diff --git a/.claude/skills/atterm-map/SKILL.md b/.claude/skills/atterm-map/SKILL.md index 6818078e..5379494c 100644 --- a/.claude/skills/atterm-map/SKILL.md +++ b/.claude/skills/atterm-map/SKILL.md @@ -80,6 +80,8 @@ description: atterm 仓库导航——某个功能/场景要改哪些文件, - `ATTERM_RATE_LIMIT_PER_MINUTE` / `ATTERM_MAX_CONNECTIONS_PER_KEY`:限额;`0` 默认值、负数禁用。**per-instance**(不 DB-backed),改后需重启该实例 - `ATTERM_RELAY_DEBUG` / `ATTERM_RELAY_DEBUG_PAYLOAD`:详细日志(现在 Admin → Config 也能热开关);开启即无条件输出 `[relay-debug]`,不受下面的级别阈值限制 - `ATTERM_RELAY_LOG_LEVEL` / `--log-level`:写到 stderr 的最低级别 `DEBUG|INFO|WARN|ERROR`(默认 `INFO`)。`--debug` 会把它压到 `DEBUG` +- `ATTERM_DIRECT_SIGNAL_ENABLED` / `--direct-signal`:启用 v0.6 beta WebRTC direct signaling broker;默认关闭,per-instance,改后需重启该实例 +- `ATTERM_DIRECT_P2P`:桌面端启用 v0.6 beta 直连 host rollout;默认关闭,当前开发阶段仅作灰度开关,正式用户偏好和 client 接入在后续 Stage 1 版本加入 其它: - `ATTERM_RELAY_URL` / `ATTERM_RELAY_TOKEN`:桌面 app 首次启动时若无配置文件,从这俩 env 读初始值 diff --git a/cmd/atterm-relay/main.go b/cmd/atterm-relay/main.go index 0a55dfc2..5648fe55 100644 --- a/cmd/atterm-relay/main.go +++ b/cmd/atterm-relay/main.go @@ -44,6 +44,7 @@ func main() { maxConns := flag.Int("max-connections-per-key", envInt("ATTERM_MAX_CONNECTIONS_PER_KEY", 0), "active websocket limit per remote IP/token; 0=default, negative=disable") debug := flag.Bool("debug", debugDefault, "enable verbose relay interaction logs (or ATTERM_RELAY_DEBUG=1)") debugPayload := flag.Bool("debug-payload", debugPayloadDefault, "include IN/OUT byte contents in debug logs (or ATTERM_RELAY_DEBUG_PAYLOAD=1)") + directSignal := flag.Bool("direct-signal", envEnabled("ATTERM_DIRECT_SIGNAL_ENABLED"), "enable the beta WebRTC direct signaling broker (or ATTERM_DIRECT_SIGNAL_ENABLED=1)") devInsecure := flag.Bool("dev-insecure", false, "allow insecure public relay settings (unbootstrapped admin); development/private networks only") logLevel := flag.String("log-level", envOr("ATTERM_RELAY_LOG_LEVEL", "INFO"), "minimum log level written to stderr: DEBUG|INFO|WARN|ERROR (or ATTERM_RELAY_LOG_LEVEL)") flag.Parse() @@ -204,6 +205,7 @@ func main() { BootstrapAdminEmail: bootstrapEmail, RealmID: realmID, InstancePublicURL: instancePublicURL, + DirectSignalEnabled: *directSignal, } // VAPID subject is consumed once here; changing it later needs a restart. diff --git a/desktop/app.go b/desktop/app.go index 25a77a78..12d897ee 100644 --- a/desktop/app.go +++ b/desktop/app.go @@ -218,7 +218,11 @@ type RelayConfig struct { // desktop build has no relay baseURL in localStorage at all. Read-only; // empty if the proxy is unavailable. The frontend appends "/relay-http". RemoteHTTPProxyURL string `json:"remote_http_proxy_url"` - Paused bool `json:"paused"` + // HomeInstanceURL is the public Relay node selected for this user. The + // frontend uses it only for direct signaling; terminal /client traffic + // continues through RemoteProxyURL in the Wails build. + HomeInstanceURL string `json:"home_instance_url"` + Paused bool `json:"paused"` } type LoggingConfig struct { @@ -368,6 +372,11 @@ type App struct { accountKeyMu sync.Mutex accountKey []byte + // nativeDirect owns Wails-side Pion client attempts. The browser transport + // remains in use on Web/Capacitor; desktop attempts never depend on WebKit. + nativeDirectMu sync.Mutex + nativeDirect map[string]*nativeDirectClient + startupFatalMu sync.RWMutex startupFatal StartupError @@ -592,6 +601,7 @@ func (a *App) startup(ctx context.Context) { // shutdown is called when the window is closed; clean up PTYs and HTTP server. func (a *App) shutdown(ctx context.Context) { a.servicePreviews.stopAll() + a.stopNativeDirectClients() a.mu.Lock() if a.uplinkCancel != nil { a.uplinkCancel() @@ -645,6 +655,7 @@ func (a *App) shutdown(ctx context.Context) { // the uplink and the Feishu integration mode. Caller need not hold a.mu. func (a *App) applyRelayConfig(cfg appConfig) { a.servicePreviews.stopAll() + a.stopNativeDirectClients() a.applyRelayUplink(cfg) a.applyRelayPrefsWatch(cfg) // Feishu mode follows the relay login state: relay when logged in, local @@ -696,6 +707,7 @@ func (a *App) applyRelayUplink(cfg appConfig) { a.uplinkCancel = cancel dialURL := uplinkDialURL(cfg.RelayHomeInstanceURL, cfg.RelayURL) a.uplink = newUplink(dialURL, cfg.RelaySessionToken, cfg.RemotePermissionOrDefault(), a.host, a.recordRelayError, a.agentSealAccountKey, cfg.AllowInsecureRelay) + a.uplink.directEnabled = cfg.DirectP2PEnabled || envEnabled("ATTERM_DIRECT_P2P") go a.uplink.Run(uplinkCtx) logInfo("uplink", "configured for %s", dialURL) } @@ -783,6 +795,7 @@ func (a *App) GetRelayConfig() RelayConfig { Paused: cfg.RelayPaused, RemoteProxyURL: a.remoteProxy.wsURL(), RemoteHTTPProxyURL: a.remoteProxy.httpURL(), + HomeInstanceURL: cfg.RelayHomeInstanceURL, } } @@ -1759,6 +1772,35 @@ func (a *App) SetWebglRendererEnabled(enabled bool) error { return a.cfgStore.Set(cfg) } +// GetDirectP2PEnabled reports whether this device should attempt and accept +// Relay-assisted direct terminal routes. The environment switch remains a +// deployment-level force-on override for staged builds. +func (a *App) GetDirectP2PEnabled() bool { + if envEnabled("ATTERM_DIRECT_P2P") { + return true + } + return a.cfgStore != nil && a.cfgStore.Get().DirectP2PEnabled +} + +// SetDirectP2PEnabled persists the per-device beta preference. Re-applying the +// Relay config restarts the uplink so its direct host listener follows the new +// value immediately; local PTYs remain independent and keep running. +func (a *App) SetDirectP2PEnabled(enabled bool) error { + if a.cfgStore == nil { + return fmt.Errorf("config store unavailable") + } + cfg := a.cfgStore.Get() + if cfg.DirectP2PEnabled == enabled { + return nil + } + cfg.DirectP2PEnabled = enabled + if err := a.cfgStore.Set(cfg); err != nil { + return err + } + a.applyRelayConfig(cfg) + return nil +} + // GetNotificationsEnabled returns the current persisted preference. // Defaults to true for fresh installs. func (a *App) GetNotificationsEnabled() bool { diff --git a/desktop/app_direct_p2p_test.go b/desktop/app_direct_p2p_test.go new file mode 100644 index 00000000..52b6bcd1 --- /dev/null +++ b/desktop/app_direct_p2p_test.go @@ -0,0 +1,43 @@ +package main + +import "testing" + +func TestDirectP2PPreferenceDefaultsOffAndControlsUplink(t *testing.T) { + a := newRelayTestApp(t) + if a.GetDirectP2PEnabled() { + t.Fatal("direct P2P must default off") + } + if err := a.cfgStore.Set(appConfig{ + RelayURL: "wss://relay.example", + RelaySessionToken: "atk_direct_test", + RemotePermission: "full", + }); err != nil { + t.Fatal(err) + } + if err := a.SetDirectP2PEnabled(true); err != nil { + t.Fatalf("SetDirectP2PEnabled(true): %v", err) + } + if !a.cfgStore.Get().DirectP2PEnabled || !a.GetDirectP2PEnabled() { + t.Fatal("enabled preference was not persisted") + } + a.mu.Lock() + uplink := a.uplink + a.mu.Unlock() + if uplink == nil || !uplink.directEnabled { + t.Fatal("restarted uplink did not enable direct host transport") + } + if err := a.SetDirectP2PEnabled(false); err != nil { + t.Fatalf("SetDirectP2PEnabled(false): %v", err) + } + if a.GetDirectP2PEnabled() || a.cfgStore.Get().DirectP2PEnabled { + t.Fatal("disabled preference was not persisted") + } +} + +func TestDirectP2PEnvironmentOverrideForcesOn(t *testing.T) { + t.Setenv("ATTERM_DIRECT_P2P", "1") + a := newRelayTestApp(t) + if !a.GetDirectP2PEnabled() { + t.Fatal("ATTERM_DIRECT_P2P must force the rollout preference on") + } +} diff --git a/desktop/app_login_test.go b/desktop/app_login_test.go index c6c941ad..1a821796 100644 --- a/desktop/app_login_test.go +++ b/desktop/app_login_test.go @@ -115,6 +115,28 @@ func TestLoginRemoteRelay_WrongPasswordReturnsError(t *testing.T) { } } +func TestRemoteRelayAuthRejectsPublicCleartextBeforeDial(t *testing.T) { + app := &App{ctx: context.Background()} + for _, tc := range []struct { + name string + call func() error + }{ + {name: "login", call: func() error { + return app.LoginRemoteRelay("http://relay.example.com", "u@example.com", "password", false) + }}, + {name: "register", call: func() error { + return app.RegisterRemoteRelay("http://relay.example.com", "u@example.com", "password", "", false) + }}, + } { + t.Run(tc.name, func(t *testing.T) { + err := tc.call() + if err == nil || !strings.Contains(err.Error(), "insecure relay url") { + t.Fatalf("expected insecure relay rejection before dialing; got %v", err) + } + }) + } +} + // TestRegisterRemoteRelay_PersistsAndUnlocksKey covers the happy register // path: URL + email + token persisted, account_key unlocked into memory. func TestRegisterRemoteRelay_PersistsAndUnlocksKey(t *testing.T) { diff --git a/desktop/app_probe_test.go b/desktop/app_probe_test.go index 1781b434..cc02b5a6 100644 --- a/desktop/app_probe_test.go +++ b/desktop/app_probe_test.go @@ -68,3 +68,11 @@ func TestProbeRelayVersion_EmptyURL(t *testing.T) { t.Fatalf("expected empty-url error; got %v", err) } } + +func TestProbeRelayVersion_RejectsPublicCleartextWithoutOptIn(t *testing.T) { + app := &App{ctx: context.Background()} + err := app.ProbeRelayVersion("http://relay.example.com", false) + if err == nil || !strings.Contains(err.Error(), "insecure relay url") { + t.Fatalf("expected insecure relay rejection before dialing; got %v", err) + } +} diff --git a/desktop/app_relay.go b/desktop/app_relay.go index 43d17634..0768857d 100644 --- a/desktop/app_relay.go +++ b/desktop/app_relay.go @@ -39,6 +39,9 @@ func (a *App) LoginRemoteRelay(relayURL, email, password string, allowInsecure b if err != nil { return err } + if err := validateRelayEndpoint(wsURL, allowInsecure); err != nil { + return err + } ctx := a.ctx if ctx == nil { ctx = context.Background() @@ -120,6 +123,9 @@ func (a *App) RegisterRemoteRelay(relayURL, email, password, claimToken string, if err != nil { return err } + if err := validateRelayEndpoint(wsURL, allowInsecure); err != nil { + return err + } ctx := a.ctx if ctx == nil { ctx = context.Background() @@ -224,10 +230,13 @@ func (a *App) ProbeRelayVersion(relayURL string, allowInsecure bool) error { if relayURL == "" { return fmt.Errorf("relay url is empty") } - httpURL, _, err := relayLoginEndpoints(relayURL) + httpURL, wsURL, err := relayLoginEndpoints(relayURL) if err != nil { return fmt.Errorf("invalid relay url: %w", err) } + if err := validateRelayEndpoint(wsURL, allowInsecure); err != nil { + return err + } ctx := a.ctx if ctx == nil { ctx = context.Background() diff --git a/desktop/app_test.go b/desktop/app_test.go index d1e38b9a..8f1e5835 100644 --- a/desktop/app_test.go +++ b/desktop/app_test.go @@ -27,6 +27,20 @@ func newRelayTestApp(t *testing.T) *App { return a } +func TestGetRelayConfigExposesDirectSignalHomeInstance(t *testing.T) { + a := newRelayTestApp(t) + if err := a.cfgStore.Set(appConfig{ + RelayURL: "wss://relay.example", + RelaySessionToken: "atk_test", + RelayHomeInstanceURL: "https://home.example.com", + }); err != nil { + t.Fatal(err) + } + if got := a.GetRelayConfig().HomeInstanceURL; got != "https://home.example.com" { + t.Fatalf("HomeInstanceURL = %q; want https://home.example.com", got) + } +} + // TestSetUplinkPaused_TogglesWithoutWipingConfig verifies the // "disconnect erases config" fix: pausing/unpausing via SetUplinkPaused // must not touch the persisted URL/token, only the pause flag. diff --git a/desktop/config.go b/desktop/config.go index 3424569c..38f2d6b8 100644 --- a/desktop/config.go +++ b/desktop/config.go @@ -183,6 +183,11 @@ type appConfig struct { // on macOS/Windows so the #33 light-theme ghosting fix stays active. WebglRendererEnabled *bool `json:"webgl_renderer_enabled,omitempty"` + // DirectP2PEnabled opts this device into the beta Relay-assisted direct + // terminal route. It gates both client upgrade attempts and this desktop's + // direct host listener; false keeps the established Relay-only behavior. + DirectP2PEnabled bool `json:"direct_p2p_enabled,omitempty"` + // Plugins is the plugin-system block. Defaults filled in on first run. Plugins PluginConfig `json:"plugins"` diff --git a/desktop/direct_signal_client.go b/desktop/direct_signal_client.go new file mode 100644 index 00000000..671efb65 --- /dev/null +++ b/desktop/direct_signal_client.go @@ -0,0 +1,452 @@ +package main + +import ( + "context" + "encoding/base64" + "encoding/binary" + "encoding/json" + "errors" + "fmt" + "net/http" + "strings" + "sync" + "time" + + "github.com/attson/atterm/internal/directsignal" + "github.com/attson/atterm/internal/e2eecrypto" + "github.com/attson/atterm/internal/peertransport" + "github.com/google/uuid" + "github.com/pion/webrtc/v4" + "nhooyr.io/websocket" +) + +const ( + nativeDirectMaxAttempts = 16 + nativeDirectTimeout = 30 * time.Second +) + +// NativeDirectStartRequest identifies one frontend SessionConnection. Relay +// credentials and account_key are intentionally read from App state in Go. +type NativeDirectStartRequest struct { + ID string `json:"id"` + SessionID string `json:"session_id"` + SinceSeq uint64 `json:"since_seq"` + ClientInstanceID string `json:"client_instance_id"` +} + +// NativeDirectEvent is the small event surface consumed by the Wails adapter. +// Frames use base64 so Wails JSON cannot reinterpret arbitrary bytes as text. +type NativeDirectEvent struct { + Kind string `json:"kind"` + FrameBase64 string `json:"frame_base64,omitempty"` + LastReplayedSeq uint64 `json:"last_replayed_seq,omitempty"` + ICEState string `json:"ice_state,omitempty"` + CandidateType string `json:"candidate_type,omitempty"` + Error string `json:"error,omitempty"` +} + +type nativeDirectClient struct { + id string + app *App + ctx context.Context + cancel context.CancelFunc + relayURL string + token string + allowInsecure bool + sessionID uuid.UUID + sinceSeq uint64 + clientInstanceID string + accountKey []byte + webrtcConfig webrtc.Configuration + + mu sync.Mutex + writeMu sync.Mutex + conn *websocket.Conn + attempt *peertransport.PionClientAttempt + channel *peertransport.PionClientChannel + authenticated bool + stopped bool + closeOnce sync.Once +} + +func (a *App) StartNativeDirect(req NativeDirectStartRequest) error { + if a == nil || a.cfgStore == nil || a.ctx == nil { + return errors.New("native direct client unavailable") + } + id, err := uuid.Parse(req.ID) + if err != nil || id == uuid.Nil { + return errors.New("invalid native direct attempt id") + } + sessionID, err := uuid.Parse(req.SessionID) + if err != nil || sessionID == uuid.Nil { + return errors.New("invalid native direct session id") + } + if strings.TrimSpace(req.ClientInstanceID) == "" || len(req.ClientInstanceID) > 128 { + return errors.New("invalid native direct client instance id") + } + cfg := a.cfgStore.Get() + if !(cfg.DirectP2PEnabled || envEnabled("ATTERM_DIRECT_P2P")) { + return errors.New("native direct connection preference disabled") + } + if cfg.RelaySessionToken == "" || cfg.RelayPaused { + return errors.New("native direct relay session unavailable") + } + relayURL := strings.TrimRight(uplinkDialURL(cfg.RelayHomeInstanceURL, cfg.RelayURL), "/") + if err := validateRelayEndpoint(relayURL, cfg.AllowInsecureRelay); err != nil { + return err + } + accountKey := a.accountKeyForSync() + if len(accountKey) != e2eecrypto.SessionKeySize { + return errors.New("native direct account key unavailable") + } + ctx, cancel := context.WithCancel(a.ctx) + client := &nativeDirectClient{ + id: id.String(), + app: a, + ctx: ctx, + cancel: cancel, + relayURL: relayURL, + token: cfg.RelaySessionToken, + allowInsecure: cfg.AllowInsecureRelay, + sessionID: sessionID, + sinceSeq: req.SinceSeq, + clientInstanceID: req.ClientInstanceID, + accountKey: accountKey, + webrtcConfig: webrtc.Configuration{ICEServers: []webrtc.ICEServer{{ + URLs: []string{"stun:stun.cloudflare.com:3478"}, + }}}, + } + a.nativeDirectMu.Lock() + if a.nativeDirect == nil { + a.nativeDirect = make(map[string]*nativeDirectClient) + } + if _, exists := a.nativeDirect[client.id]; exists || len(a.nativeDirect) >= nativeDirectMaxAttempts { + a.nativeDirectMu.Unlock() + cancel() + clearBytes(accountKey) + return errors.New("native direct attempt limit or duplicate") + } + a.nativeDirect[client.id] = client + a.nativeDirectMu.Unlock() + go func() { + if err := client.run(); err != nil { + client.fail(err) + } + }() + return nil +} + +func (a *App) SendNativeDirectFrame(id string, frame []byte) error { + client := a.nativeDirectClient(id) + if client == nil { + return errors.New("native direct attempt unavailable") + } + return client.sendFrame(frame) +} + +func (a *App) StopNativeDirect(id string) { + if client := a.nativeDirectClient(id); client != nil { + client.stop() + } +} + +func (a *App) nativeDirectClient(id string) *nativeDirectClient { + a.nativeDirectMu.Lock() + defer a.nativeDirectMu.Unlock() + return a.nativeDirect[id] +} + +func (a *App) stopNativeDirectClients() { + a.nativeDirectMu.Lock() + clients := make([]*nativeDirectClient, 0, len(a.nativeDirect)) + for _, client := range a.nativeDirect { + clients = append(clients, client) + } + a.nativeDirectMu.Unlock() + for _, client := range clients { + client.stop() + } +} + +func (c *nativeDirectClient) run() error { + dialCtx, cancelDial := context.WithTimeout(c.ctx, directHostDialTimeout) + headers := http.Header{} + headers.Set("Authorization", "Bearer "+c.token) + opts := &websocket.DialOptions{HTTPHeader: headers} + if c.allowInsecure { + opts.HTTPClient = relayHTTPClient(true, 0) + } + conn, _, err := websocket.Dial(dialCtx, c.relayURL+"/direct-signal", opts) + cancelDial() + if err != nil { + return fmt.Errorf("native direct signaling dial: %w", err) + } + c.mu.Lock() + c.conn = conn + c.mu.Unlock() + defer conn.Close(websocket.StatusNormalClosure, "") + conn.SetReadLimit(64 * 1024) + if err := c.sendSignal(directsignal.Message{ + Kind: "hello", + Role: "client", + ClientInstanceID: c.clientInstanceID, + }); err != nil { + return err + } + helloCtx, cancelHello := context.WithTimeout(c.ctx, directHostHelloTimeout) + hello, err := readDirectSignalHost(helloCtx, conn) + cancelHello() + if err != nil { + return err + } + if hello.Version != directsignal.Version || hello.Kind != "hello_ok" { + return errors.New("native direct signaling rejected client hello") + } + requestID := uuid.NewString() + if err := c.sendSignal(directsignal.Message{ + Kind: "direct_request", + RequestID: requestID, + SessionID: c.sessionID.String(), + ClientInstanceID: c.clientInstanceID, + SinceSeq: c.sinceSeq, + }); err != nil { + return err + } + timer := time.AfterFunc(nativeDirectTimeout, func() { + c.fail(errors.New("native direct attempt timed out")) + }) + defer timer.Stop() + for c.ctx.Err() == nil { + message, err := readDirectSignalHost(c.ctx, conn) + if err != nil { + return err + } + if message.Version != directsignal.Version { + continue + } + switch message.Kind { + case "direct_attempt": + if message.RequestID != requestID { + return errors.New("native direct request id mismatch") + } + if err := c.startAttempt(message); err != nil { + return err + } + case "signal": + c.mu.Lock() + attempt := c.attempt + c.mu.Unlock() + if attempt == nil { + return errors.New("native direct signal before authorization") + } + if err := attempt.HandleSignal(message.SignalType, message.Payload); err != nil { + return err + } + case "consumed", "host_registered": + case "cancel": + return fmt.Errorf("native direct attempt cancelled: %s", message.Code) + case "error": + return fmt.Errorf("native direct signaling rejected: %s", message.Code) + default: + return fmt.Errorf("unexpected native direct signal: %s", message.Kind) + } + } + return c.ctx.Err() +} + +func (c *nativeDirectClient) startAttempt(message directsignal.Message) error { + c.mu.Lock() + if c.attempt != nil { + c.mu.Unlock() + return errors.New("duplicate native direct attempt") + } + c.mu.Unlock() + attemptID, err := uuid.Parse(message.AttemptID) + if err != nil { + return errors.New("invalid native direct attempt authorization") + } + ticket, err := base64.RawURLEncoding.DecodeString(message.Ticket) + if err != nil || len(ticket) != 32 || message.SessionID != c.sessionID.String() || + message.ClientInstanceID != c.clientInstanceID || message.ExpiresAtUnixM <= time.Now().UnixMilli() { + return errors.New("invalid native direct authorization claims") + } + permission, ok := directTransportPermission(message.Permission) + if !ok { + return errors.New("invalid native direct permission") + } + auth, err := peertransport.NewAccountKeyAuthenticator(c.accountKey) + if err != nil { + return err + } + attempt, err := peertransport.NewPionClientAttempt(c.ctx, peertransport.PionClientConfig{ + Authorization: peertransport.Authorization{ + AttemptID: attemptID, + Ticket: ticket, + SessionID: c.sessionID, + UserID: message.UserID, + HostID: message.HostID, + ClientInstanceID: c.clientInstanceID, + Permission: permission, + ExpiresAtUnixMillis: uint64(message.ExpiresAtUnixM), + }, + Authenticator: auth, + WebRTC: c.webrtcConfig, + SendSignal: func(signalType, payload string) error { + return c.sendSignal(directsignal.Message{ + Kind: "signal", + AttemptID: attemptID.String(), + SignalType: signalType, + Payload: payload, + }) + }, + OnAuthenticated: func(channel *peertransport.PionClientChannel) { + c.mu.Lock() + if c.stopped { + c.mu.Unlock() + _ = channel.Close() + return + } + c.channel = channel + c.authenticated = true + c.mu.Unlock() + clearBytes(c.accountKey) + c.emit(NativeDirectEvent{Kind: "authenticated"}) + }, + OnRecord: c.handleRecord, + OnDiagnostics: func(iceState, candidateType string) { + c.emit(NativeDirectEvent{Kind: "diagnostics", ICEState: iceState, CandidateType: candidateType}) + }, + OnClosed: func(closeErr error) { + if closeErr != nil && c.ctx.Err() == nil { + c.fail(closeErr) + } + }, + }) + if err != nil { + return err + } + c.mu.Lock() + c.attempt = attempt + c.mu.Unlock() + if err := attempt.Start(); err != nil { + return err + } + return nil +} + +func (c *nativeDirectClient) handleRecord(kind peertransport.RecordKind, payload []byte) { + switch kind { + case peertransport.RecordFrame: + c.emit(NativeDirectEvent{Kind: "frame", FrameBase64: base64.StdEncoding.EncodeToString(payload)}) + case peertransport.RecordDirectReady: + if len(payload) != 8 { + c.fail(errors.New("invalid native direct ready payload")) + return + } + c.emit(NativeDirectEvent{Kind: "ready", LastReplayedSeq: binary.BigEndian.Uint64(payload)}) + case peertransport.RecordPing: + if len(payload) != 8 { + c.fail(errors.New("invalid native direct ping payload")) + return + } + c.mu.Lock() + channel := c.channel + c.mu.Unlock() + if channel != nil { + if err := channel.SendRecord(c.ctx, peertransport.RecordPong, payload); err != nil { + c.fail(err) + } + } + case peertransport.RecordPong: + if len(payload) != 8 { + c.fail(errors.New("invalid native direct pong payload")) + } + case peertransport.RecordClose: + c.fail(errors.New("native direct peer closed route")) + default: + c.fail(fmt.Errorf("unsupported native direct record kind %d", kind)) + } +} + +func (c *nativeDirectClient) sendFrame(frame []byte) error { + c.mu.Lock() + channel := c.channel + authenticated := c.authenticated + stopped := c.stopped + c.mu.Unlock() + if stopped || !authenticated || channel == nil { + return errors.New("native direct channel unavailable") + } + return channel.SendFrame(c.ctx, frame) +} + +func (c *nativeDirectClient) sendSignal(message directsignal.Message) error { + c.mu.Lock() + conn := c.conn + c.mu.Unlock() + if conn == nil { + return errors.New("native direct signaling unavailable") + } + message.Version = directsignal.Version + data, err := json.Marshal(message) + if err != nil { + return err + } + c.writeMu.Lock() + defer c.writeMu.Unlock() + writeCtx, cancel := context.WithTimeout(c.ctx, directHostWriteTimeout) + defer cancel() + return conn.Write(writeCtx, websocket.MessageText, data) +} + +func (c *nativeDirectClient) emit(event NativeDirectEvent) { + if c.app.eventsEmitter != nil { + c.app.eventsEmitter(c.app.ctx, "native-direct:event:"+c.id, event) + } +} + +func (c *nativeDirectClient) fail(err error) { + c.finish(err, true) +} + +func (c *nativeDirectClient) stop() { + c.finish(nil, false) +} + +func (c *nativeDirectClient) finish(err error, emitFailure bool) { + c.closeOnce.Do(func() { + c.mu.Lock() + c.stopped = true + conn := c.conn + attempt := c.attempt + authenticated := c.authenticated + c.channel = nil + c.mu.Unlock() + if emitFailure && authenticated && conn != nil { + _ = c.sendSignal(directsignal.Message{Kind: "direct_result", Code: "route_lost"}) + } + c.mu.Lock() + c.conn = nil + c.mu.Unlock() + c.cancel() + if attempt != nil { + _ = attempt.Close() + } + if conn != nil { + _ = conn.Close(websocket.StatusNormalClosure, "") + } + clearBytes(c.accountKey) + c.app.nativeDirectMu.Lock() + delete(c.app.nativeDirect, c.id) + c.app.nativeDirectMu.Unlock() + if emitFailure && err != nil { + c.emit(NativeDirectEvent{Kind: "failure", Error: err.Error()}) + } + }) +} + +func clearBytes(value []byte) { + for i := range value { + value[i] = 0 + } +} diff --git a/desktop/direct_signal_client_test.go b/desktop/direct_signal_client_test.go new file mode 100644 index 00000000..05d6e812 --- /dev/null +++ b/desktop/direct_signal_client_test.go @@ -0,0 +1,243 @@ +package main + +import ( + "bytes" + "context" + "encoding/base64" + "encoding/json" + "fmt" + "net/http" + "net/http/httptest" + "strings" + "sync" + "testing" + "time" + + "github.com/attson/atterm/internal/directsignal" + "github.com/attson/atterm/internal/e2eecrypto" + "github.com/attson/atterm/internal/proto" + "github.com/google/uuid" + "github.com/pion/webrtc/v4" + "nhooyr.io/websocket" +) + +type directTestPeer struct { + conn *websocket.Conn + out chan directsignal.Message + in chan directsignal.Message +} + +type directTestBroker struct { + ctx context.Context + hostID string + session uuid.UUID + userID string + ticket []byte + host chan *directTestPeer + client chan *directTestPeer + errors chan error + startOne sync.Once +} + +func newDirectTestBroker(ctx context.Context, hostID string, sessionID uuid.UUID) *directTestBroker { + return &directTestBroker{ + ctx: ctx, hostID: hostID, session: sessionID, userID: "native-user", + ticket: bytes.Repeat([]byte{0x5a}, 32), host: make(chan *directTestPeer, 1), + client: make(chan *directTestPeer, 1), errors: make(chan error, 8), + } +} + +func (b *directTestBroker) ServeHTTP(w http.ResponseWriter, r *http.Request) { + if r.URL.Path != "/direct-signal" || r.Header.Get("Authorization") != "Bearer native-token" { + http.Error(w, "unauthorized", http.StatusUnauthorized) + return + } + conn, err := websocket.Accept(w, r, nil) + if err != nil { + return + } + peer := &directTestPeer{conn: conn, out: make(chan directsignal.Message, 32), in: make(chan directsignal.Message, 32)} + hello, err := readDirectSignalHost(b.ctx, conn) + if err != nil { + b.report(err) + return + } + if hello.Kind != "hello" { + b.report(fmt.Errorf("unexpected hello: %+v", hello)) + return + } + if err := writeDirectSignalHost(b.ctx, conn, directsignal.Message{Version: directsignal.Version, Kind: "hello_ok"}); err != nil { + b.report(err) + return + } + switch hello.Role { + case "host": + b.host <- peer + case "client": + b.client <- peer + default: + b.report(fmt.Errorf("unexpected role %q", hello.Role)) + return + } + b.startOne.Do(func() { go b.route() }) + go func() { + for { + select { + case <-b.ctx.Done(): + return + case message := <-peer.out: + if err := writeDirectSignalHost(b.ctx, conn, message); err != nil { + b.report(err) + return + } + } + } + }() + for b.ctx.Err() == nil { + message, err := readDirectSignalHost(b.ctx, conn) + if err != nil { + return + } + peer.in <- message + } +} + +func (b *directTestBroker) route() { + var host, client *directTestPeer + select { + case <-b.ctx.Done(): + return + case host = <-b.host: + } + select { + case <-b.ctx.Done(): + return + case client = <-b.client: + } + var request directsignal.Message + select { + case <-b.ctx.Done(): + return + case request = <-client.in: + } + if request.Kind != "direct_request" || request.SessionID != b.session.String() { + b.report(fmt.Errorf("unexpected direct request: %+v", request)) + return + } + attempt := directsignal.Message{ + Version: directsignal.Version, Kind: "direct_attempt", RequestID: request.RequestID, + AttemptID: uuid.NewString(), Ticket: base64.RawURLEncoding.EncodeToString(b.ticket), + SessionID: b.session.String(), SinceSeq: request.SinceSeq, UserID: b.userID, + HostID: b.hostID, ClientInstanceID: request.ClientInstanceID, + Permission: proto.RemotePermissionFull, ExpiresAtUnixM: time.Now().Add(time.Minute).UnixMilli(), + } + host.out <- attempt + client.out <- attempt + for { + select { + case <-b.ctx.Done(): + return + case message := <-host.in: + if message.Kind == "signal" || message.Kind == "consumed" || message.Kind == "cancel" { + client.out <- message + } + case message := <-client.in: + if message.Kind == "signal" || message.Kind == "cancel" { + host.out <- message + } + } + } +} + +func (b *directTestBroker) report(err error) { + select { + case b.errors <- err: + default: + } +} + +func TestNativeDirectClientConnectsToDesktopPionHost(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + host := newTestRelayHost(t) + sessionID := uuid.New() + sess := addDirectTestSession(t, host, sessionID) + sess.PushOut(1, []byte("native output")) + accountKey := bytes.Repeat([]byte{0x68}, e2eecrypto.SessionKeySize) + broker := newDirectTestBroker(ctx, host.hostID, sessionID) + server := httptest.NewServer(broker) + defer server.Close() + relayURL := "ws" + strings.TrimPrefix(server.URL, "http") + + directHost := newDirectSignalHost(relayURL, "native-token", proto.RemotePermissionFull, host, func() []byte { return accountKey }, false) + directHost.webrtcConfig = webrtc.Configuration{} + hostErr := make(chan error, 1) + go func() { hostErr <- directHost.runOnce(ctx) }() + defer directHost.closeAllAttempts() + + events := make(chan NativeDirectEvent, 32) + app := &App{ctx: ctx, nativeDirect: make(map[string]*nativeDirectClient)} + app.eventsEmitter = func(_ context.Context, _ string, data ...interface{}) { + if len(data) == 1 { + if event, ok := data[0].(NativeDirectEvent); ok { + events <- event + } + } + } + clientCtx, clientCancel := context.WithCancel(ctx) + client := &nativeDirectClient{ + id: uuid.NewString(), app: app, ctx: clientCtx, cancel: clientCancel, + relayURL: relayURL, token: "native-token", sessionID: sessionID, + clientInstanceID: "native-client", accountKey: append([]byte(nil), accountKey...), + webrtcConfig: webrtc.Configuration{}, + } + app.nativeDirect[client.id] = client + clientErr := make(chan error, 1) + go func() { clientErr <- client.run() }() + defer client.stop() + + var gotAuthenticated, gotReady, sentInput bool + for !gotAuthenticated || !gotReady || !sentInput { + select { + case <-ctx.Done(): + t.Fatal(ctx.Err()) + case err := <-broker.errors: + t.Fatal(err) + case err := <-clientErr: + if err != nil { + t.Fatal(err) + } + case err := <-hostErr: + if err != nil && ctx.Err() == nil { + t.Fatal(err) + } + case event := <-events: + switch event.Kind { + case "failure": + t.Fatal(event.Error) + case "authenticated": + gotAuthenticated = true + case "ready": + if event.LastReplayedSeq != 1 { + t.Fatalf("ready seq=%d", event.LastReplayedSeq) + } + gotReady = true + claim, _ := json.Marshal(proto.ClaimDriverPayload{ClientID: "native-client", ClientName: "native"}) + if err := client.sendFrame(proto.Marshal(proto.Frame{Type: proto.TypeClaimDriver, SessionID: sessionID, Payload: claim})); err != nil { + t.Fatal(err) + } + if err := client.sendFrame(proto.Marshal(proto.Frame{Type: proto.TypeIn, SessionID: sessionID, Payload: []byte("native input")})); err != nil { + t.Fatal(err) + } + case "frame": + if event.FrameBase64 == "" { + t.Fatal("empty native frame") + } + } + case frame := <-sess.Inbound(): + if frame.Type == proto.TypeIn && bytes.Equal(frame.Payload, []byte("native input")) { + sentInput = true + } + } + } +} diff --git a/desktop/direct_signal_host.go b/desktop/direct_signal_host.go new file mode 100644 index 00000000..680be3c8 --- /dev/null +++ b/desktop/direct_signal_host.go @@ -0,0 +1,714 @@ +package main + +import ( + "context" + "encoding/base64" + "encoding/binary" + "encoding/json" + "errors" + "fmt" + "net/http" + "sort" + "strings" + "sync" + "time" + + "github.com/attson/atterm/internal/directsignal" + "github.com/attson/atterm/internal/e2eecrypto" + "github.com/attson/atterm/internal/peertransport" + "github.com/attson/atterm/internal/proto" + "github.com/attson/atterm/internal/session" + "github.com/google/uuid" + "github.com/pion/webrtc/v4" + "nhooyr.io/websocket" +) + +const ( + directHostSignalQueueDepth = 128 + directHostDialTimeout = 10 * time.Second + directHostWriteTimeout = 10 * time.Second + directHostHelloTimeout = 10 * time.Second + directStatsReportThreshold = 256 << 10 + directStatsReportInterval = 5 * time.Second +) + +type directSignalHost struct { + relayURL string + token string + permission string + host *relayHost + accountKey func() []byte + allowInsecure bool + webrtcConfig webrtc.Configuration + + mu sync.Mutex + attempts map[uuid.UUID]*directHostAttempt +} + +type directHostAttempt struct { + id uuid.UUID + sessionID uuid.UUID + sinceSeq uint64 + permission string + clientInstanceID string + host *directSignalHost + mu sync.Mutex + transport *peertransport.PionHostAttempt + channel *peertransport.PionHostChannel + sub *session.Subscriber + subscribedSession *session.Session + streamCancel context.CancelFunc + consumed bool + closed bool + closeOnce sync.Once + reportBytes func(uint64, uint64) error + statsReportInterval time.Duration + pendingBytesSent uint64 + pendingBytesRecv uint64 +} + +func newDirectSignalHost(relayURL, token, permission string, host *relayHost, accountKey func() []byte, allowInsecure bool) *directSignalHost { + return &directSignalHost{ + relayURL: strings.TrimRight(relayURL, "/"), + token: token, + permission: normalizeRemotePermission(permission), + host: host, + accountKey: accountKey, + allowInsecure: allowInsecure, + webrtcConfig: webrtc.Configuration{ICEServers: []webrtc.ICEServer{{ + URLs: []string{"stun:stun.cloudflare.com:3478"}, + }}}, + attempts: make(map[uuid.UUID]*directHostAttempt), + } +} + +func (h *directSignalHost) Run(ctx context.Context) { + defer h.closeAllAttempts() + backoff := 500 * time.Millisecond + for ctx.Err() == nil { + err := h.runOnce(ctx) + if ctx.Err() != nil { + return + } + if err != nil { + logWarn("direct", "signaling host disconnected: %v (retry in %s)", err, backoff) + } + select { + case <-ctx.Done(): + return + case <-time.After(backoff): + } + backoff *= 2 + if backoff > 8*time.Second { + backoff = 8 * time.Second + } + } +} + +func (h *directSignalHost) runOnce(ctx context.Context) error { + dialCtx, cancelDial := context.WithTimeout(ctx, directHostDialTimeout) + headers := http.Header{} + if h.token != "" { + headers.Set("Authorization", "Bearer "+h.token) + } + opts := &websocket.DialOptions{HTTPHeader: headers} + if h.allowInsecure { + opts.HTTPClient = relayHTTPClient(true, 0) + } + conn, _, err := websocket.Dial(dialCtx, h.relayURL+"/direct-signal", opts) + cancelDial() + if err != nil { + return err + } + defer conn.Close(websocket.StatusNormalClosure, "") + conn.SetReadLimit(64 * 1024) + connCtx, cancelConn := context.WithCancel(ctx) + defer cancelConn() + defer h.closePendingAttempts() + + hostID, _, _ := h.host.HostMeta() + hello := directsignal.Message{ + Version: directsignal.Version, + Kind: "hello", + Role: "host", + HostID: hostID, + SessionIDs: h.sessionIDs(), + } + if err := writeDirectSignalHost(connCtx, conn, hello); err != nil { + return err + } + helloCtx, cancelHello := context.WithTimeout(connCtx, directHostHelloTimeout) + response, err := readDirectSignalHost(helloCtx, conn) + cancelHello() + if err != nil { + return err + } + if response.Version != directsignal.Version || response.Kind != "hello_ok" { + return fmt.Errorf("direct signaling rejected host hello") + } + + out := make(chan directsignal.Message, directHostSignalQueueDepth) + send := func(message directsignal.Message) error { + message.Version = directsignal.Version + select { + case out <- message: + return nil + case <-connCtx.Done(): + return connCtx.Err() + default: + cancelConn() + return errors.New("direct signaling queue full") + } + } + writerDone := make(chan struct{}) + go func() { + defer close(writerDone) + for { + select { + case <-connCtx.Done(): + return + case message := <-out: + if err := writeDirectSignalHost(connCtx, conn, message); err != nil { + cancelConn() + return + } + } + } + }() + + changes := h.host.server.Registry().SubscribeChanges() + defer changes.Close() + go func() { + for { + select { + case <-connCtx.Done(): + return + case <-changes.C(): + if err := send(directsignal.Message{ + Kind: "host_register", + RequestID: uuid.NewString(), + HostID: hostID, + SessionIDs: h.sessionIDs(), + }); err != nil { + return + } + } + } + }() + + logInfo("direct", "signaling host registered (%d session(s))", len(hello.SessionIDs)) + for connCtx.Err() == nil { + message, err := readDirectSignalHost(connCtx, conn) + if err != nil { + cancelConn() + <-writerDone + return err + } + if message.Version != directsignal.Version { + continue + } + switch message.Kind { + case "direct_attempt": + if err := h.startAttempt(ctx, message, send); err != nil { + logWarn("direct", "attempt rejected id=%s: %v", message.AttemptID, err) + _ = send(directsignal.Message{Kind: "cancel", AttemptID: message.AttemptID, Code: "direct_unauthorized"}) + } + case "signal": + if err := h.handleSignal(message); err != nil { + logWarn("direct", "signal rejected id=%s type=%s: %v", message.AttemptID, message.SignalType, err) + _ = send(directsignal.Message{Kind: "cancel", AttemptID: message.AttemptID, Code: "ice_failed"}) + h.removeAttemptString(message.AttemptID) + } + case "cancel": + h.removeAttemptString(message.AttemptID) + case "host_registered", "error": + // Registration ACKs and per-request errors do not affect the uplink. + default: + logWarn("direct", "unexpected signaling message kind=%q", message.Kind) + } + } + <-writerDone + return connCtx.Err() +} + +func (h *directSignalHost) sessionIDs() []string { + snapshot := h.host.Snapshot() + ids := make([]string, 0, len(snapshot)) + for _, info := range snapshot { + if id, err := uuid.Parse(info.ID); err == nil { + ids = append(ids, id.String()) + } + } + sort.Strings(ids) + return ids +} + +func (h *directSignalHost) startAttempt(ctx context.Context, message directsignal.Message, send func(directsignal.Message) error) error { + attemptID, err := uuid.Parse(message.AttemptID) + if err != nil { + return errors.New("invalid attempt id") + } + sessionID, err := uuid.Parse(message.SessionID) + if err != nil { + return errors.New("invalid session id") + } + ticket, err := base64.RawURLEncoding.DecodeString(message.Ticket) + if err != nil || len(ticket) != 32 { + return errors.New("invalid direct ticket") + } + hostID, _, _ := h.host.HostMeta() + if message.HostID != hostID || message.Permission != h.permission || message.ExpiresAtUnixM <= time.Now().UnixMilli() { + return errors.New("direct claims no longer match host policy") + } + if sess, ok := h.host.server.Registry().Get(sessionID); !ok || sess.Info().HostID != hostID { + return errors.New("session is no longer local") + } + key := []byte(nil) + if h.accountKey != nil { + key = h.accountKey() + } + if len(key) != e2eecrypto.SessionKeySize { + return errors.New("account key is not unlocked") + } + auth, err := peertransport.NewAccountKeyAuthenticator(key) + if err != nil { + return err + } + permission, ok := directTransportPermission(message.Permission) + if !ok { + return errors.New("invalid direct permission") + } + entry := &directHostAttempt{ + id: attemptID, + sessionID: sessionID, + sinceSeq: message.SinceSeq, + permission: message.Permission, + clientInstanceID: message.ClientInstanceID, + host: h, + statsReportInterval: directStatsReportInterval, + reportBytes: func(sent, received uint64) error { + return send(directsignal.Message{ + Kind: "direct_stats", + BytesAvoided: sent + received, + BytesSent: sent, + BytesReceived: received, + }) + }, + } + h.mu.Lock() + if _, exists := h.attempts[attemptID]; exists || len(h.attempts) >= 8 { + h.mu.Unlock() + return errors.New("direct attempt limit or duplicate") + } + h.attempts[attemptID] = entry + h.mu.Unlock() + + transport, err := peertransport.NewPionHostAttempt(ctx, peertransport.PionHostConfig{ + Authorization: peertransport.Authorization{ + AttemptID: attemptID, + Ticket: ticket, + SessionID: sessionID, + UserID: message.UserID, + HostID: message.HostID, + ClientInstanceID: message.ClientInstanceID, + Permission: permission, + ExpiresAtUnixMillis: uint64(message.ExpiresAtUnixM), + }, + Authenticator: auth, + WebRTC: h.webrtcConfig, + SendSignal: func(signalType, payload string) error { + return send(directsignal.Message{Kind: "signal", AttemptID: attemptID.String(), SignalType: signalType, Payload: payload}) + }, + OnAuthenticated: func(channel *peertransport.PionHostChannel) { + if !entry.setAuthenticatedChannel(channel) { + _ = channel.Close() + return + } + if err := send(directsignal.Message{Kind: "consumed", AttemptID: attemptID.String()}); err != nil { + h.removeAttemptIf(attemptID, entry) + return + } + if err := entry.startStream(ctx, channel); err != nil { + logWarn("direct", "stream start failed id=%s session=%s: %v", attemptID, sessionID, err) + h.removeAttemptIf(attemptID, entry) + } + }, + OnRecord: func(kind peertransport.RecordKind, payload []byte) { + if err := entry.handleRecord(ctx, kind, payload); err != nil { + logWarn("direct", "record rejected id=%s session=%s: %v", attemptID, sessionID, err) + go h.removeAttempt(attemptID) + } + }, + OnClosed: func(error) { + h.removeAttemptIf(attemptID, entry) + }, + }) + if err != nil { + h.removeAttemptIf(attemptID, entry) + return err + } + if !entry.setTransport(transport) { + _ = transport.Close() + return errors.New("direct attempt closed during setup") + } + return nil +} + +func (h *directSignalHost) handleSignal(message directsignal.Message) error { + id, err := uuid.Parse(message.AttemptID) + if err != nil { + return errors.New("invalid attempt id") + } + h.mu.Lock() + attempt := h.attempts[id] + h.mu.Unlock() + if attempt == nil { + return errors.New("direct attempt unavailable") + } + attempt.mu.Lock() + transport := attempt.transport + closed := attempt.closed + attempt.mu.Unlock() + if transport == nil || closed { + return errors.New("direct attempt unavailable") + } + return transport.HandleSignal(message.SignalType, message.Payload) +} + +func (a *directHostAttempt) startStream(parent context.Context, channel *peertransport.PionHostChannel) error { + sess, ok := a.host.host.server.Registry().Get(a.sessionID) + if !ok || normalizeRemotePermission(a.permission) != a.host.permission { + return errors.New("session or permission changed") + } + clientID := "direct:" + a.clientInstanceID + sub, replayToSeq := sess.Subscribe(a.sinceSeq, clientID, a.clientInstanceID, session.WithoutAutoDrive()) + streamCtx, cancel := context.WithCancel(parent) + a.mu.Lock() + if a.closed || a.sub != nil { + a.mu.Unlock() + cancel() + sess.Unsubscribe(sub) + return errors.New("direct attempt closed or already streaming") + } + a.sub = sub + a.subscribedSession = sess + a.streamCancel = cancel + a.mu.Unlock() + go a.reportDirectStats(streamCtx) + go func() { + for { + select { + case <-streamCtx.Done(): + return + case <-sub.Done(): + a.host.removeAttempt(a.id) + return + case frame, open := <-sub.Out(): + if !open { + a.host.removeAttempt(a.id) + return + } + if frame.Type == proto.TypeReplayProgress { + var progress proto.ReplayProgressPayload + if json.Unmarshal(frame.Payload, &progress) == nil && progress.Phase == proto.ReplayProgressEnd { + if progress.Seq != replayToSeq { + logWarn("direct", "replay cursor mismatch session=%s got=%d want=%d", a.sessionID, progress.Seq, replayToSeq) + a.host.removeAttempt(a.id) + return + } + ready := make([]byte, 8) + binary.BigEndian.PutUint64(ready, replayToSeq) + if err := channel.SendRecord(streamCtx, peertransport.RecordDirectReady, ready); err != nil { + a.host.removeAttempt(a.id) + return + } + } + continue + } + accountKey, ok := a.host.unlockedAccountKey() + if !ok { + a.host.removeAttempt(a.id) + return + } + prepared, forward := prepareRemoteSubscriberFrame(frame, func() []byte { return accountKey }) + if !forward { + continue + } + wire := proto.Marshal(prepared) + if err := channel.SendFrame(streamCtx, wire); err != nil { + a.host.removeAttempt(a.id) + return + } + a.addDirectBytes(uint64(len(wire)), 0, false) + } + } + }() + return nil +} + +func (a *directHostAttempt) reportDirectStats(ctx context.Context) { + interval := a.statsReportInterval + if interval <= 0 { + interval = directStatsReportInterval + } + ticker := time.NewTicker(interval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + a.addDirectBytes(0, 0, true) + } + } +} + +func (a *directHostAttempt) handleRecord(ctx context.Context, kind peertransport.RecordKind, payload []byte) error { + switch kind { + case peertransport.RecordPing: + if len(payload) != 8 { + return errors.New("invalid direct ping") + } + a.mu.Lock() + channel := a.channel + a.mu.Unlock() + if channel == nil { + return errors.New("direct transport unavailable") + } + return channel.SendRecord(ctx, peertransport.RecordPong, payload) + case peertransport.RecordClose: + go a.host.removeAttempt(a.id) + return nil + case peertransport.RecordFrame: + frame, err := proto.Unmarshal(payload) + if err != nil || frame.SessionID != a.sessionID { + return errors.New("invalid direct terminal frame") + } + accountKey, ok := a.host.unlockedAccountKey() + if !ok { + return errors.New("account key is not unlocked") + } + switch frame.Type { + case proto.TypeIn, proto.TypeResize: + if !localFrameAllowedByPermission(a.permission, frame.Type) { + return errors.New("direct frame exceeds permission") + } + a.mu.Lock() + sub := a.sub + a.mu.Unlock() + if sub == nil { + return errors.New("direct subscriber unavailable") + } + sess, ok := a.host.host.server.Registry().Get(a.sessionID) + if !ok || !sess.IsDriver(sub) { + return errors.New("direct subscriber is not driver") + } + if opened, ok := openInboundFrame(frame, func() []byte { return accountKey }); ok { + frame = opened + } + if err := a.host.host.SendLocalInbound(a.sessionID, frame); err != nil { + return err + } + a.addDirectBytes(0, uint64(len(payload)), false) + return nil + case proto.TypeClaimDriver: + if a.permission == proto.RemotePermissionView { + return errors.New("driver claim exceeds permission") + } + var claim proto.ClaimDriverPayload + if err := json.Unmarshal(frame.Payload, &claim); err != nil { + return errors.New("invalid driver claim") + } + a.mu.Lock() + sub := a.sub + a.mu.Unlock() + if sub == nil { + return errors.New("direct subscriber unavailable") + } + sess, ok := a.host.host.server.Registry().Get(a.sessionID) + if !ok { + return errors.New("session unavailable") + } + sess.ClaimDriver(sub, claim.ClientID, claim.ClientName) + a.addDirectBytes(0, uint64(len(payload)), false) + return nil + default: + return fmt.Errorf("direct frame type 0x%02x is not allowed", frame.Type) + } + default: + return fmt.Errorf("direct record kind %d is not accepted from client", kind) + } +} + +func (h *directSignalHost) unlockedAccountKey() ([]byte, bool) { + if h.accountKey == nil { + return nil, false + } + key := h.accountKey() + return key, len(key) == e2eecrypto.SessionKeySize +} + +func (h *directSignalHost) removeAttemptString(raw string) { + if id, err := uuid.Parse(raw); err == nil { + h.removeAttempt(id) + } +} + +func (h *directSignalHost) removeAttempt(id uuid.UUID) { + h.mu.Lock() + attempt := h.attempts[id] + delete(h.attempts, id) + h.mu.Unlock() + if attempt != nil { + attempt.close() + } +} + +func (h *directSignalHost) removeAttemptIf(id uuid.UUID, expected *directHostAttempt) { + h.mu.Lock() + attempt := h.attempts[id] + if attempt == expected { + delete(h.attempts, id) + } else { + attempt = nil + } + h.mu.Unlock() + if attempt != nil { + attempt.close() + } +} + +func (h *directSignalHost) closeAllAttempts() { + h.mu.Lock() + attempts := make([]*directHostAttempt, 0, len(h.attempts)) + for id, attempt := range h.attempts { + delete(h.attempts, id) + attempts = append(attempts, attempt) + } + h.mu.Unlock() + for _, attempt := range attempts { + attempt.close() + } +} + +func (h *directSignalHost) closePendingAttempts() { + h.mu.Lock() + attempts := make([]*directHostAttempt, 0, len(h.attempts)) + for id, attempt := range h.attempts { + attempt.mu.Lock() + consumed := attempt.consumed + attempt.mu.Unlock() + if !consumed { + delete(h.attempts, id) + attempts = append(attempts, attempt) + } + } + h.mu.Unlock() + for _, attempt := range attempts { + attempt.close() + } +} + +func (a *directHostAttempt) setTransport(transport *peertransport.PionHostAttempt) bool { + a.mu.Lock() + defer a.mu.Unlock() + if a.closed { + return false + } + a.transport = transport + return true +} + +func (a *directHostAttempt) setAuthenticatedChannel(channel *peertransport.PionHostChannel) bool { + a.mu.Lock() + defer a.mu.Unlock() + if a.closed || a.channel != nil { + return false + } + a.consumed = true + a.channel = channel + return true +} + +func (a *directHostAttempt) close() { + a.closeOnce.Do(func() { + a.mu.Lock() + a.closed = true + cancel := a.streamCancel + sub := a.sub + sess := a.subscribedSession + transport := a.transport + a.streamCancel = nil + a.sub = nil + a.subscribedSession = nil + a.channel = nil + a.mu.Unlock() + if cancel != nil { + cancel() + } + if sub != nil && sess != nil { + sess.Unsubscribe(sub) + } + if transport != nil { + _ = transport.Close() + } + a.addDirectBytes(0, 0, true) + }) +} + +func (a *directHostAttempt) addDirectBytes(sent, received uint64, force bool) { + a.mu.Lock() + a.pendingBytesSent += sent + a.pendingBytesRecv += received + if !force && a.pendingBytesSent+a.pendingBytesRecv < directStatsReportThreshold { + a.mu.Unlock() + return + } + pendingSent := a.pendingBytesSent + pendingReceived := a.pendingBytesRecv + a.pendingBytesSent = 0 + a.pendingBytesRecv = 0 + report := a.reportBytes + a.mu.Unlock() + if pendingSent+pendingReceived > 0 && report != nil { + _ = report(pendingSent, pendingReceived) + } +} + +func directTransportPermission(value string) (peertransport.Permission, bool) { + switch value { + case proto.RemotePermissionView: + return peertransport.PermissionView, true + case proto.RemotePermissionControl: + return peertransport.PermissionControl, true + case proto.RemotePermissionFull: + return peertransport.PermissionFull, true + default: + return 0, false + } +} + +func writeDirectSignalHost(ctx context.Context, conn *websocket.Conn, message directsignal.Message) error { + data, err := json.Marshal(message) + if err != nil { + return err + } + writeCtx, cancel := context.WithTimeout(ctx, directHostWriteTimeout) + defer cancel() + return conn.Write(writeCtx, websocket.MessageText, data) +} + +func readDirectSignalHost(ctx context.Context, conn *websocket.Conn) (directsignal.Message, error) { + kind, data, err := conn.Read(ctx) + if err != nil { + return directsignal.Message{}, err + } + if kind != websocket.MessageText || len(data) > 64*1024 { + return directsignal.Message{}, errors.New("invalid direct signaling message") + } + var message directsignal.Message + if err := json.Unmarshal(data, &message); err != nil { + return directsignal.Message{}, err + } + return message, nil +} diff --git a/desktop/direct_signal_host_test.go b/desktop/direct_signal_host_test.go new file mode 100644 index 00000000..588d6aea --- /dev/null +++ b/desktop/direct_signal_host_test.go @@ -0,0 +1,597 @@ +package main + +import ( + "bytes" + "context" + "encoding/base64" + "encoding/binary" + "encoding/json" + "errors" + "fmt" + "net/http" + "net/http/httptest" + "reflect" + "strings" + "sync" + "testing" + "time" + + "github.com/attson/atterm/internal/directsignal" + "github.com/attson/atterm/internal/e2eecrypto" + "github.com/attson/atterm/internal/peertransport" + "github.com/attson/atterm/internal/proto" + "github.com/attson/atterm/internal/session" + "github.com/google/uuid" + "github.com/pion/webrtc/v4" + "nhooyr.io/websocket" +) + +func addDirectTestSession(t *testing.T, host *relayHost, id uuid.UUID) *session.Session { + t.Helper() + sess := session.New(id, proto.SessionInfo{HostID: host.hostID, RemotePermission: proto.RemotePermissionFull}) + if _, err := host.server.Registry().Add(sess); err != nil { + t.Fatalf("Registry.Add: %v", err) + } + t.Cleanup(func() { host.server.Registry().Remove(id) }) + return sess +} + +func TestDirectSignalHostHelloAndRegistration(t *testing.T) { + host := newTestRelayHost(t) + first := uuid.MustParse("00000000-0000-0000-0000-000000000002") + second := uuid.MustParse("00000000-0000-0000-0000-000000000001") + addDirectTestSession(t, host, first) + addDirectTestSession(t, host, second) + + requestChange := make(chan struct{}) + serverErr := make(chan error, 1) + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if got := r.Header.Get("Authorization"); got != "Bearer desktop-token" { + serverErr <- fmt.Errorf("Authorization=%q", got) + return + } + conn, err := websocket.Accept(w, r, nil) + if err != nil { + serverErr <- err + return + } + defer conn.Close(websocket.StatusNormalClosure, "done") + ctx, cancel := context.WithTimeout(r.Context(), 5*time.Second) + defer cancel() + hello, err := readDirectSignalHost(ctx, conn) + if err != nil { + serverErr <- err + return + } + wantIDs := []string{second.String(), first.String()} + if hello.Kind != "hello" || hello.Role != "host" || hello.HostID != host.hostID || !reflect.DeepEqual(hello.SessionIDs, wantIDs) { + serverErr <- fmt.Errorf("unexpected hello: %+v", hello) + return + } + if err := writeDirectSignalHost(ctx, conn, directsignal.Message{Version: directsignal.Version, Kind: "hello_ok"}); err != nil { + serverErr <- err + return + } + close(requestChange) + registration, err := readDirectSignalHost(ctx, conn) + if err != nil { + serverErr <- err + return + } + if registration.Kind != "host_register" || registration.HostID != host.hostID || len(registration.SessionIDs) != 3 { + serverErr <- fmt.Errorf("unexpected registration: %+v", registration) + return + } + serverErr <- nil + })) + defer server.Close() + + directHost := newDirectSignalHost("ws"+strings.TrimPrefix(server.URL, "http"), "desktop-token", proto.RemotePermissionFull, host, nil, false) + runErr := make(chan error, 1) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + go func() { runErr <- directHost.runOnce(ctx) }() + + select { + case <-time.After(5 * time.Second): + t.Fatal("timed out waiting for host hello") + case <-requestChange: + } + third := uuid.MustParse("00000000-0000-0000-0000-000000000003") + addDirectTestSession(t, host, third) + for i := 0; i < 10; i++ { + host.server.Registry().NotifyChange() + select { + case err := <-serverErr: + if err != nil { + t.Fatal(err) + } + cancel() + <-runErr + return + case <-time.After(20 * time.Millisecond): + } + } + t.Fatal("timed out waiting for host registration") +} + +func TestDirectSignalHostRejectsInvalidClaimsAndLockedKey(t *testing.T) { + host := newTestRelayHost(t) + sessionID := uuid.New() + addDirectTestSession(t, host, sessionID) + attemptID := uuid.New() + ticket := bytes.Repeat([]byte{0x41}, 32) + valid := directsignal.Message{ + Version: directsignal.Version, + Kind: "direct_attempt", + AttemptID: attemptID.String(), + Ticket: base64.RawURLEncoding.EncodeToString(ticket), + SessionID: sessionID.String(), + UserID: "user-1", + HostID: host.hostID, + ClientInstanceID: "client-1", + Permission: proto.RemotePermissionFull, + ExpiresAtUnixM: time.Now().Add(time.Minute).UnixMilli(), + } + + tests := []struct { + name string + mutate func(*directsignal.Message) + key []byte + }{ + {name: "attempt id", mutate: func(m *directsignal.Message) { m.AttemptID = "bad" }, key: ticket}, + {name: "session id", mutate: func(m *directsignal.Message) { m.SessionID = "bad" }, key: ticket}, + {name: "ticket", mutate: func(m *directsignal.Message) { m.Ticket = "bad" }, key: ticket}, + {name: "host", mutate: func(m *directsignal.Message) { m.HostID = "other" }, key: ticket}, + {name: "permission", mutate: func(m *directsignal.Message) { m.Permission = proto.RemotePermissionView }, key: ticket}, + {name: "expiry", mutate: func(m *directsignal.Message) { m.ExpiresAtUnixM = time.Now().Add(-time.Second).UnixMilli() }, key: ticket}, + {name: "missing session", mutate: func(m *directsignal.Message) { m.SessionID = uuid.NewString() }, key: ticket}, + {name: "locked key", mutate: func(*directsignal.Message) {}, key: nil}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + message := valid + tt.mutate(&message) + directHost := newDirectSignalHost("ws://unused", "", proto.RemotePermissionFull, host, func() []byte { return tt.key }, false) + if err := directHost.startAttempt(context.Background(), message, func(directsignal.Message) error { return nil }); err == nil { + t.Fatal("invalid direct attempt accepted") + } + if len(directHost.attempts) != 0 { + t.Fatal("rejected direct attempt leaked into registry") + } + }) + } +} + +func TestDirectSignalHostDuplicateAttemptKeepsExistingEntry(t *testing.T) { + host := newTestRelayHost(t) + sessionID := uuid.New() + addDirectTestSession(t, host, sessionID) + attemptID := uuid.New() + accountKey := bytes.Repeat([]byte{0x29}, e2eecrypto.SessionKeySize) + directHost := newDirectSignalHost("ws://unused", "", proto.RemotePermissionFull, host, func() []byte { return accountKey }, false) + existing := &directHostAttempt{id: attemptID, sessionID: sessionID, permission: proto.RemotePermissionFull, host: directHost} + directHost.attempts[attemptID] = existing + + message := directsignal.Message{ + AttemptID: attemptID.String(), + Ticket: base64.RawURLEncoding.EncodeToString(bytes.Repeat([]byte{0x31}, 32)), + SessionID: sessionID.String(), + UserID: "user-1", + HostID: host.hostID, + ClientInstanceID: "client-1", + Permission: proto.RemotePermissionFull, + ExpiresAtUnixM: time.Now().Add(time.Minute).UnixMilli(), + } + if err := directHost.startAttempt(context.Background(), message, func(directsignal.Message) error { return nil }); err == nil { + t.Fatal("duplicate attempt accepted") + } + if directHost.attempts[attemptID] != existing { + t.Fatal("duplicate attempt replaced or removed the existing entry") + } +} + +func TestDirectHostPermissionGateDefaultsDeny(t *testing.T) { + host := newTestRelayHost(t) + sessionID := uuid.New() + sess := addDirectTestSession(t, host, sessionID) + accountKey := bytes.Repeat([]byte{0x44}, e2eecrypto.SessionKeySize) + directHost := newDirectSignalHost("ws://unused", "", proto.RemotePermissionFull, host, func() []byte { return accountKey }, false) + + view := &directHostAttempt{id: uuid.New(), sessionID: sessionID, permission: proto.RemotePermissionView, host: directHost} + input := proto.Frame{Type: proto.TypeIn, SessionID: sessionID, Payload: []byte("x")} + if err := view.handleRecord(context.Background(), peertransport.RecordFrame, proto.Marshal(input)); err == nil { + t.Fatal("view permission accepted input") + } + + sub, _ := sess.Subscribe(0, "direct:client", "client", session.WithoutAutoDrive()) + t.Cleanup(func() { sess.Unsubscribe(sub) }) + control := &directHostAttempt{id: uuid.New(), sessionID: sessionID, permission: proto.RemotePermissionControl, host: directHost, sub: sub, subscribedSession: sess} + if err := control.handleRecord(context.Background(), peertransport.RecordFrame, proto.Marshal(input)); err == nil { + t.Fatal("non-driver direct subscriber accepted input") + } + claimPayload, _ := json.Marshal(proto.ClaimDriverPayload{ClientID: "client", ClientName: "client"}) + claim := proto.Frame{Type: proto.TypeClaimDriver, SessionID: sessionID, Payload: claimPayload} + if err := control.handleRecord(context.Background(), peertransport.RecordFrame, proto.Marshal(claim)); err != nil { + t.Fatalf("control driver claim rejected: %v", err) + } + if err := control.handleRecord(context.Background(), peertransport.RecordFrame, proto.Marshal(input)); err != nil { + t.Fatalf("control input rejected: %v", err) + } + select { + case got := <-sess.Inbound(): + if got.Type != proto.TypeIn || !bytes.Equal(got.Payload, []byte("x")) { + t.Fatalf("unexpected inbound frame: %+v", got) + } + case <-time.After(time.Second): + t.Fatal("control input was not delivered") + } + + for _, typ := range []proto.Type{proto.TypePasteImage, proto.TypePasteFile, proto.TypeFSRequest, proto.TypeServiceOpen, 0xff} { + frame := proto.Frame{Type: typ, SessionID: sessionID, Payload: []byte("payload")} + if err := control.handleRecord(context.Background(), peertransport.RecordFrame, proto.Marshal(frame)); err == nil { + t.Fatalf("frame type 0x%02x accepted", typ) + } + } + wrongSession := proto.Frame{Type: proto.TypeIn, SessionID: uuid.New(), Payload: []byte("x")} + if err := control.handleRecord(context.Background(), peertransport.RecordFrame, proto.Marshal(wrongSession)); err == nil { + t.Fatal("wrong-session frame accepted") + } +} + +func TestDirectSignalDisconnectClosesOnlyPendingAttempts(t *testing.T) { + host := newTestRelayHost(t) + sessionID := uuid.New() + sess := addDirectTestSession(t, host, sessionID) + directHost := newDirectSignalHost("ws://unused", "", proto.RemotePermissionFull, host, nil, false) + + newAttempt := func(consumed bool) *directHostAttempt { + sub, _ := sess.Subscribe(0, "direct:test", "test", session.WithoutAutoDrive()) + attempt := &directHostAttempt{id: uuid.New(), sessionID: sessionID, permission: proto.RemotePermissionFull, host: directHost, consumed: consumed, sub: sub, subscribedSession: sess} + directHost.attempts[attempt.id] = attempt + return attempt + } + pending := newAttempt(false) + active := newAttempt(true) + if got := sess.SubscriberCount(); got != 2 { + t.Fatalf("SubscriberCount=%d, want 2", got) + } + + directHost.closePendingAttempts() + if got := sess.SubscriberCount(); got != 1 { + t.Fatalf("SubscriberCount after signaling close=%d, want 1", got) + } + if _, ok := directHost.attempts[pending.id]; ok { + t.Fatal("pending attempt survived signaling close") + } + if directHost.attempts[active.id] != active { + t.Fatal("authenticated attempt was closed with signaling connection") + } + + directHost.closeAllAttempts() + if got := sess.SubscriberCount(); got != 0 { + t.Fatalf("SubscriberCount after host close=%d, want 0", got) + } +} + +func TestDirectHostAttemptReportsDirectionalBytes(t *testing.T) { + var gotSent, gotReceived uint64 + attempt := &directHostAttempt{reportBytes: func(sent, received uint64) error { + gotSent += sent + gotReceived += received + return nil + }} + attempt.addDirectBytes(200, 30, false) + if gotSent != 0 || gotReceived != 0 { + t.Fatal("reported before threshold") + } + attempt.addDirectBytes(directStatsReportThreshold-230, 0, false) + if gotSent != directStatsReportThreshold-30 || gotReceived != 30 { + t.Fatalf("threshold report = sent %d received %d", gotSent, gotReceived) + } + attempt.addDirectBytes(5, 7, true) + if gotSent != directStatsReportThreshold-25 || gotReceived != 37 { + t.Fatalf("forced report = sent %d received %d", gotSent, gotReceived) + } +} + +func TestDirectHostAttemptPeriodicallyReportsSmallDeltas(t *testing.T) { + reports := make(chan [2]uint64, 2) + attempt := &directHostAttempt{ + statsReportInterval: 5 * time.Millisecond, + reportBytes: func(sent, received uint64) error { + reports <- [2]uint64{sent, received} + return nil + }, + } + attempt.addDirectBytes(17, 9, false) + select { + case report := <-reports: + t.Fatalf("reported before interval: %v", report) + default: + } + + ctx, cancel := context.WithCancel(context.Background()) + done := make(chan struct{}) + go func() { + defer close(done) + attempt.reportDirectStats(ctx) + }() + select { + case report := <-reports: + if report != [2]uint64{17, 9} { + t.Fatalf("periodic report = %v, want [17 9]", report) + } + case <-time.After(time.Second): + t.Fatal("timed out waiting for periodic report") + } + + cancel() + select { + case <-done: + case <-time.After(time.Second): + t.Fatal("periodic reporter did not stop after cancellation") + } + attempt.addDirectBytes(0, 0, true) + select { + case report := <-reports: + t.Fatalf("reported the same bytes twice: %v", report) + default: + } +} + +func TestDirectHostAttemptCarriesSealedOutputAndInput(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + host := newTestRelayHost(t) + sessionID := uuid.New() + sess := addDirectTestSession(t, host, sessionID) + accountKey := bytes.Repeat([]byte{0x52}, e2eecrypto.SessionKeySize) + sess.PushOut(1, []byte("secret output")) + + directHost := newDirectSignalHost("ws://unused", "", proto.RemotePermissionFull, host, func() []byte { return accountKey }, false) + directHost.webrtcConfig = webrtc.Configuration{} + attemptID := uuid.New() + ticket := bytes.Repeat([]byte{0x73}, 32) + expires := time.Now().Add(time.Minute).UnixMilli() + message := directsignal.Message{ + Version: directsignal.Version, + Kind: "direct_attempt", + AttemptID: attemptID.String(), + Ticket: base64.RawURLEncoding.EncodeToString(ticket), + SessionID: sessionID.String(), + UserID: "user-1", + HostID: host.hostID, + ClientInstanceID: "client-1", + Permission: proto.RemotePermissionFull, + ExpiresAtUnixM: expires, + } + signals := make(chan directsignal.Message, 8) + if err := directHost.startAttempt(ctx, message, func(message directsignal.Message) error { + signals <- message + return nil + }); err != nil { + t.Fatal(err) + } + defer directHost.closeAllAttempts() + + clientPC, err := webrtc.NewPeerConnection(webrtc.Configuration{}) + if err != nil { + t.Fatal(err) + } + defer clientPC.Close() + dc, err := clientPC.CreateDataChannel(peertransport.TerminalDataChannelLabel, nil) + if err != nil { + t.Fatal(err) + } + auth, err := peertransport.NewAccountKeyAuthenticator(accountKey) + if err != nil { + t.Fatal(err) + } + clientPrivate, err := peertransport.GenerateEphemeralKey() + if err != nil { + t.Fatal(err) + } + clientHello, err := peertransport.EncodeClientHello(attemptID, ticket, clientPrivate.PublicKey().Bytes()) + if err != nil { + t.Fatal(err) + } + + errCh := make(chan error, 8) + records := make(chan directClientRecord, 8) + var ( + clientMu sync.Mutex + clientSealer *peertransport.RecordSealer + clientOpener *peertransport.RecordOpener + ) + dc.OnOpen(func() { + if err := dc.Send(clientHello); err != nil { + nonBlockingDirectTestError(errCh, err) + } + }) + dc.OnMessage(func(message webrtc.DataChannelMessage) { + clientMu.Lock() + defer clientMu.Unlock() + if peertransport.IsAuthOK(message.Data) { + if clientSealer == nil { + nonBlockingDirectTestError(errCh, errors.New("AUTH_OK before HOST_HELLO")) + return + } + claimPayload, _ := json.Marshal(proto.ClaimDriverPayload{ClientID: "client-1", ClientName: "client"}) + frames := []proto.Frame{ + {Type: proto.TypeClaimDriver, SessionID: sessionID, Payload: claimPayload}, + {Type: proto.TypeIn, SessionID: sessionID, Payload: []byte("direct input")}, + } + for _, frame := range frames { + record, sealErr := clientSealer.Seal(peertransport.RecordFrame, proto.Marshal(frame)) + if sealErr != nil { + nonBlockingDirectTestError(errCh, sealErr) + return + } + if sendErr := dc.Send(record); sendErr != nil { + nonBlockingDirectTestError(errCh, sendErr) + return + } + } + return + } + if clientOpener != nil { + kind, payload, err := clientOpener.Open(message.Data) + if err != nil { + nonBlockingDirectTestError(errCh, err) + return + } + records <- directClientRecord{kind: kind, payload: payload} + return + } + hostPublic, hostProof, err := peertransport.DecodeHostHello(message.Data) + if err != nil { + nonBlockingDirectTestError(errCh, err) + return + } + transcript, err := (peertransport.Transcript{ + AttemptID: attemptID, + Ticket: ticket, + SessionID: sessionID, + UserID: "user-1", + HostID: host.hostID, + ClientInstanceID: "client-1", + Permission: peertransport.PermissionFull, + ExpiresAtUnixMillis: uint64(expires), + ClientPublicKey: clientPrivate.PublicKey().Bytes(), + HostPublicKey: hostPublic, + }).MarshalBinary() + if err == nil { + err = auth.VerifyProof(transcript, peertransport.RoleHost, hostProof) + } + keys, keyErr := peertransport.DeriveTrafficKeys(clientPrivate, hostPublic, transcript, auth) + if err == nil { + err = keyErr + } + if err != nil { + nonBlockingDirectTestError(errCh, err) + return + } + hash := peertransport.TranscriptHash(transcript) + clientSealer, err = peertransport.NewRecordSealer(keys.ClientToHostKey[:], keys.ClientToHostNoncePrefix[:], hash) + if err == nil { + clientOpener, err = peertransport.NewRecordOpener(keys.HostToClientKey[:], keys.HostToClientNoncePrefix[:], hash) + } + if err != nil { + nonBlockingDirectTestError(errCh, err) + return + } + clientProof, _ := auth.BuildProof(transcript, peertransport.RoleClient) + finishProof, _ := peertransport.BuildFinishProof(auth, transcript) + finish, _ := peertransport.EncodeClientFinish(clientProof, finishProof) + if err := dc.Send(finish); err != nil { + nonBlockingDirectTestError(errCh, err) + } + }) + + offer, err := clientPC.CreateOffer(nil) + if err != nil { + t.Fatal(err) + } + gathered := webrtc.GatheringCompletePromise(clientPC) + if err := clientPC.SetLocalDescription(offer); err != nil { + t.Fatal(err) + } + select { + case <-ctx.Done(): + t.Fatal(ctx.Err()) + case <-gathered: + } + offerJSON, _ := json.Marshal(clientPC.LocalDescription()) + go func() { + if err := directHost.handleSignal(directsignal.Message{AttemptID: attemptID.String(), SignalType: "offer", Payload: string(offerJSON)}); err != nil { + nonBlockingDirectTestError(errCh, err) + } + }() + + for answerSet := false; !answerSet; { + select { + case <-ctx.Done(): + t.Fatal(ctx.Err()) + case err := <-errCh: + t.Fatal(err) + case signal := <-signals: + if signal.Kind != "signal" || signal.SignalType != "answer" { + continue + } + var answer webrtc.SessionDescription + if err := json.Unmarshal([]byte(signal.Payload), &answer); err != nil { + t.Fatal(err) + } + if err := clientPC.SetRemoteDescription(answer); err != nil { + t.Fatal(err) + } + answerSet = true + } + } + + var gotOutput, gotReady, gotInput, gotConsumed bool + for !gotOutput || !gotReady || !gotInput || !gotConsumed { + select { + case <-ctx.Done(): + t.Fatal(ctx.Err()) + case err := <-errCh: + t.Fatal(err) + case signal := <-signals: + if signal.Kind == "consumed" && signal.AttemptID == attemptID.String() { + gotConsumed = true + } + case record := <-records: + switch record.kind { + case peertransport.RecordDirectReady: + if len(record.payload) != 8 || binary.BigEndian.Uint64(record.payload) != 1 { + t.Fatalf("DIRECT_READY payload=%x", record.payload) + } + gotReady = true + case peertransport.RecordFrame: + frame, err := proto.Unmarshal(record.payload) + if err != nil { + t.Fatal(err) + } + if frame.Type != proto.TypeOut { + continue + } + seq, sealed, err := proto.DecodeOut(frame.Payload) + if err != nil || seq != 1 || bytes.Equal(sealed, []byte("secret output")) { + t.Fatalf("unexpected sealed OUT seq=%d payload=%x err=%v", seq, sealed, err) + } + sessionKey, _ := e2eecrypto.DeriveSessionKey(accountKey, sessionID) + plaintext, err := e2eecrypto.OpenOut(sessionKey, sessionID, byte(proto.TypeOut), seq, sealed) + if err != nil || !bytes.Equal(plaintext, []byte("secret output")) { + t.Fatalf("open sealed OUT: plaintext=%q err=%v", plaintext, err) + } + gotOutput = true + } + case frame := <-sess.Inbound(): + if frame.Type == proto.TypeIn && bytes.Equal(frame.Payload, []byte("direct input")) { + gotInput = true + } + } + } + + directHost.removeAttempt(attemptID) + deadline := time.Now().Add(time.Second) + for sess.SubscriberCount() != 0 && time.Now().Before(deadline) { + time.Sleep(time.Millisecond) + } + if got := sess.SubscriberCount(); got != 0 { + t.Fatalf("direct subscriber leaked after close: %d", got) + } +} + +type directClientRecord struct { + kind peertransport.RecordKind + payload []byte +} + +func nonBlockingDirectTestError(ch chan<- error, err error) { + select { + case ch <- err: + default: + } +} diff --git a/desktop/frontend/src/App.vue b/desktop/frontend/src/App.vue index e4228e12..1c90ad35 100644 --- a/desktop/frontend/src/App.vue +++ b/desktop/frontend/src/App.vue @@ -73,6 +73,7 @@ import type { Endpoint, RelayConfig, RelayMe, StartupError, UpdateState, Session import { saveRelayConfig, clearRelayConfig } from "@webshared/api/relay-config"; import type { RemoteSession } from "./platform/types"; import { type SessionConnection, type SessionInfo } from "./lib/connection"; +import { buildRelayWebSocketEndpoint } from "./lib/relayEndpoint"; import { mergeLocalSessions } from "./lib/localListMerge"; import { pruneStaleRemoteTabs } from "./lib/remoteTabCleanup"; import { PANE_COUNT, type LayoutKind, type Pane, type Tab, type SplitDir, type TerminalAppearance } from "./lib/types"; @@ -137,6 +138,8 @@ const settingsInitialTab = ref<"general" | "account" | "relay" | "logging" | "up const localEndpoint = ref(null); const remoteEndpoint = ref(null); +const directSignalEndpoint = ref(null); +const preferDirectConnection = ref(false); const localHostID = ref(""); const localHost = ref(""); @@ -860,6 +863,7 @@ async function refreshPlatformRelayState(): Promise { const relayCfg = await $platform.relay.load(); const endpoint = relayCfg ? buildWebRemoteEndpoint(relayCfg) : null; remoteEndpoint.value = endpoint; + directSignalEndpoint.value = endpoint; if (!endpoint) { sessionListStreams.stopRemote(); remoteRawList.value = []; @@ -876,17 +880,24 @@ function startPlatformRemotePoll(): void { } // connectRemoteSessionList (re)starts the remote-session list stream and sets the -// attach endpoint. Two independent concerns: +// attach and signaling endpoints. Three independent concerns: // - The LIST is read through /client-sessions via the Go loopback proxy when // available, with App.ListRemoteSessions polling as fallback. // - The ATTACH endpoint is the Go loopback proxy (remoteProxy). When it's // unavailable the list still shows; you just can't open a remote pane. -function connectRemoteSessionList(relayConnected: boolean, attachEndpoint: Endpoint | null) { +// - The direct signaling endpoint is the public home Relay. It never points +// at remoteProxy because the broker must see both WebRTC peers. +function connectRemoteSessionList( + relayConnected: boolean, + attachEndpoint: Endpoint | null, + signalEndpoint: Endpoint | null, +) { sessionListStreams.stopRemote(); remoteRawList.value = []; remoteList.value = []; remoteMissingSince.clear(); remoteEndpoint.value = attachEndpoint; + directSignalEndpoint.value = signalEndpoint; if (!relayConnected) return; if (attachEndpoint) { connectRemoteSessionListWS(attachEndpoint); @@ -897,7 +908,14 @@ function connectRemoteSessionList(relayConnected: boolean, attachEndpoint: Endpo } async function refreshRelayConfig() { - let cfg: { url: string; token: string; connected: boolean; remote_proxy_url?: string; remote_http_proxy_url?: string } = { + let cfg: { + url: string; + token: string; + connected: boolean; + remote_proxy_url?: string; + remote_http_proxy_url?: string; + home_instance_url?: string; + } = { url: "", token: "", connected: false, @@ -934,10 +952,13 @@ async function refreshRelayConfig() { const attachEndpoint: Endpoint | null = relayConnected && proxyUrl ? { url: proxyUrl, session_token: cfg.token } : null; - const key = `${relayConnected}|${attachEndpoint?.url ?? ""}|${attachEndpoint?.session_token ?? ""}`; + const signalEndpoint = relayConnected + ? buildRelayWebSocketEndpoint(cfg.home_instance_url || cfg.url, cfg.token) + : null; + const key = `${relayConnected}|${attachEndpoint?.url ?? ""}|${attachEndpoint?.session_token ?? ""}|${signalEndpoint?.url ?? ""}|${signalEndpoint?.session_token ?? ""}`; if (key === lastRemoteKey) return; lastRemoteKey = key; - connectRemoteSessionList(relayConnected, attachEndpoint); + connectRemoteSessionList(relayConnected, attachEndpoint, signalEndpoint); } function refreshDesktopRelayConfig() { @@ -976,13 +997,7 @@ function buildWebRemoteEndpoint(cfg: RelayConfig): Endpoint | null { const proto = location.protocol === "https:" ? "wss:" : "ws:"; return { url: `${proto}//${location.host}`, session_token: cfg.token }; } - try { - const u = new URL(httpBase); - const proto = u.protocol === "https:" ? "wss:" : "ws:"; - return { url: `${proto}//${u.host}`, session_token: cfg.token }; - } catch { - return null; - } + return buildRelayWebSocketEndpoint(httpBase, cfg.token); } async function refreshTerminalTheme() { @@ -1023,6 +1038,10 @@ function onAppearanceChanged(appearance: TerminalAppearance) { terminalAppearance.value = appearance; } +function onDirectConnectionChanged(enabled: boolean) { + preferDirectConnection.value = enabled; +} + function onCommandNotifyThresholdChanged(seconds: number) { commandNotifyThresholdSec.value = seconds; } @@ -1698,6 +1717,12 @@ onMounted(async () => { // Set up the size-prediction probe before anything spawns a PTY — the // probe must be ready by the time auto-startNewTab fires. await setupMeasureProbe(); + try { + preferDirectConnection.value = await $platform.directConnection.load(); + } catch (e) { + preferDirectConnection.value = false; + logWarn("direct", "failed to load direct connection preference", { error: errText(e) }); + } if (caps.wailsBindings) { try { commandNotifyThresholdSec.value = await getCommandNotifyThresholdSeconds(); @@ -1950,6 +1975,8 @@ defineExpose({ me }); :key="t.id" :tab="t" :endpoint-for="endpointFor" + :direct-endpoint="directSignalEndpoint" + :prefer-direct="preferDirectConnection" :session-info-for="paneSessionInfo" :viewer-count-for="viewerCountFor" :active="t.id === currentTabId" @@ -2000,6 +2027,7 @@ defineExpose({ me }); @terminal-theme-changed="onTerminalThemeChanged" @command-notify-threshold-changed="onCommandNotifyThresholdChanged" @appearance-changed="onAppearanceChanged" + @direct-connection-changed="onDirectConnectionChanged" @bindings-changed="onBindingsChanged" @profiles-changed="onProfilesChanged" @relay-config-changed="onRelayConfigChanged" diff --git a/desktop/frontend/src/components/AccountTrafficDashboard.test.ts b/desktop/frontend/src/components/AccountTrafficDashboard.test.ts new file mode 100644 index 00000000..f4f0f00c --- /dev/null +++ b/desktop/frontend/src/components/AccountTrafficDashboard.test.ts @@ -0,0 +1,81 @@ +import { flushPromises, mount } from '@vue/test-utils' +import { beforeEach, describe, expect, it, vi } from 'vitest' + +vi.mock('../i18n/useI18n', () => ({ + useI18n: () => ({ + t: (key: string, params?: Record) => params + ? `${key}[${Object.entries(params).map(([name, value]) => `${name}=${value}`).join(',')}]` + : key, + }), +})) + +vi.mock('@shared/api/me', () => ({ getMeTraffic: vi.fn() })) + +import { getMeTraffic } from '@shared/api/me' +import AccountTrafficDashboard from './AccountTrafficDashboard.vue' + +const getMeTrafficMock = getMeTraffic as unknown as ReturnType + +beforeEach(() => { + vi.useFakeTimers() + vi.setSystemTime(new Date('2026-09-23T12:00:00Z')) + getMeTrafficMock.mockReset() + getMeTrafficMock.mockResolvedValue({ + from: '2026-09-10', + to: '2026-09-23', + relay: [{ day: '2026-09-23', bytes_in: 1024, bytes_out: 2048, frames_in: 2, frames_out: 3 }], + relay_detail: [ + { day: '2026-09-23', frame_type: 3, frame_type_name: 'OUT', category: 'terminal', direction: 1, bytes: 2048, frames: 3 }, + { day: '2026-09-23', frame_type: 5, frame_type_name: 'META', category: 'state', direction: 0, bytes: 1024, frames: 2 }, + ], + direct: [{ day: '2026-09-23', attempts: 4, successes: 3, fallbacks: 1, bytes_sent: 4096, bytes_received: 512 }], + }) +}) + +describe('AccountTrafficDashboard', () => { + it('loads and renders Relay and P2P account totals', async () => { + const wrapper = mount(AccountTrafficDashboard) + await flushPromises() + + expect(getMeTrafficMock).toHaveBeenCalledTimes(1) + expect(wrapper.get('[data-testid="relay-traffic-total"]').text()).toContain('3.00 KB') + expect(wrapper.get('[data-testid="relay-kpi-frames"]').text()).toContain('5') + expect(wrapper.get('[data-testid="direct-traffic-total"]').text()).toContain('4.50 KB') + expect(wrapper.get('[data-testid="direct-success-rate"]').text()).toContain('75.0%') + }) + + it('switches between category, frame, and direction analysis', async () => { + const wrapper = mount(AccountTrafficDashboard) + await flushPromises() + + expect(wrapper.find('[data-testid="traffic-stacked-chart"]').exists()).toBe(true) + expect(wrapper.text()).toContain('OUT') + + await wrapper.get('[data-testid="traffic-view-frame"]').trigger('click') + expect(wrapper.find('[data-testid="traffic-stacked-chart"]').exists()).toBe(true) + + await wrapper.get('[data-testid="traffic-metric-frames"]').trigger('click') + await wrapper.get('[data-testid="traffic-view-direction"]').trigger('click') + expect(wrapper.find('[data-testid="traffic-direction-chart"]').exists()).toBe(true) + }) + + it('reloads when the range changes', async () => { + const wrapper = mount(AccountTrafficDashboard) + await flushPromises() + await wrapper.get('[data-testid="traffic-range-30"]').trigger('click') + await flushPromises() + + expect(getMeTrafficMock).toHaveBeenCalledTimes(2) + const [from, to] = getMeTrafficMock.mock.calls[1] + const elapsedDays = (Date.parse(to) - Date.parse(from)) / 86_400_000 + 1 + expect(elapsedDays).toBe(60) + }) + + it('shows a retry state after a failed request', async () => { + getMeTrafficMock.mockRejectedValueOnce(new Error('offline')) + const wrapper = mount(AccountTrafficDashboard) + await flushPromises() + + expect(wrapper.text()).toContain('settings.account.traffic.loadFailed') + }) +}) diff --git a/desktop/frontend/src/components/AccountTrafficDashboard.vue b/desktop/frontend/src/components/AccountTrafficDashboard.vue new file mode 100644 index 00000000..df0a2b9b --- /dev/null +++ b/desktop/frontend/src/components/AccountTrafficDashboard.vue @@ -0,0 +1,305 @@ + + + + + diff --git a/desktop/frontend/src/components/PaneGrid.vue b/desktop/frontend/src/components/PaneGrid.vue index a502e5b6..fc15be19 100644 --- a/desktop/frontend/src/components/PaneGrid.vue +++ b/desktop/frontend/src/components/PaneGrid.vue @@ -21,6 +21,8 @@ import { const props = defineProps<{ tab: Tab; endpointFor: (pane: Pane) => Endpoint | null; + directEndpoint?: Endpoint | null; + preferDirect?: boolean; sessionInfoFor: (pane: Pane) => SessionInfo | null; viewerCountFor?: (sessionId: string) => number; active: boolean; @@ -220,6 +222,8 @@ function requestServicePreview(pane: Pane): void { {{ t("terminal.remote") }} {{ pane.sessionId.slice(0, 8) }} + Relay <------ uplink presence + | | + +================ WebRTC terminal data =============+----> desktop host + | | + +------------ existing Relay WS fallback -----------+ +``` + +Relay 仍是账户和控制面;WebRTC 是可失败的加速数据面。客户端先通过 Relay attach,再尝试 direct upgrade,因此这个阶段不会制造“直连失败后整个远程不可用”的新故障模式。 + +最终的账户无关连接路径: + +```text + +--------------------------+ + | official/self-hosted | +new device -- signed invite -->| Rendezvous (signal only) |--+ + | +--------------------------+ | + | v + | +-----------------------------------+ WebRTC DataChannel + +------->| Quick Tunnel to local peer gateway|----------+ direct preferred + +-----------------------------------+ | + | encrypted WSS fallback v + +----------------------------> desktop peer host + +Relay account login ----------------------------------> existing Relay path +``` + +“Peer mode”描述信任模型;“Direct / Quick Tunnel / Relay”描述当前实际数据路径。UI 不把经过 Cloudflare 的 WSS 回退标成“直连”。 + +## 3. Non-goals + +MVP 不包含: + +- 用 Peer 身份替代或迁移现有 OPAQUE Relay 账户。 +- 在 Peer 模式中复用 `account_key`、Relay session token 或 `/api/pair/*` token。 +- 密码恢复、云端设备目录、云端备份 Peer 私钥。 +- Rendezvous 代存配置或充当“隐藏的中心数据库”。没有任意两台设备同时在线时,不承诺立即同步。 +- TURN/SFU、自建 overlay network、libp2p DHT。 +- 主机离线时访问终端;邀请可预签,但主机仍必须在线才能兑换和 attach。 +- 任意受信设备默认拥有继续邀请他人的权力;该能力由单独的 `can_invite` capability 控制。 +- 一个安装同时加入多个 Peer Space。MVP 每个安装只有一个 active Space;多身份/工作与个人空间后续再扩。 +- 第一版同步 Web Push subscription、Relay 登录态、Relay URL/密码/token、Peer 私钥、邀请 secret/consume ledger。 +- 第一版通过 Peer 传文件、远程文件浏览、Web Preview、远程创建 session。MVP 只开放 list/attach/view/control/resize。 +- 把 Quick Tunnel 当作有 SLA 的平台服务;它始终标为实验性第三方路径。 + +## 4. Security Model + +### 4.0 Relay-assisted direct authentication + +Stage 1 不创建 Peer identity。Relay 先验证账户、session ownership 和 permission,并签发短期单次 direct ticket;随后双方还要验证绑定 ticket/session/client/host 的 `account_key` possession proof。Relay ticket 只能授权路由,不能单独完成直连认证,因为 Relay 本身不持有 `account_key`,也应按潜在恶意 signaling intermediary 处理。 + +原始 `account_key` 仍留在现有 main-thread/Go owner。专用 helper 从它派生一次性的 direct proof key;Pion transport、signaling payload、日志和 Peer store 都不得接触原始 key。Stage 2 换成 Peer membership authenticator 时,只替换 handshake auth provider,不改变 DataChannel、record 或 frame path。 + +### 4.1 Identities + +- 每个安装生成独立 Peer device identity,与 Relay 账户完全无关。 +- 首台设备创建不可变的 signed genesis document(`space_id`、初始 admin、协议版本);其 hash 是信任锚。后续设备拿到 space membership certificate,而不是分别加入每台主机的孤立 trust domain。 +- 身份签名算法使用 P-256 ECDSA;会话密钥协商使用临时 P-256 ECDH。 +- Desktop 私钥保存在 OS keyring;iOS 使用新的 Keychain plugin;浏览器使用 IndexedDB 中不可导出的 WebCrypto `CryptoKey`。 +- `peer_id = base64url(SHA-256(canonical public key))`。 +- 每台 desktop 仍是自己本地 session 的最终 owner,可在 Space grant 之上进一步收窄权限;Space membership 本身不覆盖 session owner 的决定。 +- 不导入、不导出、不派生现有 Relay `account_key`。Peer 私钥、邀请 secret、会话密钥不得进入 URL query、日志或 Relay 配置。 + +P-256 的选择是为了让 Go、Safari/WKWebView、Chromium 和 Firefox 都能使用系统/WebCrypto 实现,不为前端新增密码学依赖。具体 key encoding、签名格式和跨语言向量必须在 P0 spike 后钉死。 + +### 4.2 Invitation and grant + +邀请分两层,解决 Quick Tunnel URL 每次变化与“预签发”之间的冲突: + +1. `CapabilityTicket`:不可变、预先签名、与网络路径无关。 +2. `ConnectionBundle`:分享时加入当前 route hints,再由签发设备签名。 + +建议 wire format: + +```text +atp1.. +``` + +签名直接覆盖原始 JSON bytes,验证端不得重新序列化 JSON,因此不依赖自制 canonical JSON。 + +`CapabilityTicket` 最少包含: + +```json +{ + "v": 1, + "invite_id": "uuid", + "batch_id": "uuid", + "space_id": "...", + "redemption_peer_id": "...", + "space_genesis_hash": "...", + "issuer_peer_id": "...", + "issuer_membership": "...", + "pairing_secret": "32-byte base64url", + "issued_at": 0, + "expires_at": 0, + "max_uses": 1, + "permission": "view|control|full", + "allowed_session_ids": [], + "can_invite": false +} +``` + +`ConnectionBundle` 包含 ticket、`routes[]`、`created_at` 和 bundle signature。route hint 可包含: + +- `rendezvous`: HTTPS/WSS base URL + opaque topic/peer id +- `quick_tunnel`: temporary HTTPS/WSS base URL +- 后续 `lan`: host/port + certificate hint + +规则: + +- 默认生成 5 个彼此独立、单次使用、24 小时有效的 ticket;数量和有效期可改。 +- 权限不能超过 issuer grant;`allowed_session_ids` 只能收窄。 +- 每张 ticket 指定签发设备为唯一 `redemption_peer_id`;该设备本地原子记录 `invite_id` consumed count。其它成员只能把兑换请求路由给签发设备,不能代为核销。 +- 这条限制是严格单次消费的必要条件:离线分区下若多个副本都能独立核销,就无法阻止同一 ticket 在两个分区各成功一次。 +- 签发设备离线时,预签 ticket 无需用户现场点击授权,但必须等该设备上线才能兑换。未来可增加显式 M-of-N redemption authority,不在 MVP 内。 +- 批量撤销只有传播到对应 redemption device 后才能阻止兑换。已复制到外部但核销设备尚未收到撤销的 delegated invitation 仍可能在过期前使用,UI 必须提示这一点。 +- 兑换成功后,签发设备签发 `DeviceGrant`/membership certificate,绑定 space、client public key、permission、session scope、`can_invite`、`can_sync_secrets`、签发/过期时间和 serial。 +- 后续连接使用 grant + client 私钥 proof,不再消耗邀请。 +- 删除 trusted device 会撤销其 grant serial;若该设备可签邀请,同时撤销其未兑换的 delegated tickets。 + +### 4.3 Handshake and record encryption + +不能只依赖 WebRTC DTLS。恶意 Rendezvous 可以建立两个 DTLS 连接并转发应用数据,因此 Peer 层还需要绑定设备身份的端到端握手: + +1. 双方生成临时 P-256 ECDH key。 +2. Client hello 携带 invite proof 或 DeviceGrant、client identity、nonce 和 ephemeral key。 +3. Host 验证 ticket/grant、使用次数和权限,并签名完整 transcript。 +4. Client 验证 host identity 与 Space membership chain 均锚定到 invitation 中的 genesis hash,再签名完整 transcript。 +5. ECDH secret 经 HKDF-SHA256 派生独立的 client-to-host / host-to-client keys。 +6. 后续每个 `proto.Marshal(Frame)` 先进入 Peer encrypted-record layer,再进入 DataChannel/WSS。 + +record layer 使用现有前端依赖已支持的 XChaCha20-Poly1305;每方向独立 key,nonce 由随机 connection prefix + 单调 counter 构造。AAD 至少绑定 peer protocol version、connection id、双方 peer id、方向和 counter。counter 回退、重复或越窗直接断开。 + +DataChannel 消息按 16 KiB fragment 发送,带 message id/index/count/total length;重组上限沿用 `proto` 的 16 MiB,超限、重复 fragment、超时未完成都断开。必须用 `bufferedAmountLowThreshold`/Pion 等价机制做 backpressure,不能无界缓存 PTY 输出。 + +### 4.4 Effective permission + +```text +effective = min(session.remote_permission, device_grant.permission, invite scope) +``` + +MVP frame allowlist: + +| Permission | Allowed client -> host frames | +|---|---| +| view | `LIST`, `ATTACH`, `PING` | +| control | view + `IN`, `RESIZE`, `CLAIM_DRIVER` | +| full | MVP 与 control 相同;后续才逐项开放 paste/file/preview/create | + +权限在两个边界执行: + +- Peer transport/router 收到远端 frame 时先拦截。 +- `desktop/uplink.go` 写 PTY 或调用本机能力前再次按 peer principal 拦截。 + +`allowed_session_ids` 为空表示主机当前所有本地会话;非空时 `LIST_RESP` 和所有 session frame 都过滤。任何 Relay 镜像会话不得经 Peer 再分享。去重和路由仍以 `session_id` 为权威,不按 `host_id`。 + +### 4.5 Peer Space governance + +Peer Space 没有“服务器上的用户记录”。所有决策都是签名 operation,并在设备相遇时复制: + +- Genesis 只作为不可变信任锚,不代表创建者是运行时 leader。当前 admin 集合来自已收敛的 governance log;创建者离线后其它 admin 仍能签发和撤销。 +- 普通成员可以写自己有权限的配置 collection。 +- `can_invite` 成员可以签发 depth=1 的 child membership;不能扩大自身权限。 +- admin 可以发布 member/grant revocation;revocation 使用 deny-wins,不能被普通配置 LWW 覆盖。 +- 删除成员触发 sync/vault epoch rotation。新 epoch key 分别用每个仍有效成员的 public wrapping key 封装。 +- 两个 admin 在分区中并发产生同一 `previous_epoch` 的 rotation 时,以 operation hash 的确定性顺序选出一个 winner;losing branch 在下次 anti-entropy 后丢弃并重新基于 winner 旋转。 +- 被撤销设备仍可能读取撤销前已经拿到的数据;rotation 只保证 forward secrecy,不能让已泄露信息失忆。 + +安全治理与普通配置不能共用一条 LWW 规则。成员撤销、capability 收窄、invite consume 是 deny/consume-wins;外观偏好等用户配置才使用 CRDT merge。 + +## 5. Architecture and Packages + +### 5.1 Go + +新增建议: + +- `internal/peerproto/` + - ticket/grant/bundle 的 typed models 与严格 parser + - handshake transcript、encrypted record、fragment codec + - 跨语言 golden vectors +- `internal/peercrypto/` + - P-256 key encoding/sign/verify、ECDH、HKDF、record keys + - 不接触 Relay `account_key` +- `internal/peerstore/` + - Peer Space、trusted devices、invite ledger、revocations、epoch envelopes 的接口和 file-backed desktop 实现 + - 原子写、0600 权限、schema version;secret-equivalent 字段由 keyring-backed storage key 加密 +- `internal/configsync/` + - signed mutation、HLC/version vector、CRDT merge、anti-entropy、snapshot/compaction + - transport-independent;Relay 与 Peer 只是不同 replication adapter +- `internal/peertransport/` + - Pion host、DataChannel adapter、ICE lifecycle + - 只实现 transport primitives,不 import `desktop/` +- `internal/rendezvous/` + - accountless encrypted signaling mailbox +- `cmd/atterm-rendezvous/` + - 可独立自建的最小服务 +- `internal/quicktunnel/` + - 后续 cloudflared lifecycle、URL extraction、timeouts + +修改建议: + +- `desktop/uplink.go` + - 继续作为所有跨远程 session 行为的 owner + - 接收 authenticated peer principal,把 Peer transport 接到本机 session/router + - 第二次执行 permission/scope gate +- `desktop/app.go` + - 暴露 Peer config、identity、invitation、trusted-device bindings +- `desktop/config.go` + - 只保存非秘密配置;私钥与 invitation secret 不写普通 config +- `desktop/prefs_sync_loop.go` / `internal/prefssync/` + - 迁移为统一 `configsync` engine 的 Relay adapter,不能让 Relay 与 Peer 两个 engine 各自回写造成同步环 +- `internal/proto/` + - 复用现有 v1 frame codec;MVP 不分配新 Type + - `docs/spec/protocol.md` 新增“Peer transport envelope”章节,不改变现有 WS payload + +Stage 0/P1 先做一个小型 refactor spike,验证现有 local relay/session router 的复用点。目标是把 `internal/relay/client_conn.go` 中与 WebSocket 无关的 frame dispatch 提取为 transport-neutral handler,由现有 WS 和 direct adapter 共用;不复制一套 LIST/ATTACH/replay/driver state machine。若 spike 证明该改动会扩大现有 Relay 风险,则改用 `desktop/uplink.go` 的窄 adapter,但同样禁止复制 `internal/session` 状态。 + +### 5.2 TypeScript/client + +新增建议: + +- `desktop/frontend/src/lib/peer/types.ts` +- `desktop/frontend/src/lib/peer/identity.ts` +- `desktop/frontend/src/lib/peer/invitation.ts` +- `desktop/frontend/src/lib/peer/handshake.ts` +- `desktop/frontend/src/lib/peer/transport.ts` +- `desktop/frontend/src/lib/peer/routeManager.ts` +- `desktop/frontend/src/lib/peer/configSync.ts` +- `desktop/frontend/src/components/SettingsPeer.vue` +- `desktop/frontend/src/components/PeerInviteDialog.vue` +- `desktop/frontend/src/components/PeerJoinDialog.vue` + +重构建议: + +- `lib/connection.ts` 引入最小 `BinaryFrameTransport` 接口:open/close/send/message/status。 +- 现有 WebSocket 是一个 adapter;RTCDataChannel 和 Peer WSS 各是一个 adapter。 +- `SessionConnection`/`SessionListConnection` 继续解析同一份 proto frame,不感知 WebRTC SDP。 +- `platform/types.ts` 增加 `PeerBridge`,Wails/Capacitor/Web 分别实现 identity storage 与 host capability。 +- `App.vue` 按 `session_id` 合并 Relay 与 Peer 的同一会话,并保存 route candidates;不得按 `host_id` 去重。 + +浏览器/WebView 约束: + +- WebRTC、WebCrypto 和 IndexedDB 均要求安全上下文;公网 HTTP 明确拒绝。 +- Quick Tunnel URL 只是 signaling/WSS endpoint。Web UI 保持在稳定 HTTPS origin,避免每次 `trycloudflare.com` hostname 改变导致浏览器 identity storage 换 origin。 +- iOS identity 走 native Keychain plugin,并遵守 Capacitor 8 的三件套注册规则。 + +## 6. Decentralized Configuration Sync + +### 6.1 Why the current engine cannot be reused unchanged + +`internal/prefssync` 当前依赖 Relay `GET/PUT /api/me/preferences` 返回权威 `updated_at`,冲突由服务器时间戳裁决。这不是多主复制模型。Peer 模式必须把“本地配置读写”和“通过哪条网络同步”分开: + +```text + +--------------------+ +local setters --------->| configsync engine |<--------- peer signed op log + | canonical replica | +Settings/UI <-----------| |<--------> Relay adapter (optional) + +--------------------+ +``` + +不能同时保留两个会直接 `WriteValue` 的同步 engine;否则 Relay pull 与 Peer merge 会互相回写、产生振荡或把较新值覆盖。迁移后只有 `configsync` 可以应用远端状态,现有 Relay API 只是一个 compatibility adapter。 + +### 6.2 Replication unit + +每个 mutation 是不可变、签名的 typed record: + +```text +SyncOp { + space_id + schema_version + op_id = device_id + monotonic_counter + actor_device_id + hlc = physical_ms + logical + collection + record_id + kind = set | delete | membership | revoke | rotate_epoch + payload_ciphertext + payload_hash + causal_context (compact version vector) + signature +} +``` + +- 每个 device counter 必须单调持久化,回退视为 identity/store corruption 并停止同步。 +- HLC 只用于并发用户配置的确定性 tie-break;因果先后由 version vector 判断。 +- 入站 physical time 相对本机最多接受有限偏移,防止错误时钟永久压过所有后续修改。 +- mutation 在签名之后不可变;Relay adapter 的旧 snapshot 没有 Peer signature,只能在本地转成 actor=`relay:` 的 compatibility op。 +- payload 先按 collection schema 校验,再应用;未知 schema 保留但不解释,方便滚动升级。 + +### 6.3 Merge rules + +没有全局 leader,也不在冲突时弹窗。所有正常设备收到相同 op set 后必须得到相同结果: + +| Data shape | Rule | +|---|---| +| Scalar preference | causal-newer wins;并发时 `(HLC, actor_device_id)` LWW | +| Map/entity collection | record-id scoped remove-wins observed map;不同记录并发编辑都保留 | +| Ordered collection | entity 使用 OR-map;顺序使用可稳定比较的 position id,不同步整个数组覆盖 | +| Local applicability | 保留合法远端值,但本机不适用时不启用,例如不存在的 `default_shell` | +| Membership/revocation | 独立 governance log;deny-wins,不走普通 LWW | +| Invitation consumption | 仅 redemption device 的原子 ledger 有权决定 | + +`quick_templates`、profiles、SSH hosts 必须逐记录合并,不能继续把整个数组/加密 blob 当成一个 LWW value,否则 A 设备新增记录、B 设备编辑另一条记录时必然丢数据。第一版可不做同一 profile 内的逐字段 CRDT,但必须做到 record-level merge。 + +### 6.4 Anti-entropy protocol + +受信 Peer 建立连接后,在独立的 reliable ordered `atterm-sync-v1` DataChannel 上同步,避免大配置阻塞 terminal input/output: + +1. 双方交换 `space_id`、schema range、version vector、collection digest、current key epochs。 +2. 按 version vector 请求缺失 ops,固定条数/字节上限分批发送。 +3. 验签、校验 capability/schema、持久化 op,再 materialize 本地 view。 +4. 返回 durable ack vector;不能在落盘前 ack。 +5. op log 超阈值时生成带覆盖 vector 的签名 snapshot。只有 snapshot 覆盖本机已知因果历史时才能 compact。 + +离线语义: + +- 本地修改立即生效并进入 pending op log。 +- 任意两台设备在线并能建立 Peer connection 时双向 anti-entropy,不区分“主/从”。 +- 小规模 Space 默认与所有当前可达成员同步;成员较多后再按 version-vector lag 选择固定 fanout,不能依赖某一台永远在线的 hub。 +- A 与 C 从未同时在线也能经 B 传播 ops。 +- 所有设备同时离线时没有同步;Rendezvous 不保存 op/snapshot。 +- iOS/Web 受后台生命周期限制,只保证 app 前台或系统允许网络活动时参与;Peer-only 不假装具备 Relay/Web Push 的后台即时性。 +- 长期离线设备回来后若所需 ops 已 compact,获取完整 snapshot + snapshot 之后的 ops。 + +WSS fallback 使用同一 encrypted record codec,并给 sync channel 最低调度优先级:input/control > terminal output > config sync。同步流量不能增加 session subscriber count,也不能破坏 lazy PTY stream。 + +### 6.5 Bootstrap and key hierarchy + +新设备兑换 invitation 时,从 `redemption_peer_id` 获取: + +- Space membership certificate 与 governance head。 +- 当前 portable-config snapshot + version vector。 +- 当前 `sync_epoch_key` envelope。 +- 仅当 grant 含 `can_sync_secrets` 时,获取 `vault_epoch_key` envelope 和允许的 secret collections。 + +普通配置与敏感 vault 分开轮换,避免“能同步主题”自动等于“能拿 SSH 私钥”。密钥层级: + +```text +device identity key never synced + -> wraps sync_epoch_key portable preferences/config + -> wraps vault_epoch_key opted-in profiles env / SSH credentials and private keys +``` + +Peer channel 已端到端加密,但同步 payload 仍使用 epoch key 封装后再进入 op log,这样本地 snapshots、未来可选的第三方 store-and-forward 也不会变成明文。AAD 必须包含 `space_id || collection || record_id || op_id || epoch`,并在 `internal/e2eecrypto/aadtags.go`/`docs/spec/protocol.md` 注册独立 namespace,禁止与 Relay account envelopes 交叉重放。 + +### 6.6 What syncs + +| Class | Examples | Peer default | +|---|---|---| +| Portable scalar | locale、terminal theme/font/cursor/scrollback、shortcuts、task display prefs | On | +| Portable collections | quick templates、profiles metadata、SSH host metadata | On, record-level merge | +| Sensitive vault | profile env、SSH password/passphrase/private key | Off;用户显式开启且目标成员有 `can_sync_secrets` | +| Machine-local | WebGL renderer、window state、log path、download path、local shell/path applicability | Never | +| Connection/account | Relay URL/password/session token、`account_key`、Rendezvous runtime state、Quick Tunnel URL | Never | +| Peer secrets | device private key、invite secret/consume ledger、session keys | Never | +| Ephemeral/session | scrollback、PTY bytes、recovery snapshot、current driver、notification subscription | Never | + +`pinned_session_ids` 只对同一 `session_id` 在其它设备上仍有意义时展示;孤儿 pin 可保留但不制造 placeholder。Web Push 不属于去中心化能力,Peer-only 模式只能做本地通知。 + +### 6.7 Relay/Peer coexistence and migration + +- `configsync` local replica 是唯一 canonical state,Relay/Peer 都是 adapter,不互为上游下游。 +- 创建新 Space 时把当前 portable config 作为 genesis 后的第一批 signed ops。 +- 加入已有 Space 时先保留一份本地 pre-join snapshot,再以 Space snapshot 初始化;本机已有 customized portable values 显示为“待导入”,只有用户确认后才生成新 ops。不能让一台新设备的默认值或旧值静默覆盖整个 Space。 +- 首次升级把现有 `PrefsMeta` + 当前值 seed 成 local signed ops;已存在 Relay 账号时先完成一次 pull,再生成 migration snapshot,避免把旧本地默认值覆盖 Relay 自定义。 +- Relay pull 项映射成 compatibility ops;Peer winner 需要同步到 Relay 时走现有 PUT,Relay echo 通过 value hash 去重,不再生成一轮本地 mutation。 +- Relay 的 whole-blob `profiles_encrypted`/`ssh_hosts_encrypted` 与 Peer record-level collection 并存期间,由 adapter materialize/拆分;迁移完成前保留 round-trip tests。 +- 用户关闭 Relay 后只停 Relay adapter,不删除 local replica、Space keys 或 pending ops。 +- 用户退出/删除 Peer Space 只移除 Peer membership 与 Space keys,不清除本地业务配置;是否同时清配置必须另行确认。 + +## 7. Quick Tunnel + +Quick Tunnel 是可选路径,不属于 atterm 账户或官方 Rendezvous: + +- Desktop 在 loopback 随机端口启动 peer gateway。 +- `cloudflared tunnel --url http://127.0.0.1:` 建立临时公网入口。 +- 解析 `https://*.trycloudflare.com`,启动超时 30 秒,退出超时 5 秒;进程退出或 app 关闭后 URL 失效。 +- gateway 同时支持加密 signaling 和加密 binary WSS。 +- 优先通过 tunnel 信令建立 WebRTC;若 DataChannel 在限定时间内失败,可在用户允许时沿同一 WSS 继续传 encrypted records。 +- WSS 回退状态显示为“经 Quick Tunnel”,不能显示为“P2P 直连”。Cloudflare 能观察 IP、连接时间与流量大小,但不能读取 terminal frame。 + +落地前必须完成独立 spike: + +- Windows/macOS/Linux 进程管理和 URL 输出格式。 +- WebSocket upgrade、长连接和 idle timeout 实测。 +- `cloudflared` Apache-2.0 NOTICE、二进制体积、平台签名/公证与 release asset 供应链。 +- 是否随 app 打包。若未通过供应链 gate,首版只支持自动发现系统已有 `cloudflared`,UI 明确提示缺失,不静默下载未验签二进制。 + +Quick Tunnel 是第一个无 Relay 账户交付路径。它先跑通 Peer Space、邀请、去中心化同步与加密 WSS fallback;临时 URL 的可用性问题由后续 Rendezvous 解决。 + +## 8. Rendezvous Service + +Rendezvous 在 Quick Tunnel 无账户模式稳定之后交付,是无账户、无持久数据库的短期信令服务: + +- Host 维持到服务的 WSS registration,使用 peer identity challenge signature 证明 peer id 所有权。 +- Client 向高熵 opaque topic 投递 offer/ICE;Host 回 answer/ICE。 +- 信令 payload 在客户端与主机间加密,服务只看到 topic、大小、时间和来源 IP,不看到 SDP candidate 内容。 +- mailbox TTL 120 秒;单 message 64 KiB;单 topic、单 IP、全局连接数均有限制。 +- 不接受 terminal `proto.Frame`,不提供 store-and-forward,不提供 TURN。 +- 必须配置 TLS、Origin allowlist、rate limits;生产环境不支持明文公网 HTTP。 +- 官方与自建服务使用同一协议;客户端只把 URL 当配置,不把官方域名写死在 crypto transcript。 + +建议接口在 spec 阶段定为 WebSocket-only,避免 polling 与 WS 两套状态机。服务可独立部署,也可由官方基础设施反代到固定路径。 + +## 9. Settings Information Architecture + +保留 Settings 弹窗,不改成独立页面: + +- Desktop 调整为自适应约 `1040-1080 x 700-720`,受 viewport max 限制。 +- Mobile 保持 full-screen。 +- sidebar、content、footer 都使用 `min-height: 0`;只让内容区滚动,确保底部 Realm/advanced sections 可达。 + +导航调整: + +- `Relay 账户` + - 登录/注册、官方或自建 Relay + - Relay E2EE/同步/fallback 设置 + - 已登录设备列表与逐台/其它/当前设备退出 +- `Peer 连接` + - 本设备 Peer identity/fingerprint + - Peer Space id、成员/权限、sync/vault key epoch + - Host 开关与当前可达性 + - Official/custom/disabled Rendezvous + - Quick Tunnel 状态 + - Trusted devices、权限、撤销 + - Pre-signed invitation batch、QR/copy/revoke + - Join existing host + - Config sync 状态:last sync、pending ops、conflict count、手动 sync + +实现上移除 standalone `devices` tab,把 `SettingsDevices.vue` 作为 Relay Account 内部 section 复用;不要复制第二份设备列表逻辑。`SettingsPeer.vue` 在 Desktop 提供 host + client controls,在 Web/Capacitor 只提供 client/join 与本设备 identity controls。 + +Session UI 增加实际 route indicator:`Direct`、`Quick Tunnel`、`Relay`。这只是连接状态,不进入 session identity,也不改变以 `session_id` 为准的合并规则。 + +## 10. Delivery Plan + +### P0 - Relay P2P protocol and spikes + +- [ ] 冻结 Relay signaling/direct ticket/account-key proof/record/route handover 规范。 +- [ ] 验证 Go↔Browser crypto vectors、Pion/WebKit、fragment/backpressure。 +- [ ] 证明 Relay→Direct→Relay 按 OUT seq 切换无 gap/duplicate,且只有一个 input/driver lease。 +- [ ] Quick Tunnel、Peer identity、config CRDT、Rendezvous 只做非阻塞可行性记录。 + +### P1 - Relay signaling and direct transport + +- [ ] 增加 authenticated Relay signaling control plane 和 scoped one-time direct ticket。 +- [ ] Pion host、browser RTC adapter、可插拔 handshake authenticator。 +- [ ] 第一种 authenticator 使用 Relay account + `account_key` possession proof。 +- [ ] transport-neutral frame path 复用现有 LIST/ATTACH/replay/driver state。 + +### P2 - Relay-first direct upgrade and fallback + +- [ ] Relay attach 后 opportunistic upgrade,DIRECT_READY 后才释放 Relay subscriber。 +- [ ] Direct 失败按 last committed seq 恢复 Relay,不重复 OUT/IN。 +- [ ] 保持 lazy stream、REPLAY_PROGRESS、permission 双重 enforcement。 +- [ ] 上线 `Prefer direct connection`、route indicator、metrics 和 staged feature flag。 + +Relay 加速 release gate 到此:旧客户端不变、直连失败永远可回现有 Relay。 + +### P3 - Peer Space and decentralized config + +- [ ] Device identity、Space genesis/membership、预签邀请、issuer-bound consume、revocation。 +- [ ] `configsync` signed op/HLC/version vector/CRDT/snapshot/epoch keys。 +- [ ] 现有 18 个同步 key 迁移;Relay 成为 optional compatibility adapter。 +- [ ] Stage 1 transport 接入 Peer membership authenticator,不复制 WebRTC/frame stack。 + +### P4 - Quick Tunnel accountless route + +- [ ] cloudflared lifecycle 和 loopback peer gateway。 +- [ ] 临时 route bundle、tunnel signaling、WebRTC-first。 +- [ ] 用户允许时使用 application-encrypted WSS fallback。 +- [ ] URL 轮换只刷新 route bundle,不重建 membership。 + +### P5 - Accountless Quick Tunnel UX + +- [ ] Desktop/Web/iOS invitation join、bootstrap、reconnect、anti-entropy。 +- [ ] Settings 合并 `Relay 账户`,新增 `Peer 连接`、Quick Tunnel 和 sync state。 +- [ ] Relay devices 与 Peer members 分离;secret sync default off。 +- [ ] 无 Relay 账号完成 attach/control/config sync。 + +Quick Tunnel accountless release gate 到此:明确临时 URL 与至少两台设备同时可达才同步的限制。 + +### P6 - Minimal Rendezvous service + +- [ ] `internal/rendezvous` + `cmd/atterm-rendezvous`。 +- [ ] TLS/WSS、encrypted SDP/ICE、presence TTL、limits、health/metrics。 +- [ ] 无账户 DB、无 config store、无 terminal relay、无 TURN。 +- [ ] 官方与自建运行同一 contract suite。 + +### P7 - Stable discovery and Rendezvous UX + +- [ ] 稳定 member discovery、sync dialing、official/custom/disabled config。 +- [ ] Desktop restart 后无需重新分享 Quick Tunnel URL 即可重连。 +- [ ] Rendezvous 只参与连接建立;WebRTC 成功后数据不经过服务。 +- [ ] Direct 失败可选 Quick Tunnel;没有 fallback 时明确报告 NAT 限制。 + +### P8 - Unified hybrid routing + +- [ ] 按 `session_id` 合并 Direct、Quick Tunnel、Relay candidates。 +- [ ] `Direct > enabled Quick Tunnel > enabled Relay`,同时尊重 trust principal 和用户策略。 +- [ ] route generation + OUT seq 去重、single input lease、flap cooldown。 +- [ ] Peer-only 不触发 Relay 登录依赖。 + +### P9 - Capability expansion and hardening + +- [ ] paste、file explorer、session create、preview 各自单独开放权限。 +- [ ] optional TURN、LAN/mDNS、manual/IPv6、完全无公网模式。 +- [ ] fuzz/NAT/chaos/soak、资源上限、grant/key renewal、battery/data measurement。 + +## 11. Test Strategy + +### Unit and vectors + +- Go/TS cross-language golden vectors:key encoding、signature、ticket、grant、transcript、HKDF、record、fragment。 +- Fuzz parsers:invite、bundle、handshake、record、fragment、signaling envelope。 +- Fake clock:expiry、TTL、revocation、counter/replay windows。 +- Permission table exhaustive test:每个现有 `proto.Type` 必须显式 allow/deny;新增 Type 默认 deny。 +- CRDT property tests:交换律、结合律、幂等性;随机 op 顺序/重复/丢包重试后收敛。 +- Governance tests:并发 revocation/rotation、stale epoch、无权限 actor、counter rollback 全部 fail closed。 + +### Integration + +- Pion host ↔ headless Chromium/WebKit client。 +- Relay attach → Direct upgrade → Relay fallback 重复切换,验证 OUT seq、single input lease 和 lazy subscriber continuity。 +- NAT matrix:host candidate、server-reflexive、blocked UDP、symmetric NAT simulation。 +- Rendezvous restart、packet reorder、duplicate ICE、late answer、host reconnect。 +- Quick Tunnel process fake + opt-in real smoke test。 +- Relay + Peer simultaneous listing/attach and lazy stream assertions。 +- A↔B、B↔C、A/C 不直连的 anti-entropy 传播;离线编辑、snapshot bootstrap、compaction 后旧设备回归。 +- Relay compatibility adapter 与 Peer adapter 同时开启,验证无 echo loop、无 whole-blob 数据丢失。 + +### Client/UI + +- Platform contract tests for Wails/Web/Capacitor identity storage and invite flows。 +- Settings 真实尺寸截图、滚动到底、mobile safe area、expired invite countdown。 +- Sync UI 覆盖 never synced、pending、syncing、converged、conflict、stale member、key rotation failed。 +- URL tests prove secret only appears after `#` and is stripped from errors/analytics/logging。 +- `new RTCPeerConnection`/`new WebSocket` 同步异常都进入统一 failure/retry state,不击穿 app boot。 + +### Release gates + +- `go test -race ./internal/peer... ./internal/configsync/... ./internal/rendezvous/... ./desktop/...` +- `go vet -tags webkit2_41 ./...` +- `cd desktop/frontend && npm run build && npm test` +- `cd web && npm run build && npm test && npm run test:contract` +- `cd mobile && npm test` +- WebKit/iOS manual matrix before enabling by default。 +- Peer feature flag initially default off;internal/beta soak 后再默认展示入口。 + +## 12. Risk Register + +| Risk | Impact | Mitigation / gate | +|---|---|---| +| Symmetric NAT / UDP blocked | WebRTC direct fails | P1-P2 自动回现有 Relay;P4 Quick Tunnel WSS;后续 user-configured TURN | +| Invite copied/replayed | Unauthorized device enrollment | 256-bit secret、short expiry、仅 issuer/redemption device 原子 consume、batch/device revoke | +| Delegated issuer compromised | Can mint valid child invitations | `can_invite` off by default、depth 1、permission narrowing、issuer revoke invalidates descendants | +| No online overlap | Config changes remain pending | 明确 eventually-consistent 语义;显示 pending/last-sync;Rendezvous 不偷偷存配置 | +| Concurrent config edits | Silent lost update | causal context + deterministic CRDT;collections record-level merge;property tests | +| Clock skew / forged future HLC | One actor dominates LWW | bounded physical skew、logical clock、device revoke;security decisions never use LWW | +| Revocation during partition | Revoked device remains active in stale partition | deny-wins when observed、epoch rotation、UI shows stale members;document unavoidable partition window | +| Concurrent epoch rotation | Space forks and devices cannot decrypt | same-parent deterministic winner、losing branch rebase、recovery tests | +| Sync/vault key confusion | Non-secret member receives credentials | separate epoch keys/capabilities/AAD namespaces;secret sync off by default | +| Op-log/tombstone growth | Disk/memory growth | signed snapshots、ack vectors、bounded retention;stale device uses full bootstrap | +| Malicious Rendezvous MITM | Host spoofing or terminal disclosure | Signed ephemeral ECDH transcript + application record encryption;signal payload encrypted | +| Malicious/compromised Relay signaling | Direct-channel MITM | Relay ticket 只做路由授权;双方还必须验证 `account_key`-bound transcript proof | +| DTLS identity not bound | Two-leg proxy reads app frames | Never treat DTLS alone as authorization; Peer handshake keys every record | +| Browser insecure context | WebCrypto/WebRTC unavailable | HTTPS/localhost only; fail before join with actionable state | +| DataChannel size/backpressure | Memory growth or Safari disconnect | 16 KiB fragments、bounded reassembly、bufferedAmount watermarks | +| Lazy stream regression | PTY bytes uploaded while idle | subscriber lifecycle integration tests; one logical subscription across route changes | +| Permission bypass | Remote PTY/filesystem access | transport gate + desktop host gate; exhaustive frame matrix; unknown Type deny | +| Quick Tunnel outage/change | Optional connection path unavailable | never required for local/Relay/Rendezvous; capability spike; visible third-party status | +| cloudflared supply chain | Unsigned executable execution | package from pinned upstream artifact with checksums/signing review, or system binary only | +| `account_key` leakage | Breaks existing Relay E2EE | 原始 key 只留现有 main-thread/Go owner;专用 API 派生一次性 direct proof key,transport/store 不持有原始 key;redaction tests | +| Duplicate Relay/Peer routes | Duplicate input/subscription | merge by `session_id`; one active route lease; explicit handover state machine | +| Browser origin changes | Device identity appears lost | stable HTTPS UI origin; Quick Tunnel is endpoint only, never identity storage origin | +| Host trust DB loss | Old grants/replay ledger unavailable | fail closed; identity backup is out of scope; UI explains reset invalidates all devices | + +## 13. Rollout Order + +Recommended PR sequence: + +1. Relay direct-path spec + account-key proof/Pion/route-handover spikes. +2. Relay signaling control plane + Pion/browser transport adapters. +3. Relay-first direct upgrade、seq handover、automatic Relay fallback and beta rollout. +4. Peer Space identity/invitations + decentralized config replica. +5. Quick Tunnel lifecycle、WebRTC signaling、encrypted WSS fallback. +6. Accountless join/bootstrap/Settings/sync; Quick Tunnel MVP soak. +7. Minimal accountless Rendezvous service + official/self-hosted contract. +8. Stable discovery、sync dialing and Rendezvous UX soak. +9. Unified Direct/Quick Tunnel/Relay route manager. +10. Full capabilities and LAN/manual/TURN/no-public-infrastructure routes. + +每个 PR 必须保持现有 Relay-only flow 可独立运行;任何 Peer 初始化失败都只能降低 Peer 状态,不能阻止 desktop boot、local PTY、Relay uplink 或 Settings 打开。 diff --git a/docs/superpowers/specs/2026-09-15-user-traffic-stats-design.md b/docs/superpowers/specs/2026-09-15-user-traffic-stats-design.md index b9150fcc..2100c966 100644 --- a/docs/superpowers/specs/2026-09-15-user-traffic-stats-design.md +++ b/docs/superpowers/specs/2026-09-15-user-traffic-stats-design.md @@ -1,8 +1,9 @@ # 用户网络流量统计监控 — 设计 - 日期:2026-09-15 +- 修订:2026-09-23(增加个人看板与 P2P 流量) - 状态:已批准(brainstorming 分节确认 + 关键决策拍板) -- 范围:relay 服务端埋点 + 聚合 + 日汇总落库 + admin API + admin 前端面板 +- 范围:Relay/P2P 埋点 + 聚合 + 日汇总落库 + admin API + 当前账号个人看板 ## 目标 @@ -21,7 +22,9 @@ | flush 策略 | 定时 flush(60s)+ graceful shutdown 再 flush 一次 | | 多实例 | 共享表,各实例对同一行 UPSERT 累加(bytes += delta) | | 埋点方式 | 新增独立计量钩子,入站在 readFrame、出站包 writeFrame helper;不复用 debugFrame | -| 可见范围 | 纯 admin,先落地;普通用户自查入口不做 | +| 可见范围 | admin 可看全局 Relay 明细;普通用户只能看自己的 Relay/P2P 日汇总 | +| P2P 口径 | host 视角的 terminal frame wire bytes,发送/接收分开;不含 ICE/SDP/DataChannel 开销 | +| 隐私边界 | 个人 API 不返回 user id/email;P2P 统计不含 session id、candidate、token 或 terminal 内容 | ## 架构总览 @@ -41,6 +44,11 @@ [前端层] AdminPanel "traffic" tab → admin/Traffic.vue ``` +P2P 数据旁路:已认证 host 按阈值或连接关闭发送 `direct_stats` 聚合增量,Relay 按 +认证上下文中的 user id 累加到 `directMetrics`,随同一 60s flush 写入 +`direct_traffic_daily`。该上报由账号自己的 host 产生,可用于个人可观测性和平台容量趋势, +但不能作为计费或配额的可信依据。 + 数据流关键点: - 埋点只在**真正过网**时计数:出站在 `c.Write` 返回 nil 后计,入站在 `readFrame` 成功 返回后计。 @@ -176,6 +184,20 @@ QueryTraffic(ctx context.Context, from, to string) ([]TrafficRow, error) - i18n:`desktop/frontend/src/i18n/messages/{en,zh-CN}.ts` 加 `admin.trafficTab` 及表头 label(中英两套)。 +### 7. 个人 Relay/P2P 看板(2026-09-23 修订) + +- `GET /api/me/traffic?from=&to=` 由 `requireSession` 保护,user id 只取请求上下文;日期 + 最多 180 天,允许一次取当前 90 天和前一周期。响应不带 user id/email,Relay 同时返回 + 帧级明细与兼容的按日 in/out 汇总,P2P 按日返回 attempts/successes/fallbacks/ + bytes_sent/bytes_received。 +- `direct_traffic_daily` 主键为 `(user_id, day)`,使用 additive UPSERT,支持多 Relay + 实例共享 Postgres 后自然汇总。 +- host 的 `direct_stats` 同时携带 `bytes_sent` / `bytes_received`;`bytes_avoided` 仅为旧 + Relay 兼容字段。每个非零方向的单条增量最大 64 MiB,只有 host role 可以上报。 +- Web/Capacitor 的 `SettingsAccount.vue` 与桌面端 `SettingsRelay.vue` 都只在认证成功后挂载 + 同一个紧凑看板,支持 7/30/90 天范围,展示 Relay、P2P 总量、直连成功率和每日双序列 + 趋势。未登录时不发起统计请求。 + ## 错误处理 - 埋点:`recordTraffic` 永不返回 error、永不 panic、永不阻塞收发路径(加锁累加是唯一开销)。 @@ -197,8 +219,8 @@ QueryTraffic(ctx context.Context, from, to string) ([]TrafficRow, error) ## 明确不做(out of scope / YAGNI) - 分钟级时间序列、实时流量曲线 -- 普通用户自查入口(`/api/me/traffic`) - 限流 / 配额 / 告警 +- 将 P2P 客户端上报用于计费或安全审计 - 图表库依赖 - 历史数据保留期自动清理(可后续加 cron) @@ -212,6 +234,9 @@ QueryTraffic(ctx context.Context, from, to string) ([]TrafficRow, error) - `internal/userstore/migrations/postgres/0012_relay_traffic.sql` - `internal/userstore/traffic.go`(Store 方法实现,或并入现有文件) - `desktop/frontend/src/components/admin/Traffic.vue` +- `internal/relay/me_traffic.go` +- `internal/userstore/migrations/{sqlite,postgres}/0013_direct_traffic.sql` +- `desktop/frontend/src/components/AccountTrafficDashboard.vue` 修改: - `internal/relay/server.go`(trafficMeter 字段 + ticker + shutdown flush + readFrame 计量 + writeFrame 收敛) diff --git a/docs/superpowers/specs/2026-09-22-relay-p2p-acceleration-design.md b/docs/superpowers/specs/2026-09-22-relay-p2p-acceleration-design.md new file mode 100644 index 00000000..a320377c --- /dev/null +++ b/docs/superpowers/specs/2026-09-22-relay-p2p-acceleration-design.md @@ -0,0 +1,282 @@ +# Relay-assisted P2P Acceleration Design + +> Status: Accepted for v0.6 implementation +> Date: 2026-09-22 +> Parent plan: [Accountless P2P](../plans/2026-09-22-accountless-p2p.md) +> Release boundary: v0.6.x only; this document does not define Peer Space or accountless access + +## 1. Outcome + +已登录同一 Relay 账户的客户端仍先通过现有 `/client` attach。随后它可以经新的 Relay signaling 通道与 owning desktop 建立 WebRTC DataChannel,把 terminal data path 升级为直连。登录、session list、权限、driver arbitration、presence 和 fallback 仍由 Relay 管理。 + +直连失败、超时或中途断开时,客户端从最后 committed OUT sequence 重新 attach Relay。关闭 feature flag 后,运行行为必须与 v0.5 Relay-only 完全一致。 + +本阶段不创建 Peer identity,不签发 accountless invitation,不引入 TURN,也不改变 `internal/proto.Version = 1`。 + +## 2. Trust Boundary + +一次 direct attempt 同时需要两类授权: + +1. Relay authorization:Relay 已验证 user、session、permission、active uplink 和 client connection,并通过已鉴权 signaling WS 向双方下发同一份短期 pending authorization。 +2. End-to-end authentication:双方用 `account_key` 派生的 proof key 对包含 ticket、claims 和临时 P-256 公钥的 transcript 做角色分离 HMAC。 + +Relay 知道 ticket、claims、SDP/ICE timing 和连接元数据,但不知道 `account_key`、ECDH private key、proof key 或 record key。因此 Relay 可以拒绝/延迟/重放 signaling,但无法伪造能通过另一端校验的 direct handshake。 + +`account_key` 不发送给 Relay、DataChannel 或 native bridge。现有 key owner 只输出本次握手的 proof 与方向密钥;这些派生值在 attempt 结束时清除。 + +## 3. Signaling Surface + +### 3.1 Endpoint and authentication + +- 新增 `GET /direct-signal` WebSocket;不复用 terminal `/client`、`/uplink` frame stream。 +- Browser 使用现有 `Sec-WebSocket-Protocol: atterm-token.`,native client 使用现有 Bearer/session auth 规则。 +- Origin、IP rate limit、per-user connection limit 和 max message size 使用 Relay 现有安全策略。 +- signaling schema 有独立 `version: 1`,不占用 `proto.Type`,也不改变 terminal frame payload。 +- 单条 JSON message 上限 64 KiB;未知字段忽略,未知 message kind 拒绝当前 attempt 而非断开账户会话。 + +### 3.2 Attempt creation + +Client sends: + +```json +{ + "version": 1, + "kind": "direct_request", + "request_id": "client-generated UUID", + "session_id": "UUID", + "client_instance_id": "random install/boot scoped id", + "since_seq": 42 +} +``` + +Relay verifies the authenticated user owns the requested session, the requested permission is still available, and the owning uplink has advertised direct capability. It then creates: + +- `attempt_id`: random UUID, used for routing and log correlation. +- `ticket`: 32 random bytes, base64url without padding. +- exact claims: `user_id`, `session_id`, `host_id`, `client_instance_id`, effective permission, `expires_at_unix_ms`. +- expiry: 30 seconds from issue. + +The ticket is an opaque single-use capability, not a self-contained signed token. Both endpoints receive it only over their authenticated Relay signaling connections. The host stores a hash of the ticket with the exact claims in a bounded pending-attempt table. A DataChannel handshake is accepted only if it matches that pending entry; successful authentication, expiry, explicit cancel, or connection close consumes it atomically. + +This avoids adding a second persistent Relay signing identity. It does not weaken end-to-end authentication because possession of the ticket alone is insufficient without the account-key proof. + +### 3.3 Routed messages + +After `direct_offer`, Relay only routes bounded opaque signaling payloads associated with the attempt: + +- `offer`, `answer`: one each, max 32 KiB. +- `ice_candidate`: max 8 KiB each, max 64 per side. +- `ice_end`: one per side. +- `cancel`: terminal for the attempt. + +Relay never parses SDP to make authorization decisions and never logs SDP, ICE candidates, ticket bytes, proof bytes or DataChannel payloads. Diagnostics may retain attempt duration, coarse candidate type, terminal result and a random attempt id for at most the normal metrics retention period. + +### 3.4 ICE discovery and privacy + +Stage 1 uses `stun:stun.cloudflare.com:3478` for server-reflexive ICE candidate discovery and does not provide TURN. STUN is not a tunnel or terminal-data relay: it observes the connecting endpoint's source IP and request timing, while terminal records flow directly between the two WebRTC peers. Direct peers necessarily learn the candidate addresses needed to connect, and the authenticated atterm Relay routes those candidate strings in memory without logging them. If public STUN or peer-to-peer UDP is unavailable, the attempt fails into the existing Relay path; terminal availability does not depend on STUN. + +## 4. Pluggable Handshake Authentication + +Transport depends on this narrow contract: + +```go +type HandshakeAuthenticator interface { + BuildProof(transcript []byte, role Role) ([]byte, error) + VerifyProof(transcript []byte, role Role, proof []byte) error + KeyBinding(transcript []byte) ([]byte, error) +} +``` + +The v0.6 implementation is `AccountKeyAuthenticator`. Stage 2 adds `PeerMembershipAuthenticator` without changing P-256 ECDH, record framing, fragmentation or route handover. + +The raw authentication secret must remain inside its current owner. Implementations may expose a derived per-attempt proof/key binding to the transport, never the root `account_key` or Peer epoch key. + +## 5. Canonical Transcript and Handshake + +### 5.1 Canonical transcript + +All integers are unsigned big-endian. All variable fields are `u16 length || bytes`; values over their declared bounds are rejected before allocation. + +```text +literal "atterm-direct-handshake-v1" (26 bytes) +attempt_id (16-byte UUID) +ticket (u16 + 32 bytes) +session_id (16-byte UUID) +user_id (u16 + UTF-8, max 128) +host_id (u16 + UTF-8, max 128) +client_instance_id (u16 + UTF-8, max 128) +permission (u8: view=1, control=2, full=3) +expires_at_unix_ms (u64) +client_ephemeral_public (u16 + 65-byte uncompressed P-256 point) +host_ephemeral_public (u16 + 65-byte uncompressed P-256 point) +``` + +Both endpoints reconstruct these bytes from their locally validated pending authorization and exchanged public keys. Any mismatch produces a different proof. + +### 5.2 Key schedule + +```text +transcript_hash = SHA-256(transcript) +proof_key = HKDF-SHA256( + ikm = account_key, + salt = transcript_hash, + info = "atterm-direct-proof-v1", + len = 32) + +client_proof = HMAC-SHA256(proof_key, + "atterm-direct-client-v1" || transcript_hash) +host_proof = HMAC-SHA256(proof_key, + "atterm-direct-host-v1" || transcript_hash) + +shared_secret = P-256 ECDH(local_private, peer_public) +traffic_secret = HKDF-SHA256( + ikm = shared_secret, + salt = proof_key, + info = "atterm-direct-traffic-v1" || transcript_hash, + len = 96) + +traffic_secret[0:32] = client_to_host_key +traffic_secret[32:64] = host_to_client_key +traffic_secret[64:80] = client_to_host_nonce_prefix +traffic_secret[80:96] = host_to_client_nonce_prefix +``` + +The transcript is authenticated before either endpoint accepts application records. P-256 public points must pass the runtime's curve validation; all-zero or malformed shared secrets are rejected. + +### 5.3 Message order + +The ordered reliable DataChannel label is `atterm-terminal-v1`, negotiated in-band, binary only. + +```text +client -> host CLIENT_HELLO(attempt_id, ticket, client_pub) +host -> client HOST_HELLO(host_pub, host_proof) +client -> host CLIENT_FINISH(client_proof, HMAC(proof_key, "atterm-direct-finish-v1" || transcript_hash)) +host -> client AUTH_OK(initial host record counter = 0) +``` + +`client_proof` 不能放进 `CLIENT_HELLO`:canonical transcript 包含 `host_pub`,client 在收到 `HOST_HELLO` 前无法构造该 proof。Host 先用已鉴权 signaling 下发的 pending authorization 校验 `attempt_id + ticket`,收到 `client_pub` 后才能构造完整 transcript 并证明 host role;client 验证 host proof 后在 `CLIENT_FINISH` 同时证明 client role和确认完整 transcript。Host 不在 `CLIENT_FINISH` 验证通过前发送 terminal data。任何 parse、expiry、claim、proof 或 state mismatch 都关闭 DataChannel 并消费 attempt。Handshake timeout 是 DataChannel open 后 10 秒。 + +握手消息全部是 binary DataChannel message,固定布局如下;`version=1`,kind 分别为 `1..4`,不允许 trailing bytes: + +```text +CLIENT_HELLO = version(1B) || kind=1(1B) || attempt_id(16B) || ticket(32B) || client_pub(65B) +HOST_HELLO = version(1B) || kind=2(1B) || host_pub(65B) || host_proof(32B) +CLIENT_FINISH = version(1B) || kind=3(1B) || client_proof(32B) || finish_proof(32B) +AUTH_OK = version(1B) || kind=4(1B) +``` + +P-256 public key 使用 SEC1 uncompressed point(`0x04 || X(32B) || Y(32B)`)。任一 text message、长度错误、曲线点错误、顺序错误或重复握手消息都关闭当前 direct attempt。 + +## 6. Encrypted Record Layer + +All post-handshake DataChannel messages contain exactly one record: + +```text +version u8 = 1 +kind u8 +counter u64 big-endian +plain_len u32 big-endian +ciphertext plain_len + 16 byte Poly1305 tag +``` + +Nonce is `direction_nonce_prefix(16) || counter_be64`. AAD is: + +```text +transcript_hash(32) || version(1) || kind(1) || counter(8) || plain_len(4) +``` + +Cipher is XChaCha20-Poly1305. Counters start at zero independently in each direction and must equal the receiver's next expected counter. Ordered reliable DataChannel makes a replay window unnecessary; duplicate, gap or wrap closes the direct route and triggers Relay fallback. A reconnect always creates fresh ECDH keys, nonce prefixes and counters. + +Record kinds: + +| Kind | Value | Payload | +|---|---:|---| +| FRAME | 1 | Existing `proto.Marshal(Frame)` bytes | +| FRAGMENT | 2 | Fragment header + a slice of one marshaled frame | +| DIRECT_READY | 3 | `last_replayed_out_seq` u64 | +| PING | 4 | opaque 8 bytes | +| PONG | 5 | echoed 8 bytes | +| CLOSE | 6 | bounded code/reason | + +Unknown kinds are deny-by-default. They do not become permission-bearing merely because a newer terminal `proto.Type` exists. + +### 6.1 Fragmentation and limits + +- A record plaintext is at most 16 KiB. +- A marshaled terminal frame is at most 16 MiB. +- FRAGMENT header is `message_id u64 || offset u32 || total_len u32`. +- Offset must be contiguous, one reassembly per direction, with a 10-second deadline. +- Sender backpressure starts when `bufferedAmount > 1 MiB` and resumes below 256 KiB. +- Limit or ordering violations close only the direct route; the Relay account connection stays alive. + +## 7. Route Handover + +The client owns one route generation and one committed OUT cursor per `session_id`: + +```text +relay_attached -> direct_connecting -> direct_replay -> direct_active + ^ | + +------------- fallback ---------------+ +``` + +1. Client attaches via Relay with existing semantics and records the greatest OUT seq delivered to xterm as `committed_seq`. +2. Direct authentication succeeds. Host subscribes to the same local `session.Session` with `since_seq = committed_seq`. +3. During direct replay, Relay remains subscribed. Frames from both routes are accepted only for the current generation and deduplicated by OUT seq before delivery. +4. Host sends `DIRECT_READY(last_replayed_out_seq)` only after replay catch-up and live handoff are ordered on the direct subscriber. +5. Client validates `DIRECT_READY`. If Relay advanced `committed_seq` beyond `last_replayed_out_seq` during overlap, the client keeps both routes until the ordered direct stream observes that newer cursor; duplicate direct OUT frames advance this route-local observation without being rendered twice. It then switches the route generation and closes its old `/client` terminal socket so Relay removes that subscriber. The account, signaling, and session-list connections remain. The signaling attempt itself was already atomically removed when host sent `consumed` after account-key authentication, so readiness is not acknowledged against that expired attempt. +6. Direct failure freezes IN/RESIZE/CLAIM_DRIVER, increments route generation, and reattaches Relay using the last `committed_seq`. Input resumes only after Relay attach/replay completes. + +Late frames from an older route generation are dropped. OUT may arrive twice at the transport boundary during overlap but is delivered to xterm once. IN, RESIZE, paste and driver claim have exactly one active writer route and are never mirrored during transition. + +## 8. Driver, Permission and Lazy Streaming + +- Relay checks effective permission before ticket issue; desktop host checks permission again before local PTY or filesystem access. +- View permission permits OUT/META/replay only. Control permits IN/RESIZE/driver operations. `full` does not implicitly enable file, preview or future frame types on direct transport. +- Direct route uses the same client principal as the preceding Relay attach. Because driver ownership is tied to a physical subscriber, a client that was already the Relay driver sends `CLAIM_DRIVER` first on the ordered direct channel before releasing the Relay subscriber; a viewer does not claim during route change. +- The desktop treats Relay and direct overlap as one logical remote subscriber. Transition must never create a logical N→0→N edge. +- The physical direct subscriber is registered before Relay subscription release. `SetSubscriberLifecycle` therefore preserves 0→1/N→0 lazy upload semantics. +- Config sync and signaling are not terminal subscribers and cannot trigger `STREAM_REQUEST`. + +## 9. Failure Codes and Fallback + +Stable local error categories: + +| Code | Meaning | Retry | +|---|---|---| +| `direct_disabled` | client, host or Relay kill switch off | no | +| `direct_unsupported` | peer version/platform lacks capability | no | +| `direct_unauthorized` | account/session/permission mismatch | after auth change | +| `ticket_expired` | pending authorization expired | new attempt | +| `auth_failed` | proof/transcript mismatch | no automatic loop | +| `ice_failed` | no viable candidate pair | after cooldown/network change | +| `handshake_timeout` | channel opened but auth did not finish | one new attempt | +| `record_invalid` | AEAD/counter/limit violation | Relay fallback; no immediate direct retry | +| `route_lost` | active channel closed | Relay fallback, cooldown | + +Fallback is expected behavior, not a session error. UI remains connected and changes the route indicator to Relay. Authentication failures are security events and use a longer cooldown than ordinary ICE failures. + +## 10. Rollout and Compatibility + +- v0.6.0 beta: client preference default off and Relay server kill switch default off unless explicitly enabled. +- Capability negotiation happens on signaling connection; old Relay/clients never see direct messages. +- Relay-only `/client` and `/uplink` behavior is unchanged. +- Existing sealed `TypeOut` envelopes remain intact inside the encrypted record. Nested encryption is deliberate: Relay fallback and direct transport share one frame representation. +- Direct diagnostics redact IP addresses to candidate class (`host`, `srflx`, `relay`), never include ticket/proof/key/SDP/ICE strings, and never log terminal payloads. +- Default-on requires 100 route-flap runs without duplicate IN or missing/duplicate OUT, plus packaged Chromium/WebKit/iOS NAT matrix soak. + +## 11. Implementation Boundaries + +- `internal/peertransport`: canonical transcript, authenticator interface, key schedule, record codec, fragmentation and Pion adapter. +- `internal/relay`: authenticated signaling broker and bounded pending attempt registry; no terminal frame parsing on this endpoint. +- `desktop/uplink.go`: owns host orchestration, local session lookup, permission recheck, logical subscriber and route lease. +- `desktop/frontend/src/lib`: shared browser signaling/DataChannel transport used by Wails, Web and Capacitor. +- Existing `internal/proto` frame encoding remains unchanged. Production signaling wire details must be mirrored into `docs/spec/protocol.md` when Stage 1 is connected. + +## 12. Acceptance Tests + +- Go/browser golden vectors cover transcript bytes, P-256 ECDH, both proofs, directional keys/nonces and records. +- Wrong account key, session, ticket, role, public key, expiry and mutated transcript all fail authentication. +- Record replay, gap, wrong direction, wrong kind/length and tamper fail closed. +- 10 MiB replay under concurrent input respects bounds and reaches one final `committed_seq`. +- Forced failures at each handover edge fall back through the existing Relay path. +- Race tests prove one input writer, one driver lease and no lazy-stream zero edge during overlap. diff --git a/docs/superpowers/specs/2026-09-23-p2p-stage0-feasibility-notes.md b/docs/superpowers/specs/2026-09-23-p2p-stage0-feasibility-notes.md new file mode 100644 index 00000000..7340397c --- /dev/null +++ b/docs/superpowers/specs/2026-09-23-p2p-stage0-feasibility-notes.md @@ -0,0 +1,106 @@ +# P2P Stage 0 Feasibility Notes + +> Status: Accepted inputs for v0.6 implementation +> Date: 2026-09-23 +> Parent: [Relay-assisted P2P acceleration](./2026-09-22-relay-p2p-acceleration-design.md) + +## 1. Pion and DataChannel + +Decision: **GO**, with Pion pinned to `github.com/pion/webrtc/v4 v4.1.8` while the repository stays on Go 1.23. + +- Pion v4.2.20 requires Go 1.24 and cannot be adopted without changing the repository toolchain contract. +- v4.1.8 declares Go 1.21 and interoperates with the current Go 1.23 build. +- The spike is test-only. No current app startup path creates a PeerConnection. +- Channel contract is label `atterm-terminal-v1`, ordered, reliable, binary. +- Frame plaintext fragments stay at or below 16 KiB; one reassembly is capped at 16 MiB and 10 seconds. +- Backpressure high/low watermarks remain 1 MiB / 256 KiB for the Stage 1 adapters. + +Measured on 2026-09-23 in the Linux development environment: + +| Pair | Payload | Fragments | Result | +|---|---:|---:|---| +| Pion ↔ Pion, Go race test | 10 MiB | 641 | pass, setup + transfer ~5.68 s | +| Chromium 140 → Pion | 10 MiB | 641 | pass, setup + transfer ~1.14 s | +| TypeScript framing in jsdom | 10 MiB | 641 | pass, reassembly test ~0.2 s | +| WebKit → Pion | 10 MiB | 641 | not measured; no automatable WebKit browser in this environment | +| Firefox → Pion | 10 MiB | 641 | not measured; Firefox not installed in this environment | + +The optional Chromium test auto-detects `google-chrome`/`chromium`; it skips cleanly where no browser is installed. WebKit remains an explicit Stage 0 exit gate and must be run in the packaged Linux/macOS/iOS matrix before direct transport is wired into a default-on build. + +## 2. Route Handover + +Decision: **GO** for the state model; integration remains Stage 1. + +Go and TypeScript now share the same states and invariants: + +```text +relay_attached -> direct_connecting -> direct_replay -> direct_active + ^ | + +---------- relay_reattaching <--------+ +``` + +- One generation invalidates late callbacks after route loss. +- Relay remains the sole input writer during connect/replay. +- Input is frozen while Relay fallback attaches. +- OUT is committed once by monotonic session sequence even during route overlap. +- `DIRECT_READY.replayed_seq` must not precede the cursor used to start the attempt. If Relay has advanced farther during overlap, input switches only after the ordered direct stream observes the current committed cursor. + +Both implementations pass 100 forced Direct/Relay transitions without duplicate committed OUT or a second input route. The Stage 1 integration still has to prove the same property with real `session.Subscribe`, `/client` attach and `SetSubscriberLifecycle` callbacks. + +## 3. Quick Tunnel + +Decision: **GO for v0.7**, conditional on explicit executable supply and verification. + +- Quick Tunnel can expose one loopback HTTP/WebSocket peer gateway without introducing a platform account database. +- It is reachability only. Peer membership proof remains the authorization source. +- WebRTC signaling uses the tunnel first; application-encrypted WSS is an optional fallback over the same record codec. +- `cloudflared` is not installed in the current development environment, so process output parsing and URL lifetime were not measured in Stage 0. +- The app must never silently download an unverified `cloudflared`. Stage 2 must choose one of: user-provided executable, separately signed bundled artifact, or explicit package-manager prerequisite. +- A `trycloudflare.com` URL is ephemeral route metadata. Rotation must not revoke or recreate Peer membership. + +No Quick Tunnel code enters v0.6; this decision cannot delay Relay acceleration. + +## 4. Peer Identity Storage + +Decision: **GO for v0.7** with platform-specific non-exportable storage where available. + +- Desktop: P-256 private identity sealed in OS keyring, with the existing guarded fallback posture documented separately. +- iOS: Keychain through the existing Capacitor secure-storage registration pattern. +- Web/PWA: non-exportable WebCrypto `CryptoKey` in IndexedDB; membership export requires a separately designed encrypted transfer, never raw automatic export. +- The identity is distinct from Relay `account_key`; neither derives the other. + +An invitation may bootstrap membership, but every transport handshake verifies the resulting signed membership/capability chain. A temporary route URL is never an identity. + +## 5. Rendezvous + +Decision: **GO for v0.8** as a separate stateless binary and protocol contract. + +- TLS/WSS presence and opaque-topic signaling only. +- No Relay account login, terminal forwarding, config database or TURN behavior. +- Restart may lose presence/mailbox entries but never membership or configuration truth. +- Official and self-hosted deployments must run the same black-box contract suite. +- The Stage 1 signaling message envelope can be reused, but Relay authorization claims are replaced by Peer membership proof before any direct transport is accepted. + +Rendezvous is deliberately after Quick Tunnel so stable discovery does not become a hidden prerequisite for accountless trust. + +## 6. Decentralized Config Replication + +Decision: **GO for v0.7**, with a signed op log rather than multi-master writes to the existing Relay preference rows. + +- Each device owns a monotonic counter and signs immutable ops. +- Version vectors drive anti-entropy; HLC/LWW handles concurrent scalar updates. +- Record collections use remove-wins tombstones and stable positions, avoiding whole-array LWW for profiles/templates/SSH hosts. +- Membership and sync/vault epoch keys gate replicas; Relay preference sync becomes a compatibility adapter, not a competing writer. +- No always-online device is required, so offline Spaces visibly retain pending changes until any two members meet. + +Before Stage 2 production wiring, randomized three-device partition tests must pass at least 10,000 seeds, including revoke/epoch-rotation and snapshot compaction cases. + +## 7. Remaining Stage 0 Gate + +Only the packaged browser matrix remains unproven: + +- WebKit/WKWebView ↔ Pion ordered/reliable DataChannel. +- Firefox ↔ Pion message-size and backpressure behavior. +- Network switch / ICE restart teardown on packaged desktop and iOS targets. + +These measurements may change adapter details and timeouts, but not the accepted transcript, proof, record, fragment or route-generation formats. diff --git a/go.mod b/go.mod index 250c4160..a25219d3 100644 --- a/go.mod +++ b/go.mod @@ -29,6 +29,9 @@ require ( nhooyr.io/websocket v1.8.17 ) +// Pinned while this module stays on Go 1.23; Pion v4.2.20 requires Go 1.24. +require github.com/pion/webrtc/v4 v4.1.8 + require ( filippo.io/edwards25519 v1.0.0 // indirect filippo.io/nistec v0.0.2 // indirect @@ -59,6 +62,21 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/ncruces/go-strftime v1.0.0 // indirect + github.com/pion/datachannel v1.5.10 // indirect + github.com/pion/dtls/v3 v3.0.8 // indirect + github.com/pion/ice/v4 v4.0.13 // indirect + github.com/pion/interceptor v0.1.42 // indirect + github.com/pion/logging v0.2.4 // indirect + github.com/pion/mdns/v2 v2.1.0 // indirect + github.com/pion/randutil v0.1.0 // indirect + github.com/pion/rtcp v1.2.16 // indirect + github.com/pion/rtp v1.8.26 // indirect + github.com/pion/sctp v1.8.41 // indirect + github.com/pion/sdp/v3 v3.0.16 // indirect + github.com/pion/srtp/v3 v3.0.9 // indirect + github.com/pion/stun/v3 v3.0.2 // indirect + github.com/pion/transport/v3 v3.1.1 // indirect + github.com/pion/turn/v4 v4.1.3 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect @@ -69,6 +87,7 @@ require ( github.com/valyala/fasttemplate v1.2.2 // indirect github.com/wailsapp/go-webview2 v1.0.22 // indirect github.com/wailsapp/mimetype v1.4.1 // indirect + github.com/wlynxg/anet v0.0.5 // indirect golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect modernc.org/libc v1.65.7 // indirect modernc.org/mathutil v1.7.1 // indirect diff --git a/go.sum b/go.sum index 4ebd7b24..fa85eee8 100644 --- a/go.sum +++ b/go.sum @@ -90,6 +90,38 @@ github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJm github.com/oklog/ulid/v2 v2.1.1 h1:suPZ4ARWLOJLegGFiZZ1dFAkqzhMjL3J1TzI+5wHz8s= github.com/oklog/ulid/v2 v2.1.1/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ= github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= +github.com/pion/datachannel v1.5.10 h1:ly0Q26K1i6ZkGf42W7D4hQYR90pZwzFOjTq5AuCKk4o= +github.com/pion/datachannel v1.5.10/go.mod h1:p/jJfC9arb29W7WrxyKbepTU20CFgyx5oLo8Rs4Py/M= +github.com/pion/dtls/v3 v3.0.8 h1:ZrPUrvPVDaTJDM8Vu1veatzXebLlsIWeT7Vaate/zwM= +github.com/pion/dtls/v3 v3.0.8/go.mod h1:abApPjgadS/ra1wvUzHLc3o2HvoxppAh+NZkyApL4Os= +github.com/pion/ice/v4 v4.0.13 h1:1cdmd80gmLdnVTM2bXzw2CBebvXvkGNEaWi/CuDK9WQ= +github.com/pion/ice/v4 v4.0.13/go.mod h1:Xo5f5DBbEjQac+6pR7i83AGuwoGxnxwXkOOvHFVnfnM= +github.com/pion/interceptor v0.1.42 h1:0/4tvNtruXflBxLfApMVoMubUMik57VZ+94U0J7cmkQ= +github.com/pion/interceptor v0.1.42/go.mod h1:g6XYTChs9XyolIQFhRHOOUS+bGVGLRfgTCUzH29EfVU= +github.com/pion/logging v0.2.4 h1:tTew+7cmQ+Mc1pTBLKH2puKsOvhm32dROumOZ655zB8= +github.com/pion/logging v0.2.4/go.mod h1:DffhXTKYdNZU+KtJ5pyQDjvOAh/GsNSyv1lbkFbe3so= +github.com/pion/mdns/v2 v2.1.0 h1:3IJ9+Xio6tWYjhN6WwuY142P/1jA0D5ERaIqawg/fOY= +github.com/pion/mdns/v2 v2.1.0/go.mod h1:pcez23GdynwcfRU1977qKU0mDxSeucttSHbCSfFOd9A= +github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA= +github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8= +github.com/pion/rtcp v1.2.16 h1:fk1B1dNW4hsI78XUCljZJlC4kZOPk67mNRuQ0fcEkSo= +github.com/pion/rtcp v1.2.16/go.mod h1:/as7VKfYbs5NIb4h6muQ35kQF/J0ZVNz2Z3xKoCBYOo= +github.com/pion/rtp v1.8.26 h1:VB+ESQFQhBXFytD+Gk8cxB6dXeVf2WQzg4aORvAvAAc= +github.com/pion/rtp v1.8.26/go.mod h1:rF5nS1GqbR7H/TCpKwylzeq6yDM+MM6k+On5EgeThEM= +github.com/pion/sctp v1.8.41 h1:20R4OHAno4Vky3/iE4xccInAScAa83X6nWUfyc65MIs= +github.com/pion/sctp v1.8.41/go.mod h1:2wO6HBycUH7iCssuGyc2e9+0giXVW0pyCv3ZuL8LiyY= +github.com/pion/sdp/v3 v3.0.16 h1:0dKzYO6gTAvuLaAKQkC02eCPjMIi4NuAr/ibAwrGDCo= +github.com/pion/sdp/v3 v3.0.16/go.mod h1:9tyKzznud3qiweZcD86kS0ff1pGYB3VX+Bcsmkx6IXo= +github.com/pion/srtp/v3 v3.0.9 h1:lRGF4G61xxj+m/YluB3ZnBpiALSri2lTzba0kGZMrQY= +github.com/pion/srtp/v3 v3.0.9/go.mod h1:E+AuWd7Ug2Fp5u38MKnhduvpVkveXJX6J4Lq4rxUYt8= +github.com/pion/stun/v3 v3.0.2 h1:BJuGEN2oLrJisiNEJtUTJC4BGbzbfp37LizfqswblFU= +github.com/pion/stun/v3 v3.0.2/go.mod h1:JFJKfIWvt178MCF5H/YIgZ4VX3LYE77vca4b9HP60SA= +github.com/pion/transport/v3 v3.1.1 h1:Tr684+fnnKlhPceU+ICdrw6KKkTms+5qHMgw6bIkYOM= +github.com/pion/transport/v3 v3.1.1/go.mod h1:+c2eewC5WJQHiAA46fkMMzoYZSuGzA/7E2FPrOYHctQ= +github.com/pion/turn/v4 v4.1.3 h1:jVNW0iR05AS94ysEtvzsrk3gKs9Zqxf6HmnsLfRvlzA= +github.com/pion/turn/v4 v4.1.3/go.mod h1:TD/eiBUf5f5LwXbCJa35T7dPtTpCHRJ9oJWmyPLVT3A= +github.com/pion/webrtc/v4 v4.1.8 h1:ynkjfiURDQ1+8EcJsoa60yumHAmyeYjz08AaOuor+sk= +github.com/pion/webrtc/v4 v4.1.8/go.mod h1:KVaARG2RN0lZx0jc7AWTe38JpPv+1/KicOZ9jN52J/s= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -127,6 +159,8 @@ github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhw github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o= github.com/wailsapp/wails/v2 v2.12.0 h1:BHO/kLNWFHYjCzucxbzAYZWUjub1Tvb4cSguQozHn5c= github.com/wailsapp/wails/v2 v2.12.0/go.mod h1:mo1bzK1DEJrobt7YrBjgxvb5Sihb1mhAY09hppbibQg= +github.com/wlynxg/anet v0.0.5 h1:J3VJGi1gvo0JwZ/P1/Yc/8p63SoW98B5dHkYDmpgvvU= +github.com/wlynxg/anet v0.0.5/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= diff --git a/internal/directsignal/message.go b/internal/directsignal/message.go new file mode 100644 index 00000000..a0144667 --- /dev/null +++ b/internal/directsignal/message.go @@ -0,0 +1,40 @@ +// Package directsignal defines the Relay-assisted P2P signaling JSON schema. +// It deliberately contains no WebRTC implementation so Relay and clients can +// share the wire contract without coupling the control plane to Pion. +package directsignal + +const Version = 1 + +type Message struct { + Version int `json:"version"` + Kind string `json:"kind"` + + Role string `json:"role,omitempty"` + HostID string `json:"host_id,omitempty"` + SessionIDs []string `json:"session_ids,omitempty"` + ClientInstanceID string `json:"client_instance_id,omitempty"` + + RequestID string `json:"request_id,omitempty"` + SessionID string `json:"session_id,omitempty"` + SinceSeq uint64 `json:"since_seq,omitempty"` + + AttemptID string `json:"attempt_id,omitempty"` + Ticket string `json:"ticket,omitempty"` + UserID string `json:"user_id,omitempty"` + Permission string `json:"permission,omitempty"` + ExpiresAtUnixM int64 `json:"expires_at_unix_ms,omitempty"` + + SignalType string `json:"signal_type,omitempty"` + Payload string `json:"payload,omitempty"` + + Code string `json:"code,omitempty"` + Message string `json:"message,omitempty"` + + // BytesAvoided is a bounded aggregate delta reported by an authenticated + // direct host. It is retained for compatibility with older relays. + BytesAvoided uint64 `json:"bytes_avoided,omitempty"` + // BytesSent and BytesReceived are aggregate host-relative P2P byte deltas. + // They contain no session identifier, address, or terminal payload. + BytesSent uint64 `json:"bytes_sent,omitempty"` + BytesReceived uint64 `json:"bytes_received,omitempty"` +} diff --git a/internal/peertransport/client_handshake.go b/internal/peertransport/client_handshake.go new file mode 100644 index 00000000..2d03bad7 --- /dev/null +++ b/internal/peertransport/client_handshake.go @@ -0,0 +1,150 @@ +package peertransport + +import ( + "crypto/ecdh" + "fmt" + "time" + + "github.com/google/uuid" +) + +type clientHandshakeState byte + +const ( + clientHandshakeAwaitHostHello clientHandshakeState = iota + 1 + clientHandshakeAwaitAuthOK + clientHandshakeComplete +) + +// ClientHandshake is the native counterpart of the browser direct handshake. +// It keeps the account-key authenticator and ephemeral private key inside Go. +type ClientHandshake struct { + auth HandshakeAuthenticator + authorization Authorization + privateKey *ecdh.PrivateKey + clientPublicKey []byte + trafficKeys TrafficKeys + transcriptHash [sha256Size]byte + state clientHandshakeState + helloSent bool + now func() time.Time +} + +// ClientHandshakeResult contains the next client message. Traffic keys become +// available only after the host confirms the transcript with AUTH_OK. +type ClientHandshakeResult struct { + Response []byte + Authenticated bool + TrafficKeys TrafficKeys + TranscriptHash [sha256Size]byte +} + +func NewClientHandshake(auth HandshakeAuthenticator, authorization Authorization) (*ClientHandshake, error) { + if auth == nil { + return nil, fmt.Errorf("%w: missing authenticator", ErrInvalidHandshake) + } + if authorization.AttemptID == uuid.Nil || authorization.SessionID == uuid.Nil || len(authorization.Ticket) != directTicketSize { + return nil, fmt.Errorf("%w: malformed authorization", ErrInvalidHandshake) + } + privateKey, err := GenerateEphemeralKey() + if err != nil { + return nil, err + } + copyAuthorization := authorization + copyAuthorization.Ticket = append([]byte(nil), authorization.Ticket...) + return &ClientHandshake{ + auth: auth, + authorization: copyAuthorization, + privateKey: privateKey, + clientPublicKey: privateKey.PublicKey().Bytes(), + state: clientHandshakeAwaitHostHello, + now: time.Now, + }, nil +} + +func (h *ClientHandshake) ClientHello() ([]byte, error) { + if h == nil || h.auth == nil || h.privateKey == nil || h.state != clientHandshakeAwaitHostHello || h.helloSent { + return nil, fmt.Errorf("%w: client hello unavailable", ErrInvalidHandshake) + } + if h.authorization.ExpiresAtUnixMillis <= uint64(h.now().UnixMilli()) { + return nil, fmt.Errorf("%w: authorization expired", ErrInvalidHandshake) + } + h.helloSent = true + return EncodeClientHello(h.authorization.AttemptID, h.authorization.Ticket, h.clientPublicKey) +} + +func (h *ClientHandshake) Handle(message []byte) (ClientHandshakeResult, error) { + if h == nil || h.auth == nil || h.privateKey == nil { + return ClientHandshakeResult{}, fmt.Errorf("%w: nil client state", ErrInvalidHandshake) + } + if h.authorization.ExpiresAtUnixMillis <= uint64(h.now().UnixMilli()) { + return ClientHandshakeResult{}, fmt.Errorf("%w: authorization expired", ErrInvalidHandshake) + } + switch h.state { + case clientHandshakeAwaitHostHello: + return h.handleHostHello(message) + case clientHandshakeAwaitAuthOK: + return h.handleAuthOK(message) + default: + return ClientHandshakeResult{}, fmt.Errorf("%w: handshake already complete", ErrInvalidHandshake) + } +} + +func (h *ClientHandshake) handleHostHello(message []byte) (ClientHandshakeResult, error) { + if !h.helloSent { + return ClientHandshakeResult{}, fmt.Errorf("%w: client hello not sent", ErrInvalidHandshake) + } + hostPublicKey, hostProof, err := DecodeHostHello(message) + if err != nil { + return ClientHandshakeResult{}, err + } + transcript, err := (Transcript{ + AttemptID: h.authorization.AttemptID, + Ticket: h.authorization.Ticket, + SessionID: h.authorization.SessionID, + UserID: h.authorization.UserID, + HostID: h.authorization.HostID, + ClientInstanceID: h.authorization.ClientInstanceID, + Permission: h.authorization.Permission, + ExpiresAtUnixMillis: h.authorization.ExpiresAtUnixMillis, + ClientPublicKey: h.clientPublicKey, + HostPublicKey: hostPublicKey, + }).MarshalBinary() + if err != nil { + return ClientHandshakeResult{}, err + } + if err := h.auth.VerifyProof(transcript, RoleHost, hostProof); err != nil { + return ClientHandshakeResult{}, fmt.Errorf("%w: host proof", ErrInvalidHandshake) + } + h.trafficKeys, err = DeriveTrafficKeys(h.privateKey, hostPublicKey, transcript, h.auth) + if err != nil { + return ClientHandshakeResult{}, err + } + h.transcriptHash = TranscriptHash(transcript) + clientProof, err := h.auth.BuildProof(transcript, RoleClient) + if err != nil { + return ClientHandshakeResult{}, err + } + finishProof, err := BuildFinishProof(h.auth, transcript) + if err != nil { + return ClientHandshakeResult{}, err + } + response, err := EncodeClientFinish(clientProof, finishProof) + if err != nil { + return ClientHandshakeResult{}, err + } + h.state = clientHandshakeAwaitAuthOK + return ClientHandshakeResult{Response: response}, nil +} + +func (h *ClientHandshake) handleAuthOK(message []byte) (ClientHandshakeResult, error) { + if !IsAuthOK(message) { + return ClientHandshakeResult{}, fmt.Errorf("%w: malformed auth ok", ErrInvalidHandshake) + } + h.state = clientHandshakeComplete + return ClientHandshakeResult{ + Authenticated: true, + TrafficKeys: h.trafficKeys, + TranscriptHash: h.transcriptHash, + }, nil +} diff --git a/internal/peertransport/crypto.go b/internal/peertransport/crypto.go new file mode 100644 index 00000000..e5b0c27a --- /dev/null +++ b/internal/peertransport/crypto.go @@ -0,0 +1,286 @@ +package peertransport + +import ( + "crypto/ecdh" + "crypto/hmac" + "crypto/rand" + "crypto/sha256" + "encoding/binary" + "errors" + "fmt" + "io" + "unicode/utf8" + + "github.com/google/uuid" + "golang.org/x/crypto/hkdf" +) + +const ( + accountKeySize = 32 + directTicketSize = 32 + maxTranscriptString = 128 + p256PublicKeySize = 65 + transcriptDomain = "atterm-direct-handshake-v1" + proofInfo = "atterm-direct-proof-v1" + clientProofDomain = "atterm-direct-client-v1" + hostProofDomain = "atterm-direct-host-v1" + finishProofDomain = "atterm-direct-finish-v1" + trafficInfo = "atterm-direct-traffic-v1" + directionalKeySize = 32 + directionalNonceSize = 16 + trafficKeyMaterialLen = 2*directionalKeySize + 2*directionalNonceSize +) + +var ( + // ErrInvalidTranscript means a claim or public key cannot be represented by + // the v1 canonical transcript. + ErrInvalidTranscript = errors.New("peertransport: invalid transcript") + // ErrAuthentication means a direct proof does not match the transcript. + ErrAuthentication = errors.New("peertransport: authentication failed") + // ErrInvalidKey means key material has the wrong size or is not on P-256. + ErrInvalidKey = errors.New("peertransport: invalid key") +) + +// Permission is the effective Relay permission bound into a direct attempt. +type Permission byte + +const ( + PermissionView Permission = 1 + PermissionControl Permission = 2 + PermissionFull Permission = 3 +) + +func (p Permission) valid() bool { + return p >= PermissionView && p <= PermissionFull +} + +// Role separates client and host proofs made over the same transcript. +type Role byte + +const ( + RoleClient Role = 1 + RoleHost Role = 2 +) + +func (r Role) proofDomain() (string, error) { + switch r { + case RoleClient: + return clientProofDomain, nil + case RoleHost: + return hostProofDomain, nil + default: + return "", fmt.Errorf("%w: unknown role %d", ErrAuthentication, r) + } +} + +// Transcript binds Relay authorization claims to both ephemeral ECDH keys. +// MarshalBinary is the only canonical encoding used by proofs and key setup. +type Transcript struct { + AttemptID uuid.UUID + Ticket []byte + SessionID uuid.UUID + UserID string + HostID string + ClientInstanceID string + Permission Permission + ExpiresAtUnixMillis uint64 + ClientPublicKey []byte + HostPublicKey []byte +} + +// MarshalBinary returns the canonical v1 transcript described by the direct +// transport design. It validates curve points before any proof is calculated. +func (t Transcript) MarshalBinary() ([]byte, error) { + if t.AttemptID == uuid.Nil || t.SessionID == uuid.Nil { + return nil, fmt.Errorf("%w: nil attempt or session id", ErrInvalidTranscript) + } + if len(t.Ticket) != directTicketSize { + return nil, fmt.Errorf("%w: ticket is %d bytes", ErrInvalidTranscript, len(t.Ticket)) + } + if !t.Permission.valid() { + return nil, fmt.Errorf("%w: permission %d", ErrInvalidTranscript, t.Permission) + } + if t.ExpiresAtUnixMillis == 0 { + return nil, fmt.Errorf("%w: zero expiry", ErrInvalidTranscript) + } + for name, value := range map[string]string{ + "user_id": t.UserID, + "host_id": t.HostID, + "client_instance_id": t.ClientInstanceID, + } { + if value == "" || !utf8.ValidString(value) || len(value) > maxTranscriptString { + return nil, fmt.Errorf("%w: %s", ErrInvalidTranscript, name) + } + } + curve := ecdh.P256() + for name, publicKey := range map[string][]byte{ + "client public key": t.ClientPublicKey, + "host public key": t.HostPublicKey, + } { + if len(publicKey) != p256PublicKeySize { + return nil, fmt.Errorf("%w: %s is %d bytes", ErrInvalidTranscript, name, len(publicKey)) + } + if _, err := curve.NewPublicKey(publicKey); err != nil { + return nil, fmt.Errorf("%w: %s: %v", ErrInvalidTranscript, name, err) + } + } + + capacity := len(transcriptDomain) + 16 + 2 + directTicketSize + 16 + + 2 + len(t.UserID) + 2 + len(t.HostID) + 2 + len(t.ClientInstanceID) + + 1 + 8 + 2 + len(t.ClientPublicKey) + 2 + len(t.HostPublicKey) + out := make([]byte, 0, capacity) + out = append(out, transcriptDomain...) + out = append(out, t.AttemptID[:]...) + out = appendField(out, t.Ticket) + out = append(out, t.SessionID[:]...) + out = appendField(out, []byte(t.UserID)) + out = appendField(out, []byte(t.HostID)) + out = appendField(out, []byte(t.ClientInstanceID)) + out = append(out, byte(t.Permission)) + out = binary.BigEndian.AppendUint64(out, t.ExpiresAtUnixMillis) + out = appendField(out, t.ClientPublicKey) + out = appendField(out, t.HostPublicKey) + return out, nil +} + +func appendField(dst, value []byte) []byte { + dst = binary.BigEndian.AppendUint16(dst, uint16(len(value))) + return append(dst, value...) +} + +// HandshakeAuthenticator proves authority over one transcript without +// exposing its root secret to the transport implementation. +type HandshakeAuthenticator interface { + BuildProof(transcript []byte, role Role) ([]byte, error) + VerifyProof(transcript []byte, role Role, proof []byte) error + KeyBinding(transcript []byte) ([]byte, error) +} + +// AccountKeyAuthenticator implements the v0.6 same-account direct handshake. +// It copies accountKey so callers may clear their input buffer immediately. +type AccountKeyAuthenticator struct { + accountKey [accountKeySize]byte +} + +// NewAccountKeyAuthenticator creates a per-account proof provider. +func NewAccountKeyAuthenticator(accountKey []byte) (*AccountKeyAuthenticator, error) { + if len(accountKey) != accountKeySize { + return nil, fmt.Errorf("%w: account_key is %d bytes", ErrInvalidKey, len(accountKey)) + } + a := &AccountKeyAuthenticator{} + copy(a.accountKey[:], accountKey) + return a, nil +} + +// KeyBinding derives the per-attempt proof key used as the ECDH HKDF salt. +func (a *AccountKeyAuthenticator) KeyBinding(transcript []byte) ([]byte, error) { + if a == nil { + return nil, fmt.Errorf("%w: nil authenticator", ErrInvalidKey) + } + hash := sha256.Sum256(transcript) + r := hkdf.New(sha256.New, a.accountKey[:], hash[:], []byte(proofInfo)) + key := make([]byte, directionalKeySize) + if _, err := io.ReadFull(r, key); err != nil { + return nil, fmt.Errorf("derive proof key: %w", err) + } + return key, nil +} + +// BuildProof returns the role-separated HMAC for transcript. +func (a *AccountKeyAuthenticator) BuildProof(transcript []byte, role Role) ([]byte, error) { + domain, err := role.proofDomain() + if err != nil { + return nil, err + } + key, err := a.KeyBinding(transcript) + if err != nil { + return nil, err + } + hash := sha256.Sum256(transcript) + mac := hmac.New(sha256.New, key) + _, _ = mac.Write([]byte(domain)) + _, _ = mac.Write(hash[:]) + return mac.Sum(nil), nil +} + +// VerifyProof checks a client or host proof in constant time. +func (a *AccountKeyAuthenticator) VerifyProof(transcript []byte, role Role, proof []byte) error { + expected, err := a.BuildProof(transcript, role) + if err != nil { + return err + } + if !hmac.Equal(expected, proof) { + return ErrAuthentication + } + return nil +} + +// BuildFinishProof confirms that the client received and verified HOST_HELLO. +func BuildFinishProof(auth HandshakeAuthenticator, transcript []byte) ([]byte, error) { + key, err := auth.KeyBinding(transcript) + if err != nil { + return nil, err + } + hash := sha256.Sum256(transcript) + mac := hmac.New(sha256.New, key) + _, _ = mac.Write([]byte(finishProofDomain)) + _, _ = mac.Write(hash[:]) + return mac.Sum(nil), nil +} + +// GenerateEphemeralKey returns a fresh P-256 key for one direct attempt. +func GenerateEphemeralKey() (*ecdh.PrivateKey, error) { + key, err := ecdh.P256().GenerateKey(rand.Reader) + if err != nil { + return nil, fmt.Errorf("generate P-256 key: %w", err) + } + return key, nil +} + +// TrafficKeys contains direction-separated record keys and nonce prefixes. +type TrafficKeys struct { + ClientToHostKey [directionalKeySize]byte + HostToClientKey [directionalKeySize]byte + ClientToHostNoncePrefix [directionalNonceSize]byte + HostToClientNoncePrefix [directionalNonceSize]byte +} + +// DeriveTrafficKeys performs P-256 ECDH and binds its result to the +// authenticator and exact transcript. +func DeriveTrafficKeys(privateKey *ecdh.PrivateKey, peerPublicKey, transcript []byte, auth HandshakeAuthenticator) (TrafficKeys, error) { + if privateKey == nil || auth == nil { + return TrafficKeys{}, fmt.Errorf("%w: missing private key or authenticator", ErrInvalidKey) + } + peer, err := ecdh.P256().NewPublicKey(peerPublicKey) + if err != nil { + return TrafficKeys{}, fmt.Errorf("%w: peer public key: %v", ErrInvalidKey, err) + } + shared, err := privateKey.ECDH(peer) + if err != nil { + return TrafficKeys{}, fmt.Errorf("P-256 ECDH: %w", err) + } + binding, err := auth.KeyBinding(transcript) + if err != nil { + return TrafficKeys{}, err + } + hash := sha256.Sum256(transcript) + info := make([]byte, 0, len(trafficInfo)+len(hash)) + info = append(info, trafficInfo...) + info = append(info, hash[:]...) + r := hkdf.New(sha256.New, shared, binding, info) + material := make([]byte, trafficKeyMaterialLen) + if _, err := io.ReadFull(r, material); err != nil { + return TrafficKeys{}, fmt.Errorf("derive traffic keys: %w", err) + } + var keys TrafficKeys + copy(keys.ClientToHostKey[:], material[0:32]) + copy(keys.HostToClientKey[:], material[32:64]) + copy(keys.ClientToHostNoncePrefix[:], material[64:80]) + copy(keys.HostToClientNoncePrefix[:], material[80:96]) + return keys, nil +} + +// TranscriptHash returns the record-layer binding for a canonical transcript. +func TranscriptHash(transcript []byte) [sha256.Size]byte { + return sha256.Sum256(transcript) +} diff --git a/internal/peertransport/crypto_test.go b/internal/peertransport/crypto_test.go new file mode 100644 index 00000000..cdfe25f4 --- /dev/null +++ b/internal/peertransport/crypto_test.go @@ -0,0 +1,211 @@ +package peertransport + +import ( + "bytes" + "crypto/ecdh" + "encoding/hex" + "encoding/json" + "errors" + "os" + "testing" + + "github.com/google/uuid" +) + +func fixedKey(t *testing.T, last byte) *ecdh.PrivateKey { + t.Helper() + raw := make([]byte, 32) + raw[len(raw)-1] = last + key, err := ecdh.P256().NewPrivateKey(raw) + if err != nil { + t.Fatalf("NewPrivateKey: %v", err) + } + return key +} + +func testTranscript(t *testing.T) (Transcript, []byte, *ecdh.PrivateKey, *ecdh.PrivateKey) { + t.Helper() + client := fixedKey(t, 1) + host := fixedKey(t, 2) + claims := Transcript{ + AttemptID: uuid.MustParse("11111111-2222-4333-8444-555555555555"), + Ticket: bytes.Repeat([]byte{0xa5}, 32), + SessionID: uuid.MustParse("aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee"), + UserID: "user-123", + HostID: "host-macbook", + ClientInstanceID: "client-iphone", + Permission: PermissionControl, + ExpiresAtUnixMillis: 1_800_000_000_123, + ClientPublicKey: client.PublicKey().Bytes(), + HostPublicKey: host.PublicKey().Bytes(), + } + wire, err := claims.MarshalBinary() + if err != nil { + t.Fatalf("MarshalBinary: %v", err) + } + return claims, wire, client, host +} + +func TestTranscriptAndKeySchedule(t *testing.T) { + _, transcript, client, host := testTranscript(t) + accountKey := bytes.Repeat([]byte{0x42}, 32) + auth, err := NewAccountKeyAuthenticator(accountKey) + if err != nil { + t.Fatal(err) + } + clientProof, err := auth.BuildProof(transcript, RoleClient) + if err != nil { + t.Fatal(err) + } + hostProof, err := auth.BuildProof(transcript, RoleHost) + if err != nil { + t.Fatal(err) + } + if bytes.Equal(clientProof, hostProof) { + t.Fatal("role-separated proofs are equal") + } + if err := auth.VerifyProof(transcript, RoleClient, clientProof); err != nil { + t.Fatalf("VerifyProof: %v", err) + } + if err := auth.VerifyProof(transcript, RoleHost, clientProof); !errors.Is(err, ErrAuthentication) { + t.Fatalf("client proof accepted as host proof: %v", err) + } + + clientKeys, err := DeriveTrafficKeys(client, host.PublicKey().Bytes(), transcript, auth) + if err != nil { + t.Fatal(err) + } + hostKeys, err := DeriveTrafficKeys(host, client.PublicKey().Bytes(), transcript, auth) + if err != nil { + t.Fatal(err) + } + if clientKeys != hostKeys { + t.Fatal("ECDH endpoints derived different traffic keys") + } + if clientKeys.ClientToHostKey == clientKeys.HostToClientKey { + t.Fatal("direction keys are equal") + } +} + +func TestWrongAccountKeyAndTranscriptClaimsFailProof(t *testing.T) { + claims, transcript, _, _ := testTranscript(t) + auth, _ := NewAccountKeyAuthenticator(bytes.Repeat([]byte{0x42}, 32)) + proof, _ := auth.BuildProof(transcript, RoleClient) + + wrongAuth, _ := NewAccountKeyAuthenticator(bytes.Repeat([]byte{0x43}, 32)) + if err := wrongAuth.VerifyProof(transcript, RoleClient, proof); !errors.Is(err, ErrAuthentication) { + t.Fatalf("wrong account key accepted: %v", err) + } + tests := []struct { + name string + mutate func(*Transcript) + }{ + {"session", func(v *Transcript) { v.SessionID = uuid.New() }}, + {"ticket", func(v *Transcript) { v.Ticket = bytes.Repeat([]byte{0xa6}, 32) }}, + {"expiry", func(v *Transcript) { v.ExpiresAtUnixMillis++ }}, + {"public key", func(v *Transcript) { v.HostPublicKey = append([]byte(nil), v.ClientPublicKey...) }}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + changedClaims := claims + tt.mutate(&changedClaims) + changed, err := changedClaims.MarshalBinary() + if err != nil { + t.Fatal(err) + } + if err := auth.VerifyProof(changed, RoleClient, proof); !errors.Is(err, ErrAuthentication) { + t.Fatalf("changed transcript accepted: %v", err) + } + }) + } +} + +func TestTranscriptRejectsMalformedInputs(t *testing.T) { + claims, _, _, _ := testTranscript(t) + tests := []struct { + name string + mutate func(*Transcript) + }{ + {"short ticket", func(v *Transcript) { v.Ticket = v.Ticket[:31] }}, + {"nil session", func(v *Transcript) { v.SessionID = uuid.Nil }}, + {"empty host", func(v *Transcript) { v.HostID = "" }}, + {"bad permission", func(v *Transcript) { v.Permission = 9 }}, + {"zero expiry", func(v *Transcript) { v.ExpiresAtUnixMillis = 0 }}, + {"bad public key", func(v *Transcript) { v.HostPublicKey = bytes.Repeat([]byte{1}, 65) }}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + changed := claims + tt.mutate(&changed) + if _, err := changed.MarshalBinary(); !errors.Is(err, ErrInvalidTranscript) { + t.Fatalf("got %v", err) + } + }) + } +} + +func TestGoldenValuesAreStable(t *testing.T) { + type goldenVector struct { + AccountKeyHex string `json:"account_key_hex"` + ClientPrivateKeyHex string `json:"client_private_key_hex"` + HostPrivateKeyHex string `json:"host_private_key_hex"` + ClientPublicKeyHex string `json:"client_public_key_hex"` + HostPublicKeyHex string `json:"host_public_key_hex"` + TranscriptHex string `json:"transcript_hex"` + ClientProofHex string `json:"client_proof_hex"` + HostProofHex string `json:"host_proof_hex"` + FinishProofHex string `json:"finish_proof_hex"` + ClientToHostKeyHex string `json:"client_to_host_key_hex"` + HostToClientKeyHex string `json:"host_to_client_key_hex"` + ClientNoncePrefixHex string `json:"client_nonce_prefix_hex"` + HostNoncePrefixHex string `json:"host_nonce_prefix_hex"` + RecordPlaintextHex string `json:"record_plaintext_hex"` + RecordHex string `json:"record_hex"` + } + raw, err := os.ReadFile("testdata/direct_crypto_v1.json") + if err != nil { + t.Fatal(err) + } + var vector goldenVector + if err := json.Unmarshal(raw, &vector); err != nil { + t.Fatal(err) + } + + _, transcript, client, host := testTranscript(t) + auth, _ := NewAccountKeyAuthenticator(bytes.Repeat([]byte{0x42}, 32)) + clientProof, _ := auth.BuildProof(transcript, RoleClient) + hostProof, _ := auth.BuildProof(transcript, RoleHost) + finishProof, _ := BuildFinishProof(auth, transcript) + keys, _ := DeriveTrafficKeys(client, host.PublicKey().Bytes(), transcript, auth) + sealer, _ := NewRecordSealer(keys.ClientToHostKey[:], keys.ClientToHostNoncePrefix[:], TranscriptHash(transcript)) + recordPlaintext, err := hex.DecodeString(vector.RecordPlaintextHex) + if err != nil { + t.Fatal(err) + } + record, _ := sealer.Seal(RecordFrame, recordPlaintext) + + vectors := map[string]struct { + got []byte + want string + }{ + "account_key": {bytes.Repeat([]byte{0x42}, 32), vector.AccountKeyHex}, + "client_private": {client.Bytes(), vector.ClientPrivateKeyHex}, + "host_private": {host.Bytes(), vector.HostPrivateKeyHex}, + "transcript": {transcript, vector.TranscriptHex}, + "client_public": {client.PublicKey().Bytes(), vector.ClientPublicKeyHex}, + "host_public": {host.PublicKey().Bytes(), vector.HostPublicKeyHex}, + "client_proof": {clientProof, vector.ClientProofHex}, + "host_proof": {hostProof, vector.HostProofHex}, + "finish_proof": {finishProof, vector.FinishProofHex}, + "client_to_host_key": {keys.ClientToHostKey[:], vector.ClientToHostKeyHex}, + "host_to_client_key": {keys.HostToClientKey[:], vector.HostToClientKeyHex}, + "client_nonce_prefix": {keys.ClientToHostNoncePrefix[:], vector.ClientNoncePrefixHex}, + "host_nonce_prefix": {keys.HostToClientNoncePrefix[:], vector.HostNoncePrefixHex}, + "record": {record, vector.RecordHex}, + } + for name, vector := range vectors { + if got := hex.EncodeToString(vector.got); got != vector.want { + t.Errorf("%s = %s", name, got) + } + } +} diff --git a/internal/peertransport/doc.go b/internal/peertransport/doc.go new file mode 100644 index 00000000..c2a01a95 --- /dev/null +++ b/internal/peertransport/doc.go @@ -0,0 +1,4 @@ +// Package peertransport provides the authenticated, encrypted transport +// primitives shared by Relay-assisted direct connections and later Peer Space +// routes. It deliberately contains no WebRTC or Relay lifecycle policy. +package peertransport diff --git a/internal/peertransport/fragment.go b/internal/peertransport/fragment.go new file mode 100644 index 00000000..779d62d0 --- /dev/null +++ b/internal/peertransport/fragment.go @@ -0,0 +1,121 @@ +package peertransport + +import ( + "encoding/binary" + "errors" + "fmt" + "time" +) + +const ( + fragmentHeaderSize = 8 + 4 + 4 + fragmentDataSize = MaxRecordPlaintext - fragmentHeaderSize + // MaxFrameSize is the largest marshaled proto.Frame accepted by the direct + // transport. It matches the existing Relay connection read limit. + MaxFrameSize = 16 * 1024 * 1024 + // ReassemblyTimeout bounds how long an incomplete frame can retain memory. + ReassemblyTimeout = 10 * time.Second +) + +var ( + // ErrInvalidFragment covers malformed, interleaved or out-of-order chunks. + ErrInvalidFragment = errors.New("peertransport: invalid fragment") + // ErrReassemblyTimeout means an incomplete message exceeded its deadline. + ErrReassemblyTimeout = errors.New("peertransport: reassembly timeout") +) + +// FragmentFrame splits one marshaled terminal frame into bounded FRAGMENT +// plaintexts. Callers should use a FRAME record when len(frame) <= 16 KiB. +func FragmentFrame(messageID uint64, frame []byte) ([][]byte, error) { + if len(frame) <= MaxRecordPlaintext { + return nil, fmt.Errorf("%w: frame does not require fragmentation", ErrInvalidFragment) + } + if len(frame) > MaxFrameSize { + return nil, fmt.Errorf("%w: frame is %d bytes", ErrInvalidFragment, len(frame)) + } + count := (len(frame) + fragmentDataSize - 1) / fragmentDataSize + fragments := make([][]byte, 0, count) + for offset := 0; offset < len(frame); offset += fragmentDataSize { + end := offset + fragmentDataSize + if end > len(frame) { + end = len(frame) + } + fragment := make([]byte, fragmentHeaderSize+end-offset) + binary.BigEndian.PutUint64(fragment[0:8], messageID) + binary.BigEndian.PutUint32(fragment[8:12], uint32(offset)) + binary.BigEndian.PutUint32(fragment[12:16], uint32(len(frame))) + copy(fragment[fragmentHeaderSize:], frame[offset:end]) + fragments = append(fragments, fragment) + } + return fragments, nil +} + +// Reassembler accepts one contiguous fragmented message at a time. Direct +// records are ordered and reliable, so interleaving or offset gaps indicate a +// peer implementation error and fail the route closed. +type Reassembler struct { + messageID uint64 + total uint32 + next uint32 + startedAt time.Time + buffer []byte + active bool +} + +// Add validates and appends one FRAGMENT plaintext. complete is true only +// when frame contains the full reassembled marshaled terminal frame. +func (r *Reassembler) Add(fragment []byte, now time.Time) (frame []byte, complete bool, err error) { + if r.active && now.Sub(r.startedAt) > ReassemblyTimeout { + r.Reset() + return nil, false, ErrReassemblyTimeout + } + if len(fragment) <= fragmentHeaderSize || len(fragment) > MaxRecordPlaintext { + return nil, false, fmt.Errorf("%w: size %d", ErrInvalidFragment, len(fragment)) + } + messageID := binary.BigEndian.Uint64(fragment[0:8]) + offset := binary.BigEndian.Uint32(fragment[8:12]) + total := binary.BigEndian.Uint32(fragment[12:16]) + chunk := fragment[fragmentHeaderSize:] + if total <= MaxRecordPlaintext || total > MaxFrameSize { + return nil, false, fmt.Errorf("%w: total %d", ErrInvalidFragment, total) + } + if uint64(offset)+uint64(len(chunk)) > uint64(total) { + return nil, false, fmt.Errorf("%w: chunk exceeds total", ErrInvalidFragment) + } + if !r.active { + if offset != 0 { + return nil, false, fmt.Errorf("%w: first offset %d", ErrInvalidFragment, offset) + } + r.messageID = messageID + r.total = total + r.startedAt = now + r.buffer = make([]byte, 0, int(total)) + r.active = true + } + if messageID != r.messageID || total != r.total || offset != r.next { + return nil, false, fmt.Errorf("%w: message or offset mismatch", ErrInvalidFragment) + } + r.buffer = append(r.buffer, chunk...) + r.next += uint32(len(chunk)) + if r.next != r.total { + return nil, false, nil + } + frame = r.buffer + r.buffer = nil + r.active = false + r.messageID = 0 + r.total = 0 + r.next = 0 + r.startedAt = time.Time{} + return frame, true, nil +} + +// Reset drops an incomplete message and releases its backing allocation. +func (r *Reassembler) Reset() { + r.messageID = 0 + r.total = 0 + r.next = 0 + r.startedAt = time.Time{} + r.buffer = nil + r.active = false +} diff --git a/internal/peertransport/fragment_test.go b/internal/peertransport/fragment_test.go new file mode 100644 index 00000000..31ba5c6d --- /dev/null +++ b/internal/peertransport/fragment_test.go @@ -0,0 +1,79 @@ +package peertransport + +import ( + "bytes" + "errors" + "testing" + "time" +) + +func TestFragmentReassemblyTenMiB(t *testing.T) { + frame := make([]byte, 10*1024*1024) + for i := range frame { + frame[i] = byte(i % 251) + } + fragments, err := FragmentFrame(77, frame) + if err != nil { + t.Fatal(err) + } + if len(fragments) < 2 { + t.Fatal("large frame was not fragmented") + } + now := time.Unix(1_800_000_000, 0) + var reassembler Reassembler + var got []byte + for i, fragment := range fragments { + if len(fragment) > MaxRecordPlaintext { + t.Fatalf("fragment %d is %d bytes", i, len(fragment)) + } + var complete bool + got, complete, err = reassembler.Add(fragment, now) + if err != nil { + t.Fatalf("fragment %d: %v", i, err) + } + if complete != (i == len(fragments)-1) { + t.Fatalf("fragment %d complete=%v", i, complete) + } + } + if !bytes.Equal(got, frame) { + t.Fatal("reassembled frame differs") + } +} + +func TestReassemblerRejectsGapInterleaveAndTimeout(t *testing.T) { + frame := bytes.Repeat([]byte{0x55}, MaxRecordPlaintext*2) + fragments, _ := FragmentFrame(1, frame) + now := time.Unix(1_800_000_000, 0) + + var gap Reassembler + if _, _, err := gap.Add(fragments[1], now); !errors.Is(err, ErrInvalidFragment) { + t.Fatalf("gap accepted: %v", err) + } + + var interleaved Reassembler + if _, _, err := interleaved.Add(fragments[0], now); err != nil { + t.Fatal(err) + } + other := append([]byte(nil), fragments[1]...) + other[7] = 2 + if _, _, err := interleaved.Add(other, now); !errors.Is(err, ErrInvalidFragment) { + t.Fatalf("interleaved message accepted: %v", err) + } + + var expired Reassembler + if _, _, err := expired.Add(fragments[0], now); err != nil { + t.Fatal(err) + } + if _, _, err := expired.Add(fragments[1], now.Add(ReassemblyTimeout+time.Millisecond)); !errors.Is(err, ErrReassemblyTimeout) { + t.Fatalf("expired message accepted: %v", err) + } +} + +func TestFragmentBounds(t *testing.T) { + if _, err := FragmentFrame(1, make([]byte, MaxRecordPlaintext)); !errors.Is(err, ErrInvalidFragment) { + t.Fatalf("small frame accepted: %v", err) + } + if _, err := FragmentFrame(1, make([]byte, MaxFrameSize+1)); !errors.Is(err, ErrInvalidFragment) { + t.Fatalf("oversize frame accepted: %v", err) + } +} diff --git a/internal/peertransport/handshake.go b/internal/peertransport/handshake.go new file mode 100644 index 00000000..11f2bed6 --- /dev/null +++ b/internal/peertransport/handshake.go @@ -0,0 +1,234 @@ +package peertransport + +import ( + "crypto/ecdh" + "crypto/hmac" + "crypto/subtle" + "errors" + "fmt" + "time" + + "github.com/google/uuid" +) + +const ( + HandshakeVersion = 1 + + handshakeClientHello byte = 1 + handshakeHostHello byte = 2 + handshakeClientFinish byte = 3 + handshakeAuthOK byte = 4 + + handshakeHeaderSize = 2 + clientHelloMessageSize = handshakeHeaderSize + 16 + directTicketSize + p256PublicKeySize + hostHelloMessageSize = handshakeHeaderSize + p256PublicKeySize + sha256Size + clientFinishMessageSize = handshakeHeaderSize + 2*sha256Size + authOKMessageSize = handshakeHeaderSize + directHandshakeTimeout = 10 * time.Second + sha256Size = 32 +) + +var ErrInvalidHandshake = errors.New("peertransport: invalid handshake") + +// Authorization is the exact Relay-issued pending authorization bound into a +// direct handshake. Ticket is copied by NewHostHandshake and never retained by +// the Relay-facing signaling layer after the attempt ends. +type Authorization struct { + AttemptID uuid.UUID + Ticket []byte + SessionID uuid.UUID + UserID string + HostID string + ClientInstanceID string + Permission Permission + ExpiresAtUnixMillis uint64 +} + +type hostHandshakeState byte + +const ( + hostHandshakeAwaitClientHello hostHandshakeState = iota + 1 + hostHandshakeAwaitClientFinish + hostHandshakeComplete +) + +// HostHandshake authenticates one DataChannel against a Relay authorization. +// It is deliberately independent of Pion so the same state machine can be +// tested without network timing and reused by later transports. +type HostHandshake struct { + auth HandshakeAuthenticator + authorization Authorization + privateKey *ecdh.PrivateKey + clientPublicKey []byte + hostPublicKey []byte + transcript []byte + state hostHandshakeState + now func() time.Time +} + +// HostHandshakeResult contains the only response valid for the processed +// message. TrafficKeys are populated only alongside Authenticated=true. +type HostHandshakeResult struct { + Response []byte + Authenticated bool + TrafficKeys TrafficKeys + TranscriptHash [sha256Size]byte +} + +func NewHostHandshake(auth HandshakeAuthenticator, authorization Authorization) (*HostHandshake, error) { + if auth == nil { + return nil, fmt.Errorf("%w: missing authenticator", ErrInvalidHandshake) + } + if authorization.AttemptID == uuid.Nil || authorization.SessionID == uuid.Nil || len(authorization.Ticket) != directTicketSize { + return nil, fmt.Errorf("%w: malformed authorization", ErrInvalidHandshake) + } + privateKey, err := GenerateEphemeralKey() + if err != nil { + return nil, err + } + copyAuthorization := authorization + copyAuthorization.Ticket = append([]byte(nil), authorization.Ticket...) + return &HostHandshake{ + auth: auth, + authorization: copyAuthorization, + privateKey: privateKey, + hostPublicKey: privateKey.PublicKey().Bytes(), + state: hostHandshakeAwaitClientHello, + now: time.Now, + }, nil +} + +// Handle consumes the next binary handshake message. Any error is terminal for +// the direct attempt; callers close the DataChannel and consume the ticket. +func (h *HostHandshake) Handle(message []byte) (HostHandshakeResult, error) { + if h == nil || h.auth == nil || h.privateKey == nil { + return HostHandshakeResult{}, fmt.Errorf("%w: nil host state", ErrInvalidHandshake) + } + if h.authorization.ExpiresAtUnixMillis <= uint64(h.now().UnixMilli()) { + return HostHandshakeResult{}, fmt.Errorf("%w: authorization expired", ErrInvalidHandshake) + } + switch h.state { + case hostHandshakeAwaitClientHello: + return h.handleClientHello(message) + case hostHandshakeAwaitClientFinish: + return h.handleClientFinish(message) + default: + return HostHandshakeResult{}, fmt.Errorf("%w: handshake already complete", ErrInvalidHandshake) + } +} + +func (h *HostHandshake) handleClientHello(message []byte) (HostHandshakeResult, error) { + if len(message) != clientHelloMessageSize || message[0] != HandshakeVersion || message[1] != handshakeClientHello { + return HostHandshakeResult{}, fmt.Errorf("%w: expected client hello", ErrInvalidHandshake) + } + attemptID, err := uuid.FromBytes(message[2:18]) + if err != nil || attemptID != h.authorization.AttemptID { + return HostHandshakeResult{}, fmt.Errorf("%w: attempt mismatch", ErrInvalidHandshake) + } + ticket := message[18 : 18+directTicketSize] + if subtle.ConstantTimeCompare(ticket, h.authorization.Ticket) != 1 { + return HostHandshakeResult{}, fmt.Errorf("%w: ticket mismatch", ErrInvalidHandshake) + } + clientPublicKey := append([]byte(nil), message[18+directTicketSize:]...) + transcript, err := (Transcript{ + AttemptID: h.authorization.AttemptID, + Ticket: h.authorization.Ticket, + SessionID: h.authorization.SessionID, + UserID: h.authorization.UserID, + HostID: h.authorization.HostID, + ClientInstanceID: h.authorization.ClientInstanceID, + Permission: h.authorization.Permission, + ExpiresAtUnixMillis: h.authorization.ExpiresAtUnixMillis, + ClientPublicKey: clientPublicKey, + HostPublicKey: h.hostPublicKey, + }).MarshalBinary() + if err != nil { + return HostHandshakeResult{}, err + } + hostProof, err := h.auth.BuildProof(transcript, RoleHost) + if err != nil || len(hostProof) != sha256Size { + return HostHandshakeResult{}, fmt.Errorf("%w: build host proof", ErrInvalidHandshake) + } + h.transcript = transcript + h.clientPublicKey = clientPublicKey + h.state = hostHandshakeAwaitClientFinish + response := make([]byte, hostHelloMessageSize) + response[0] = HandshakeVersion + response[1] = handshakeHostHello + copy(response[2:2+p256PublicKeySize], h.hostPublicKey) + copy(response[2+p256PublicKeySize:], hostProof) + return HostHandshakeResult{Response: response}, nil +} + +func (h *HostHandshake) handleClientFinish(message []byte) (HostHandshakeResult, error) { + if len(message) != clientFinishMessageSize || message[0] != HandshakeVersion || message[1] != handshakeClientFinish { + return HostHandshakeResult{}, fmt.Errorf("%w: expected client finish", ErrInvalidHandshake) + } + clientProof := message[2 : 2+sha256Size] + if err := h.auth.VerifyProof(h.transcript, RoleClient, clientProof); err != nil { + return HostHandshakeResult{}, fmt.Errorf("%w: client proof", ErrInvalidHandshake) + } + wantFinish, err := BuildFinishProof(h.auth, h.transcript) + if err != nil || !hmac.Equal(wantFinish, message[2+sha256Size:]) { + return HostHandshakeResult{}, fmt.Errorf("%w: finish proof", ErrInvalidHandshake) + } + keys, err := DeriveTrafficKeys(h.privateKey, h.clientPublicKey, h.transcript, h.auth) + if err != nil { + return HostHandshakeResult{}, err + } + h.state = hostHandshakeComplete + return HostHandshakeResult{ + Response: []byte{HandshakeVersion, handshakeAuthOK}, + Authenticated: true, + TrafficKeys: keys, + TranscriptHash: TranscriptHash(h.transcript), + }, nil +} + +// EncodeClientHello builds the fixed-size first DataChannel message. +func EncodeClientHello(attemptID uuid.UUID, ticket, clientPublicKey []byte) ([]byte, error) { + if attemptID == uuid.Nil || len(ticket) != directTicketSize || len(clientPublicKey) != p256PublicKeySize { + return nil, fmt.Errorf("%w: malformed client hello", ErrInvalidHandshake) + } + if _, err := ecdh.P256().NewPublicKey(clientPublicKey); err != nil { + return nil, fmt.Errorf("%w: client public key", ErrInvalidHandshake) + } + message := make([]byte, clientHelloMessageSize) + message[0] = HandshakeVersion + message[1] = handshakeClientHello + copy(message[2:18], attemptID[:]) + copy(message[18:18+directTicketSize], ticket) + copy(message[18+directTicketSize:], clientPublicKey) + return message, nil +} + +// DecodeHostHello returns copies of the host public key and proof. +func DecodeHostHello(message []byte) (hostPublicKey, hostProof []byte, err error) { + if len(message) != hostHelloMessageSize || message[0] != HandshakeVersion || message[1] != handshakeHostHello { + return nil, nil, fmt.Errorf("%w: malformed host hello", ErrInvalidHandshake) + } + publicKey := message[2 : 2+p256PublicKeySize] + if _, err := ecdh.P256().NewPublicKey(publicKey); err != nil { + return nil, nil, fmt.Errorf("%w: host public key", ErrInvalidHandshake) + } + return append([]byte(nil), publicKey...), append([]byte(nil), message[2+p256PublicKeySize:]...), nil +} + +func EncodeClientFinish(clientProof, finishProof []byte) ([]byte, error) { + if len(clientProof) != sha256Size || len(finishProof) != sha256Size { + return nil, fmt.Errorf("%w: malformed client finish", ErrInvalidHandshake) + } + message := make([]byte, clientFinishMessageSize) + message[0] = HandshakeVersion + message[1] = handshakeClientFinish + copy(message[2:2+sha256Size], clientProof) + copy(message[2+sha256Size:], finishProof) + return message, nil +} + +func IsAuthOK(message []byte) bool { + return len(message) == authOKMessageSize && message[0] == HandshakeVersion && message[1] == handshakeAuthOK +} + +// DirectHandshakeTimeout is the maximum time from DataChannel open to AUTH_OK. +func DirectHandshakeTimeout() time.Duration { return directHandshakeTimeout } diff --git a/internal/peertransport/handshake_test.go b/internal/peertransport/handshake_test.go new file mode 100644 index 00000000..411ea841 --- /dev/null +++ b/internal/peertransport/handshake_test.go @@ -0,0 +1,178 @@ +package peertransport + +import ( + "bytes" + "errors" + "testing" + "time" + + "github.com/google/uuid" +) + +func TestHostHandshakeAuthenticatesClientAndDerivesMatchingKeys(t *testing.T) { + accountKey := bytes.Repeat([]byte{0x42}, accountKeySize) + auth, err := NewAccountKeyAuthenticator(accountKey) + if err != nil { + t.Fatal(err) + } + authorization := testAuthorization(time.Now().Add(time.Minute)) + host, err := NewHostHandshake(auth, authorization) + if err != nil { + t.Fatal(err) + } + clientPrivate, err := GenerateEphemeralKey() + if err != nil { + t.Fatal(err) + } + clientHello, err := EncodeClientHello(authorization.AttemptID, authorization.Ticket, clientPrivate.PublicKey().Bytes()) + if err != nil { + t.Fatal(err) + } + result, err := host.Handle(clientHello) + if err != nil { + t.Fatal(err) + } + hostPublic, hostProof, err := DecodeHostHello(result.Response) + if err != nil { + t.Fatal(err) + } + transcript, err := buildHandshakeTestTranscript(authorization, clientPrivate.PublicKey().Bytes(), hostPublic) + if err != nil { + t.Fatal(err) + } + if err := auth.VerifyProof(transcript, RoleHost, hostProof); err != nil { + t.Fatalf("verify host proof: %v", err) + } + clientProof, _ := auth.BuildProof(transcript, RoleClient) + finishProof, _ := BuildFinishProof(auth, transcript) + clientFinish, _ := EncodeClientFinish(clientProof, finishProof) + result, err = host.Handle(clientFinish) + if err != nil { + t.Fatal(err) + } + if !result.Authenticated || !IsAuthOK(result.Response) { + t.Fatalf("final result = %+v", result) + } + wantKeys, err := DeriveTrafficKeys(clientPrivate, hostPublic, transcript, auth) + if err != nil { + t.Fatal(err) + } + if result.TrafficKeys != wantKeys { + t.Fatal("host and client traffic keys differ") + } + if _, err := host.Handle(clientFinish); !errors.Is(err, ErrInvalidHandshake) { + t.Fatalf("repeated finish err=%v", err) + } +} + +func TestClientAndHostHandshakeRoundTrip(t *testing.T) { + accountKey := bytes.Repeat([]byte{0x27}, accountKeySize) + auth, err := NewAccountKeyAuthenticator(accountKey) + if err != nil { + t.Fatal(err) + } + authorization := testAuthorization(time.Now().Add(time.Minute)) + client, err := NewClientHandshake(auth, authorization) + if err != nil { + t.Fatal(err) + } + host, err := NewHostHandshake(auth, authorization) + if err != nil { + t.Fatal(err) + } + hello, err := client.ClientHello() + if err != nil { + t.Fatal(err) + } + hostHello, err := host.Handle(hello) + if err != nil { + t.Fatal(err) + } + clientFinish, err := client.Handle(hostHello.Response) + if err != nil { + t.Fatal(err) + } + hostResult, err := host.Handle(clientFinish.Response) + if err != nil { + t.Fatal(err) + } + clientResult, err := client.Handle(hostResult.Response) + if err != nil { + t.Fatal(err) + } + if !hostResult.Authenticated || !clientResult.Authenticated { + t.Fatal("both handshake roles must authenticate") + } + if hostResult.TrafficKeys != clientResult.TrafficKeys || hostResult.TranscriptHash != clientResult.TranscriptHash { + t.Fatal("client and host derived different record keys") + } + if _, err := client.Handle(hostResult.Response); !errors.Is(err, ErrInvalidHandshake) { + t.Fatalf("repeated auth ok err=%v", err) + } +} + +func TestHostHandshakeRejectsExpiredTicketAndMutatedProofs(t *testing.T) { + accountKey := bytes.Repeat([]byte{0x51}, accountKeySize) + auth, _ := NewAccountKeyAuthenticator(accountKey) + authorization := testAuthorization(time.Now().Add(time.Minute)) + clientPrivate, _ := GenerateEphemeralKey() + + expired, _ := NewHostHandshake(auth, testAuthorization(time.Now().Add(-time.Millisecond))) + expired.now = time.Now + hello, _ := EncodeClientHello(expired.authorization.AttemptID, expired.authorization.Ticket, clientPrivate.PublicKey().Bytes()) + if _, err := expired.Handle(hello); !errors.Is(err, ErrInvalidHandshake) { + t.Fatalf("expired err=%v", err) + } + + wrongTicketHost, _ := NewHostHandshake(auth, authorization) + wrongTicket := append([]byte(nil), authorization.Ticket...) + wrongTicket[0] ^= 0xff + hello, _ = EncodeClientHello(authorization.AttemptID, wrongTicket, clientPrivate.PublicKey().Bytes()) + if _, err := wrongTicketHost.Handle(hello); !errors.Is(err, ErrInvalidHandshake) { + t.Fatalf("wrong ticket err=%v", err) + } + + mutatedHost, _ := NewHostHandshake(auth, authorization) + hello, _ = EncodeClientHello(authorization.AttemptID, authorization.Ticket, clientPrivate.PublicKey().Bytes()) + first, err := mutatedHost.Handle(hello) + if err != nil { + t.Fatal(err) + } + hostPublic, _, _ := DecodeHostHello(first.Response) + transcript, _ := buildHandshakeTestTranscript(authorization, clientPrivate.PublicKey().Bytes(), hostPublic) + clientProof, _ := auth.BuildProof(transcript, RoleClient) + finishProof, _ := BuildFinishProof(auth, transcript) + clientProof[0] ^= 0xff + finish, _ := EncodeClientFinish(clientProof, finishProof) + if _, err := mutatedHost.Handle(finish); !errors.Is(err, ErrInvalidHandshake) { + t.Fatalf("mutated proof err=%v", err) + } +} + +func testAuthorization(expiresAt time.Time) Authorization { + return Authorization{ + AttemptID: uuid.New(), + Ticket: bytes.Repeat([]byte{0x31}, directTicketSize), + SessionID: uuid.New(), + UserID: "user-01", + HostID: "host-01", + ClientInstanceID: "client-01", + Permission: PermissionControl, + ExpiresAtUnixMillis: uint64(expiresAt.UnixMilli()), + } +} + +func buildHandshakeTestTranscript(authorization Authorization, clientPublic, hostPublic []byte) ([]byte, error) { + return (Transcript{ + AttemptID: authorization.AttemptID, + Ticket: authorization.Ticket, + SessionID: authorization.SessionID, + UserID: authorization.UserID, + HostID: authorization.HostID, + ClientInstanceID: authorization.ClientInstanceID, + Permission: authorization.Permission, + ExpiresAtUnixMillis: authorization.ExpiresAtUnixMillis, + ClientPublicKey: clientPublic, + HostPublicKey: hostPublic, + }).MarshalBinary() +} diff --git a/internal/peertransport/pion_chrome_spike_test.go b/internal/peertransport/pion_chrome_spike_test.go new file mode 100644 index 00000000..3bb2f750 --- /dev/null +++ b/internal/peertransport/pion_chrome_spike_test.go @@ -0,0 +1,208 @@ +package peertransport + +import ( + "bytes" + "crypto/sha256" + "encoding/json" + "fmt" + "net/http" + "net/http/httptest" + "os/exec" + "strings" + "sync" + "testing" + "time" + + "github.com/pion/webrtc/v4" +) + +func TestPionChromiumOrderedReliableDataChannel(t *testing.T) { + chrome, err := findChrome() + if err != nil { + t.Skip("Chrome not installed; browser DataChannel spike skipped") + } + if testing.Short() { + t.Skip("browser DataChannel spike skipped in short mode") + } + + answerPC, err := webrtc.NewPeerConnection(webrtc.Configuration{}) + if err != nil { + t.Fatal(err) + } + defer answerPC.Close() + errCh := make(chan error, 4) + browserDone := make(chan struct{}) + var browserDoneOnce sync.Once + var reassembler Reassembler + answerPC.OnDataChannel(func(dc *webrtc.DataChannel) { + if dc.Label() != "atterm-terminal-v1" || !dc.Ordered() || dc.MaxPacketLifeTime() != nil || dc.MaxRetransmits() != nil { + nonBlockingTestError(errCh, fmt.Errorf("unexpected Chromium channel reliability")) + return + } + dc.OnMessage(func(message webrtc.DataChannelMessage) { + frame, complete, addErr := reassembler.Add(message.Data, time.Now()) + if addErr != nil { + nonBlockingTestError(errCh, addErr) + return + } + if !complete { + return + } + want := make([]byte, 10*1024*1024) + for i := range want { + want[i] = byte(i % 251) + } + gotHash := sha256.Sum256(frame) + wantHash := sha256.Sum256(want) + if !bytes.Equal(gotHash[:], wantHash[:]) { + nonBlockingTestError(errCh, fmt.Errorf("Chromium payload hash differs")) + return + } + if sendErr := dc.SendText("ok"); sendErr != nil { + nonBlockingTestError(errCh, sendErr) + } + }) + }) + + mux := http.NewServeMux() + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { + w.Header().Set("Content-Type", "text/html; charset=utf-8") + _, _ = w.Write([]byte(chromiumSpikePage)) + }) + mux.HandleFunc("/wait", func(w http.ResponseWriter, _ *http.Request) { + select { + case <-browserDone: + w.WriteHeader(http.StatusNoContent) + case <-time.After(25 * time.Second): + http.Error(w, "browser timeout", http.StatusGatewayTimeout) + } + }) + mux.HandleFunc("/complete", func(w http.ResponseWriter, _ *http.Request) { + browserDoneOnce.Do(func() { close(browserDone) }) + w.WriteHeader(http.StatusNoContent) + }) + mux.HandleFunc("/offer", func(w http.ResponseWriter, r *http.Request) { + var offer webrtc.SessionDescription + if decodeErr := json.NewDecoder(http.MaxBytesReader(w, r.Body, 128*1024)).Decode(&offer); decodeErr != nil { + http.Error(w, "bad offer", http.StatusBadRequest) + nonBlockingTestError(errCh, decodeErr) + return + } + if setErr := answerPC.SetRemoteDescription(offer); setErr != nil { + http.Error(w, "bad remote description", http.StatusBadRequest) + nonBlockingTestError(errCh, setErr) + return + } + answer, createErr := answerPC.CreateAnswer(nil) + if createErr != nil { + http.Error(w, "create answer failed", http.StatusInternalServerError) + nonBlockingTestError(errCh, createErr) + return + } + gathered := webrtc.GatheringCompletePromise(answerPC) + if setErr := answerPC.SetLocalDescription(answer); setErr != nil { + http.Error(w, "set answer failed", http.StatusInternalServerError) + nonBlockingTestError(errCh, setErr) + return + } + <-gathered + w.Header().Set("Content-Type", "application/json") + if encodeErr := json.NewEncoder(w).Encode(answerPC.LocalDescription()); encodeErr != nil { + nonBlockingTestError(errCh, encodeErr) + } + }) + server := httptest.NewServer(mux) + defer server.Close() + + started := time.Now() + cmd := exec.Command(chrome, + "--headless=new", + "--no-sandbox", + "--disable-gpu", + "--disable-dev-shm-usage", + "--disable-features=WebRtcHideLocalIpsWithMdns", + "--no-proxy-server", + "--user-data-dir="+t.TempDir(), + "--virtual-time-budget=20000", + "--dump-dom", + server.URL, + ) + output, runErr := cmd.CombinedOutput() + select { + case callbackErr := <-errCh: + t.Fatal(callbackErr) + default: + } + if runErr != nil { + t.Fatalf("Chrome spike: %v\n%s", runErr, output) + } + if !strings.Contains(string(output), `data-result="pass"`) { + t.Fatalf("Chrome did not complete DataChannel transfer:\n%s", output) + } + t.Logf("Chromium -> Pion 10 MiB transfer completed in %s", time.Since(started)) +} + +func findChrome() (string, error) { + for _, name := range []string{"google-chrome", "chromium", "chromium-browser"} { + if path, err := exec.LookPath(name); err == nil { + return path, nil + } + } + return "", exec.ErrNotFound +} + +func nonBlockingTestError(ch chan<- error, err error) { + select { + case ch <- err: + default: + } +} + +const chromiumSpikePage = ` +` diff --git a/internal/peertransport/pion_client.go b/internal/peertransport/pion_client.go new file mode 100644 index 00000000..8931449f --- /dev/null +++ b/internal/peertransport/pion_client.go @@ -0,0 +1,340 @@ +package peertransport + +import ( + "context" + "encoding/json" + "fmt" + "sync" + "time" + + "github.com/pion/webrtc/v4" +) + +// PionClientConfig contains one Relay-authorized client attempt. +type PionClientConfig struct { + Authorization Authorization + Authenticator HandshakeAuthenticator + WebRTC webrtc.Configuration + SendSignal func(signalType, payload string) error + OnAuthenticated func(*PionClientChannel) + OnRecord func(RecordKind, []byte) + OnDiagnostics func(iceState, candidateType string) + OnClosed func(error) +} + +// PionClientAttempt owns the offerer side of one direct route. +type PionClientAttempt struct { + ctx context.Context + cancel context.CancelFunc + pc *webrtc.PeerConnection + dc *webrtc.DataChannel + handshake *ClientHandshake + cfg PionClientConfig + + mu sync.Mutex + channel *PionClientChannel + timer *time.Timer + started bool + closed bool +} + +// PionClientChannel is available only after account-key authentication. +type PionClientChannel struct { + attempt *PionClientAttempt + dc *webrtc.DataChannel + sealer *RecordSealer + opener *RecordOpener + reassembler Reassembler + + sendMu sync.Mutex + receiveMu sync.Mutex + nextMessageID uint64 +} + +func NewPionClientAttempt(parent context.Context, cfg PionClientConfig) (*PionClientAttempt, error) { + if parent == nil || cfg.SendSignal == nil { + return nil, fmt.Errorf("%w: missing context or signaling sender", ErrDirectTransport) + } + handshake, err := NewClientHandshake(cfg.Authenticator, cfg.Authorization) + if err != nil { + return nil, err + } + pc, err := webrtc.NewPeerConnection(cfg.WebRTC) + if err != nil { + return nil, fmt.Errorf("%w: create peer connection: %v", ErrDirectTransport, err) + } + dc, err := pc.CreateDataChannel(TerminalDataChannelLabel, nil) + if err != nil { + _ = pc.Close() + return nil, fmt.Errorf("%w: create data channel: %v", ErrDirectTransport, err) + } + ctx, cancel := context.WithCancel(parent) + a := &PionClientAttempt{ctx: ctx, cancel: cancel, pc: pc, dc: dc, handshake: handshake, cfg: cfg} + pc.OnICEConnectionStateChange(func(state webrtc.ICEConnectionState) { + candidateType := "" + if state == webrtc.ICEConnectionStateConnected || state == webrtc.ICEConnectionStateCompleted { + if sctp := pc.SCTP(); sctp != nil && sctp.Transport() != nil && sctp.Transport().ICETransport() != nil { + if pair, pairErr := sctp.Transport().ICETransport().GetSelectedCandidatePair(); pairErr == nil && pair != nil && pair.Local != nil { + candidateType = pair.Local.Typ.String() + } + } + } + if cfg.OnDiagnostics != nil { + cfg.OnDiagnostics(state.String(), candidateType) + } + }) + pc.OnConnectionStateChange(func(state webrtc.PeerConnectionState) { + switch state { + case webrtc.PeerConnectionStateFailed, webrtc.PeerConnectionStateDisconnected: + a.fail(fmt.Errorf("%w: peer connection %s", ErrDirectTransport, state.String())) + case webrtc.PeerConnectionStateClosed: + a.fail(fmt.Errorf("%w: peer connection closed", ErrDirectTransport)) + } + }) + dc.OnOpen(a.onDataChannelOpen) + dc.OnMessage(a.onDataChannelMessage) + dc.OnClose(func() { a.fail(fmt.Errorf("%w: data channel closed", ErrDirectTransport)) }) + dc.OnError(func(err error) { a.fail(fmt.Errorf("%w: data channel: %v", ErrDirectTransport, err)) }) + go func() { + <-ctx.Done() + a.finish(context.Cause(ctx)) + }() + return a, nil +} + +func (a *PionClientAttempt) Start() error { + a.mu.Lock() + if a.closed || a.started { + a.mu.Unlock() + return fmt.Errorf("%w: client attempt unavailable", ErrDirectTransport) + } + a.started = true + a.timer = time.AfterFunc(directHandshakeTimeout, func() { + a.fail(fmt.Errorf("%w: handshake timeout", ErrDirectTransport)) + }) + a.mu.Unlock() + offer, err := a.pc.CreateOffer(nil) + if err != nil { + return fmt.Errorf("%w: create offer: %v", ErrDirectTransport, err) + } + gathered := webrtc.GatheringCompletePromise(a.pc) + if err := a.pc.SetLocalDescription(offer); err != nil { + return fmt.Errorf("%w: set offer: %v", ErrDirectTransport, err) + } + select { + case <-a.ctx.Done(): + return fmt.Errorf("%w: gathering cancelled", ErrDirectTransport) + case <-gathered: + } + encoded, err := json.Marshal(a.pc.LocalDescription()) + if err != nil { + return fmt.Errorf("%w: encode offer: %v", ErrDirectTransport, err) + } + if err := a.cfg.SendSignal("offer", string(encoded)); err != nil { + return fmt.Errorf("%w: send offer: %v", ErrDirectTransport, err) + } + return a.cfg.SendSignal("ice_end", "") +} + +func (a *PionClientAttempt) HandleSignal(signalType, payload string) error { + if a == nil || a.pc == nil { + return fmt.Errorf("%w: nil attempt", ErrDirectTransport) + } + switch signalType { + case "answer": + var answer webrtc.SessionDescription + if err := json.Unmarshal([]byte(payload), &answer); err != nil || answer.Type != webrtc.SDPTypeAnswer { + return fmt.Errorf("%w: invalid answer", ErrDirectTransport) + } + if err := a.pc.SetRemoteDescription(answer); err != nil { + return fmt.Errorf("%w: set answer: %v", ErrDirectTransport, err) + } + return nil + case "ice_candidate": + var candidate webrtc.ICECandidateInit + if err := json.Unmarshal([]byte(payload), &candidate); err != nil { + return fmt.Errorf("%w: invalid ICE candidate", ErrDirectTransport) + } + if err := a.pc.AddICECandidate(candidate); err != nil { + return fmt.Errorf("%w: add ICE candidate: %v", ErrDirectTransport, err) + } + return nil + case "ice_end": + return nil + default: + return fmt.Errorf("%w: unsupported signal %q", ErrDirectTransport, signalType) + } +} + +func (a *PionClientAttempt) onDataChannelOpen() { + hello, err := a.handshake.ClientHello() + if err != nil { + a.fail(err) + return + } + if err := a.dc.Send(hello); err != nil { + a.fail(fmt.Errorf("%w: send client hello: %v", ErrDirectTransport, err)) + } +} + +func (a *PionClientAttempt) onDataChannelMessage(message webrtc.DataChannelMessage) { + if message.IsString { + a.fail(fmt.Errorf("%w: text data channel message", ErrDirectTransport)) + return + } + a.mu.Lock() + channel := a.channel + a.mu.Unlock() + if channel != nil { + if err := channel.receive(message.Data); err != nil { + a.fail(err) + } + return + } + result, err := a.handshake.Handle(message.Data) + if err != nil { + a.fail(err) + return + } + if len(result.Response) > 0 { + if err := a.dc.Send(result.Response); err != nil { + a.fail(fmt.Errorf("%w: send handshake: %v", ErrDirectTransport, err)) + return + } + } + if !result.Authenticated { + return + } + sealer, err := NewRecordSealer(result.TrafficKeys.ClientToHostKey[:], result.TrafficKeys.ClientToHostNoncePrefix[:], result.TranscriptHash) + if err != nil { + a.fail(err) + return + } + opener, err := NewRecordOpener(result.TrafficKeys.HostToClientKey[:], result.TrafficKeys.HostToClientNoncePrefix[:], result.TranscriptHash) + if err != nil { + a.fail(err) + return + } + channel = &PionClientChannel{attempt: a, dc: a.dc, sealer: sealer, opener: opener, nextMessageID: 1} + a.mu.Lock() + a.channel = channel + if a.timer != nil { + a.timer.Stop() + a.timer = nil + } + a.mu.Unlock() + if a.cfg.OnAuthenticated != nil { + a.cfg.OnAuthenticated(channel) + } +} + +func (c *PionClientChannel) receive(record []byte) error { + c.receiveMu.Lock() + defer c.receiveMu.Unlock() + kind, plaintext, err := c.opener.Open(record) + if err != nil { + return err + } + if kind == RecordFragment { + frame, complete, err := c.reassembler.Add(plaintext, time.Now()) + if err != nil || !complete { + return err + } + kind = RecordFrame + plaintext = frame + } + if c.attempt.cfg.OnRecord != nil { + c.attempt.cfg.OnRecord(kind, append([]byte(nil), plaintext...)) + } + return nil +} + +func (c *PionClientChannel) SendRecord(ctx context.Context, kind RecordKind, plaintext []byte) error { + if c == nil || c.dc == nil || c.sealer == nil { + return fmt.Errorf("%w: unauthenticated channel", ErrDirectTransport) + } + c.sendMu.Lock() + defer c.sendMu.Unlock() + return c.sendRecordLocked(ctx, kind, plaintext) +} + +func (c *PionClientChannel) SendFrame(ctx context.Context, frame []byte) error { + if c == nil || c.dc == nil || c.sealer == nil { + return fmt.Errorf("%w: unauthenticated channel", ErrDirectTransport) + } + if len(frame) > MaxFrameSize { + return fmt.Errorf("%w: frame too large", ErrDirectTransport) + } + c.sendMu.Lock() + defer c.sendMu.Unlock() + if len(frame) <= MaxRecordPlaintext { + return c.sendRecordLocked(ctx, RecordFrame, frame) + } + fragments, err := FragmentFrame(c.nextMessageID, frame) + if err != nil { + return err + } + c.nextMessageID++ + for _, fragment := range fragments { + if err := c.sendRecordLocked(ctx, RecordFragment, fragment); err != nil { + return err + } + } + return nil +} + +func (c *PionClientChannel) sendRecordLocked(ctx context.Context, kind RecordKind, plaintext []byte) error { + for c.dc.BufferedAmount() > directBufferedHighWater { + select { + case <-ctx.Done(): + return ctx.Err() + case <-c.attempt.ctx.Done(): + return fmt.Errorf("%w: attempt closed", ErrDirectTransport) + case <-time.After(directBufferedPoll): + } + } + record, err := c.sealer.Seal(kind, plaintext) + if err != nil { + return err + } + if err := c.dc.Send(record); err != nil { + return fmt.Errorf("%w: send record: %v", ErrDirectTransport, err) + } + return nil +} + +func (c *PionClientChannel) Close() error { + if c == nil || c.attempt == nil { + return nil + } + return c.attempt.Close() +} + +func (a *PionClientAttempt) Close() error { + if a == nil { + return nil + } + a.finish(nil) + return nil +} + +func (a *PionClientAttempt) fail(err error) { a.finish(err) } + +func (a *PionClientAttempt) finish(err error) { + a.mu.Lock() + if a.closed { + a.mu.Unlock() + return + } + a.closed = true + if a.timer != nil { + a.timer.Stop() + a.timer = nil + } + a.mu.Unlock() + a.cancel() + _ = a.pc.Close() + if a.cfg.OnClosed != nil { + a.cfg.OnClosed(err) + } +} diff --git a/internal/peertransport/pion_client_test.go b/internal/peertransport/pion_client_test.go new file mode 100644 index 00000000..8a972c84 --- /dev/null +++ b/internal/peertransport/pion_client_test.go @@ -0,0 +1,133 @@ +package peertransport + +import ( + "bytes" + "context" + "encoding/binary" + "fmt" + "testing" + "time" + + "github.com/pion/webrtc/v4" +) + +func TestPionClientAndHostCarryEncryptedRecords(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + auth, err := NewAccountKeyAuthenticator(bytes.Repeat([]byte{0x72}, accountKeySize)) + if err != nil { + t.Fatal(err) + } + authorization := testAuthorization(time.Now().Add(time.Minute)) + errCh := make(chan error, 8) + hostRecord := make(chan []byte, 1) + clientFrame := make(chan []byte, 1) + clientReady := make(chan uint64, 1) + clientAuthenticated := make(chan struct{}, 1) + + var client *PionClientAttempt + host, err := NewPionHostAttempt(ctx, PionHostConfig{ + Authorization: authorization, + Authenticator: auth, + WebRTC: webrtc.Configuration{}, + SendSignal: func(signalType, payload string) error { + if client == nil { + return fmt.Errorf("client not ready") + } + return client.HandleSignal(signalType, payload) + }, + OnAuthenticated: func(channel *PionHostChannel) { + ready := make([]byte, 8) + binary.BigEndian.PutUint64(ready, 41) + if sendErr := channel.SendRecord(ctx, RecordDirectReady, ready); sendErr != nil { + nonBlockingTestError(errCh, sendErr) + } + if sendErr := channel.SendFrame(ctx, []byte("host output")); sendErr != nil { + nonBlockingTestError(errCh, sendErr) + } + }, + OnRecord: func(kind RecordKind, payload []byte) { + if kind != RecordFrame { + nonBlockingTestError(errCh, fmt.Errorf("host record kind=%d", kind)) + return + } + hostRecord <- payload + }, + OnClosed: func(closeErr error) { + if closeErr != nil && ctx.Err() == nil { + nonBlockingTestError(errCh, closeErr) + } + }, + }) + if err != nil { + t.Fatal(err) + } + defer host.Close() + + client, err = NewPionClientAttempt(ctx, PionClientConfig{ + Authorization: authorization, + Authenticator: auth, + WebRTC: webrtc.Configuration{}, + SendSignal: func(signalType, payload string) error { + return host.HandleSignal(signalType, payload) + }, + OnAuthenticated: func(channel *PionClientChannel) { + clientAuthenticated <- struct{}{} + if sendErr := channel.SendFrame(ctx, []byte("client input")); sendErr != nil { + nonBlockingTestError(errCh, sendErr) + } + }, + OnRecord: func(kind RecordKind, payload []byte) { + switch kind { + case RecordFrame: + clientFrame <- payload + case RecordDirectReady: + if len(payload) != 8 { + nonBlockingTestError(errCh, fmt.Errorf("ready payload length=%d", len(payload))) + return + } + clientReady <- binary.BigEndian.Uint64(payload) + default: + nonBlockingTestError(errCh, fmt.Errorf("client record kind=%d", kind)) + } + }, + OnClosed: func(closeErr error) { + if closeErr != nil && ctx.Err() == nil { + nonBlockingTestError(errCh, closeErr) + } + }, + }) + if err != nil { + t.Fatal(err) + } + defer client.Close() + if err := client.Start(); err != nil { + t.Fatal(err) + } + + for authenticated, gotHost, gotFrame, gotReady := false, false, false, false; !authenticated || !gotHost || !gotFrame || !gotReady; { + select { + case <-ctx.Done(): + t.Fatal(ctx.Err()) + case err := <-errCh: + t.Fatal(err) + case <-clientAuthenticated: + authenticated = true + case payload := <-hostRecord: + if string(payload) != "client input" { + t.Fatalf("host payload=%q", payload) + } + gotHost = true + case payload := <-clientFrame: + if string(payload) != "host output" { + t.Fatalf("client payload=%q", payload) + } + gotFrame = true + case seq := <-clientReady: + if seq != 41 { + t.Fatalf("ready seq=%d", seq) + } + gotReady = true + } + } +} diff --git a/internal/peertransport/pion_host.go b/internal/peertransport/pion_host.go new file mode 100644 index 00000000..0c7f8e7b --- /dev/null +++ b/internal/peertransport/pion_host.go @@ -0,0 +1,347 @@ +package peertransport + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "sync" + "time" + + "github.com/pion/webrtc/v4" +) + +const ( + TerminalDataChannelLabel = "atterm-terminal-v1" + directBufferedHighWater = 1024 * 1024 + directBufferedPoll = 2 * time.Millisecond +) + +var ErrDirectTransport = errors.New("peertransport: direct transport failed") + +// PionHostConfig contains one Relay-authorized host attempt. SendSignal must +// enqueue bounded signaling messages without logging their payloads. +type PionHostConfig struct { + Authorization Authorization + Authenticator HandshakeAuthenticator + WebRTC webrtc.Configuration + SendSignal func(signalType, payload string) error + OnAuthenticated func(*PionHostChannel) + OnRecord func(RecordKind, []byte) + OnClosed func(error) +} + +// PionHostAttempt owns one PeerConnection and consumes one direct ticket. +type PionHostAttempt struct { + ctx context.Context + cancel context.CancelFunc + pc *webrtc.PeerConnection + handshake *HostHandshake + cfg PionHostConfig + + mu sync.Mutex + handshakeMu sync.Mutex + offerSeen bool + dataChannel *webrtc.DataChannel + channel *PionHostChannel + timer *time.Timer + closed bool +} + +// PionHostChannel is available only after account-key authentication. Send +// methods serialize counters and enforce DataChannel backpressure. +type PionHostChannel struct { + attempt *PionHostAttempt + dc *webrtc.DataChannel + sealer *RecordSealer + opener *RecordOpener + reassembler Reassembler + + sendMu sync.Mutex + receiveMu sync.Mutex + nextMessageID uint64 +} + +func NewPionHostAttempt(parent context.Context, cfg PionHostConfig) (*PionHostAttempt, error) { + if parent == nil || cfg.SendSignal == nil { + return nil, fmt.Errorf("%w: missing context or signaling sender", ErrDirectTransport) + } + handshake, err := NewHostHandshake(cfg.Authenticator, cfg.Authorization) + if err != nil { + return nil, err + } + pc, err := webrtc.NewPeerConnection(cfg.WebRTC) + if err != nil { + return nil, fmt.Errorf("%w: create peer connection: %v", ErrDirectTransport, err) + } + ctx, cancel := context.WithCancel(parent) + a := &PionHostAttempt{ctx: ctx, cancel: cancel, pc: pc, handshake: handshake, cfg: cfg} + pc.OnDataChannel(a.onDataChannel) + pc.OnConnectionStateChange(func(state webrtc.PeerConnectionState) { + switch state { + case webrtc.PeerConnectionStateFailed: + a.fail(fmt.Errorf("%w: peer connection failed", ErrDirectTransport)) + case webrtc.PeerConnectionStateClosed: + a.finish(nil) + } + }) + go func() { + <-ctx.Done() + a.finish(context.Cause(ctx)) + }() + return a, nil +} + +// HandleSignal applies one Relay-routed offer or ICE message. The v0.6 client +// is the sole offerer; renegotiation is intentionally unsupported. +func (a *PionHostAttempt) HandleSignal(signalType, payload string) error { + if a == nil || a.pc == nil { + return fmt.Errorf("%w: nil attempt", ErrDirectTransport) + } + select { + case <-a.ctx.Done(): + return fmt.Errorf("%w: attempt closed", ErrDirectTransport) + default: + } + switch signalType { + case "offer": + a.mu.Lock() + if a.offerSeen { + a.mu.Unlock() + return fmt.Errorf("%w: duplicate offer", ErrDirectTransport) + } + a.offerSeen = true + a.mu.Unlock() + var offer webrtc.SessionDescription + if err := json.Unmarshal([]byte(payload), &offer); err != nil || offer.Type != webrtc.SDPTypeOffer { + return fmt.Errorf("%w: invalid offer", ErrDirectTransport) + } + if err := a.pc.SetRemoteDescription(offer); err != nil { + return fmt.Errorf("%w: set offer: %v", ErrDirectTransport, err) + } + answer, err := a.pc.CreateAnswer(nil) + if err != nil { + return fmt.Errorf("%w: create answer: %v", ErrDirectTransport, err) + } + gathered := webrtc.GatheringCompletePromise(a.pc) + if err := a.pc.SetLocalDescription(answer); err != nil { + return fmt.Errorf("%w: set answer: %v", ErrDirectTransport, err) + } + select { + case <-a.ctx.Done(): + return fmt.Errorf("%w: gathering cancelled", ErrDirectTransport) + case <-gathered: + } + encoded, err := json.Marshal(a.pc.LocalDescription()) + if err != nil { + return fmt.Errorf("%w: encode answer: %v", ErrDirectTransport, err) + } + if err := a.cfg.SendSignal("answer", string(encoded)); err != nil { + return fmt.Errorf("%w: send answer: %v", ErrDirectTransport, err) + } + return a.cfg.SendSignal("ice_end", "") + case "ice_candidate": + var candidate webrtc.ICECandidateInit + if err := json.Unmarshal([]byte(payload), &candidate); err != nil { + return fmt.Errorf("%w: invalid ICE candidate", ErrDirectTransport) + } + if err := a.pc.AddICECandidate(candidate); err != nil { + return fmt.Errorf("%w: add ICE candidate: %v", ErrDirectTransport, err) + } + return nil + case "ice_end": + return nil + default: + return fmt.Errorf("%w: unsupported signal %q", ErrDirectTransport, signalType) + } +} + +func (a *PionHostAttempt) onDataChannel(dc *webrtc.DataChannel) { + if dc.Label() != TerminalDataChannelLabel || !dc.Ordered() || dc.MaxPacketLifeTime() != nil || dc.MaxRetransmits() != nil { + a.fail(fmt.Errorf("%w: invalid data channel", ErrDirectTransport)) + return + } + a.mu.Lock() + if a.dataChannel != nil { + a.mu.Unlock() + a.fail(fmt.Errorf("%w: duplicate data channel", ErrDirectTransport)) + return + } + a.dataChannel = dc + a.mu.Unlock() + dc.OnOpen(func() { + a.mu.Lock() + if a.timer == nil { + a.timer = time.AfterFunc(directHandshakeTimeout, func() { + a.fail(fmt.Errorf("%w: handshake timeout", ErrDirectTransport)) + }) + } + a.mu.Unlock() + }) + dc.OnMessage(a.onDataChannelMessage) + dc.OnClose(func() { a.finish(nil) }) +} + +func (a *PionHostAttempt) onDataChannelMessage(message webrtc.DataChannelMessage) { + if message.IsString { + a.fail(fmt.Errorf("%w: text data channel message", ErrDirectTransport)) + return + } + a.mu.Lock() + channel := a.channel + dc := a.dataChannel + a.mu.Unlock() + if channel != nil { + if err := channel.receive(message.Data); err != nil { + a.fail(err) + } + return + } + a.handshakeMu.Lock() + result, err := a.handshake.Handle(message.Data) + a.handshakeMu.Unlock() + if err != nil { + a.fail(err) + return + } + if err := dc.Send(result.Response); err != nil { + a.fail(fmt.Errorf("%w: send handshake: %v", ErrDirectTransport, err)) + return + } + if !result.Authenticated { + return + } + sealer, err := NewRecordSealer(result.TrafficKeys.HostToClientKey[:], result.TrafficKeys.HostToClientNoncePrefix[:], result.TranscriptHash) + if err != nil { + a.fail(err) + return + } + opener, err := NewRecordOpener(result.TrafficKeys.ClientToHostKey[:], result.TrafficKeys.ClientToHostNoncePrefix[:], result.TranscriptHash) + if err != nil { + a.fail(err) + return + } + channel = &PionHostChannel{attempt: a, dc: dc, sealer: sealer, opener: opener, nextMessageID: 1} + a.mu.Lock() + a.channel = channel + if a.timer != nil { + a.timer.Stop() + a.timer = nil + } + a.mu.Unlock() + if a.cfg.OnAuthenticated != nil { + a.cfg.OnAuthenticated(channel) + } +} + +func (c *PionHostChannel) receive(record []byte) error { + c.receiveMu.Lock() + defer c.receiveMu.Unlock() + kind, plaintext, err := c.opener.Open(record) + if err != nil { + return err + } + if kind == RecordFragment { + frame, complete, err := c.reassembler.Add(plaintext, time.Now()) + if err != nil || !complete { + return err + } + kind = RecordFrame + plaintext = frame + } + if c.attempt.cfg.OnRecord != nil { + c.attempt.cfg.OnRecord(kind, append([]byte(nil), plaintext...)) + } + return nil +} + +func (c *PionHostChannel) SendRecord(ctx context.Context, kind RecordKind, plaintext []byte) error { + if c == nil || c.dc == nil || c.sealer == nil { + return fmt.Errorf("%w: unauthenticated channel", ErrDirectTransport) + } + c.sendMu.Lock() + defer c.sendMu.Unlock() + return c.sendRecordLocked(ctx, kind, plaintext) +} + +// SendFrame encrypts one marshaled proto.Frame, fragmenting it when needed. +func (c *PionHostChannel) SendFrame(ctx context.Context, frame []byte) error { + if c == nil || c.dc == nil || c.sealer == nil { + return fmt.Errorf("%w: unauthenticated channel", ErrDirectTransport) + } + if len(frame) > MaxFrameSize { + return fmt.Errorf("%w: frame too large", ErrDirectTransport) + } + c.sendMu.Lock() + defer c.sendMu.Unlock() + if len(frame) <= MaxRecordPlaintext { + return c.sendRecordLocked(ctx, RecordFrame, frame) + } + fragments, err := FragmentFrame(c.nextMessageID, frame) + if err != nil { + return err + } + c.nextMessageID++ + for _, fragment := range fragments { + if err := c.sendRecordLocked(ctx, RecordFragment, fragment); err != nil { + return err + } + } + return nil +} + +func (c *PionHostChannel) sendRecordLocked(ctx context.Context, kind RecordKind, plaintext []byte) error { + for c.dc.BufferedAmount() > directBufferedHighWater { + select { + case <-ctx.Done(): + return ctx.Err() + case <-c.attempt.ctx.Done(): + return fmt.Errorf("%w: attempt closed", ErrDirectTransport) + case <-time.After(directBufferedPoll): + } + } + record, err := c.sealer.Seal(kind, plaintext) + if err != nil { + return err + } + if err := c.dc.Send(record); err != nil { + return fmt.Errorf("%w: send record: %v", ErrDirectTransport, err) + } + return nil +} + +func (c *PionHostChannel) Close() error { + if c == nil || c.attempt == nil { + return nil + } + return c.attempt.Close() +} + +func (a *PionHostAttempt) Close() error { + if a == nil { + return nil + } + a.finish(nil) + return nil +} + +func (a *PionHostAttempt) fail(err error) { a.finish(err) } + +func (a *PionHostAttempt) finish(err error) { + a.mu.Lock() + if a.closed { + a.mu.Unlock() + return + } + a.closed = true + if a.timer != nil { + a.timer.Stop() + a.timer = nil + } + a.mu.Unlock() + a.cancel() + _ = a.pc.Close() + if a.cfg.OnClosed != nil { + a.cfg.OnClosed(err) + } +} diff --git a/internal/peertransport/pion_host_test.go b/internal/peertransport/pion_host_test.go new file mode 100644 index 00000000..594f080b --- /dev/null +++ b/internal/peertransport/pion_host_test.go @@ -0,0 +1,217 @@ +package peertransport + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "sync" + "testing" + "time" + + "github.com/pion/webrtc/v4" +) + +func TestPionHostAttemptAuthenticatesAndCarriesEncryptedRecords(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + accountKey := bytes.Repeat([]byte{0x63}, accountKeySize) + auth, err := NewAccountKeyAuthenticator(accountKey) + if err != nil { + t.Fatal(err) + } + authorization := testAuthorization(time.Now().Add(time.Minute)) + answerCh := make(chan string, 1) + hostAuthenticated := make(chan *PionHostChannel, 1) + hostRecord := make(chan []byte, 1) + clientRecord := make(chan []byte, 1) + errCh := make(chan error, 8) + + hostAttempt, err := NewPionHostAttempt(ctx, PionHostConfig{ + Authorization: authorization, + Authenticator: auth, + SendSignal: func(signalType, payload string) error { + switch signalType { + case "answer": + answerCh <- payload + case "ice_end": + default: + return fmt.Errorf("unexpected host signal %q", signalType) + } + return nil + }, + OnAuthenticated: func(channel *PionHostChannel) { + hostAuthenticated <- channel + if sendErr := channel.SendRecord(ctx, RecordDirectReady, []byte("ready")); sendErr != nil { + nonBlockingTestError(errCh, sendErr) + } + }, + OnRecord: func(kind RecordKind, payload []byte) { + if kind != RecordFrame { + nonBlockingTestError(errCh, fmt.Errorf("host record kind=%d", kind)) + return + } + hostRecord <- payload + }, + OnClosed: func(closeErr error) { + if closeErr != nil && ctx.Err() == nil { + nonBlockingTestError(errCh, closeErr) + } + }, + }) + if err != nil { + t.Fatal(err) + } + defer hostAttempt.Close() + + clientPC, err := webrtc.NewPeerConnection(webrtc.Configuration{}) + if err != nil { + t.Fatal(err) + } + defer clientPC.Close() + dc, err := clientPC.CreateDataChannel(TerminalDataChannelLabel, nil) + if err != nil { + t.Fatal(err) + } + clientPrivate, err := GenerateEphemeralKey() + if err != nil { + t.Fatal(err) + } + clientHello, err := EncodeClientHello(authorization.AttemptID, authorization.Ticket, clientPrivate.PublicKey().Bytes()) + if err != nil { + t.Fatal(err) + } + + var ( + clientMu sync.Mutex + clientSealer *RecordSealer + clientOpener *RecordOpener + ) + dc.OnOpen(func() { + if sendErr := dc.Send(clientHello); sendErr != nil { + nonBlockingTestError(errCh, sendErr) + } + }) + dc.OnMessage(func(message webrtc.DataChannelMessage) { + clientMu.Lock() + defer clientMu.Unlock() + if IsAuthOK(message.Data) { + if clientSealer == nil { + nonBlockingTestError(errCh, fmt.Errorf("AUTH_OK before host hello")) + return + } + record, sealErr := clientSealer.Seal(RecordFrame, []byte("input")) + if sealErr != nil { + nonBlockingTestError(errCh, sealErr) + return + } + if sendErr := dc.Send(record); sendErr != nil { + nonBlockingTestError(errCh, sendErr) + } + return + } + if clientOpener != nil { + kind, plaintext, openErr := clientOpener.Open(message.Data) + if openErr != nil { + nonBlockingTestError(errCh, openErr) + return + } + if kind != RecordDirectReady { + nonBlockingTestError(errCh, fmt.Errorf("client record kind=%d", kind)) + return + } + clientRecord <- plaintext + return + } + hostPublic, hostProof, decodeErr := DecodeHostHello(message.Data) + if decodeErr != nil { + nonBlockingTestError(errCh, decodeErr) + return + } + transcript, transcriptErr := buildHandshakeTestTranscript(authorization, clientPrivate.PublicKey().Bytes(), hostPublic) + if transcriptErr != nil { + nonBlockingTestError(errCh, transcriptErr) + return + } + if verifyErr := auth.VerifyProof(transcript, RoleHost, hostProof); verifyErr != nil { + nonBlockingTestError(errCh, verifyErr) + return + } + keys, keyErr := DeriveTrafficKeys(clientPrivate, hostPublic, transcript, auth) + if keyErr != nil { + nonBlockingTestError(errCh, keyErr) + return + } + hash := TranscriptHash(transcript) + clientSealer, keyErr = NewRecordSealer(keys.ClientToHostKey[:], keys.ClientToHostNoncePrefix[:], hash) + if keyErr == nil { + clientOpener, keyErr = NewRecordOpener(keys.HostToClientKey[:], keys.HostToClientNoncePrefix[:], hash) + } + if keyErr != nil { + nonBlockingTestError(errCh, keyErr) + return + } + clientProof, _ := auth.BuildProof(transcript, RoleClient) + finishProof, _ := BuildFinishProof(auth, transcript) + finish, _ := EncodeClientFinish(clientProof, finishProof) + if sendErr := dc.Send(finish); sendErr != nil { + nonBlockingTestError(errCh, sendErr) + } + }) + + offer, err := clientPC.CreateOffer(nil) + if err != nil { + t.Fatal(err) + } + gathered := webrtc.GatheringCompletePromise(clientPC) + if err := clientPC.SetLocalDescription(offer); err != nil { + t.Fatal(err) + } + select { + case <-ctx.Done(): + t.Fatal(ctx.Err()) + case <-gathered: + } + offerJSON, _ := json.Marshal(clientPC.LocalDescription()) + go func() { + if handleErr := hostAttempt.HandleSignal("offer", string(offerJSON)); handleErr != nil { + nonBlockingTestError(errCh, handleErr) + } + }() + + select { + case <-ctx.Done(): + t.Fatal(ctx.Err()) + case err := <-errCh: + t.Fatal(err) + case answerJSON := <-answerCh: + var answer webrtc.SessionDescription + if err := json.Unmarshal([]byte(answerJSON), &answer); err != nil { + t.Fatal(err) + } + if err := clientPC.SetRemoteDescription(answer); err != nil { + t.Fatal(err) + } + } + + for authenticated, gotHost, gotClient := false, false, false; !authenticated || !gotHost || !gotClient; { + select { + case <-ctx.Done(): + t.Fatal(ctx.Err()) + case err := <-errCh: + t.Fatal(err) + case <-hostAuthenticated: + authenticated = true + case payload := <-hostRecord: + if string(payload) != "input" { + t.Fatalf("host payload=%q", payload) + } + gotHost = true + case payload := <-clientRecord: + if string(payload) != "ready" { + t.Fatalf("client payload=%q", payload) + } + gotClient = true + } + } +} diff --git a/internal/peertransport/pion_spike_test.go b/internal/peertransport/pion_spike_test.go new file mode 100644 index 00000000..948c594f --- /dev/null +++ b/internal/peertransport/pion_spike_test.go @@ -0,0 +1,140 @@ +package peertransport + +import ( + "bytes" + "context" + "crypto/sha256" + "fmt" + "testing" + "time" + + "github.com/pion/webrtc/v4" +) + +func TestPionOrderedReliableDataChannelTenMiB(t *testing.T) { + const payloadSize = 10 * 1024 * 1024 + ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second) + defer cancel() + + offerPC, err := webrtc.NewPeerConnection(webrtc.Configuration{}) + if err != nil { + t.Fatal(err) + } + defer offerPC.Close() + answerPC, err := webrtc.NewPeerConnection(webrtc.Configuration{}) + if err != nil { + t.Fatal(err) + } + defer answerPC.Close() + + payload := make([]byte, payloadSize) + for i := range payload { + payload[i] = byte(i % 251) + } + wantHash := sha256.Sum256(payload) + fragments, err := FragmentFrame(1, payload) + if err != nil { + t.Fatal(err) + } + + errCh := make(chan error, 4) + completeCh := make(chan struct{}, 1) + var reassembler Reassembler + answerPC.OnDataChannel(func(dc *webrtc.DataChannel) { + if dc.Label() != "atterm-terminal-v1" || !dc.Ordered() || dc.MaxPacketLifeTime() != nil || dc.MaxRetransmits() != nil { + errCh <- fmt.Errorf("unexpected data channel reliability label=%q ordered=%v", dc.Label(), dc.Ordered()) + return + } + dc.OnMessage(func(message webrtc.DataChannelMessage) { + if message.IsString { + errCh <- fmt.Errorf("received text fragment") + return + } + frame, complete, addErr := reassembler.Add(message.Data, time.Now()) + if addErr != nil { + errCh <- addErr + return + } + if !complete { + return + } + gotHash := sha256.Sum256(frame) + if !bytes.Equal(gotHash[:], wantHash[:]) { + errCh <- fmt.Errorf("reassembled payload hash differs") + return + } + if sendErr := dc.SendText("ok"); sendErr != nil { + errCh <- sendErr + } + }) + }) + + dc, err := offerPC.CreateDataChannel("atterm-terminal-v1", nil) + if err != nil { + t.Fatal(err) + } + dc.OnMessage(func(message webrtc.DataChannelMessage) { + if message.IsString && string(message.Data) == "ok" { + select { + case completeCh <- struct{}{}: + default: + } + } + }) + dc.OnOpen(func() { + go func() { + for _, fragment := range fragments { + for dc.BufferedAmount() > 1024*1024 { + select { + case <-ctx.Done(): + errCh <- ctx.Err() + return + case <-time.After(time.Millisecond): + } + } + if sendErr := dc.Send(fragment); sendErr != nil { + errCh <- sendErr + return + } + } + }() + }) + + started := time.Now() + if err := signalPeerConnections(offerPC, answerPC); err != nil { + t.Fatal(err) + } + select { + case err := <-errCh: + t.Fatal(err) + case <-completeCh: + t.Logf("Pion loopback: setup + 10 MiB transfer completed in %s across %d fragments", time.Since(started), len(fragments)) + case <-ctx.Done(): + t.Fatal(ctx.Err()) + } +} + +func signalPeerConnections(offerPC, answerPC *webrtc.PeerConnection) error { + offer, err := offerPC.CreateOffer(nil) + if err != nil { + return err + } + offerGathered := webrtc.GatheringCompletePromise(offerPC) + if err := offerPC.SetLocalDescription(offer); err != nil { + return err + } + <-offerGathered + if err := answerPC.SetRemoteDescription(*offerPC.LocalDescription()); err != nil { + return err + } + answer, err := answerPC.CreateAnswer(nil) + if err != nil { + return err + } + answerGathered := webrtc.GatheringCompletePromise(answerPC) + if err := answerPC.SetLocalDescription(answer); err != nil { + return err + } + <-answerGathered + return offerPC.SetRemoteDescription(*answerPC.LocalDescription()) +} diff --git a/internal/peertransport/record.go b/internal/peertransport/record.go new file mode 100644 index 00000000..7767871b --- /dev/null +++ b/internal/peertransport/record.go @@ -0,0 +1,183 @@ +package peertransport + +import ( + "crypto/cipher" + "encoding/binary" + "errors" + "fmt" + "math" + + "golang.org/x/crypto/chacha20poly1305" +) + +const ( + recordVersion = 1 + recordHeaderSize = 1 + 1 + 8 + 4 + recordTagSize = 16 + // MaxRecordPlaintext keeps one DataChannel message well below browser + // implementation limits; larger terminal frames use FRAGMENT records. + MaxRecordPlaintext = 16 * 1024 +) + +var ( + // ErrInvalidRecord covers structure, kind, size and AEAD failures. Callers + // close the direct route and fall back instead of trying to recover in-band. + ErrInvalidRecord = errors.New("peertransport: invalid record") + // ErrRecordSequence means a duplicate, gap or exhausted counter. + ErrRecordSequence = errors.New("peertransport: invalid record sequence") +) + +// RecordKind identifies the plaintext carried inside a direct record. +type RecordKind byte + +const ( + RecordFrame RecordKind = 1 + RecordFragment RecordKind = 2 + RecordDirectReady RecordKind = 3 + RecordPing RecordKind = 4 + RecordPong RecordKind = 5 + RecordClose RecordKind = 6 +) + +func (k RecordKind) valid() bool { + return k >= RecordFrame && k <= RecordClose +} + +// RecordSealer emits strictly increasing records for one direction. +type RecordSealer struct { + aead cipher.AEAD + noncePrefix [directionalNonceSize]byte + transcriptHash [32]byte + next uint64 + exhausted bool +} + +// NewRecordSealer constructs one direction of the direct record layer. +func NewRecordSealer(key, noncePrefix []byte, transcriptHash [32]byte) (*RecordSealer, error) { + aead, prefix, err := newRecordCipher(key, noncePrefix) + if err != nil { + return nil, err + } + return &RecordSealer{aead: aead, noncePrefix: prefix, transcriptHash: transcriptHash}, nil +} + +// Seal encrypts plaintext at the next record counter. +func (s *RecordSealer) Seal(kind RecordKind, plaintext []byte) ([]byte, error) { + if s == nil || s.aead == nil { + return nil, fmt.Errorf("%w: nil sealer", ErrInvalidRecord) + } + if s.exhausted { + return nil, ErrRecordSequence + } + if !kind.valid() { + return nil, fmt.Errorf("%w: kind %d", ErrInvalidRecord, kind) + } + if len(plaintext) > MaxRecordPlaintext { + return nil, fmt.Errorf("%w: plaintext is %d bytes", ErrInvalidRecord, len(plaintext)) + } + counter := s.next + header := makeRecordHeader(kind, counter, len(plaintext)) + nonce := makeRecordNonce(s.noncePrefix, counter) + aad := makeRecordAAD(s.transcriptHash, header) + record := s.aead.Seal(header, nonce, plaintext, aad) + if counter == math.MaxUint64 { + s.exhausted = true + } else { + s.next++ + } + return record, nil +} + +// RecordOpener accepts only the next record counter for one direction. +type RecordOpener struct { + aead cipher.AEAD + noncePrefix [directionalNonceSize]byte + transcriptHash [32]byte + next uint64 + exhausted bool +} + +// NewRecordOpener constructs one direction of the direct record layer. +func NewRecordOpener(key, noncePrefix []byte, transcriptHash [32]byte) (*RecordOpener, error) { + aead, prefix, err := newRecordCipher(key, noncePrefix) + if err != nil { + return nil, err + } + return &RecordOpener{aead: aead, noncePrefix: prefix, transcriptHash: transcriptHash}, nil +} + +// Open validates structure, sequence and AEAD before advancing the counter. +func (o *RecordOpener) Open(record []byte) (RecordKind, []byte, error) { + if o == nil || o.aead == nil { + return 0, nil, fmt.Errorf("%w: nil opener", ErrInvalidRecord) + } + if o.exhausted { + return 0, nil, ErrRecordSequence + } + if len(record) < recordHeaderSize+recordTagSize { + return 0, nil, fmt.Errorf("%w: truncated", ErrInvalidRecord) + } + if record[0] != recordVersion { + return 0, nil, fmt.Errorf("%w: version %d", ErrInvalidRecord, record[0]) + } + kind := RecordKind(record[1]) + if !kind.valid() { + return 0, nil, fmt.Errorf("%w: kind %d", ErrInvalidRecord, kind) + } + counter := binary.BigEndian.Uint64(record[2:10]) + if counter != o.next { + return 0, nil, fmt.Errorf("%w: got %d want %d", ErrRecordSequence, counter, o.next) + } + plainLen := binary.BigEndian.Uint32(record[10:14]) + if plainLen > MaxRecordPlaintext || len(record) != recordHeaderSize+int(plainLen)+recordTagSize { + return 0, nil, fmt.Errorf("%w: length %d", ErrInvalidRecord, plainLen) + } + header := record[:recordHeaderSize] + nonce := makeRecordNonce(o.noncePrefix, counter) + aad := makeRecordAAD(o.transcriptHash, header) + plaintext, err := o.aead.Open(nil, nonce, record[recordHeaderSize:], aad) + if err != nil { + return 0, nil, fmt.Errorf("%w: authentication", ErrInvalidRecord) + } + if counter == math.MaxUint64 { + o.exhausted = true + } else { + o.next++ + } + return kind, plaintext, nil +} + +func newRecordCipher(key, noncePrefix []byte) (cipher.AEAD, [directionalNonceSize]byte, error) { + var prefix [directionalNonceSize]byte + if len(key) != chacha20poly1305.KeySize || len(noncePrefix) != directionalNonceSize { + return nil, prefix, fmt.Errorf("%w: key/prefix size %d/%d", ErrInvalidKey, len(key), len(noncePrefix)) + } + aead, err := chacha20poly1305.NewX(key) + if err != nil { + return nil, prefix, fmt.Errorf("XChaCha20-Poly1305: %w", err) + } + copy(prefix[:], noncePrefix) + return aead, prefix, nil +} + +func makeRecordHeader(kind RecordKind, counter uint64, plainLen int) []byte { + header := make([]byte, recordHeaderSize) + header[0] = recordVersion + header[1] = byte(kind) + binary.BigEndian.PutUint64(header[2:10], counter) + binary.BigEndian.PutUint32(header[10:14], uint32(plainLen)) + return header +} + +func makeRecordNonce(prefix [directionalNonceSize]byte, counter uint64) []byte { + nonce := make([]byte, chacha20poly1305.NonceSizeX) + copy(nonce, prefix[:]) + binary.BigEndian.PutUint64(nonce[directionalNonceSize:], counter) + return nonce +} + +func makeRecordAAD(transcriptHash [32]byte, header []byte) []byte { + aad := make([]byte, 0, len(transcriptHash)+len(header)) + aad = append(aad, transcriptHash[:]...) + return append(aad, header...) +} diff --git a/internal/peertransport/record_test.go b/internal/peertransport/record_test.go new file mode 100644 index 00000000..f6525c55 --- /dev/null +++ b/internal/peertransport/record_test.go @@ -0,0 +1,79 @@ +package peertransport + +import ( + "bytes" + "errors" + "testing" +) + +func recordPair(t *testing.T) (*RecordSealer, *RecordOpener) { + t.Helper() + key := bytes.Repeat([]byte{0x71}, 32) + prefix := bytes.Repeat([]byte{0x19}, 16) + hash := TranscriptHash([]byte("test transcript")) + sealer, err := NewRecordSealer(key, prefix, hash) + if err != nil { + t.Fatal(err) + } + opener, err := NewRecordOpener(key, prefix, hash) + if err != nil { + t.Fatal(err) + } + return sealer, opener +} + +func TestRecordRoundTripAndSequence(t *testing.T) { + sealer, opener := recordPair(t) + first, err := sealer.Seal(RecordFrame, []byte("frame-one")) + if err != nil { + t.Fatal(err) + } + kind, plaintext, err := opener.Open(first) + if err != nil { + t.Fatal(err) + } + if kind != RecordFrame || !bytes.Equal(plaintext, []byte("frame-one")) { + t.Fatalf("opened %d %q", kind, plaintext) + } + if _, _, err := opener.Open(first); !errors.Is(err, ErrRecordSequence) { + t.Fatalf("replay accepted: %v", err) + } + second, _ := sealer.Seal(RecordPing, bytes.Repeat([]byte{1}, 8)) + if _, _, err := opener.Open(second); err != nil { + t.Fatalf("second record after rejected replay: %v", err) + } +} + +func TestRecordRejectsTamperDirectionAndBounds(t *testing.T) { + sealer, _ := recordPair(t) + record, _ := sealer.Seal(RecordFrame, []byte("secret")) + + _, opener := recordPair(t) + tampered := append([]byte(nil), record...) + tampered[len(tampered)-1] ^= 1 + if _, _, err := opener.Open(tampered); !errors.Is(err, ErrInvalidRecord) { + t.Fatalf("tamper accepted: %v", err) + } + if _, _, err := opener.Open(record); err != nil { + t.Fatalf("failed authentication advanced counter: %v", err) + } + + _, gapOpener := recordPair(t) + gap := append([]byte(nil), record...) + gap[9] = 1 + if _, _, err := gapOpener.Open(gap); !errors.Is(err, ErrRecordSequence) { + t.Fatalf("counter gap accepted: %v", err) + } + + wrongKey, _ := NewRecordOpener(bytes.Repeat([]byte{0x72}, 32), bytes.Repeat([]byte{0x19}, 16), TranscriptHash([]byte("test transcript"))) + if _, _, err := wrongKey.Open(record); !errors.Is(err, ErrInvalidRecord) { + t.Fatalf("wrong direction key accepted: %v", err) + } + + if _, err := sealer.Seal(RecordFrame, make([]byte, MaxRecordPlaintext+1)); !errors.Is(err, ErrInvalidRecord) { + t.Fatalf("oversize accepted: %v", err) + } + if _, err := sealer.Seal(99, nil); !errors.Is(err, ErrInvalidRecord) { + t.Fatalf("unknown kind accepted: %v", err) + } +} diff --git a/internal/peertransport/route.go b/internal/peertransport/route.go new file mode 100644 index 00000000..40fe9f52 --- /dev/null +++ b/internal/peertransport/route.go @@ -0,0 +1,174 @@ +package peertransport + +import ( + "errors" + "fmt" +) + +var ErrInvalidRouteTransition = errors.New("peertransport: invalid route transition") + +// Route identifies the terminal byte path, not the trust principal. +type Route byte + +const ( + RouteNone Route = 0 + RouteRelay Route = 1 + RouteDirect Route = 2 +) + +// RouteState is the client-side handover phase for one session_id. +type RouteState byte + +const ( + RouteRelayAttached RouteState = iota + 1 + RouteDirectConnecting + RouteDirectReplay + RouteDirectActive + RouteRelayReattaching +) + +// RouteTracker models one output cursor and one input writer across route +// overlap. Network adapters attach the returned generation to their callbacks +// so late frames from closed routes cannot mutate current state. +type RouteTracker struct { + state RouteState + generation uint64 + committedSeq uint64 + directStartSeq uint64 + directObservedSeq uint64 + directReady bool +} + +// NewRouteTracker starts from an attached Relay path and its committed cursor. +func NewRouteTracker(committedSeq uint64) *RouteTracker { + return &RouteTracker{state: RouteRelayAttached, generation: 1, committedSeq: committedSeq} +} + +func (r *RouteTracker) State() RouteState { return r.state } + +func (r *RouteTracker) Generation() uint64 { return r.generation } + +func (r *RouteTracker) CommittedSeq() uint64 { return r.committedSeq } + +// BeginDirect starts an opportunistic attempt while Relay remains the writer. +func (r *RouteTracker) BeginDirect() (uint64, error) { + if r.state != RouteRelayAttached { + return r.generation, fmt.Errorf("%w: begin direct from %d", ErrInvalidRouteTransition, r.state) + } + r.state = RouteDirectConnecting + r.directStartSeq = r.committedSeq + r.directObservedSeq = r.committedSeq + r.directReady = false + return r.generation, nil +} + +// BeginDirectReplay admits output from both ordered routes. Input stays Relay. +func (r *RouteTracker) BeginDirectReplay(generation uint64) error { + if generation != r.generation || r.state != RouteDirectConnecting { + return fmt.Errorf("%w: begin replay generation=%d state=%d", ErrInvalidRouteTransition, generation, r.state) + } + r.state = RouteDirectReplay + return nil +} + +// NoteDirectReady records the end of the direct subscriber's initial replay. +// Relay may already have advanced committedSeq, so activation can still wait +// for ordered live direct frames to catch that cursor. +func (r *RouteTracker) NoteDirectReady(generation, replayedSeq uint64) error { + if generation != r.generation || r.state != RouteDirectReplay || replayedSeq < r.directStartSeq { + return fmt.Errorf("%w: ready generation=%d replayed=%d start=%d state=%d", + ErrInvalidRouteTransition, generation, replayedSeq, r.directStartSeq, r.state) + } + if replayedSeq > r.directObservedSeq { + r.directObservedSeq = replayedSeq + } + r.directReady = true + return nil +} + +// CanActivateDirect reports whether direct has observed every OUT sequence +// already committed from Relay after DIRECT_READY. +func (r *RouteTracker) CanActivateDirect(generation uint64) bool { + return generation == r.generation && r.state == RouteDirectReplay && r.directReady && r.directObservedSeq >= r.committedSeq +} + +// ActivateDirect switches the sole input writer after direct catch-up. +func (r *RouteTracker) ActivateDirect(generation uint64) error { + if !r.CanActivateDirect(generation) { + return fmt.Errorf("%w: activate generation=%d direct_observed=%d committed=%d ready=%t state=%d", + ErrInvalidRouteTransition, generation, r.directObservedSeq, r.committedSeq, r.directReady, r.state) + } + r.state = RouteDirectActive + return nil +} + +// AbortDirect keeps Relay active when setup fails before the switch. +func (r *RouteTracker) AbortDirect(generation uint64) error { + if generation != r.generation || (r.state != RouteDirectConnecting && r.state != RouteDirectReplay) { + return fmt.Errorf("%w: abort generation=%d state=%d", ErrInvalidRouteTransition, generation, r.state) + } + r.generation++ + r.state = RouteRelayAttached + return nil +} + +// DirectLost invalidates old callbacks and freezes input until Relay attach is +// confirmed. The new generation must be used for the fallback connection. +func (r *RouteTracker) DirectLost(generation uint64) (uint64, error) { + if generation != r.generation || r.state != RouteDirectActive { + return r.generation, fmt.Errorf("%w: direct lost generation=%d state=%d", ErrInvalidRouteTransition, generation, r.state) + } + r.generation++ + r.state = RouteRelayReattaching + return r.generation, nil +} + +// RelayAttached completes fallback from the current committed OUT cursor. +func (r *RouteTracker) RelayAttached(generation uint64) error { + if generation != r.generation || r.state != RouteRelayReattaching { + return fmt.Errorf("%w: relay attached generation=%d state=%d", ErrInvalidRouteTransition, generation, r.state) + } + r.state = RouteRelayAttached + return nil +} + +// InputRoute returns the only route currently allowed to send input/control. +// RouteNone deliberately freezes input during ambiguous fallback ownership. +func (r *RouteTracker) InputRoute() Route { + switch r.state { + case RouteRelayAttached, RouteDirectConnecting, RouteDirectReplay: + return RouteRelay + case RouteDirectActive: + return RouteDirect + default: + return RouteNone + } +} + +// AcceptOutput commits a new OUT sequence exactly once. false means a stale +// route, inactive route, or already committed duplicate and is safe to drop. +func (r *RouteTracker) AcceptOutput(generation uint64, route Route, seq uint64) bool { + if generation != r.generation || seq == 0 { + return false + } + allowed := false + switch r.state { + case RouteRelayAttached, RouteDirectConnecting, RouteRelayReattaching: + allowed = route == RouteRelay + case RouteDirectReplay: + allowed = route == RouteRelay || route == RouteDirect + case RouteDirectActive: + allowed = route == RouteDirect + } + if !allowed { + return false + } + if route == RouteDirect && r.state == RouteDirectReplay && seq > r.directObservedSeq { + r.directObservedSeq = seq + } + if seq <= r.committedSeq { + return false + } + r.committedSeq = seq + return true +} diff --git a/internal/peertransport/route_test.go b/internal/peertransport/route_test.go new file mode 100644 index 00000000..9129ae4e --- /dev/null +++ b/internal/peertransport/route_test.go @@ -0,0 +1,133 @@ +package peertransport + +import ( + "errors" + "testing" +) + +func TestRouteTrackerRepeatedHandoverHasOneOutputAndInputRoute(t *testing.T) { + tracker := NewRouteTracker(0) + delivered := make(map[uint64]int) + nextSeq := uint64(1) + + commit := func(generation uint64, route Route, seq uint64) { + t.Helper() + if tracker.AcceptOutput(generation, route, seq) { + delivered[seq]++ + } + } + + for cycle := 0; cycle < 100; cycle++ { + generation, err := tracker.BeginDirect() + if err != nil { + t.Fatal(err) + } + if tracker.InputRoute() != RouteRelay { + t.Fatal("direct setup changed input writer") + } + commit(generation, RouteRelay, nextSeq) + nextSeq++ + if err := tracker.BeginDirectReplay(generation); err != nil { + t.Fatal(err) + } + + // Both paths may surface the overlap. Whichever arrives first commits; + // the other is a duplicate and must not reach the terminal. + commit(generation, RouteDirect, nextSeq) + commit(generation, RouteRelay, nextSeq) + nextSeq++ + if err := tracker.NoteDirectReady(generation, tracker.CommittedSeq()); err != nil { + t.Fatal(err) + } + if err := tracker.ActivateDirect(generation); err != nil { + t.Fatal(err) + } + if tracker.InputRoute() != RouteDirect { + t.Fatal("direct active did not become sole input writer") + } + commit(generation, RouteRelay, nextSeq) + commit(generation, RouteDirect, nextSeq) + nextSeq++ + + fallbackGeneration, err := tracker.DirectLost(generation) + if err != nil { + t.Fatal(err) + } + if tracker.InputRoute() != RouteNone { + t.Fatal("input was not frozen during fallback") + } + commit(generation, RouteDirect, nextSeq) + commit(fallbackGeneration, RouteRelay, nextSeq) + nextSeq++ + if err := tracker.RelayAttached(fallbackGeneration); err != nil { + t.Fatal(err) + } + if tracker.InputRoute() != RouteRelay { + t.Fatal("Relay did not regain sole input writer") + } + } + + for seq := uint64(1); seq < nextSeq; seq++ { + if delivered[seq] != 1 { + t.Fatalf("seq %d delivered %d times", seq, delivered[seq]) + } + } +} + +func TestRouteTrackerRejectsStaleAndInvalidTransitions(t *testing.T) { + tracker := NewRouteTracker(10) + generation, _ := tracker.BeginDirect() + if _, err := tracker.BeginDirect(); !errors.Is(err, ErrInvalidRouteTransition) { + t.Fatalf("second attempt accepted: %v", err) + } + if err := tracker.BeginDirectReplay(generation + 1); !errors.Is(err, ErrInvalidRouteTransition) { + t.Fatalf("stale generation accepted: %v", err) + } + if err := tracker.BeginDirectReplay(generation); err != nil { + t.Fatal(err) + } + if err := tracker.NoteDirectReady(generation, 9); !errors.Is(err, ErrInvalidRouteTransition) { + t.Fatalf("activation behind committed cursor accepted: %v", err) + } + if err := tracker.AbortDirect(generation); err != nil { + t.Fatal(err) + } + if tracker.AcceptOutput(generation, RouteRelay, 11) { + t.Fatal("stale generation output accepted") + } +} + +func TestRouteTrackerWaitsForDirectAfterRelayAdvancesPastReady(t *testing.T) { + tracker := NewRouteTracker(10) + generation, err := tracker.BeginDirect() + if err != nil { + t.Fatal(err) + } + if err := tracker.BeginDirectReplay(generation); err != nil { + t.Fatal(err) + } + if !tracker.AcceptOutput(generation, RouteRelay, 12) { + t.Fatal("Relay output was not committed") + } + if err := tracker.NoteDirectReady(generation, 10); err != nil { + t.Fatal(err) + } + if tracker.CanActivateDirect(generation) { + t.Fatal("direct activated before catching Relay cursor") + } + if tracker.AcceptOutput(generation, RouteDirect, 11) { + t.Fatal("duplicate direct output was committed") + } + if tracker.CanActivateDirect(generation) { + t.Fatal("direct activated one sequence behind Relay") + } + if tracker.AcceptOutput(generation, RouteDirect, 12) { + t.Fatal("duplicate direct output was committed") + } + if !tracker.CanActivateDirect(generation) { + t.Fatal("direct did not become activatable after catching Relay cursor") + } + if err := tracker.ActivateDirect(generation); err != nil { + t.Fatal(err) + } +} diff --git a/internal/peertransport/testdata/direct_crypto_v1.json b/internal/peertransport/testdata/direct_crypto_v1.json new file mode 100644 index 00000000..dd88261d --- /dev/null +++ b/internal/peertransport/testdata/direct_crypto_v1.json @@ -0,0 +1,25 @@ +{ + "account_key_hex": "4242424242424242424242424242424242424242424242424242424242424242", + "client_private_key_hex": "0000000000000000000000000000000000000000000000000000000000000001", + "host_private_key_hex": "0000000000000000000000000000000000000000000000000000000000000002", + "attempt_id": "11111111-2222-4333-8444-555555555555", + "ticket_hex": "a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5", + "session_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee", + "user_id": "user-123", + "host_id": "host-macbook", + "client_instance_id": "client-iphone", + "permission": 2, + "expires_at_unix_ms": 1800000000123, + "client_public_key_hex": "046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5", + "host_public_key_hex": "047cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997807775510db8ed040293d9ac69f7430dbba7dade63ce982299e04b79d227873d1", + "transcript_hex": "61747465726d2d6469726563742d68616e647368616b652d7631111111112222433384445555555555550020a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5aaaaaaaabbbb4ccc8dddeeeeeeeeeeee0008757365722d313233000c686f73742d6d6163626f6f6b000d636c69656e742d6970686f6e6502000001a3185c507b0041046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f50041047cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997807775510db8ed040293d9ac69f7430dbba7dade63ce982299e04b79d227873d1", + "client_proof_hex": "a217d9cec36a282134a40cc6a276535cb15319d5f94e49f2eb56d9f34d31ff1a", + "host_proof_hex": "bad0c36bf264240783aa90d652afe0523658e66c50043993858104e8771b6e40", + "finish_proof_hex": "9ebbbe17925cc13de010c36455174a8f91d1a21ffd479103fa8b62436ab60142", + "client_to_host_key_hex": "146e0375cd41cda8cc0c03ec0379e4b7c4e366336eb6053e84231534e1416b40", + "host_to_client_key_hex": "d8adaf325d73b39ded61569ac72ddb89e5964fd8613db2cf001ecc6ca06786af", + "client_nonce_prefix_hex": "467a8b8ee6f9abd824a3267a07bcc65f", + "host_nonce_prefix_hex": "57ccbed23fb3816803309d42d5b45364", + "record_plaintext_hex": "68656c6c6f20646972656374", + "record_hex": "010100000000000000000000000c7ab341f40e53b11ae8500ff61a9adc0036f36a927e4d838cb85cce72" +} diff --git a/internal/relay/direct_metrics.go b/internal/relay/direct_metrics.go new file mode 100644 index 00000000..bd2d67b4 --- /dev/null +++ b/internal/relay/direct_metrics.go @@ -0,0 +1,100 @@ +package relay + +import ( + "sync" + "sync/atomic" + + "github.com/attson/atterm/internal/userstore" +) + +type directMetrics struct { + attempts atomic.Uint64 + successes atomic.Uint64 + fallbacks atomic.Uint64 + bytesAvoided atomic.Uint64 + + mu sync.Mutex + pending map[string]*userstore.DirectTrafficDelta +} + +type directMetricsSnapshot struct { + Attempts uint64 + Successes uint64 + Fallbacks uint64 + BytesAvoided uint64 +} + +func newDirectMetrics() *directMetrics { + return &directMetrics{pending: make(map[string]*userstore.DirectTrafficDelta)} +} + +func (m *directMetrics) cellLocked(userID string) *userstore.DirectTrafficDelta { + cell := m.pending[userID] + if cell == nil { + cell = &userstore.DirectTrafficDelta{UserID: userID} + m.pending[userID] = cell + } + return cell +} + +func (m *directMetrics) recordAttempt(userID string) { + m.attempts.Add(1) + if userID == "" { + return + } + m.mu.Lock() + m.cellLocked(userID).Attempts++ + m.mu.Unlock() +} + +func (m *directMetrics) recordSuccess(userID string) { + m.successes.Add(1) + if userID == "" { + return + } + m.mu.Lock() + m.cellLocked(userID).Successes++ + m.mu.Unlock() +} + +func (m *directMetrics) recordFallback(userID string) { + m.fallbacks.Add(1) + if userID == "" { + return + } + m.mu.Lock() + m.cellLocked(userID).Fallbacks++ + m.mu.Unlock() +} + +func (m *directMetrics) recordBytes(userID string, sent, received uint64) { + m.bytesAvoided.Add(sent + received) + if userID == "" { + return + } + m.mu.Lock() + cell := m.cellLocked(userID) + cell.BytesSent += int64(sent) + cell.BytesReceived += int64(received) + m.mu.Unlock() +} + +func (m *directMetrics) drain() []userstore.DirectTrafficDelta { + m.mu.Lock() + defer m.mu.Unlock() + out := make([]userstore.DirectTrafficDelta, 0, len(m.pending)) + for _, cell := range m.pending { + out = append(out, *cell) + } + m.pending = make(map[string]*userstore.DirectTrafficDelta) + return out +} + +func (m *directMetrics) snapshot() directMetricsSnapshot { + return directMetricsSnapshot{ + Attempts: m.attempts.Load(), + Successes: m.successes.Load(), + Fallbacks: m.fallbacks.Load(), + BytesAvoided: m.bytesAvoided.Load(), + } +} diff --git a/internal/relay/direct_signal.go b/internal/relay/direct_signal.go new file mode 100644 index 00000000..8120d589 --- /dev/null +++ b/internal/relay/direct_signal.go @@ -0,0 +1,601 @@ +package relay + +import ( + "context" + "crypto/rand" + "crypto/sha256" + "encoding/base64" + "encoding/json" + "errors" + "net/http" + "strings" + "sync" + "sync/atomic" + "time" + + "github.com/attson/atterm/internal/directsignal" + "github.com/attson/atterm/internal/proto" + "github.com/google/uuid" + "nhooyr.io/websocket" +) + +const ( + directSignalVersion = directsignal.Version + directSignalReadLimit = 64 * 1024 + directSignalWriteWait = 10 * time.Second + directSignalPingPeriod = 25 * time.Second + directSignalHelloTimeout = 10 * time.Second + directSignalQueueDepth = 64 + directTicketTTL = 30 * time.Second + directTicketBytes = 32 + directMaxSessionsPerHost = 256 + directMaxAttemptsPerPeer = 8 + directMaxAttempts = 1024 + directMaxIdentifierBytes = 128 + directMaxSDPBytes = 32 * 1024 + directMaxICEBytes = 8 * 1024 + directMaxICEPerSide = 64 + directMaxStatsDelta = 64 << 20 +) + +type directSignalMessage = directsignal.Message + +type directSignalPeer struct { + ownerUserID string + role string + hostID string + clientInstanceID string + out chan directSignalMessage + cancel context.CancelFunc + activeRoutes atomic.Uint64 +} + +func (p *directSignalPeer) send(message directSignalMessage) bool { + select { + case p.out <- message: + return true + default: + p.cancel() + return false + } +} + +type directSignalAttempt struct { + id uuid.UUID + requestID string + sessionID uuid.UUID + ticketHash [sha256.Size]byte + ownerUserID string + hostID string + clientInstanceID string + permission string + expiresAt time.Time + client *directSignalPeer + host *directSignalPeer + offerSeen bool + answerSeen bool + clientICE int + hostICE int + clientICEEnd bool + hostICEEnd bool +} + +type directSignalHub struct { + mu sync.Mutex + hosts map[uuid.UUID]*directSignalPeer + attempts map[uuid.UUID]*directSignalAttempt + now func() time.Time + metrics *directMetrics +} + +func newDirectSignalHub(metrics ...*directMetrics) *directSignalHub { + stats := newDirectMetrics() + if len(metrics) > 0 && metrics[0] != nil { + stats = metrics[0] + } + return &directSignalHub{ + hosts: make(map[uuid.UUID]*directSignalPeer), + attempts: make(map[uuid.UUID]*directSignalAttempt), + now: time.Now, + metrics: stats, + } +} + +func (s *Server) handleDirectSignalHTTP(w http.ResponseWriter, r *http.Request) { + if !s.cfg.DirectSignalEnabled { + http.NotFound(w, r) + return + } + user, ok := UserFromContext(r.Context()) + if !ok || user.ID == "" { + http.Error(w, "unauthorized", http.StatusUnauthorized) + return + } + if !s.allowAuthenticatedRequest(w, r) { + return + } + key := requestLimitKey(r) + if !s.conns.acquire(key) { + http.Error(w, "too many connections", http.StatusTooManyRequests) + return + } + defer s.conns.release(key) + + conn, err := websocket.Accept(w, r, s.acceptOptionsWithAuthSubprotocol(r)) + if err != nil { + return + } + defer conn.Close(websocket.StatusInternalError, "") + conn.SetReadLimit(directSignalReadLimit) + s.handleDirectSignal(r.Context(), conn, user.ID) +} + +func (s *Server) handleDirectSignal(ctx context.Context, conn *websocket.Conn, ownerUserID string) { + connCtx, cancel := context.WithCancel(ctx) + defer cancel() + peer := &directSignalPeer{ + ownerUserID: ownerUserID, + out: make(chan directSignalMessage, directSignalQueueDepth), + cancel: cancel, + } + defer s.direct.unregister(peer) + + writerDone := make(chan struct{}) + go func() { + defer close(writerDone) + ticker := time.NewTicker(directSignalPingPeriod) + defer ticker.Stop() + for { + select { + case <-connCtx.Done(): + return + case message := <-peer.out: + writeCtx, writeCancel := context.WithTimeout(connCtx, directSignalWriteWait) + data, _ := json.Marshal(message) + err := conn.Write(writeCtx, websocket.MessageText, data) + writeCancel() + if err != nil { + cancel() + return + } + case <-ticker.C: + pingCtx, pingCancel := context.WithTimeout(connCtx, directSignalWriteWait) + err := conn.Ping(pingCtx) + pingCancel() + if err != nil { + cancel() + return + } + } + } + }() + + helloCtx, helloCancel := context.WithTimeout(connCtx, directSignalHelloTimeout) + message, err := readDirectSignal(helloCtx, conn) + helloCancel() + if err != nil || message.Kind != "hello" || message.Version != directSignalVersion { + _ = conn.Close(websocket.StatusPolicyViolation, "expected direct hello") + cancel() + <-writerDone + return + } + switch message.Role { + case "client": + if !validDirectIdentifier(message.ClientInstanceID) { + _ = conn.Close(websocket.StatusPolicyViolation, "bad client instance id") + cancel() + <-writerDone + return + } + peer.role = "client" + peer.clientInstanceID = message.ClientInstanceID + case "host": + peer.role = "host" + if err := s.registerDirectHost(peer, message.HostID, message.SessionIDs); err != nil { + _ = conn.Close(websocket.StatusPolicyViolation, err.Error()) + cancel() + <-writerDone + return + } + default: + _ = conn.Close(websocket.StatusPolicyViolation, "bad direct role") + cancel() + <-writerDone + return + } + peer.send(directSignalMessage{Version: directSignalVersion, Kind: "hello_ok"}) + + for connCtx.Err() == nil { + message, err = readDirectSignal(connCtx, conn) + if err != nil { + break + } + if message.Version != directSignalVersion { + peer.send(directSignalError(message.RequestID, "unsupported_version", "unsupported signaling version")) + continue + } + switch message.Kind { + case "host_register": + if peer.role != "host" { + peer.send(directSignalError(message.RequestID, "invalid_role", "host registration requires host role")) + continue + } + if err := s.registerDirectHost(peer, message.HostID, message.SessionIDs); err != nil { + peer.send(directSignalError(message.RequestID, "invalid_registration", err.Error())) + continue + } + peer.send(directSignalMessage{Version: directSignalVersion, Kind: "host_registered", RequestID: message.RequestID}) + case "direct_request": + if peer.role != "client" { + peer.send(directSignalError(message.RequestID, "invalid_role", "direct request requires client role")) + continue + } + if err := s.beginDirectAttempt(peer, message); err != nil { + peer.send(directSignalError(message.RequestID, directSignalErrorCode(err), err.Error())) + } + case "signal", "cancel", "consumed": + if err := s.direct.route(peer, message); err != nil { + peer.send(directSignalError(message.RequestID, directSignalErrorCode(err), err.Error())) + } + case "direct_stats": + bytesSent, bytesReceived := message.BytesSent, message.BytesReceived + if bytesSent == 0 && bytesReceived == 0 { + bytesSent = message.BytesAvoided // legacy v1 hosts only reported one aggregate + } + if peer.role != "host" || (bytesSent == 0 && bytesReceived == 0) || + bytesSent > directMaxStatsDelta || bytesReceived > directMaxStatsDelta { + peer.send(directSignalError(message.RequestID, "invalid_stats", "invalid direct byte estimate")) + continue + } + s.directStats.recordBytes(peer.ownerUserID, bytesSent, bytesReceived) + case "direct_result": + if peer.role != "client" || message.Code != "route_lost" || !consumeDirectActiveRoute(peer) { + peer.send(directSignalError(message.RequestID, "invalid_result", "invalid direct result")) + continue + } + s.directStats.recordFallback(peer.ownerUserID) + default: + peer.send(directSignalError(message.RequestID, "unknown_kind", "unknown signaling message")) + } + } + cancel() + <-writerDone +} + +func readDirectSignal(ctx context.Context, conn *websocket.Conn) (directSignalMessage, error) { + kind, data, err := conn.Read(ctx) + if err != nil { + return directSignalMessage{}, err + } + if kind != websocket.MessageText || len(data) > directSignalReadLimit { + return directSignalMessage{}, errors.New("direct signaling requires bounded text messages") + } + var message directSignalMessage + if err := json.Unmarshal(data, &message); err != nil { + return directSignalMessage{}, err + } + return message, nil +} + +func (s *Server) registerDirectHost(peer *directSignalPeer, hostID string, rawSessionIDs []string) error { + if !validDirectIdentifier(hostID) || len(rawSessionIDs) > directMaxSessionsPerHost { + return errors.New("invalid host registration") + } + if _, ok := s.sessionCreateRoutes().lookupHost(hostID, peer.ownerUserID); !ok { + return errors.New("host uplink is not active") + } + sessionIDs := make([]uuid.UUID, 0, len(rawSessionIDs)) + seen := make(map[uuid.UUID]struct{}, len(rawSessionIDs)) + for _, raw := range rawSessionIDs { + id, err := uuid.Parse(raw) + if err != nil { + return errors.New("invalid session id") + } + if _, duplicate := seen[id]; duplicate { + continue + } + sess, ok := s.registry.Get(id) + if !ok || sess.OwnerUserID != peer.ownerUserID || sess.Info().HostID != hostID { + return errors.New("session is not owned by this host") + } + seen[id] = struct{}{} + sessionIDs = append(sessionIDs, id) + } + s.direct.registerHost(peer, hostID, sessionIDs) + return nil +} + +func (s *Server) beginDirectAttempt(client *directSignalPeer, request directSignalMessage) error { + if !validDirectIdentifier(request.RequestID) { + return directSignalCodeError{"invalid_request", "invalid direct request id"} + } + sessionID, err := uuid.Parse(request.SessionID) + if err != nil { + return directSignalCodeError{"invalid_request", "invalid session id"} + } + sess, ok := s.registry.Get(sessionID) + if !ok || sess.OwnerUserID != client.ownerUserID { + return directSignalCodeError{"direct_unauthorized", "session unavailable"} + } + s.directStats.recordAttempt(client.ownerUserID) + info := sess.Info() + if _, ok := s.sessionCreateRoutes().lookupHost(info.HostID, client.ownerUserID); !ok { + s.directStats.recordFallback(client.ownerUserID) + return directSignalCodeError{"host_offline", "host uplink is not active"} + } + ticket := make([]byte, directTicketBytes) + if _, err := rand.Read(ticket); err != nil { + s.directStats.recordFallback(client.ownerUserID) + return directSignalCodeError{"internal_error", "ticket generation failed"} + } + permission := directPermissionString(parseRemotePermission(info.RemotePermission)) + if err := s.direct.begin(client, sessionID, info.HostID, permission, request.RequestID, request.SinceSeq, ticket); err != nil { + s.directStats.recordFallback(client.ownerUserID) + return err + } + return nil +} + +func (h *directSignalHub) registerHost(peer *directSignalPeer, hostID string, sessionIDs []uuid.UUID) { + h.mu.Lock() + defer h.mu.Unlock() + peer.hostID = hostID + for sessionID, existing := range h.hosts { + if existing == peer { + delete(h.hosts, sessionID) + } + } + for _, sessionID := range sessionIDs { + h.hosts[sessionID] = peer + } +} + +func (h *directSignalHub) unregister(peer *directSignalPeer) { + h.mu.Lock() + defer h.mu.Unlock() + for sessionID, existing := range h.hosts { + if existing == peer { + delete(h.hosts, sessionID) + } + } + for id, attempt := range h.attempts { + if attempt.client == peer || attempt.host == peer { + other := attempt.client + if other == peer { + other = attempt.host + } + other.send(directSignalMessage{Version: directSignalVersion, Kind: "cancel", AttemptID: id.String(), Code: "peer_disconnected"}) + delete(h.attempts, id) + h.metrics.recordFallback(attempt.ownerUserID) + } + } +} + +func (h *directSignalHub) begin(client *directSignalPeer, sessionID uuid.UUID, hostID, permission, requestID string, sinceSeq uint64, ticket []byte) error { + h.mu.Lock() + defer h.mu.Unlock() + h.reapExpiredLocked() + host := h.hosts[sessionID] + if host == nil || host.ownerUserID != client.ownerUserID || host.hostID != hostID { + return directSignalCodeError{"host_offline", "direct host is not registered"} + } + if len(h.attempts) >= directMaxAttempts || h.attemptCountLocked(client) >= directMaxAttemptsPerPeer || h.attemptCountLocked(host) >= directMaxAttemptsPerPeer { + return directSignalCodeError{"attempt_limit", "too many direct attempts"} + } + id := uuid.New() + expiresAt := h.now().Add(directTicketTTL) + attempt := &directSignalAttempt{ + id: id, + requestID: requestID, + sessionID: sessionID, + ticketHash: sha256.Sum256(ticket), + ownerUserID: client.ownerUserID, + hostID: hostID, + clientInstanceID: client.clientInstanceID, + permission: permission, + expiresAt: expiresAt, + client: client, + host: host, + } + ticketText := base64.RawURLEncoding.EncodeToString(ticket) + base := directSignalMessage{ + Version: directSignalVersion, + Kind: "direct_attempt", + RequestID: requestID, + SessionID: sessionID.String(), + SinceSeq: sinceSeq, + AttemptID: id.String(), + Ticket: ticketText, + UserID: client.ownerUserID, + HostID: hostID, + ClientInstanceID: client.clientInstanceID, + Permission: permission, + ExpiresAtUnixM: expiresAt.UnixMilli(), + } + if !host.send(base) { + return directSignalCodeError{"host_offline", "direct host signaling is unavailable"} + } + if !client.send(base) { + host.send(directSignalMessage{Version: directSignalVersion, Kind: "cancel", AttemptID: id.String(), Code: "client_disconnected"}) + return directSignalCodeError{"client_unavailable", "direct client signaling is unavailable"} + } + h.attempts[id] = attempt + return nil +} + +func (h *directSignalHub) route(sender *directSignalPeer, message directSignalMessage) error { + id, err := uuid.Parse(message.AttemptID) + if err != nil { + return directSignalCodeError{"invalid_request", "invalid attempt id"} + } + h.mu.Lock() + defer h.mu.Unlock() + h.reapExpiredLocked() + attempt := h.attempts[id] + if attempt == nil || (attempt.client != sender && attempt.host != sender) { + return directSignalCodeError{"attempt_unavailable", "direct attempt unavailable"} + } + receiver := attempt.host + isClient := sender == attempt.client + if !isClient { + receiver = attempt.client + } + switch message.Kind { + case "cancel": + code := message.Code + if code == "" { + code = "peer_cancelled" + } + if !validDirectIdentifier(code) { + return directSignalCodeError{"invalid_request", "invalid direct cancel code"} + } + receiver.send(directSignalMessage{Version: directSignalVersion, Kind: "cancel", AttemptID: id.String(), Code: code}) + delete(h.attempts, id) + h.metrics.recordFallback(attempt.ownerUserID) + return nil + case "consumed": + if isClient { + return directSignalCodeError{"invalid_role", "only host may consume a direct ticket"} + } + receiver.send(directSignalMessage{Version: directSignalVersion, Kind: "consumed", AttemptID: id.String()}) + delete(h.attempts, id) + attempt.client.activeRoutes.Add(1) + h.metrics.recordSuccess(attempt.ownerUserID) + return nil + case "signal": + if err := validateDirectSignalMessage(attempt, isClient, message); err != nil { + return err + } + routed := directSignalMessage{ + Version: directSignalVersion, + Kind: "signal", + AttemptID: id.String(), + SignalType: message.SignalType, + Payload: message.Payload, + } + if !receiver.send(routed) { + delete(h.attempts, id) + h.metrics.recordFallback(attempt.ownerUserID) + return directSignalCodeError{"peer_disconnected", "signaling peer unavailable"} + } + return nil + default: + return directSignalCodeError{"unknown_kind", "unknown attempt message"} + } +} + +func consumeDirectActiveRoute(peer *directSignalPeer) bool { + for { + active := peer.activeRoutes.Load() + if active == 0 { + return false + } + if peer.activeRoutes.CompareAndSwap(active, active-1) { + return true + } + } +} + +func validateDirectSignalMessage(attempt *directSignalAttempt, fromClient bool, message directSignalMessage) error { + switch message.SignalType { + case "offer": + if !fromClient || attempt.offerSeen || len(message.Payload) == 0 || len(message.Payload) > directMaxSDPBytes { + return directSignalCodeError{"invalid_signal", "invalid direct offer"} + } + attempt.offerSeen = true + case "answer": + if fromClient || !attempt.offerSeen || attempt.answerSeen || len(message.Payload) == 0 || len(message.Payload) > directMaxSDPBytes { + return directSignalCodeError{"invalid_signal", "invalid direct answer"} + } + attempt.answerSeen = true + case "ice_candidate": + if len(message.Payload) == 0 || len(message.Payload) > directMaxICEBytes { + return directSignalCodeError{"invalid_signal", "invalid ICE candidate"} + } + if fromClient { + attempt.clientICE++ + if attempt.clientICE > directMaxICEPerSide { + return directSignalCodeError{"signal_limit", "too many ICE candidates"} + } + } else { + attempt.hostICE++ + if attempt.hostICE > directMaxICEPerSide { + return directSignalCodeError{"signal_limit", "too many ICE candidates"} + } + } + case "ice_end": + if message.Payload != "" { + return directSignalCodeError{"invalid_signal", "ICE end payload must be empty"} + } + if fromClient { + if attempt.clientICEEnd { + return directSignalCodeError{"invalid_signal", "duplicate ICE end"} + } + attempt.clientICEEnd = true + } else { + if attempt.hostICEEnd { + return directSignalCodeError{"invalid_signal", "duplicate ICE end"} + } + attempt.hostICEEnd = true + } + default: + return directSignalCodeError{"invalid_signal", "unknown signaling payload"} + } + return nil +} + +func (h *directSignalHub) attemptCountLocked(peer *directSignalPeer) int { + count := 0 + for _, attempt := range h.attempts { + if attempt.client == peer || attempt.host == peer { + count++ + } + } + return count +} + +func (h *directSignalHub) reapExpiredLocked() { + now := h.now() + for id, attempt := range h.attempts { + if !now.Before(attempt.expiresAt) { + attempt.client.send(directSignalMessage{Version: directSignalVersion, Kind: "cancel", AttemptID: id.String(), Code: "ticket_expired"}) + attempt.host.send(directSignalMessage{Version: directSignalVersion, Kind: "cancel", AttemptID: id.String(), Code: "ticket_expired"}) + delete(h.attempts, id) + h.metrics.recordFallback(attempt.ownerUserID) + } + } +} + +func validDirectIdentifier(value string) bool { + return value != "" && len(value) <= directMaxIdentifierBytes && strings.TrimSpace(value) == value +} + +func directPermissionString(permission remotePermission) string { + switch permission { + case permFull: + return proto.RemotePermissionFull + case permControl: + return proto.RemotePermissionControl + default: + return proto.RemotePermissionView + } +} + +type directSignalCodeError struct { + code string + message string +} + +func (e directSignalCodeError) Error() string { return e.message } + +func directSignalErrorCode(err error) string { + var coded directSignalCodeError + if errors.As(err, &coded) { + return coded.code + } + return "internal_error" +} + +func directSignalError(requestID, code, message string) directSignalMessage { + return directSignalMessage{Version: directSignalVersion, Kind: "error", RequestID: requestID, Code: code, Message: message} +} diff --git a/internal/relay/direct_signal_test.go b/internal/relay/direct_signal_test.go new file mode 100644 index 00000000..b4266a7f --- /dev/null +++ b/internal/relay/direct_signal_test.go @@ -0,0 +1,388 @@ +package relay + +import ( + "context" + "crypto/sha256" + "encoding/base64" + "encoding/json" + "net/http" + "net/http/httptest" + "strings" + "testing" + "time" + + "github.com/attson/atterm/internal/proto" + "github.com/attson/atterm/internal/session" + "github.com/attson/atterm/internal/userstore" + "github.com/google/uuid" + "nhooyr.io/websocket" +) + +func newDirectSignalTestServer(t *testing.T) (*Server, string, string, uuid.UUID, string) { + t.Helper() + store := userstore.NewInMemory(t) + ctx := context.Background() + user, err := store.CreateOpaqueUser(ctx, "direct@example.com") + if err != nil { + t.Fatal(err) + } + token, _, err := store.CreateSession(ctx, user.ID, "direct-test", "127.0.0.1", userstore.DefaultSessionTTL) + if err != nil { + t.Fatal(err) + } + srv := NewServer(Config{ + Store: store, + Resolver: NewIdentityResolver(store), + DirectSignalEnabled: true, + }) + hostID := "host-direct-a" + sessionID := uuid.New() + sess := session.New(sessionID, proto.SessionInfo{ + ID: sessionID.String(), + HostID: hostID, + Command: "bash", + RemotePermission: proto.RemotePermissionControl, + }) + sess.OwnerUserID = user.ID + if _, err := srv.registry.Add(sess); err != nil { + t.Fatal(err) + } + srv.sessionCreateRoutes().registerHost(hostID, make(chan proto.Frame, 1), user.ID) + return srv, token, user.ID, sessionID, hostID +} + +func dialDirectSignal(t *testing.T, ctx context.Context, server *httptest.Server, token string) *websocket.Conn { + t.Helper() + url := "ws" + strings.TrimPrefix(server.URL, "http") + "/direct-signal" + conn, _, err := websocket.Dial(ctx, url, &websocket.DialOptions{HTTPHeader: http.Header{ + "Authorization": []string{"Bearer " + token}, + }}) + if err != nil { + t.Fatalf("dial direct signal: %v", err) + } + return conn +} + +func writeDirectSignal(t *testing.T, ctx context.Context, conn *websocket.Conn, message directSignalMessage) { + t.Helper() + data, err := json.Marshal(message) + if err != nil { + t.Fatal(err) + } + if err := conn.Write(ctx, websocket.MessageText, data); err != nil { + t.Fatalf("write direct signal: %v", err) + } +} + +func readDirectSignalTest(t *testing.T, ctx context.Context, conn *websocket.Conn) directSignalMessage { + t.Helper() + kind, data, err := conn.Read(ctx) + if err != nil { + t.Fatalf("read direct signal: %v", err) + } + if kind != websocket.MessageText { + t.Fatalf("message kind = %v", kind) + } + var message directSignalMessage + if err := json.Unmarshal(data, &message); err != nil { + t.Fatal(err) + } + return message +} + +func TestDirectSignalIssuesAndRoutesSingleUseAttempt(t *testing.T) { + srv, token, userID, sessionID, hostID := newDirectSignalTestServer(t) + httpServer := httptest.NewServer(srv) + defer httpServer.Close() + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + + host := dialDirectSignal(t, ctx, httpServer, token) + defer host.Close(websocket.StatusNormalClosure, "") + writeDirectSignal(t, ctx, host, directSignalMessage{ + Version: directSignalVersion, + Kind: "hello", + Role: "host", + HostID: hostID, + SessionIDs: []string{sessionID.String()}, + }) + if got := readDirectSignalTest(t, ctx, host); got.Kind != "hello_ok" { + t.Fatalf("host hello = %+v", got) + } + + client := dialDirectSignal(t, ctx, httpServer, token) + defer client.Close(websocket.StatusNormalClosure, "") + writeDirectSignal(t, ctx, client, directSignalMessage{ + Version: directSignalVersion, + Kind: "hello", + Role: "client", + ClientInstanceID: "client-iphone", + }) + if got := readDirectSignalTest(t, ctx, client); got.Kind != "hello_ok" { + t.Fatalf("client hello = %+v", got) + } + + writeDirectSignal(t, ctx, client, directSignalMessage{ + Version: directSignalVersion, + Kind: "direct_request", + RequestID: "request-1", + SessionID: sessionID.String(), + SinceSeq: 42, + }) + clientAttempt := readDirectSignalTest(t, ctx, client) + hostAttempt := readDirectSignalTest(t, ctx, host) + if clientAttempt.Kind != "direct_attempt" || hostAttempt.Kind != "direct_attempt" { + t.Fatalf("attempt kinds client=%q host=%q", clientAttempt.Kind, hostAttempt.Kind) + } + if clientAttempt.AttemptID == "" || clientAttempt.AttemptID != hostAttempt.AttemptID || clientAttempt.Ticket != hostAttempt.Ticket { + t.Fatalf("attempt mismatch client=%+v host=%+v", clientAttempt, hostAttempt) + } + if clientAttempt.UserID != userID || clientAttempt.SessionID != sessionID.String() || clientAttempt.HostID != hostID || + clientAttempt.ClientInstanceID != "client-iphone" || clientAttempt.Permission != proto.RemotePermissionControl || clientAttempt.SinceSeq != 42 { + t.Fatalf("attempt claims = %+v", clientAttempt) + } + ticket, err := base64.RawURLEncoding.DecodeString(clientAttempt.Ticket) + if err != nil || len(ticket) != directTicketBytes { + t.Fatalf("ticket: len=%d err=%v", len(ticket), err) + } + attemptID := uuid.MustParse(clientAttempt.AttemptID) + srv.direct.mu.Lock() + stored := srv.direct.attempts[attemptID] + ticketHash := sha256.Sum256(ticket) + if stored == nil || stored.ticketHash != ticketHash { + t.Error("Relay did not retain matching ticket hash") + } + srv.direct.mu.Unlock() + + writeDirectSignal(t, ctx, client, directSignalMessage{ + Version: directSignalVersion, + Kind: "signal", + AttemptID: clientAttempt.AttemptID, + SignalType: "offer", + Payload: "opaque-sdp-offer", + }) + if got := readDirectSignalTest(t, ctx, host); got.Kind != "signal" || got.SignalType != "offer" || got.Payload != "opaque-sdp-offer" || got.Ticket != "" { + t.Fatalf("routed offer = %+v", got) + } + + writeDirectSignal(t, ctx, host, directSignalMessage{ + Version: directSignalVersion, + Kind: "consumed", + AttemptID: clientAttempt.AttemptID, + }) + if got := readDirectSignalTest(t, ctx, client); got.Kind != "consumed" || got.AttemptID != clientAttempt.AttemptID { + t.Fatalf("consume ack = %+v", got) + } + srv.direct.mu.Lock() + _, stillPresent := srv.direct.attempts[attemptID] + srv.direct.mu.Unlock() + if stillPresent { + t.Fatal("consumed attempt remains registered") + } + metrics := srv.directStats.snapshot() + if metrics.Attempts != 1 || metrics.Successes != 1 || metrics.Fallbacks != 0 { + t.Fatalf("direct metrics after success = %+v", metrics) + } + writeDirectSignal(t, ctx, client, directSignalMessage{ + Version: directSignalVersion, + Kind: "direct_stats", + BytesSent: 1, + }) + if got := readDirectSignalTest(t, ctx, client); got.Kind != "error" || got.Code != "invalid_stats" { + t.Fatalf("client stats response = %+v", got) + } + writeDirectSignal(t, ctx, host, directSignalMessage{ + Version: directSignalVersion, + Kind: "direct_stats", + BytesSent: directMaxStatsDelta + 1, + }) + if got := readDirectSignalTest(t, ctx, host); got.Kind != "error" || got.Code != "invalid_stats" { + t.Fatalf("oversized stats response = %+v", got) + } + writeDirectSignal(t, ctx, host, directSignalMessage{ + Version: directSignalVersion, + Kind: "direct_stats", + BytesAvoided: 512 * 1024, + BytesSent: 500 * 1024, + BytesReceived: 12 * 1024, + }) + writeDirectSignal(t, ctx, client, directSignalMessage{ + Version: directSignalVersion, + Kind: "direct_result", + Code: "route_lost", + }) + deadline := time.Now().Add(time.Second) + for { + metrics = srv.directStats.snapshot() + if metrics.BytesAvoided == 512*1024 && metrics.Fallbacks == 1 { + break + } + if time.Now().After(deadline) { + t.Fatalf("direct metrics after reports = %+v", metrics) + } + time.Sleep(time.Millisecond) + } + pending := srv.directStats.drain() + if len(pending) != 1 || pending[0].UserID != userID || pending[0].Attempts != 1 || pending[0].Successes != 1 || + pending[0].Fallbacks != 1 || pending[0].BytesSent != 500*1024 || pending[0].BytesReceived != 12*1024 { + t.Fatalf("per-user direct metrics = %+v", pending) + } + + writeDirectSignal(t, ctx, host, directSignalMessage{ + Version: directSignalVersion, + Kind: "consumed", + AttemptID: clientAttempt.AttemptID, + }) + if got := readDirectSignalTest(t, ctx, host); got.Kind != "error" || got.Code != "attempt_unavailable" { + t.Fatalf("second consume = %+v", got) + } +} + +func TestDirectSignalRejectsWrongOwnerAndInactiveHost(t *testing.T) { + srv, token, userID, sessionID, hostID := newDirectSignalTestServer(t) + store := srv.cfg.Store.(*userstore.DBStore) + otherToken, _ := createUserWithSession(t, store, "other-direct@example.com") + httpServer := httptest.NewServer(srv) + defer httpServer.Close() + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + + other := dialDirectSignal(t, ctx, httpServer, otherToken) + defer other.Close(websocket.StatusNormalClosure, "") + writeDirectSignal(t, ctx, other, directSignalMessage{Version: directSignalVersion, Kind: "hello", Role: "client", ClientInstanceID: "other-client"}) + _ = readDirectSignalTest(t, ctx, other) + writeDirectSignal(t, ctx, other, directSignalMessage{Version: directSignalVersion, Kind: "direct_request", RequestID: "wrong-owner", SessionID: sessionID.String()}) + if got := readDirectSignalTest(t, ctx, other); got.Kind != "error" || got.Code != "direct_unauthorized" { + t.Fatalf("wrong owner response = %+v", got) + } + + owner := dialDirectSignal(t, ctx, httpServer, token) + defer owner.Close(websocket.StatusNormalClosure, "") + writeDirectSignal(t, ctx, owner, directSignalMessage{Version: directSignalVersion, Kind: "hello", Role: "client", ClientInstanceID: "owner-client"}) + _ = readDirectSignalTest(t, ctx, owner) + routes := srv.sessionCreateRoutes() + routes.mu.Lock() + delete(routes.hosts, hostKey{ownerUserID: userID, hostID: hostID}) + routes.mu.Unlock() + writeDirectSignal(t, ctx, owner, directSignalMessage{Version: directSignalVersion, Kind: "direct_request", RequestID: "offline", SessionID: sessionID.String()}) + if got := readDirectSignalTest(t, ctx, owner); got.Kind != "error" || got.Code != "host_offline" { + t.Fatalf("inactive host response = %+v", got) + } +} + +func TestDirectSignalDisabledByDefault(t *testing.T) { + srv, token := serverWithSession(t) + httpServer := httptest.NewServer(srv) + defer httpServer.Close() + ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) + defer cancel() + url := "ws" + strings.TrimPrefix(httpServer.URL, "http") + "/direct-signal" + conn, response, err := websocket.Dial(ctx, url, &websocket.DialOptions{HTTPHeader: http.Header{ + "Authorization": []string{"Bearer " + token}, + }}) + if conn != nil { + conn.CloseNow() + } + if err == nil || response == nil || response.StatusCode != http.StatusNotFound { + t.Fatalf("disabled dial err=%v status=%v", err, response) + } +} + +func TestDirectSignalAttemptExpiryAndSignalBounds(t *testing.T) { + now := time.Unix(1_800_000_000, 0) + hub := newDirectSignalHub() + hub.now = func() time.Time { return now } + _, cancelClient := context.WithCancel(context.Background()) + defer cancelClient() + _, cancelHost := context.WithCancel(context.Background()) + defer cancelHost() + client := &directSignalPeer{ownerUserID: "owner", role: "client", clientInstanceID: "client", out: make(chan directSignalMessage, 8), cancel: cancelClient} + host := &directSignalPeer{ownerUserID: "owner", role: "host", hostID: "host", out: make(chan directSignalMessage, 8), cancel: cancelHost} + sessionID := uuid.New() + hub.registerHost(host, "host", []uuid.UUID{sessionID}) + ticket := make([]byte, directTicketBytes) + if err := hub.begin(client, sessionID, "host", proto.RemotePermissionControl, "request", 0, ticket); err != nil { + t.Fatal(err) + } + clientAttempt := <-client.out + <-host.out + + if err := hub.route(client, directSignalMessage{ + Kind: "signal", + AttemptID: clientAttempt.AttemptID, + SignalType: "offer", + Payload: strings.Repeat("x", directMaxSDPBytes+1), + }); directSignalErrorCode(err) != "invalid_signal" { + t.Fatalf("oversize offer err=%v code=%q", err, directSignalErrorCode(err)) + } + + now = now.Add(directTicketTTL + time.Millisecond) + if err := hub.route(client, directSignalMessage{ + Kind: "signal", + AttemptID: clientAttempt.AttemptID, + SignalType: "offer", + Payload: "offer", + }); directSignalErrorCode(err) != "attempt_unavailable" { + t.Fatalf("expired attempt err=%v code=%q", err, directSignalErrorCode(err)) + } + if got := <-client.out; got.Kind != "cancel" || got.Code != "ticket_expired" { + t.Fatalf("client expiry = %+v", got) + } + if got := <-host.out; got.Kind != "cancel" || got.Code != "ticket_expired" { + t.Fatalf("host expiry = %+v", got) + } +} + +func TestDirectSignalHostReconnectKeepsNewestRegistration(t *testing.T) { + hub := newDirectSignalHub() + sessionID := uuid.New() + newPeer := func() *directSignalPeer { + _, cancel := context.WithCancel(context.Background()) + t.Cleanup(cancel) + return &directSignalPeer{ + ownerUserID: "owner", + role: "host", + out: make(chan directSignalMessage, 1), + cancel: cancel, + } + } + oldHost := newPeer() + newHost := newPeer() + + hub.registerHost(oldHost, "host", []uuid.UUID{sessionID}) + hub.registerHost(newHost, "host", []uuid.UUID{sessionID}) + hub.unregister(oldHost) + + hub.mu.Lock() + registered := hub.hosts[sessionID] + hub.mu.Unlock() + if registered != newHost { + t.Fatal("stale host disconnect removed the replacement registration") + } +} + +func TestDirectSignalRejectsOversizeCancelCode(t *testing.T) { + hub := newDirectSignalHub() + _, cancelClient := context.WithCancel(context.Background()) + defer cancelClient() + _, cancelHost := context.WithCancel(context.Background()) + defer cancelHost() + client := &directSignalPeer{ownerUserID: "owner", role: "client", clientInstanceID: "client", out: make(chan directSignalMessage, 2), cancel: cancelClient} + host := &directSignalPeer{ownerUserID: "owner", role: "host", out: make(chan directSignalMessage, 2), cancel: cancelHost} + sessionID := uuid.New() + hub.registerHost(host, "host", []uuid.UUID{sessionID}) + if err := hub.begin(client, sessionID, "host", proto.RemotePermissionControl, "request", 0, make([]byte, directTicketBytes)); err != nil { + t.Fatal(err) + } + attempt := <-client.out + <-host.out + + err := hub.route(client, directSignalMessage{ + Kind: "cancel", + AttemptID: attempt.AttemptID, + Code: strings.Repeat("x", directMaxIdentifierBytes+1), + }) + if directSignalErrorCode(err) != "invalid_request" { + t.Fatalf("oversize cancel err=%v code=%q", err, directSignalErrorCode(err)) + } +} diff --git a/internal/relay/health_http.go b/internal/relay/health_http.go index 6a9c81f1..d87332bb 100644 --- a/internal/relay/health_http.go +++ b/internal/relay/health_http.go @@ -35,6 +35,11 @@ type HealthPayload struct { ActiveSessions int `json:"active_sessions"` RelayInstances int `json:"relay_instances"` TrafficFlushIntervalSec int `json:"traffic_flush_interval_seconds"` + DirectAttempts uint64 `json:"direct_attempts"` + DirectSignalEnabled bool `json:"direct_signal_enabled"` + DirectSuccesses uint64 `json:"direct_successes"` + DirectFallbacks uint64 `json:"direct_fallbacks"` + DirectBytesAvoided uint64 `json:"direct_bytes_avoided"` MobileOriginCompatible bool `json:"mobile_origin_compatible"` GeneratedAt string `json:"generated_at"` Warnings []string `json:"health_check_warnings,omitempty"` @@ -91,6 +96,7 @@ func collectHealth(ctx context.Context, s *Server, r *http.Request) HealthPayloa } originsCopy := append([]string(nil), s.currentAllowedOrigins()...) + direct := s.directStats.snapshot() payload := HealthPayload{ Version: cfg.Version, @@ -104,6 +110,11 @@ func collectHealth(ctx context.Context, s *Server, r *http.Request) HealthPayloa ActiveSessions: len(s.registry.List()), RelayInstances: 1, TrafficFlushIntervalSec: int(trafficFlushInterval / time.Second), + DirectAttempts: direct.Attempts, + DirectSignalEnabled: cfg.DirectSignalEnabled, + DirectSuccesses: direct.Successes, + DirectFallbacks: direct.Fallbacks, + DirectBytesAvoided: direct.BytesAvoided, MobileOriginCompatible: isMobileOriginCompatible(originsCopy), GeneratedAt: time.Now().UTC().Format(time.RFC3339), } diff --git a/internal/relay/health_http_test.go b/internal/relay/health_http_test.go index e99d832a..821ad1a9 100644 --- a/internal/relay/health_http_test.go +++ b/internal/relay/health_http_test.go @@ -352,6 +352,11 @@ func TestHealthPayload_JSONFieldsStable(t *testing.T) { "active_sessions", "relay_instances", "traffic_flush_interval_seconds", + "direct_attempts", + "direct_signal_enabled", + "direct_successes", + "direct_fallbacks", + "direct_bytes_avoided", "mobile_origin_compatible", "generated_at", } diff --git a/internal/relay/me_traffic.go b/internal/relay/me_traffic.go new file mode 100644 index 00000000..bc8e2301 --- /dev/null +++ b/internal/relay/me_traffic.go @@ -0,0 +1,140 @@ +package relay + +import ( + "net/http" + "sort" + "time" + + "github.com/attson/atterm/internal/proto" +) + +const meTrafficMaxDays = 180 + +type meRelayTrafficDay struct { + Day string `json:"day"` + BytesIn int64 `json:"bytes_in"` + BytesOut int64 `json:"bytes_out"` + FramesIn int64 `json:"frames_in"` + FramesOut int64 `json:"frames_out"` +} + +type meDirectTrafficDay struct { + Day string `json:"day"` + Attempts int64 `json:"attempts"` + Successes int64 `json:"successes"` + Fallbacks int64 `json:"fallbacks"` + BytesSent int64 `json:"bytes_sent"` + BytesReceived int64 `json:"bytes_received"` +} + +type meRelayTrafficDetail struct { + Day string `json:"day"` + FrameType int `json:"frame_type"` + FrameTypeName string `json:"frame_type_name"` + Category string `json:"category"` + Direction int `json:"direction"` + Bytes int64 `json:"bytes"` + Frames int64 `json:"frames"` +} + +type meTrafficResponse struct { + From string `json:"from"` + To string `json:"to"` + Relay []meRelayTrafficDay `json:"relay"` + RelayDetail []meRelayTrafficDetail `json:"relay_detail"` + Direct []meDirectTrafficDay `json:"direct"` +} + +// handleMeTrafficHTTP returns the authenticated account's own daily usage. +// The user ID comes exclusively from requireSession and is intentionally +// absent from the response, so the endpoint cannot become a cross-account +// lookup surface. +func (s *Server) handleMeTrafficHTTP(w http.ResponseWriter, r *http.Request) { + user, ok := UserFromContext(r.Context()) + if !ok || user.ID == "" { + http.Error(w, "unauthorized", http.StatusUnauthorized) + return + } + + today := time.Now().UTC() + to := r.URL.Query().Get("to") + from := r.URL.Query().Get("from") + if to == "" { + to = today.Format("2006-01-02") + } + if from == "" { + from = today.AddDate(0, 0, -6).Format("2006-01-02") + } + fromTime, fromErr := time.Parse("2006-01-02", from) + toTime, toErr := time.Parse("2006-01-02", to) + if fromErr != nil || toErr != nil { + http.Error(w, "invalid date, use YYYY-MM-DD", http.StatusBadRequest) + return + } + if fromTime.After(toTime) || int(toTime.Sub(fromTime).Hours()/24)+1 > meTrafficMaxDays { + http.Error(w, "invalid date range", http.StatusBadRequest) + return + } + + // Personal usage is an explicit refresh surface. Persist the current + // in-memory window so active low-volume sessions are visible immediately. + s.flushTraffic(s.cfg.Store) + + relayRows, err := s.cfg.Store.QueryTrafficForUser(r.Context(), user.ID, from, to) + if err != nil { + http.Error(w, "internal error", http.StatusInternalServerError) + return + } + directRows, err := s.cfg.Store.QueryDirectTraffic(r.Context(), user.ID, from, to) + if err != nil { + http.Error(w, "internal error", http.StatusInternalServerError) + return + } + + relayByDay := make(map[string]*meRelayTrafficDay) + relayDetail := make([]meRelayTrafficDetail, 0, len(relayRows)) + for _, row := range relayRows { + relayDetail = append(relayDetail, meRelayTrafficDetail{ + Day: row.Day, + FrameType: row.FrameType, + FrameTypeName: frameTypeName(proto.Type(row.FrameType)), + Category: frameCategory(proto.Type(row.FrameType)), + Direction: row.Direction, + Bytes: row.Bytes, + Frames: row.Frames, + }) + cell := relayByDay[row.Day] + if cell == nil { + cell = &meRelayTrafficDay{Day: row.Day} + relayByDay[row.Day] = cell + } + if row.Direction == trafficIn { + cell.BytesIn += row.Bytes + cell.FramesIn += row.Frames + } else if row.Direction == trafficOut { + cell.BytesOut += row.Bytes + cell.FramesOut += row.Frames + } + } + relayDays := make([]meRelayTrafficDay, 0, len(relayByDay)) + for _, row := range relayByDay { + relayDays = append(relayDays, *row) + } + sort.Slice(relayDays, func(i, j int) bool { return relayDays[i].Day < relayDays[j].Day }) + + directDays := make([]meDirectTrafficDay, 0, len(directRows)) + for _, row := range directRows { + directDays = append(directDays, meDirectTrafficDay{ + Day: row.Day, + Attempts: row.Attempts, + Successes: row.Successes, + Fallbacks: row.Fallbacks, + BytesSent: row.BytesSent, + BytesReceived: row.BytesReceived, + }) + } + + writeJSONStatus(w, http.StatusOK, meTrafficResponse{ + From: from, To: to, Relay: relayDays, RelayDetail: relayDetail, Direct: directDays, + }) +} diff --git a/internal/relay/me_traffic_test.go b/internal/relay/me_traffic_test.go new file mode 100644 index 00000000..3e3b1b78 --- /dev/null +++ b/internal/relay/me_traffic_test.go @@ -0,0 +1,96 @@ +package relay + +import ( + "context" + "encoding/json" + "net/http" + "strings" + "testing" + "time" + + "github.com/attson/atterm/internal/proto" + "github.com/attson/atterm/internal/userstore" +) + +func TestMeTraffic_OnlyReturnsAuthenticatedUser(t *testing.T) { + srv, store, userID, token := newAdminTestServer(t) + day := time.Now().UTC().Format("2006-01-02") + other, err := store.CreateOpaqueUser(context.Background(), "other@example.com") + if err != nil { + t.Fatal(err) + } + if err := store.AddTrafficDeltas(context.Background(), day, []userstore.TrafficDelta{ + {UserID: userID, FrameType: int(proto.TypeOut), Direction: trafficOut, Bytes: 1200, Frames: 3}, + {UserID: userID, FrameType: int(proto.TypeIn), Direction: trafficIn, Bytes: 300, Frames: 2}, + {UserID: other.ID, FrameType: int(proto.TypeOut), Direction: trafficOut, Bytes: 9999, Frames: 9}, + }); err != nil { + t.Fatal(err) + } + if err := store.AddDirectTrafficDeltas(context.Background(), day, []userstore.DirectTrafficDelta{ + {UserID: userID, Attempts: 4, Successes: 3, Fallbacks: 1, BytesSent: 800, BytesReceived: 200}, + {UserID: other.ID, Attempts: 9, Successes: 9, BytesSent: 9999}, + }); err != nil { + t.Fatal(err) + } + + rec := adminGetBearer(srv, "/api/me/traffic?from="+day+"&to="+day, token) + if rec.Code != http.StatusOK { + t.Fatalf("status = %d; body=%s", rec.Code, rec.Body.String()) + } + var got meTrafficResponse + if err := json.Unmarshal(rec.Body.Bytes(), &got); err != nil { + t.Fatal(err) + } + if len(got.Relay) != 1 || got.Relay[0].BytesOut != 1200 || got.Relay[0].BytesIn != 300 { + t.Fatalf("relay = %#v", got.Relay) + } + if len(got.RelayDetail) != 2 || got.RelayDetail[0].FrameTypeName == "" || got.RelayDetail[0].Category == "" { + t.Fatalf("relay detail = %#v", got.RelayDetail) + } + if len(got.Direct) != 1 || got.Direct[0].BytesSent != 800 || got.Direct[0].BytesReceived != 200 || got.Direct[0].Successes != 3 { + t.Fatalf("direct = %#v", got.Direct) + } + if strings.Contains(rec.Body.String(), other.ID) || strings.Contains(rec.Body.String(), "other@example.com") || strings.Contains(rec.Body.String(), userID) { + t.Fatalf("personal response leaked identity fields: %s", rec.Body.String()) + } +} + +func TestMeTraffic_RequiresAuthenticationAndValidRange(t *testing.T) { + srv, _, _, token := newAdminTestServer(t) + if rec := adminGetBearer(srv, "/api/me/traffic", ""); rec.Code != http.StatusUnauthorized { + t.Fatalf("unauthenticated status = %d, want 401", rec.Code) + } + for _, path := range []string{ + "/api/me/traffic?from=bad", + "/api/me/traffic?from=2026-09-23&to=2026-09-22", + "/api/me/traffic?from=2026-01-01&to=2026-09-23", + } { + if rec := adminGetBearer(srv, path, token); rec.Code != http.StatusBadRequest { + t.Errorf("%s status = %d, want 400", path, rec.Code) + } + } +} + +func TestMeTraffic_FlushesPendingMetricsBeforeQuery(t *testing.T) { + srv, _, userID, token := newAdminTestServer(t) + day := time.Now().UTC().Format("2006-01-02") + srv.recordTraffic(userID, proto.TypeOut, trafficOut, 73) + srv.directStats.recordAttempt(userID) + srv.directStats.recordSuccess(userID) + srv.directStats.recordBytes(userID, 123, 45) + + rec := adminGetBearer(srv, "/api/me/traffic?from="+day+"&to="+day, token) + if rec.Code != http.StatusOK { + t.Fatalf("status = %d; body=%s", rec.Code, rec.Body.String()) + } + var got meTrafficResponse + if err := json.Unmarshal(rec.Body.Bytes(), &got); err != nil { + t.Fatal(err) + } + if len(got.Relay) != 1 || got.Relay[0].BytesOut != 73 { + t.Fatalf("relay = %#v", got.Relay) + } + if len(got.Direct) != 1 || got.Direct[0].Attempts != 1 || got.Direct[0].Successes != 1 || got.Direct[0].BytesSent != 123 || got.Direct[0].BytesReceived != 45 { + t.Fatalf("direct = %#v", got.Direct) + } +} diff --git a/internal/relay/server.go b/internal/relay/server.go index 46d7ad76..e5486d80 100644 --- a/internal/relay/server.go +++ b/internal/relay/server.go @@ -8,8 +8,8 @@ import ( "encoding/json" "io/fs" "net/http" - "nhooyr.io/websocket" "strings" + "sync" "sync/atomic" "time" @@ -20,6 +20,7 @@ import ( "github.com/attson/atterm/internal/userstore" "github.com/attson/atterm/internal/webpush" "github.com/google/uuid" + "nhooyr.io/websocket" ) // Config configures a Server. @@ -84,6 +85,10 @@ type Config struct { // instance_id in the relay_instances registry). Empty disables node // registration / selection (single-instance/dev). InstancePublicURL string + // DirectSignalEnabled mounts the v0.6 beta WebRTC signaling surface. It + // defaults off so upgrading a Relay cannot change terminal routing until an + // operator explicitly joins the beta. + DirectSignalEnabled bool } // Server bundles the registry and HTTP handlers. @@ -95,6 +100,8 @@ type Server struct { rate *fixedWindowLimiter conns *connectionLimiter services *serviceHub + direct *directSignalHub + directStats *directMetrics startTime time.Time uplinkCount int64 // atomic; read via UplinkCount() // feishu holds the runtime Feishu handler; nil = integration disabled. @@ -113,9 +120,10 @@ type Server struct { // traffic accumulates per-user byte/frame counts on the send/receive // paths; flushStop signals the flush goroutine to drain and exit, and // flushDone is closed once it has. - traffic *trafficMeter - flushStop chan struct{} - flushDone chan struct{} + traffic *trafficMeter + trafficFlushMu sync.Mutex + flushStop chan struct{} + flushDone chan struct{} } // NewServer builds a Server with its routes installed. @@ -128,6 +136,7 @@ func NewServer(cfg Config) *Server { if connLimit == 0 { connLimit = defaultMaxConnections } + directStats := newDirectMetrics() s := &Server{ cfg: cfg, registry: session.NewRegistry(), @@ -136,6 +145,8 @@ func NewServer(cfg Config) *Server { rate: newFixedWindowLimiter(rateLimit, time.Minute), conns: newConnectionLimiter(connLimit), services: newServiceHub(), + direct: newDirectSignalHub(directStats), + directStats: directStats, startTime: time.Now(), } originsInit := append([]string(nil), cfg.AllowedOrigins...) @@ -155,6 +166,7 @@ func NewServer(cfg Config) *Server { s.mux.HandleFunc("/client-sessions", s.requireSession(s.handleClientSessionsHTTP)) s.mux.HandleFunc("/service-client", s.requireSession(s.handleServiceClientHTTP)) s.mux.HandleFunc("/service-host", s.requireSession(s.handleServiceHostHTTP)) + s.mux.HandleFunc("/direct-signal", s.requireSession(s.handleDirectSignalHTTP)) s.mux.HandleFunc("/api/sessions", s.requireSession(s.handleSessionsHTTP)) // Public — anonymous traffic allowed. s.mux.HandleFunc("/api/version", s.handleVersionHTTP) @@ -212,6 +224,7 @@ func NewServer(cfg Config) *Server { s.mux.HandleFunc("POST /api/sessions/seen", s.requireSession(s.handleSessionsSeenHTTP)) s.mux.HandleFunc("GET /api/nodes", s.requireSession(s.handleNodesHTTP)) s.mux.HandleFunc("PUT /api/me/home", s.requireSession(s.handleSetHomeHTTP)) + s.mux.HandleFunc("GET /api/me/traffic", s.requireSession(s.handleMeTrafficHTTP)) // OPAQUE auth: wire only when both the singleton was built // upstream and the store is the concrete SQLite one the handler diff --git a/internal/relay/templates/health.gohtml b/internal/relay/templates/health.gohtml index fe808b48..fb2e177a 100644 --- a/internal/relay/templates/health.gohtml +++ b/internal/relay/templates/health.gohtml @@ -32,6 +32,11 @@
Rate limit / min
{{ .RateLimitPerMinute }}
Max conn / key
{{ .MaxConnectionsPerKey }}
Active uplinks
{{ .ActiveUplinks }}
+
Direct attempts
{{ .DirectAttempts }}
+
Direct signaling
{{ if .DirectSignalEnabled }}enabled{{ else }}disabled{{ end }}
+
Direct successes
{{ .DirectSuccesses }}
+
Direct fallbacks
{{ .DirectFallbacks }}
+
Direct bytes avoided
{{ .DirectBytesAvoided }}
Mobile compat
{{ if .MobileOriginCompatible }}yes{{ else }}no (add a capacitor:// origin){{ end }}
@@ -61,6 +66,11 @@ pad('Rate limit / min:') + h.rate_limit_per_minute, pad('Max conn / key:') + h.max_connections_per_key, pad('Active uplinks:') + h.active_uplinks, + pad('Direct attempts:') + h.direct_attempts, + pad('Direct signaling:') + (h.direct_signal_enabled ? 'enabled' : 'disabled'), + pad('Direct successes:') + h.direct_successes, + pad('Direct fallbacks:') + h.direct_fallbacks, + pad('Direct bytes avoided:') + h.direct_bytes_avoided, pad('Mobile compat:') + (h.mobile_origin_compatible ? 'yes' : 'no') ]; return lines.join('\n'); diff --git a/internal/relay/traffic_meter.go b/internal/relay/traffic_meter.go index 1d2d3263..15c9f8cd 100644 --- a/internal/relay/traffic_meter.go +++ b/internal/relay/traffic_meter.go @@ -115,8 +115,12 @@ func (s *Server) trafficFlushLoop(store userstore.Store) { // day's rollup. A failed persist logs a warning and drops the window's data // (accepted trade-off; the snapshot has already reset the meter). func (s *Server) flushTraffic(store userstore.Store) { + s.trafficFlushMu.Lock() + defer s.trafficFlushMu.Unlock() + deltas := s.traffic.snapshot() - if len(deltas) == 0 { + directDeltas := s.directStats.drain() + if len(deltas) == 0 && len(directDeltas) == 0 { return } day := time.Now().UTC().Format("2006-01-02") @@ -132,8 +136,15 @@ func (s *Server) flushTraffic(store userstore.Store) { } ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() - if err := store.AddTrafficDeltas(ctx, day, conv); err != nil { - logging.Warn("relay-traffic", "flush failed, dropping %d deltas: %v", len(conv), err) + if len(conv) > 0 { + if err := store.AddTrafficDeltas(ctx, day, conv); err != nil { + logging.Warn("relay-traffic", "flush failed, dropping %d deltas: %v", len(conv), err) + } + } + if len(directDeltas) > 0 { + if err := store.AddDirectTrafficDeltas(ctx, day, directDeltas); err != nil { + logging.Warn("relay-traffic", "direct flush failed, dropping %d deltas: %v", len(directDeltas), err) + } } } diff --git a/internal/relay/traffic_meter_test.go b/internal/relay/traffic_meter_test.go index a9804c97..fc615562 100644 --- a/internal/relay/traffic_meter_test.go +++ b/internal/relay/traffic_meter_test.go @@ -81,6 +81,9 @@ func TestServerFlushTrafficPersists(t *testing.T) { defer srv.Close() srv.recordTraffic("u1", proto.TypeOut, trafficOut, 120) + srv.directStats.recordAttempt("u1") + srv.directStats.recordSuccess("u1") + srv.directStats.recordBytes("u1", 400, 25) srv.flushTraffic(store) // force a flush without waiting for the ticker day := time.Now().UTC().Format("2006-01-02") @@ -97,4 +100,11 @@ func TestServerFlushTrafficPersists(t *testing.T) { if total != 120 { t.Errorf("persisted bytes = %d, want 120", total) } + direct, err := store.QueryDirectTraffic(context.Background(), "u1", day, day) + if err != nil { + t.Fatalf("QueryDirectTraffic: %v", err) + } + if len(direct) != 1 || direct[0].Attempts != 1 || direct[0].Successes != 1 || direct[0].BytesSent != 400 || direct[0].BytesReceived != 25 { + t.Errorf("persisted direct traffic = %+v", direct) + } } diff --git a/internal/relay/web-dist/assets/FileExplorer-BumK3wPT.js b/internal/relay/web-dist/assets/FileExplorer-BmPzqkbb.js similarity index 99% rename from internal/relay/web-dist/assets/FileExplorer-BumK3wPT.js rename to internal/relay/web-dist/assets/FileExplorer-BmPzqkbb.js index 7dfbf886..73756993 100644 --- a/internal/relay/web-dist/assets/FileExplorer-BumK3wPT.js +++ b/internal/relay/web-dist/assets/FileExplorer-BmPzqkbb.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BKS_vG9j.js","assets/index-DRFRE0Ca.js","assets/index-DblmzGAc.js","assets/useI18n-lwZlSdSx.js","assets/index-Ci2MtInW.js","assets/prefsSync-C5tz9Q-s.js","assets/client-DMh7GjbV.js","assets/Switch-DguIL3dU.js","assets/auth-B3RxKR1W.js","assets/index-DfP-AjMF.css","assets/index-B5lmJj73.js","assets/index-DTgf7QAl.js","assets/index-DZaDIMfZ.js","assets/index-gs2Ov3d4.js","assets/index-BKUnbiGw.js","assets/index-Di5PmtZ2.js","assets/index-CidLZrB5.js","assets/index-Dy-6tZbQ.js","assets/index-DB-c3u2H.js","assets/index-DR4XN96w.js","assets/index-CHTSx7s6.js","assets/index-KcexLGIr.js","assets/index-CVE6o20G.js","assets/index-cGfdCuRo.js","assets/index-C5ykaaYB.js"])))=>i.map(i=>d[i]); -import{ap as Qe,bH as j,bt as En,bj as us,bw as O,ad as V,bl as mn,aa as J,ab as ke,bP as hn,ca as q,cy as ds,cr as Oa,v as rt,a7 as me,bO as Pf,bk as Gi,ac as Ie,c3 as Q,ak as vi,F as Xt,bJ as mi,br as qt,cA as Bi,cv as ft,ai as ps,_ as le,cs as If,bY as Nf,cq as _f}from"./useI18n-lwZlSdSx.js";import{c as Pt,C as Ff,a as it,e as Se,o as Ji,f as Wf,X as Hf,p as La,b as Vf,k as $f,m as zf,h as qf,s as Uf,n as Kf,j as jf,d as Gf,g as Jf,t as _s,q as Yf,u as Xf,i as Qf,U as Zf,r as eu,l as tu}from"./index-Ci2MtInW.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Ck_fIti9.js","assets/index-Bf0-KgBD.js","assets/index-DDP-KCe3.js","assets/useI18n-D4u8zssu.js","assets/index-zrZBIArQ.js","assets/prefsSync-Dj3wNxrO.js","assets/client-n-fLEpOg.js","assets/Switch-BlSJOKEO.js","assets/auth-BBmiA1GG.js","assets/index-CR9U8Dqy.css","assets/index-C1t4FMl1.js","assets/index-B6JsQQbt.js","assets/index-DlIw5VzR.js","assets/index-8SnOqa2v.js","assets/index-ChT88caY.js","assets/index-CehbsLvs.js","assets/index-_4Qee-Ew.js","assets/index-DoVrcQoW.js","assets/index-CKUfNIJP.js","assets/index-DPMPlQhe.js","assets/index-C7tiEnPN.js","assets/index-BSbI304G.js","assets/index-DmukWKLV.js","assets/index-BBTANB6i.js","assets/index-HGllhEs0.js"])))=>i.map(i=>d[i]); +import{ap as Qe,bH as j,bt as En,bj as us,bw as O,ad as V,bl as mn,aa as J,ab as ke,bP as hn,ca as q,cy as ds,cr as Oa,v as rt,a7 as me,bO as Pf,bk as Gi,ac as Ie,c3 as Q,ak as vi,F as Xt,bJ as mi,br as qt,cA as Bi,cv as ft,ai as ps,_ as le,cs as If,bY as Nf,cq as _f}from"./useI18n-D4u8zssu.js";import{c as Pt,C as Ff,a as it,e as Se,o as Ji,f as Wf,X as Hf,p as La,b as Vf,k as $f,m as zf,h as qf,s as Uf,n as Kf,j as jf,d as Gf,g as Jf,t as _s,q as Yf,u as Xf,i as Qf,U as Zf,r as eu,l as tu}from"./index-zrZBIArQ.js";/** * @license lucide-vue-next v1.0.0 - ISC * * This source code is licensed under the ISC license. @@ -61,4 +61,4 @@ import{ap as Qe,bH as j,bt as En,bj as us,bw as O,ad as V,bl as mn,aa as J,ab as `))};if((_.mac||_.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:a,insert:ne.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let u=this.to-this.from+(f.to-f.from+f.insert.length);Mo(e,f,S.single(this.toEditorPos(i.selectionStart,u),this.toEditorPos(i.selectionEnd,u)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let n=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o{let n=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(r.rangeStart),h=this.toEditorPos(r.rangeEnd);if(a{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let n=xn(i.root);n&&n.rangeCount&&this.editContext.updateSelectionBounds(n.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,n=this.pendingContextChange;return e.changes.iterChanges((r,o,l,a,h)=>{if(i)return;let c=h.length-(o-r);if(n&&o>=n.to)if(n.from==r&&n.to==o&&n.insert.eq(h)){n=this.pendingContextChange=null,t+=c,this.to+=c;return}else n=null,this.revertPending(e.state);if(r+=t,o+=t,o<=this.from)this.from+=c,this.to+=c;else if(rthis.to||this.to-this.from+h.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),h.toString()),this.to+=c}t+=c}),n&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(n=>!n.isUserEvent("input.type")&&n.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),n=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=n)&&this.editContext.updateSelection(i,n)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class H{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(n=>n.forEach(r=>i(r,this)))||(n=>this.update(n)),this.dispatch=this.dispatch.bind(this),this._root=e.root||zd(e.parent)||document,this.viewState=new Bl(this,e.state||se.create(e)),e.scrollTo&&e.scrollTo.is(zn)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ri).map(n=>new nr(n));for(let n of this.plugins)n.update(this);this.observer=new pg(this),this.inputState=new _p(this),this.inputState.ensureHandlers(this.plugins),this.docView=new bl(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof Ae?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,n,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(Vh))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=$h(r,o),a||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(se.phrases)!=this.state.facet(se.phrases))return this.setState(r);n=ws.create(this,r,e),n.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection,{x:p,y:g}=this.state.facet(H.cursorScrollMargin);f=new Fi(d.empty?d:S.cursor(d.head,d.head>d.anchor?-1:1),"nearest","nearest",g,p)}for(let d of u.effects)d.is(zn)&&(f=d.value.clip(this.state))}this.viewState.update(n,f),this.bidiCache=As.update(this.bidiCache,n.changes),n.empty||(this.updatePlugins(n),this.inputState.update(n)),t=this.docView.update(n),this.state.facet(ln)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(n.startState.facet(Jn)!=n.state.facet(Jn)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!n.empty)for(let u of this.state.facet(Ur))try{u(n)}catch(d){Ot(this.state,d,"update listener")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!Ph(this,c)&&h.force&&_i(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Bl(this,e),this.plugins=e.facet(Ri).map(i=>new nr(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new bl(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Ri),i=e.state.facet(Ri);if(t!=i){let n=[];for(let r of i){let o=t.indexOf(r);if(o<0)n.push(new nr(r));else{let l=this.plugins[o];l.mustUpdate=e,n.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let n of this.plugins)n.mustUpdate=e;for(let n=0;n-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.viewState.scrollParent,n=this.viewState.getScrollOffset(),{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(n-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(ah(i||this.win))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(n);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure();if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return Ot(this.state,p),_l}}),f=ws.create(this,this.state,[]),u=!1;f.flags|=a,t?t.flags|=a:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f),u&&this.docViewUpdate());for(let d=0;d1||p<-1)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){n=n+p,i?i.scrollTop+=p:this.win.scrollBy(0,p),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(Ur))l(t)}get themeClasses(){return Yr+" "+(this.state.facet(Jr)?Kh:Uh)+" "+this.state.facet(Jn)}updateAttrs(){let e=Fl(this,Ah,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ft)?"true":"false",class:"cm-content",style:`${_.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Fl(this,Co,t);let i=this.observer.ignore(()=>{let n=dl(this.contentDOM,this.contentAttrs,t),r=dl(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let n of i.effects)if(n.is(H.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=n.value}}mountStyles(){this.styleModules=this.state.facet(ln);let e=this.state.facet(H.cspNonce);ii.mount(this.root,this.styleModules.concat(ug).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;ti.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return lr(this,e,wl(this,e,t,i))}moveByGroup(e,t){return lr(this,e,wl(this,e,t,i=>Tp(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),n=this.textDirectionAt(e.from),r=i[t?i.length-1:0];return S.cursor(r.side(t,n)+e.from,r.forward(!t,n)?1:-1)}moveToLineBoundary(e,t,i=!0){return Mp(this,e,t,i)}moveVertically(e,t,i){return lr(this,e,Dp(this,e,t,i))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let i=jr(this,e,t);return i&&i.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),jr(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let n=this.state.doc.lineAt(e),r=this.bidiSpans(n),o=r[Et.find(r,e-n.from,-1,t)];return bs(i,o.dir==pe.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(kh)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>yg)return ph(e.length);let t=this.textDirectionAt(e.from),i;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||dh(r.isolates,i=ml(this,e))))return r.order;i||(i=ml(this,e));let n=Xd(e.text,t,i);return this.bidiCache.push(new As(e.from,e.to,t,i,!0,n)),n}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||_.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{lh(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){var i,n,r,o;return zn.of(new Fi(typeof e=="number"?S.cursor(e):e,(i=t.y)!==null&&i!==void 0?i:"nearest",(n=t.x)!==null&&n!==void 0?n:"nearest",(r=t.yMargin)!==null&&r!==void 0?r:5,(o=t.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return zn.of(new Fi(S.cursor(i.from),"start","start",i.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return st.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return st.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=ii.newName(),n=[Jn.of(i),ln.of(Xr(`.${i}`,e))];return t&&t.dark&&n.push(Jr.of(!0)),n}static baseTheme(e){return On.lowest(ln.of(Xr("."+Yr,e,jh)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),n=i&&ye.get(i)||ye.get(e);return((t=n==null?void 0:n.root)===null||t===void 0?void 0:t.view)||null}}H.styleModule=ln;H.inputHandler=wh;H.clipboardInputFilter=ko;H.clipboardOutputFilter=So;H.scrollHandler=Sh;H.focusChangeEffect=xh;H.perLineTextDirection=kh;H.exceptionSink=bh;H.updateListener=Ur;H.editable=Ft;H.mouseSelectionStyle=vh;H.dragMovesSelection=yh;H.clickAddsSelectionRange=mh;H.decorations=Vs;H.blockWrappers=Mh;H.outerDecorations=Ao;H.atomicRanges=Pn;H.bidiIsolatedRanges=Th;H.cursorScrollMargin=F.define({combine:s=>{let e=5,t=5;for(let i of s)typeof i=="number"?e=t=i:{x:e,y:t}=i;return{x:e,y:t}}});H.scrollMargins=Dh;H.darkTheme=Jr;H.cspNonce=F.define({combine:s=>s.length?s[0]:""});H.contentAttributes=Co;H.editorAttributes=Ah;H.lineWrapping=H.contentAttributes.of({class:"cm-lineWrapping"});H.announce=oe.define();const yg=4096,_l={};class As{constructor(e,t,i,n,r,o){this.from=e,this.to=t,this.dir=i,this.isolates=n,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let i=[],n=e.length?e[e.length-1].dir:pe.LTR;for(let r=Math.max(0,e.length-10);r=0;n--){let r=i[n],o=typeof r=="function"?r(s):r;o&&bo(o,t)}return t}const vg=_.mac?"mac":_.windows?"win":_.linux?"linux":"key";function bg(s,e){const t=s.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let n,r,o,l;for(let a=0;ai.concat(n),[]))),t}function xg(s,e,t){return Jh(Gh(s.state),e,s,t)}let Yt=null;const kg=4e3;function Sg(s,e=vg){let t=Object.create(null),i=Object.create(null),n=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,h,c)=>{var f,u;let d=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(b=>bg(b,e));for(let b=1;b{let D=Yt={view:T,prefix:x,scope:o};return setTimeout(()=>{Yt==D&&(Yt=null)},kg),!0}]})}let g=p.join(" ");n(g,!1);let y=d[g]||(d[g]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&y.run.push(a),h&&(y.preventDefault=!0),c&&(y.stopPropagation=!0)};for(let o of s){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of l){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let u in c)c[u].run.push(d=>f(d,Zr))}let a=o[e]||o.key;if(a)for(let h of l)r(h,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(h,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}let Zr=null;function Jh(s,e,t,i){Zr=e;let n=Id(e),r=Va(n,0),o=$a(r)==n.length&&n!=" ",l="",a=!1,h=!1,c=!1;Yt&&Yt.view==t&&Yt.scope==i&&(l=Yt.prefix+" ",_h.indexOf(e.keyCode)<0&&(h=!0,Yt=null));let f=new Set,u=y=>{if(y){for(let b of y.run)if(!f.has(b)&&(f.add(b),b(t)))return y.stopPropagation&&(c=!0),!0;y.preventDefault&&(y.stopPropagation&&(c=!0),h=!0)}return!1},d=s[i],p,g;return d&&(u(d[l+Yn(n,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(_.windows&&e.ctrlKey&&e.altKey)&&!(_.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=ni[e.keyCode])&&p!=n?(u(d[l+Yn(p,e,!0)])||e.shiftKey&&(g=bn[e.keyCode])!=n&&g!=p&&u(d[l+Yn(g,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(d[l+Yn(n,e,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&e.stopPropagation(),Zr=null,a}const Hl=F.define({combine(s){let e,t;for(let i of s)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Yh(s,e){let t=s.plugin(Xh),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const Xh=st.fromClass(class{constructor(s){this.input=s.state.facet(Ms),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(s));let e=s.state.facet(Hl);this.top=new Xn(s,!0,e.topContainer),this.bottom=new Xn(s,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(s){let e=s.state.facet(Hl);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Xn(s.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Xn(s.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=s.state.facet(Ms);if(t!=this.input){let i=t.filter(a=>a),n=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),c;h<0?(c=a(s.view),l.push(c)):(c=this.panels[h],c.update&&c.update(s)),n.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=n,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(s)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:s=>H.scrollMargins.of(e=>{let t=e.plugin(s);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Xn{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Vl(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Vl(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Vl(s){let e=s.nextSibling;return s.remove(),e}const Ms=F.define({enables:Xh});function Cg(s,e){let t,i=new Promise(o=>t=o),n=o=>Ag(o,e,t);s.state.field(cr,!1)?s.dispatch({effects:Qh.of(n)}):s.dispatch({effects:oe.appendConfig.of(cr.init(()=>[n]))});let r=Zh.of(n);return{close:r,result:i.then(o=>((s.win.queueMicrotask||(a=>s.win.setTimeout(a,10)))(()=>{s.state.field(cr).indexOf(n)>-1&&s.dispatch({effects:r})}),o))}}const cr=vt.define({create(){return[]},update(s,e){for(let t of e.effects)t.is(Qh)?s=[t.value].concat(s):t.is(Zh)&&(s=s.filter(i=>i!=t.value));return s},provide:s=>Ms.computeN([s],e=>e.field(s))}),Qh=oe.define(),Zh=oe.define();function Ag(s,e,t){let i=e.content?e.content(s,()=>o(null)):null;if(!i){if(i=Ee("form"),e.input){let l=Ee("input",e.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(Ee("label",(e.label||"")+": ",l))}else i.appendChild(document.createTextNode(e.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(Ee("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let n=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let l=0;l{h.keyCode==27?(h.preventDefault(),o(null)):h.keyCode==13&&(h.preventDefault(),o(a))}),a.addEventListener("submit",h=>{h.preventDefault(),o(a)})}let r=Ee("div",i,Ee("button",{onclick:()=>o(null),"aria-label":s.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(r.className=e.class),r.classList.add("cm-dialog");function o(l){r.contains(r.ownerDocument.activeElement)&&s.focus(),t(l)}return{dom:r,top:e.top,mount:()=>{if(e.focus){let l;typeof e.focus=="string"?l=i.querySelector(e.focus):l=i.querySelector("input")||i.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class ri extends bi{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}ri.prototype.elementClass="";ri.prototype.toDOM=void 0;ri.prototype.mapMode=nt.TrackBefore;ri.prototype.startSide=ri.prototype.endSide=-1;ri.prototype.point=!0;const fr=F.define(),Mg=F.define(),Tg={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>ie.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},gn=F.define();function Dg(s){return[ec(),gn.of({...Tg,...s})]}const $l=F.define({combine:s=>s.some(e=>e)});function ec(s){return[Eg]}const Eg=st.fromClass(class{constructor(s){this.view=s,this.domAfter=null,this.prevViewport=s.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=s.state.facet(gn).map(e=>new ql(s,e)),this.fixed=!s.state.facet($l);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),s.scrollDOM.insertBefore(this.dom,s.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(s){if(this.updateGutters(s)){let e=this.prevViewport,t=s.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}if(s.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet($l)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=s.view.viewport}syncGutters(s){let e=this.dom.nextSibling;s&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=ie.iter(this.view.state.facet(fr),this.view.viewport.from),i=[],n=this.gutters.map(r=>new Og(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(r.type)){let o=!0;for(let l of r.type)if(l.type==Ye.Text&&o){eo(t,i,l.from);for(let a of n)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of n)a.widget(this.view,l)}else if(r.type==Ye.Text){eo(t,i,r.from);for(let o of n)o.line(this.view,r,i)}else if(r.widget)for(let o of n)o.widget(this.view,r);for(let r of n)r.finish();s&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(s){let e=s.startState.facet(gn),t=s.state.facet(gn),i=s.docChanged||s.heightChanged||s.viewportChanged||!ie.eq(s.startState.facet(fr),s.state.facet(fr),s.view.viewport.from,s.view.viewport.to);if(e==t)for(let n of this.gutters)n.update(s)&&(i=!0);else{i=!0;let n=[];for(let r of t){let o=e.indexOf(r);o<0?n.push(new ql(this.view,r)):(this.gutters[o].update(s),n.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),n.indexOf(r)<0&&r.destroy();for(let r of n)r.config.side=="after"?this.getDOMAfter().appendChild(r.dom):this.dom.appendChild(r.dom);this.gutters=n}return i}destroy(){for(let s of this.gutters)s.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:s=>H.scrollMargins.of(e=>{let t=e.plugin(s);if(!t||t.gutters.length==0||!t.fixed)return null;let i=t.dom.offsetWidth*e.scaleX,n=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==pe.LTR?{left:i,right:n}:{right:i,left:n}})});function zl(s){return Array.isArray(s)?s:[s]}function eo(s,e,t){for(;s.value&&s.from<=t;)s.from==t&&e.push(s.value),s.next()}class Og{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=ie.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:n}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==n.elements.length){let l=new tc(e,o,r,i);n.elements.push(l),n.dom.appendChild(l.dom)}else n.elements[this.i].update(e,o,r,i);this.height=t.bottom,this.i++}line(e,t,i){let n=[];eo(this.cursor,n,t.from),i.length&&(n=n.concat(i));let r=this.gutter.config.lineMarker(e,t,n);r&&n.unshift(r);let o=this.gutter;n.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,n)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),n=i?[i]:null;for(let r of e.state.facet(Mg)){let o=r(e,t.widget,t);o&&(n||(n=[])).push(o)}n&&this.addElement(e,t,n)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class ql{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,n=>{let r=n.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let a=r.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=n.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[i](e,l,n)&&n.preventDefault()});this.markers=zl(t.markers(e)),t.initialSpacer&&(this.spacer=new tc(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=zl(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let n=this.config.updateSpacer(this.spacer.markers[0],e);n!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[n])}let i=e.view.viewport;return!ie.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class tc{constructor(e,t,i,n){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,n)}update(e,t,i,n){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),Lg(this.markers,n)||this.setMarkers(e,n)}setMarkers(e,t){let i="cm-gutterElement",n=this.dom.firstChild;for(let r=0,o=0;;){let l=o,a=rr(l,a,h)||o(l,a,h):o}return i}})}});class ur extends ri{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function dr(s,e){return s.state.facet(Pi).formatNumber(e,s.state)}const Pg=gn.compute([Pi],s=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Bg)},lineMarker(e,t,i){return i.some(n=>n.toDOM)?null:new ur(dr(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let n of e.state.facet(Rg)){let r=n(e,t,i);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(Pi)!=e.state.facet(Pi),initialSpacer(e){return new ur(dr(e,Ul(e.state.doc.lines)))},updateSpacer(e,t){let i=dr(t.view,Ul(t.view.state.doc.lines));return i==e.number?e:new ur(i)},domEventHandlers:s.facet(Pi).domEventHandlers,side:"before"}));function Ig(s={}){return[Pi.of(s),ec(),Pg]}function Ul(s){let e=9;for(;e{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Ke.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}ee.closedBy=new ee({deserialize:s=>s.split(" ")});ee.openedBy=new ee({deserialize:s=>s.split(" ")});ee.group=new ee({deserialize:s=>s.split(" ")});ee.isolate=new ee({deserialize:s=>{if(s&&s!="rtl"&&s!="ltr"&&s!="auto")throw new RangeError("Invalid value for isolate: "+s);return s||"auto"}});ee.contextHash=new ee({perNode:!0});ee.lookAhead=new ee({perNode:!0});ee.mounted=new ee({perNode:!0});class Wi{constructor(e,t,i,n=!1){this.tree=e,this.overlay=t,this.parser=i,this.bracketed=n}static get(e){return e&&e.props&&e.props[ee.mounted.id]}}const Fg=Object.create(null);class Ke{constructor(e,t,i,n=0){this.name=e,this.props=t,this.id=i,this.flags=n}static define(e){let t=e.props&&e.props.length?Object.create(null):Fg,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),n=new Ke(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(n)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return n}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(ee.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let n of i.split(" "))t[n]=e[i];return i=>{for(let n=i.prop(ee.group),r=-1;r<(n?n.length:0);r++){let o=t[r<0?i.name:n[r]];if(o)return o}}}}Ke.none=new Ke("",Object.create(null),0,8);class Eo{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|he.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=n&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Bo(Ke.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,n)=>new ce(this.type,t,i,n,this.propValues),e.makeTree||((t,i,n)=>new ce(Ke.none,t,i,n)))}static build(e){return $g(e)}}ce.empty=new ce(Ke.none,[],[],0);class Oo{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Oo(this.buffer,this.index)}}class oi{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return Ke.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,i){let n=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Sn(s,e,t,i){for(var n;s.from==s.to||(t<1?s.from>=e:s.from>e)||(t>-1?s.to<=e:s.to0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from,u;if(!(!(r&he.EnterBracketed&&c instanceof ce&&(u=Wi.get(c))&&!u.overlay&&u.bracketed&&i>=f&&i<=f+c.length)&&!ic(n,i,f,f+c.length))){if(c instanceof oi){if(r&he.ExcludeBuffers)continue;let d=c.findChild(0,c.buffer.length,t,i-f,n);if(d>-1)return new Lt(new Wg(o,c,e,f),null,d)}else if(r&he.IncludeAnonymous||!c.type.isAnonymous||Lo(c)){let d;if(!(r&he.IgnoreMounts)&&(d=Wi.get(c))&&!d.overlay)return new He(d.tree,f,e,o);let p=new He(c,f,e,o);return r&he.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(t<0?c.children.length-1:0,t,i,n,r)}}}if(r&he.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,i=0){let n;if(!(i&he.IgnoreOverlays)&&(n=Wi.get(this._tree))&&n.overlay){let r=e-this.from,o=i&he.EnterBracketed&&n.bracketed;for(let{from:l,to:a}of n.overlay)if((t>0||o?l<=r:l=r:a>r))return new He(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function jl(s,e,t,i){let n=s.cursor(),r=[];if(!n.firstChild())return r;if(t!=null){for(let o=!1;!o;)if(o=n.type.is(t),!n.nextSibling())return r}for(;;){if(i!=null&&n.type.is(i))return r;if(n.type.is(e)&&r.push(n.node),!n.nextSibling())return i==null?r:[]}}function to(s,e,t=e.length-1){for(let i=s;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class Wg{constructor(e,t,i,n){this.parent=e,this.buffer=t,this.index=i,this.start=n}}class Lt extends nc{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new Lt(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,i=0){if(i&he.ExcludeBuffers)return null;let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new Lt(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Lt(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Lt(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,n=this.index+4,r=i.buffer[this.index+3];if(r>n){let o=i.buffer[this.index+1];e.push(i.slice(n,r,o)),t.push(0)}return new ce(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function sc(s){if(!s.length)return null;let e=0,t=s[0];for(let r=1;rt.from||o.to=e){let l=new He(o.tree,o.overlay[0].from+r.from,-1,r);(n||(n=[i])).push(Sn(l,e,t,!1))}}return n?sc(n):i}class Ts{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~he.EnterBracketed,e instanceof He)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:n}=this.buffer;return this.type=t||n.set.types[n.buffer[e]],this.from=i+n.buffer[e+1],this.to=i+n.buffer[e+2],!0}yield(e){return e?e instanceof He?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:n}=this.buffer,r=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&he.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&he.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&he.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let n=i<0?0:this.stack[i]+4;if(this.index!=n)return this.yieldBuf(t.findChild(n,this.index,-1,0,4))}else{let n=t.buffer[this.index+3];if(n<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(n)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:n}=this;if(n){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&he.IncludeAnonymous||l instanceof oi||!l.type.isAnonymous||Lo(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==n){if(n==this.index)return o;t=o,i=r+1;break e}n=this.stack[--r]}for(let n=i;n=0;r--){if(r<0)return to(this._tree,e,n);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[n]&&e[n]!=o.name)return!1;n--}}return!0}}function Lo(s){return s.children.some(e=>e instanceof oi||!e.type.isAnonymous||Lo(e))}function $g(s){var e;let{buffer:t,nodeSet:i,maxBufferLength:n=Ng,reused:r=[],minRepeatType:o=i.types.length}=s,l=Array.isArray(t)?new Oo(t,t.length):t,a=i.types,h=0,c=0;function f(A,P,C,U,M,$){let{id:N,start:I,end:G,size:L}=l,R=c,Z=h;if(L<0)if(l.next(),L==-1){let de=r[N];C.push(de),U.push(I-A);return}else if(L==-3){h=N;return}else if(L==-4){c=N;return}else throw new RangeError(`Unrecognized record size: ${L}`);let X=a[N],ue,Me,ot=I-A;if(G-I<=n&&(Me=y(l.pos-P,M))){let de=new Uint16Array(Me.size-Me.skip),Te=l.pos-Me.size,De=de.length;for(;l.pos>Te;)De=b(Me.start,de,De);ue=new oi(de,G-Me.start,i),ot=Me.start-A}else{let de=l.pos-L;l.next();let Te=[],De=[],Fe=N>=o?N:-1,Le=0,je=G;for(;l.pos>de;)Fe>=0&&l.id==Fe&&l.size>=0?(l.end<=je-n&&(p(Te,De,I,Le,l.end,je,Fe,R,Z),Le=Te.length,je=l.end),l.next()):$>2500?u(I,de,Te,De):f(I,de,Te,De,Fe,$+1);if(Fe>=0&&Le>0&&Le-1&&Le>0){let $e=d(X,Z);ue=Bo(X,Te,De,0,Te.length,0,G-I,$e,$e)}else ue=g(X,Te,De,G-I,R-G,Z)}C.push(ue),U.push(ot)}function u(A,P,C,U){let M=[],$=0,N=-1;for(;l.pos>P;){let{id:I,start:G,end:L,size:R}=l;if(R>4)l.next();else{if(N>-1&&G=0;L-=3)I[R++]=M[L],I[R++]=M[L+1]-G,I[R++]=M[L+2]-G,I[R++]=R;C.push(new oi(I,M[2]-G,i)),U.push(G-A)}}function d(A,P){return(C,U,M)=>{let $=0,N=C.length-1,I,G;if(N>=0&&(I=C[N])instanceof ce){if(!N&&I.type==A&&I.length==M)return I;(G=I.prop(ee.lookAhead))&&($=U[N]+I.length+G)}return g(A,C,U,M,$,P)}}function p(A,P,C,U,M,$,N,I,G){let L=[],R=[];for(;A.length>U;)L.push(A.pop()),R.push(P.pop()+C-M);A.push(g(i.types[N],L,R,$-M,I-$,G)),P.push(M-C)}function g(A,P,C,U,M,$,N){if($){let I=[ee.contextHash,$];N=N?[I].concat(N):[I]}if(M>25){let I=[ee.lookAhead,M];N=N?[I].concat(N):[I]}return new ce(A,P,C,U,N)}function y(A,P){let C=l.fork(),U=0,M=0,$=0,N=C.end-n,I={size:0,start:0,skip:0};e:for(let G=C.pos-A;C.pos>G;){let L=C.size;if(C.id==P&&L>=0){I.size=U,I.start=M,I.skip=$,$+=4,U+=4,C.next();continue}let R=C.pos-L;if(L<0||R=o?4:0,X=C.start;for(C.next();C.pos>R;){if(C.size<0)if(C.size==-3||C.size==-4)Z+=4;else break e;else C.id>=o&&(Z+=4);C.next()}M=X,U+=L,$+=Z}return(P<0||U==A)&&(I.size=U,I.start=M,I.skip=$),I.size>4?I:void 0}function b(A,P,C){let{id:U,start:M,end:$,size:N}=l;if(l.next(),N>=0&&U4){let G=l.pos-(N-4);for(;l.pos>G;)C=b(A,P,C)}P[--C]=I,P[--C]=$-A,P[--C]=M-A,P[--C]=U}else N==-3?h=U:N==-4&&(c=U);return C}let x=[],T=[];for(;l.pos>0;)f(s.start||0,s.bufferStart||0,x,T,-1,0);let D=(e=s.length)!==null&&e!==void 0?e:x.length?T[0]+x[0].length:0;return new ce(a[s.topID],x.reverse(),T.reverse(),D)}const Gl=new WeakMap;function cs(s,e){if(!s.isAnonymous||e instanceof oi||e.type!=s)return 1;let t=Gl.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=s||!(i instanceof ce)){t=1;break}t+=cs(s,i)}Gl.set(e,t)}return t}function Bo(s,e,t,i,n,r,o,l,a){let h=0;for(let p=i;p=c)break;P+=C}if(T==D+1){if(P>c){let C=p[D];d(C.children,C.positions,0,C.children.length,g[D]+x);continue}f.push(p[D])}else{let C=g[T-1]+p[T-1].length-A;f.push(Bo(s,p,g,D,T,A,C,null,a))}u.push(A+x-r)}}return d(e,t,i,n,0),(l||a)(f,u,o)}class uv{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let n=this.map.get(e);n||this.map.set(e,n=new Map),n.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof Lt?this.setBuffer(e.context.buffer,e.index,t):e instanceof He&&this.map.set(e.tree,t)}get(e){return e instanceof Lt?this.getBuffer(e.context.buffer,e.index):e instanceof He?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Ht{constructor(e,t,i,n,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=n,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let n=[new Ht(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&n.push(r);return n}static applyChanges(e,t,i=128){if(!t.length)return e;let n=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=i)for(;o&&o.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new Ht(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&n.push(u),o.to>f)break;o=rnew ht(n.from,n.to)):[new ht(0,0)]:[new ht(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let n=this.startParse(e,t,i);for(;;){let r=n.advance();if(r)return r}}}class zg{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function dv(s){return(e,t,i,n)=>new Ug(e,s,t,i,n)}class Jl{constructor(e,t,i,n,r,o){this.parser=e,this.parse=t,this.overlay=i,this.bracketed=n,this.target=r,this.from=o}}function Yl(s){if(!s.length||s.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(s))}class qg{constructor(e,t,i,n,r,o,l,a){this.parser=e,this.predicate=t,this.mounts=i,this.index=n,this.start=r,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}}const io=new ee({perNode:!0});class Ug{constructor(e,t,i,n,r){this.nest=t,this.input=i,this.fragments=n,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let n of this.inner)n.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new ce(i.type,i.children,i.positions,i.length,i.propValues.concat([[io,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[ee.mounted.id]=new Wi(t,e.overlay,e.parser,e.bracketed),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)l=!1;else if(e.hasNode(n)){if(t){let h=t.mounts.find(c=>c.frag.from<=n.from&&c.frag.to>=n.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=n.from&&u<=n.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=Kg(i.ranges,n.from,n.to)))l=o!=2;else if(!n.type.isAnonymous&&(r=this.nest(n,this.input))&&(n.fromnew ht(f.from-n.from,f.to-n.from)):null,!!r.bracketed,n.tree,c.length?c[0].from:n.from)),r.overlay?c.length&&(i={ranges:c,depth:0,prev:i}):l=!1}}else if(t&&(a=t.predicate(n))&&(a===!0&&(a=new ht(n.from,n.to)),a.from=0&&t.ranges[h].to==a.from?t.ranges[h]={from:t.ranges[h].from,to:a.to}:t.ranges.push(a)}if(l&&n.firstChild())t&&t.depth++,i&&i.depth++;else for(;!n.nextSibling();){if(!n.parent())break e;if(t&&!--t.depth){let h=Zl(this.ranges,t.ranges);h.length&&(Yl(h),this.inner.splice(t.index,0,new Jl(t.parser,t.parser.startParse(this.input,ea(t.mounts,h),h),t.ranges.map(c=>new ht(c.from-t.start,c.to-t.start)),t.bracketed,t.target,h[0].from))),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function Kg(s,e,t){for(let i of s){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function Xl(s,e,t,i,n,r){if(e=e&&t.enter(i,1,he.IgnoreOverlays|he.ExcludeBuffers)))if(t.to<=e)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof ce)t=t.children[0];else break}return!1}}class Gg{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(io))!==null&&t!==void 0?t:i.to,this.inner=new Ql(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(io))!==null&&e!==void 0?e:t.to,this.inner=new Ql(t.tree,-t.offset)}}findMounts(e,t){var i;let n=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(ee.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=r.to)break;a.tree==this.curFrag.tree&&n.push({frag:a,pos:r.from-a.offset,mount:o})}}}return n}}function Zl(s,e){let t=null,i=e;for(let n=1,r=0;n=l)break;a.to<=o||(t||(i=t=e.slice()),a.froml&&t.splice(r+1,0,new ht(l,a.to))):a.to>l?t[r--]=new ht(l,a.to):t.splice(r--,1))}}return i}function Jg(s,e,t,i){let n=0,r=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=n==s.length?1e9:o?s[n].to:s[n].from,f=r==e.length?1e9:l?e[r].to:e[r].from;if(o!=l){let u=Math.max(a,t),d=Math.min(c,f,i);unew ht(u.from+i,u.to+i)),f=Jg(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,g=p?h:f[u].from;if(g>d&&t.push(new Ht(d,g,n.tree,-o,r.from>=d||r.openStart,r.to<=g||r.openEnd)),p)break;d=f[u].to}}else t.push(new Ht(a,h,n.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return t}let Yg=0;class lt{constructor(e,t,i,n){this.name=e,this.set=t,this.base=i,this.modified=n,this.id=Yg++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e=="string"?e:"?";if(e instanceof lt&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let n=new lt(i,[],null,[]);if(n.set.push(n),t)for(let r of t.set)n.set.push(r);return n}static defineModifier(e){let t=new Ds(e);return i=>i.modified.indexOf(t)>-1?i:Ds.get(i.base||i,i.modified.concat(t).sort((n,r)=>n.id-r.id))}}let Xg=0;class Ds{constructor(e){this.name=e,this.instances=[],this.id=Xg++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&Qg(t,l.modified));if(i)return i;let n=[],r=new lt(e.name,n,e,t);for(let l of t)l.instances.push(r);let o=Zg(t);for(let l of e.set)if(!l.modified.length)for(let a of o)n.push(Ds.get(l,a));return r}}function Qg(s,e){return s.length==e.length&&s.every((t,i)=>t==e[i])}function Zg(s){let e=[[]];for(let t=0;ti.length-t.length)}function em(s){let e=Object.create(null);for(let t in s){let i=s[t];Array.isArray(i)||(i=[i]);for(let n of t.split(" "))if(n){let r=[],o=2,l=n;for(let f=0;;){if(l=="..."&&f>0&&f+3==n.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+n);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==n.length)break;let d=n[f++];if(f==n.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+n);l=n.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+n);let c=new Cn(i,o,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return oc.add(e)}const oc=new ee({combine(s,e){let t,i,n;for(;s||e;){if(!s||e&&s.depth>=e.depth?(n=e,e=e.next):(n=s,s=s.next),t&&t.mode==n.mode&&!n.context&&!t.context)continue;let r=new Cn(n.tags,n.mode,n.context);t?t.next=r:i=r,t=r}return i}});class Cn{constructor(e,t,i,n){this.tags=e,this.mode=t,this.context=i,this.next=n}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=n;for(let l of r)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function tm(s,e){let t=null;for(let i of s){let n=i.style(e);n&&(t=t?t+" "+n:n)}return t}function im(s,e,t,i=0,n=s.length){let r=new nm(i,Array.isArray(e)?e:[e],t);r.highlightRange(s.cursor(),i,n,"",r.highlighters),r.flush(n)}class nm{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,n,r){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=n,c=sm(e)||Cn.empty,f=tm(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(n+=(n?" ":"")+f)),this.startSpan(Math.max(t,l),h),c.opaque)return;let u=e.tree&&e.tree.prop(ee.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(y=>!y.scope||y.scope(u.tree.type)),g=e.firstChild();for(let y=0,b=l;;y++){let x=y=T||!e.nextSibling())););if(!x||T>i)break;b=x.to+l,b>t&&(this.highlightRange(d.cursor(),Math.max(t,x.from+l),Math.min(i,b),"",p),this.startSpan(Math.min(i,b),h))}g&&e.parent()}else if(e.firstChild()){u&&(n="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,n,r),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function sm(s){let e=s.type.prop(oc);for(;e&&e.context&&!s.matchContext(e.context);)e=e.next;return e||null}const E=lt.define,Zn=E(),jt=E(),ta=E(jt),ia=E(jt),Gt=E(),es=E(Gt),pr=E(Gt),Mt=E(),ui=E(Mt),Ct=E(),At=E(),no=E(),sn=E(no),ts=E(),v={comment:Zn,lineComment:E(Zn),blockComment:E(Zn),docComment:E(Zn),name:jt,variableName:E(jt),typeName:ta,tagName:E(ta),propertyName:ia,attributeName:E(ia),className:E(jt),labelName:E(jt),namespace:E(jt),macroName:E(jt),literal:Gt,string:es,docString:E(es),character:E(es),attributeValue:E(es),number:pr,integer:E(pr),float:E(pr),bool:E(Gt),regexp:E(Gt),escape:E(Gt),color:E(Gt),url:E(Gt),keyword:Ct,self:E(Ct),null:E(Ct),atom:E(Ct),unit:E(Ct),modifier:E(Ct),operatorKeyword:E(Ct),controlKeyword:E(Ct),definitionKeyword:E(Ct),moduleKeyword:E(Ct),operator:At,derefOperator:E(At),arithmeticOperator:E(At),logicOperator:E(At),bitwiseOperator:E(At),compareOperator:E(At),updateOperator:E(At),definitionOperator:E(At),typeOperator:E(At),controlOperator:E(At),punctuation:no,separator:E(no),bracket:sn,angleBracket:E(sn),squareBracket:E(sn),paren:E(sn),brace:E(sn),content:Mt,heading:ui,heading1:E(ui),heading2:E(ui),heading3:E(ui),heading4:E(ui),heading5:E(ui),heading6:E(ui),contentSeparator:E(Mt),list:E(Mt),quote:E(Mt),emphasis:E(Mt),strong:E(Mt),link:E(Mt),monospace:E(Mt),strikethrough:E(Mt),inserted:E(),deleted:E(),changed:E(),invalid:E(),meta:ts,documentMeta:E(ts),annotation:E(ts),processingInstruction:E(ts),definition:lt.defineModifier("definition"),constant:lt.defineModifier("constant"),function:lt.defineModifier("function"),standard:lt.defineModifier("standard"),local:lt.defineModifier("local"),special:lt.defineModifier("special")};for(let s in v){let e=v[s];e instanceof lt&&(e.name=s)}lc([{tag:v.link,class:"tok-link"},{tag:v.heading,class:"tok-heading"},{tag:v.emphasis,class:"tok-emphasis"},{tag:v.strong,class:"tok-strong"},{tag:v.keyword,class:"tok-keyword"},{tag:v.atom,class:"tok-atom"},{tag:v.bool,class:"tok-bool"},{tag:v.url,class:"tok-url"},{tag:v.labelName,class:"tok-labelName"},{tag:v.inserted,class:"tok-inserted"},{tag:v.deleted,class:"tok-deleted"},{tag:v.literal,class:"tok-literal"},{tag:v.string,class:"tok-string"},{tag:v.number,class:"tok-number"},{tag:[v.regexp,v.escape,v.special(v.string)],class:"tok-string2"},{tag:v.variableName,class:"tok-variableName"},{tag:v.local(v.variableName),class:"tok-variableName tok-local"},{tag:v.definition(v.variableName),class:"tok-variableName tok-definition"},{tag:v.special(v.variableName),class:"tok-variableName2"},{tag:v.definition(v.propertyName),class:"tok-propertyName tok-definition"},{tag:v.typeName,class:"tok-typeName"},{tag:v.namespace,class:"tok-namespace"},{tag:v.className,class:"tok-className"},{tag:v.macroName,class:"tok-macroName"},{tag:v.propertyName,class:"tok-propertyName"},{tag:v.operator,class:"tok-operator"},{tag:v.comment,class:"tok-comment"},{tag:v.meta,class:"tok-meta"},{tag:v.invalid,class:"tok-invalid"},{tag:v.punctuation,class:"tok-punctuation"}]);var gr;const Zt=new ee;function Ro(s){return F.define({combine:s?e=>e.concat(s):void 0})}const ac=new ee;class qe{constructor(e,t,i=[],n=""){this.data=e,this.name=n,se.prototype.hasOwnProperty("tree")||Object.defineProperty(se.prototype,"tree",{get(){return _e(this)}}),this.parser=t,this.extension=[$t.of(this),se.languageData.of((r,o,l)=>{let a=na(r,o,l),h=a.type.prop(Zt);if(!h)return[];let c=r.facet(h),f=a.type.prop(ac);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(e,t,i=-1){return na(e,t,i).type.prop(Zt)==this.data}findRegions(e){let t=e.facet($t);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],n=(r,o)=>{if(r.prop(Zt)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(ee.mounted);if(l){if(l.tree.prop(Zt)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(n(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new Es(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function _e(s){let e=s.field(qe.state,!1);return e?e.tree:ce.empty}function hc(s,e,t=50){var i;let n=(i=s.field(qe.state,!1))===null||i===void 0?void 0:i.context;if(!n)return null;let r=n.viewport;n.updateViewport({from:0,to:e});let o=n.isDone(e)||n.work(t,e)?n.tree:null;return n.updateViewport(r),o}function rm(s,e=s.doc.length){var t;return((t=s.field(qe.state,!1))===null||t===void 0?void 0:t.context.isDone(e))||!1}function om(s,e=s.viewport.to,t=100){let i=hc(s.state,e,t);return i!=_e(s.state)&&s.dispatch({}),!!i}function lm(s){var e;return((e=s.plugin(uc))===null||e===void 0?void 0:e.isWorking())||!1}class cc{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let rn=null;class Si{constructor(e,t,i=[],n,r,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=n,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Si(e,t,[],ce.empty,0,i,[],null)}startParse(){return this.parser.startParse(new cc(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=ce.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let n=Date.now()+e;e=()=>Date.now()>n}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Ht.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=rn;rn=this;try{return e()}finally{rn=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=sa(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:n,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=Ht.applyChanges(i,a),n=ce.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=sa(this.fragments,n,r),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends rc{createParse(t,i,n){let r=n[0].from,o=n[n.length-1].to;return{parsedPos:r,advance(){let a=rn;if(a){for(let h of n)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new ce(Ke.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return rn}}function sa(s,e,t){return Ht.applyChanges(s,[{fromA:e,toA:t,fromB:e,toB:t}])}class Ui{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new Ui(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Si.create(e.facet($t).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new Ui(i)}}qe.state=vt.define({create:Ui.init,update(s,e){for(let t of e.effects)if(t.is(qe.setState))return t.value;return e.startState.facet($t)!=e.state.facet($t)?Ui.init(e.state):s.apply(e)}});let fc=s=>{let e=setTimeout(()=>s(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(fc=s=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(s,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const mr=typeof navigator<"u"&&(!((gr=navigator.scheduling)===null||gr===void 0)&&gr.isInputPending)?()=>navigator.scheduling.isInputPending():null,uc=st.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(qe.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(qe.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=fc(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndn+1e3,a=r.context.work(()=>mr&&mr()||Date.now()>o,n+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:qe.setState.of(new Ui(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ot(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),$t=F.define({combine(s){return s.length?s[0]:null},enables:s=>[qe.state,uc,H.contentAttributes.compute([s],e=>{let t=e.facet(s);return t&&t.name?{"data-language":t.name}:{}})]});class am{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class Po{constructor(e,t,i,n,r,o=void 0){this.name=e,this.alias=t,this.extensions=i,this.filename=n,this.loadFunc=r,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:i}=e;if(!t){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(i)}return new Po(e.name,(e.alias||[]).concat(e.name).map(n=>n.toLowerCase()),e.extensions||[],e.filename,t,i)}static matchFilename(e,t){for(let n of e)if(n.filename&&n.filename.test(t))return n;let i=/\.([^.]+)$/.exec(t);if(i){for(let n of e)if(n.extensions.indexOf(i[1])>-1)return n}return null}static matchLanguageName(e,t,i=!0){t=t.toLowerCase();for(let n of e)if(n.alias.some(r=>r==t))return n;if(i)for(let n of e)for(let r of n.alias){let o=t.indexOf(r);if(o>-1&&(r.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+r.length])))return n}return null}}const dc=F.define(),Us=F.define({combine:s=>{if(!s.length)return" ";let e=s[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(s[0]));return e}});function li(s){let e=s.facet(Us);return e.charCodeAt(0)==9?s.tabSize*e.length:e.length}function Ci(s,e){let t="",i=s.tabSize,n=s.facet(Us)[0];if(n==" "){for(;e>=i;)t+=" ",e-=i;n=" "}for(let r=0;r=e?cm(s,t,e):null}function hm(s,e,t){let i=Object.create(null),n=new Xi(s,{overrideIndentation:o=>{var l;return(l=i[o])!==null&&l!==void 0?l:-1}}),r=[];for(let o=e;o<=t;){let l=s.doc.lineAt(o);o=l.to+1;let a=In(n,l.from);if(a==null)continue;/\S/.test(l.text)||(a=0);let h=/^\s*/.exec(l.text)[0],c=Ci(s,a);h!=c&&(i[l.from]=a,r.push({from:l.from,to:l.from+h.length,insert:c}))}return s.changes(r)}class Xi{constructor(e,t={}){this.state=e,this.options=t,this.unit=li(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:n,simulateDoubleBreak:r}=this.options;return n!=null&&n>=i.from&&n<=i.to?r&&n==e?{text:"",from:e}:(t<0?n-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return Ws(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:n}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(n);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Io=new ee;function cm(s,e,t){let i=e.resolveStack(t),n=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(n!=i.node){let r=[];for(let o=n;o&&!(o.fromi.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return pc(i,s,t)}function pc(s,e,t){for(let i=s;i;i=i.next){let n=um(i.node);if(n)return n(Ks.create(e,t,i))}return 0}function fm(s){return s.pos==s.options.simulateBreak&&s.options.simulateDoubleBreak}function um(s){let e=s.type.prop(Io);if(e)return e;let t=s.firstChild,i;if(t&&(i=t.type.prop(ee.closedBy))){let n=s.lastChild,r=n&&i.indexOf(n.name)>-1;return o=>gc(o,!0,1,void 0,r&&!fm(o)?n.from:void 0)}return s.parent==null?dm:null}function dm(){return 0}class Ks extends Xi{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new Ks(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(pm(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return pc(this.context.next,this.base,this.pos)}}function pm(s,e){for(let t=e;t;t=t.parent)if(s==t)return!0;return!1}function gm(s){let e=s.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let n=s.options.simulateBreak,r=s.state.doc.lineAt(t.from),o=n==null||n<=r.from?r.to:Math.min(r.to,n);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let h=/^ */.exec(r.text.slice(t.to-r.from))[0].length;return{from:t.from,to:t.to+h}}l=a.to}}function mm({closing:s,align:e=!0,units:t=1}){return i=>gc(i,e,t,s)}function gc(s,e,t,i,n){let r=s.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||n==s.pos+o,a=e?gm(s):null;return a?l?s.column(a.from):s.column(a.to):s.baseIndent+(l?0:s.unit*t)}const ym=s=>s.baseIndent;function vm({except:s,units:e=1}={}){return t=>{let i=s&&s.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const bm=200;function wm(){return se.transactionFilter.of(s=>{if(!s.docChanged||!s.isUserEvent("input.type")&&!s.isUserEvent("input.complete"))return s;let e=s.startState.languageDataAt("indentOnInput",s.startState.selection.main.head);if(!e.length)return s;let t=s.newDoc,{head:i}=s.newSelection.main,n=t.lineAt(i);if(i>n.from+bm)return s;let r=t.sliceString(n.from,i);if(!e.some(h=>h.test(r)))return s;let{state:o}=s,l=-1,a=[];for(let{head:h}of o.selection.ranges){let c=o.doc.lineAt(h);if(c.from==l)continue;l=c.from;let f=In(o,c.from);if(f==null)continue;let u=/^\s*/.exec(c.text)[0],d=Ci(o,f);u!=d&&a.push({from:c.from,to:c.from+u.length,insert:d})}return a.length?[s,{changes:a,sequential:!0}]:s})}const mc=F.define(),yc=new ee;function xm(s){let e=s.firstChild,t=s.lastChild;return e&&e.tot)continue;if(r&&l.from=e&&h.to>t&&(r=h)}}return r}function Sm(s){let e=s.lastChild;return e&&e.to==s.to&&e.type.isError}function Ki(s,e,t){for(let i of s.facet(mc)){let n=i(s,e,t);if(n)return n}return km(s,e,t)}function vc(s,e){let t=e.mapPos(s.from,1),i=e.mapPos(s.to,-1);return t>=i?void 0:{from:t,to:i}}const Qi=oe.define({map:vc}),Ai=oe.define({map:vc});function No(s){let e=[];for(let{head:t}of s.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(s.lineBlockAt(t));return e}const zt=vt.define({create(){return re.none},update(s,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((t,i)=>s=ra(s,t,i)),s=s.map(e.changes);for(let t of e.effects)if(t.is(Qi)&&!Am(s,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(Fo),n=i?re.replace({widget:new Om(i(e.state,t.value))}):oa;s=s.update({add:[n.range(t.value.from,t.value.to)]})}else t.is(Ai)&&(s=s.update({filter:(i,n)=>t.value.from!=i||t.value.to!=n,filterFrom:t.value.from,filterTo:t.value.to}));return e.selection&&(s=ra(s,e.selection.main.head)),s},provide:s=>H.decorations.from(s),toJSON(s,e){let t=[];return s.between(0,e.doc.length,(i,n)=>{t.push(i,n)}),t},fromJSON(s){if(!Array.isArray(s)||s.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{ne&&(i=!0)}),i?s.update({filterFrom:e,filterTo:t,filter:(n,r)=>n>=t||r<=e}):s}function Cm(s){return s.field(zt,!1)||ie.empty}function An(s,e,t){var i;let n=null;return(i=s.field(zt,!1))===null||i===void 0||i.between(e,t,(r,o)=>{(!n||n.from>r)&&(n={from:r,to:o})}),n}function Am(s,e,t){let i=!1;return s.between(e,e,(n,r)=>{n==e&&r==t&&(i=!0)}),i}function _o(s,e){return s.field(zt,!1)?e:e.concat(oe.appendConfig.of(Wo()))}const bc=s=>{for(let e of No(s)){let t=Ki(s.state,e.from,e.to);if(t)return s.dispatch({effects:_o(s.state,[Qi.of(t),Os(s,t)])}),!0}return!1},wc=s=>{if(!s.state.field(zt,!1))return!1;let e=[];for(let t of No(s)){let i=An(s.state,t.from,t.to);i&&e.push(Ai.of(i),Os(s,i,!1))}return e.length&&s.dispatch({effects:e}),e.length>0};function Os(s,e,t=!0){let i=s.state.doc.lineAt(e.from).number,n=s.state.doc.lineAt(e.to).number;return H.announce.of(`${s.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${s.state.phrase("to")} ${n}.`)}const xc=s=>{let{state:e}=s,t=[];for(let i=0;i{let e=s.state.field(zt,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,s.state.doc.length,(i,n)=>{t.push(Ai.of({from:i,to:n}))}),s.dispatch({effects:t}),!0};function Mm(s,e){for(let t=e;;){let i=Ki(s.state,t.from,t.to);if(i&&i.to>e.from)return i;if(!t.from)return null;t=s.lineBlockAt(t.from-1)}}const Tm=s=>{let e=[];for(let t of No(s)){let i=An(s.state,t.from,t.to);if(i)e.push(Ai.of(i),Os(s,i,!1));else{let n=Mm(s,t);n&&e.push(Qi.of(n),Os(s,n))}}return e.length>0&&s.dispatch({effects:_o(s.state,e)}),!!e.length},Dm=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:bc},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:wc},{key:"Ctrl-Alt-[",run:xc},{key:"Ctrl-Alt-]",run:kc}],Em={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Fo=F.define({combine(s){return Ln(s,Em)}});function Wo(s){let e=[zt,Rm];return s&&e.push(Fo.of(s)),e}function Sc(s,e){let{state:t}=s,i=t.facet(Fo),n=o=>{let l=s.lineBlockAt(s.posAtDOM(o.target)),a=An(s.state,l.from,l.to);a&&s.dispatch({effects:Ai.of(a)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(s,n,e);let r=document.createElement("span");return r.textContent=i.placeholderText,r.setAttribute("aria-label",t.phrase("folded code")),r.title=t.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=n,r}const oa=re.replace({widget:new class extends Yi{toDOM(s){return Sc(s,null)}}});class Om extends Yi{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Sc(e,this.value)}}const Lm={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class yr extends ri{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function Bm(s={}){let e={...Lm,...s},t=new yr(e,!0),i=new yr(e,!1),n=st.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet($t)!=o.state.facet($t)||o.startState.field(zt,!1)!=o.state.field(zt,!1)||_e(o.startState)!=_e(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new ti;for(let a of o.viewportLineBlocks){let h=An(o.state,a.from,a.to)?i:Ki(o.state,a.from,a.to)?t:null;h&&l.add(a.from,a.from,h)}return l.finish()}}),{domEventHandlers:r}=e;return[n,Dg({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(n))===null||l===void 0?void 0:l.markers)||ie.empty},initialSpacer(){return new yr(e,!1)},domEventHandlers:{...r,click:(o,l,a)=>{if(r.click&&r.click(o,l,a))return!0;let h=An(o.state,l.from,l.to);if(h)return o.dispatch({effects:Ai.of(h)}),!0;let c=Ki(o.state,l.from,l.to);return c?(o.dispatch({effects:Qi.of(c)}),!0):!1}}}),Wo()]}const Rm=H.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Mi{constructor(e,t){this.specs=e;let i;function n(l){let a=ii.newName();return(i||(i=Object.create(null)))["."+a]=l,a}const r=typeof t.all=="string"?t.all:t.all?n(t.all):void 0,o=t.scope;this.scope=o instanceof qe?l=>l.prop(Zt)==o.data:o?l=>l==o:void 0,this.style=lc(e.map(l=>({tag:l.tag,class:l.class||n(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new ii(i):null,this.themeType=t.themeType}static define(e,t){return new Mi(e,t||{})}}const so=F.define(),Cc=F.define({combine(s){return s.length?[s[0]]:null}});function fs(s){let e=s.facet(so);return e.length?e:s.facet(Cc)}function Ac(s,e){let t=[Nm],i;return s instanceof Mi&&(s.module&&t.push(H.styleModule.of(s.module)),i=s.themeType),e!=null&&e.fallback?t.push(Cc.of(s)):i?t.push(so.computeN([H.darkTheme],n=>n.facet(H.darkTheme)==(i=="dark")?[s]:[])):t.push(so.of(s)),t}function Pm(s,e,t){let i=fs(s),n=null;if(i){for(let r of i)if(!r.scope||t&&r.scope(t)){let o=r.style(e);o&&(n=n?n+" "+o:o)}}return n}class Im{constructor(e){this.markCache=Object.create(null),this.tree=_e(e.state),this.decorations=this.buildDeco(e,fs(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=_e(e.state),i=fs(e.state),n=i!=fs(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||n)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return re.none;let i=new ti;for(let{from:n,to:r}of e.visibleRanges)im(this.tree,t,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=re.mark({class:a})))},n,r);return i.finish()}}const Nm=On.high(st.fromClass(Im,{decorations:s=>s.decorations})),_m=Mi.define([{tag:v.meta,color:"#404740"},{tag:v.link,textDecoration:"underline"},{tag:v.heading,textDecoration:"underline",fontWeight:"bold"},{tag:v.emphasis,fontStyle:"italic"},{tag:v.strong,fontWeight:"bold"},{tag:v.strikethrough,textDecoration:"line-through"},{tag:v.keyword,color:"#708"},{tag:[v.atom,v.bool,v.url,v.contentSeparator,v.labelName],color:"#219"},{tag:[v.literal,v.inserted],color:"#164"},{tag:[v.string,v.deleted],color:"#a11"},{tag:[v.regexp,v.escape,v.special(v.string)],color:"#e40"},{tag:v.definition(v.variableName),color:"#00f"},{tag:v.local(v.variableName),color:"#30a"},{tag:[v.typeName,v.namespace],color:"#085"},{tag:v.className,color:"#167"},{tag:[v.special(v.variableName),v.macroName],color:"#256"},{tag:v.definition(v.propertyName),color:"#00c"},{tag:v.comment,color:"#940"},{tag:v.invalid,color:"#f00"}]),Fm=H.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Mc=1e4,Tc="()[]{}",Dc=F.define({combine(s){return Ln(s,{afterCursor:!0,brackets:Tc,maxScanDistance:Mc,renderMatch:Vm})}}),Wm=re.mark({class:"cm-matchingBracket"}),Hm=re.mark({class:"cm-nonmatchingBracket"});function Vm(s){let e=[],t=s.matched?Wm:Hm;return e.push(t.range(s.start.from,s.start.to)),s.end&&e.push(t.range(s.end.from,s.end.to)),e}function la(s){let e=[],t=s.facet(Dc);for(let i of s.selection.ranges){if(!i.empty)continue;let n=mt(s,i.head,-1,t)||i.head>0&&mt(s,i.head-1,1,t)||t.afterCursor&&(mt(s,i.head,1,t)||i.heads.decorations}),zm=[$m,Fm];function qm(s={}){return[Dc.of(s),zm]}const Ec=new ee;function ro(s,e,t){let i=s.prop(e<0?ee.openedBy:ee.closedBy);if(i)return i;if(s.name.length==1){let n=t.indexOf(s.name);if(n>-1&&n%2==(e<0?1:0))return[t[n+e]]}return null}function oo(s){let e=s.type.prop(Ec);return e?e(s.node):s}function mt(s,e,t,i={}){let n=i.maxScanDistance||Mc,r=i.brackets||Tc,o=_e(s),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=ro(a.type,t,r);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return Um(s,e,t,a,c,h,r)}}return Km(s,e,t,o,l.type,n,r)}function Um(s,e,t,i,n,r,o){let l=i.parent,a={from:n.from,to:n.to},h=0,c=l==null?void 0:l.cursor();if(c&&(t<0?c.childBefore(i.from):c.childAfter(i.to)))do if(t<0?c.to<=i.from:c.from>=i.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=s.doc.iterRange(e,t>0?s.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let g=t>0?0:d.length-1,y=t>0?d.length:-1;g!=y;g+=t){let b=o.indexOf(d[g]);if(!(b<0||i.resolveInner(p+g,1).type!=n))if(b%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+g,to:p+g+1},matched:b>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}function aa(s,e,t,i=0,n=0){e==null&&(e=s.search(/[^\s\u00a0]/),e==-1&&(e=s.length));let r=n;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,e.length);return n(r)==n(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}}function jm(s){return{name:s.name||"",token:s.token,blankLine:s.blankLine||(()=>{}),startState:s.startState||(()=>!0),copyState:s.copyState||Gm,indent:s.indent||(()=>null),languageData:s.languageData||{},tokenTable:s.tokenTable||zo,mergeTokens:s.mergeTokens!==!1}}function Gm(s){if(typeof s!="object")return s;let e={};for(let t in s){let i=s[t];e[t]=i instanceof Array?i.slice():i}return e}const ha=new WeakMap;class Vo extends qe{constructor(e){let t=Ro(e.languageData),i=jm(e),n,r=new class extends rc{createParse(o,l,a){return new Ym(n,o,l,a)}};super(t,r,[],e.name),this.topNode=Zm(t,this),n=this,this.streamParser=i,this.stateAfter=new ee({perNode:!0}),this.tokenTable=e.tokenTable?new Rc(i.tokenTable):Qm}static define(e){return new Vo(e)}getIndent(e){let t,{overrideIndentation:i}=e.options;i&&(t=ha.get(e.state),t!=null&&t1e4)return null;for(;r=i&&t+e.length<=n&&e.prop(s.stateAfter);if(r)return{state:s.streamParser.copyState(r),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],h=l instanceof ce&&a=e.length)return e;!n&&t==0&&e.type==s.topNode&&(n=!0);for(let r=e.children.length-1;r>=0;r--){let o=e.positions[r],l=e.children[r],a;if(ot&&$o(s,r.tree,0-r.offset,t,l),h;if(a&&a.pos<=i&&(h=Oc(s,r.tree,t+r.offset,a.pos+r.offset,!1)))return{state:a.state,tree:h}}return{state:s.streamParser.startState(n?li(n):4),tree:ce.empty}}class Ym{constructor(e,t,i,n){this.lang=e,this.input=t,this.fragments=i,this.ranges=n,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=n[n.length-1].to;let r=Si.get(),o=n[0].from,{state:l,tree:a}=Jm(e,i,o,this.to,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;hh.from<=r.viewport.from&&h.to>=r.viewport.from)&&(this.state=this.lang.streamParser.startState(li(r.state)),r.skipUntilInView(this.parsedPos,r.viewport.from),this.parsedPos=r.viewport.from),this.moveRangeIndex()}advance(){let e=Si.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(t,this.chunkStart+512);for(e&&(i=Math.min(i,e.viewport.to));this.parsedPos=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==` `&&(t="");else{let i=t.indexOf(` `);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let n=this.rangeIndex;;){let r=this.ranges[n].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),n++,n==this.ranges.length))break;let o=this.ranges[n].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let n=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?n>r:n>=r)break;let o=this.ranges[++this.rangeIndex].from;t+=o-n}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){n=this.skipGapsTo(t,n,1),t+=n;let l=this.chunk.length;n=this.skipGapsTo(i,n,-1),i+=n,r+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&r==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=i:this.chunk.push(e,t,i,r),n}parseLine(e){let{line:t,end:i}=this.nextLine(),n=0,{streamParser:r}=this.lang,o=new Ho(t,e?e.state.tabSize:4,e?li(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Lc(r.token,o,this.state);if(l&&(n=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,n)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPose.start)return n}throw new Error("Stream parser failed to advance stream.")}const zo=Object.create(null),Mn=[Ke.none],Xm=new Eo(Mn),ca=[],fa=Object.create(null),Bc=Object.create(null);for(let[s,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Bc[s]=Pc(zo,e);class Rc{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Bc)}resolve(e){return e?this.table[e]||(this.table[e]=Pc(this.extra,e)):0}}const Qm=new Rc(zo);function vr(s,e){ca.indexOf(s)>-1||(ca.push(s),console.warn(e))}function Pc(s,e){let t=[];for(let l of e.split(" ")){let a=[];for(let h of l.split(".")){let c=s[h]||v[h];c?typeof c=="function"?a.length?a=a.map(c):vr(h,`Modifier ${h} used at start of tag`):a.length?vr(h,`Tag ${h} used as modifier`):a=Array.isArray(c)?c:[c]:vr(h,`Unknown highlighting tag ${h}`)}for(let h of a)t.push(h)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),n=i+" "+t.map(l=>l.id),r=fa[n];if(r)return r.id;let o=fa[n]=Ke.define({id:Mn.length,name:i,props:[em({[i]:t})]});return Mn.push(o),o.id}function Zm(s,e){let t=Ke.define({id:Mn.length,name:"Document",props:[Zt.add(()=>s),Io.add(()=>i=>e.getIndent(i))],top:!0});return Mn.push(t),t}function Ic(s){return s.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(s)}function Nc(s){for(let e=s.iter();!e.next().done;)if(Ic(e.value))return!0;return!1}function e0(s){let e=!1;return s.iterChanges((t,i,n,r,o)=>{!e&&Nc(o)&&(e=!0)}),e}const lo=F.define({combine:s=>s.some(e=>e)});function t0(s={}){let e=[i0];return s.alwaysIsolate&&e.push(lo.of(!0)),e}const i0=st.fromClass(class{constructor(s){this.always=s.state.facet(lo)||s.textDirection!=pe.LTR||s.state.facet(H.perLineTextDirection),this.hasRTL=!this.always&&Nc(s.state.doc),this.tree=_e(s.state),this.decorations=this.always||this.hasRTL?ua(s,this.tree,this.always):re.none}update(s){let e=s.state.facet(lo)||s.view.textDirection!=pe.LTR||s.state.facet(H.perLineTextDirection);if(!e&&!this.hasRTL&&e0(s.changes)&&(this.hasRTL=!0),!e&&!this.hasRTL)return;let t=_e(s.state);(e!=this.always||t!=this.tree||s.docChanged||s.viewportChanged)&&(this.tree=t,this.always=e,this.decorations=ua(s.view,t,e))}},{provide:s=>{function e(t){var i,n;return(n=(i=t.plugin(s))===null||i===void 0?void 0:i.decorations)!==null&&n!==void 0?n:re.none}return[H.outerDecorations.of(e),On.lowest(H.bidiIsolatedRanges.of(e))]}});function ua(s,e,t){let i=new ti,n=s.visibleRanges;t||(n=n0(n,s.state.doc));for(let{from:r,to:o}of n)e.iterate({enter:l=>{let a=l.type.prop(ee.isolate);a&&i.add(l.from,l.to,s0[a])},from:r,to:o});return i.finish()}function n0(s,e){let t=e.iter(),i=0,n=[],r=null;for(let{from:o,to:l}of s)if(!(r&&r.to>o&&(o=r.to,o>=l)))for(i+t.value.lengtha-10?r.to=Math.min(l,h):n.push(r={from:a,to:Math.min(l,h)})),h>=l)break;i=h,t.next()}return n}const s0={rtl:re.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:pe.RTL}),ltr:re.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:pe.LTR}),auto:re.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})},r0=Object.freeze(Object.defineProperty({__proto__:null,DocInput:cc,HighlightStyle:Mi,IndentContext:Xi,LRLanguage:Es,Language:qe,LanguageDescription:Po,LanguageSupport:am,ParseContext:Si,StreamLanguage:Vo,StringStream:Ho,TreeIndentContext:Ks,bidiIsolates:t0,bracketMatching:qm,bracketMatchingHandle:Ec,codeFolding:Wo,continuedIndent:vm,defaultHighlightStyle:_m,defineLanguageFacet:Ro,delimitedIndent:mm,ensureSyntaxTree:hc,flatIndent:ym,foldAll:xc,foldCode:bc,foldEffect:Qi,foldGutter:Bm,foldInside:xm,foldKeymap:Dm,foldNodeProp:yc,foldService:mc,foldState:zt,foldable:Ki,foldedRanges:Cm,forceParsing:om,getIndentUnit:li,getIndentation:In,highlightingFor:Pm,indentNodeProp:Io,indentOnInput:wm,indentRange:hm,indentService:dc,indentString:Ci,indentUnit:Us,language:$t,languageDataProp:Zt,matchBrackets:mt,sublanguageProp:ac,syntaxHighlighting:Ac,syntaxParserRunning:lm,syntaxTree:_e,syntaxTreeAvailable:rm,toggleFold:Tm,unfoldAll:kc,unfoldCode:wc,unfoldEffect:Ai},Symbol.toStringTag,{value:"Module"})),o0=s=>{let{state:e}=s,t=e.doc.lineAt(e.selection.main.from),i=Uo(s.state,t.from);return i.line?l0(s):i.block?h0(s):!1};function qo(s,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let n=s(e,t);return n?(i(t.update(n)),!0):!1}}const l0=qo(u0,0),a0=qo(_c,0),h0=qo((s,e)=>_c(s,e,f0(e)),0);function Uo(s,e){let t=s.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const on=50;function c0(s,{open:e,close:t},i,n){let r=s.sliceDoc(i-on,i),o=s.sliceDoc(n,n+on),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,h=r.length-l;if(r.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:n+a,margin:a&&1}};let c,f;n-i<=2*on?c=f=s.sliceDoc(i,n):(c=s.sliceDoc(i,i+on),f=s.sliceDoc(n-on,n));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:n-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function f0(s){let e=[];for(let t of s.selection.ranges){let i=s.doc.lineAt(t.from),n=t.to<=i.to?i:s.doc.lineAt(t.to);n.from>i.from&&n.from==t.to&&(n=t.to==i.to+1?i:s.doc.lineAt(t.to-1));let r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=n.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:n.to})}return e}function _c(s,e,t=e.selection.ranges){let i=t.map(r=>Uo(e,r.from).block);if(!i.every(r=>r))return null;let n=t.map((r,o)=>c0(e,i[o],r.from,r.to));if(s!=2&&!n.every(r=>r))return{changes:e.changes(t.map((r,o)=>n[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(s!=1&&n.some(r=>r)){let r=[];for(let o=0,l;on&&(r==o||o>f.from)){n=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+h,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(s!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const ao=ai.define(),d0=ai.define(),p0=F.define(),Fc=F.define({combine(s){return Ln(s,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,n)=>e(i,n)||t(i,n)})}}),Wc=vt.define({create(){return Bt.empty},update(s,e){let t=e.state.facet(Fc),i=e.annotation(ao);if(i){let a=Je.fromTransaction(e,i.selection),h=i.side,c=h==0?s.undone:s.done;return a?c=Ls(c,c.length,t.minDepth,a):c=$c(c,e.startState.selection),new Bt(h==0?i.rest:c,h==0?c:i.rest)}let n=e.annotation(d0);if((n=="full"||n=="before")&&(s=s.isolate()),e.annotation(Ae.addToHistory)===!1)return e.changes.empty?s:s.addMapping(e.changes.desc);let r=Je.fromTransaction(e),o=e.annotation(Ae.time),l=e.annotation(Ae.userEvent);return r?s=s.addChanges(r,o,l,t,e):e.selection&&(s=s.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(n=="full"||n=="after")&&(s=s.isolate()),s},toJSON(s){return{done:s.done.map(e=>e.toJSON()),undone:s.undone.map(e=>e.toJSON())}},fromJSON(s){return new Bt(s.done.map(Je.fromJSON),s.undone.map(Je.fromJSON))}});function g0(s={}){return[Wc,Fc.of(s),H.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?Hc:e.inputType=="historyRedo"?ho:null;return i?(e.preventDefault(),i(t)):!1}})]}function js(s,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let n=t.field(Wc,!1);if(!n)return!1;let r=n.pop(s,t,e);return r?(i(r),!0):!1}}const Hc=js(0,!1),ho=js(1,!1),m0=js(0,!0),y0=js(1,!0);class Je{constructor(e,t,i,n,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=n,this.selectionsAfter=r}setSelAfter(e){return new Je(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(n=>n.toJSON())}}static fromJSON(e){return new Je(e.changes&&Ce.fromJSON(e.changes),[],e.mapped&&Rt.fromJSON(e.mapped),e.startSelection&&S.fromJSON(e.startSelection),e.selectionsAfter.map(S.fromJSON))}static fromTransaction(e,t){let i=ct;for(let n of e.startState.facet(p0)){let r=n(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new Je(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,ct)}static selection(e){return new Je(void 0,ct,void 0,void 0,e)}}function Ls(s,e,t,i){let n=e+1>t+20?e-t-1:0,r=s.slice(n,e);return r.push(i),r}function v0(s,e){let t=[],i=!1;return s.iterChangedRanges((n,r)=>t.push(n,r)),e.iterChangedRanges((n,r,o,l)=>{for(let a=0;a=h&&o<=c&&(i=!0)}}),i}function b0(s,e){return s.ranges.length==e.ranges.length&&s.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function Vc(s,e){return s.length?e.length?s.concat(e):s:e}const ct=[],w0=200;function $c(s,e){if(s.length){let t=s[s.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-w0));return i.length&&i[i.length-1].eq(e)?s:(i.push(e),Ls(s,s.length-1,1e9,t.setSelAfter(i)))}else return[Je.selection([e])]}function x0(s){let e=s[s.length-1],t=s.slice();return t[s.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function br(s,e){if(!s.length)return s;let t=s.length,i=ct;for(;t;){let n=k0(s[t-1],e,i);if(n.changes&&!n.changes.empty||n.effects.length){let r=s.slice(0,t);return r[t-1]=n,r}else e=n.mapped,t--,i=n.selectionsAfter}return i.length?[Je.selection(i)]:ct}function k0(s,e,t){let i=Vc(s.selectionsAfter.length?s.selectionsAfter.map(l=>l.map(e)):ct,t);if(!s.changes)return Je.selection(i);let n=s.changes.map(e),r=e.mapDesc(s.changes,!0),o=s.mapped?s.mapped.composeDesc(r):r;return new Je(n,oe.mapEffects(s.effects,e),o,s.startSelection.map(r),i)}const S0=/^(input\.type|delete)($|\.)/;class Bt{constructor(e,t,i=0,n=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new Bt(this.done,this.undone):this}addChanges(e,t,i,n,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||S0.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?s.moveByChar(t,e):Gs(t,e))}function Ve(s){return s.textDirectionAt(s.state.selection.main.head)==pe.LTR}const qc=s=>zc(s,!Ve(s)),Uc=s=>zc(s,Ve(s));function Kc(s,e){return wt(s,t=>t.empty?s.moveByGroup(t,e):Gs(t,e))}const A0=s=>Kc(s,!Ve(s)),M0=s=>Kc(s,Ve(s));function T0(s,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(s.sliceDoc(e.from,e.to)))||e.firstChild}function Js(s,e,t){let i=_e(s).resolveInner(e.head),n=t?ee.closedBy:ee.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;T0(s,h,n)?i=h:a=t?h.to:h.from}let r=i.type.prop(n),o,l;return r&&(o=t?mt(s,i.from,1):mt(s,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,S.cursor(l,t?-1:1)}const D0=s=>wt(s,e=>Js(s.state,e,!Ve(s))),E0=s=>wt(s,e=>Js(s.state,e,Ve(s)));function jc(s,e){return wt(s,t=>{if(!t.empty)return Gs(t,e);let i=s.moveVertically(t,e);return i.head!=t.head?i:s.moveToLineBoundary(t,e)})}const Gc=s=>jc(s,!1),Jc=s=>jc(s,!0);function Yc(s){let e=s.scrollDOM.clientHeighto.empty?s.moveVertically(o,e,t.height):Gs(o,e));if(n.eq(i.selection))return!1;let r;if(t.selfScroll){let o=s.coordsAtPos(i.selection.main.head),l=s.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottomXc(s,!1),co=s=>Xc(s,!0);function hi(s,e,t){let i=s.lineBlockAt(e.head),n=s.moveToLineBoundary(e,t);if(n.head==e.head&&n.head!=(t?i.to:i.from)&&(n=s.moveToLineBoundary(e,t,!1)),!t&&n.head==i.from&&i.length){let r=/^\s*/.exec(s.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(n=S.cursor(i.from+r))}return n}const O0=s=>wt(s,e=>hi(s,e,!0)),L0=s=>wt(s,e=>hi(s,e,!1)),B0=s=>wt(s,e=>hi(s,e,!Ve(s))),R0=s=>wt(s,e=>hi(s,e,Ve(s))),P0=s=>wt(s,e=>S.cursor(s.lineBlockAt(e.head).from,1)),I0=s=>wt(s,e=>S.cursor(s.lineBlockAt(e.head).to,-1));function N0(s,e,t){let i=!1,n=Zi(s.selection,r=>{let o=mt(s,r.head,-1)||mt(s,r.head,1)||r.head>0&&mt(s,r.head-1,1)||r.headN0(s,e);function ut(s,e,t){let i=Zi(s.state.selection,n=>{n.undirectional&&n.head>=n.anchor!=e&&(n=S.range(n.head,n.anchor));let r=t(n);return S.range(n.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return i.eq(s.state.selection)?!1:(s.dispatch(bt(s.state,i)),!0)}function Qc(s,e){return ut(s,e,t=>s.moveByChar(t,e))}const Zc=s=>Qc(s,!Ve(s)),ef=s=>Qc(s,Ve(s));function tf(s,e){return ut(s,e,t=>s.moveByGroup(t,e))}const F0=s=>tf(s,!Ve(s)),W0=s=>tf(s,Ve(s)),H0=s=>{let e=!Ve(s);return ut(s,e,t=>Js(s.state,t,e))},V0=s=>{let e=Ve(s);return ut(s,e,t=>Js(s.state,t,e))};function nf(s,e){return ut(s,e,t=>s.moveVertically(t,e))}const sf=s=>nf(s,!1),rf=s=>nf(s,!0);function of(s,e){return ut(s,e,t=>s.moveVertically(t,e,Yc(s).height))}const pa=s=>of(s,!1),ga=s=>of(s,!0),$0=s=>ut(s,!0,e=>hi(s,e,!0)),z0=s=>ut(s,!1,e=>hi(s,e,!1)),q0=s=>{let e=!Ve(s);return ut(s,e,t=>hi(s,t,e))},U0=s=>{let e=Ve(s);return ut(s,e,t=>hi(s,t,e))},K0=s=>ut(s,!1,e=>S.cursor(s.lineBlockAt(e.head).from)),j0=s=>ut(s,!0,e=>S.cursor(s.lineBlockAt(e.head).to)),ma=({state:s,dispatch:e})=>(e(bt(s,{anchor:0})),!0),ya=({state:s,dispatch:e})=>(e(bt(s,{anchor:s.doc.length})),!0),va=({state:s,dispatch:e})=>(e(bt(s,{anchor:s.selection.main.anchor,head:0})),!0),ba=({state:s,dispatch:e})=>(e(bt(s,{anchor:s.selection.main.anchor,head:s.doc.length})),!0),G0=({state:s,dispatch:e})=>(e(s.update({selection:{anchor:0,head:s.doc.length},userEvent:"select"})),!0),J0=({state:s,dispatch:e})=>{let t=Ys(s).map(({from:i,to:n})=>S.range(i,Math.min(n+1,s.doc.length)));return e(s.update({selection:S.create(t),userEvent:"select"})),!0},Y0=({state:s,dispatch:e})=>{let t=Zi(s.selection,i=>{let n=_e(s),r=n.resolveStack(i.from,1);if(i.empty){let o=n.resolveStack(i.from,-1);o.node.from>=r.node.from&&o.node.to<=r.node.to&&(r=o)}for(let o=r;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return S.range(l.to,l.from)}return i});return t.eq(s.selection)?!1:(e(bt(s,t)),!0)};function lf(s,e){let{state:t}=s,i=t.selection,n=t.selection.ranges.slice();for(let r of t.selection.ranges){let o=t.doc.lineAt(r.head);if(e?o.to0)for(let l=r;;){let a=s.moveVertically(l,e);if(a.heado.to){n.some(h=>h.head==a.head)||n.push(a);break}else{if(a.head==l.head)break;l=a}}}return n.length==i.ranges.length?!1:(s.dispatch(bt(t,S.create(n,n.length-1))),!0)}const X0=s=>lf(s,!1),Q0=s=>lf(s,!0),Z0=({state:s,dispatch:e})=>{let t=s.selection,i=null;return t.ranges.length>1?i=S.create([t.main]):t.main.empty||(i=S.create([S.cursor(t.main.head)])),i?(e(bt(s,i)),!0):!1};function Nn(s,e){if(s.state.readOnly)return!1;let t="delete.selection",{state:i}=s,n=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(r);ao&&(t="delete.forward",a=is(s,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=is(s,o,!1),l=is(s,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:S.cursor(o,on(s)))i.between(e,e,(n,r)=>{ne&&(e=t?r:n)});return e}const af=(s,e,t)=>Nn(s,i=>{let n=i.from,{state:r}=s,o=r.doc.lineAt(n),l,a;if(t&&!e&&n>o.from&&naf(s,!1,!0),hf=s=>af(s,!0,!1),cf=(s,e)=>Nn(s,t=>{let i=t.head,{state:n}=s,r=n.doc.lineAt(i),o=n.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t.head&&r.number!=(e?n.doc.lines:1)&&(i+=e?1:-1);break}let a=Oe(r.text,i-r.from,e)+r.from,h=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||i!=t.head)&&(l=c),i=a}return i}),ff=s=>cf(s,!1),ey=s=>cf(s,!0),ty=s=>Nn(s,e=>{let t=s.lineBlockAt(e.head).to;return e.headNn(s,e=>{let t=s.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),ny=s=>Nn(s,e=>{let t=s.moveToLineBoundary(e,!0).head;return e.head{if(s.readOnly)return!1;let t=s.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:ne.of(["",""])},range:S.cursor(i.from)}));return e(s.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},ry=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=s.changeByRange(i=>{if(!i.empty||i.from==0||i.from==s.doc.length)return{range:i};let n=i.from,r=s.doc.lineAt(n),o=n==r.from?n-1:Oe(r.text,n-r.from,!1)+r.from,l=n==r.to?n+1:Oe(r.text,n-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:s.doc.slice(n,l).append(s.doc.slice(o,n))},range:S.cursor(l)}});return t.changes.empty?!1:(e(s.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Ys(s){let e=[],t=-1;for(let i of s.selection.ranges){let n=s.doc.lineAt(i.from),r=s.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=s.doc.lineAt(i.to-1)),t>=n.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:n.from,to:r.to,ranges:[i]});t=r.number+1}return e}function uf(s,e,t){if(s.readOnly)return!1;let i=[],n=[];for(let r of Ys(s)){if(t?r.to==s.doc.length:r.from==0)continue;let o=s.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+s.lineBreak});for(let a of r.ranges)n.push(S.range(Math.min(s.doc.length,a.anchor+l),Math.min(s.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:s.lineBreak+o.text});for(let a of r.ranges)n.push(S.range(a.anchor-l,a.head-l))}}return i.length?(e(s.update({changes:i,scrollIntoView:!0,selection:S.create(n,s.selection.mainIndex),userEvent:"move.line"})),!0):!1}const oy=({state:s,dispatch:e})=>uf(s,e,!1),ly=({state:s,dispatch:e})=>uf(s,e,!0);function df(s,e,t){if(s.readOnly)return!1;let i=[];for(let r of Ys(s))t?i.push({from:r.from,insert:s.doc.slice(r.from,r.to)+s.lineBreak}):i.push({from:r.to,insert:s.lineBreak+s.doc.slice(r.from,r.to)});let n=s.changes(i);return e(s.update({changes:n,selection:s.selection.map(n,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const ay=({state:s,dispatch:e})=>df(s,e,!1),hy=({state:s,dispatch:e})=>df(s,e,!0),cy=s=>{if(s.state.readOnly)return!1;let{state:e}=s,t=e.changes(Ys(e).map(({from:n,to:r})=>(n>0?n--:r{let r;if(s.lineWrapping){let o=s.lineBlockAt(n.head),l=s.coordsAtPos(n.head,n.assoc||1);l&&(r=o.bottom+s.documentTop-l.bottom+s.defaultLineHeight/2)}return s.moveVertically(n,!0,r)}).map(t);return s.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function fy(s,e){if(/\(\)|\[\]|\{\}/.test(s.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=_e(s).resolveInner(e),i=t.childBefore(e),n=t.childAfter(e),r;return i&&n&&i.to<=e&&n.from>=e&&(r=i.type.prop(ee.closedBy))&&r.indexOf(n.name)>-1&&s.doc.lineAt(i.to).from==s.doc.lineAt(n.from).from&&!/\S/.test(s.sliceDoc(i.to,n.from))?{from:i.to,to:n.from}:null}const wa=pf(!1),uy=pf(!0);function pf(s){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(n=>{let{from:r,to:o}=n,l=e.doc.lineAt(r),a=!s&&r==o&&fy(e,r);s&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new Xi(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=In(h,r);for(c==null&&(c=Ws(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));ol.from&&r{let n=[];for(let o=i.from;o<=i.to;){let l=s.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,n,i),t=l.number),o=l.to+1}let r=s.changes(n);return{changes:n,range:S.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const dy=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=Object.create(null),i=new Xi(s,{overrideIndentation:r=>{let o=t[r];return o??-1}}),n=Ko(s,(r,o,l)=>{let a=In(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=Ci(s,a);(h!=c||l.froms.readOnly?!1:(e(s.update(Ko(s,(t,i)=>{i.push({from:t.from,insert:s.facet(Us)})}),{userEvent:"input.indent"})),!0),gy=({state:s,dispatch:e})=>s.readOnly?!1:(e(s.update(Ko(s,(t,i)=>{let n=/^\s*/.exec(t.text)[0];if(!n)return;let r=Ws(n,s.tabSize),o=0,l=Ci(s,Math.max(0,r-li(s)));for(;o(s.setTabFocusMode(),!0),yy=[{key:"Ctrl-b",run:qc,shift:Zc,preventDefault:!0},{key:"Ctrl-f",run:Uc,shift:ef},{key:"Ctrl-p",run:Gc,shift:sf},{key:"Ctrl-n",run:Jc,shift:rf},{key:"Ctrl-a",run:P0,shift:K0},{key:"Ctrl-e",run:I0,shift:j0},{key:"Ctrl-d",run:hf},{key:"Ctrl-h",run:fo},{key:"Ctrl-k",run:ty},{key:"Ctrl-Alt-h",run:ff},{key:"Ctrl-o",run:sy},{key:"Ctrl-t",run:ry},{key:"Ctrl-v",run:co}],vy=[{key:"ArrowLeft",run:qc,shift:Zc,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:A0,shift:F0,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:B0,shift:q0,preventDefault:!0},{key:"ArrowRight",run:Uc,shift:ef,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:M0,shift:W0,preventDefault:!0},{mac:"Cmd-ArrowRight",run:R0,shift:U0,preventDefault:!0},{key:"ArrowUp",run:Gc,shift:sf,preventDefault:!0},{mac:"Cmd-ArrowUp",run:ma,shift:va},{mac:"Ctrl-ArrowUp",run:da,shift:pa},{key:"ArrowDown",run:Jc,shift:rf,preventDefault:!0},{mac:"Cmd-ArrowDown",run:ya,shift:ba},{mac:"Ctrl-ArrowDown",run:co,shift:ga},{key:"PageUp",run:da,shift:pa},{key:"PageDown",run:co,shift:ga},{key:"Home",run:L0,shift:z0,preventDefault:!0},{key:"Mod-Home",run:ma,shift:va},{key:"End",run:O0,shift:$0,preventDefault:!0},{key:"Mod-End",run:ya,shift:ba},{key:"Enter",run:wa,shift:wa},{key:"Mod-a",run:G0},{key:"Backspace",run:fo,shift:fo,preventDefault:!0},{key:"Delete",run:hf,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:ff,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:ey,preventDefault:!0},{mac:"Mod-Backspace",run:iy,preventDefault:!0},{mac:"Mod-Delete",run:ny,preventDefault:!0}].concat(yy.map(s=>({mac:s.key,run:s.run,shift:s.shift}))),by=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:D0,shift:H0},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:E0,shift:V0},{key:"Alt-ArrowUp",run:oy},{key:"Shift-Alt-ArrowUp",run:ay},{key:"Alt-ArrowDown",run:ly},{key:"Shift-Alt-ArrowDown",run:hy},{key:"Mod-Alt-ArrowUp",run:X0},{key:"Mod-Alt-ArrowDown",run:Q0},{key:"Escape",run:Z0},{key:"Mod-Enter",run:uy},{key:"Alt-l",mac:"Ctrl-l",run:J0},{key:"Mod-i",run:Y0,preventDefault:!0},{key:"Mod-[",run:gy},{key:"Mod-]",run:py},{key:"Mod-Alt-\\",run:dy},{key:"Shift-Mod-k",run:cy},{key:"Shift-Mod-\\",run:_0},{key:"Mod-/",run:o0},{key:"Alt-A",run:a0},{key:"Ctrl-m",mac:"Shift-Alt-m",run:my}].concat(vy),xa=typeof String.prototype.normalize=="function"?s=>s.normalize("NFKD"):s=>s;class Tn{constructor(e,t,i=0,n=e.length,r,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,n),this.bufferStart=i,this.normalize=r?l=>r(xa(l)):xa,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Va(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=vd(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=$a(e);let n=this.normalize(t);if(n.length)for(let r=0,o=i,l=!0;;r++){let a=n.charCodeAt(r),h=this.match(a,o,l,this.bufferPos+this.bufferStart,r==n.length-1);if(h)return this.value=h,this;if(r==n.length-1)break;l&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,n=i+t[0].length;if(this.matchPos=Bs(this.text,n+(i==n?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,n,t)))return this.value={from:i,to:n,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||n.to<=t){let l=new Hi(t,e.sliceString(t,i));return wr.set(e,l),l}if(n.from==t&&n.to==i)return n;let{text:r,from:o}=n;return o>t&&(r=e.sliceString(t,o)+r,o=t),n.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,n=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,n,t)))return this.value={from:i,to:n,precise:!0,match:t},this.matchPos=Bs(this.text,n+(i==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Hi.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(mf.prototype[Symbol.iterator]=yf.prototype[Symbol.iterator]=function(){return this});function wy(s){try{return new RegExp(s,jo),!0}catch{return!1}}function Bs(s,e){if(e>=s.length)return e;let t=s.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}const xy=s=>{let{state:e}=s,t=String(e.doc.lineAt(s.state.selection.main.head).number),{close:i,result:n}=Cg(s,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:t},focus:!0,submitLabel:e.phrase("go")});return n.then(r=>{let o=r&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(r.elements.line.value);if(!o){s.dispatch({effects:i});return}let l=e.doc.lineAt(e.selection.main.head),[,a,h,c,f]=o,u=c?+c.slice(1):0,d=h?+h:l.number;if(h&&f){let y=d/100;a&&(y=y*(a=="-"?-1:1)+l.number/e.doc.lines),d=Math.round(e.doc.lines*y)}else h&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=e.doc.line(Math.max(1,Math.min(e.doc.lines,d))),g=S.cursor(p.from+Math.max(0,Math.min(u,p.length)));s.dispatch({effects:[i,H.scrollIntoView(g.from,{y:"center"})],selection:g})}),!0},ky=({state:s,dispatch:e})=>{let{selection:t}=s,i=S.create(t.ranges.map(n=>s.wordAt(n.head)||S.cursor(n.head)),t.mainIndex);return i.eq(t)?!1:(e(s.update({selection:i})),!0)};function Sy(s,e){let{main:t,ranges:i}=s.selection,n=s.wordAt(t.head),r=n&&n.from==t.from&&n.to==t.to;for(let o=!1,l=new Tn(s.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Tn(s.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=s.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const Cy=({state:s,dispatch:e})=>{let{ranges:t}=s.selection;if(t.some(r=>r.from===r.to))return ky({state:s,dispatch:e});let i=s.sliceDoc(t[0].from,t[0].to);if(s.selection.ranges.some(r=>s.sliceDoc(r.from,r.to)!=i))return!1;let n=Sy(s,i);return n?(e(s.update({selection:s.selection.addRange(S.range(n.from,n.to),!1),effects:H.scrollIntoView(n.to)})),!0):!1},Ti=F.define({combine(s){return Ln(s,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Wy(e),scrollToMatch:e=>H.scrollIntoView(e)})}});function Ay(s){return s?[Ti.of(s),po]:po}class vf{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||wy(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?` -`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Ly(this):new Dy(this)}getCursor(e,t=0,i){let n=e.doc?e:se.create({doc:e});return i==null&&(i=n.doc.length),this.regexp?Li(this,n,t,i):Oi(this,n,t,i)}}class bf{constructor(e){this.spec=e}}function My(s,e,t){return(i,n,r,o)=>{if(t&&!t(i,n,r,o))return!1;let l=i>=o&&n<=o+r.length?r.slice(i-o,n-o):e.doc.sliceString(i,n);return s(l,e,i,n)}}function Oi(s,e,t,i){let n;return s.wholeWord&&(n=Ty(e.doc,e.charCategorizer(e.selection.main.head))),s.test&&(n=My(s.test,e,n)),new Tn(e.doc,s.unquoted,t,i,s.caseSensitive?void 0:r=>r.toLowerCase(),n)}function Ty(s,e){return(t,i,n,r)=>((r>t||r+n.length=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let r=Oi(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}function Ey(s,e,t){return(i,n,r)=>(!t||t(i,n,r))&&s(r[0],e,i,n)}function Li(s,e,t,i){let n;return s.wholeWord&&(n=Oy(e.charCategorizer(e.selection.main.head))),s.test&&(n=Ey(s.test,e,n)),new mf(e.doc,s.search,{ignoreCase:!s.caseSensitive,test:n},t,i)}function Rs(s,e){return s.slice(Oe(s,e,!1),e)}function Ps(s,e){return s.slice(e,Oe(s,e))}function Oy(s){return(e,t,i)=>!i[0].length||(s(Rs(i.input,i.index))!=Ne.Word||s(Ps(i.input,i.index))!=Ne.Word)&&(s(Ps(i.input,i.index+i[0].length))!=Ne.Word||s(Rs(i.input,i.index+i[0].length))!=Ne.Word)}class Ly extends bf{nextMatch(e,t,i){let n=Li(this.spec,e,i,e.doc.length).next();return n.done&&(n=Li(this.spec,e,0,t).next()),n.done?null:n.value}prevMatchInRange(e,t,i){for(let n=1;;n++){let r=Math.max(t,i-n*1e4),o=Li(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let n=i.length;n>0;n--){let r=+i.slice(0,n);if(r>0&&r=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let r=Li(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}const Dn=oe.define(),Go=oe.define(),ei=vt.define({create(s){return new xr(uo(s).create(),null)},update(s,e){for(let t of e.effects)t.is(Dn)?s=new xr(t.value.create(),s.panel):t.is(Go)&&(s=new xr(s.query,t.value?Jo:null));return s},provide:s=>Ms.from(s,e=>e.panel)});class xr{constructor(e,t){this.query=e,this.panel=t}}const By=re.mark({class:"cm-searchMatch"}),Ry=re.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Py=st.fromClass(class{constructor(s){this.view=s,this.decorations=this.highlight(s.state.field(ei))}update(s){let e=s.state.field(ei);(e!=s.startState.field(ei)||s.docChanged||s.selectionSet||s.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:s,panel:e}){if(!e||!s.spec.valid)return re.none;let{view:t}=this,i=new ti;for(let n=0,r=t.visibleRanges,o=r.length;nr[n+1].from-2*250;)a=r[++n].to;s.highlight(t.state,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?Ry:By)})}return i.finish()}},{decorations:s=>s.decorations});function _n(s){return e=>{let t=e.state.field(ei,!1);return t&&t.query.spec.valid?s(e,t):kf(e)}}const Is=_n((s,{query:e})=>{let{to:t}=s.state.selection.main,i=e.nextMatch(s.state,t,t);if(!i)return!1;let n=S.single(i.from,i.to),r=s.state.facet(Ti);return s.dispatch({selection:n,effects:[Yo(s,i),r.scrollToMatch(n.main,s)],userEvent:"select.search"}),xf(s),!0}),Ns=_n((s,{query:e})=>{let{state:t}=s,{from:i}=t.selection.main,n=e.prevMatch(t,i,i);if(!n)return!1;let r=S.single(n.from,n.to),o=s.state.facet(Ti);return s.dispatch({selection:r,effects:[Yo(s,n),o.scrollToMatch(r.main,s)],userEvent:"select.search"}),xf(s),!0}),Iy=_n((s,{query:e})=>{let t=e.matchAll(s.state,1e3);return!t||!t.length?!1:(s.dispatch({selection:S.create(t.map(i=>S.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),Ny=({state:s,dispatch:e})=>{let t=s.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:n}=t.main,r=[],o=0;for(let l=new Tn(s.doc,s.sliceDoc(i,n));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(S.range(l.value.from,l.value.to))}return e(s.update({selection:S.create(r,o),userEvent:"select.search.matches"})),!0},ka=_n((s,{query:e})=>{let{state:t}=s,{from:i,to:n}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,i,i);if(!r)return!1;let o=r,l=[],a,h,c=[];o.precise?o.from==i&&o.to==n&&(h=t.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:h}),o=e.nextMatch(t,o.from,o.to),c.push(H.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))):o=e.nextMatch(t,o.from,o.to);let f=s.state.changes(l);return o&&(a=S.single(o.from,o.to).map(f),c.push(Yo(s,o)),c.push(t.facet(Ti).scrollToMatch(a.main,s))),s.dispatch({changes:f,selection:a,effects:c,userEvent:"input.replace"}),!0}),_y=_n((s,{query:e})=>{if(s.state.readOnly)return!1;let t=[];for(let n of e.matchAll(s.state,1e9)){let{from:r,to:o,precise:l}=n;l&&t.push({from:r,to:o,insert:e.getReplacement(n)})}if(!t.length)return!1;let i=s.state.phrase("replaced $ matches",t.length)+".";return s.dispatch({changes:t,effects:H.announce.of(i),userEvent:"input.replace.all"}),!0});function Jo(s){return s.state.facet(Ti).createPanel(s)}function uo(s,e){var t,i,n,r,o;let l=s.selection.main,a=l.empty||l.to>l.from+100?"":s.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=s.facet(Ti);return new vf({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(n=e==null?void 0:e.literal)!==null&&n!==void 0?n:h.literal,regexp:(r=e==null?void 0:e.regexp)!==null&&r!==void 0?r:h.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function wf(s){let e=Yh(s,Jo);return e&&e.dom.querySelector("[main-field]")}function xf(s){let e=wf(s);e&&e==s.root.activeElement&&e.select()}const kf=s=>{let e=s.state.field(ei,!1);if(e&&e.panel){let t=wf(s);if(t&&t!=s.root.activeElement){let i=uo(s.state,e.query.spec);i.valid&&s.dispatch({effects:Dn.of(i)}),t.focus(),t.select()}}else s.dispatch({effects:[Go.of(!0),e?Dn.of(uo(s.state,e.query.spec)):oe.appendConfig.of(po)]});return!0},Sf=s=>{let e=s.state.field(ei,!1);if(!e||!e.panel)return!1;let t=Yh(s,Jo);return t&&t.dom.contains(s.root.activeElement)&&s.focus(),s.dispatch({effects:Go.of(!1)}),!0},Fy=[{key:"Mod-f",run:kf,scope:"editor search-panel"},{key:"F3",run:Is,shift:Ns,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Is,shift:Ns,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Sf,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Ny},{key:"Mod-Alt-g",run:xy},{key:"Mod-d",run:Cy,preventDefault:!0}];class Wy{constructor(e){this.view=e;let t=this.query=e.state.field(ei).query.spec;this.commit=this.commit.bind(this),this.searchField=Ee("input",{value:t.search,placeholder:Ze(e,"Find"),"aria-label":Ze(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ee("input",{value:t.replace,placeholder:Ze(e,"Replace"),"aria-label":Ze(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ee("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Ee("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Ee("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(n,r,o){return Ee("button",{class:"cm-button",name:n,onclick:r,type:"button"},o)}this.dom=Ee("div",{onkeydown:n=>this.keydown(n),class:"cm-search"},[this.searchField,i("next",()=>Is(e),[Ze(e,"next")]),i("prev",()=>Ns(e),[Ze(e,"previous")]),i("select",()=>Iy(e),[Ze(e,"all")]),Ee("label",null,[this.caseField,Ze(e,"match case")]),Ee("label",null,[this.reField,Ze(e,"regexp")]),Ee("label",null,[this.wordField,Ze(e,"by word")]),...e.state.readOnly?[]:[Ee("br"),this.replaceField,i("replace",()=>ka(e),[Ze(e,"replace")]),i("replaceAll",()=>_y(e),[Ze(e,"replace all")])],Ee("button",{name:"close",onclick:()=>Sf(e),"aria-label":Ze(e,"close"),type:"button"},["×"])])}commit(){let e=new vf({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Dn.of(e)}))}keydown(e){xg(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Ns:Is)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),ka(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(Dn)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Ti).top}}function Ze(s,e){return s.state.phrase(e)}const ns=30,ss=/[\s\.,:;?!]/;function Yo(s,{from:e,to:t}){let i=s.state.doc.lineAt(e),n=s.state.doc.lineAt(t).to,r=Math.max(i.from,e-ns),o=Math.min(n,t+ns),l=s.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;al.length-ns;a--)if(!ss.test(l[a-1])&&ss.test(l[a])){l=l.slice(0,a);break}}return H.announce.of(`${s.state.phrase("current match")}. ${l} ${s.state.phrase("on line")} ${i.number}.`)}const Hy=H.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),po=[ei,On.low(Py),Hy];function Vy(s){const e=s.lastIndexOf("/");return e>=0?s.slice(e+1):s}async function dt(s,e){const[{StreamLanguage:t},i]=await Promise.all([le(()=>Promise.resolve().then(()=>r0),void 0),s]),n=i[e];return t.define(n)}async function $y(s){const e=Vy(s);switch(e){case"Dockerfile":return dt(le(()=>import("./dockerfile-ZL4hHokT.js"),[]),"dockerFile");case"Gemfile":case"Rakefile":return dt(le(()=>import("./ruby-B2Rjki9n.js"),[]),"ruby");case"Makefile":case"GNUmakefile":return dt(le(()=>import("./clike-B9uivgTg.js"),[]),"c")}const t=/\.([A-Za-z0-9]+)$/.exec(e),i=t?t[1].toLowerCase():null;if(!i)return null;switch(i){case"js":case"jsx":case"ts":case"tsx":{const{javascript:n}=await le(async()=>{const{javascript:r}=await import("./index-BKS_vG9j.js");return{javascript:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));return n({typescript:i==="ts"||i==="tsx",jsx:i==="jsx"||i==="tsx"})}case"json":{const{json:n}=await le(async()=>{const{json:r}=await import("./index-B5lmJj73.js");return{json:r}},__vite__mapDeps([10,1,3,4,5,6,7,8,9]));return n()}case"md":case"markdown":{const{markdown:n}=await le(async()=>{const{markdown:r}=await import("./index-DTgf7QAl.js");return{markdown:r}},__vite__mapDeps([11,2,12,1,13,3,4,5,6,7,8,9,0]));return n()}case"css":case"scss":{const{css:n}=await le(async()=>{const{css:r}=await import("./index-gs2Ov3d4.js");return{css:r}},__vite__mapDeps([13,1,3,4,5,6,7,8,9]));return n()}case"html":case"htm":{const{html:n}=await le(async()=>{const{html:r}=await import("./index-DZaDIMfZ.js");return{html:r}},__vite__mapDeps([12,1,13,3,4,5,6,7,8,9,0,2]));return n()}case"py":{const{python:n}=await le(async()=>{const{python:r}=await import("./index-BKUnbiGw.js");return{python:r}},__vite__mapDeps([14,1,2,3,4,5,6,7,8,9]));return n()}case"go":{const{go:n}=await le(async()=>{const{go:r}=await import("./index-Di5PmtZ2.js");return{go:r}},__vite__mapDeps([15,1,2,3,4,5,6,7,8,9]));return n()}case"rs":{const{rust:n}=await le(async()=>{const{rust:r}=await import("./index-CidLZrB5.js");return{rust:r}},__vite__mapDeps([16,1,3,4,5,6,7,8,9]));return n()}case"c":case"cc":case"cpp":case"cxx":case"h":case"hpp":case"hh":case"m":case"mm":{const{cpp:n}=await le(async()=>{const{cpp:r}=await import("./index-Dy-6tZbQ.js");return{cpp:r}},__vite__mapDeps([17,1,3,4,5,6,7,8,9]));return n()}case"java":{const{java:n}=await le(async()=>{const{java:r}=await import("./index-DB-c3u2H.js");return{java:r}},__vite__mapDeps([18,1,3,4,5,6,7,8,9]));return n()}case"php":{const{php:n}=await le(async()=>{const{php:r}=await import("./index-DR4XN96w.js");return{php:r}},__vite__mapDeps([19,1,12,13,3,4,5,6,7,8,9,0,2]));return n()}case"sql":{const{sql:n}=await le(async()=>{const{sql:r}=await import("./index-CHTSx7s6.js");return{sql:r}},__vite__mapDeps([20,1,2,3,4,5,6,7,8,9]));return n()}case"xml":case"xsd":case"xsl":case"plist":case"svg":{const{xml:n}=await le(async()=>{const{xml:r}=await import("./index-KcexLGIr.js");return{xml:r}},__vite__mapDeps([21,1,3,4,5,6,7,8,9]));return n()}case"yml":case"yaml":{const{yaml:n}=await le(async()=>{const{yaml:r}=await import("./index-CVE6o20G.js");return{yaml:r}},__vite__mapDeps([22,1,3,4,5,6,7,8,9]));return n()}case"vue":{const{vue:n}=await le(async()=>{const{vue:r}=await import("./index-cGfdCuRo.js");return{vue:r}},__vite__mapDeps([23,12,1,13,3,4,5,6,7,8,9,0,2]));return n()}case"sass":{const{sass:n}=await le(async()=>{const{sass:r}=await import("./index-C5ykaaYB.js");return{sass:r}},__vite__mapDeps([24,1,13,3,4,5,6,7,8,9]));return n()}case"sh":case"bash":case"zsh":case"fish":case"ksh":return dt(le(()=>import("./shell-CjFT_Tl9.js"),[]),"shell");case"toml":return dt(le(()=>import("./toml-Bm5Em-hy.js"),[]),"toml");case"rb":return dt(le(()=>import("./ruby-B2Rjki9n.js"),[]),"ruby");case"lua":return dt(le(()=>import("./lua-VAEuO923.js"),[]),"lua");case"ini":case"properties":case"conf":return dt(le(()=>import("./properties-C78fOPTZ.js"),[]),"properties");case"diff":case"patch":return dt(le(()=>import("./diff-DbItnlRl.js"),[]),"diff");case"swift":return dt(le(()=>import("./swift-BzpIVaGY.js"),[]),"swift");case"kt":case"kts":case"scala":return dt(le(()=>import("./clike-B9uivgTg.js"),[]),"kotlin");default:return null}}const zy=Mi.define([{tag:v.keyword,color:"#f47067"},{tag:v.controlKeyword,color:"#f47067"},{tag:v.operatorKeyword,color:"#f47067"},{tag:v.definitionKeyword,color:"#f47067"},{tag:v.modifier,color:"#f47067"},{tag:v.string,color:"#96d0ff"},{tag:v.special(v.string),color:"#96d0ff"},{tag:v.regexp,color:"#96d0ff"},{tag:v.escape,color:"#96d0ff"},{tag:[v.comment,v.lineComment,v.blockComment,v.docComment],color:"#768390",fontStyle:"italic"},{tag:v.number,color:"#6cb6ff"},{tag:v.bool,color:"#6cb6ff"},{tag:v.atom,color:"#6cb6ff"},{tag:v.function(v.variableName),color:"#dcbdfb"},{tag:v.function(v.propertyName),color:"#dcbdfb"},{tag:v.macroName,color:"#dcbdfb"},{tag:v.variableName,color:"#adbac7"},{tag:v.propertyName,color:"#adbac7"},{tag:v.typeName,color:"#ffaf6f"},{tag:v.className,color:"#ffaf6f"},{tag:v.namespace,color:"#ffaf6f"},{tag:v.operator,color:"#f47067"},{tag:v.punctuation,color:"#adbac7"},{tag:v.bracket,color:"#adbac7"},{tag:v.derefOperator,color:"#adbac7"},{tag:v.tagName,color:"#8ddb8c"},{tag:v.attributeName,color:"#dcbdfb"},{tag:v.attributeValue,color:"#96d0ff"},{tag:v.heading,color:"#6cb6ff",fontWeight:"bold"},{tag:v.strong,fontWeight:"bold"},{tag:v.emphasis,fontStyle:"italic"},{tag:v.link,color:"#6cb6ff",textDecoration:"underline"},{tag:v.url,color:"#6cb6ff"},{tag:v.quote,color:"#768390"},{tag:v.monospace,color:"#96d0ff"},{tag:v.invalid,color:"#ff938a"},{tag:v.deleted,color:"#ff938a",backgroundColor:"rgba(244,112,103,0.15)"},{tag:v.inserted,color:"#8ddb8c",backgroundColor:"rgba(141,219,140,0.15)"}]),qy=Mi.define([{tag:v.keyword,color:"#cf222e"},{tag:v.controlKeyword,color:"#cf222e"},{tag:v.operatorKeyword,color:"#cf222e"},{tag:v.definitionKeyword,color:"#cf222e"},{tag:v.modifier,color:"#cf222e"},{tag:v.string,color:"#0a3069"},{tag:v.special(v.string),color:"#0a3069"},{tag:v.regexp,color:"#0a3069"},{tag:v.escape,color:"#0a3069"},{tag:[v.comment,v.lineComment,v.blockComment,v.docComment],color:"#6e7781",fontStyle:"italic"},{tag:v.number,color:"#0550ae"},{tag:v.bool,color:"#0550ae"},{tag:v.atom,color:"#0550ae"},{tag:v.function(v.variableName),color:"#8250df"},{tag:v.function(v.propertyName),color:"#8250df"},{tag:v.macroName,color:"#8250df"},{tag:v.variableName,color:"#24292f"},{tag:v.propertyName,color:"#24292f"},{tag:v.typeName,color:"#953800"},{tag:v.className,color:"#953800"},{tag:v.namespace,color:"#953800"},{tag:v.operator,color:"#cf222e"},{tag:v.punctuation,color:"#24292f"},{tag:v.bracket,color:"#24292f"},{tag:v.derefOperator,color:"#24292f"},{tag:v.tagName,color:"#116329"},{tag:v.attributeName,color:"#8250df"},{tag:v.attributeValue,color:"#0a3069"},{tag:v.heading,color:"#0550ae",fontWeight:"bold"},{tag:v.strong,fontWeight:"bold"},{tag:v.emphasis,fontStyle:"italic"},{tag:v.link,color:"#0969da",textDecoration:"underline"},{tag:v.url,color:"#0969da"},{tag:v.quote,color:"#6e7781"},{tag:v.monospace,color:"#0a3069"},{tag:v.invalid,color:"#82071e"},{tag:v.deleted,color:"#82071e",backgroundColor:"rgba(255,129,130,0.2)"},{tag:v.inserted,color:"#116329",backgroundColor:"rgba(74,194,107,0.2)"}]);function Uy(s){return Ac(s==="light"?qy:zy)}const Ky={class:"file-editor"},jy={key:0,class:"banner err conflict","data-test":"conflict-banner"},Gy={class:"msg"},Jy={key:1,class:"banner err","data-test":"save-error"},Yy={key:2,class:"reload-badge"},Xy={key:3,class:"banner muted"},Qy={key:4,class:"banner muted"},Zy={key:5,class:"banner err"},e1={key:6,class:"banner muted"},Sa=2*1024*1024,t1=Qe({__name:"CodeEditor",props:{fs:{},path:{},showLineNumbers:{type:Boolean},theme:{}},emits:["dirty-change"],setup(s,{expose:e,emit:t}){const{t:i}=Ji(),n=s,r=t,o=j(null),l=j("loading"),a=j(""),h=j(!1),c=j(null),f=j(!1),u=j(null),d=j("");let p=null,g=null,y=!1,b=0,x="";function T(L,R,Z,X,ue){return!y&&b===ue&&n.fs===L&&n.path===R&&n.showLineNumbers===Z&&n.theme===X}function D(L,R){return typeof window>"u"||!o.value?R:getComputedStyle(o.value).getPropertyValue(L).trim()||R}function A(L){let R;if(typeof L=="string"){const Z=atob(L);R=new Uint8Array(Z.length);for(let X=0;XSa){l.value="tooLarge",C(!1);return}const ot=await L.readFile(R,Sa);if(!T(L,R,Z,X,ue))return;const de=A(ot.data);x=de,C(!1),u.value=null,d.value="";const Te=H.updateListener.of($e=>{$e.docChanged&&C($e.state.doc.toString()!==x)}),De=Qr.of([{key:"Mod-s",preventDefault:!0,run:()=>(M(),!0)}]),Fe=[P(X),Uy(X),g0(),Ay({top:!0}),Qr.of([...by,...C0,...Fy]),De,Te];Z&&Fe.push(Ig());const Le=await $y(R);if(Le&&Fe.push(Le),!T(L,R,Z,X,ue)||!o.value)return;const je=new H({state:se.create({doc:de,extensions:Fe}),parent:o.value});if(!T(L,R,Z,X,ue)){je.destroy();return}p=je,l.value="ok"}catch(Me){if(!T(L,R,Z,X,ue))return;l.value="error",a.value=Me.message}}}async function M(){if(!p||l.value!=="ok")return!1;const L=p.state.doc.toString(),R=new TextEncoder().encode(L);d.value="";try{const Z=await n.fs.writeFile(n.path,R,c.value);return x=L,c.value=Z.modTime,h.value=!1,u.value=null,C(!1),!0}catch(Z){const X=Z.message??"",ue=/stale_modtime: current=(\d+)/.exec(X);return ue?u.value={currentModTime:Number(ue[1])}:d.value=X,!1}}async function $(){u.value&&(c.value=u.value.currentModTime,u.value=null,await M())}function N(){u.value=null,U()}async function I(L,R){const Z=n.path,X=b;if(!(!Z.startsWith(R+"/")&&Z!==R))try{const ue=await L.fileMeta(Z);if(y||n.fs!==L||n.path!==Z||b!==X)return;c.value&&ue.modTime>c.value&&(h.value=!0)}catch{}}function G(L){g==null||g(),g=L.onDirChanged(R=>{I(L,R)})}return En(()=>{y=!1,U(),G(n.fs)}),ft(()=>[n.path,n.fs,n.showLineNumbers,n.theme],()=>{U()}),ft(()=>n.fs,L=>G(L)),qt(()=>{y=!0,b++,p==null||p.destroy(),p=null,g&&g()}),e({save:M,testAppend:L=>{p&&p.dispatch({changes:{from:p.state.doc.length,insert:L}})}}),(L,R)=>(O(),V("div",Ky,[u.value?(O(),V("div",jy,[J("span",Gy,Q(q(i)("plugins.fileExplorer.staleModTime")),1),J("button",{"data-test":"conflict-overwrite",onClick:$},Q(q(i)("plugins.fileExplorer.overwrite")),1),J("button",{"data-test":"conflict-reload",onClick:N},Q(q(i)("plugins.fileExplorer.reloadDiscard")),1),J("button",{"data-test":"conflict-cancel",onClick:R[0]||(R[0]=Z=>u.value=null)},Q(q(i)("plugins.fileExplorer.cancel")),1)])):Ie("",!0),d.value?(O(),V("div",Jy,Q(q(i)("plugins.fileExplorer.saveFailed",{message:d.value})),1)):Ie("",!0),h.value?(O(),V("div",Yy,[ps(Q(q(i)("plugins.fileExplorer.fileChanged"))+" ",1),J("button",{onClick:U},Q(f.value?q(i)("plugins.fileExplorer.reloadDiscard"):q(i)("plugins.fileExplorer.reload")),1)])):Ie("",!0),l.value==="tooLarge"?(O(),V("div",Xy,Q(q(i)("plugins.fileExplorer.tooLarge")),1)):l.value==="binary"?(O(),V("div",Qy,Q(q(i)("plugins.fileExplorer.binary")),1)):l.value==="error"?(O(),V("div",Zy,Q(q(i)("plugins.fileExplorer.errorPrefix",{message:a.value})),1)):l.value==="loading"?(O(),V("div",e1,Q(q(i)("common.loading")),1)):Ie("",!0),ds(J("div",{ref_key:"host",ref:o,class:"cm-host"},null,512),[[If,l.value==="ok"]])]))}}),i1=rt(t1,[["__scopeId","data-v-25358a6a"]]),n1={class:"binary-banner"},s1={class:"msg"},r1=Qe({__name:"BinaryBanner",props:{fs:{},path:{},message:{}},setup(s){const e=s,{t}=Ji();async function i(){try{await e.fs.openExternal(e.path)}catch{}}return(n,r)=>(O(),V("div",n1,[J("span",s1,Q(n.message??q(t)("plugins.fileExplorer.unsupportedPreview")),1),J("button",{class:"open-btn",onClick:i},Q(q(t)("plugins.fileExplorer.openInSystem")),1)]))}}),ji=rt(r1,[["__scopeId","data-v-780ce2ee"]]),o1=["data-asset-request","src"],l1=Qe({__name:"ImagePreview",props:{fs:{},path:{},theme:{}},setup(s){const e=s,t=j(""),i=j(0),n=j("fit"),r=j(!1);let o=!0,l=0,a=null;function h(){var d,p;a&&((p=(d=a.fs).revokeAssetUrl)==null||p.call(d,a.path),a=null)}async function c(){var y;const d=e.fs,p=e.path,g=++l;i.value=g,h(),a={fs:d,path:p},t.value="",r.value=!1;try{const b=await d.assetUrlFor(p);if(!o||g!==l||e.fs!==d||e.path!==p){(y=d.revokeAssetUrl)==null||y.call(d,p);return}t.value=b}catch{o&&g===l&&e.fs===d&&e.path===p&&(r.value=!0)}}ft(()=>[e.path,e.fs.identity],()=>{c()},{immediate:!0}),qt(()=>{o=!1,l++,h()});function f(){n.value=n.value==="fit"?"native":"fit"}function u(d){const p=d.currentTarget;!t.value||!p||p.dataset.assetRequest!==String(i.value)||(h(),r.value=!0)}return(d,p)=>r.value?(O(),ke(ji,{key:0,fs:d.fs,path:d.path},null,8,["fs","path"])):(O(),V("div",{key:1,class:Gi(["img-host",n.value])},[(O(),V("img",{key:i.value,"data-asset-request":i.value,src:t.value,alt:"",onClick:f,onError:u},null,40,o1))],2))}}),a1=rt(l1,[["__scopeId","data-v-06adca93"]]),h1={key:1,class:"media-host"},c1=["data-asset-request","src"],f1=["data-asset-request","src"],u1=Qe({__name:"MediaPreview",props:{fs:{},path:{},kind:{}},setup(s){const e=s,t=j(""),i=j(0),n=j(!1);let r=!0,o=0,l=null;function a(){var f,u;l&&((u=(f=l.fs).revokeAssetUrl)==null||u.call(f,l.path),l=null)}async function h(){var p;const f=e.fs,u=e.path,d=++o;i.value=d,a(),l={fs:f,path:u},t.value="",n.value=!1;try{const g=await f.assetUrlFor(u);if(!r||d!==o||e.fs!==f||e.path!==u){(p=f.revokeAssetUrl)==null||p.call(f,u);return}t.value=g}catch{r&&d===o&&e.fs===f&&e.path===u&&(n.value=!0)}}ft(()=>[e.path,e.fs.identity],()=>{h()},{immediate:!0}),qt(()=>{r=!1,o++,a()});function c(f){const u=f.currentTarget;!t.value||!u||u.dataset.assetRequest!==String(i.value)||(a(),n.value=!0)}return(f,u)=>n.value?(O(),ke(ji,{key:0,fs:f.fs,path:f.path},null,8,["fs","path"])):(O(),V("div",h1,[f.kind==="video"?(O(),V("video",{key:i.value,"data-asset-request":i.value,src:t.value,controls:"",preload:"metadata",onError:c},null,40,c1)):(O(),V("audio",{key:i.value,"data-asset-request":i.value,src:t.value,controls:"",preload:"metadata",onError:c},null,40,f1))]))}}),d1=rt(u1,[["__scopeId","data-v-71c6a6ef"]]),p1={key:1,class:"pdf-host"},g1=["data"],m1=Qe({__name:"PdfPreview",props:{fs:{},path:{}},setup(s){const e=s,t=j(""),i=j(!1);let n=!0,r=0,o=null;function l(){var h,c;o&&((c=(h=o.fs).revokeAssetUrl)==null||c.call(h,o.path),o=null)}async function a(){var u;const h=e.fs,c=e.path,f=++r;l(),o={fs:h,path:c},t.value="",i.value=!1;try{const d=await h.assetUrlFor(c);if(!n||f!==r||e.fs!==h||e.path!==c){(u=h.revokeAssetUrl)==null||u.call(h,c);return}t.value=d}catch{n&&f===r&&e.fs===h&&e.path===c&&(i.value=!0)}}return ft(()=>[e.path,e.fs.identity],()=>{a()},{immediate:!0}),qt(()=>{n=!1,r++,l()}),(h,c)=>i.value?(O(),ke(ji,{key:0,fs:h.fs,path:h.path},null,8,["fs","path"])):(O(),V("div",p1,[J("object",{data:t.value,type:"application/pdf"},[vi(ji,{fs:h.fs,path:h.path},null,8,["fs","path"])],8,g1)]))}}),y1=rt(m1,[["__scopeId","data-v-160ee5d7"]]),v1=["innerHTML"],b1={key:2,class:"md-host placeholder"},Ca=2*1024*1024,w1=Qe({__name:"MarkdownPreview",props:{fs:{},path:{},theme:{}},setup(s){const e=s,t=La(),i=j(""),n=j("loading");let r=!1,o=0;function l(f,u,d){return!r&&o===d&&e.fs===f&&e.path===u}function a(f){let u;if(typeof f=="string"){const d=atob(f);u=new Uint8Array(d.length);for(let p=0;pCa){n.value="error";return}const g=await f.readFile(u,Ca);if(!l(f,u,d))return;const y=a(g.data),b=(await le(async()=>{const{default:D}=await import("./index-D8AWWFft.js");return{default:D}},[])).default,T=new b({html:!1,linkify:!0,breaks:!1}).render(y);if(!l(f,u,d))return;i.value=T,n.value="ok"}catch{if(!l(f,u,d))return;n.value="error"}}}function c(f){const u=f.target;if(!u)return;const d=u.closest("a");if(!d)return;const p=d.getAttribute("href")??"";f.preventDefault(),/^(https?|mailto):/i.test(p)&&t.system.openExternalURL(p)}return En(()=>{r=!1,h()}),ft(()=>[e.path,e.fs],()=>{h()}),qt(()=>{r=!0,o++}),(f,u)=>n.value==="error"?(O(),ke(ji,{key:0,fs:f.fs,path:f.path},null,8,["fs","path"])):n.value==="ok"?(O(),V("div",{key:1,class:Gi(["md-host",f.theme]),innerHTML:i.value,onClick:c},null,10,v1)):(O(),V("div",b1,"…"))}}),x1=rt(w1,[["__scopeId","data-v-b84f1c1b"]]),k1={class:"file-editor-host"},S1={key:0,class:"banner err"},C1={key:7,class:"banner muted","data-test":"kind-pending"},A1=Qe({__name:"FileEditor",props:{fs:{},path:{},showLineNumbers:{type:Boolean},theme:{},viewMode:{}},emits:["dirty-change"],setup(s,{expose:e,emit:t}){const i=s,n=t,r=j(null);async function o(){var p,g;return((g=(p=r.value)==null?void 0:p.save)==null?void 0:g.call(p))??Promise.resolve(!1)}e({save:o});const{t:l}=Ji(),a=j(null),h=j("");let c=!1,f=0;function u(p,g,y){return!c&&f===y&&i.fs===p&&i.path===g}async function d(){const p=i.fs,g=i.path,y=++f;a.value=null,h.value="";try{const b=await p.fileMeta(g);if(!u(p,g,y))return;a.value=cd(g,b.isBinary)}catch(b){if(!u(p,g,y))return;h.value=(b==null?void 0:b.message)||String(b)||l("plugins.fileExplorer.unknownError")}}return ft(()=>[i.path,i.fs],()=>{d()},{immediate:!0}),qt(()=>{c=!0,f++}),(p,g)=>(O(),V("div",k1,[h.value?(O(),V("div",S1,Q(q(l)("plugins.fileExplorer.errorPrefix",{message:h.value})),1)):a.value==="code"||(a.value==="svg"||a.value==="markdown")&&p.viewMode==="code"?(O(),ke(i1,{key:1,ref_key:"codeEditorRef",ref:r,fs:p.fs,path:p.path,"show-line-numbers":p.showLineNumbers,theme:p.theme,onDirtyChange:g[0]||(g[0]=y=>n("dirty-change",y))},null,8,["fs","path","show-line-numbers","theme"])):a.value==="image"||a.value==="svg"&&p.viewMode==="render"?(O(),ke(a1,{key:2,fs:p.fs,path:p.path,theme:p.theme},null,8,["fs","path","theme"])):a.value==="markdown"&&p.viewMode==="render"?(O(),ke(x1,{key:3,fs:p.fs,path:p.path,theme:p.theme},null,8,["fs","path","theme"])):a.value==="video"||a.value==="audio"?(O(),ke(d1,{key:4,fs:p.fs,path:p.path,kind:a.value},null,8,["fs","path","kind"])):a.value==="pdf"?(O(),ke(y1,{key:5,fs:p.fs,path:p.path},null,8,["fs","path"])):a.value==="binary-unknown"?(O(),ke(ji,{key:6,fs:p.fs,path:p.path},null,8,["fs","path"])):(O(),V("div",C1,Q(q(l)("common.loading")),1))]))}}),M1=rt(A1,[["__scopeId","data-v-db7692c8"]]);function Aa(s){return/\.(md|markdown)$/i.test(s)?"render":"code"}const T1=8;function kr(s,e,t){const i=Date.now(),n=s.tabs.findIndex(o=>o.path===e);if(n>=0){const o=yi(s);return o.tabs[n].lastActiveAt=i,t==="persistent"&&(o.tabs[n].persistent=!0),o.activeIdx=n,o}if(t==="preview"){const o=s.tabs.findIndex(l=>!l.persistent);if(o>=0){const l=yi(s);return l.tabs[o]={path:e,persistent:!1,lastActiveAt:i,viewMode:Aa(e),dirty:!1},l.activeIdx=o,l}}let r=yi(s);return r.tabs.push({path:e,persistent:t==="persistent",lastActiveAt:i,viewMode:Aa(e),dirty:!1}),r.activeIdx=r.tabs.length-1,r.tabs.length>T1&&(r=E1(r)),r}function D1(s,e){if(e<0||e>=s.tabs.length)return s;const t=yi(s);return t.tabs.splice(e,1),t.tabs.length===0?(t.activeIdx=-1,t):(t.activeIdx=Math.min(e,t.tabs.length-1),t)}function E1(s){const e=s.activeIdx>=0?s.tabs[s.activeIdx].path:null,t=a=>!a.persistent&&a.path!==e,i=s.tabs.filter(t),n=i.length>0?i:s.tabs;let r=n[0];for(const a of n)a.lastActiveAtr.path===e);if(i<0||s.tabs[i].dirty===t)return s;const n=yi(s);return n.tabs[i].dirty=t,n}function yi(s){return{tabs:s.tabs.map(e=>({...e})),activeIdx:s.activeIdx}}function B1(s,e){return{identity:"local",listDir:t=>s.fs.listDir(t),watchDir:t=>s.fs.watchDir(t),unwatchDir:async t=>{if(typeof t!="number")throw new Error("local filesystem watch ID must be a number");await s.fs.unwatchDir(t)},readFile:(t,i)=>s.fs.readFile(t,i),fileMeta:t=>s.fs.fileMeta(t),openExternal:t=>s.fs.openExternal(t),assetUrlFor:t=>Promise.resolve(s.fs.assetUrlFor(t)),onDirChanged:t=>(e==null?void 0:e.on("plugin-fs:dir-changed",i=>{typeof i=="string"&&t(i)}))??(()=>{}),dispose:()=>{},writeFile:(t,i,n)=>s.fs.writeFile(t,Array.from(i),n??0,n===null),createFile:t=>s.fs.createFile(t),rename:(t,i)=>s.fs.rename(t,i),remove:(t,i)=>s.fs.remove(t,i),mkdir:t=>s.fs.mkdir(t),trash:t=>s.fs.trash(t)}}const R1=2*1024*1024,P1=256*1024,Ma=50*1024*1024,Ta="application/octet-stream";function et(s){if(!s.ok)throw new Error(s.error||"remote filesystem request failed");return s}function Cf(s){try{const e=atob(s),t=new Uint8Array(e.length);for(let i=0;iMa)throw new Error("remote asset exceeds the 50 MiB size limit");const X=_1(R);if(I+X.byteLength>Ma)throw new Error("remote asset exceeds the 50 MiB size limit");if(G&&(N=R.contentType||Ta,G=!1),$.push(F1(X)),I+=X.byteLength,R.eof)break;if(X.byteLength===0)throw new Error("remote filesystem response returned an empty non-final chunk")}return URL.createObjectURL(new Blob($,{type:N}))}function A(M){if(l)return Promise.reject(new Error("remote filesystem bridge is disposed"));const $=t.get(M);if($)return Promise.resolve($);const N=n.get(M)??0,I=i.get(M);if((I==null?void 0:I.generation)===N)return I.promise;const G=D(M).then(R=>{if(l)throw URL.revokeObjectURL(R),new Error("remote filesystem bridge is disposed");if((n.get(M)??0)!==N)throw URL.revokeObjectURL(R),new Error("remote filesystem asset request was invalidated");return t.set(M,R),R});i.set(M,{generation:N,promise:G});const L=()=>{var R;((R=i.get(M))==null?void 0:R.promise)===G&&i.delete(M)};return G.then(L,L),G}function P(M){n.set(M,(n.get(M)??0)+1);const $=t.get(M);$&&(URL.revokeObjectURL($),t.delete(M))}function C(M){if(l)return()=>{};const $={handler:M};return r.add($),o||(o=s.onFSEvent(N=>{if(!(l||N.event!=="changed"||!N.path))for(const{handler:I}of Array.from(r))try{I(N.path)}catch(G){it("file-explorer","dir-changed subscriber threw",{path:N.path,error:Se(G)})}})),()=>{r.delete($),r.size===0&&o&&(o(),o=null)}}function U(){if(!l){l=!0;for(const M of t.values())URL.revokeObjectURL(M);t.clear(),i.clear(),n.clear(),r.clear(),o&&(o(),o=null)}}return{identity:e,listDir:a,watchDir:h,unwatchDir:c,readFile:f,fileMeta:u,openExternal:d,assetUrlFor:A,onDirChanged:C,revokeAssetUrl:P,dispose:U,writeFile:p,createFile:g,rename:y,remove:b,mkdir:x,trash:T}}function _1(s){if(typeof s.data!="string")throw new Error("remote filesystem response chunk missing data");if(!Number.isSafeInteger(s.length)||s.length<0)throw new Error("remote filesystem response chunk has invalid length");const e=Cf(s.data);if(s.length!==e.byteLength)throw new Error("remote filesystem response chunk length does not match data");return e}function F1(s){const e=new Uint8Array(s.byteLength);return e.set(s),e.buffer}const W1=2*1024*1024,H1="/",V1="already_exists",$1="no platform trash command available",z1=200;function Da(s){return _s("plugins.fileExplorer.sshNoRecursiveDelete",{path:s})}function Ea(s){return Promise.reject(new Error(_s(`plugins.fileExplorer.${s}`)))}function rs(s,e){const t=Se(e);return t.includes(V1)?new Error(_s("plugins.fileExplorer.sshUploadExists",{path:s})):new Error(t)}function q1(s){let e=!1;function t(){if(e)throw new Error(_s("plugins.fileExplorer.sshBridgeDisposed"))}async function i(d){t();const p=await Jf(s,d);return{entries:p.entries??[],truncated:!!p.truncated,total:p.total??(p.entries??[]).length}}async function n(d){return(await i(d)).entries}async function r(d){return t(),await Gf(s,d)}async function o(d,p=W1){return t(),await jf(s,d,p)}async function l(d,p,g){t();try{return await Kf(s,d,p,g??0,g===null)}catch(y){throw rs(d,y)}}async function a(d){t();try{return await Uf(s,d)}catch(p){throw rs(d,p)}}async function h(d){t();try{return await qf(s,d)}catch(p){throw rs(d,p)}}async function c(d,p){t();try{return await zf(s,d,p)}catch(g){throw rs(p,g)}}async function f(d,p){if(t(),p)throw new Error(Da(d));await $f(s,d,!1)}function u(){if(!e){e=!0;try{Vf(s).catch(d=>{it("file-explorer","releasing the ssh file source failed",{hostID:s,error:Se(d)})})}catch(d){it("file-explorer","releasing the ssh file source failed",{hostID:s,error:Se(d)})}}}return{identity:`ssh:${s}`,searchMaxDirs:z1,dirRemovalRefusal:Da,listDir:n,listDirDetailed:i,fileMeta:r,readFile:o,writeFile:l,createFile:a,mkdir:h,rename:c,remove:f,watchDir:()=>Promise.resolve(`ssh:${s}`),unwatchDir:()=>Promise.resolve(),onDirChanged:()=>()=>{},openExternal:()=>Ea("sshNoOpenExternal"),assetUrlFor:()=>Ea("sshNoInlineAsset"),trash:()=>Promise.reject(new Error($1)),dispose:u}}const U1={class:"file-explorer"},K1={class:"fe-header"},j1=["title"],G1=["disabled","title"],J1=["title"],Y1={key:0,class:"source-picker"},X1=["aria-label"],Q1={value:""},Z1=["value"],ev={class:"tree-search"},tv=["placeholder","aria-label"],iv={class:"tree-scroll"},nv={key:1,class:"placeholder"},sv={class:"editor-pane"},rv={class:"editor-area"},ov={key:1,class:"placeholder"},lv=Qe({__name:"FileExplorer",props:{context:{}},setup(s){const e=s,t=La(),i=Yf(),{t:n}=Ji(),r=j(null),o=me(()=>{var B;return((B=i.cfg)==null?void 0:B.fileExplorer.innerTreeRatio)??.3}),l=j(null),a=me(()=>l.value??o.value),h=j(null),{onMouseDown:c}=eu({onDrag:B=>{if(!h.value)return;const K=h.value.clientWidth;if(K<=0)return;const te=l.value??o.value,ge=Math.max(.15,Math.min(te-B/K,.5));l.value=ge},onEnd:()=>{if(l.value===null||!i.cfg){l.value=null;return}const B=JSON.parse(JSON.stringify(i.cfg));B.fileExplorer.innerTreeRatio=l.value,i.save(B),l.value=null}}),f=j([]),u=j("");async function d(){if(t.pluginHost)try{f.value=await tu()??[]}catch(B){it("file-explorer","ssh sources unavailable",{error:Se(B)}),f.value=[]}}d();function p(B){return B.alias||`${B.user}@${B.host}`}const g=me(()=>{if(u.value)return{identity:`ssh:${u.value}`,connection:null,sshHostID:u.value};if(!e.context.activeIsRemote.value)return{identity:t.pluginHost?"local":null,connection:null,sshHostID:""};const B=e.context.activeSessionId.value,K=e.context.activeSessionConnection.value;return{identity:B&&K?`remote:${B}`:null,connection:K,sshHostID:""}}),y=j({});ft(()=>[e.context.activeCwd.value,g.value.identity,g.value.sshHostID],([B,K,te])=>{B&&K&&!te&&(y.value={...y.value,[K]:B})},{immediate:!0});const b=me(()=>{if(g.value.sshHostID)return H1;if(r.value)return r.value;const B=e.context.activeCwd.value;if(B)return B;const K=g.value.identity;return K?y.value[K]??null:null}),x=j({tabs:[],activeIdx:-1}),T=Nf(null),D=j(0),A=j("");ft(()=>[g.value.identity,g.value.connection,g.value.sshHostID],async([B,K,te])=>{var kt;const ge=te?q1(te):B==="local"?t.pluginHost?B1(t.pluginHost,t.events):null:B&&K?N1(K,B):null,ve=T.value,xt=(ve==null?void 0:ve.identity)!==(ge==null?void 0:ge.identity);T.value=ge,D.value++,xt&&(r.value=null,x.value={tabs:[],activeIdx:-1},A.value=""),await us(),(kt=ve==null?void 0:ve.dispose)==null||kt.call(ve)},{immediate:!0}),qt(()=>{var B,K;(K=(B=T.value)==null?void 0:B.dispose)==null||K.call(B),T.value=null});const P=Xf(),C=j(null),U=j(null),M=j(!1),$=me(()=>{var B;return((B=C.value)==null?void 0:B.selectedDir)??b.value});function N(){var B;(B=U.value)==null||B.click()}async function I(B){var xt,kt,en;const K=B.target,te=((xt=K.files)==null?void 0:xt[0])??null;K.value="";const ge=T.value,ve=$.value;if(!(!te||!ge||!ve)){M.value=!0;try{const It=new Uint8Array(await te.arrayBuffer()),Wn=ve.endsWith("/")?ve+te.name:`${ve}/${te.name}`;await ge.writeFile(Wn,It,null),e.context.showToast(n("plugins.fileExplorer.sshUploadDone",{name:te.name,dir:ve})),(en=(kt=C.value)==null?void 0:kt.refreshDir)==null||en.call(kt,ve)}catch(It){e.context.showToast(Se(It)),it("file-explorer","ssh upload failed",{error:Se(It)})}finally{M.value=!1}}}ft(()=>P.pending,async B=>{var te;if(!B||!T.value)return;await us(),(await((te=C.value)==null?void 0:te.revealPath(B))??!1)&&(x.value=kr(x.value,B,"preview")),P.consume()},{immediate:!0});function G(B){x.value=kr(x.value,B,"preview")}function L(B){x.value=kr(x.value,B,"persistent")}function R(B){x.value={...x.value,activeIdx:B}}function Z(B){x.value=D1(x.value,B)}const X=j(null),ue=j(null);function Me(B){const K=Le.value;K&&(x.value=L1(x.value,K,B))}async function ot(B){const K=x.value.tabs[B];if(!(K!=null&&K.dirty)){Z(B);return}X.value={idx:B,name:K.path.split("/").pop()??K.path,buttons:[{id:"save",label:n("plugins.fileExplorer.save"),kind:"primary"},{id:"dontSave",label:n("plugins.fileExplorer.dontSave"),kind:"danger"},{id:"cancel",label:n("plugins.fileExplorer.cancel"),kind:"secondary"}]}}async function de(B){var ge,ve;const K=X.value;if(X.value=null,!K||B==="cancel")return;if(B==="dontSave"){Z(K.idx);return}(await((ve=(ge=ue.value)==null?void 0:ge.save)==null?void 0:ve.call(ge))??!1)&&Z(K.idx)}function Te(){r.value=r.value===null?e.context.activeCwd.value:null}const De=me(()=>{const B=x.value.activeIdx;return B>=0?x.value.tabs[B].viewMode:"code"});function Fe(){x.value=O1(x.value,De.value==="code"?"render":"code")}const Le=me(()=>x.value.activeIdx>=0?x.value.tabs[x.value.activeIdx].path:null),je=me(()=>{var B;return((B=i.cfg)==null?void 0:B.fileExplorer.showHidden)??!1}),$e=me(()=>{var B;return((B=i.cfg)==null?void 0:B.fileExplorer.showLineNumbers)??!1});async function Fn(B,K){if(!i.cfg)return;const te=JSON.parse(JSON.stringify(i.cfg));te.fileExplorer[B]=K;try{await i.save(te)}catch(ge){it("file-explorer","saving view option failed",{error:Se(ge)})}}const ci=me(()=>Qf(e.context.terminalThemeId.value)?"light":"dimmed");return(B,K)=>(O(),V("div",U1,[J("div",{class:"fe-body",ref_key:"bodyRef",ref:h},[J("div",{class:"tree-pane",style:mn({width:a.value*100+"%"})},[J("header",K1,[J("span",{class:"root-path",title:b.value??""},Q(b.value??q(n)("plugins.fileExplorer.noActivePaneShort")),9,j1),g.value.sshHostID?(O(),V("button",{key:0,class:"pin","data-test":"ssh-upload",disabled:M.value||!$.value,title:q(n)("plugins.fileExplorer.sshUpload",{dir:$.value??""}),onClick:N},[vi(q(Zf),{size:14,"stroke-width":1.5})],8,G1)):(O(),V("button",{key:1,class:Gi(["pin",{pinned:r.value!==null}]),title:r.value!==null?q(n)("plugins.fileExplorer.unpinFollow"):q(n)("plugins.fileExplorer.pinCurrentCwd"),onClick:Te},[(O(),ke(hn(r.value!==null?q(ou):q(ru)),{size:14,"stroke-width":1.5}))],10,J1))]),f.value.length>0?(O(),V("div",Y1,[ds(J("select",{"onUpdate:modelValue":K[0]||(K[0]=te=>u.value=te),"data-test":"fs-source","aria-label":q(n)("plugins.fileExplorer.sourceLabel")},[J("option",Q1,Q(q(n)("plugins.fileExplorer.sourceActivePane")),1),(O(!0),V(Xt,null,mi(f.value,te=>(O(),V("option",{key:te.id,value:te.id},Q(p(te)),9,Z1))),128))],8,X1),[[_f,u.value]])])):Ie("",!0),J("input",{ref_key:"uploadInput",ref:U,class:"upload-input","data-test":"ssh-upload-input",type:"file",onChange:I},null,544),J("div",ev,[ds(J("input",{"onUpdate:modelValue":K[1]||(K[1]=te=>A.value=te),"data-test":"file-name-search",type:"search",placeholder:q(n)("plugins.fileExplorer.searchFiles"),"aria-label":q(n)("plugins.fileExplorer.searchFiles")},null,8,tv),[[Oa,A.value]])]),J("div",iv,[b.value&&T.value?(O(),ke(Yu,{ref_key:"fileTreeRef",ref:C,key:D.value,fs:T.value,root:b.value,"show-hidden":je.value,"show-line-numbers":$e.value,"search-query":A.value,context:B.context,onFileClicked:G,onFileDoubleClicked:L,onToggleShowHidden:K[2]||(K[2]=te=>Fn("showHidden",te)),onToggleShowLineNumbers:K[3]||(K[3]=te=>Fn("showLineNumbers",te))},null,8,["fs","root","show-hidden","show-line-numbers","search-query","context"])):(O(),V("div",nv,Q(q(n)("plugins.fileExplorer.noActivePane")),1))])],4),J("div",{class:"divider",onMousedown:K[4]||(K[4]=(...te)=>q(c)&&q(c)(...te))},null,32),J("div",sv,[vi(sd,{tabs:x.value.tabs,"active-idx":x.value.activeIdx,"view-mode":De.value,onSelect:R,onCloseRequest:ot,onToggleViewMode:Fe},null,8,["tabs","active-idx","view-mode"]),J("div",rv,[Le.value&&T.value?(O(),ke(M1,{ref_key:"codeEditorRef",ref:ue,key:D.value,fs:T.value,path:Le.value,"show-line-numbers":$e.value,theme:ci.value,"view-mode":De.value,onDirtyChange:Me},null,8,["fs","path","show-line-numbers","theme","view-mode"])):(O(),V("div",ov,Q(q(n)("plugins.fileExplorer.selectFile")),1))])])],512),X.value?(O(),ke(Pa,{key:0,title:q(n)("plugins.fileExplorer.confirmCloseTitle",{name:X.value.name}),buttons:X.value.buttons,onResolve:de},null,8,["title","buttons"])):Ie("",!0)]))}}),av=rt(lv,[["__scopeId","data-v-098631c4"]]),gv=Object.freeze(Object.defineProperty({__proto__:null,default:av},Symbol.toStringTag,{value:"Module"}));export{ai as A,Us as B,Qr as C,re as D,S as E,F,Zt as G,dv as H,he as I,em as J,ac as K,Es as L,nt as M,ee as N,_e as O,Si as P,v as Q,bi as R,oe as S,lt as T,Yi as W,Ng as a,se as b,H as c,gv as d,qe as e,Po as f,am as g,Eo as h,Ke as i,uv as j,rc as k,On as l,vt as m,ne as n,Ae as o,ce as p,Ec as q,vm as r,Ws as s,Ro as t,mm as u,ym as v,xm as w,yc as x,mc as y,Io as z}; +`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Ly(this):new Dy(this)}getCursor(e,t=0,i){let n=e.doc?e:se.create({doc:e});return i==null&&(i=n.doc.length),this.regexp?Li(this,n,t,i):Oi(this,n,t,i)}}class bf{constructor(e){this.spec=e}}function My(s,e,t){return(i,n,r,o)=>{if(t&&!t(i,n,r,o))return!1;let l=i>=o&&n<=o+r.length?r.slice(i-o,n-o):e.doc.sliceString(i,n);return s(l,e,i,n)}}function Oi(s,e,t,i){let n;return s.wholeWord&&(n=Ty(e.doc,e.charCategorizer(e.selection.main.head))),s.test&&(n=My(s.test,e,n)),new Tn(e.doc,s.unquoted,t,i,s.caseSensitive?void 0:r=>r.toLowerCase(),n)}function Ty(s,e){return(t,i,n,r)=>((r>t||r+n.length=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let r=Oi(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}function Ey(s,e,t){return(i,n,r)=>(!t||t(i,n,r))&&s(r[0],e,i,n)}function Li(s,e,t,i){let n;return s.wholeWord&&(n=Oy(e.charCategorizer(e.selection.main.head))),s.test&&(n=Ey(s.test,e,n)),new mf(e.doc,s.search,{ignoreCase:!s.caseSensitive,test:n},t,i)}function Rs(s,e){return s.slice(Oe(s,e,!1),e)}function Ps(s,e){return s.slice(e,Oe(s,e))}function Oy(s){return(e,t,i)=>!i[0].length||(s(Rs(i.input,i.index))!=Ne.Word||s(Ps(i.input,i.index))!=Ne.Word)&&(s(Ps(i.input,i.index+i[0].length))!=Ne.Word||s(Rs(i.input,i.index+i[0].length))!=Ne.Word)}class Ly extends bf{nextMatch(e,t,i){let n=Li(this.spec,e,i,e.doc.length).next();return n.done&&(n=Li(this.spec,e,0,t).next()),n.done?null:n.value}prevMatchInRange(e,t,i){for(let n=1;;n++){let r=Math.max(t,i-n*1e4),o=Li(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let n=i.length;n>0;n--){let r=+i.slice(0,n);if(r>0&&r=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let r=Li(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}const Dn=oe.define(),Go=oe.define(),ei=vt.define({create(s){return new xr(uo(s).create(),null)},update(s,e){for(let t of e.effects)t.is(Dn)?s=new xr(t.value.create(),s.panel):t.is(Go)&&(s=new xr(s.query,t.value?Jo:null));return s},provide:s=>Ms.from(s,e=>e.panel)});class xr{constructor(e,t){this.query=e,this.panel=t}}const By=re.mark({class:"cm-searchMatch"}),Ry=re.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Py=st.fromClass(class{constructor(s){this.view=s,this.decorations=this.highlight(s.state.field(ei))}update(s){let e=s.state.field(ei);(e!=s.startState.field(ei)||s.docChanged||s.selectionSet||s.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:s,panel:e}){if(!e||!s.spec.valid)return re.none;let{view:t}=this,i=new ti;for(let n=0,r=t.visibleRanges,o=r.length;nr[n+1].from-2*250;)a=r[++n].to;s.highlight(t.state,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?Ry:By)})}return i.finish()}},{decorations:s=>s.decorations});function _n(s){return e=>{let t=e.state.field(ei,!1);return t&&t.query.spec.valid?s(e,t):kf(e)}}const Is=_n((s,{query:e})=>{let{to:t}=s.state.selection.main,i=e.nextMatch(s.state,t,t);if(!i)return!1;let n=S.single(i.from,i.to),r=s.state.facet(Ti);return s.dispatch({selection:n,effects:[Yo(s,i),r.scrollToMatch(n.main,s)],userEvent:"select.search"}),xf(s),!0}),Ns=_n((s,{query:e})=>{let{state:t}=s,{from:i}=t.selection.main,n=e.prevMatch(t,i,i);if(!n)return!1;let r=S.single(n.from,n.to),o=s.state.facet(Ti);return s.dispatch({selection:r,effects:[Yo(s,n),o.scrollToMatch(r.main,s)],userEvent:"select.search"}),xf(s),!0}),Iy=_n((s,{query:e})=>{let t=e.matchAll(s.state,1e3);return!t||!t.length?!1:(s.dispatch({selection:S.create(t.map(i=>S.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),Ny=({state:s,dispatch:e})=>{let t=s.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:n}=t.main,r=[],o=0;for(let l=new Tn(s.doc,s.sliceDoc(i,n));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(S.range(l.value.from,l.value.to))}return e(s.update({selection:S.create(r,o),userEvent:"select.search.matches"})),!0},ka=_n((s,{query:e})=>{let{state:t}=s,{from:i,to:n}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,i,i);if(!r)return!1;let o=r,l=[],a,h,c=[];o.precise?o.from==i&&o.to==n&&(h=t.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:h}),o=e.nextMatch(t,o.from,o.to),c.push(H.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))):o=e.nextMatch(t,o.from,o.to);let f=s.state.changes(l);return o&&(a=S.single(o.from,o.to).map(f),c.push(Yo(s,o)),c.push(t.facet(Ti).scrollToMatch(a.main,s))),s.dispatch({changes:f,selection:a,effects:c,userEvent:"input.replace"}),!0}),_y=_n((s,{query:e})=>{if(s.state.readOnly)return!1;let t=[];for(let n of e.matchAll(s.state,1e9)){let{from:r,to:o,precise:l}=n;l&&t.push({from:r,to:o,insert:e.getReplacement(n)})}if(!t.length)return!1;let i=s.state.phrase("replaced $ matches",t.length)+".";return s.dispatch({changes:t,effects:H.announce.of(i),userEvent:"input.replace.all"}),!0});function Jo(s){return s.state.facet(Ti).createPanel(s)}function uo(s,e){var t,i,n,r,o;let l=s.selection.main,a=l.empty||l.to>l.from+100?"":s.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=s.facet(Ti);return new vf({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(n=e==null?void 0:e.literal)!==null&&n!==void 0?n:h.literal,regexp:(r=e==null?void 0:e.regexp)!==null&&r!==void 0?r:h.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function wf(s){let e=Yh(s,Jo);return e&&e.dom.querySelector("[main-field]")}function xf(s){let e=wf(s);e&&e==s.root.activeElement&&e.select()}const kf=s=>{let e=s.state.field(ei,!1);if(e&&e.panel){let t=wf(s);if(t&&t!=s.root.activeElement){let i=uo(s.state,e.query.spec);i.valid&&s.dispatch({effects:Dn.of(i)}),t.focus(),t.select()}}else s.dispatch({effects:[Go.of(!0),e?Dn.of(uo(s.state,e.query.spec)):oe.appendConfig.of(po)]});return!0},Sf=s=>{let e=s.state.field(ei,!1);if(!e||!e.panel)return!1;let t=Yh(s,Jo);return t&&t.dom.contains(s.root.activeElement)&&s.focus(),s.dispatch({effects:Go.of(!1)}),!0},Fy=[{key:"Mod-f",run:kf,scope:"editor search-panel"},{key:"F3",run:Is,shift:Ns,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Is,shift:Ns,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Sf,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Ny},{key:"Mod-Alt-g",run:xy},{key:"Mod-d",run:Cy,preventDefault:!0}];class Wy{constructor(e){this.view=e;let t=this.query=e.state.field(ei).query.spec;this.commit=this.commit.bind(this),this.searchField=Ee("input",{value:t.search,placeholder:Ze(e,"Find"),"aria-label":Ze(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ee("input",{value:t.replace,placeholder:Ze(e,"Replace"),"aria-label":Ze(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ee("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Ee("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Ee("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(n,r,o){return Ee("button",{class:"cm-button",name:n,onclick:r,type:"button"},o)}this.dom=Ee("div",{onkeydown:n=>this.keydown(n),class:"cm-search"},[this.searchField,i("next",()=>Is(e),[Ze(e,"next")]),i("prev",()=>Ns(e),[Ze(e,"previous")]),i("select",()=>Iy(e),[Ze(e,"all")]),Ee("label",null,[this.caseField,Ze(e,"match case")]),Ee("label",null,[this.reField,Ze(e,"regexp")]),Ee("label",null,[this.wordField,Ze(e,"by word")]),...e.state.readOnly?[]:[Ee("br"),this.replaceField,i("replace",()=>ka(e),[Ze(e,"replace")]),i("replaceAll",()=>_y(e),[Ze(e,"replace all")])],Ee("button",{name:"close",onclick:()=>Sf(e),"aria-label":Ze(e,"close"),type:"button"},["×"])])}commit(){let e=new vf({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Dn.of(e)}))}keydown(e){xg(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Ns:Is)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),ka(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(Dn)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Ti).top}}function Ze(s,e){return s.state.phrase(e)}const ns=30,ss=/[\s\.,:;?!]/;function Yo(s,{from:e,to:t}){let i=s.state.doc.lineAt(e),n=s.state.doc.lineAt(t).to,r=Math.max(i.from,e-ns),o=Math.min(n,t+ns),l=s.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;al.length-ns;a--)if(!ss.test(l[a-1])&&ss.test(l[a])){l=l.slice(0,a);break}}return H.announce.of(`${s.state.phrase("current match")}. ${l} ${s.state.phrase("on line")} ${i.number}.`)}const Hy=H.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),po=[ei,On.low(Py),Hy];function Vy(s){const e=s.lastIndexOf("/");return e>=0?s.slice(e+1):s}async function dt(s,e){const[{StreamLanguage:t},i]=await Promise.all([le(()=>Promise.resolve().then(()=>r0),void 0),s]),n=i[e];return t.define(n)}async function $y(s){const e=Vy(s);switch(e){case"Dockerfile":return dt(le(()=>import("./dockerfile-ZL4hHokT.js"),[]),"dockerFile");case"Gemfile":case"Rakefile":return dt(le(()=>import("./ruby-B2Rjki9n.js"),[]),"ruby");case"Makefile":case"GNUmakefile":return dt(le(()=>import("./clike-B9uivgTg.js"),[]),"c")}const t=/\.([A-Za-z0-9]+)$/.exec(e),i=t?t[1].toLowerCase():null;if(!i)return null;switch(i){case"js":case"jsx":case"ts":case"tsx":{const{javascript:n}=await le(async()=>{const{javascript:r}=await import("./index-Ck_fIti9.js");return{javascript:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));return n({typescript:i==="ts"||i==="tsx",jsx:i==="jsx"||i==="tsx"})}case"json":{const{json:n}=await le(async()=>{const{json:r}=await import("./index-C1t4FMl1.js");return{json:r}},__vite__mapDeps([10,1,3,4,5,6,7,8,9]));return n()}case"md":case"markdown":{const{markdown:n}=await le(async()=>{const{markdown:r}=await import("./index-B6JsQQbt.js");return{markdown:r}},__vite__mapDeps([11,2,12,1,13,3,4,5,6,7,8,9,0]));return n()}case"css":case"scss":{const{css:n}=await le(async()=>{const{css:r}=await import("./index-8SnOqa2v.js");return{css:r}},__vite__mapDeps([13,1,3,4,5,6,7,8,9]));return n()}case"html":case"htm":{const{html:n}=await le(async()=>{const{html:r}=await import("./index-DlIw5VzR.js");return{html:r}},__vite__mapDeps([12,1,13,3,4,5,6,7,8,9,0,2]));return n()}case"py":{const{python:n}=await le(async()=>{const{python:r}=await import("./index-ChT88caY.js");return{python:r}},__vite__mapDeps([14,1,2,3,4,5,6,7,8,9]));return n()}case"go":{const{go:n}=await le(async()=>{const{go:r}=await import("./index-CehbsLvs.js");return{go:r}},__vite__mapDeps([15,1,2,3,4,5,6,7,8,9]));return n()}case"rs":{const{rust:n}=await le(async()=>{const{rust:r}=await import("./index-_4Qee-Ew.js");return{rust:r}},__vite__mapDeps([16,1,3,4,5,6,7,8,9]));return n()}case"c":case"cc":case"cpp":case"cxx":case"h":case"hpp":case"hh":case"m":case"mm":{const{cpp:n}=await le(async()=>{const{cpp:r}=await import("./index-DoVrcQoW.js");return{cpp:r}},__vite__mapDeps([17,1,3,4,5,6,7,8,9]));return n()}case"java":{const{java:n}=await le(async()=>{const{java:r}=await import("./index-CKUfNIJP.js");return{java:r}},__vite__mapDeps([18,1,3,4,5,6,7,8,9]));return n()}case"php":{const{php:n}=await le(async()=>{const{php:r}=await import("./index-DPMPlQhe.js");return{php:r}},__vite__mapDeps([19,1,12,13,3,4,5,6,7,8,9,0,2]));return n()}case"sql":{const{sql:n}=await le(async()=>{const{sql:r}=await import("./index-C7tiEnPN.js");return{sql:r}},__vite__mapDeps([20,1,2,3,4,5,6,7,8,9]));return n()}case"xml":case"xsd":case"xsl":case"plist":case"svg":{const{xml:n}=await le(async()=>{const{xml:r}=await import("./index-BSbI304G.js");return{xml:r}},__vite__mapDeps([21,1,3,4,5,6,7,8,9]));return n()}case"yml":case"yaml":{const{yaml:n}=await le(async()=>{const{yaml:r}=await import("./index-DmukWKLV.js");return{yaml:r}},__vite__mapDeps([22,1,3,4,5,6,7,8,9]));return n()}case"vue":{const{vue:n}=await le(async()=>{const{vue:r}=await import("./index-BBTANB6i.js");return{vue:r}},__vite__mapDeps([23,12,1,13,3,4,5,6,7,8,9,0,2]));return n()}case"sass":{const{sass:n}=await le(async()=>{const{sass:r}=await import("./index-HGllhEs0.js");return{sass:r}},__vite__mapDeps([24,1,13,3,4,5,6,7,8,9]));return n()}case"sh":case"bash":case"zsh":case"fish":case"ksh":return dt(le(()=>import("./shell-CjFT_Tl9.js"),[]),"shell");case"toml":return dt(le(()=>import("./toml-Bm5Em-hy.js"),[]),"toml");case"rb":return dt(le(()=>import("./ruby-B2Rjki9n.js"),[]),"ruby");case"lua":return dt(le(()=>import("./lua-VAEuO923.js"),[]),"lua");case"ini":case"properties":case"conf":return dt(le(()=>import("./properties-C78fOPTZ.js"),[]),"properties");case"diff":case"patch":return dt(le(()=>import("./diff-DbItnlRl.js"),[]),"diff");case"swift":return dt(le(()=>import("./swift-BzpIVaGY.js"),[]),"swift");case"kt":case"kts":case"scala":return dt(le(()=>import("./clike-B9uivgTg.js"),[]),"kotlin");default:return null}}const zy=Mi.define([{tag:v.keyword,color:"#f47067"},{tag:v.controlKeyword,color:"#f47067"},{tag:v.operatorKeyword,color:"#f47067"},{tag:v.definitionKeyword,color:"#f47067"},{tag:v.modifier,color:"#f47067"},{tag:v.string,color:"#96d0ff"},{tag:v.special(v.string),color:"#96d0ff"},{tag:v.regexp,color:"#96d0ff"},{tag:v.escape,color:"#96d0ff"},{tag:[v.comment,v.lineComment,v.blockComment,v.docComment],color:"#768390",fontStyle:"italic"},{tag:v.number,color:"#6cb6ff"},{tag:v.bool,color:"#6cb6ff"},{tag:v.atom,color:"#6cb6ff"},{tag:v.function(v.variableName),color:"#dcbdfb"},{tag:v.function(v.propertyName),color:"#dcbdfb"},{tag:v.macroName,color:"#dcbdfb"},{tag:v.variableName,color:"#adbac7"},{tag:v.propertyName,color:"#adbac7"},{tag:v.typeName,color:"#ffaf6f"},{tag:v.className,color:"#ffaf6f"},{tag:v.namespace,color:"#ffaf6f"},{tag:v.operator,color:"#f47067"},{tag:v.punctuation,color:"#adbac7"},{tag:v.bracket,color:"#adbac7"},{tag:v.derefOperator,color:"#adbac7"},{tag:v.tagName,color:"#8ddb8c"},{tag:v.attributeName,color:"#dcbdfb"},{tag:v.attributeValue,color:"#96d0ff"},{tag:v.heading,color:"#6cb6ff",fontWeight:"bold"},{tag:v.strong,fontWeight:"bold"},{tag:v.emphasis,fontStyle:"italic"},{tag:v.link,color:"#6cb6ff",textDecoration:"underline"},{tag:v.url,color:"#6cb6ff"},{tag:v.quote,color:"#768390"},{tag:v.monospace,color:"#96d0ff"},{tag:v.invalid,color:"#ff938a"},{tag:v.deleted,color:"#ff938a",backgroundColor:"rgba(244,112,103,0.15)"},{tag:v.inserted,color:"#8ddb8c",backgroundColor:"rgba(141,219,140,0.15)"}]),qy=Mi.define([{tag:v.keyword,color:"#cf222e"},{tag:v.controlKeyword,color:"#cf222e"},{tag:v.operatorKeyword,color:"#cf222e"},{tag:v.definitionKeyword,color:"#cf222e"},{tag:v.modifier,color:"#cf222e"},{tag:v.string,color:"#0a3069"},{tag:v.special(v.string),color:"#0a3069"},{tag:v.regexp,color:"#0a3069"},{tag:v.escape,color:"#0a3069"},{tag:[v.comment,v.lineComment,v.blockComment,v.docComment],color:"#6e7781",fontStyle:"italic"},{tag:v.number,color:"#0550ae"},{tag:v.bool,color:"#0550ae"},{tag:v.atom,color:"#0550ae"},{tag:v.function(v.variableName),color:"#8250df"},{tag:v.function(v.propertyName),color:"#8250df"},{tag:v.macroName,color:"#8250df"},{tag:v.variableName,color:"#24292f"},{tag:v.propertyName,color:"#24292f"},{tag:v.typeName,color:"#953800"},{tag:v.className,color:"#953800"},{tag:v.namespace,color:"#953800"},{tag:v.operator,color:"#cf222e"},{tag:v.punctuation,color:"#24292f"},{tag:v.bracket,color:"#24292f"},{tag:v.derefOperator,color:"#24292f"},{tag:v.tagName,color:"#116329"},{tag:v.attributeName,color:"#8250df"},{tag:v.attributeValue,color:"#0a3069"},{tag:v.heading,color:"#0550ae",fontWeight:"bold"},{tag:v.strong,fontWeight:"bold"},{tag:v.emphasis,fontStyle:"italic"},{tag:v.link,color:"#0969da",textDecoration:"underline"},{tag:v.url,color:"#0969da"},{tag:v.quote,color:"#6e7781"},{tag:v.monospace,color:"#0a3069"},{tag:v.invalid,color:"#82071e"},{tag:v.deleted,color:"#82071e",backgroundColor:"rgba(255,129,130,0.2)"},{tag:v.inserted,color:"#116329",backgroundColor:"rgba(74,194,107,0.2)"}]);function Uy(s){return Ac(s==="light"?qy:zy)}const Ky={class:"file-editor"},jy={key:0,class:"banner err conflict","data-test":"conflict-banner"},Gy={class:"msg"},Jy={key:1,class:"banner err","data-test":"save-error"},Yy={key:2,class:"reload-badge"},Xy={key:3,class:"banner muted"},Qy={key:4,class:"banner muted"},Zy={key:5,class:"banner err"},e1={key:6,class:"banner muted"},Sa=2*1024*1024,t1=Qe({__name:"CodeEditor",props:{fs:{},path:{},showLineNumbers:{type:Boolean},theme:{}},emits:["dirty-change"],setup(s,{expose:e,emit:t}){const{t:i}=Ji(),n=s,r=t,o=j(null),l=j("loading"),a=j(""),h=j(!1),c=j(null),f=j(!1),u=j(null),d=j("");let p=null,g=null,y=!1,b=0,x="";function T(L,R,Z,X,ue){return!y&&b===ue&&n.fs===L&&n.path===R&&n.showLineNumbers===Z&&n.theme===X}function D(L,R){return typeof window>"u"||!o.value?R:getComputedStyle(o.value).getPropertyValue(L).trim()||R}function A(L){let R;if(typeof L=="string"){const Z=atob(L);R=new Uint8Array(Z.length);for(let X=0;XSa){l.value="tooLarge",C(!1);return}const ot=await L.readFile(R,Sa);if(!T(L,R,Z,X,ue))return;const de=A(ot.data);x=de,C(!1),u.value=null,d.value="";const Te=H.updateListener.of($e=>{$e.docChanged&&C($e.state.doc.toString()!==x)}),De=Qr.of([{key:"Mod-s",preventDefault:!0,run:()=>(M(),!0)}]),Fe=[P(X),Uy(X),g0(),Ay({top:!0}),Qr.of([...by,...C0,...Fy]),De,Te];Z&&Fe.push(Ig());const Le=await $y(R);if(Le&&Fe.push(Le),!T(L,R,Z,X,ue)||!o.value)return;const je=new H({state:se.create({doc:de,extensions:Fe}),parent:o.value});if(!T(L,R,Z,X,ue)){je.destroy();return}p=je,l.value="ok"}catch(Me){if(!T(L,R,Z,X,ue))return;l.value="error",a.value=Me.message}}}async function M(){if(!p||l.value!=="ok")return!1;const L=p.state.doc.toString(),R=new TextEncoder().encode(L);d.value="";try{const Z=await n.fs.writeFile(n.path,R,c.value);return x=L,c.value=Z.modTime,h.value=!1,u.value=null,C(!1),!0}catch(Z){const X=Z.message??"",ue=/stale_modtime: current=(\d+)/.exec(X);return ue?u.value={currentModTime:Number(ue[1])}:d.value=X,!1}}async function $(){u.value&&(c.value=u.value.currentModTime,u.value=null,await M())}function N(){u.value=null,U()}async function I(L,R){const Z=n.path,X=b;if(!(!Z.startsWith(R+"/")&&Z!==R))try{const ue=await L.fileMeta(Z);if(y||n.fs!==L||n.path!==Z||b!==X)return;c.value&&ue.modTime>c.value&&(h.value=!0)}catch{}}function G(L){g==null||g(),g=L.onDirChanged(R=>{I(L,R)})}return En(()=>{y=!1,U(),G(n.fs)}),ft(()=>[n.path,n.fs,n.showLineNumbers,n.theme],()=>{U()}),ft(()=>n.fs,L=>G(L)),qt(()=>{y=!0,b++,p==null||p.destroy(),p=null,g&&g()}),e({save:M,testAppend:L=>{p&&p.dispatch({changes:{from:p.state.doc.length,insert:L}})}}),(L,R)=>(O(),V("div",Ky,[u.value?(O(),V("div",jy,[J("span",Gy,Q(q(i)("plugins.fileExplorer.staleModTime")),1),J("button",{"data-test":"conflict-overwrite",onClick:$},Q(q(i)("plugins.fileExplorer.overwrite")),1),J("button",{"data-test":"conflict-reload",onClick:N},Q(q(i)("plugins.fileExplorer.reloadDiscard")),1),J("button",{"data-test":"conflict-cancel",onClick:R[0]||(R[0]=Z=>u.value=null)},Q(q(i)("plugins.fileExplorer.cancel")),1)])):Ie("",!0),d.value?(O(),V("div",Jy,Q(q(i)("plugins.fileExplorer.saveFailed",{message:d.value})),1)):Ie("",!0),h.value?(O(),V("div",Yy,[ps(Q(q(i)("plugins.fileExplorer.fileChanged"))+" ",1),J("button",{onClick:U},Q(f.value?q(i)("plugins.fileExplorer.reloadDiscard"):q(i)("plugins.fileExplorer.reload")),1)])):Ie("",!0),l.value==="tooLarge"?(O(),V("div",Xy,Q(q(i)("plugins.fileExplorer.tooLarge")),1)):l.value==="binary"?(O(),V("div",Qy,Q(q(i)("plugins.fileExplorer.binary")),1)):l.value==="error"?(O(),V("div",Zy,Q(q(i)("plugins.fileExplorer.errorPrefix",{message:a.value})),1)):l.value==="loading"?(O(),V("div",e1,Q(q(i)("common.loading")),1)):Ie("",!0),ds(J("div",{ref_key:"host",ref:o,class:"cm-host"},null,512),[[If,l.value==="ok"]])]))}}),i1=rt(t1,[["__scopeId","data-v-25358a6a"]]),n1={class:"binary-banner"},s1={class:"msg"},r1=Qe({__name:"BinaryBanner",props:{fs:{},path:{},message:{}},setup(s){const e=s,{t}=Ji();async function i(){try{await e.fs.openExternal(e.path)}catch{}}return(n,r)=>(O(),V("div",n1,[J("span",s1,Q(n.message??q(t)("plugins.fileExplorer.unsupportedPreview")),1),J("button",{class:"open-btn",onClick:i},Q(q(t)("plugins.fileExplorer.openInSystem")),1)]))}}),ji=rt(r1,[["__scopeId","data-v-780ce2ee"]]),o1=["data-asset-request","src"],l1=Qe({__name:"ImagePreview",props:{fs:{},path:{},theme:{}},setup(s){const e=s,t=j(""),i=j(0),n=j("fit"),r=j(!1);let o=!0,l=0,a=null;function h(){var d,p;a&&((p=(d=a.fs).revokeAssetUrl)==null||p.call(d,a.path),a=null)}async function c(){var y;const d=e.fs,p=e.path,g=++l;i.value=g,h(),a={fs:d,path:p},t.value="",r.value=!1;try{const b=await d.assetUrlFor(p);if(!o||g!==l||e.fs!==d||e.path!==p){(y=d.revokeAssetUrl)==null||y.call(d,p);return}t.value=b}catch{o&&g===l&&e.fs===d&&e.path===p&&(r.value=!0)}}ft(()=>[e.path,e.fs.identity],()=>{c()},{immediate:!0}),qt(()=>{o=!1,l++,h()});function f(){n.value=n.value==="fit"?"native":"fit"}function u(d){const p=d.currentTarget;!t.value||!p||p.dataset.assetRequest!==String(i.value)||(h(),r.value=!0)}return(d,p)=>r.value?(O(),ke(ji,{key:0,fs:d.fs,path:d.path},null,8,["fs","path"])):(O(),V("div",{key:1,class:Gi(["img-host",n.value])},[(O(),V("img",{key:i.value,"data-asset-request":i.value,src:t.value,alt:"",onClick:f,onError:u},null,40,o1))],2))}}),a1=rt(l1,[["__scopeId","data-v-06adca93"]]),h1={key:1,class:"media-host"},c1=["data-asset-request","src"],f1=["data-asset-request","src"],u1=Qe({__name:"MediaPreview",props:{fs:{},path:{},kind:{}},setup(s){const e=s,t=j(""),i=j(0),n=j(!1);let r=!0,o=0,l=null;function a(){var f,u;l&&((u=(f=l.fs).revokeAssetUrl)==null||u.call(f,l.path),l=null)}async function h(){var p;const f=e.fs,u=e.path,d=++o;i.value=d,a(),l={fs:f,path:u},t.value="",n.value=!1;try{const g=await f.assetUrlFor(u);if(!r||d!==o||e.fs!==f||e.path!==u){(p=f.revokeAssetUrl)==null||p.call(f,u);return}t.value=g}catch{r&&d===o&&e.fs===f&&e.path===u&&(n.value=!0)}}ft(()=>[e.path,e.fs.identity],()=>{h()},{immediate:!0}),qt(()=>{r=!1,o++,a()});function c(f){const u=f.currentTarget;!t.value||!u||u.dataset.assetRequest!==String(i.value)||(a(),n.value=!0)}return(f,u)=>n.value?(O(),ke(ji,{key:0,fs:f.fs,path:f.path},null,8,["fs","path"])):(O(),V("div",h1,[f.kind==="video"?(O(),V("video",{key:i.value,"data-asset-request":i.value,src:t.value,controls:"",preload:"metadata",onError:c},null,40,c1)):(O(),V("audio",{key:i.value,"data-asset-request":i.value,src:t.value,controls:"",preload:"metadata",onError:c},null,40,f1))]))}}),d1=rt(u1,[["__scopeId","data-v-71c6a6ef"]]),p1={key:1,class:"pdf-host"},g1=["data"],m1=Qe({__name:"PdfPreview",props:{fs:{},path:{}},setup(s){const e=s,t=j(""),i=j(!1);let n=!0,r=0,o=null;function l(){var h,c;o&&((c=(h=o.fs).revokeAssetUrl)==null||c.call(h,o.path),o=null)}async function a(){var u;const h=e.fs,c=e.path,f=++r;l(),o={fs:h,path:c},t.value="",i.value=!1;try{const d=await h.assetUrlFor(c);if(!n||f!==r||e.fs!==h||e.path!==c){(u=h.revokeAssetUrl)==null||u.call(h,c);return}t.value=d}catch{n&&f===r&&e.fs===h&&e.path===c&&(i.value=!0)}}return ft(()=>[e.path,e.fs.identity],()=>{a()},{immediate:!0}),qt(()=>{n=!1,r++,l()}),(h,c)=>i.value?(O(),ke(ji,{key:0,fs:h.fs,path:h.path},null,8,["fs","path"])):(O(),V("div",p1,[J("object",{data:t.value,type:"application/pdf"},[vi(ji,{fs:h.fs,path:h.path},null,8,["fs","path"])],8,g1)]))}}),y1=rt(m1,[["__scopeId","data-v-160ee5d7"]]),v1=["innerHTML"],b1={key:2,class:"md-host placeholder"},Ca=2*1024*1024,w1=Qe({__name:"MarkdownPreview",props:{fs:{},path:{},theme:{}},setup(s){const e=s,t=La(),i=j(""),n=j("loading");let r=!1,o=0;function l(f,u,d){return!r&&o===d&&e.fs===f&&e.path===u}function a(f){let u;if(typeof f=="string"){const d=atob(f);u=new Uint8Array(d.length);for(let p=0;pCa){n.value="error";return}const g=await f.readFile(u,Ca);if(!l(f,u,d))return;const y=a(g.data),b=(await le(async()=>{const{default:D}=await import("./index-D8AWWFft.js");return{default:D}},[])).default,T=new b({html:!1,linkify:!0,breaks:!1}).render(y);if(!l(f,u,d))return;i.value=T,n.value="ok"}catch{if(!l(f,u,d))return;n.value="error"}}}function c(f){const u=f.target;if(!u)return;const d=u.closest("a");if(!d)return;const p=d.getAttribute("href")??"";f.preventDefault(),/^(https?|mailto):/i.test(p)&&t.system.openExternalURL(p)}return En(()=>{r=!1,h()}),ft(()=>[e.path,e.fs],()=>{h()}),qt(()=>{r=!0,o++}),(f,u)=>n.value==="error"?(O(),ke(ji,{key:0,fs:f.fs,path:f.path},null,8,["fs","path"])):n.value==="ok"?(O(),V("div",{key:1,class:Gi(["md-host",f.theme]),innerHTML:i.value,onClick:c},null,10,v1)):(O(),V("div",b1,"…"))}}),x1=rt(w1,[["__scopeId","data-v-b84f1c1b"]]),k1={class:"file-editor-host"},S1={key:0,class:"banner err"},C1={key:7,class:"banner muted","data-test":"kind-pending"},A1=Qe({__name:"FileEditor",props:{fs:{},path:{},showLineNumbers:{type:Boolean},theme:{},viewMode:{}},emits:["dirty-change"],setup(s,{expose:e,emit:t}){const i=s,n=t,r=j(null);async function o(){var p,g;return((g=(p=r.value)==null?void 0:p.save)==null?void 0:g.call(p))??Promise.resolve(!1)}e({save:o});const{t:l}=Ji(),a=j(null),h=j("");let c=!1,f=0;function u(p,g,y){return!c&&f===y&&i.fs===p&&i.path===g}async function d(){const p=i.fs,g=i.path,y=++f;a.value=null,h.value="";try{const b=await p.fileMeta(g);if(!u(p,g,y))return;a.value=cd(g,b.isBinary)}catch(b){if(!u(p,g,y))return;h.value=(b==null?void 0:b.message)||String(b)||l("plugins.fileExplorer.unknownError")}}return ft(()=>[i.path,i.fs],()=>{d()},{immediate:!0}),qt(()=>{c=!0,f++}),(p,g)=>(O(),V("div",k1,[h.value?(O(),V("div",S1,Q(q(l)("plugins.fileExplorer.errorPrefix",{message:h.value})),1)):a.value==="code"||(a.value==="svg"||a.value==="markdown")&&p.viewMode==="code"?(O(),ke(i1,{key:1,ref_key:"codeEditorRef",ref:r,fs:p.fs,path:p.path,"show-line-numbers":p.showLineNumbers,theme:p.theme,onDirtyChange:g[0]||(g[0]=y=>n("dirty-change",y))},null,8,["fs","path","show-line-numbers","theme"])):a.value==="image"||a.value==="svg"&&p.viewMode==="render"?(O(),ke(a1,{key:2,fs:p.fs,path:p.path,theme:p.theme},null,8,["fs","path","theme"])):a.value==="markdown"&&p.viewMode==="render"?(O(),ke(x1,{key:3,fs:p.fs,path:p.path,theme:p.theme},null,8,["fs","path","theme"])):a.value==="video"||a.value==="audio"?(O(),ke(d1,{key:4,fs:p.fs,path:p.path,kind:a.value},null,8,["fs","path","kind"])):a.value==="pdf"?(O(),ke(y1,{key:5,fs:p.fs,path:p.path},null,8,["fs","path"])):a.value==="binary-unknown"?(O(),ke(ji,{key:6,fs:p.fs,path:p.path},null,8,["fs","path"])):(O(),V("div",C1,Q(q(l)("common.loading")),1))]))}}),M1=rt(A1,[["__scopeId","data-v-db7692c8"]]);function Aa(s){return/\.(md|markdown)$/i.test(s)?"render":"code"}const T1=8;function kr(s,e,t){const i=Date.now(),n=s.tabs.findIndex(o=>o.path===e);if(n>=0){const o=yi(s);return o.tabs[n].lastActiveAt=i,t==="persistent"&&(o.tabs[n].persistent=!0),o.activeIdx=n,o}if(t==="preview"){const o=s.tabs.findIndex(l=>!l.persistent);if(o>=0){const l=yi(s);return l.tabs[o]={path:e,persistent:!1,lastActiveAt:i,viewMode:Aa(e),dirty:!1},l.activeIdx=o,l}}let r=yi(s);return r.tabs.push({path:e,persistent:t==="persistent",lastActiveAt:i,viewMode:Aa(e),dirty:!1}),r.activeIdx=r.tabs.length-1,r.tabs.length>T1&&(r=E1(r)),r}function D1(s,e){if(e<0||e>=s.tabs.length)return s;const t=yi(s);return t.tabs.splice(e,1),t.tabs.length===0?(t.activeIdx=-1,t):(t.activeIdx=Math.min(e,t.tabs.length-1),t)}function E1(s){const e=s.activeIdx>=0?s.tabs[s.activeIdx].path:null,t=a=>!a.persistent&&a.path!==e,i=s.tabs.filter(t),n=i.length>0?i:s.tabs;let r=n[0];for(const a of n)a.lastActiveAtr.path===e);if(i<0||s.tabs[i].dirty===t)return s;const n=yi(s);return n.tabs[i].dirty=t,n}function yi(s){return{tabs:s.tabs.map(e=>({...e})),activeIdx:s.activeIdx}}function B1(s,e){return{identity:"local",listDir:t=>s.fs.listDir(t),watchDir:t=>s.fs.watchDir(t),unwatchDir:async t=>{if(typeof t!="number")throw new Error("local filesystem watch ID must be a number");await s.fs.unwatchDir(t)},readFile:(t,i)=>s.fs.readFile(t,i),fileMeta:t=>s.fs.fileMeta(t),openExternal:t=>s.fs.openExternal(t),assetUrlFor:t=>Promise.resolve(s.fs.assetUrlFor(t)),onDirChanged:t=>(e==null?void 0:e.on("plugin-fs:dir-changed",i=>{typeof i=="string"&&t(i)}))??(()=>{}),dispose:()=>{},writeFile:(t,i,n)=>s.fs.writeFile(t,Array.from(i),n??0,n===null),createFile:t=>s.fs.createFile(t),rename:(t,i)=>s.fs.rename(t,i),remove:(t,i)=>s.fs.remove(t,i),mkdir:t=>s.fs.mkdir(t),trash:t=>s.fs.trash(t)}}const R1=2*1024*1024,P1=256*1024,Ma=50*1024*1024,Ta="application/octet-stream";function et(s){if(!s.ok)throw new Error(s.error||"remote filesystem request failed");return s}function Cf(s){try{const e=atob(s),t=new Uint8Array(e.length);for(let i=0;iMa)throw new Error("remote asset exceeds the 50 MiB size limit");const X=_1(R);if(I+X.byteLength>Ma)throw new Error("remote asset exceeds the 50 MiB size limit");if(G&&(N=R.contentType||Ta,G=!1),$.push(F1(X)),I+=X.byteLength,R.eof)break;if(X.byteLength===0)throw new Error("remote filesystem response returned an empty non-final chunk")}return URL.createObjectURL(new Blob($,{type:N}))}function A(M){if(l)return Promise.reject(new Error("remote filesystem bridge is disposed"));const $=t.get(M);if($)return Promise.resolve($);const N=n.get(M)??0,I=i.get(M);if((I==null?void 0:I.generation)===N)return I.promise;const G=D(M).then(R=>{if(l)throw URL.revokeObjectURL(R),new Error("remote filesystem bridge is disposed");if((n.get(M)??0)!==N)throw URL.revokeObjectURL(R),new Error("remote filesystem asset request was invalidated");return t.set(M,R),R});i.set(M,{generation:N,promise:G});const L=()=>{var R;((R=i.get(M))==null?void 0:R.promise)===G&&i.delete(M)};return G.then(L,L),G}function P(M){n.set(M,(n.get(M)??0)+1);const $=t.get(M);$&&(URL.revokeObjectURL($),t.delete(M))}function C(M){if(l)return()=>{};const $={handler:M};return r.add($),o||(o=s.onFSEvent(N=>{if(!(l||N.event!=="changed"||!N.path))for(const{handler:I}of Array.from(r))try{I(N.path)}catch(G){it("file-explorer","dir-changed subscriber threw",{path:N.path,error:Se(G)})}})),()=>{r.delete($),r.size===0&&o&&(o(),o=null)}}function U(){if(!l){l=!0;for(const M of t.values())URL.revokeObjectURL(M);t.clear(),i.clear(),n.clear(),r.clear(),o&&(o(),o=null)}}return{identity:e,listDir:a,watchDir:h,unwatchDir:c,readFile:f,fileMeta:u,openExternal:d,assetUrlFor:A,onDirChanged:C,revokeAssetUrl:P,dispose:U,writeFile:p,createFile:g,rename:y,remove:b,mkdir:x,trash:T}}function _1(s){if(typeof s.data!="string")throw new Error("remote filesystem response chunk missing data");if(!Number.isSafeInteger(s.length)||s.length<0)throw new Error("remote filesystem response chunk has invalid length");const e=Cf(s.data);if(s.length!==e.byteLength)throw new Error("remote filesystem response chunk length does not match data");return e}function F1(s){const e=new Uint8Array(s.byteLength);return e.set(s),e.buffer}const W1=2*1024*1024,H1="/",V1="already_exists",$1="no platform trash command available",z1=200;function Da(s){return _s("plugins.fileExplorer.sshNoRecursiveDelete",{path:s})}function Ea(s){return Promise.reject(new Error(_s(`plugins.fileExplorer.${s}`)))}function rs(s,e){const t=Se(e);return t.includes(V1)?new Error(_s("plugins.fileExplorer.sshUploadExists",{path:s})):new Error(t)}function q1(s){let e=!1;function t(){if(e)throw new Error(_s("plugins.fileExplorer.sshBridgeDisposed"))}async function i(d){t();const p=await Jf(s,d);return{entries:p.entries??[],truncated:!!p.truncated,total:p.total??(p.entries??[]).length}}async function n(d){return(await i(d)).entries}async function r(d){return t(),await Gf(s,d)}async function o(d,p=W1){return t(),await jf(s,d,p)}async function l(d,p,g){t();try{return await Kf(s,d,p,g??0,g===null)}catch(y){throw rs(d,y)}}async function a(d){t();try{return await Uf(s,d)}catch(p){throw rs(d,p)}}async function h(d){t();try{return await qf(s,d)}catch(p){throw rs(d,p)}}async function c(d,p){t();try{return await zf(s,d,p)}catch(g){throw rs(p,g)}}async function f(d,p){if(t(),p)throw new Error(Da(d));await $f(s,d,!1)}function u(){if(!e){e=!0;try{Vf(s).catch(d=>{it("file-explorer","releasing the ssh file source failed",{hostID:s,error:Se(d)})})}catch(d){it("file-explorer","releasing the ssh file source failed",{hostID:s,error:Se(d)})}}}return{identity:`ssh:${s}`,searchMaxDirs:z1,dirRemovalRefusal:Da,listDir:n,listDirDetailed:i,fileMeta:r,readFile:o,writeFile:l,createFile:a,mkdir:h,rename:c,remove:f,watchDir:()=>Promise.resolve(`ssh:${s}`),unwatchDir:()=>Promise.resolve(),onDirChanged:()=>()=>{},openExternal:()=>Ea("sshNoOpenExternal"),assetUrlFor:()=>Ea("sshNoInlineAsset"),trash:()=>Promise.reject(new Error($1)),dispose:u}}const U1={class:"file-explorer"},K1={class:"fe-header"},j1=["title"],G1=["disabled","title"],J1=["title"],Y1={key:0,class:"source-picker"},X1=["aria-label"],Q1={value:""},Z1=["value"],ev={class:"tree-search"},tv=["placeholder","aria-label"],iv={class:"tree-scroll"},nv={key:1,class:"placeholder"},sv={class:"editor-pane"},rv={class:"editor-area"},ov={key:1,class:"placeholder"},lv=Qe({__name:"FileExplorer",props:{context:{}},setup(s){const e=s,t=La(),i=Yf(),{t:n}=Ji(),r=j(null),o=me(()=>{var B;return((B=i.cfg)==null?void 0:B.fileExplorer.innerTreeRatio)??.3}),l=j(null),a=me(()=>l.value??o.value),h=j(null),{onMouseDown:c}=eu({onDrag:B=>{if(!h.value)return;const K=h.value.clientWidth;if(K<=0)return;const te=l.value??o.value,ge=Math.max(.15,Math.min(te-B/K,.5));l.value=ge},onEnd:()=>{if(l.value===null||!i.cfg){l.value=null;return}const B=JSON.parse(JSON.stringify(i.cfg));B.fileExplorer.innerTreeRatio=l.value,i.save(B),l.value=null}}),f=j([]),u=j("");async function d(){if(t.pluginHost)try{f.value=await tu()??[]}catch(B){it("file-explorer","ssh sources unavailable",{error:Se(B)}),f.value=[]}}d();function p(B){return B.alias||`${B.user}@${B.host}`}const g=me(()=>{if(u.value)return{identity:`ssh:${u.value}`,connection:null,sshHostID:u.value};if(!e.context.activeIsRemote.value)return{identity:t.pluginHost?"local":null,connection:null,sshHostID:""};const B=e.context.activeSessionId.value,K=e.context.activeSessionConnection.value;return{identity:B&&K?`remote:${B}`:null,connection:K,sshHostID:""}}),y=j({});ft(()=>[e.context.activeCwd.value,g.value.identity,g.value.sshHostID],([B,K,te])=>{B&&K&&!te&&(y.value={...y.value,[K]:B})},{immediate:!0});const b=me(()=>{if(g.value.sshHostID)return H1;if(r.value)return r.value;const B=e.context.activeCwd.value;if(B)return B;const K=g.value.identity;return K?y.value[K]??null:null}),x=j({tabs:[],activeIdx:-1}),T=Nf(null),D=j(0),A=j("");ft(()=>[g.value.identity,g.value.connection,g.value.sshHostID],async([B,K,te])=>{var kt;const ge=te?q1(te):B==="local"?t.pluginHost?B1(t.pluginHost,t.events):null:B&&K?N1(K,B):null,ve=T.value,xt=(ve==null?void 0:ve.identity)!==(ge==null?void 0:ge.identity);T.value=ge,D.value++,xt&&(r.value=null,x.value={tabs:[],activeIdx:-1},A.value=""),await us(),(kt=ve==null?void 0:ve.dispose)==null||kt.call(ve)},{immediate:!0}),qt(()=>{var B,K;(K=(B=T.value)==null?void 0:B.dispose)==null||K.call(B),T.value=null});const P=Xf(),C=j(null),U=j(null),M=j(!1),$=me(()=>{var B;return((B=C.value)==null?void 0:B.selectedDir)??b.value});function N(){var B;(B=U.value)==null||B.click()}async function I(B){var xt,kt,en;const K=B.target,te=((xt=K.files)==null?void 0:xt[0])??null;K.value="";const ge=T.value,ve=$.value;if(!(!te||!ge||!ve)){M.value=!0;try{const It=new Uint8Array(await te.arrayBuffer()),Wn=ve.endsWith("/")?ve+te.name:`${ve}/${te.name}`;await ge.writeFile(Wn,It,null),e.context.showToast(n("plugins.fileExplorer.sshUploadDone",{name:te.name,dir:ve})),(en=(kt=C.value)==null?void 0:kt.refreshDir)==null||en.call(kt,ve)}catch(It){e.context.showToast(Se(It)),it("file-explorer","ssh upload failed",{error:Se(It)})}finally{M.value=!1}}}ft(()=>P.pending,async B=>{var te;if(!B||!T.value)return;await us(),(await((te=C.value)==null?void 0:te.revealPath(B))??!1)&&(x.value=kr(x.value,B,"preview")),P.consume()},{immediate:!0});function G(B){x.value=kr(x.value,B,"preview")}function L(B){x.value=kr(x.value,B,"persistent")}function R(B){x.value={...x.value,activeIdx:B}}function Z(B){x.value=D1(x.value,B)}const X=j(null),ue=j(null);function Me(B){const K=Le.value;K&&(x.value=L1(x.value,K,B))}async function ot(B){const K=x.value.tabs[B];if(!(K!=null&&K.dirty)){Z(B);return}X.value={idx:B,name:K.path.split("/").pop()??K.path,buttons:[{id:"save",label:n("plugins.fileExplorer.save"),kind:"primary"},{id:"dontSave",label:n("plugins.fileExplorer.dontSave"),kind:"danger"},{id:"cancel",label:n("plugins.fileExplorer.cancel"),kind:"secondary"}]}}async function de(B){var ge,ve;const K=X.value;if(X.value=null,!K||B==="cancel")return;if(B==="dontSave"){Z(K.idx);return}(await((ve=(ge=ue.value)==null?void 0:ge.save)==null?void 0:ve.call(ge))??!1)&&Z(K.idx)}function Te(){r.value=r.value===null?e.context.activeCwd.value:null}const De=me(()=>{const B=x.value.activeIdx;return B>=0?x.value.tabs[B].viewMode:"code"});function Fe(){x.value=O1(x.value,De.value==="code"?"render":"code")}const Le=me(()=>x.value.activeIdx>=0?x.value.tabs[x.value.activeIdx].path:null),je=me(()=>{var B;return((B=i.cfg)==null?void 0:B.fileExplorer.showHidden)??!1}),$e=me(()=>{var B;return((B=i.cfg)==null?void 0:B.fileExplorer.showLineNumbers)??!1});async function Fn(B,K){if(!i.cfg)return;const te=JSON.parse(JSON.stringify(i.cfg));te.fileExplorer[B]=K;try{await i.save(te)}catch(ge){it("file-explorer","saving view option failed",{error:Se(ge)})}}const ci=me(()=>Qf(e.context.terminalThemeId.value)?"light":"dimmed");return(B,K)=>(O(),V("div",U1,[J("div",{class:"fe-body",ref_key:"bodyRef",ref:h},[J("div",{class:"tree-pane",style:mn({width:a.value*100+"%"})},[J("header",K1,[J("span",{class:"root-path",title:b.value??""},Q(b.value??q(n)("plugins.fileExplorer.noActivePaneShort")),9,j1),g.value.sshHostID?(O(),V("button",{key:0,class:"pin","data-test":"ssh-upload",disabled:M.value||!$.value,title:q(n)("plugins.fileExplorer.sshUpload",{dir:$.value??""}),onClick:N},[vi(q(Zf),{size:14,"stroke-width":1.5})],8,G1)):(O(),V("button",{key:1,class:Gi(["pin",{pinned:r.value!==null}]),title:r.value!==null?q(n)("plugins.fileExplorer.unpinFollow"):q(n)("plugins.fileExplorer.pinCurrentCwd"),onClick:Te},[(O(),ke(hn(r.value!==null?q(ou):q(ru)),{size:14,"stroke-width":1.5}))],10,J1))]),f.value.length>0?(O(),V("div",Y1,[ds(J("select",{"onUpdate:modelValue":K[0]||(K[0]=te=>u.value=te),"data-test":"fs-source","aria-label":q(n)("plugins.fileExplorer.sourceLabel")},[J("option",Q1,Q(q(n)("plugins.fileExplorer.sourceActivePane")),1),(O(!0),V(Xt,null,mi(f.value,te=>(O(),V("option",{key:te.id,value:te.id},Q(p(te)),9,Z1))),128))],8,X1),[[_f,u.value]])])):Ie("",!0),J("input",{ref_key:"uploadInput",ref:U,class:"upload-input","data-test":"ssh-upload-input",type:"file",onChange:I},null,544),J("div",ev,[ds(J("input",{"onUpdate:modelValue":K[1]||(K[1]=te=>A.value=te),"data-test":"file-name-search",type:"search",placeholder:q(n)("plugins.fileExplorer.searchFiles"),"aria-label":q(n)("plugins.fileExplorer.searchFiles")},null,8,tv),[[Oa,A.value]])]),J("div",iv,[b.value&&T.value?(O(),ke(Yu,{ref_key:"fileTreeRef",ref:C,key:D.value,fs:T.value,root:b.value,"show-hidden":je.value,"show-line-numbers":$e.value,"search-query":A.value,context:B.context,onFileClicked:G,onFileDoubleClicked:L,onToggleShowHidden:K[2]||(K[2]=te=>Fn("showHidden",te)),onToggleShowLineNumbers:K[3]||(K[3]=te=>Fn("showLineNumbers",te))},null,8,["fs","root","show-hidden","show-line-numbers","search-query","context"])):(O(),V("div",nv,Q(q(n)("plugins.fileExplorer.noActivePane")),1))])],4),J("div",{class:"divider",onMousedown:K[4]||(K[4]=(...te)=>q(c)&&q(c)(...te))},null,32),J("div",sv,[vi(sd,{tabs:x.value.tabs,"active-idx":x.value.activeIdx,"view-mode":De.value,onSelect:R,onCloseRequest:ot,onToggleViewMode:Fe},null,8,["tabs","active-idx","view-mode"]),J("div",rv,[Le.value&&T.value?(O(),ke(M1,{ref_key:"codeEditorRef",ref:ue,key:D.value,fs:T.value,path:Le.value,"show-line-numbers":$e.value,theme:ci.value,"view-mode":De.value,onDirtyChange:Me},null,8,["fs","path","show-line-numbers","theme","view-mode"])):(O(),V("div",ov,Q(q(n)("plugins.fileExplorer.selectFile")),1))])])],512),X.value?(O(),ke(Pa,{key:0,title:q(n)("plugins.fileExplorer.confirmCloseTitle",{name:X.value.name}),buttons:X.value.buttons,onResolve:de},null,8,["title","buttons"])):Ie("",!0)]))}}),av=rt(lv,[["__scopeId","data-v-098631c4"]]),gv=Object.freeze(Object.defineProperty({__proto__:null,default:av},Symbol.toStringTag,{value:"Module"}));export{ai as A,Us as B,Qr as C,re as D,S as E,F,Zt as G,dv as H,he as I,em as J,ac as K,Es as L,nt as M,ee as N,_e as O,Si as P,v as Q,bi as R,oe as S,lt as T,Yi as W,Ng as a,se as b,H as c,gv as d,qe as e,Po as f,am as g,Eo as h,Ke as i,uv as j,rc as k,On as l,vt as m,ne as n,Ae as o,ce as p,Ec as q,vm as r,Ws as s,Ro as t,mm as u,ym as v,xm as w,yc as x,mc as y,Io as z}; diff --git a/internal/relay/web-dist/assets/Switch-DguIL3dU.js b/internal/relay/web-dist/assets/Switch-BlSJOKEO.js similarity index 99% rename from internal/relay/web-dist/assets/Switch-DguIL3dU.js rename to internal/relay/web-dist/assets/Switch-BlSJOKEO.js index 02830bf8..b463d2cc 100644 --- a/internal/relay/web-dist/assets/Switch-DguIL3dU.js +++ b/internal/relay/web-dist/assets/Switch-BlSJOKEO.js @@ -1,4 +1,4 @@ -import{ai as me,F as Ce,a as ae,ar as le,a3 as ye,a6 as V,R as I,H as E,K as n,L as S,ay as we,G as K,ap as re,aL as l,bg as xe,N as Se,bQ as $e,d as ze,E as Re,W as ke,I as Be,p as Ie,bS as F,i as _e,cb as te,cl as O,ci as se,a7 as A,aH as Pe,ag as v,cm as ce,bH as U,a4 as Te,a_ as Ve,aG as Fe,aq as $,a5 as Ee,aO as ne,O as ie,bb as J,l as He,e as Ae,cc as We,c6 as je,ch as Le,bD as Q,P as Z}from"./useI18n-lwZlSdSx.js";function oe(e,o=!0,a=[]){return e.forEach(t=>{if(t!==null){if(typeof t!="object"){(typeof t=="string"||typeof t=="number")&&a.push(me(String(t)));return}if(Array.isArray(t)){oe(t,o,a);return}if(t.type===Ce){if(t.children===null)return;Array.isArray(t.children)&&oe(t.children,o,a)}else{if(t.type===ae&&o)return;a.push(t)}}}),a}function Oe(e,o="default",a=[]){const r=e.$slots[o];return r===void 0?a:r()}function Me(e){const{lineHeight:o,borderRadius:a,fontWeightStrong:t,baseColor:r,dividerColor:u,actionColor:m,textColor1:h,textColor2:f,closeColorHover:g,closeColorPressed:p,closeIconColor:b,closeIconColorHover:s,closeIconColorPressed:d,infoColor:i,successColor:z,warningColor:y,errorColor:R,fontSize:w}=e;return Object.assign(Object.assign({},ye),{fontSize:w,lineHeight:o,titleFontWeight:t,borderRadius:a,border:`1px solid ${u}`,color:m,titleTextColor:h,iconColor:f,contentTextColor:f,closeBorderRadius:a,closeColorHover:g,closeColorPressed:p,closeIconColor:b,closeIconColorHover:s,closeIconColorPressed:d,borderInfo:`1px solid ${V(r,I(i,{alpha:.25}))}`,colorInfo:V(r,I(i,{alpha:.08})),titleTextColorInfo:h,iconColorInfo:i,contentTextColorInfo:f,closeColorHoverInfo:g,closeColorPressedInfo:p,closeIconColorInfo:b,closeIconColorHoverInfo:s,closeIconColorPressedInfo:d,borderSuccess:`1px solid ${V(r,I(z,{alpha:.25}))}`,colorSuccess:V(r,I(z,{alpha:.08})),titleTextColorSuccess:h,iconColorSuccess:z,contentTextColorSuccess:f,closeColorHoverSuccess:g,closeColorPressedSuccess:p,closeIconColorSuccess:b,closeIconColorHoverSuccess:s,closeIconColorPressedSuccess:d,borderWarning:`1px solid ${V(r,I(y,{alpha:.33}))}`,colorWarning:V(r,I(y,{alpha:.08})),titleTextColorWarning:h,iconColorWarning:y,contentTextColorWarning:f,closeColorHoverWarning:g,closeColorPressedWarning:p,closeIconColorWarning:b,closeIconColorHoverWarning:s,closeIconColorPressedWarning:d,borderError:`1px solid ${V(r,I(R,{alpha:.25}))}`,colorError:V(r,I(R,{alpha:.08})),titleTextColorError:h,iconColorError:R,contentTextColorError:f,closeColorHoverError:g,closeColorPressedError:p,closeIconColorError:b,closeIconColorHoverError:s,closeIconColorPressedError:d})}const De={common:le,self:Me},Ge=E("alert",` +import{ai as me,F as Ce,a as ae,ar as le,a3 as ye,a6 as V,R as I,H as E,K as n,L as S,ay as we,G as K,ap as re,aL as l,bg as xe,N as Se,bQ as $e,d as ze,E as Re,W as ke,I as Be,p as Ie,bS as F,i as _e,cb as te,cl as O,ci as se,a7 as A,aH as Pe,ag as v,cm as ce,bH as U,a4 as Te,a_ as Ve,aG as Fe,aq as $,a5 as Ee,aO as ne,O as ie,bb as J,l as He,e as Ae,cc as We,c6 as je,ch as Le,bD as Q,P as Z}from"./useI18n-D4u8zssu.js";function oe(e,o=!0,a=[]){return e.forEach(t=>{if(t!==null){if(typeof t!="object"){(typeof t=="string"||typeof t=="number")&&a.push(me(String(t)));return}if(Array.isArray(t)){oe(t,o,a);return}if(t.type===Ce){if(t.children===null)return;Array.isArray(t.children)&&oe(t.children,o,a)}else{if(t.type===ae&&o)return;a.push(t)}}}),a}function Oe(e,o="default",a=[]){const r=e.$slots[o];return r===void 0?a:r()}function Me(e){const{lineHeight:o,borderRadius:a,fontWeightStrong:t,baseColor:r,dividerColor:u,actionColor:m,textColor1:h,textColor2:f,closeColorHover:g,closeColorPressed:p,closeIconColor:b,closeIconColorHover:s,closeIconColorPressed:d,infoColor:i,successColor:z,warningColor:y,errorColor:R,fontSize:w}=e;return Object.assign(Object.assign({},ye),{fontSize:w,lineHeight:o,titleFontWeight:t,borderRadius:a,border:`1px solid ${u}`,color:m,titleTextColor:h,iconColor:f,contentTextColor:f,closeBorderRadius:a,closeColorHover:g,closeColorPressed:p,closeIconColor:b,closeIconColorHover:s,closeIconColorPressed:d,borderInfo:`1px solid ${V(r,I(i,{alpha:.25}))}`,colorInfo:V(r,I(i,{alpha:.08})),titleTextColorInfo:h,iconColorInfo:i,contentTextColorInfo:f,closeColorHoverInfo:g,closeColorPressedInfo:p,closeIconColorInfo:b,closeIconColorHoverInfo:s,closeIconColorPressedInfo:d,borderSuccess:`1px solid ${V(r,I(z,{alpha:.25}))}`,colorSuccess:V(r,I(z,{alpha:.08})),titleTextColorSuccess:h,iconColorSuccess:z,contentTextColorSuccess:f,closeColorHoverSuccess:g,closeColorPressedSuccess:p,closeIconColorSuccess:b,closeIconColorHoverSuccess:s,closeIconColorPressedSuccess:d,borderWarning:`1px solid ${V(r,I(y,{alpha:.33}))}`,colorWarning:V(r,I(y,{alpha:.08})),titleTextColorWarning:h,iconColorWarning:y,contentTextColorWarning:f,closeColorHoverWarning:g,closeColorPressedWarning:p,closeIconColorWarning:b,closeIconColorHoverWarning:s,closeIconColorPressedWarning:d,borderError:`1px solid ${V(r,I(R,{alpha:.25}))}`,colorError:V(r,I(R,{alpha:.08})),titleTextColorError:h,iconColorError:R,contentTextColorError:f,closeColorHoverError:g,closeColorPressedError:p,closeIconColorError:b,closeIconColorHoverError:s,closeIconColorPressedError:d})}const De={common:le,self:Me},Ge=E("alert",` line-height: var(--n-line-height); border-radius: var(--n-border-radius); position: relative; diff --git a/internal/relay/web-dist/assets/auth-B3RxKR1W.js b/internal/relay/web-dist/assets/auth-BBmiA1GG.js similarity index 99% rename from internal/relay/web-dist/assets/auth-B3RxKR1W.js rename to internal/relay/web-dist/assets/auth-BBmiA1GG.js index 69183340..05a256d5 100644 --- a/internal/relay/web-dist/assets/auth-B3RxKR1W.js +++ b/internal/relay/web-dist/assets/auth-BBmiA1GG.js @@ -1 +1 @@ -var Se=Object.defineProperty;var Te=(e,t,n)=>t in e?Se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var m=(e,t,n)=>Te(e,typeof t!="symbol"?t+"":t,n);import{a as zt}from"./client-DMh7GjbV.js";import{_ as ae,be as ke,bV as Ce,Z as Re}from"./useI18n-lwZlSdSx.js";const Ut=BigInt(2**32-1),Qt=BigInt(32);function Me(e,t=!1){return t?{h:Number(e&Ut),l:Number(e>>Qt&Ut)}:{h:Number(e>>Qt&Ut)|0,l:Number(e&Ut)|0}}const It=(e,t,n)=>e>>>n|t<<32-n,Ot=(e,t,n)=>e<<32-n|t>>>n,he=(e,t,n)=>e<<64-n|t>>>n-32,le=(e,t,n)=>e>>>n-32|t<<64-n,ue=(e,t)=>t,de=(e,t)=>e;function pe(e,t,n,r){const s=(t>>>0)+(r>>>0);return{h:e+n+(s/2**32|0)|0,l:s|0}}const Yt=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),Xt=(e,t,n,r)=>t+n+r+(e/2**32|0)|0;function De(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function ct(e,t=""){if(typeof e!="number"){const n=t&&`"${t}" `;throw new TypeError(`${n}expected number, got ${typeof e}`)}if(!Number.isSafeInteger(e)||e<0){const n=t&&`"${t}" `;throw new RangeError(`${n}expected integer >= 0, got ${e}`)}}function q(e,t,n=""){const r=De(e),s=e==null?void 0:e.length,o=t!==void 0;if(!r||o&&s!==t){const f=n&&`"${n}" `,i=o?` of length ${t}`:"",c=r?`length=${s}`:`type=${typeof e}`,h=f+"expected Uint8Array"+i+", got "+c;throw r?new RangeError(h):new TypeError(h)}return e}function qt(e){if(typeof e!="function"||typeof e.create!="function")throw new TypeError("Hash must wrapped by utils.createHasher");if(ct(e.outputLen),ct(e.blockLen),e.outputLen<1)throw new Error('"outputLen" must be >= 1');if(e.blockLen<1)throw new Error('"blockLen" must be >= 1')}function wt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Wt(e,t){q(e,void 0,"digestInto() output");const n=t.outputLen;if(e.length='+n)}function Ht(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function gt(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function X(...e){for(let t=0;t>>t}const ye=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function we(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const Y=ye?e=>e:e=>we(e)>>>0;function $e(e){for(let t=0;te:$e;function _t(e){if(typeof e!="string")throw new TypeError("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Ft(e,t=""){return typeof e=="string"?_t(e):q(e,void 0,t)}function ge(e,t={}){const n=(s,o)=>e(o).update(s).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=s=>e(s),Object.assign(n,t),Object.freeze(n)}function te(e=32){ct(e,"bytesLength");const t=typeof globalThis=="object"?globalThis.crypto:null;if(typeof(t==null?void 0:t.getRandomValues)!="function")throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const Ne=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])}),Fe=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]);function Pe(e,t,n){return e&t^~e&n}function Ke(e,t,n){return e&t^e&n^t&n}class je{constructor(t,n,r,s){m(this,"blockLen");m(this,"outputLen");m(this,"canXOF",!1);m(this,"padOffset");m(this,"isLE");m(this,"buffer");m(this,"view");m(this,"finished",!1);m(this,"length",0);m(this,"pos",0);m(this,"destroyed",!1);this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(t),this.view=Rt(this.buffer)}update(t){wt(this),q(t);const{view:n,buffer:r,blockLen:s}=this,o=t.length;for(let f=0;fs-f&&(this.process(r,0),f=0);for(let l=f;la.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;ln)throw new Error("outputLen bigger than keyLen");const{key:o,salt:f,personalization:i}=t;if(o!==void 0&&(o.length<1||o.length>n))throw new Error('"key" expected to be undefined or of length=1..'+n);f!==void 0&&q(f,r,"salt"),i!==void 0&&q(i,s,"personalization")}class Ge{constructor(t,n){m(this,"buffer");m(this,"buffer32");m(this,"finished",!1);m(this,"destroyed",!1);m(this,"length",0);m(this,"pos",0);m(this,"blockLen");m(this,"outputLen");m(this,"canXOF",!1);ct(t),ct(n),this.blockLen=t,this.outputLen=n,this.buffer=new Uint8Array(t),this.buffer32=gt(this.buffer)}update(t){wt(this),q(t);const{blockLen:n,buffer:r,buffer32:s}=this,o=t.length,f=t.byteOffset,i=t.buffer;for(let c=0;c>>8*a}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){const{buffer:n,length:r,finished:s,destroyed:o,outputLen:f,pos:i}=this;return t||(t=new this.constructor({dkLen:f})),t.set(...this.get()),t.buffer.set(n),t.destroyed=o,t.finished=s,t.length=r,t.pos=i,t.outputLen=f,t}clone(){return this._cloneInto()}}class ze extends Ge{constructor(n={}){const r=n.dkLen===void 0?64:n.dkLen;super(128,r);m(this,"v0l",j[0]|0);m(this,"v0h",j[1]|0);m(this,"v1l",j[2]|0);m(this,"v1h",j[3]|0);m(this,"v2l",j[4]|0);m(this,"v2h",j[5]|0);m(this,"v3l",j[6]|0);m(this,"v3h",j[7]|0);m(this,"v4l",j[8]|0);m(this,"v4h",j[9]|0);m(this,"v5l",j[10]|0);m(this,"v5h",j[11]|0);m(this,"v6l",j[12]|0);m(this,"v6h",j[13]|0);m(this,"v7l",j[14]|0);m(this,"v7h",j[15]|0);Ve(r,n,64,16,16);let{key:s,personalization:o,salt:f}=n,i=0;if(s!==void 0&&(q(s,void 0,"key"),i=s.length),this.v0l^=this.outputLen|i<<8|65536|1<<24,f!==void 0){q(f,void 0,"salt");const c=gt(f);this.v4l^=Y(c[0]),this.v4h^=Y(c[1]),this.v5l^=Y(c[2]),this.v5h^=Y(c[3])}if(o!==void 0){q(o,void 0,"personalization");const c=gt(o);this.v6l^=Y(c[0]),this.v6h^=Y(c[1]),this.v7l^=Y(c[2]),this.v7h^=Y(c[3])}if(s!==void 0){const c=new Uint8Array(this.blockLen);c.set(s),this.update(c)}}get(){let{v0l:n,v0h:r,v1l:s,v1h:o,v2l:f,v2h:i,v3l:c,v3h:h,v4l:a,v4h:l,v5l:y,v5h:w,v6l:u,v6h:d,v7l:b,v7h:x}=this;return[n,r,s,o,f,i,c,h,a,l,y,w,u,d,b,x]}set(n,r,s,o,f,i,c,h,a,l,y,w,u,d,b,x){this.v0l=n|0,this.v0h=r|0,this.v1l=s|0,this.v1h=o|0,this.v2l=f|0,this.v2h=i|0,this.v3l=c|0,this.v3h=h|0,this.v4l=a|0,this.v4h=l|0,this.v5l=y|0,this.v5h=w|0,this.v6l=u|0,this.v6h=d|0,this.v7l=b|0,this.v7h=x|0}compress(n,r,s){this.get().forEach((h,a)=>p[a]=h),p.set(j,16);let{h:o,l:f}=Me(BigInt(this.length));p[24]=j[8]^f,p[25]=j[9]^o,s&&(p[28]=~p[28],p[29]=~p[29]);let i=0;const c=Fe;for(let h=0;h<12;h++)et(0,4,8,12,n,r+2*c[i++]),nt(0,4,8,12,n,r+2*c[i++]),et(1,5,9,13,n,r+2*c[i++]),nt(1,5,9,13,n,r+2*c[i++]),et(2,6,10,14,n,r+2*c[i++]),nt(2,6,10,14,n,r+2*c[i++]),et(3,7,11,15,n,r+2*c[i++]),nt(3,7,11,15,n,r+2*c[i++]),et(0,5,10,15,n,r+2*c[i++]),nt(0,5,10,15,n,r+2*c[i++]),et(1,6,11,12,n,r+2*c[i++]),nt(1,6,11,12,n,r+2*c[i++]),et(2,7,8,13,n,r+2*c[i++]),nt(2,7,8,13,n,r+2*c[i++]),et(3,4,9,14,n,r+2*c[i++]),nt(3,4,9,14,n,r+2*c[i++]);this.v0l^=p[0]^p[16],this.v0h^=p[1]^p[17],this.v1l^=p[2]^p[18],this.v1h^=p[3]^p[19],this.v2l^=p[4]^p[20],this.v2h^=p[5]^p[21],this.v3l^=p[6]^p[22],this.v3h^=p[7]^p[23],this.v4l^=p[8]^p[24],this.v4h^=p[9]^p[25],this.v5l^=p[10]^p[26],this.v5h^=p[11]^p[27],this.v6l^=p[12]^p[28],this.v6h^=p[13]^p[29],this.v7l^=p[14]^p[30],this.v7h^=p[15]^p[31],X(p)}destroy(){this.destroyed=!0,X(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const xt=ge(e=>new ze(e)),be={Argond2d:0,Argon2i:1,Argon2id:2},mt=4,ee=(e,t="")=>e===void 0?Uint8Array.of():Ft(e,t);function Pt(e,t){const n=e&65535,r=e>>>16,s=t&65535,o=t>>>16,f=Math.imul(n,s),i=Math.imul(r,s),c=Math.imul(n,o),h=Math.imul(r,o),a=(f>>>16)+(i&65535)+c,l=h+(i>>>16)+(a>>>16)|0,y=a<<16|f&65535;return{h:l,l:y}}function Ye(e,t){const{h:n,l:r}=Pt(e,t);return{h:(n<<1|r>>>31)&4294967295,l:r<<1&4294967295}}function vt(e,t,n,r){const{h:s,l:o}=Ye(t,r),f=Yt(t,r,o);return{h:Xt(f,e,n,s),l:f|0}}const K=new Uint32Array(256);function rt(e,t,n,r){let s=K[2*e],o=K[2*e+1],f=K[2*t],i=K[2*t+1],c=K[2*n],h=K[2*n+1],a=K[2*r],l=K[2*r+1];({h:o,l:s}=vt(o,s,i,f)),{Dh:l,Dl:a}={Dh:l^o,Dl:a^s},{Dh:l,Dl:a}={Dh:ue(l,a),Dl:de(l)},{h,l:c}=vt(h,c,l,a),{Bh:i,Bl:f}={Bh:i^h,Bl:f^c},{Bh:i,Bl:f}={Bh:It(i,f,24),Bl:Ot(i,f,24)},{h:o,l:s}=vt(o,s,i,f),{Dh:l,Dl:a}={Dh:l^o,Dl:a^s},{Dh:l,Dl:a}={Dh:It(l,a,16),Dl:Ot(l,a,16)},{h,l:c}=vt(h,c,l,a),{Bh:i,Bl:f}={Bh:i^h,Bl:f^c},{Bh:i,Bl:f}={Bh:he(i,f,63),Bl:le(i,f,63)},K[2*e]=s,K[2*e+1]=o,K[2*t]=f,K[2*t+1]=i,K[2*n]=c,K[2*n+1]=h,K[2*r]=a,K[2*r+1]=l}function ne(e,t,n,r,s,o,f,i,c,h,a,l,y,w,u,d){rt(e,s,c,y),rt(t,o,h,w),rt(n,f,a,u),rt(r,i,l,d),rt(e,o,a,d),rt(t,f,l,y),rt(n,i,c,w),rt(r,s,h,u)}function Et(e,t,n,r,s){for(let o=0;o<256;o++)K[o]=e[t+o]^e[n+o];for(let o=0;o<128;o+=16)ne(o,o+1,o+2,o+3,o+4,o+5,o+6,o+7,o+8,o+9,o+10,o+11,o+12,o+13,o+14,o+15);for(let o=0;o<16;o+=2)ne(o,o+1,o+16,o+17,o+32,o+33,o+48,o+49,o+64,o+65,o+80,o+81,o+96,o+97,o+112,o+113);if(s)for(let o=0;o<256;o++)e[r+o]^=K[o]^e[t+o]^e[n+o];else for(let o=0;o<256;o++)e[r+o]=K[o]^e[t+o]^e[n+o];X(K)}function Kt(e,t){const n=Ht(e),r=new Uint32Array(1),s=Ht(r);if(r[0]=Y(t),t<=64)return xt.create({dkLen:t}).update(s).update(n).digest();const o=new Uint8Array(t);let f=xt.create({}).update(s).update(n).digest(),i=0;for(o.set(f.subarray(0,32)),i+=32;t-i>64;i+=32){const c=xt.create({}).update(f);c.digestInto(f),c.destroy(),o.set(f.subarray(0,32),i)}return o.set(xt(f,{dkLen:t-i}),i),X(f,r),o}function Xe(e,t,n,r,s,o,f=!1){let i;e===0?t===0?i=s-1:f?i=t*r+s-1:i=t*r+(s==0?-1:0):f?i=n-r+s-1:i=n-r+(s==0?-1:0);const c=e!==0&&t!==mt-1?(t+1)*r:0,h=i-1-Pt(i,Pt(o,o).h).h;return(c+h)%n}const xe=Math.pow(2,32);function st(e){return Number.isSafeInteger(e)&&e>=0&&e=Math.pow(2,24))throw new Error('"p" must be 1..2^24');if(!st(s))throw new Error('"m" must be 0..2^32');if(!st(o)||o<1)throw new Error('"t" (iterations) must be 1..2^32');if(i!==void 0&&typeof i!="function")throw new Error('"progressCb" must be a function');if(ct(c,"asyncTick"),!st(s)||s<8*r)throw new Error('"m" (memory) must be at least 8*p bytes');if(f!==16&&f!==19)throw new Error('"version" must be 0x10 or 0x13, got '+f);return t}function We(e,t,n,r){if(e=Ft(e,"password"),t=Ft(t,"salt"),!st(e.length))throw new Error('"password" must be less of length 1..4Gb');if(!st(t.length)||t.length<8)throw new Error('"salt" must be of length 8..4Gb');if(!Object.values(be).includes(n))throw new Error('"type" was invalid');let{p:s,dkLen:o,m:f,t:i,version:c,key:h,personalization:a,maxmem:l,onProgress:y,asyncTick:w}=qe(r);h=ee(h,"key"),a=ee(a,"personalization");const u=xt.create(),d=new Uint32Array(1),b=Ht(d);for(let L of[s,o,f,i,c,n])d[0]=Y(L),u.update(b);for(let L of[e,t,h,a])d[0]=Y(L.length),u.update(b).update(L);const x=new Uint32Array(18),A=Ht(x);u.digestInto(A);const _=s,B=4*s*Math.floor(f/(mt*s)),D=Math.floor(B/s),$=Math.floor(D/mt),O=B*1024;if(!st(l))throw new Error('"maxmem" expected <2**32, got '+l);if(O>l)throw new Error('"maxmem" limit was hit: memUsed(mP*1024)='+O+", maxmem="+l);const P=new Uint32Array(O/4);for(let L=0;L{};if(y){const L=i*mt*s*$-2*s,U=Math.max(Math.floor(L/1e4),1);let v=0;I=()=>{v++,y&&(!(v%U)||v===L)&&y(v/L)}}return X(d,x),{type:n,mP:B,p:s,t:i,version:c,B:P,laneLen:D,lanes:_,segmentLen:$,dkLen:o,perBlock:I,asyncTick:w}}function Je(e,t,n,r){const s=new Uint32Array(256);for(let f=0;fQe(be.Argon2id,e,t,n);/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */function en(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function jt(e){if(typeof e!="boolean")throw new TypeError(`boolean expected, not ${e}`)}function At(e){if(typeof e!="number")throw new TypeError("number expected, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError("positive integer expected, got "+e)}function z(e,t,n=""){const r=en(e),s=e==null?void 0:e.length,o=t!==void 0;if(!r||o&&s!==t){const f=n&&`"${n}" `,i=o?` of length ${t}`:"",c=r?`length=${s}`:`type=${typeof e}`,h=f+"expected Uint8Array"+i+", got "+c;throw r?new RangeError(h):new TypeError(h)}return e}function re(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function nn(e,t,n=!1){z(e,void 0,"output");const r=t.outputLen;if(e.lengthe<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,G=at?e=>e:e=>me(e)>>>0,on=e=>{for(let t=0;te:on;function sn(e,t){if(t==null||typeof t!="object")throw new Error("options must be defined");return Object.assign(e,t)}function fn(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r[],o=(i,c)=>r(c,...s(i)).update(i).digest(),f=r(new Uint8Array(e),...s(new Uint8Array(0)));return o.outputLen=f.outputLen,o.blockLen=f.blockLen,o.create=(i,...c)=>r(i,...c),o}const an=(e,t)=>{function n(r,...s){if(z(r,void 0,"key"),e.nonceLength!==void 0){const a=s[0];z(a,e.varSizeNonce?void 0:e.nonceLength,"nonce")}const o=e.tagLength;o&&s[1]!==void 0&&z(s[1],void 0,"AAD");const f=t(r,...s),i=(a,l)=>{if(l!==void 0){if(a!==2)throw new Error("cipher output not supported");z(l,void 0,"output")}};let c=!1;return{encrypt(a,l){if(c)throw new Error("cannot encrypt() twice with same key + nonce");return c=!0,z(a),i(f.encrypt.length,l),f.encrypt(a,l)},decrypt(a,l){if(z(a),o&&a.lengthUint8Array.from(e.split(""),t=>t.charCodeAt(0)),ln=it(Q(Ee("expand 16-byte k"))),un=it(Q(Ee("expand 32-byte k")));function g(e,t){return e<>>32-t}const bt=64,dn=16,Gt=2**32-1,oe=Uint32Array.of();function pn(e,t,n,r,s,o,f,i){const c=s.length,h=new Uint8Array(bt),a=Q(h),l=at&&Lt(s)&&Lt(o),y=l?Q(s):oe,w=l?Q(o):oe;if(!at){for(let u=0;u=Gt)throw new Error("arx: counter overflow");const d=Math.min(bt,c-u);for(let b=0,x;b=Gt)throw new Error("arx: counter overflow");const d=Math.min(bt,c-u);if(l&&d===bt){const b=u/4;if(u%4!==0)throw new Error("arx: invalid block position");for(let x=0,A;x{z(i,void 0,"key"),z(c,void 0,"nonce"),z(h,void 0,"data");const y=h.length;if(a=Vt(y,a,!1),At(l),l<0||l>=Gt)throw new Error("arx: counter overflow");const w=[];let u=i.length,d,b;if(u===32)w.push(d=St(i)),b=un;else if(u===16&&n)d=new Uint8Array(32),d.set(i),d.set(i,16),b=ln,w.push(d);else throw z(i,32,"arx key"),new Error("invalid key size");(!at||!Lt(c))&&w.push(c=St(c));let x=Q(d);if(r){if(c.length!==24)throw new Error("arx: extended nonce must be 24 bytes");const B=c.subarray(0,16);if(at)r(b,x,Q(B),x);else{const D=it(Uint32Array.from(b));r(D,x,Q(B),x),ft(D),it(x)}c=c.subarray(16)}else at||it(x);const A=16-s;if(A!==c.length)throw new Error(`arx: nonce must be ${A} or 16 bytes`);if(A!==12){const B=new Uint8Array(12);B.set(c,o?0:12-c.length),c=B,w.push(c)}const _=it(Q(c));try{return pn(e,b,x,_,h,a,l,f),a}finally{ft(...w)}}}function V(e,t){return e[t++]&255|(e[t++]&255)<<8}class wn{constructor(t){m(this,"blockLen",16);m(this,"outputLen",16);m(this,"buffer",new Uint8Array(16));m(this,"r",new Uint16Array(10));m(this,"h",new Uint16Array(10));m(this,"pad",new Uint16Array(8));m(this,"pos",0);m(this,"finished",!1);m(this,"destroyed",!1);t=St(z(t,32,"key"));const n=V(t,0),r=V(t,2),s=V(t,4),o=V(t,6),f=V(t,8),i=V(t,10),c=V(t,12),h=V(t,14);this.r[0]=n&8191,this.r[1]=(n>>>13|r<<3)&8191,this.r[2]=(r>>>10|s<<6)&7939,this.r[3]=(s>>>7|o<<9)&8191,this.r[4]=(o>>>4|f<<12)&255,this.r[5]=f>>>1&8190,this.r[6]=(f>>>14|i<<2)&8191,this.r[7]=(i>>>11|c<<5)&8065,this.r[8]=(c>>>8|h<<8)&8191,this.r[9]=h>>>5&127;for(let a=0;a<8;a++)this.pad[a]=V(t,16+2*a)}process(t,n,r=!1){const s=r?0:2048,{h:o,r:f}=this,i=f[0],c=f[1],h=f[2],a=f[3],l=f[4],y=f[5],w=f[6],u=f[7],d=f[8],b=f[9],x=V(t,n+0),A=V(t,n+2),_=V(t,n+4),B=V(t,n+6),D=V(t,n+8),$=V(t,n+10),O=V(t,n+12),P=V(t,n+14);let I=o[0]+(x&8191),L=o[1]+((x>>>13|A<<3)&8191),U=o[2]+((A>>>10|_<<6)&8191),v=o[3]+((_>>>7|B<<9)&8191),H=o[4]+((B>>>4|D<<12)&8191),S=o[5]+(D>>>1&8191),T=o[6]+((D>>>14|$<<2)&8191),k=o[7]+(($>>>11|O<<5)&8191),C=o[8]+((O>>>8|P<<8)&8191),R=o[9]+(P>>>5|s),E=0,N=E+I*i+L*(5*b)+U*(5*d)+v*(5*u)+H*(5*w);E=N>>>13,N&=8191,N+=S*(5*y)+T*(5*l)+k*(5*a)+C*(5*h)+R*(5*c),E+=N>>>13,N&=8191;let F=E+I*c+L*i+U*(5*b)+v*(5*d)+H*(5*u);E=F>>>13,F&=8191,F+=S*(5*w)+T*(5*y)+k*(5*l)+C*(5*a)+R*(5*h),E+=F>>>13,F&=8191;let M=E+I*h+L*c+U*i+v*(5*b)+H*(5*d);E=M>>>13,M&=8191,M+=S*(5*u)+T*(5*w)+k*(5*y)+C*(5*l)+R*(5*a),E+=M>>>13,M&=8191;let J=E+I*a+L*h+U*c+v*i+H*(5*b);E=J>>>13,J&=8191,J+=S*(5*d)+T*(5*u)+k*(5*w)+C*(5*y)+R*(5*l),E+=J>>>13,J&=8191;let ht=E+I*l+L*a+U*h+v*c+H*i;E=ht>>>13,ht&=8191,ht+=S*(5*b)+T*(5*d)+k*(5*u)+C*(5*w)+R*(5*y),E+=ht>>>13,ht&=8191;let lt=E+I*y+L*l+U*a+v*h+H*c;E=lt>>>13,lt&=8191,lt+=S*i+T*(5*b)+k*(5*d)+C*(5*u)+R*(5*w),E+=lt>>>13,lt&=8191;let ut=E+I*w+L*y+U*l+v*a+H*h;E=ut>>>13,ut&=8191,ut+=S*c+T*i+k*(5*b)+C*(5*d)+R*(5*u),E+=ut>>>13,ut&=8191;let dt=E+I*u+L*w+U*y+v*l+H*a;E=dt>>>13,dt&=8191,dt+=S*h+T*c+k*i+C*(5*b)+R*(5*d),E+=dt>>>13,dt&=8191;let pt=E+I*d+L*u+U*w+v*y+H*l;E=pt>>>13,pt&=8191,pt+=S*a+T*h+k*c+C*i+R*(5*b),E+=pt>>>13,pt&=8191;let yt=E+I*b+L*d+U*u+v*w+H*y;E=yt>>>13,yt&=8191,yt+=S*l+T*a+k*h+C*c+R*i,E+=yt>>>13,yt&=8191,E=(E<<2)+E|0,E=E+N|0,N=E&8191,E=E>>>13,F+=E,o[0]=N,o[1]=F,o[2]=M,o[3]=J,o[4]=ht,o[5]=lt,o[6]=ut,o[7]=dt,o[8]=pt,o[9]=yt}finalize(){const{h:t,pad:n}=this,r=new Uint16Array(10);let s=t[1]>>>13;t[1]&=8191;for(let i=2;i<10;i++)t[i]+=s,s=t[i]>>>13,t[i]&=8191;t[0]+=s*5,s=t[0]>>>13,t[0]&=8191,t[1]+=s,s=t[1]>>>13,t[1]&=8191,t[2]+=s,r[0]=t[0]+5,s=r[0]>>>13,r[0]&=8191;for(let i=1;i<10;i++)r[i]=t[i]+s,s=r[i]>>>13,r[i]&=8191;r[9]-=8192;let o=(s^1)-1;for(let i=0;i<10;i++)r[i]&=o;o=~o;for(let i=0;i<10;i++)t[i]=t[i]&o|r[i];t[0]=(t[0]|t[1]<<13)&65535,t[1]=(t[1]>>>3|t[2]<<10)&65535,t[2]=(t[2]>>>6|t[3]<<7)&65535,t[3]=(t[3]>>>9|t[4]<<4)&65535,t[4]=(t[4]>>>12|t[5]<<1|t[6]<<14)&65535,t[5]=(t[6]>>>2|t[7]<<11)&65535,t[6]=(t[7]>>>5|t[8]<<8)&65535,t[7]=(t[8]>>>8|t[9]<<5)&65535;let f=t[0]+n[0];t[0]=f&65535;for(let i=1;i<8;i++)f=(t[i]+n[i]|0)+(f>>>16)|0,t[i]=f&65535;ft(r)}update(t){re(this),z(t),t=St(t);const{buffer:n,blockLen:r}=this,s=t.length;for(let o=0;o>>0,t[o++]=r[f]>>>8}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}}const gn=cn(32,e=>new wn(e));function bn(e,t,n,r,s,o=20){let f=e[0],i=e[1],c=e[2],h=e[3],a=t[0],l=t[1],y=t[2],w=t[3],u=t[4],d=t[5],b=t[6],x=t[7],A=s,_=n[0],B=n[1],D=n[2],$=f,O=i,P=c,I=h,L=a,U=l,v=y,H=w,S=u,T=d,k=b,C=x,R=A,E=_,N=B,F=D;for(let J=0;J{e.update(t);const n=t.length%16;n&&e.update(En.subarray(n))},An=new Uint8Array(32);function ie(e,t,n,r,s){s!==void 0&&z(s,void 0,"AAD");const o=e(t,n,An),f=hn(r.length,s?s.length:0,!0),i=gn.create(o);s&&se(i,s),se(i,r),i.update(f);const c=i.digest();return ft(o,f),c}const Ln=e=>(t,n,r)=>({encrypt(o,f){const i=o.length;f=Vt(i+16,f,!1),f.set(o);const c=f.subarray(0,-16);e(t,n,c,c,1);const h=ie(e,t,n,c,r);return f.set(h,i),ft(h),f},decrypt(o,f){f=Vt(o.length-16,f,!1);const i=o.subarray(0,-16),c=o.subarray(-16),h=ie(e,t,n,i,r);if(!fn(c,h))throw ft(h),new Error("invalid tag");return f.set(o.subarray(0,-16)),e(t,n,f,f,1),ft(h),f}}),Jt=an({blockSize:64,nonceLength:24,tagLength:16},Ln(mn));class fe{constructor(t,n){m(this,"oHash");m(this,"iHash");m(this,"blockLen");m(this,"outputLen");m(this,"canXOF",!1);m(this,"finished",!1);m(this,"destroyed",!1);if(qt(t),q(n,void 0,"key"),this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,s=new Uint8Array(r);s.set(n.length>r?t.create().update(n).digest():n);for(let o=0;o{const e=(t,n,r)=>new fe(t,n).update(r).digest();return e.create=(t,n)=>new fe(t,n),e})();function _n(e,t,n){return qt(e),n===void 0&&(n=new Uint8Array(e.outputLen)),Ae(e,n,t)}const Mt=Uint8Array.of(0),ce=Uint8Array.of();function Un(e,t,n,r=32){qt(e),ct(r,"length"),q(t,void 0,"prk");const s=e.outputLen;if(t.length255*s)throw new Error("Length must be <= 255*HashLen");const o=Math.ceil(r/s);n===void 0?n=ce:q(n,void 0,"info");const f=new Uint8Array(o*s),i=Ae.create(e,t),c=i._cloneInto(),h=new Uint8Array(i.outputLen);for(let a=0;aUn(e,_n(e,t,n),r,s),Bn=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ot=new Uint32Array(64);class In extends je{constructor(t){super(64,t,8,!1)}get(){const{A:t,B:n,C:r,D:s,E:o,F:f,G:i,H:c}=this;return[t,n,r,s,o,f,i,c]}set(t,n,r,s,o,f,i,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=o|0,this.F=f|0,this.G=i|0,this.H=c|0}process(t,n){for(let l=0;l<16;l++,n+=4)ot[l]=t.getUint32(n,!1);for(let l=16;l<64;l++){const y=ot[l-15],w=ot[l-2],u=W(y,7)^W(y,18)^y>>>3,d=W(w,17)^W(w,19)^w>>>10;ot[l]=d+ot[l-7]+u+ot[l-16]|0}let{A:r,B:s,C:o,D:f,E:i,F:c,G:h,H:a}=this;for(let l=0;l<64;l++){const y=W(i,6)^W(i,11)^W(i,25),w=a+y+Pe(i,c,h)+Bn[l]+ot[l]|0,d=(W(r,2)^W(r,13)^W(r,22))+Ke(r,s,o)|0;a=h,h=c,c=i,i=f+w|0,f=o,o=s,s=r,r=w+d|0}r=r+this.A|0,s=s+this.B|0,o=o+this.C|0,f=f+this.D|0,i=i+this.E|0,c=c+this.F|0,h=h+this.G|0,a=a+this.H|0,this.set(r,s,o,f,i,c,h,a)}roundClean(){X(ot)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),X(this.buffer)}}class On extends In{constructor(){super(32);m(this,"A",tt[0]|0);m(this,"B",tt[1]|0);m(this,"C",tt[2]|0);m(this,"D",tt[3]|0);m(this,"E",tt[4]|0);m(this,"F",tt[5]|0);m(this,"G",tt[6]|0);m(this,"H",tt[7]|0)}}const Hn=ge(()=>new On,Ne(1)),Le="atterm-relay",_e=_t("atterm-account-key-v1");function Ue(){return{alg:"argon2id",m:64*1024,t:3,p:1}}function ve(e,t,n){return tn(_t(e),t,{m:n.m,t:n.t,p:n.p,dkLen:32})}function Sn(e,t,n=Ue()){if(t.length!==32)throw new Error(`accountKey must be 32 bytes, got ${t.length}`);const r=te(16),s=ve(e,r,n),o=te(24),i=Jt(s,o,_e).encrypt(t);return{method:"password",wrapped:Dt(i),nonce:Dt(o),salt:Dt(r),kdf_params:JSON.stringify(n)}}function Tn(e,t){const n=JSON.parse(t.kdf_params);if(n.alg!=="argon2id")throw new Error(`unsupported kdf alg: ${n.alg}`);const r=$t(t.salt),s=ve(e,r,n),o=$t(t.nonce),f=Jt(s,o,_e);try{return f.decrypt($t(t.wrapped))}catch{throw new Error("invalid password")}}function Dt(e){return btoa(String.fromCharCode(...e))}function $t(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),r=atob(t+n),s=new Uint8Array(r.length);for(let o=0;o"u")throw new Error("opaque wasm: no DOM to load the Go runtime");const{default:e}=await ae(async()=>{const{default:t}=await import("./wasm_exec-BVJFcdQq.js");return{default:t}},[]);await new Promise((t,n)=>{const r=document.createElement("script");r.src=e,r.onload=()=>t(),r.onerror=()=>n(new Error("opaque wasm: failed to load wasm_exec.js")),document.head.appendChild(r)})}function kt(){return Bt||(Bt=(async()=>{await Dn();const{default:e}=await ae(async()=>{const{default:o}=await import("./opaque-BH0YqBjY.js");return{default:o}},[]),t=globalThis.Go,n=new t;let r;try{r=await WebAssembly.instantiateStreaming(fetch(e),n.importObject)}catch{const o=await fetch(e);r=await WebAssembly.instantiate(await o.arrayBuffer(),n.importObject)}n.run(r.instance);const s=globalThis.attermOpaque;if(!s)throw new Error("opaque wasm did not initialize");return s})(),Bt)}function Ct(e){if(e&&typeof e=="object"&&"error"in e)throw new Error(e.error);return e}async function $n(e){return Ct((await kt()).registerInit(e))}async function Nn(e,t,n,r){return Ct((await kt()).registerFinish(e,t,n,r))}async function Fn(e){return Ct((await kt()).loginInit(e))}async function Pn(e,t,n,r){return Ct((await kt()).loginFinish(e,t,n,r))}const Zt="atterm.account-key";function Kn(e){return btoa(String.fromCharCode(...e))}function jn(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r"u"||sessionStorage.setItem(Zt,Kn(e))}function Jn(){if(typeof sessionStorage>"u")return null;const e=sessionStorage.getItem(Zt);if(!e)return null;try{return jn(e)}catch{return null}}function Vn(){typeof sessionStorage>"u"||sessionStorage.removeItem(Zt)}async function Zn(){const{data:e}=await zt("/api/bootstrap/status");return e}function He(e,t,n){const r=ke(),s=t??(r==null?void 0:r.realmId),o=n??(r==null?void 0:r.homeInstanceURL);Ce({baseURL:(r==null?void 0:r.baseURL)??"",allowInsecure:(r==null?void 0:r.allowInsecure)??!1,sessionToken:e,expiresAt:null,...s!==void 0?{realmId:s}:{},...o!==void 0?{homeInstanceURL:o}:{}})}async function Tt(e,t){const{data:n}=await zt(e,{method:"POST",body:JSON.stringify(t)});return n}async function Qn(e,t){const{handle:n,ke1:r}=await Fn(t),s=await Tt("/api/auth/login/init",{email:e,login_ke:r});let o;try{({ke3:o}=await Pn(n,s.login_response,Le,e))}catch{throw new Error("invalid credentials")}const f=await Tt("/api/auth/login/finalize",{email:e,session_id:s.session_id,login_ke3:o}),i=Tn(t,f.account_key_wrap);return Oe(i),He(f.session_token,f.realm_id,f.home_instance_url),{user_id:f.user_id,email:e}}async function Gn(e,t,n=""){const{handle:r,ke1:s}=await $n(t),o=await Tt("/api/auth/register/init",{email:e,registration_ke:s}),{record:f}=await Nn(r,o.registration_response,Le,e),i=new Uint8Array(32);crypto.getRandomValues(i);const c=Sn(t,i,Ue()),h={email:e,registration_record:f,account_key_wrap:c};n&&(h.claim_token=n);const a=await Tt("/api/auth/register/finalize",h);return Oe(i),He(a.session_token),{user_id:a.user_id,email:e,is_admin:a.is_admin}}async function tr(e,t,n=""){return Gn(e,t,n)}async function er(){try{await zt("/api/auth/logout",{method:"POST"})}finally{Vn(),Re()}}export{Le as S,Qn as a,er as b,Fn as c,Wn as d,qn as e,Zn as g,Jn as l,Pn as o,Gn as r,tr as s}; +var Se=Object.defineProperty;var Te=(e,t,n)=>t in e?Se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var m=(e,t,n)=>Te(e,typeof t!="symbol"?t+"":t,n);import{a as zt}from"./client-n-fLEpOg.js";import{_ as ae,be as ke,bV as Ce,Z as Re}from"./useI18n-D4u8zssu.js";const Ut=BigInt(2**32-1),Qt=BigInt(32);function Me(e,t=!1){return t?{h:Number(e&Ut),l:Number(e>>Qt&Ut)}:{h:Number(e>>Qt&Ut)|0,l:Number(e&Ut)|0}}const It=(e,t,n)=>e>>>n|t<<32-n,Ot=(e,t,n)=>e<<32-n|t>>>n,he=(e,t,n)=>e<<64-n|t>>>n-32,le=(e,t,n)=>e>>>n-32|t<<64-n,ue=(e,t)=>t,de=(e,t)=>e;function pe(e,t,n,r){const s=(t>>>0)+(r>>>0);return{h:e+n+(s/2**32|0)|0,l:s|0}}const Yt=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),Xt=(e,t,n,r)=>t+n+r+(e/2**32|0)|0;function De(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function ct(e,t=""){if(typeof e!="number"){const n=t&&`"${t}" `;throw new TypeError(`${n}expected number, got ${typeof e}`)}if(!Number.isSafeInteger(e)||e<0){const n=t&&`"${t}" `;throw new RangeError(`${n}expected integer >= 0, got ${e}`)}}function q(e,t,n=""){const r=De(e),s=e==null?void 0:e.length,o=t!==void 0;if(!r||o&&s!==t){const f=n&&`"${n}" `,i=o?` of length ${t}`:"",c=r?`length=${s}`:`type=${typeof e}`,h=f+"expected Uint8Array"+i+", got "+c;throw r?new RangeError(h):new TypeError(h)}return e}function qt(e){if(typeof e!="function"||typeof e.create!="function")throw new TypeError("Hash must wrapped by utils.createHasher");if(ct(e.outputLen),ct(e.blockLen),e.outputLen<1)throw new Error('"outputLen" must be >= 1');if(e.blockLen<1)throw new Error('"blockLen" must be >= 1')}function wt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Wt(e,t){q(e,void 0,"digestInto() output");const n=t.outputLen;if(e.length='+n)}function Ht(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function gt(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function X(...e){for(let t=0;t>>t}const ye=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function we(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const Y=ye?e=>e:e=>we(e)>>>0;function $e(e){for(let t=0;te:$e;function _t(e){if(typeof e!="string")throw new TypeError("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Ft(e,t=""){return typeof e=="string"?_t(e):q(e,void 0,t)}function ge(e,t={}){const n=(s,o)=>e(o).update(s).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=s=>e(s),Object.assign(n,t),Object.freeze(n)}function te(e=32){ct(e,"bytesLength");const t=typeof globalThis=="object"?globalThis.crypto:null;if(typeof(t==null?void 0:t.getRandomValues)!="function")throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const Ne=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])}),Fe=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]);function Pe(e,t,n){return e&t^~e&n}function Ke(e,t,n){return e&t^e&n^t&n}class je{constructor(t,n,r,s){m(this,"blockLen");m(this,"outputLen");m(this,"canXOF",!1);m(this,"padOffset");m(this,"isLE");m(this,"buffer");m(this,"view");m(this,"finished",!1);m(this,"length",0);m(this,"pos",0);m(this,"destroyed",!1);this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(t),this.view=Rt(this.buffer)}update(t){wt(this),q(t);const{view:n,buffer:r,blockLen:s}=this,o=t.length;for(let f=0;fs-f&&(this.process(r,0),f=0);for(let l=f;la.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;ln)throw new Error("outputLen bigger than keyLen");const{key:o,salt:f,personalization:i}=t;if(o!==void 0&&(o.length<1||o.length>n))throw new Error('"key" expected to be undefined or of length=1..'+n);f!==void 0&&q(f,r,"salt"),i!==void 0&&q(i,s,"personalization")}class Ge{constructor(t,n){m(this,"buffer");m(this,"buffer32");m(this,"finished",!1);m(this,"destroyed",!1);m(this,"length",0);m(this,"pos",0);m(this,"blockLen");m(this,"outputLen");m(this,"canXOF",!1);ct(t),ct(n),this.blockLen=t,this.outputLen=n,this.buffer=new Uint8Array(t),this.buffer32=gt(this.buffer)}update(t){wt(this),q(t);const{blockLen:n,buffer:r,buffer32:s}=this,o=t.length,f=t.byteOffset,i=t.buffer;for(let c=0;c>>8*a}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){const{buffer:n,length:r,finished:s,destroyed:o,outputLen:f,pos:i}=this;return t||(t=new this.constructor({dkLen:f})),t.set(...this.get()),t.buffer.set(n),t.destroyed=o,t.finished=s,t.length=r,t.pos=i,t.outputLen=f,t}clone(){return this._cloneInto()}}class ze extends Ge{constructor(n={}){const r=n.dkLen===void 0?64:n.dkLen;super(128,r);m(this,"v0l",j[0]|0);m(this,"v0h",j[1]|0);m(this,"v1l",j[2]|0);m(this,"v1h",j[3]|0);m(this,"v2l",j[4]|0);m(this,"v2h",j[5]|0);m(this,"v3l",j[6]|0);m(this,"v3h",j[7]|0);m(this,"v4l",j[8]|0);m(this,"v4h",j[9]|0);m(this,"v5l",j[10]|0);m(this,"v5h",j[11]|0);m(this,"v6l",j[12]|0);m(this,"v6h",j[13]|0);m(this,"v7l",j[14]|0);m(this,"v7h",j[15]|0);Ve(r,n,64,16,16);let{key:s,personalization:o,salt:f}=n,i=0;if(s!==void 0&&(q(s,void 0,"key"),i=s.length),this.v0l^=this.outputLen|i<<8|65536|1<<24,f!==void 0){q(f,void 0,"salt");const c=gt(f);this.v4l^=Y(c[0]),this.v4h^=Y(c[1]),this.v5l^=Y(c[2]),this.v5h^=Y(c[3])}if(o!==void 0){q(o,void 0,"personalization");const c=gt(o);this.v6l^=Y(c[0]),this.v6h^=Y(c[1]),this.v7l^=Y(c[2]),this.v7h^=Y(c[3])}if(s!==void 0){const c=new Uint8Array(this.blockLen);c.set(s),this.update(c)}}get(){let{v0l:n,v0h:r,v1l:s,v1h:o,v2l:f,v2h:i,v3l:c,v3h:h,v4l:a,v4h:l,v5l:y,v5h:w,v6l:u,v6h:d,v7l:b,v7h:x}=this;return[n,r,s,o,f,i,c,h,a,l,y,w,u,d,b,x]}set(n,r,s,o,f,i,c,h,a,l,y,w,u,d,b,x){this.v0l=n|0,this.v0h=r|0,this.v1l=s|0,this.v1h=o|0,this.v2l=f|0,this.v2h=i|0,this.v3l=c|0,this.v3h=h|0,this.v4l=a|0,this.v4h=l|0,this.v5l=y|0,this.v5h=w|0,this.v6l=u|0,this.v6h=d|0,this.v7l=b|0,this.v7h=x|0}compress(n,r,s){this.get().forEach((h,a)=>p[a]=h),p.set(j,16);let{h:o,l:f}=Me(BigInt(this.length));p[24]=j[8]^f,p[25]=j[9]^o,s&&(p[28]=~p[28],p[29]=~p[29]);let i=0;const c=Fe;for(let h=0;h<12;h++)et(0,4,8,12,n,r+2*c[i++]),nt(0,4,8,12,n,r+2*c[i++]),et(1,5,9,13,n,r+2*c[i++]),nt(1,5,9,13,n,r+2*c[i++]),et(2,6,10,14,n,r+2*c[i++]),nt(2,6,10,14,n,r+2*c[i++]),et(3,7,11,15,n,r+2*c[i++]),nt(3,7,11,15,n,r+2*c[i++]),et(0,5,10,15,n,r+2*c[i++]),nt(0,5,10,15,n,r+2*c[i++]),et(1,6,11,12,n,r+2*c[i++]),nt(1,6,11,12,n,r+2*c[i++]),et(2,7,8,13,n,r+2*c[i++]),nt(2,7,8,13,n,r+2*c[i++]),et(3,4,9,14,n,r+2*c[i++]),nt(3,4,9,14,n,r+2*c[i++]);this.v0l^=p[0]^p[16],this.v0h^=p[1]^p[17],this.v1l^=p[2]^p[18],this.v1h^=p[3]^p[19],this.v2l^=p[4]^p[20],this.v2h^=p[5]^p[21],this.v3l^=p[6]^p[22],this.v3h^=p[7]^p[23],this.v4l^=p[8]^p[24],this.v4h^=p[9]^p[25],this.v5l^=p[10]^p[26],this.v5h^=p[11]^p[27],this.v6l^=p[12]^p[28],this.v6h^=p[13]^p[29],this.v7l^=p[14]^p[30],this.v7h^=p[15]^p[31],X(p)}destroy(){this.destroyed=!0,X(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const xt=ge(e=>new ze(e)),be={Argond2d:0,Argon2i:1,Argon2id:2},mt=4,ee=(e,t="")=>e===void 0?Uint8Array.of():Ft(e,t);function Pt(e,t){const n=e&65535,r=e>>>16,s=t&65535,o=t>>>16,f=Math.imul(n,s),i=Math.imul(r,s),c=Math.imul(n,o),h=Math.imul(r,o),a=(f>>>16)+(i&65535)+c,l=h+(i>>>16)+(a>>>16)|0,y=a<<16|f&65535;return{h:l,l:y}}function Ye(e,t){const{h:n,l:r}=Pt(e,t);return{h:(n<<1|r>>>31)&4294967295,l:r<<1&4294967295}}function vt(e,t,n,r){const{h:s,l:o}=Ye(t,r),f=Yt(t,r,o);return{h:Xt(f,e,n,s),l:f|0}}const K=new Uint32Array(256);function rt(e,t,n,r){let s=K[2*e],o=K[2*e+1],f=K[2*t],i=K[2*t+1],c=K[2*n],h=K[2*n+1],a=K[2*r],l=K[2*r+1];({h:o,l:s}=vt(o,s,i,f)),{Dh:l,Dl:a}={Dh:l^o,Dl:a^s},{Dh:l,Dl:a}={Dh:ue(l,a),Dl:de(l)},{h,l:c}=vt(h,c,l,a),{Bh:i,Bl:f}={Bh:i^h,Bl:f^c},{Bh:i,Bl:f}={Bh:It(i,f,24),Bl:Ot(i,f,24)},{h:o,l:s}=vt(o,s,i,f),{Dh:l,Dl:a}={Dh:l^o,Dl:a^s},{Dh:l,Dl:a}={Dh:It(l,a,16),Dl:Ot(l,a,16)},{h,l:c}=vt(h,c,l,a),{Bh:i,Bl:f}={Bh:i^h,Bl:f^c},{Bh:i,Bl:f}={Bh:he(i,f,63),Bl:le(i,f,63)},K[2*e]=s,K[2*e+1]=o,K[2*t]=f,K[2*t+1]=i,K[2*n]=c,K[2*n+1]=h,K[2*r]=a,K[2*r+1]=l}function ne(e,t,n,r,s,o,f,i,c,h,a,l,y,w,u,d){rt(e,s,c,y),rt(t,o,h,w),rt(n,f,a,u),rt(r,i,l,d),rt(e,o,a,d),rt(t,f,l,y),rt(n,i,c,w),rt(r,s,h,u)}function Et(e,t,n,r,s){for(let o=0;o<256;o++)K[o]=e[t+o]^e[n+o];for(let o=0;o<128;o+=16)ne(o,o+1,o+2,o+3,o+4,o+5,o+6,o+7,o+8,o+9,o+10,o+11,o+12,o+13,o+14,o+15);for(let o=0;o<16;o+=2)ne(o,o+1,o+16,o+17,o+32,o+33,o+48,o+49,o+64,o+65,o+80,o+81,o+96,o+97,o+112,o+113);if(s)for(let o=0;o<256;o++)e[r+o]^=K[o]^e[t+o]^e[n+o];else for(let o=0;o<256;o++)e[r+o]=K[o]^e[t+o]^e[n+o];X(K)}function Kt(e,t){const n=Ht(e),r=new Uint32Array(1),s=Ht(r);if(r[0]=Y(t),t<=64)return xt.create({dkLen:t}).update(s).update(n).digest();const o=new Uint8Array(t);let f=xt.create({}).update(s).update(n).digest(),i=0;for(o.set(f.subarray(0,32)),i+=32;t-i>64;i+=32){const c=xt.create({}).update(f);c.digestInto(f),c.destroy(),o.set(f.subarray(0,32),i)}return o.set(xt(f,{dkLen:t-i}),i),X(f,r),o}function Xe(e,t,n,r,s,o,f=!1){let i;e===0?t===0?i=s-1:f?i=t*r+s-1:i=t*r+(s==0?-1:0):f?i=n-r+s-1:i=n-r+(s==0?-1:0);const c=e!==0&&t!==mt-1?(t+1)*r:0,h=i-1-Pt(i,Pt(o,o).h).h;return(c+h)%n}const xe=Math.pow(2,32);function st(e){return Number.isSafeInteger(e)&&e>=0&&e=Math.pow(2,24))throw new Error('"p" must be 1..2^24');if(!st(s))throw new Error('"m" must be 0..2^32');if(!st(o)||o<1)throw new Error('"t" (iterations) must be 1..2^32');if(i!==void 0&&typeof i!="function")throw new Error('"progressCb" must be a function');if(ct(c,"asyncTick"),!st(s)||s<8*r)throw new Error('"m" (memory) must be at least 8*p bytes');if(f!==16&&f!==19)throw new Error('"version" must be 0x10 or 0x13, got '+f);return t}function We(e,t,n,r){if(e=Ft(e,"password"),t=Ft(t,"salt"),!st(e.length))throw new Error('"password" must be less of length 1..4Gb');if(!st(t.length)||t.length<8)throw new Error('"salt" must be of length 8..4Gb');if(!Object.values(be).includes(n))throw new Error('"type" was invalid');let{p:s,dkLen:o,m:f,t:i,version:c,key:h,personalization:a,maxmem:l,onProgress:y,asyncTick:w}=qe(r);h=ee(h,"key"),a=ee(a,"personalization");const u=xt.create(),d=new Uint32Array(1),b=Ht(d);for(let L of[s,o,f,i,c,n])d[0]=Y(L),u.update(b);for(let L of[e,t,h,a])d[0]=Y(L.length),u.update(b).update(L);const x=new Uint32Array(18),A=Ht(x);u.digestInto(A);const _=s,B=4*s*Math.floor(f/(mt*s)),D=Math.floor(B/s),$=Math.floor(D/mt),O=B*1024;if(!st(l))throw new Error('"maxmem" expected <2**32, got '+l);if(O>l)throw new Error('"maxmem" limit was hit: memUsed(mP*1024)='+O+", maxmem="+l);const P=new Uint32Array(O/4);for(let L=0;L{};if(y){const L=i*mt*s*$-2*s,U=Math.max(Math.floor(L/1e4),1);let v=0;I=()=>{v++,y&&(!(v%U)||v===L)&&y(v/L)}}return X(d,x),{type:n,mP:B,p:s,t:i,version:c,B:P,laneLen:D,lanes:_,segmentLen:$,dkLen:o,perBlock:I,asyncTick:w}}function Je(e,t,n,r){const s=new Uint32Array(256);for(let f=0;fQe(be.Argon2id,e,t,n);/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */function en(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function jt(e){if(typeof e!="boolean")throw new TypeError(`boolean expected, not ${e}`)}function At(e){if(typeof e!="number")throw new TypeError("number expected, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError("positive integer expected, got "+e)}function z(e,t,n=""){const r=en(e),s=e==null?void 0:e.length,o=t!==void 0;if(!r||o&&s!==t){const f=n&&`"${n}" `,i=o?` of length ${t}`:"",c=r?`length=${s}`:`type=${typeof e}`,h=f+"expected Uint8Array"+i+", got "+c;throw r?new RangeError(h):new TypeError(h)}return e}function re(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function nn(e,t,n=!1){z(e,void 0,"output");const r=t.outputLen;if(e.lengthe<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,G=at?e=>e:e=>me(e)>>>0,on=e=>{for(let t=0;te:on;function sn(e,t){if(t==null||typeof t!="object")throw new Error("options must be defined");return Object.assign(e,t)}function fn(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r[],o=(i,c)=>r(c,...s(i)).update(i).digest(),f=r(new Uint8Array(e),...s(new Uint8Array(0)));return o.outputLen=f.outputLen,o.blockLen=f.blockLen,o.create=(i,...c)=>r(i,...c),o}const an=(e,t)=>{function n(r,...s){if(z(r,void 0,"key"),e.nonceLength!==void 0){const a=s[0];z(a,e.varSizeNonce?void 0:e.nonceLength,"nonce")}const o=e.tagLength;o&&s[1]!==void 0&&z(s[1],void 0,"AAD");const f=t(r,...s),i=(a,l)=>{if(l!==void 0){if(a!==2)throw new Error("cipher output not supported");z(l,void 0,"output")}};let c=!1;return{encrypt(a,l){if(c)throw new Error("cannot encrypt() twice with same key + nonce");return c=!0,z(a),i(f.encrypt.length,l),f.encrypt(a,l)},decrypt(a,l){if(z(a),o&&a.lengthUint8Array.from(e.split(""),t=>t.charCodeAt(0)),ln=it(Q(Ee("expand 16-byte k"))),un=it(Q(Ee("expand 32-byte k")));function g(e,t){return e<>>32-t}const bt=64,dn=16,Gt=2**32-1,oe=Uint32Array.of();function pn(e,t,n,r,s,o,f,i){const c=s.length,h=new Uint8Array(bt),a=Q(h),l=at&&Lt(s)&&Lt(o),y=l?Q(s):oe,w=l?Q(o):oe;if(!at){for(let u=0;u=Gt)throw new Error("arx: counter overflow");const d=Math.min(bt,c-u);for(let b=0,x;b=Gt)throw new Error("arx: counter overflow");const d=Math.min(bt,c-u);if(l&&d===bt){const b=u/4;if(u%4!==0)throw new Error("arx: invalid block position");for(let x=0,A;x{z(i,void 0,"key"),z(c,void 0,"nonce"),z(h,void 0,"data");const y=h.length;if(a=Vt(y,a,!1),At(l),l<0||l>=Gt)throw new Error("arx: counter overflow");const w=[];let u=i.length,d,b;if(u===32)w.push(d=St(i)),b=un;else if(u===16&&n)d=new Uint8Array(32),d.set(i),d.set(i,16),b=ln,w.push(d);else throw z(i,32,"arx key"),new Error("invalid key size");(!at||!Lt(c))&&w.push(c=St(c));let x=Q(d);if(r){if(c.length!==24)throw new Error("arx: extended nonce must be 24 bytes");const B=c.subarray(0,16);if(at)r(b,x,Q(B),x);else{const D=it(Uint32Array.from(b));r(D,x,Q(B),x),ft(D),it(x)}c=c.subarray(16)}else at||it(x);const A=16-s;if(A!==c.length)throw new Error(`arx: nonce must be ${A} or 16 bytes`);if(A!==12){const B=new Uint8Array(12);B.set(c,o?0:12-c.length),c=B,w.push(c)}const _=it(Q(c));try{return pn(e,b,x,_,h,a,l,f),a}finally{ft(...w)}}}function V(e,t){return e[t++]&255|(e[t++]&255)<<8}class wn{constructor(t){m(this,"blockLen",16);m(this,"outputLen",16);m(this,"buffer",new Uint8Array(16));m(this,"r",new Uint16Array(10));m(this,"h",new Uint16Array(10));m(this,"pad",new Uint16Array(8));m(this,"pos",0);m(this,"finished",!1);m(this,"destroyed",!1);t=St(z(t,32,"key"));const n=V(t,0),r=V(t,2),s=V(t,4),o=V(t,6),f=V(t,8),i=V(t,10),c=V(t,12),h=V(t,14);this.r[0]=n&8191,this.r[1]=(n>>>13|r<<3)&8191,this.r[2]=(r>>>10|s<<6)&7939,this.r[3]=(s>>>7|o<<9)&8191,this.r[4]=(o>>>4|f<<12)&255,this.r[5]=f>>>1&8190,this.r[6]=(f>>>14|i<<2)&8191,this.r[7]=(i>>>11|c<<5)&8065,this.r[8]=(c>>>8|h<<8)&8191,this.r[9]=h>>>5&127;for(let a=0;a<8;a++)this.pad[a]=V(t,16+2*a)}process(t,n,r=!1){const s=r?0:2048,{h:o,r:f}=this,i=f[0],c=f[1],h=f[2],a=f[3],l=f[4],y=f[5],w=f[6],u=f[7],d=f[8],b=f[9],x=V(t,n+0),A=V(t,n+2),_=V(t,n+4),B=V(t,n+6),D=V(t,n+8),$=V(t,n+10),O=V(t,n+12),P=V(t,n+14);let I=o[0]+(x&8191),L=o[1]+((x>>>13|A<<3)&8191),U=o[2]+((A>>>10|_<<6)&8191),v=o[3]+((_>>>7|B<<9)&8191),H=o[4]+((B>>>4|D<<12)&8191),S=o[5]+(D>>>1&8191),T=o[6]+((D>>>14|$<<2)&8191),k=o[7]+(($>>>11|O<<5)&8191),C=o[8]+((O>>>8|P<<8)&8191),R=o[9]+(P>>>5|s),E=0,N=E+I*i+L*(5*b)+U*(5*d)+v*(5*u)+H*(5*w);E=N>>>13,N&=8191,N+=S*(5*y)+T*(5*l)+k*(5*a)+C*(5*h)+R*(5*c),E+=N>>>13,N&=8191;let F=E+I*c+L*i+U*(5*b)+v*(5*d)+H*(5*u);E=F>>>13,F&=8191,F+=S*(5*w)+T*(5*y)+k*(5*l)+C*(5*a)+R*(5*h),E+=F>>>13,F&=8191;let M=E+I*h+L*c+U*i+v*(5*b)+H*(5*d);E=M>>>13,M&=8191,M+=S*(5*u)+T*(5*w)+k*(5*y)+C*(5*l)+R*(5*a),E+=M>>>13,M&=8191;let J=E+I*a+L*h+U*c+v*i+H*(5*b);E=J>>>13,J&=8191,J+=S*(5*d)+T*(5*u)+k*(5*w)+C*(5*y)+R*(5*l),E+=J>>>13,J&=8191;let ht=E+I*l+L*a+U*h+v*c+H*i;E=ht>>>13,ht&=8191,ht+=S*(5*b)+T*(5*d)+k*(5*u)+C*(5*w)+R*(5*y),E+=ht>>>13,ht&=8191;let lt=E+I*y+L*l+U*a+v*h+H*c;E=lt>>>13,lt&=8191,lt+=S*i+T*(5*b)+k*(5*d)+C*(5*u)+R*(5*w),E+=lt>>>13,lt&=8191;let ut=E+I*w+L*y+U*l+v*a+H*h;E=ut>>>13,ut&=8191,ut+=S*c+T*i+k*(5*b)+C*(5*d)+R*(5*u),E+=ut>>>13,ut&=8191;let dt=E+I*u+L*w+U*y+v*l+H*a;E=dt>>>13,dt&=8191,dt+=S*h+T*c+k*i+C*(5*b)+R*(5*d),E+=dt>>>13,dt&=8191;let pt=E+I*d+L*u+U*w+v*y+H*l;E=pt>>>13,pt&=8191,pt+=S*a+T*h+k*c+C*i+R*(5*b),E+=pt>>>13,pt&=8191;let yt=E+I*b+L*d+U*u+v*w+H*y;E=yt>>>13,yt&=8191,yt+=S*l+T*a+k*h+C*c+R*i,E+=yt>>>13,yt&=8191,E=(E<<2)+E|0,E=E+N|0,N=E&8191,E=E>>>13,F+=E,o[0]=N,o[1]=F,o[2]=M,o[3]=J,o[4]=ht,o[5]=lt,o[6]=ut,o[7]=dt,o[8]=pt,o[9]=yt}finalize(){const{h:t,pad:n}=this,r=new Uint16Array(10);let s=t[1]>>>13;t[1]&=8191;for(let i=2;i<10;i++)t[i]+=s,s=t[i]>>>13,t[i]&=8191;t[0]+=s*5,s=t[0]>>>13,t[0]&=8191,t[1]+=s,s=t[1]>>>13,t[1]&=8191,t[2]+=s,r[0]=t[0]+5,s=r[0]>>>13,r[0]&=8191;for(let i=1;i<10;i++)r[i]=t[i]+s,s=r[i]>>>13,r[i]&=8191;r[9]-=8192;let o=(s^1)-1;for(let i=0;i<10;i++)r[i]&=o;o=~o;for(let i=0;i<10;i++)t[i]=t[i]&o|r[i];t[0]=(t[0]|t[1]<<13)&65535,t[1]=(t[1]>>>3|t[2]<<10)&65535,t[2]=(t[2]>>>6|t[3]<<7)&65535,t[3]=(t[3]>>>9|t[4]<<4)&65535,t[4]=(t[4]>>>12|t[5]<<1|t[6]<<14)&65535,t[5]=(t[6]>>>2|t[7]<<11)&65535,t[6]=(t[7]>>>5|t[8]<<8)&65535,t[7]=(t[8]>>>8|t[9]<<5)&65535;let f=t[0]+n[0];t[0]=f&65535;for(let i=1;i<8;i++)f=(t[i]+n[i]|0)+(f>>>16)|0,t[i]=f&65535;ft(r)}update(t){re(this),z(t),t=St(t);const{buffer:n,blockLen:r}=this,s=t.length;for(let o=0;o>>0,t[o++]=r[f]>>>8}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}}const gn=cn(32,e=>new wn(e));function bn(e,t,n,r,s,o=20){let f=e[0],i=e[1],c=e[2],h=e[3],a=t[0],l=t[1],y=t[2],w=t[3],u=t[4],d=t[5],b=t[6],x=t[7],A=s,_=n[0],B=n[1],D=n[2],$=f,O=i,P=c,I=h,L=a,U=l,v=y,H=w,S=u,T=d,k=b,C=x,R=A,E=_,N=B,F=D;for(let J=0;J{e.update(t);const n=t.length%16;n&&e.update(En.subarray(n))},An=new Uint8Array(32);function ie(e,t,n,r,s){s!==void 0&&z(s,void 0,"AAD");const o=e(t,n,An),f=hn(r.length,s?s.length:0,!0),i=gn.create(o);s&&se(i,s),se(i,r),i.update(f);const c=i.digest();return ft(o,f),c}const Ln=e=>(t,n,r)=>({encrypt(o,f){const i=o.length;f=Vt(i+16,f,!1),f.set(o);const c=f.subarray(0,-16);e(t,n,c,c,1);const h=ie(e,t,n,c,r);return f.set(h,i),ft(h),f},decrypt(o,f){f=Vt(o.length-16,f,!1);const i=o.subarray(0,-16),c=o.subarray(-16),h=ie(e,t,n,i,r);if(!fn(c,h))throw ft(h),new Error("invalid tag");return f.set(o.subarray(0,-16)),e(t,n,f,f,1),ft(h),f}}),Jt=an({blockSize:64,nonceLength:24,tagLength:16},Ln(mn));class fe{constructor(t,n){m(this,"oHash");m(this,"iHash");m(this,"blockLen");m(this,"outputLen");m(this,"canXOF",!1);m(this,"finished",!1);m(this,"destroyed",!1);if(qt(t),q(n,void 0,"key"),this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,s=new Uint8Array(r);s.set(n.length>r?t.create().update(n).digest():n);for(let o=0;o{const e=(t,n,r)=>new fe(t,n).update(r).digest();return e.create=(t,n)=>new fe(t,n),e})();function _n(e,t,n){return qt(e),n===void 0&&(n=new Uint8Array(e.outputLen)),Ae(e,n,t)}const Mt=Uint8Array.of(0),ce=Uint8Array.of();function Un(e,t,n,r=32){qt(e),ct(r,"length"),q(t,void 0,"prk");const s=e.outputLen;if(t.length255*s)throw new Error("Length must be <= 255*HashLen");const o=Math.ceil(r/s);n===void 0?n=ce:q(n,void 0,"info");const f=new Uint8Array(o*s),i=Ae.create(e,t),c=i._cloneInto(),h=new Uint8Array(i.outputLen);for(let a=0;aUn(e,_n(e,t,n),r,s),Bn=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ot=new Uint32Array(64);class In extends je{constructor(t){super(64,t,8,!1)}get(){const{A:t,B:n,C:r,D:s,E:o,F:f,G:i,H:c}=this;return[t,n,r,s,o,f,i,c]}set(t,n,r,s,o,f,i,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=o|0,this.F=f|0,this.G=i|0,this.H=c|0}process(t,n){for(let l=0;l<16;l++,n+=4)ot[l]=t.getUint32(n,!1);for(let l=16;l<64;l++){const y=ot[l-15],w=ot[l-2],u=W(y,7)^W(y,18)^y>>>3,d=W(w,17)^W(w,19)^w>>>10;ot[l]=d+ot[l-7]+u+ot[l-16]|0}let{A:r,B:s,C:o,D:f,E:i,F:c,G:h,H:a}=this;for(let l=0;l<64;l++){const y=W(i,6)^W(i,11)^W(i,25),w=a+y+Pe(i,c,h)+Bn[l]+ot[l]|0,d=(W(r,2)^W(r,13)^W(r,22))+Ke(r,s,o)|0;a=h,h=c,c=i,i=f+w|0,f=o,o=s,s=r,r=w+d|0}r=r+this.A|0,s=s+this.B|0,o=o+this.C|0,f=f+this.D|0,i=i+this.E|0,c=c+this.F|0,h=h+this.G|0,a=a+this.H|0,this.set(r,s,o,f,i,c,h,a)}roundClean(){X(ot)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),X(this.buffer)}}class On extends In{constructor(){super(32);m(this,"A",tt[0]|0);m(this,"B",tt[1]|0);m(this,"C",tt[2]|0);m(this,"D",tt[3]|0);m(this,"E",tt[4]|0);m(this,"F",tt[5]|0);m(this,"G",tt[6]|0);m(this,"H",tt[7]|0)}}const Hn=ge(()=>new On,Ne(1)),Le="atterm-relay",_e=_t("atterm-account-key-v1");function Ue(){return{alg:"argon2id",m:64*1024,t:3,p:1}}function ve(e,t,n){return tn(_t(e),t,{m:n.m,t:n.t,p:n.p,dkLen:32})}function Sn(e,t,n=Ue()){if(t.length!==32)throw new Error(`accountKey must be 32 bytes, got ${t.length}`);const r=te(16),s=ve(e,r,n),o=te(24),i=Jt(s,o,_e).encrypt(t);return{method:"password",wrapped:Dt(i),nonce:Dt(o),salt:Dt(r),kdf_params:JSON.stringify(n)}}function Tn(e,t){const n=JSON.parse(t.kdf_params);if(n.alg!=="argon2id")throw new Error(`unsupported kdf alg: ${n.alg}`);const r=$t(t.salt),s=ve(e,r,n),o=$t(t.nonce),f=Jt(s,o,_e);try{return f.decrypt($t(t.wrapped))}catch{throw new Error("invalid password")}}function Dt(e){return btoa(String.fromCharCode(...e))}function $t(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),r=atob(t+n),s=new Uint8Array(r.length);for(let o=0;o"u")throw new Error("opaque wasm: no DOM to load the Go runtime");const{default:e}=await ae(async()=>{const{default:t}=await import("./wasm_exec-BVJFcdQq.js");return{default:t}},[]);await new Promise((t,n)=>{const r=document.createElement("script");r.src=e,r.onload=()=>t(),r.onerror=()=>n(new Error("opaque wasm: failed to load wasm_exec.js")),document.head.appendChild(r)})}function kt(){return Bt||(Bt=(async()=>{await Dn();const{default:e}=await ae(async()=>{const{default:o}=await import("./opaque-BH0YqBjY.js");return{default:o}},[]),t=globalThis.Go,n=new t;let r;try{r=await WebAssembly.instantiateStreaming(fetch(e),n.importObject)}catch{const o=await fetch(e);r=await WebAssembly.instantiate(await o.arrayBuffer(),n.importObject)}n.run(r.instance);const s=globalThis.attermOpaque;if(!s)throw new Error("opaque wasm did not initialize");return s})(),Bt)}function Ct(e){if(e&&typeof e=="object"&&"error"in e)throw new Error(e.error);return e}async function $n(e){return Ct((await kt()).registerInit(e))}async function Nn(e,t,n,r){return Ct((await kt()).registerFinish(e,t,n,r))}async function Fn(e){return Ct((await kt()).loginInit(e))}async function Pn(e,t,n,r){return Ct((await kt()).loginFinish(e,t,n,r))}const Zt="atterm.account-key";function Kn(e){return btoa(String.fromCharCode(...e))}function jn(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r"u"||sessionStorage.setItem(Zt,Kn(e))}function Jn(){if(typeof sessionStorage>"u")return null;const e=sessionStorage.getItem(Zt);if(!e)return null;try{return jn(e)}catch{return null}}function Vn(){typeof sessionStorage>"u"||sessionStorage.removeItem(Zt)}async function Zn(){const{data:e}=await zt("/api/bootstrap/status");return e}function He(e,t,n){const r=ke(),s=t??(r==null?void 0:r.realmId),o=n??(r==null?void 0:r.homeInstanceURL);Ce({baseURL:(r==null?void 0:r.baseURL)??"",allowInsecure:(r==null?void 0:r.allowInsecure)??!1,sessionToken:e,expiresAt:null,...s!==void 0?{realmId:s}:{},...o!==void 0?{homeInstanceURL:o}:{}})}async function Tt(e,t){const{data:n}=await zt(e,{method:"POST",body:JSON.stringify(t)});return n}async function Qn(e,t){const{handle:n,ke1:r}=await Fn(t),s=await Tt("/api/auth/login/init",{email:e,login_ke:r});let o;try{({ke3:o}=await Pn(n,s.login_response,Le,e))}catch{throw new Error("invalid credentials")}const f=await Tt("/api/auth/login/finalize",{email:e,session_id:s.session_id,login_ke3:o}),i=Tn(t,f.account_key_wrap);return Oe(i),He(f.session_token,f.realm_id,f.home_instance_url),{user_id:f.user_id,email:e}}async function Gn(e,t,n=""){const{handle:r,ke1:s}=await $n(t),o=await Tt("/api/auth/register/init",{email:e,registration_ke:s}),{record:f}=await Nn(r,o.registration_response,Le,e),i=new Uint8Array(32);crypto.getRandomValues(i);const c=Sn(t,i,Ue()),h={email:e,registration_record:f,account_key_wrap:c};n&&(h.claim_token=n);const a=await Tt("/api/auth/register/finalize",h);return Oe(i),He(a.session_token),{user_id:a.user_id,email:e,is_admin:a.is_admin}}async function tr(e,t,n=""){return Gn(e,t,n)}async function er(){try{await zt("/api/auth/logout",{method:"POST"})}finally{Vn(),Re()}}export{Le as S,Qn as a,er as b,Fn as c,Wn as d,qn as e,Zn as g,Jn as l,Pn as o,Gn as r,tr as s}; diff --git a/internal/relay/web-dist/assets/client-DMh7GjbV.js b/internal/relay/web-dist/assets/client-n-fLEpOg.js similarity index 95% rename from internal/relay/web-dist/assets/client-DMh7GjbV.js rename to internal/relay/web-dist/assets/client-n-fLEpOg.js index a5639897..f447ca0e 100644 --- a/internal/relay/web-dist/assets/client-DMh7GjbV.js +++ b/internal/relay/web-dist/assets/client-n-fLEpOg.js @@ -1 +1 @@ -import{be as d,Z as f}from"./useI18n-lwZlSdSx.js";function m(o){if(!o||!o.startsWith("/")||o.startsWith("//")||o.startsWith("/\\")||typeof location>"u")return"/";try{const t=new URL(o,location.origin);return t.origin!==location.origin?"/":t.pathname+t.search+t.hash}catch{return"/"}}class l extends Error{constructor(t,a,s){super(`api error ${t} ${a}`),this.status=t,this.code=a,this.response=s,this.name="ApiError"}}async function C(o,t={}){const a=(t.method||"GET").toUpperCase(),s=new Headers(t.headers),n=d();n!=null&&n.sessionToken&&s.set("Authorization",`Bearer ${n.sessionToken}`),!s.has("Content-Type")&&t.body!==void 0&&a!=="GET"&&a!=="HEAD"&&s.set("Content-Type","application/json");const p=((n==null?void 0:n.baseURL)??"").replace(/\/$/,"")+o;let e;try{e=await fetch(p,{...t,headers:s,credentials:"omit"})}catch{throw new l(0,"network_error",null)}if(e.status===401&&(f(),typeof location<"u"&&!(location.pathname==="/login.html"||location.pathname==="/signup.html"))){const h=m(location.pathname+location.search+location.hash);location.assign("/login.html?next="+encodeURIComponent(h))}if(!e.ok){let i="http_error";if((e.headers.get("Content-Type")||"").includes("application/json"))try{const c=await e.clone().json();c&&typeof c.error=="string"&&(i=c.error)}catch{}throw new l(e.status,i,e)}const u=e.headers.get("Content-Type")||"";let r;return u.includes("application/json")?r=await e.json():r=void 0,{data:r,status:e.status,headers:e.headers}}export{l as A,C as a,m as s}; +import{be as d,Z as f}from"./useI18n-D4u8zssu.js";function m(o){if(!o||!o.startsWith("/")||o.startsWith("//")||o.startsWith("/\\")||typeof location>"u")return"/";try{const t=new URL(o,location.origin);return t.origin!==location.origin?"/":t.pathname+t.search+t.hash}catch{return"/"}}class l extends Error{constructor(t,a,s){super(`api error ${t} ${a}`),this.status=t,this.code=a,this.response=s,this.name="ApiError"}}async function C(o,t={}){const a=(t.method||"GET").toUpperCase(),s=new Headers(t.headers),n=d();n!=null&&n.sessionToken&&s.set("Authorization",`Bearer ${n.sessionToken}`),!s.has("Content-Type")&&t.body!==void 0&&a!=="GET"&&a!=="HEAD"&&s.set("Content-Type","application/json");const p=((n==null?void 0:n.baseURL)??"").replace(/\/$/,"")+o;let e;try{e=await fetch(p,{...t,headers:s,credentials:"omit"})}catch{throw new l(0,"network_error",null)}if(e.status===401&&(f(),typeof location<"u"&&!(location.pathname==="/login.html"||location.pathname==="/signup.html"))){const h=m(location.pathname+location.search+location.hash);location.assign("/login.html?next="+encodeURIComponent(h))}if(!e.ok){let i="http_error";if((e.headers.get("Content-Type")||"").includes("application/json"))try{const c=await e.clone().json();c&&typeof c.error=="string"&&(i=c.error)}catch{}throw new l(e.status,i,e)}const u=e.headers.get("Content-Type")||"";let r;return u.includes("application/json")?r=await e.json():r=void 0,{data:r,status:e.status,headers:e.headers}}export{l as A,C as a,m as s}; diff --git a/internal/relay/web-dist/assets/firstrun-BX3Qt0kf.js b/internal/relay/web-dist/assets/firstrun-BwaQ7wyz.js similarity index 91% rename from internal/relay/web-dist/assets/firstrun-BX3Qt0kf.js rename to internal/relay/web-dist/assets/firstrun-BwaQ7wyz.js index 640761f4..9130e736 100644 --- a/internal/relay/web-dist/assets/firstrun-BX3Qt0kf.js +++ b/internal/relay/web-dist/assets/firstrun-BwaQ7wyz.js @@ -1 +1 @@ -import{ap as L,bH as n,a7 as q,bt as V,aI as C,bw as v,ab as k,cx as l,ak as r,ca as e,n as E,aa as o,g as M,c3 as u,j as S,k as f,m as _,B as P,ai as b,ad as T,ac as y,bi as N,am as U,h as D,cd as F,v as H,aQ as j,a9 as G}from"./useI18n-lwZlSdSx.js";import{A as O}from"./client-DMh7GjbV.js";import{g as Q,r as R}from"./auth-B3RxKR1W.js";import{formatVersionLabel as W,fetchVersion as z}from"./version-Dm8mqW3q.js";import{L as J,a as K}from"./mobile-guard-Cco5WjS8.js";import"./pwa-BO-YW0rH.js";const X={class:"auth-page"},Y={class:"auth-title"},Z={class:"auth-subtitle"},$={class:"auth-hint"},ee={key:0,class:"auth-error",role:"alert"},ae={class:"auth-alt"},te={href:"/login.html"},se={class:"auth-version"},re=L({__name:"App",setup(oe){const m=n(""),p=n(""),h=n(""),d=n(!1),i=n(""),g=n(!1),w=n("dev"),{t:a}=F(),A=q(()=>W(w.value,a));V(async()=>{try{const{admin_exists:t}=await Q();if(t){location.replace("/login.html");return}}catch{}g.value=!0,w.value=await z()});function x(t){if(t instanceof O){if(t.code==="email_taken")return a("auth.errors.emailTaken");if(t.code==="password_weak")return a("auth.errors.passwordWeak");if(t.code==="invalid_email")return a("auth.errors.invalidEmail");if(t.code==="rate_limited")return a("auth.errors.rateLimitedShort");if(t.code==="invalid_request")return a("auth.errors.invalidRequest")}return a("auth.setup.failed")}async function B(t){if(t.preventDefault(),!d.value){if(i.value="",p.value!==h.value){i.value=a("auth.setup.passwordMismatch");return}d.value=!0;try{(await R(m.value.trim(),p.value)).is_admin?location.assign("/"):i.value=a("auth.setup.notAdmin")}catch(s){i.value=x(s)}finally{d.value=!1}}}const I=C();return(t,s)=>(v(),k(e(D),{theme:e(U),"theme-overrides":e(I),locale:e(N).locale,"date-locale":e(N).dateLocale},{default:l(()=>[r(e(E),null,{default:l(()=>[o("main",X,[r(J,{class:"auth-language"}),g.value?(v(),k(e(M),{key:0,class:"auth-card",bordered:!1},{default:l(()=>[o("header",Y,[o("h1",null,u(e(a)("common.appName")),1),o("p",Z,u(e(a)("auth.setup.title")),1)]),o("p",$,u(e(a)("auth.setup.hint")),1),r(e(S),{"label-placement":"top","require-mark-placement":"right-hanging",autocomplete:"on",novalidate:"",onSubmit:B},{default:l(()=>[r(e(f),{label:e(a)("auth.email"),"show-feedback":!1},{default:l(()=>[r(e(_),{value:m.value,"onUpdate:value":s[0]||(s[0]=c=>m.value=c),type:"text",placeholder:e(a)("auth.setup.emailPlaceholder"),"input-props":{type:"email",required:!0,autocomplete:"username"}},null,8,["value","placeholder"])]),_:1},8,["label"]),r(e(f),{label:e(a)("auth.password"),"show-feedback":!1},{default:l(()=>[r(e(_),{value:p.value,"onUpdate:value":s[1]||(s[1]=c=>p.value=c),type:"password","show-password-on":"click","input-props":{required:!0,autocomplete:"new-password",minlength:12}},null,8,["value"])]),_:1},8,["label"]),r(e(f),{label:e(a)("auth.setup.confirmPassword"),"show-feedback":!1},{default:l(()=>[r(e(_),{value:h.value,"onUpdate:value":s[2]||(s[2]=c=>h.value=c),type:"password","show-password-on":"click","input-props":{required:!0,autocomplete:"new-password",minlength:12}},null,8,["value"])]),_:1},8,["label"]),r(e(P),{class:"submit-btn",type:"primary","attr-type":"submit",loading:d.value,disabled:d.value,block:""},{default:l(()=>[b(u(e(a)("auth.setup.createAdmin")),1)]),_:1},8,["loading","disabled"]),i.value?(v(),T("p",ee,u(i.value),1)):y("",!0),o("p",ae,[b(u(e(a)("auth.alreadyHaveAccount"))+" ",1),o("a",te,u(e(a)("auth.signIn")),1),s[3]||(s[3]=b(". "))])]),_:1})]),_:1})):y("",!0),o("p",se,u(A.value),1)])]),_:1})]),_:1},8,["theme","theme-overrides","locale","date-locale"]))}}),le=H(re,[["__scopeId","data-v-687faf31"]]);K("firstrun")||(j(),G(le).mount("#app")); +import{ap as L,bH as n,a7 as q,bt as V,aI as C,bw as v,ab as k,cx as l,ak as r,ca as e,n as E,aa as o,g as M,c3 as u,j as S,k as f,m as _,B as P,ai as b,ad as T,ac as y,bi as N,am as U,h as D,cd as F,v as H,aQ as j,a9 as G}from"./useI18n-D4u8zssu.js";import{A as O}from"./client-n-fLEpOg.js";import{g as Q,r as R}from"./auth-BBmiA1GG.js";import{formatVersionLabel as W,fetchVersion as z}from"./version-DDxXxorX.js";import{L as J,a as K}from"./mobile-guard-B4PiwDK4.js";import"./pwa-CEp47jJM.js";const X={class:"auth-page"},Y={class:"auth-title"},Z={class:"auth-subtitle"},$={class:"auth-hint"},ee={key:0,class:"auth-error",role:"alert"},ae={class:"auth-alt"},te={href:"/login.html"},se={class:"auth-version"},re=L({__name:"App",setup(oe){const m=n(""),p=n(""),h=n(""),d=n(!1),i=n(""),g=n(!1),w=n("dev"),{t:a}=F(),A=q(()=>W(w.value,a));V(async()=>{try{const{admin_exists:t}=await Q();if(t){location.replace("/login.html");return}}catch{}g.value=!0,w.value=await z()});function x(t){if(t instanceof O){if(t.code==="email_taken")return a("auth.errors.emailTaken");if(t.code==="password_weak")return a("auth.errors.passwordWeak");if(t.code==="invalid_email")return a("auth.errors.invalidEmail");if(t.code==="rate_limited")return a("auth.errors.rateLimitedShort");if(t.code==="invalid_request")return a("auth.errors.invalidRequest")}return a("auth.setup.failed")}async function B(t){if(t.preventDefault(),!d.value){if(i.value="",p.value!==h.value){i.value=a("auth.setup.passwordMismatch");return}d.value=!0;try{(await R(m.value.trim(),p.value)).is_admin?location.assign("/"):i.value=a("auth.setup.notAdmin")}catch(s){i.value=x(s)}finally{d.value=!1}}}const I=C();return(t,s)=>(v(),k(e(D),{theme:e(U),"theme-overrides":e(I),locale:e(N).locale,"date-locale":e(N).dateLocale},{default:l(()=>[r(e(E),null,{default:l(()=>[o("main",X,[r(J,{class:"auth-language"}),g.value?(v(),k(e(M),{key:0,class:"auth-card",bordered:!1},{default:l(()=>[o("header",Y,[o("h1",null,u(e(a)("common.appName")),1),o("p",Z,u(e(a)("auth.setup.title")),1)]),o("p",$,u(e(a)("auth.setup.hint")),1),r(e(S),{"label-placement":"top","require-mark-placement":"right-hanging",autocomplete:"on",novalidate:"",onSubmit:B},{default:l(()=>[r(e(f),{label:e(a)("auth.email"),"show-feedback":!1},{default:l(()=>[r(e(_),{value:m.value,"onUpdate:value":s[0]||(s[0]=c=>m.value=c),type:"text",placeholder:e(a)("auth.setup.emailPlaceholder"),"input-props":{type:"email",required:!0,autocomplete:"username"}},null,8,["value","placeholder"])]),_:1},8,["label"]),r(e(f),{label:e(a)("auth.password"),"show-feedback":!1},{default:l(()=>[r(e(_),{value:p.value,"onUpdate:value":s[1]||(s[1]=c=>p.value=c),type:"password","show-password-on":"click","input-props":{required:!0,autocomplete:"new-password",minlength:12}},null,8,["value"])]),_:1},8,["label"]),r(e(f),{label:e(a)("auth.setup.confirmPassword"),"show-feedback":!1},{default:l(()=>[r(e(_),{value:h.value,"onUpdate:value":s[2]||(s[2]=c=>h.value=c),type:"password","show-password-on":"click","input-props":{required:!0,autocomplete:"new-password",minlength:12}},null,8,["value"])]),_:1},8,["label"]),r(e(P),{class:"submit-btn",type:"primary","attr-type":"submit",loading:d.value,disabled:d.value,block:""},{default:l(()=>[b(u(e(a)("auth.setup.createAdmin")),1)]),_:1},8,["loading","disabled"]),i.value?(v(),T("p",ee,u(i.value),1)):y("",!0),o("p",ae,[b(u(e(a)("auth.alreadyHaveAccount"))+" ",1),o("a",te,u(e(a)("auth.signIn")),1),s[3]||(s[3]=b(". "))])]),_:1})]),_:1})):y("",!0),o("p",se,u(A.value),1)])]),_:1})]),_:1},8,["theme","theme-overrides","locale","date-locale"]))}}),le=H(re,[["__scopeId","data-v-687faf31"]]);K("firstrun")||(j(),G(le).mount("#app")); diff --git a/internal/relay/web-dist/assets/index-gs2Ov3d4.js b/internal/relay/web-dist/assets/index-8SnOqa2v.js similarity index 98% rename from internal/relay/web-dist/assets/index-gs2Ov3d4.js rename to internal/relay/web-dist/assets/index-8SnOqa2v.js index fd4cd4ff..62b9390d 100644 --- a/internal/relay/web-dist/assets/index-gs2Ov3d4.js +++ b/internal/relay/web-dist/assets/index-8SnOqa2v.js @@ -1 +1 @@ -import{L as k,E as $,a as z}from"./index-DRFRE0Ca.js";import{J as R,Q as t,g as Y,L as W,z as Z,r as x,x as G,w as _,O as V,j as E,I as U}from"./FileExplorer-BumK3wPT.js";import"./useI18n-lwZlSdSx.js";import"./index-Ci2MtInW.js";import"./prefsSync-C5tz9Q-s.js";import"./client-DMh7GjbV.js";import"./Switch-DguIL3dU.js";import"./auth-B3RxKR1W.js";const T=135,m=1,q=136,C=137,P=2,N=138,F=3,I=4,X=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],D=58,B=40,b=95,K=91,c=45,L=46,A=35,J=37,H=38,M=92,ee=10,Oe=42;function Q(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function j(e){return e>=48&&e<=57}function S(e){return j(e)||e>=97&&e<=102||e>=65&&e<=70}const v=(e,r,i)=>(O,a)=>{for(let o=!1,l=0,n=0;;n++){let{next:s}=O;if(Q(s)||s==c||s==b||o&&j(s))!o&&(s!=c||n>0)&&(o=!0),l===n&&s==c&&l++,O.advance();else if(s==M&&O.peek(1)!=ee){if(O.advance(),S(O.next)){do O.advance();while(S(O.next));O.next==32&&O.advance()}else O.next>-1&&O.advance();o=!0}else{o&&O.acceptToken(l==2&&a.canShift(P)?r:s==B?i:e);break}}},ae=new $(v(q,P,C),{contextual:!0}),re=new $(v(N,F,I),{contextual:!0}),te=new $(e=>{if(X.includes(e.peek(-1))){let{next:r}=e;(Q(r)||r==b||r==A||r==L||r==Oe||r==K||r==D&&Q(e.peek(1))||r==c||r==H)&&e.acceptToken(T)}}),oe=new $(e=>{if(!X.includes(e.peek(-1))){let{next:r}=e;if(r==J&&(e.advance(),e.acceptToken(m)),Q(r)){do e.advance();while(Q(e.next)||j(e.next));e.acceptToken(m)}}}),le=R({"AtKeyword import charset namespace keyframes media supports font-feature-values":t.definitionKeyword,"from to selector scope MatchFlag":t.keyword,NamespaceName:t.namespace,KeyframeName:t.labelName,KeyframeRangeName:t.operatorKeyword,TagName:t.tagName,ClassName:t.className,PseudoClassName:t.constant(t.className),IdName:t.labelName,"FeatureName PropertyName":t.propertyName,AttributeName:t.attributeName,NumberLiteral:t.number,KeywordQuery:t.keyword,UnaryQueryOp:t.operatorKeyword,"CallTag ValueName FontName":t.atom,VariableName:t.variableName,Callee:t.operatorKeyword,Unit:t.unit,"UniversalSelector NestingSelector":t.definitionOperator,"MatchOp CompareOp":t.compareOperator,"ChildOp SiblingOp, LogicOp":t.logicOperator,BinOp:t.arithmeticOperator,Important:t.modifier,Comment:t.blockComment,ColorLiteral:t.color,"ParenthesizedContent StringLiteral":t.string,":":t.punctuation,"PseudoOp #":t.derefOperator,"; , |":t.separator,"( )":t.paren,"[ ]":t.squareBracket,"{ }":t.brace}),ie={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},ne={__proto__:null,or:104,and:104,not:112,only:112,layer:186},se={__proto__:null,selector:118,layer:182},de={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-values":226},Qe={__proto__:null,to:223},ce=k.deserialize({version:14,states:"IpQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FdO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#DtO'dQdO'#DvO'oQdO'#D}O'oQdO'#EQOOQP'#Fd'#FdO)OQhO'#EsOOQS'#Fc'#FcOOQS'#Ev'#EvQYQdOOO)VQdO'#EWO*cQhO'#E^O)VQdO'#E`O*jQdO'#EbO*uQdO'#EeO)zQhO'#EkO*}QdO'#EmO+YQdO'#EpO+_QaO'#CfO+fQ`O'#ETO+kQ`O'#FnO+vQdO'#FnQOQ`OOP,QO&jO'#CaPOOO)CAR)CAROOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,]QdO,59YO'_QdO,5:`O'dQdO,5:bO'oQdO,5:iO'oQdO,5:kO'oQdO,5:lO'oQdO'#E}O,hQ`O,58}O,pQdO'#ESOOQS,58},58}OOQP'#Cq'#CqOOQO'#Dr'#DrOOQP,59Y,59YO,wQ`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lO%jbIYS$cQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$XUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU!uQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[te,oe,ae,re,1,2,3,4,new z("m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~",28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:e=>ie[e]||-1},{term:138,get:e=>ne[e]||-1},{term:4,get:e=>se[e]||-1},{term:28,get:e=>de[e]||-1},{term:136,get:e=>Qe[e]||-1}],tokenPrec:2256});let p=null;function u(){if(!p&&typeof document=="object"&&document.body){let{style:e}=document.body,r=[],i=new Set;for(let O in e)O!="cssText"&&O!="cssFloat"&&typeof e[O]=="string"&&(/[A-Z]/.test(O)&&(O=O.replace(/[A-Z]/g,a=>"-"+a.toLowerCase())),i.has(O)||(r.push(O),i.add(O)));p=r.sort().map(O=>({type:"property",label:O,apply:O+": "}))}return p||[]}const g=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),y=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),$e=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),pe=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),d=/^(\w[\w-]*|-\w[\w-]*|)$/,ue=/^-(-[\w-]*)?$/;function je(e,r){var i;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let O=(i=e.parent)===null||i===void 0?void 0:i.firstChild;return(O==null?void 0:O.name)!="Callee"?!1:r.sliceString(O.from,O.to)=="var"}const h=new E,me=["Declaration"];function Se(e){for(let r=e;;){if(r.type.isTop)return r;if(!(r=r.parent))return e}}function w(e,r,i){if(r.to-r.from>4096){let O=h.get(r);if(O)return O;let a=[],o=new Set,l=r.cursor(U.IncludeAnonymous);if(l.firstChild())do for(let n of w(e,l.node,i))o.has(n.label)||(o.add(n.label),a.push(n));while(l.nextSibling());return h.set(r,a),a}else{let O=[],a=new Set;return r.cursor().iterate(o=>{var l;if(i(o)&&o.matchContext(me)&&((l=o.node.nextSibling)===null||l===void 0?void 0:l.name)==":"){let n=e.sliceString(o.from,o.to);a.has(n)||(a.add(n),O.push({label:n,type:"variable"}))}}),O}}const ge=e=>r=>{let{state:i,pos:O}=r,a=V(i).resolveInner(O,-1),o=a.type.isError&&a.from==a.to-1&&i.doc.sliceString(a.from,a.to)=="-";if(a.name=="PropertyName"||(o||a.name=="TagName")&&/^(Block|Styles)$/.test(a.resolve(a.to).name))return{from:a.from,options:u(),validFor:d};if(a.name=="ValueName")return{from:a.from,options:y,validFor:d};if(a.name=="PseudoClassName")return{from:a.from,options:g,validFor:d};if(e(a)||(r.explicit||o)&&je(a,i.doc))return{from:e(a)||o?a.from:O,options:w(i.doc,Se(a),e),validFor:ue};if(a.name=="TagName"){for(let{parent:s}=a;s;s=s.parent)if(s.name=="Block")return{from:a.from,options:u(),validFor:d};return{from:a.from,options:$e,validFor:d}}if(a.name=="AtKeyword")return{from:a.from,options:pe,validFor:d};if(!r.explicit)return null;let l=a.resolve(O),n=l.childBefore(O);return n&&n.name==":"&&l.name=="PseudoClassSelector"?{from:O,options:g,validFor:d}:n&&n.name==":"&&l.name=="Declaration"||l.name=="ArgList"?{from:O,options:y,validFor:d}:l.name=="Block"||l.name=="Styles"?{from:O,options:u(),validFor:d}:null},ye=ge(e=>e.name=="VariableName"),f=W.define({name:"css",parser:ce.configure({props:[Z.add({Declaration:x()}),G.add({"Block KeyframeList":_})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function ze(){return new Y(f,f.data.of({autocomplete:ye}))}export{ze as css,ye as cssCompletionSource,f as cssLanguage,ge as defineCSSCompletionSource}; +import{L as k,E as $,a as z}from"./index-Bf0-KgBD.js";import{J as R,Q as t,g as Y,L as W,z as Z,r as x,x as G,w as _,O as V,j as E,I as U}from"./FileExplorer-BmPzqkbb.js";import"./useI18n-D4u8zssu.js";import"./index-zrZBIArQ.js";import"./prefsSync-Dj3wNxrO.js";import"./client-n-fLEpOg.js";import"./Switch-BlSJOKEO.js";import"./auth-BBmiA1GG.js";const T=135,m=1,q=136,C=137,P=2,N=138,F=3,I=4,X=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],D=58,B=40,b=95,K=91,c=45,L=46,A=35,J=37,H=38,M=92,ee=10,Oe=42;function Q(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function j(e){return e>=48&&e<=57}function S(e){return j(e)||e>=97&&e<=102||e>=65&&e<=70}const v=(e,r,i)=>(O,a)=>{for(let o=!1,l=0,n=0;;n++){let{next:s}=O;if(Q(s)||s==c||s==b||o&&j(s))!o&&(s!=c||n>0)&&(o=!0),l===n&&s==c&&l++,O.advance();else if(s==M&&O.peek(1)!=ee){if(O.advance(),S(O.next)){do O.advance();while(S(O.next));O.next==32&&O.advance()}else O.next>-1&&O.advance();o=!0}else{o&&O.acceptToken(l==2&&a.canShift(P)?r:s==B?i:e);break}}},ae=new $(v(q,P,C),{contextual:!0}),re=new $(v(N,F,I),{contextual:!0}),te=new $(e=>{if(X.includes(e.peek(-1))){let{next:r}=e;(Q(r)||r==b||r==A||r==L||r==Oe||r==K||r==D&&Q(e.peek(1))||r==c||r==H)&&e.acceptToken(T)}}),oe=new $(e=>{if(!X.includes(e.peek(-1))){let{next:r}=e;if(r==J&&(e.advance(),e.acceptToken(m)),Q(r)){do e.advance();while(Q(e.next)||j(e.next));e.acceptToken(m)}}}),le=R({"AtKeyword import charset namespace keyframes media supports font-feature-values":t.definitionKeyword,"from to selector scope MatchFlag":t.keyword,NamespaceName:t.namespace,KeyframeName:t.labelName,KeyframeRangeName:t.operatorKeyword,TagName:t.tagName,ClassName:t.className,PseudoClassName:t.constant(t.className),IdName:t.labelName,"FeatureName PropertyName":t.propertyName,AttributeName:t.attributeName,NumberLiteral:t.number,KeywordQuery:t.keyword,UnaryQueryOp:t.operatorKeyword,"CallTag ValueName FontName":t.atom,VariableName:t.variableName,Callee:t.operatorKeyword,Unit:t.unit,"UniversalSelector NestingSelector":t.definitionOperator,"MatchOp CompareOp":t.compareOperator,"ChildOp SiblingOp, LogicOp":t.logicOperator,BinOp:t.arithmeticOperator,Important:t.modifier,Comment:t.blockComment,ColorLiteral:t.color,"ParenthesizedContent StringLiteral":t.string,":":t.punctuation,"PseudoOp #":t.derefOperator,"; , |":t.separator,"( )":t.paren,"[ ]":t.squareBracket,"{ }":t.brace}),ie={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},ne={__proto__:null,or:104,and:104,not:112,only:112,layer:186},se={__proto__:null,selector:118,layer:182},de={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-values":226},Qe={__proto__:null,to:223},ce=k.deserialize({version:14,states:"IpQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FdO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#DtO'dQdO'#DvO'oQdO'#D}O'oQdO'#EQOOQP'#Fd'#FdO)OQhO'#EsOOQS'#Fc'#FcOOQS'#Ev'#EvQYQdOOO)VQdO'#EWO*cQhO'#E^O)VQdO'#E`O*jQdO'#EbO*uQdO'#EeO)zQhO'#EkO*}QdO'#E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#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!e`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!e`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!e`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!e`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!e`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!e`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$cQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$XUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU!uQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[te,oe,ae,re,1,2,3,4,new z("m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~",28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:e=>ie[e]||-1},{term:138,get:e=>ne[e]||-1},{term:4,get:e=>se[e]||-1},{term:28,get:e=>de[e]||-1},{term:136,get:e=>Qe[e]||-1}],tokenPrec:2256});let p=null;function u(){if(!p&&typeof document=="object"&&document.body){let{style:e}=document.body,r=[],i=new Set;for(let O in e)O!="cssText"&&O!="cssFloat"&&typeof e[O]=="string"&&(/[A-Z]/.test(O)&&(O=O.replace(/[A-Z]/g,a=>"-"+a.toLowerCase())),i.has(O)||(r.push(O),i.add(O)));p=r.sort().map(O=>({type:"property",label:O,apply:O+": "}))}return p||[]}const g=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),y=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),$e=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),pe=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),d=/^(\w[\w-]*|-\w[\w-]*|)$/,ue=/^-(-[\w-]*)?$/;function je(e,r){var i;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let O=(i=e.parent)===null||i===void 0?void 0:i.firstChild;return(O==null?void 0:O.name)!="Callee"?!1:r.sliceString(O.from,O.to)=="var"}const h=new E,me=["Declaration"];function Se(e){for(let r=e;;){if(r.type.isTop)return r;if(!(r=r.parent))return e}}function w(e,r,i){if(r.to-r.from>4096){let O=h.get(r);if(O)return O;let a=[],o=new Set,l=r.cursor(U.IncludeAnonymous);if(l.firstChild())do for(let n of w(e,l.node,i))o.has(n.label)||(o.add(n.label),a.push(n));while(l.nextSibling());return h.set(r,a),a}else{let O=[],a=new Set;return r.cursor().iterate(o=>{var l;if(i(o)&&o.matchContext(me)&&((l=o.node.nextSibling)===null||l===void 0?void 0:l.name)==":"){let n=e.sliceString(o.from,o.to);a.has(n)||(a.add(n),O.push({label:n,type:"variable"}))}}),O}}const ge=e=>r=>{let{state:i,pos:O}=r,a=V(i).resolveInner(O,-1),o=a.type.isError&&a.from==a.to-1&&i.doc.sliceString(a.from,a.to)=="-";if(a.name=="PropertyName"||(o||a.name=="TagName")&&/^(Block|Styles)$/.test(a.resolve(a.to).name))return{from:a.from,options:u(),validFor:d};if(a.name=="ValueName")return{from:a.from,options:y,validFor:d};if(a.name=="PseudoClassName")return{from:a.from,options:g,validFor:d};if(e(a)||(r.explicit||o)&&je(a,i.doc))return{from:e(a)||o?a.from:O,options:w(i.doc,Se(a),e),validFor:ue};if(a.name=="TagName"){for(let{parent:s}=a;s;s=s.parent)if(s.name=="Block")return{from:a.from,options:u(),validFor:d};return{from:a.from,options:$e,validFor:d}}if(a.name=="AtKeyword")return{from:a.from,options:pe,validFor:d};if(!r.explicit)return null;let l=a.resolve(O),n=l.childBefore(O);return n&&n.name==":"&&l.name=="PseudoClassSelector"?{from:O,options:g,validFor:d}:n&&n.name==":"&&l.name=="Declaration"||l.name=="ArgList"?{from:O,options:y,validFor:d}:l.name=="Block"||l.name=="Styles"?{from:O,options:u(),validFor:d}:null},ye=ge(e=>e.name=="VariableName"),f=W.define({name:"css",parser:ce.configure({props:[Z.add({Declaration:x()}),G.add({"Block KeyframeList":_})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function ze(){return new Y(f,f.data.of({autocomplete:ye}))}export{ze as css,ye as cssCompletionSource,f as cssLanguage,ge as defineCSSCompletionSource}; diff --git a/internal/relay/web-dist/assets/index-DTgf7QAl.js b/internal/relay/web-dist/assets/index-B6JsQQbt.js similarity index 98% rename from internal/relay/web-dist/assets/index-DTgf7QAl.js rename to internal/relay/web-dist/assets/index-B6JsQQbt.js index dab9c3ac..f1260e79 100644 --- a/internal/relay/web-dist/assets/index-DTgf7QAl.js +++ b/internal/relay/web-dist/assets/index-B6JsQQbt.js @@ -1,4 +1,4 @@ -import{k as st,i as Q,N as v,T as it,h as Ee,J as Ie,p as H,H as ot,Q as m,g as fe,l as at,C as lt,y as ht,O as X,E as P,s as z,e as ft,B as ut,t as dt,b as pt,x as Me,z as ct,G as mt,c as gt,f as ue,P as kt}from"./FileExplorer-BumK3wPT.js";import{C as Lt}from"./index-DblmzGAc.js";import{html as bt,htmlCompletionSource as wt}from"./index-DZaDIMfZ.js";import"./useI18n-lwZlSdSx.js";import"./index-Ci2MtInW.js";import"./prefsSync-C5tz9Q-s.js";import"./client-DMh7GjbV.js";import"./Switch-DguIL3dU.js";import"./auth-B3RxKR1W.js";import"./index-DRFRE0Ca.js";import"./index-gs2Ov3d4.js";import"./index-BKS_vG9j.js";class _{static create(e,r,n,s,i){let o=s+(s<<8)+e+(r<<4)|0;return new _(e,r,n,o,i,[],[])}constructor(e,r,n,s,i,o,a){this.type=e,this.value=r,this.from=n,this.hash=s,this.end=i,this.children=o,this.positions=a,this.hashProp=[[v.contextHash,s]]}addChild(e,r){e.prop(v.contextHash)!=this.hash&&(e=new H(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(r)}toTree(e,r=this.end){let n=this.children.length-1;return n>=0&&(r=Math.max(r,this.positions[n]+this.children[n].length+this.from)),new H(e.types[this.type],this.children,this.positions,r-this.from).balance({makeTree:(s,i,o)=>new H(Q.none,s,i,o,this.hashProp)})}}var u;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(u||(u={}));class St{constructor(e,r){this.start=e,this.content=r,this.marks=[],this.parsers=[]}}class Ct{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return R(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,r=0,n=0){for(let s=r;s=e.stack[r.depth+1].value+r.baseIndent)return!0;if(r.indent>=r.baseIndent+4)return!1;let n=(t.type==u.OrderedList?oe:ie)(r,e,!1);return n>0&&(t.type!=u.BulletList||se(r,e,!1)<0)&&r.text.charCodeAt(r.pos+n-1)==t.value}const He={[u.Blockquote](t,e,r){return r.next!=62?!1:(r.markers.push(k(u.QuoteMark,e.lineStart+r.pos,e.lineStart+r.pos+1)),r.moveBase(r.pos+(A(r.text.charCodeAt(r.pos+1))?2:1)),t.end=e.lineStart+r.text.length,!0)},[u.ListItem](t,e,r){return r.indent-1?!1:(r.moveBaseColumn(r.baseIndent+t.value),!0)},[u.OrderedList]:de,[u.BulletList]:de,[u.Document](){return!0}};function A(t){return t==32||t==9||t==10||t==13}function R(t,e=0){for(;er&&A(t.charCodeAt(e-1));)e--;return e}function Pe(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(De.SetextHeading)>-1||n<3?-1:1}function Ne(t,e){for(let r=t.stack.length-1;r>=0;r--)if(t.stack[r].type==e)return!0;return!1}function ie(t,e,r){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||A(t.text.charCodeAt(t.pos+1)))&&(!r||Ne(e,u.BulletList)||t.skipSpace(t.pos+2)=48&&s<=57;){n++;if(n==t.text.length)return-1;s=t.text.charCodeAt(n)}return n==t.pos||n>t.pos+9||s!=46&&s!=41||nt.pos+1||t.next!=49)?-1:n+1-t.pos}function ye(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e6?-1:r}function Oe(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e/,Te=/\?>/,ee=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/,Te=/\?>/,ee=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*"),ie=y(ee,"?>"),ce=y(te,"]]>"),me=I({Text:u.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":u.angleBracket,TagName:u.tagName,"MismatchedCloseTag/TagName":[u.tagName,u.invalid],AttributeName:u.attributeName,AttributeValue:u.attributeValue,Is:u.definitionOperator,"EntityReference CharacterReference":u.character,Comment:u.blockComment,ProcessingInst:u.processingInstruction,DoctypeDecl:u.documentMeta,Cdata:u.special(u.string)}),$e=G.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'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sv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!%mZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!&`!a;'S$q;'S;=`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[le,se,ie,ce,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function T(e,t){let o=t&&t.getChild("TagName");return o?e.sliceString(o.from,o.to):""}function P(e,t){let o=t&&t.firstChild;return!o||o.name!="OpenTag"?"":T(e,o)}function Se(e,t,o){let O=t&&t.getChildren("Attribute").find(a=>a.from<=o&&a.to>=o),r=O&&O.getChild("AttributeName");return r?e.sliceString(r.from,r.to):""}function C(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name=="Element")return t;return null}function ge(e,t){var o;let O=k(e).resolveInner(t,-1),r=null;for(let a=O;!r&&a.parent;a=a.parent)(a.name=="OpenTag"||a.name=="CloseTag"||a.name=="SelfClosingTag"||a.name=="MismatchedCloseTag")&&(r=a);if(r&&(r.to>t||r.lastChild.type.isError)){let a=r.parent;if(O.name=="TagName")return r.name=="CloseTag"||r.name=="MismatchedCloseTag"?{type:"closeTag",from:O.from,context:a}:{type:"openTag",from:O.from,context:C(a)};if(O.name=="AttributeName")return{type:"attrName",from:O.from,context:r};if(O.name=="AttributeValue")return{type:"attrValue",from:O.from,context:r};let s=O==r||O.name=="Attribute"?O.childBefore(t):O;return(s==null?void 0:s.name)=="StartTag"?{type:"openTag",from:t,context:C(a)}:(s==null?void 0:s.name)=="StartCloseTag"&&s.to<=t?{type:"closeTag",from:t,context:a}:(s==null?void 0:s.name)=="Is"?{type:"attrValue",from:t,context:r}:s?{type:"attrName",from:t,context:r}:null}else if(O.name=="StartCloseTag")return{type:"closeTag",from:t,context:O.parent};for(;O.parent&&O.to==t&&!(!((o=O.lastChild)===null||o===void 0)&&o.type.isError);)O=O.parent;return O.name=="Element"||O.name=="Text"||O.name=="Document"?{type:"tag",from:t,context:O.name=="Element"?O:C(O)}:null}class pe{constructor(t,o,O){this.attrs=o,this.attrValues=O,this.children=[],this.name=t.name,this.completion=Object.assign(Object.assign({type:"type"},t.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=t.textContent?t.textContent.map(r=>({label:r,type:"text"})):[]}}const b=/^[:\-\.\w\u00b7-\uffff]*$/;function E(e){return Object.assign(Object.assign({type:"property"},e.completion||{}),{label:e.name})}function R(e){return typeof e=="string"?{label:`"${e}"`,type:"constant"}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function ue(e,t){let o=[],O=[],r=Object.create(null);for(let n of t){let $=E(n);o.push($),n.global&&O.push($),n.values&&(r[n.name]=n.values.map(R))}let a=[],s=[],f=Object.create(null);for(let n of e){let $=O,c=r;n.attributes&&($=$.concat(n.attributes.map(l=>typeof l=="string"?o.find(d=>d.label==l)||{label:l,type:"property"}:(l.values&&(c==r&&(c=Object.create(c)),c[l.name]=l.values.map(R)),E(l)))));let p=new pe(n,$,c);f[p.name]=p,a.push(p),n.top&&s.push(p)}s.length||(s=a);for(let n=0;n{var $;let{doc:c}=n.state,p=ge(n.state,n.pos);if(!p||p.type=="tag"&&!n.explicit)return null;let{type:l,from:d,context:S}=p;if(l=="openTag"){let i=s,m=P(c,S);if(m){let g=f[m];i=(g==null?void 0:g.children)||a}return{from:d,options:i.map(g=>g.completion),validFor:b}}else if(l=="closeTag"){let i=P(c,S);return i?{from:d,to:n.pos+(c.sliceString(n.pos,n.pos+1)==">"?1:0),options:[(($=f[i])===null||$===void 0?void 0:$.closeNameCompletion)||{label:i+">",type:"type"}],validFor:b}:null}else if(l=="attrName"){let i=f[T(c,S)];return{from:d,options:(i==null?void 0:i.attrs)||O,validFor:b}}else if(l=="attrValue"){let i=Se(c,S,d);if(!i)return null;let m=f[T(c,S)],g=((m==null?void 0:m.attrValues)||r)[i];return!g||!g.length?null:{from:d,to:n.pos+(c.sliceString(n.pos,n.pos+1)=='"'?1:0),options:g,validFor:/^"[^"]*"?$/}}else if(l=="tag"){let i=P(c,S),m=f[i],g=[],q=S&&S.lastChild;i&&(!q||q.name!="CloseTag"||T(c,q)!=i)&&g.push(m?m.closeCompletion:{label:"",type:"type",boost:2});let v=g.concat(((m==null?void 0:m.children)||(S?a:s)).map(x=>x.openCompletion));if(S&&(m!=null&&m.text.length)){let x=S.firstChild;x.to>n.pos-20&&!/\S/.test(n.state.sliceDoc(x.to,n.pos))&&(v=v.concat(m.text))}return{from:d,options:v,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}const w=j.define({name:"xml",parser:$e.configure({props:[U.add({Element(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),Z.add({Element(e){let t=e.firstChild,o=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:o.name=="CloseTag"?o.from:e.to}}}),B.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/$/}});function he(e={}){let t=[w.data.of({autocomplete:ue(e.elements||[],e.attributes||[])})];return e.autoCloseTags!==!1&&t.push(fe),new Y(w,t)}function z(e,t,o=e.length){if(!t)return"";let O=t.firstChild,r=O&&O.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,o)):""}const fe=D.inputHandler.of((e,t,o,O,r)=>{if(e.composing||e.state.readOnly||t!=o||O!=">"&&O!="/"||!w.isActiveAt(e.state,t,-1))return!1;let a=r(),{state:s}=a,f=s.changeByRange(n=>{var $,c,p;let{head:l}=n,d=s.doc.sliceString(l-1,l)==O,S=k(s).resolveInner(l,-1),i;if(d&&O==">"&&S.name=="EndTag"){let m=S.parent;if(((c=($=m.parent)===null||$===void 0?void 0:$.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(i=z(s.doc,m.parent,l))){let g=l+(s.doc.sliceString(l,l+1)===">"?1:0),q=``;return{range:n,changes:{from:l,to:g,insert:q}}}}else if(d&&O=="/"&&S.name=="StartCloseTag"){let m=S.parent;if(S.from==l-2&&((p=m.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(i=z(s.doc,m,l))){let g=l+(s.doc.sliceString(l,l+1)===">"?1:0),q=`${i}>`;return{range:M.cursor(l+q.length,-1),changes:{from:l,to:g,insert:q}}}}return{range:n}});return f.changes.empty?!1:(e.dispatch([a,s.update(f,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{fe as autoCloseTags,ue as completeFromSchema,he as xml,w as xmlLanguage}; +import{L as G,E as A,C as N}from"./index-Bf0-KgBD.js";import{J as I,Q as u,g as Y,L as j,z as U,x as Z,q as B,O as k,c as D,E as M}from"./FileExplorer-BmPzqkbb.js";import"./useI18n-D4u8zssu.js";import"./index-zrZBIArQ.js";import"./prefsSync-Dj3wNxrO.js";import"./client-n-fLEpOg.js";import"./Switch-BlSJOKEO.js";import"./auth-BBmiA1GG.js";const h=1,F=2,L=3,J=4,K=5,H=36,ee=37,te=38,Oe=11,oe=13;function re(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function ne(e){return e==9||e==10||e==13||e==32}let Q=null,V=null,X=0;function W(e,t){let o=e.pos+t;if(V==e&&X==o)return Q;for(;ne(e.peek(t));)t++;let O="";for(;;){let r=e.peek(t);if(!re(r))break;O+=String.fromCharCode(r),t++}return V=e,X=o,Q=O||null}function _(e,t){this.name=e,this.parent=t}const ae=new N({start:null,shift(e,t,o,O){return t==h?new _(W(O,1)||"",e):e},reduce(e,t){return t==Oe&&e?e.parent:e},reuse(e,t,o,O){let r=t.type.id;return r==h||r==oe?new _(W(O,1)||"",e):e},strict:!1}),le=new A((e,t)=>{if(e.next==60){if(e.advance(),e.next==47){e.advance();let o=W(e,0);if(!o)return e.acceptToken(K);if(t.context&&o==t.context.name)return e.acceptToken(F);for(let O=t.context;O;O=O.parent)if(O.name==o)return e.acceptToken(L,-2);e.acceptToken(J)}else if(e.next!=33&&e.next!=63)return e.acceptToken(h)}},{contextual:!0});function y(e,t){return new A(o=>{let O=0,r=t.charCodeAt(0);e:for(;!(o.next<0);o.advance(),O++)if(o.next==r){for(let a=1;a"),ie=y(ee,"?>"),ce=y(te,"]]>"),me=I({Text:u.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":u.angleBracket,TagName:u.tagName,"MismatchedCloseTag/TagName":[u.tagName,u.invalid],AttributeName:u.attributeName,AttributeValue:u.attributeValue,Is:u.definitionOperator,"EntityReference CharacterReference":u.character,Comment:u.blockComment,ProcessingInst:u.processingInstruction,DoctypeDecl:u.documentMeta,Cdata:u.special(u.string)}),$e=G.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E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`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[le,se,ie,ce,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function T(e,t){let o=t&&t.getChild("TagName");return o?e.sliceString(o.from,o.to):""}function P(e,t){let o=t&&t.firstChild;return!o||o.name!="OpenTag"?"":T(e,o)}function Se(e,t,o){let O=t&&t.getChildren("Attribute").find(a=>a.from<=o&&a.to>=o),r=O&&O.getChild("AttributeName");return r?e.sliceString(r.from,r.to):""}function C(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name=="Element")return t;return null}function ge(e,t){var o;let O=k(e).resolveInner(t,-1),r=null;for(let a=O;!r&&a.parent;a=a.parent)(a.name=="OpenTag"||a.name=="CloseTag"||a.name=="SelfClosingTag"||a.name=="MismatchedCloseTag")&&(r=a);if(r&&(r.to>t||r.lastChild.type.isError)){let a=r.parent;if(O.name=="TagName")return r.name=="CloseTag"||r.name=="MismatchedCloseTag"?{type:"closeTag",from:O.from,context:a}:{type:"openTag",from:O.from,context:C(a)};if(O.name=="AttributeName")return{type:"attrName",from:O.from,context:r};if(O.name=="AttributeValue")return{type:"attrValue",from:O.from,context:r};let s=O==r||O.name=="Attribute"?O.childBefore(t):O;return(s==null?void 0:s.name)=="StartTag"?{type:"openTag",from:t,context:C(a)}:(s==null?void 0:s.name)=="StartCloseTag"&&s.to<=t?{type:"closeTag",from:t,context:a}:(s==null?void 0:s.name)=="Is"?{type:"attrValue",from:t,context:r}:s?{type:"attrName",from:t,context:r}:null}else if(O.name=="StartCloseTag")return{type:"closeTag",from:t,context:O.parent};for(;O.parent&&O.to==t&&!(!((o=O.lastChild)===null||o===void 0)&&o.type.isError);)O=O.parent;return O.name=="Element"||O.name=="Text"||O.name=="Document"?{type:"tag",from:t,context:O.name=="Element"?O:C(O)}:null}class pe{constructor(t,o,O){this.attrs=o,this.attrValues=O,this.children=[],this.name=t.name,this.completion=Object.assign(Object.assign({type:"type"},t.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=t.textContent?t.textContent.map(r=>({label:r,type:"text"})):[]}}const b=/^[:\-\.\w\u00b7-\uffff]*$/;function E(e){return Object.assign(Object.assign({type:"property"},e.completion||{}),{label:e.name})}function R(e){return typeof e=="string"?{label:`"${e}"`,type:"constant"}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function ue(e,t){let o=[],O=[],r=Object.create(null);for(let n of t){let $=E(n);o.push($),n.global&&O.push($),n.values&&(r[n.name]=n.values.map(R))}let a=[],s=[],f=Object.create(null);for(let n of e){let $=O,c=r;n.attributes&&($=$.concat(n.attributes.map(l=>typeof l=="string"?o.find(d=>d.label==l)||{label:l,type:"property"}:(l.values&&(c==r&&(c=Object.create(c)),c[l.name]=l.values.map(R)),E(l)))));let p=new pe(n,$,c);f[p.name]=p,a.push(p),n.top&&s.push(p)}s.length||(s=a);for(let n=0;n{var $;let{doc:c}=n.state,p=ge(n.state,n.pos);if(!p||p.type=="tag"&&!n.explicit)return null;let{type:l,from:d,context:S}=p;if(l=="openTag"){let i=s,m=P(c,S);if(m){let g=f[m];i=(g==null?void 0:g.children)||a}return{from:d,options:i.map(g=>g.completion),validFor:b}}else if(l=="closeTag"){let i=P(c,S);return i?{from:d,to:n.pos+(c.sliceString(n.pos,n.pos+1)==">"?1:0),options:[(($=f[i])===null||$===void 0?void 0:$.closeNameCompletion)||{label:i+">",type:"type"}],validFor:b}:null}else if(l=="attrName"){let i=f[T(c,S)];return{from:d,options:(i==null?void 0:i.attrs)||O,validFor:b}}else if(l=="attrValue"){let i=Se(c,S,d);if(!i)return null;let m=f[T(c,S)],g=((m==null?void 0:m.attrValues)||r)[i];return!g||!g.length?null:{from:d,to:n.pos+(c.sliceString(n.pos,n.pos+1)=='"'?1:0),options:g,validFor:/^"[^"]*"?$/}}else if(l=="tag"){let i=P(c,S),m=f[i],g=[],q=S&&S.lastChild;i&&(!q||q.name!="CloseTag"||T(c,q)!=i)&&g.push(m?m.closeCompletion:{label:"",type:"type",boost:2});let v=g.concat(((m==null?void 0:m.children)||(S?a:s)).map(x=>x.openCompletion));if(S&&(m!=null&&m.text.length)){let x=S.firstChild;x.to>n.pos-20&&!/\S/.test(n.state.sliceDoc(x.to,n.pos))&&(v=v.concat(m.text))}return{from:d,options:v,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}const w=j.define({name:"xml",parser:$e.configure({props:[U.add({Element(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),Z.add({Element(e){let t=e.firstChild,o=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:o.name=="CloseTag"?o.from:e.to}}}),B.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/$/}});function he(e={}){let t=[w.data.of({autocomplete:ue(e.elements||[],e.attributes||[])})];return e.autoCloseTags!==!1&&t.push(fe),new Y(w,t)}function z(e,t,o=e.length){if(!t)return"";let O=t.firstChild,r=O&&O.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,o)):""}const fe=D.inputHandler.of((e,t,o,O,r)=>{if(e.composing||e.state.readOnly||t!=o||O!=">"&&O!="/"||!w.isActiveAt(e.state,t,-1))return!1;let a=r(),{state:s}=a,f=s.changeByRange(n=>{var $,c,p;let{head:l}=n,d=s.doc.sliceString(l-1,l)==O,S=k(s).resolveInner(l,-1),i;if(d&&O==">"&&S.name=="EndTag"){let m=S.parent;if(((c=($=m.parent)===null||$===void 0?void 0:$.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(i=z(s.doc,m.parent,l))){let g=l+(s.doc.sliceString(l,l+1)===">"?1:0),q=``;return{range:n,changes:{from:l,to:g,insert:q}}}}else if(d&&O=="/"&&S.name=="StartCloseTag"){let m=S.parent;if(S.from==l-2&&((p=m.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(i=z(s.doc,m,l))){let g=l+(s.doc.sliceString(l,l+1)===">"?1:0),q=`${i}>`;return{range:M.cursor(l+q.length,-1),changes:{from:l,to:g,insert:q}}}}return{range:n}});return f.changes.empty?!1:(e.dispatch([a,s.update(f,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{fe as autoCloseTags,ue as completeFromSchema,he as xml,w as xmlLanguage}; diff --git a/internal/relay/web-dist/assets/index-DRFRE0Ca.js b/internal/relay/web-dist/assets/index-Bf0-KgBD.js similarity index 99% rename from internal/relay/web-dist/assets/index-DRFRE0Ca.js rename to internal/relay/web-dist/assets/index-Bf0-KgBD.js index f4330ee6..4bf80df8 100644 --- a/internal/relay/web-dist/assets/index-DRFRE0Ca.js +++ b/internal/relay/web-dist/assets/index-Bf0-KgBD.js @@ -1 +1 @@ -import{k as L,h as $,i as E,a as j,N as y,p as S,I as G}from"./FileExplorer-BumK3wPT.js";var N={};class v{constructor(t,e,s,i,h,r,n,o,a,u=0,f){this.p=t,this.stack=e,this.state=s,this.reducePos=i,this.pos=h,this.score=r,this.buffer=n,this.bufferBase=o,this.curContext=a,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((t,e)=>e%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,s=0){let i=t.parser.context;return new v(t,[],e,s,s,0,[],0,i?new R(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var e;let s=t>>19,i=t&65535,{parser:h}=this.p,r=this.reducePos=2e3&&!(!((e=this.p.parser.nodeSet.types[i])===null||e===void 0)&&e.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizeo;)this.stack.pop();this.reduceContext(i,a)}storeNode(t,e,s,i=4,h=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[r-4]==0&&this.buffer[r-1]>-1){if(e==s)return;if(this.buffer[r-2]>=e){this.buffer[r-2]=s;return}}}if(!h||this.pos==s)this.buffer.push(t,e,s,i);else{let r=this.buffer.length;if(r>0&&(this.buffer[r-4]!=0||this.buffer[r-1]<0)){let n=!1;for(let o=r;o>0&&this.buffer[o-2]>s;o-=4)if(this.buffer[o-1]>=0){n=!0;break}if(n)for(;r>0&&this.buffer[r-2]>s;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,i>4&&(i-=4)}this.buffer[r]=t,this.buffer[r+1]=e,this.buffer[r+2]=s,this.buffer[r+3]=i}}shift(t,e,s,i){if(t&131072)this.pushState(t&65535,this.pos);else if(t&262144)this.pos=i,this.shiftContext(e,s),e<=this.p.parser.maxNode&&this.buffer.push(e,s,i,4);else{let h=t,{parser:r}=this.p;this.pos=i;let n=r.stateFlag(h,1);!n&&(i>s||e<=r.maxNode)&&(this.reducePos=i),this.pushState(h,n?s:Math.min(s,this.reducePos)),this.shiftContext(e,s),e<=r.maxNode&&this.buffer.push(e,s,i,4)}}apply(t,e,s,i){t&65536?this.reduce(t):this.shift(t,e,s,i)}useNode(t,e){let s=this.p.reused.length-1;(s<0||this.p.reused[s]!=t)&&(this.p.reused.push(t),s++);let i=this.pos;this.reducePos=this.pos=i+t.length,this.pushState(e,i),this.buffer.push(s,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,e=t.buffer.length;for(e&&t.buffer[e-4]==0&&(e-=4);e>0&&t.buffer[e-2]>t.reducePos;)e-=4;let s=t.buffer.slice(e),i=t.bufferBase+e;for(;t&&i==t.bufferBase;)t=t.parent;return new v(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,s,i,this.curContext,this.lookAhead,t)}recoverByDelete(t,e){let s=t<=this.p.parser.maxNode;s&&this.storeNode(t,this.pos,e,4),this.storeNode(0,this.pos,e,s?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(t){for(let e=new U(this);;){let s=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,t);if(s==0)return!1;if(!(s&65536))return!0;e.reduce(s)}}recoverByInsert(t){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>8||this.stack.length>=120){let i=[];for(let h=0,r;ho&1&&n==r)||i.push(e[h],r)}e=i}let s=[];for(let i=0;i>19,i=e&65535,h=this.stack.length-s*3;if(h<0||t.getGoto(this.stack[h],i,!1)<0){let r=this.findForcedReduction();if(r==null)return!1;e=r}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}findForcedReduction(){let{parser:t}=this.p,e=[],s=(i,h)=>{if(!e.includes(i))return e.push(i),t.allActions(i,r=>{if(!(r&393216))if(r&65536){let n=(r>>19)-h;if(n>1){let o=r&65535,a=this.stack.length-n*3;if(a>=0&&t.getGoto(this.stack[a],o,!1)>=0)return n<<19|65536|o}}else{let n=s(r,h+1);if(n!=null)return n}})};return s(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let e=0;e0&&this.emitLookAhead()}}class R{constructor(t,e){this.tracker=t,this.context=e,this.hash=t.strict?t.hash(e):0}}class U{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let e=t&65535,s=t>>19;s==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(s-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],e,!0);this.state=i}}class A{constructor(t,e,s){this.stack=t,this.pos=e,this.index=s,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,e=t.bufferBase+t.buffer.length){return new A(t,e,e-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new A(this.stack,this.pos,this.index)}}function x(l,t=Uint16Array){if(typeof l!="string")return l;let e=null;for(let s=0,i=0;s=92&&r--,r>=34&&r--;let o=r-32;if(o>=46&&(o-=46,n=!0),h+=o,n)break;h*=46}e?e[i++]=h:e=new t(h)}return e}class P{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const z=new P;class H{constructor(t,e){this.input=t,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=z,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(t,e){let s=this.range,i=this.rangeIndex,h=this.pos+t;for(;hs.to:h>=s.to;){if(i==this.ranges.length-1)return null;let r=this.ranges[++i];h+=r.from-s.to,s=r}return h}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,e.from);return this.end}peek(t){let e=this.chunkOff+t,s,i;if(e>=0&&e=this.chunk2Pos&&sn.to&&(this.chunk2=this.chunk2.slice(0,n.to-s)),i=this.chunk2.charCodeAt(0)}}return s>=this.token.lookAhead&&(this.token.lookAhead=s+1),i}acceptToken(t,e=0){let s=e?this.resolveOffset(e,-1):this.pos;if(s==null||s=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,e){if(e?(this.token=e,e.start=t,e.lookAhead=t+1,e.value=e.extended=-1):this.token=z,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,e-this.chunkPos);if(t>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,e-this.chunk2Pos);if(t>=this.range.from&&e<=this.range.to)return this.input.read(t,e);let s="";for(let i of this.ranges){if(i.from>=e)break;i.to>t&&(s+=this.input.read(Math.max(i.from,t),Math.min(i.to,e)))}return s}}class m{constructor(t,e){this.data=t,this.id=e}token(t,e){let{parser:s}=e.p;O(this.data,t,e,this.id,s.data,s.tokenPrecTable)}}m.prototype.contextual=m.prototype.fallback=m.prototype.extend=!1;class W{constructor(t,e,s){this.precTable=e,this.elseToken=s,this.data=typeof t=="string"?x(t):t}token(t,e){let s=t.pos,i=0;for(;;){let h=t.next<0,r=t.resolveOffset(1,1);if(O(this.data,t,e,0,this.data,this.precTable),t.token.value>-1)break;if(this.elseToken==null)return;if(h||i++,r==null)break;t.reset(r,t.token)}i&&(t.reset(s,t.token),t.acceptToken(this.elseToken,i))}}W.prototype.contextual=m.prototype.fallback=m.prototype.extend=!1;class Z{constructor(t,e={}){this.token=t,this.contextual=!!e.contextual,this.fallback=!!e.fallback,this.extend=!!e.extend}}function O(l,t,e,s,i,h){let r=0,n=1<0){let p=l[c];if(o.allows(p)&&(t.token.value==-1||t.token.value==p||q(p,t.token.value,i,h))){t.acceptToken(p);break}}let u=t.next,f=0,d=l[r+2];if(t.next<0&&d>f&&l[a+d*3-3]==65535){r=l[a+d*3-1];continue t}for(;f>1,p=a+c+(c<<1),b=l[p],M=l[p+1]||65536;if(u=M)f=c+1;else{r=l[p+2],t.advance();continue t}}break}}function I(l,t,e){for(let s=t,i;(i=l[s])!=65535;s++)if(i==e)return s-t;return-1}function q(l,t,e,s){let i=I(e,s,t);return i<0||I(e,s,l)t)&&!s.type.isError)return e<0?Math.max(0,Math.min(s.to-1,t-25)):Math.min(l.length,Math.max(s.from+1,t+25));if(e<0?s.prevSibling():s.nextSibling())break;if(!s.parent())return e<0?0:l.length}}class J{constructor(t,e){this.fragments=t,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?D(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?D(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=r,null;if(h instanceof S){if(r==t){if(r=Math.max(this.safeFrom,t)&&(this.trees.push(h),this.start.push(r),this.index.push(0))}else this.index[e]++,this.nextStart=r+h.length}}}class K{constructor(t,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(s=>new P)}getActions(t){let e=0,s=null,{parser:i}=t.p,{tokenizers:h}=i,r=i.stateSlot(t.state,3),n=t.curContext?t.curContext.hash:0,o=0;for(let a=0;af.end+25&&(o=Math.max(f.lookAhead,o)),f.value!=0)){let d=e;if(f.extended>-1&&(e=this.addActions(t,f.extended,f.end,e)),e=this.addActions(t,f.value,f.end,e),!u.extend&&(s=f,e>d))break}}for(;this.actions.length>e;)this.actions.pop();return o&&t.setLookAhead(o),!s&&t.pos==this.stream.end&&(s=new P,s.value=t.p.parser.eofTerm,s.start=s.end=t.pos,e=this.addActions(t,s.value,s.end,e)),this.mainToken=s,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let e=new P,{pos:s,p:i}=t;return e.start=s,e.end=Math.min(s+1,i.stream.end),e.value=s==i.stream.end?i.parser.eofTerm:0,e}updateCachedToken(t,e,s){let i=this.stream.clipPos(s.pos);if(e.token(this.stream.reset(i,t),s),t.value>-1){let{parser:h}=s.p;for(let r=0;r=0&&s.p.parser.dialect.allows(n>>1)){n&1?t.extended=n>>1:t.value=n>>1;break}}}else t.value=0,t.end=this.stream.clipPos(i+1)}putAction(t,e,s,i){for(let h=0;ht.bufferLength*4?new J(s,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,e=this.minStackPos,s=this.stacks=[],i,h;if(this.bigReductionCount>300&&t.length==1){let[r]=t;for(;r.forceReduce()&&r.stack.length&&r.stack[r.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let r=0;re)s.push(n);else{if(this.advanceStack(n,s,t))continue;{i||(i=[],h=[]),i.push(n);let o=this.tokens.getMainToken(n);h.push(o.value,o.end)}}break}}if(!s.length){let r=i&&X(i);if(r)return g&&console.log("Finish with "+this.stackID(r)),this.stackToTree(r);if(this.parser.strict)throw g&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+e);this.recovering||(this.recovering=5)}if(this.recovering&&i){let r=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,h,s);if(r)return g&&console.log("Force-finish "+this.stackID(r)),this.stackToTree(r.forceAll())}if(this.recovering){let r=this.recovering==1?1:this.recovering*3;if(s.length>r)for(s.sort((n,o)=>o.score-n.score);s.length>r;)s.pop();s.some(n=>n.reducePos>e)&&this.recovering--}else if(s.length>1){t:for(let r=0;r500&&a.buffer.length>500)if((n.score-a.score||n.buffer.length-a.buffer.length)>0)s.splice(o--,1);else{s.splice(r--,1);continue t}}}s.length>12&&(s.sort((r,n)=>n.score-r.score),s.splice(12,s.length-12))}this.minStackPos=s[0].pos;for(let r=1;r ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let a=t.curContext&&t.curContext.tracker.strict,u=a?t.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?h.getGoto(t.state,f.type.id):-1;if(d>-1&&f.length&&(!a||(f.prop(y.contextHash)||0)==u))return t.useNode(f,d),g&&console.log(r+this.stackID(t)+` (via reuse of ${h.getName(f.type.id)})`),!0;if(!(f instanceof S)||f.children.length==0||f.positions[0]>0)break;let c=f.children[0];if(c instanceof S&&f.positions[0]==0)f=c;else break}}let n=h.stateSlot(t.state,4);if(n>0)return t.reduce(n),g&&console.log(r+this.stackID(t)+` (via always-reduce ${h.getName(n&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let o=this.tokens.getActions(t);for(let a=0;ai?e.push(p):s.push(p)}return!1}advanceFully(t,e){let s=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>s)return B(t,e),!0}}runRecovery(t,e,s){let i=null,h=!1;for(let r=0;r ":"";if(n.deadEnd&&(h||(h=!0,n.restart(),g&&console.log(u+this.stackID(n)+" (restarted)"),this.advanceFully(n,s))))continue;let f=n.split(),d=u;for(let c=0;c<10&&f.forceReduce()&&(g&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,s));c++)g&&(d=this.stackID(f)+" -> ");for(let c of n.recoverByInsert(o))g&&console.log(u+this.stackID(c)+" (via recover-insert)"),this.advanceFully(c,s);this.stream.end>n.pos?(a==n.pos&&(a++,o=0),n.recoverByDelete(o,a),g&&console.log(u+this.stackID(n)+` (via recover-delete ${this.parser.getName(o)})`),B(n,s)):(!i||i.scorel;class _{constructor(t){this.start=t.start,this.shift=t.shift||C,this.reduce=t.reduce||C,this.reuse=t.reuse||C,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class w extends L{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let e=t.nodeNames.split(" ");this.minRepeatTerm=e.length;for(let n=0;nt.topRules[n][1]),i=[];for(let n=0;n=0)h(u,o,n[a++]);else{let f=n[a+-u];for(let d=-u;d>0;d--)h(n[a++],o,f);a++}}}this.nodeSet=new $(e.map((n,o)=>E.define({name:o>=this.minRepeatTerm?void 0:n,id:o,props:i[o],top:s.indexOf(o)>-1,error:o==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(o)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=j;let r=x(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let n=0;ntypeof n=="number"?new m(r,n):n),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,e,s){let i=new Q(this,t,e,s);for(let h of this.wrappers)i=h(i,t,e,s);return i}getGoto(t,e,s=!1){let i=this.goto;if(e>=i[0])return-1;for(let h=i[e+1];;){let r=i[h++],n=r&1,o=i[h++];if(n&&s)return o;for(let a=h+(r>>1);h0}validAction(t,e){return!!this.allActions(t,s=>s==e?!0:null)}allActions(t,e){let s=this.stateSlot(t,4),i=s?e(s):void 0;for(let h=this.stateSlot(t,1);i==null;h+=3){if(this.data[h]==65535)if(this.data[h+1]==1)h=k(this.data,h+2);else break;i=e(k(this.data,h+1))}return i}nextStates(t){let e=[];for(let s=this.stateSlot(t,1);;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=k(this.data,s+2);else break;if(!(this.data[s+2]&1)){let i=this.data[s+1];e.some((h,r)=>r&1&&h==i)||e.push(this.data[s],i)}}return e}configure(t){let e=Object.assign(Object.create(w.prototype),this);if(t.props&&(e.nodeSet=this.nodeSet.extend(...t.props)),t.top){let s=this.topRules[t.top];if(!s)throw new RangeError(`Invalid top rule name ${t.top}`);e.top=s}return t.tokenizers&&(e.tokenizers=this.tokenizers.map(s=>{let i=t.tokenizers.find(h=>h.from==s);return i?i.to:s})),t.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map((s,i)=>{let h=t.specializers.find(n=>n.from==s.external);if(!h)return s;let r=Object.assign(Object.assign({},s),{external:h.to});return e.specializers[i]=F(r),r})),t.contextTracker&&(e.context=t.contextTracker),t.dialect&&(e.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(e.strict=t.strict),t.wrap&&(e.wrappers=e.wrappers.concat(t.wrap)),t.bufferLength!=null&&(e.bufferLength=t.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let e=this.dynamicPrecedences;return e==null?0:e[t]||0}parseDialect(t){let e=Object.keys(this.dialects),s=e.map(()=>!1);if(t)for(let h of t.split(" ")){let r=e.indexOf(h);r>=0&&(s[r]=!0)}let i=null;for(let h=0;hs)&&e.p.parser.stateFlag(e.state,2)&&(!t||t.scorel.external(e,s)<<1|t}return l.get}export{_ as C,Z as E,w as L,W as a}; +import{k as L,h as $,i as E,a as j,N as y,p as S,I as G}from"./FileExplorer-BmPzqkbb.js";var N={};class v{constructor(t,e,s,i,h,r,n,o,a,u=0,f){this.p=t,this.stack=e,this.state=s,this.reducePos=i,this.pos=h,this.score=r,this.buffer=n,this.bufferBase=o,this.curContext=a,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((t,e)=>e%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,s=0){let i=t.parser.context;return new v(t,[],e,s,s,0,[],0,i?new R(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var e;let s=t>>19,i=t&65535,{parser:h}=this.p,r=this.reducePos=2e3&&!(!((e=this.p.parser.nodeSet.types[i])===null||e===void 0)&&e.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizeo;)this.stack.pop();this.reduceContext(i,a)}storeNode(t,e,s,i=4,h=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[r-4]==0&&this.buffer[r-1]>-1){if(e==s)return;if(this.buffer[r-2]>=e){this.buffer[r-2]=s;return}}}if(!h||this.pos==s)this.buffer.push(t,e,s,i);else{let r=this.buffer.length;if(r>0&&(this.buffer[r-4]!=0||this.buffer[r-1]<0)){let n=!1;for(let o=r;o>0&&this.buffer[o-2]>s;o-=4)if(this.buffer[o-1]>=0){n=!0;break}if(n)for(;r>0&&this.buffer[r-2]>s;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,i>4&&(i-=4)}this.buffer[r]=t,this.buffer[r+1]=e,this.buffer[r+2]=s,this.buffer[r+3]=i}}shift(t,e,s,i){if(t&131072)this.pushState(t&65535,this.pos);else if(t&262144)this.pos=i,this.shiftContext(e,s),e<=this.p.parser.maxNode&&this.buffer.push(e,s,i,4);else{let h=t,{parser:r}=this.p;this.pos=i;let n=r.stateFlag(h,1);!n&&(i>s||e<=r.maxNode)&&(this.reducePos=i),this.pushState(h,n?s:Math.min(s,this.reducePos)),this.shiftContext(e,s),e<=r.maxNode&&this.buffer.push(e,s,i,4)}}apply(t,e,s,i){t&65536?this.reduce(t):this.shift(t,e,s,i)}useNode(t,e){let s=this.p.reused.length-1;(s<0||this.p.reused[s]!=t)&&(this.p.reused.push(t),s++);let i=this.pos;this.reducePos=this.pos=i+t.length,this.pushState(e,i),this.buffer.push(s,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,e=t.buffer.length;for(e&&t.buffer[e-4]==0&&(e-=4);e>0&&t.buffer[e-2]>t.reducePos;)e-=4;let s=t.buffer.slice(e),i=t.bufferBase+e;for(;t&&i==t.bufferBase;)t=t.parent;return new v(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,s,i,this.curContext,this.lookAhead,t)}recoverByDelete(t,e){let s=t<=this.p.parser.maxNode;s&&this.storeNode(t,this.pos,e,4),this.storeNode(0,this.pos,e,s?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(t){for(let e=new U(this);;){let s=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,t);if(s==0)return!1;if(!(s&65536))return!0;e.reduce(s)}}recoverByInsert(t){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>8||this.stack.length>=120){let i=[];for(let h=0,r;ho&1&&n==r)||i.push(e[h],r)}e=i}let s=[];for(let i=0;i>19,i=e&65535,h=this.stack.length-s*3;if(h<0||t.getGoto(this.stack[h],i,!1)<0){let r=this.findForcedReduction();if(r==null)return!1;e=r}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}findForcedReduction(){let{parser:t}=this.p,e=[],s=(i,h)=>{if(!e.includes(i))return e.push(i),t.allActions(i,r=>{if(!(r&393216))if(r&65536){let n=(r>>19)-h;if(n>1){let o=r&65535,a=this.stack.length-n*3;if(a>=0&&t.getGoto(this.stack[a],o,!1)>=0)return n<<19|65536|o}}else{let n=s(r,h+1);if(n!=null)return n}})};return s(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let e=0;e0&&this.emitLookAhead()}}class R{constructor(t,e){this.tracker=t,this.context=e,this.hash=t.strict?t.hash(e):0}}class U{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let e=t&65535,s=t>>19;s==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(s-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],e,!0);this.state=i}}class A{constructor(t,e,s){this.stack=t,this.pos=e,this.index=s,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,e=t.bufferBase+t.buffer.length){return new A(t,e,e-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new A(this.stack,this.pos,this.index)}}function x(l,t=Uint16Array){if(typeof l!="string")return l;let e=null;for(let s=0,i=0;s=92&&r--,r>=34&&r--;let o=r-32;if(o>=46&&(o-=46,n=!0),h+=o,n)break;h*=46}e?e[i++]=h:e=new t(h)}return e}class P{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const z=new P;class H{constructor(t,e){this.input=t,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=z,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(t,e){let s=this.range,i=this.rangeIndex,h=this.pos+t;for(;hs.to:h>=s.to;){if(i==this.ranges.length-1)return null;let r=this.ranges[++i];h+=r.from-s.to,s=r}return h}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,e.from);return this.end}peek(t){let e=this.chunkOff+t,s,i;if(e>=0&&e=this.chunk2Pos&&sn.to&&(this.chunk2=this.chunk2.slice(0,n.to-s)),i=this.chunk2.charCodeAt(0)}}return s>=this.token.lookAhead&&(this.token.lookAhead=s+1),i}acceptToken(t,e=0){let s=e?this.resolveOffset(e,-1):this.pos;if(s==null||s=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,e){if(e?(this.token=e,e.start=t,e.lookAhead=t+1,e.value=e.extended=-1):this.token=z,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,e-this.chunkPos);if(t>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,e-this.chunk2Pos);if(t>=this.range.from&&e<=this.range.to)return this.input.read(t,e);let s="";for(let i of this.ranges){if(i.from>=e)break;i.to>t&&(s+=this.input.read(Math.max(i.from,t),Math.min(i.to,e)))}return s}}class m{constructor(t,e){this.data=t,this.id=e}token(t,e){let{parser:s}=e.p;O(this.data,t,e,this.id,s.data,s.tokenPrecTable)}}m.prototype.contextual=m.prototype.fallback=m.prototype.extend=!1;class W{constructor(t,e,s){this.precTable=e,this.elseToken=s,this.data=typeof t=="string"?x(t):t}token(t,e){let s=t.pos,i=0;for(;;){let h=t.next<0,r=t.resolveOffset(1,1);if(O(this.data,t,e,0,this.data,this.precTable),t.token.value>-1)break;if(this.elseToken==null)return;if(h||i++,r==null)break;t.reset(r,t.token)}i&&(t.reset(s,t.token),t.acceptToken(this.elseToken,i))}}W.prototype.contextual=m.prototype.fallback=m.prototype.extend=!1;class Z{constructor(t,e={}){this.token=t,this.contextual=!!e.contextual,this.fallback=!!e.fallback,this.extend=!!e.extend}}function O(l,t,e,s,i,h){let r=0,n=1<0){let p=l[c];if(o.allows(p)&&(t.token.value==-1||t.token.value==p||q(p,t.token.value,i,h))){t.acceptToken(p);break}}let u=t.next,f=0,d=l[r+2];if(t.next<0&&d>f&&l[a+d*3-3]==65535){r=l[a+d*3-1];continue t}for(;f>1,p=a+c+(c<<1),b=l[p],M=l[p+1]||65536;if(u=M)f=c+1;else{r=l[p+2],t.advance();continue t}}break}}function I(l,t,e){for(let s=t,i;(i=l[s])!=65535;s++)if(i==e)return s-t;return-1}function q(l,t,e,s){let i=I(e,s,t);return i<0||I(e,s,l)t)&&!s.type.isError)return e<0?Math.max(0,Math.min(s.to-1,t-25)):Math.min(l.length,Math.max(s.from+1,t+25));if(e<0?s.prevSibling():s.nextSibling())break;if(!s.parent())return e<0?0:l.length}}class J{constructor(t,e){this.fragments=t,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?D(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?D(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=r,null;if(h instanceof S){if(r==t){if(r=Math.max(this.safeFrom,t)&&(this.trees.push(h),this.start.push(r),this.index.push(0))}else this.index[e]++,this.nextStart=r+h.length}}}class K{constructor(t,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(s=>new P)}getActions(t){let e=0,s=null,{parser:i}=t.p,{tokenizers:h}=i,r=i.stateSlot(t.state,3),n=t.curContext?t.curContext.hash:0,o=0;for(let a=0;af.end+25&&(o=Math.max(f.lookAhead,o)),f.value!=0)){let d=e;if(f.extended>-1&&(e=this.addActions(t,f.extended,f.end,e)),e=this.addActions(t,f.value,f.end,e),!u.extend&&(s=f,e>d))break}}for(;this.actions.length>e;)this.actions.pop();return o&&t.setLookAhead(o),!s&&t.pos==this.stream.end&&(s=new P,s.value=t.p.parser.eofTerm,s.start=s.end=t.pos,e=this.addActions(t,s.value,s.end,e)),this.mainToken=s,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let e=new P,{pos:s,p:i}=t;return e.start=s,e.end=Math.min(s+1,i.stream.end),e.value=s==i.stream.end?i.parser.eofTerm:0,e}updateCachedToken(t,e,s){let i=this.stream.clipPos(s.pos);if(e.token(this.stream.reset(i,t),s),t.value>-1){let{parser:h}=s.p;for(let r=0;r=0&&s.p.parser.dialect.allows(n>>1)){n&1?t.extended=n>>1:t.value=n>>1;break}}}else t.value=0,t.end=this.stream.clipPos(i+1)}putAction(t,e,s,i){for(let h=0;ht.bufferLength*4?new J(s,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,e=this.minStackPos,s=this.stacks=[],i,h;if(this.bigReductionCount>300&&t.length==1){let[r]=t;for(;r.forceReduce()&&r.stack.length&&r.stack[r.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let r=0;re)s.push(n);else{if(this.advanceStack(n,s,t))continue;{i||(i=[],h=[]),i.push(n);let o=this.tokens.getMainToken(n);h.push(o.value,o.end)}}break}}if(!s.length){let r=i&&X(i);if(r)return g&&console.log("Finish with "+this.stackID(r)),this.stackToTree(r);if(this.parser.strict)throw g&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+e);this.recovering||(this.recovering=5)}if(this.recovering&&i){let r=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,h,s);if(r)return g&&console.log("Force-finish "+this.stackID(r)),this.stackToTree(r.forceAll())}if(this.recovering){let r=this.recovering==1?1:this.recovering*3;if(s.length>r)for(s.sort((n,o)=>o.score-n.score);s.length>r;)s.pop();s.some(n=>n.reducePos>e)&&this.recovering--}else if(s.length>1){t:for(let r=0;r500&&a.buffer.length>500)if((n.score-a.score||n.buffer.length-a.buffer.length)>0)s.splice(o--,1);else{s.splice(r--,1);continue t}}}s.length>12&&(s.sort((r,n)=>n.score-r.score),s.splice(12,s.length-12))}this.minStackPos=s[0].pos;for(let r=1;r ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let a=t.curContext&&t.curContext.tracker.strict,u=a?t.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?h.getGoto(t.state,f.type.id):-1;if(d>-1&&f.length&&(!a||(f.prop(y.contextHash)||0)==u))return t.useNode(f,d),g&&console.log(r+this.stackID(t)+` (via reuse of ${h.getName(f.type.id)})`),!0;if(!(f instanceof S)||f.children.length==0||f.positions[0]>0)break;let c=f.children[0];if(c instanceof S&&f.positions[0]==0)f=c;else break}}let n=h.stateSlot(t.state,4);if(n>0)return t.reduce(n),g&&console.log(r+this.stackID(t)+` (via always-reduce ${h.getName(n&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let o=this.tokens.getActions(t);for(let a=0;ai?e.push(p):s.push(p)}return!1}advanceFully(t,e){let s=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>s)return B(t,e),!0}}runRecovery(t,e,s){let i=null,h=!1;for(let r=0;r ":"";if(n.deadEnd&&(h||(h=!0,n.restart(),g&&console.log(u+this.stackID(n)+" (restarted)"),this.advanceFully(n,s))))continue;let f=n.split(),d=u;for(let c=0;c<10&&f.forceReduce()&&(g&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,s));c++)g&&(d=this.stackID(f)+" -> ");for(let c of n.recoverByInsert(o))g&&console.log(u+this.stackID(c)+" (via recover-insert)"),this.advanceFully(c,s);this.stream.end>n.pos?(a==n.pos&&(a++,o=0),n.recoverByDelete(o,a),g&&console.log(u+this.stackID(n)+` (via recover-delete ${this.parser.getName(o)})`),B(n,s)):(!i||i.scorel;class _{constructor(t){this.start=t.start,this.shift=t.shift||C,this.reduce=t.reduce||C,this.reuse=t.reuse||C,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class w extends L{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let e=t.nodeNames.split(" ");this.minRepeatTerm=e.length;for(let n=0;nt.topRules[n][1]),i=[];for(let n=0;n=0)h(u,o,n[a++]);else{let f=n[a+-u];for(let d=-u;d>0;d--)h(n[a++],o,f);a++}}}this.nodeSet=new $(e.map((n,o)=>E.define({name:o>=this.minRepeatTerm?void 0:n,id:o,props:i[o],top:s.indexOf(o)>-1,error:o==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(o)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=j;let r=x(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let n=0;ntypeof n=="number"?new m(r,n):n),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,e,s){let i=new Q(this,t,e,s);for(let h of this.wrappers)i=h(i,t,e,s);return i}getGoto(t,e,s=!1){let i=this.goto;if(e>=i[0])return-1;for(let h=i[e+1];;){let r=i[h++],n=r&1,o=i[h++];if(n&&s)return o;for(let a=h+(r>>1);h0}validAction(t,e){return!!this.allActions(t,s=>s==e?!0:null)}allActions(t,e){let s=this.stateSlot(t,4),i=s?e(s):void 0;for(let h=this.stateSlot(t,1);i==null;h+=3){if(this.data[h]==65535)if(this.data[h+1]==1)h=k(this.data,h+2);else break;i=e(k(this.data,h+1))}return i}nextStates(t){let e=[];for(let s=this.stateSlot(t,1);;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=k(this.data,s+2);else break;if(!(this.data[s+2]&1)){let i=this.data[s+1];e.some((h,r)=>r&1&&h==i)||e.push(this.data[s],i)}}return e}configure(t){let e=Object.assign(Object.create(w.prototype),this);if(t.props&&(e.nodeSet=this.nodeSet.extend(...t.props)),t.top){let s=this.topRules[t.top];if(!s)throw new RangeError(`Invalid top rule name ${t.top}`);e.top=s}return t.tokenizers&&(e.tokenizers=this.tokenizers.map(s=>{let i=t.tokenizers.find(h=>h.from==s);return i?i.to:s})),t.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map((s,i)=>{let h=t.specializers.find(n=>n.from==s.external);if(!h)return s;let r=Object.assign(Object.assign({},s),{external:h.to});return e.specializers[i]=F(r),r})),t.contextTracker&&(e.context=t.contextTracker),t.dialect&&(e.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(e.strict=t.strict),t.wrap&&(e.wrappers=e.wrappers.concat(t.wrap)),t.bufferLength!=null&&(e.bufferLength=t.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let e=this.dynamicPrecedences;return e==null?0:e[t]||0}parseDialect(t){let e=Object.keys(this.dialects),s=e.map(()=>!1);if(t)for(let h of t.split(" ")){let r=e.indexOf(h);r>=0&&(s[r]=!0)}let i=null;for(let h=0;hs)&&e.p.parser.stateFlag(e.state,2)&&(!t||t.scorel.external(e,s)<<1|t}return l.get}export{_ as C,Z as E,w as L,W as a}; diff --git a/internal/relay/web-dist/assets/index-B5lmJj73.js b/internal/relay/web-dist/assets/index-C1t4FMl1.js similarity index 85% rename from internal/relay/web-dist/assets/index-B5lmJj73.js rename to internal/relay/web-dist/assets/index-C1t4FMl1.js index 7e937ef4..9f94ae07 100644 --- a/internal/relay/web-dist/assets/index-B5lmJj73.js +++ b/internal/relay/web-dist/assets/index-C1t4FMl1.js @@ -1 +1 @@ -import{L as r}from"./index-DRFRE0Ca.js";import{J as a,Q as O,g as P,L as o,z as t,r as e,x as Q,w as s}from"./FileExplorer-BumK3wPT.js";import"./useI18n-lwZlSdSx.js";import"./index-Ci2MtInW.js";import"./prefsSync-C5tz9Q-s.js";import"./client-DMh7GjbV.js";import"./Switch-DguIL3dU.js";import"./auth-B3RxKR1W.js";const n=a({String:O.string,Number:O.number,"True False":O.bool,PropertyName:O.propertyName,Null:O.null,", :":O.separator,"[ ]":O.squareBracket,"{ }":O.brace}),i=r.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[n],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),p=o.define({name:"json",parser:i.configure({props:[t.add({Object:e({except:/^\s*\}/}),Array:e({except:/^\s*\]/})}),Q.add({"Object Array":s})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function b(){return new P(p)}export{b as json,p as jsonLanguage}; +import{L as r}from"./index-Bf0-KgBD.js";import{J as a,Q as O,g as P,L as o,z as t,r as e,x as Q,w as s}from"./FileExplorer-BmPzqkbb.js";import"./useI18n-D4u8zssu.js";import"./index-zrZBIArQ.js";import"./prefsSync-Dj3wNxrO.js";import"./client-n-fLEpOg.js";import"./Switch-BlSJOKEO.js";import"./auth-BBmiA1GG.js";const n=a({String:O.string,Number:O.number,"True False":O.bool,PropertyName:O.propertyName,Null:O.null,", :":O.separator,"[ ]":O.squareBracket,"{ }":O.brace}),i=r.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[n],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),p=o.define({name:"json",parser:i.configure({props:[t.add({Object:e({except:/^\s*\}/}),Array:e({except:/^\s*\]/})}),Q.add({"Object Array":s})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function b(){return new P(p)}export{b as json,p as jsonLanguage}; diff --git a/internal/relay/web-dist/assets/index-CHTSx7s6.js b/internal/relay/web-dist/assets/index-C7tiEnPN.js similarity index 97% rename from internal/relay/web-dist/assets/index-CHTSx7s6.js rename to internal/relay/web-dist/assets/index-C7tiEnPN.js index 6769ab20..287c82e5 100644 --- a/internal/relay/web-dist/assets/index-CHTSx7s6.js +++ b/internal/relay/web-dist/assets/index-C7tiEnPN.js @@ -1,2 +1,2 @@ -import{g as M,L as H,z as J,r as ee,x as te,J as ae,Q as n,O as re}from"./FileExplorer-BumK3wPT.js";import{E as oe,L as ne}from"./index-DRFRE0Ca.js";import{i as le,c as se}from"./index-DblmzGAc.js";import"./useI18n-lwZlSdSx.js";import"./index-Ci2MtInW.js";import"./prefsSync-C5tz9Q-s.js";import"./client-DMh7GjbV.js";import"./Switch-DguIL3dU.js";import"./auth-B3RxKR1W.js";const ie=36,R=1,ce=2,k=3,S=4,fe=5,de=6,Oe=7,me=8,ue=9,he=10,ke=11,Qe=12,ge=13,ve=14,xe=15,be=16,pe=17,q=18,Ce=19,$=20,A=21,L=22,Se=23,Pe=24;function y(t){return t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57}function ye(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function h(t,e,r){for(let a=!1;;){if(t.next<0)return;if(t.next==e&&!a){t.advance();return}a=r&&!a&&t.next==92,t.advance()}}function we(t,e){e:for(;;){if(t.next<0)return;if(t.next==36){t.advance();for(let r=0;r)".charCodeAt(r);for(;;){if(t.next<0)return;if(t.next==a&&t.peek(1)==39){t.advance(2);return}t.advance()}}function w(t,e){for(;!(t.next!=95&&!y(t.next));)e!=null&&(e+=String.fromCharCode(t.next)),t.advance();return e}function Ue(t){if(t.next==39||t.next==34||t.next==96){let e=t.next;t.advance(),h(t,e,!1)}else w(t)}function Z(t,e){for(;t.next==48||t.next==49;)t.advance();e&&t.next==e&&t.advance()}function D(t,e){for(;;){if(t.next==46){if(e)break;e=!0}else if(t.next<48||t.next>57)break;t.advance()}if(t.next==69||t.next==101)for(t.advance(),(t.next==43||t.next==45)&&t.advance();t.next>=48&&t.next<=57;)t.advance()}function j(t){for(;!(t.next<0||t.next==10);)t.advance()}function u(t,e){for(let r=0;r=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57}function ye(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function h(t,e,r){for(let a=!1;;){if(t.next<0)return;if(t.next==e&&!a){t.advance();return}a=r&&!a&&t.next==92,t.advance()}}function we(t,e){e:for(;;){if(t.next<0)return;if(t.next==36){t.advance();for(let r=0;r)".charCodeAt(r);for(;;){if(t.next<0)return;if(t.next==a&&t.peek(1)==39){t.advance(2);return}t.advance()}}function w(t,e){for(;!(t.next!=95&&!y(t.next));)e!=null&&(e+=String.fromCharCode(t.next)),t.advance();return e}function Ue(t){if(t.next==39||t.next==34||t.next==96){let e=t.next;t.advance(),h(t,e,!1)}else w(t)}function Z(t,e){for(;t.next==48||t.next==49;)t.advance();e&&t.next==e&&t.advance()}function D(t,e){for(;;){if(t.next==46){if(e)break;e=!0}else if(t.next<48||t.next>57)break;t.advance()}if(t.next==69||t.next==101)for(t.advance(),(t.next==43||t.next==45)&&t.advance();t.next>=48&&t.next<=57;)t.advance()}function j(t){for(;!(t.next<0||t.next==10);)t.advance()}function u(t,e){for(let r=0;r!=&|~^/",specialVar:"?",identifierQuotes:'"',caseInsensitiveIdentifiers:!1,words:V(Xe,Be)};function Ie(t,e,r,a){let o={};for(let l in T)o[l]=(t.hasOwnProperty(l)?t:T)[l];return e&&(o.words=V(e,r||"",a)),o}function W(t){return new oe(e=>{var r;let{next:a}=e;if(e.advance(),u(a,P)){for(;u(e.next,P);)e.advance();e.acceptToken(ie)}else if(a==36&&t.doubleDollarQuotedStrings){let o=w(e,"");e.next==36&&(e.advance(),we(e,o),e.acceptToken(k))}else if(a==39||a==34&&t.doubleQuotedStrings)h(e,a,t.backslashEscapes),e.acceptToken(k);else if(a==35&&t.hashComments||a==47&&e.next==47&&t.slashComments)j(e),e.acceptToken(R);else if(a==45&&e.next==45&&(!t.spaceAfterDashes||e.peek(1)==32))j(e),e.acceptToken(R);else if(a==47&&e.next==42){e.advance();for(let o=1;;){let l=e.next;if(e.next<0)break;if(e.advance(),l==42&&e.next==47){if(o--,e.advance(),!o)break}else l==47&&e.next==42&&(o++,e.advance())}e.acceptToken(ce)}else if((a==101||a==69)&&e.next==39)e.advance(),h(e,39,!0),e.acceptToken(k);else if((a==110||a==78)&&e.next==39&&t.charSetCasts)e.advance(),h(e,39,t.backslashEscapes),e.acceptToken(k);else if(a==95&&t.charSetCasts)for(let o=0;;o++){if(e.next==39&&o>1){e.advance(),h(e,39,t.backslashEscapes),e.acceptToken(k);break}if(!y(e.next))break;e.advance()}else if(t.plsqlQuotingMechanism&&(a==113||a==81)&&e.next==39&&e.peek(1)>0&&!u(e.peek(1),P)){let o=e.peek(1);e.advance(2),Te(e,o),e.acceptToken(k)}else if(u(a,t.identifierQuotes)){const o=a==91?93:a;h(e,o,!1),e.acceptToken(Ce)}else if(a==40)e.acceptToken(Oe);else if(a==41)e.acceptToken(me);else if(a==123)e.acceptToken(ue);else if(a==125)e.acceptToken(he);else if(a==91)e.acceptToken(ke);else if(a==93)e.acceptToken(Qe);else if(a==59)e.acceptToken(ge);else if(t.unquotedBitLiterals&&a==48&&e.next==98)e.advance(),Z(e),e.acceptToken(L);else if((a==98||a==66)&&(e.next==39||e.next==34)){const o=e.next;e.advance(),t.treatBitsAsBytes?(h(e,o,t.backslashEscapes),e.acceptToken(Se)):(Z(e,o),e.acceptToken(L))}else if(a==48&&(e.next==120||e.next==88)||(a==120||a==88)&&e.next==39){let o=e.next==39;for(e.advance();ye(e.next);)e.advance();o&&e.next==39&&e.advance(),e.acceptToken(S)}else if(a==46&&e.next>=48&&e.next<=57)D(e,!0),e.acceptToken(S);else if(a==46)e.acceptToken(ve);else if(a>=48&&a<=57)D(e,!1),e.acceptToken(S);else if(u(a,t.operatorChars)){for(;u(e.next,t.operatorChars);)e.advance();e.acceptToken(xe)}else if(u(a,t.specialVar))e.next==a&&e.advance(),Ue(e),e.acceptToken(pe);else if(a==58||a==44)e.acceptToken(be);else if(y(a)){let o=w(e,String.fromCharCode(a));e.acceptToken(e.next==46||e.peek(-o.length-1)==46?q:(r=t.words[o.toLowerCase()])!==null&&r!==void 0?r:q)}})}const F=W(T),_e=ne.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,nodeProps:[["isolate",-4,1,2,3,19,""]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,F],topRules:{Script:[0,25]},tokenPrec:0});function U(t){let e=t.cursor().moveTo(t.from,-1);for(;/Comment/.test(e.name);)e.moveTo(e.from,-1);return e.node}function v(t,e){let r=t.sliceString(e.from,e.to),a=/^([`'"\[])(.*)([`'"\]])$/.exec(r);return a?a[2]:r}function p(t){return t&&(t.name=="Identifier"||t.name=="QuotedIdentifier")}function Re(t,e){if(e.name=="CompositeIdentifier"){let r=[];for(let a=e.firstChild;a;a=a.nextSibling)p(a)&&r.push(v(t,a));return r}return[v(t,e)]}function N(t,e){for(let r=[];;){if(!e||e.name!=".")return r;let a=U(e);if(!p(a))return r;r.unshift(v(t,a)),e=U(a)}}function qe(t,e){let r=re(t).resolveInner(e,-1),a=Ze(t.doc,r);return r.name=="Identifier"||r.name=="QuotedIdentifier"||r.name=="Keyword"?{from:r.from,quoted:r.name=="QuotedIdentifier"?t.doc.sliceString(r.from,r.from+1):null,parents:N(t.doc,U(r)),aliases:a}:r.name=="."?{from:e,quoted:null,parents:N(t.doc,r),aliases:a}:{from:e,quoted:null,parents:[],empty:!0,aliases:a}}const Le=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function Ze(t,e){let r;for(let o=e;!r;o=o.parent){if(!o)return null;o.name=="Statement"&&(r=o)}let a=null;for(let o=r.firstChild,l=!1,c=null;o;o=o.nextSibling){let i=o.name=="Keyword"?t.sliceString(o.from,o.to).toLowerCase():null,s=null;if(!l)l=i=="from";else if(i=="as"&&c&&p(o.nextSibling))s=v(t,o.nextSibling);else{if(i&&Le.has(i))break;c&&p(o)&&(s=v(t,o))}s&&(a||(a=Object.create(null)),a[s]=Re(t,c)),c=/Identifier$/.test(o.name)?o:null}return a}function De(t,e,r){return r.map(a=>({...a,label:a.label[0]==t?a.label:t+a.label+e,apply:void 0}))}const je=/^\w*$/,Ne=/^[`'"\[]?\w*[`'"\]]?$/;function z(t){return t.self&&typeof t.self.label=="string"}class B{constructor(e,r){this.idQuote=e,this.idCaseInsensitive=r,this.list=[],this.children=void 0}child(e){let r=this.children||(this.children=Object.create(null)),a=r[e];return a||(e&&!this.list.some(o=>o.label==e)&&this.list.push(E(e,"type",this.idQuote,this.idCaseInsensitive)),r[e]=new B(this.idQuote,this.idCaseInsensitive))}maybeChild(e){return this.children?this.children[e]:null}addCompletion(e){let r=this.list.findIndex(a=>a.label==e.label);r>-1?this.list[r]=e:this.list.push(e)}addCompletions(e){for(let r of e)this.addCompletion(typeof r=="string"?E(r,"property",this.idQuote,this.idCaseInsensitive):r)}addNamespace(e){Array.isArray(e)?this.addCompletions(e):z(e)?this.addNamespace(e.children):this.addNamespaceObject(e)}addNamespaceObject(e){for(let r of Object.keys(e)){let a=e[r],o=null,l=r.replace(/\\?\./g,i=>i=="."?"\0":i).split("\0"),c=this;z(a)&&(o=a.self,a=a.children);for(let i=0;i{let{parents:Q,from:I,quoted:_,empty:G,aliases:x}=qe(O.state,O.pos);if(G&&!O.explicit)return null;x&&Q.length==1&&(Q=x[Q[0]]||Q);let f=s;for(let m of Q){for(;!f.children||!f.children[m];)if(f==s&&d)f=d;else if(f==d&&a)f=f.child(a);else return null;let g=f.maybeChild(m);if(!g)return null;f=g}let b=f.list;if(f==s&&x&&(b=b.concat(Object.keys(x).map(m=>({label:m,type:"constant"})))),_){let m=_[0],g=K(m),Y=O.state.sliceDoc(O.pos,O.pos+1)==g;return{from:I,to:Y?O.pos+1:void 0,options:De(m,g,b),validFor:Ne}}else return{from:I,options:b,validFor:je}}}function Ee(t){return t==A?"type":t==$?"keyword":"variable"}function $e(t,e,r){let a=Object.keys(t).map(o=>r(e?o.toUpperCase():o,Ee(t[o])));return le(["QuotedIdentifier","String","LineComment","BlockComment","."],se(a))}let Ae=_e.configure({props:[J.add({Statement:ee()}),te.add({Statement(t,e){return{from:Math.min(t.from+100,e.doc.lineAt(t.from).to),to:t.to}},BlockComment(t){return{from:t.from+2,to:t.to-2}}}),ae({Keyword:n.keyword,Type:n.typeName,Builtin:n.standard(n.name),Bits:n.number,Bytes:n.string,Bool:n.bool,Null:n.null,Number:n.number,String:n.string,Identifier:n.name,QuotedIdentifier:n.special(n.string),SpecialVar:n.special(n.name),LineComment:n.lineComment,BlockComment:n.blockComment,Operator:n.operator,"Semi Punctuation":n.punctuation,"( )":n.paren,"{ }":n.brace,"[ ]":n.squareBracket})]});class C{constructor(e,r,a){this.dialect=e,this.language=r,this.spec=a}get extension(){return this.language.extension}configureLanguage(e,r){return new C(this.dialect,this.language.configure(e,r),this.spec)}static define(e){let r=Ie(e,e.keywords,e.types,e.builtin),a=H.define({name:"sql",parser:Ae.configure({tokenizers:[{from:F,to:W(r)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new C(r,a,e)}}function Ve(t,e){return{label:t,type:e,boost:-1}}function We(t,e=!1,r){return $e(t.dialect.words,e,r||Ve)}function Fe(t){return t.schema?ze(t.schema,t.tables,t.schemas,t.defaultTable,t.defaultSchema,t.dialect||X):()=>null}function Ke(t){return t.schema?(t.dialect||X).language.data.of({autocomplete:Fe(t)}):[]}function ot(t={}){let e=t.dialect||X;return new M(e.language,[Ke(t),e.language.data.of({autocomplete:We(e,t.upperCaseKeywords,t.keywordCompletion)})])}const X=C.define({});export{C as SQLDialect,X as StandardSQL,We as keywordCompletionSource,Fe as schemaCompletionSource,ot as sql}; diff --git a/internal/relay/web-dist/assets/index-DB-c3u2H.js b/internal/relay/web-dist/assets/index-CKUfNIJP.js similarity index 99% rename from internal/relay/web-dist/assets/index-DB-c3u2H.js rename to internal/relay/web-dist/assets/index-CKUfNIJP.js index 02c2b23d..1574c2ae 100644 --- a/internal/relay/web-dist/assets/index-DB-c3u2H.js +++ b/internal/relay/web-dist/assets/index-CKUfNIJP.js @@ -1 +1 @@ -import{L as r}from"./index-DRFRE0Ca.js";import{J as e,Q as O,g as s,L as X,z as l,v as Y,r as $,u as S,x as o,w as t}from"./FileExplorer-BumK3wPT.js";import"./useI18n-lwZlSdSx.js";import"./index-Ci2MtInW.js";import"./prefsSync-C5tz9Q-s.js";import"./client-DMh7GjbV.js";import"./Switch-DguIL3dU.js";import"./auth-B3RxKR1W.js";const Z=e({null:O.null,instanceof:O.operatorKeyword,this:O.self,"new super assert open to with void":O.keyword,"class interface extends implements enum var":O.definitionKeyword,"module package import":O.moduleKeyword,"switch while for if else case default do break continue return try catch finally throw":O.controlKeyword,"requires exports opens uses provides public private protected static transitive abstract final strictfp synchronized native transient volatile throws":O.modifier,IntegerLiteral:O.integer,FloatingPointLiteral:O.float,"StringLiteral TextBlock":O.string,CharacterLiteral:O.character,LineComment:O.lineComment,BlockComment:O.blockComment,BooleanLiteral:O.bool,PrimitiveType:O.standard(O.typeName),TypeName:O.typeName,Identifier:O.variableName,"MethodName/Identifier":O.function(O.variableName),Definition:O.definition(O.variableName),ArithOp:O.arithmeticOperator,LogicOp:O.logicOperator,BitOp:O.bitwiseOperator,CompareOp:O.compareOperator,AssignOp:O.definitionOperator,UpdateOp:O.updateOperator,Asterisk:O.punctuation,Label:O.labelName,"( )":O.paren,"[ ]":O.squareBracket,"{ }":O.brace,".":O.derefOperator,", ;":O.separator}),n={__proto__:null,true:34,false:34,null:42,void:46,byte:48,short:48,int:48,long:48,char:48,float:48,double:48,boolean:48,extends:62,super:64,class:76,this:78,new:84,public:100,protected:102,private:104,abstract:106,static:108,final:110,strictfp:112,default:114,synchronized:116,native:118,transient:120,volatile:122,throws:150,implements:160,interface:166,enum:176,instanceof:238,open:267,module:269,requires:274,transitive:276,exports:278,to:280,opens:282,uses:284,provides:286,with:288,package:292,import:296,if:308,else:310,while:314,for:318,var:325,assert:332,switch:336,case:342,do:346,break:350,continue:354,return:358,throw:364,try:368,catch:372,finally:380},d=r.deserialize({version:14,states:"##jQ]QPOOQ$wQPOOO(bQQO'#H^O*iQQO'#CbOOQO'#Cb'#CbO*pQPO'#CaO*xOSO'#CpOOQO'#Hc'#HcOOQO'#Cu'#CuO,eQPO'#D_O-OQQO'#HmOOQO'#Hm'#HmO/gQQO'#HhO/nQQO'#HhOOQO'#Hh'#HhOOQO'#Hg'#HgO1rQPO'#DUO2PQPO'#GnO4wQPO'#D_O5OQPO'#DzO*pQPO'#E[O5qQPO'#E[OOQO'#DV'#DVO7SQQO'#HaO9^QQO'#EeO9eQPO'#EdO9jQP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`-r-t-}.R.g.m/[/_/b/d/n0Z0f0kQ#f`Q&O#YQ'Y$YU)W%g'`'iQ)}&bQ*s'_Q,Q(tQ,j)oQ,k)pR.c,^Q)n%}R,i)m$SfO`copx!Y![!_!a#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Z$_$l$m$n$o$p$q%O%d%k%v&d'm(O(T(U)Q)R)])f*P*l*o+T+d+h+i+l+o+s,Y,`-r-t-}.R.g.m/[/_/b/d/n0Z0f0kT&p#t,ZQ&|#xQ(P$oQ-u+hQ/]-tR0P/_]!nP!o'^*q-^/O#PaOPX`bcx![!f!o!y#_#e#l$_$m$n$o$p$q%O%b%d&]&i'^'e'h'{(U)O)Q)R*W*q+O+d+l+s+x,Y-[-^.R/O/dU#WY!W'|Q%T!eU&k#n#s+fQ(o%VS,s*T*zT.s,u-aj#UY!W!e#n#s%V%w&W)y*T*z,u-aU&V#`&`(}Q)x&[Q+e'|Q+q(`Q-s+fQ.O+rQ/g.WR0U/hQ)i%vQ,g)fR/o.mR,h)f`!jP!o'^'h*q+O-^/OT%W!g*|R%]!hW%U!e%V*z-aQ(z%^R,V({S#d`%bR&a#eQ)X%gT*t'`'iR*y'e[!lP!o'^*q-^/OR%X!gR#h`R,b)]R)a%kT-j+]-kQ/V-mR/z/WR/z/X",nodeNames:"⚠ LineComment BlockComment Program ModuleDeclaration MarkerAnnotation Identifier ScopedIdentifier . Annotation ) ( AnnotationArgumentList AssignmentExpression FieldAccess IntegerLiteral FloatingPointLiteral BooleanLiteral CharacterLiteral StringLiteral TextBlock null ClassLiteral void PrimitiveType TypeName ScopedTypeName GenericType TypeArguments AnnotatedType Wildcard extends super , ArrayType ] Dimension [ class this ParenthesizedExpression ObjectCreationExpression new ArgumentList } { ClassBody ; FieldDeclaration Modifiers public protected private abstract static final strictfp default synchronized native transient volatile VariableDeclarator Definition AssignOp ArrayInitializer MethodDeclaration TypeParameters TypeParameter TypeBound FormalParameters ReceiverParameter FormalParameter SpreadParameter Throws throws Block ClassDeclaration Superclass SuperInterfaces implements InterfaceTypeList InterfaceDeclaration interface ExtendsInterfaces InterfaceBody ConstantDeclaration EnumDeclaration enum EnumBody EnumConstant EnumBodyDeclarations AnnotationTypeDeclaration AnnotationTypeBody AnnotationTypeElementDeclaration StaticInitializer ConstructorDeclaration ConstructorBody ExplicitConstructorInvocation ArrayAccess MethodInvocation MethodName MethodReference ArrayCreationExpression Dimension AssignOp BinaryExpression CompareOp CompareOp LogicOp LogicOp BitOp BitOp BitOp ArithOp ArithOp ArithOp BitOp InstanceofExpression instanceof LambdaExpression InferredParameters TernaryExpression LogicOp : UpdateExpression UpdateOp UnaryExpression LogicOp BitOp CastExpression ElementValueArrayInitializer ElementValuePair open module ModuleBody ModuleDirective requires transitive exports to opens uses provides with PackageDeclaration package ImportDeclaration import Asterisk ExpressionStatement LabeledStatement Label IfStatement if else WhileStatement while ForStatement for ForSpec LocalVariableDeclaration var EnhancedForStatement ForSpec AssertStatement assert SwitchStatement switch SwitchBlock SwitchLabel case DoStatement do BreakStatement break ContinueStatement continue ReturnStatement return SynchronizedStatement ThrowStatement throw TryStatement try CatchClause catch CatchFormalParameter CatchType FinallyClause finally TryWithResourcesStatement ResourceSpecification Resource ClassContent",maxTerm:276,nodeProps:[["isolate",-4,1,2,18,19,""],["group",-26,4,47,76,77,82,87,92,145,147,150,151,153,156,158,161,163,165,167,172,174,176,178,180,181,183,191,"Statement",-25,6,13,14,15,16,17,18,19,20,21,22,39,40,41,99,100,102,103,106,118,120,122,125,127,130,"Expression",-7,23,24,25,26,27,29,34,"Type"],["openedBy",10,"(",44,"{"],["closedBy",11,")",45,"}"]],propSources:[Z],skippedNodes:[0,1,2],repeatNodeCount:28,tokenData:"#'f_R!_OX%QXY'fYZ)bZ^'f^p%Qpq'fqr*|rs,^st%Qtu4euv5zvw7[wx8rxyAZyzAwz{Be{|CZ|}Dq}!OE_!O!PFx!P!Q! r!Q!R!,h!R![!0`![!]!>p!]!^!@Q!^!_!@n!_!`!BX!`!a!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s%qs;'S%Q;'S;=`&s<%lO%QV!N_VsR&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QU!N{X#eQ&YSOY%QYZ%lZr%Qrs%qs!_%Q!_!`6n!`;'S%Q;'S;=`&s<%lO%QV# oV}R&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%Q_#!_Z'OX#dQ&YSOY%QYZ%lZr%Qrs%qs!_%Q!_!`6n!`#p%Q#p#q##Q#q;'S%Q;'S;=`&s<%lO%QU##XV#bQ&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QV##uV|R&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QT#$cV#uP&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%Q_#%Ru&YS%yZ&PZOX%QXY'fYZ)bZ^'f^p%Qpq'fqr%Qrs%qst%Qtu4eu!Q%Q!Q![4e![!c%Q!c!}4e!}#R%Q#R#S4e#S#T%Q#T#o4e#o#y%Q#y#z'f#z$f%Q$f$g'f$g#BY4e#BY#BZ#$x#BZ$IS4e$IS$I_#$x$I_$I|4e$I|$JO#$x$JO$JT4e$JT$JU#$x$JU$KV4e$KV$KW#$x$KW&FU4e&FU&FV#$x&FV;'S4e;'S;=`5t<%lO4e",tokenizers:[0,1,2,3],topRules:{Program:[0,3],ClassContent:[1,194]},dynamicPrecedences:{27:1,232:-1,243:-1},specialized:[{term:231,get:Q=>n[Q]||-1}],tokenPrec:7144}),_=X.define({name:"java",parser:d.configure({props:[l.add({IfStatement:$({except:/^\s*({|else\b)/}),TryStatement:$({except:/^\s*({|catch|finally)\b/}),LabeledStatement:Y,SwitchBlock:Q=>{let P=Q.textAfter,i=/^\s*\}/.test(P),a=/^\s*(case|default)\b/.test(P);return Q.baseIndent+(i?0:a?1:2)*Q.unit},Block:S({closing:"}"}),BlockComment:()=>null,Statement:$({except:/^{/})}),o.add({"Block SwitchBlock ClassBody ElementValueArrayInitializer ModuleBody EnumBody ConstructorBody InterfaceBody ArrayInitializer":t,BlockComment(Q){return{from:Q.from+2,to:Q.to-2}}})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\})$/}});function c(){return new s(_)}export{c as java,_ as javaLanguage}; +import{L as r}from"./index-Bf0-KgBD.js";import{J as e,Q as O,g as s,L as X,z as l,v as Y,r as $,u as S,x as o,w as t}from"./FileExplorer-BmPzqkbb.js";import"./useI18n-D4u8zssu.js";import"./index-zrZBIArQ.js";import"./prefsSync-Dj3wNxrO.js";import"./client-n-fLEpOg.js";import"./Switch-BlSJOKEO.js";import"./auth-BBmiA1GG.js";const Z=e({null:O.null,instanceof:O.operatorKeyword,this:O.self,"new super assert open to with void":O.keyword,"class interface extends implements enum var":O.definitionKeyword,"module package import":O.moduleKeyword,"switch while for if else case default do break continue return try catch finally throw":O.controlKeyword,"requires exports opens uses provides public private protected static transitive abstract final strictfp synchronized native transient volatile throws":O.modifier,IntegerLiteral:O.integer,FloatingPointLiteral:O.float,"StringLiteral TextBlock":O.string,CharacterLiteral:O.character,LineComment:O.lineComment,BlockComment:O.blockComment,BooleanLiteral:O.bool,PrimitiveType:O.standard(O.typeName),TypeName:O.typeName,Identifier:O.variableName,"MethodName/Identifier":O.function(O.variableName),Definition:O.definition(O.variableName),ArithOp:O.arithmeticOperator,LogicOp:O.logicOperator,BitOp:O.bitwiseOperator,CompareOp:O.compareOperator,AssignOp:O.definitionOperator,UpdateOp:O.updateOperator,Asterisk:O.punctuation,Label:O.labelName,"( )":O.paren,"[ ]":O.squareBracket,"{ }":O.brace,".":O.derefOperator,", ;":O.separator}),n={__proto__:null,true:34,false:34,null:42,void:46,byte:48,short:48,int:48,long:48,char:48,float:48,double:48,boolean:48,extends:62,super:64,class:76,this:78,new:84,public:100,protected:102,private:104,abstract:106,static:108,final:110,strictfp:112,default:114,synchronized:116,native:118,transient:120,volatile:122,throws:150,implements:160,interface:166,enum:176,instanceof:238,open:267,module:269,requires:274,transitive:276,exports:278,to:280,opens:282,uses:284,provides:286,with:288,package:292,import:296,if:308,else:310,while:314,for:318,var:325,assert:332,switch:336,case:342,do:346,break:350,continue:354,return:358,throw:364,try:368,catch:372,finally:380},d=r.deserialize({version:14,states:"##jQ]QPOOQ$wQPOOO(bQQO'#H^O*iQQO'#CbOOQO'#Cb'#CbO*pQPO'#CaO*xOSO'#CpOOQO'#Hc'#HcOOQO'#Cu'#CuO,eQPO'#D_O-OQQO'#HmOOQO'#Hm'#HmO/gQQO'#HhO/nQQO'#HhOOQO'#Hh'#HhOOQO'#Hg'#HgO1rQPO'#DUO2PQPO'#GnO4wQPO'#D_O5OQPO'#DzO*pQPO'#E[O5qQPO'#E[OOQO'#DV'#DVO7SQQO'#HaO9^QQO'#EeO9eQPO'#EdO9jQPO'#EfOOQO'#Hb'#HbO7jQQO'#HbO:pQQO'#FhO:wQPO'#ExO:|QPO'#E}O:|QPO'#FPOOQO'#Ha'#HaOOQO'#HY'#HYOOQO'#Gh'#GhOOQO'#HX'#HXO<^QPO'#FiOOQO'#HW'#HWOOQO'#Gg'#GgQ]QPOOOOQO'#Hs'#HsOQQPO'#GSO>]QPO'#GUO=kQPO'#GWO:|QPO'#GXO>dQPO'#GZO?QQQO'#HiO?mQQO'#CuO?tQPO'#HxO@SQPO'#D_O@rQPO'#DpO?wQPO'#DqO@|QPO'#HxOA_QPO'#DpOAgQPO'#IROAlQPO'#E`OOQO'#Hr'#HrOOQO'#Gm'#GmQ$wQPOOOAtQPO'#HsOOQO'#H^'#H^OCsQQO,58{OOQO'#H['#H[OOOO'#Gi'#GiOEfOSO,59[OOQO,59[,59[OOQO'#Hi'#HiOFVQPO,59eOGXQPO,59yOOQO-E:f-E:fO*pQPO,58zOG{QPO,58zO*pQPO,5;}OHQQPO'#DQOHVQPO'#DQOOQO'#Gk'#GkOIVQQO,59jOOQO'#Dm'#DmOJqQPO'#HuOJ{QPO'#DlOKZQPO'#HtOKcQPO,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X%gT*t'`'iR*y'e[!lP!o'^*q-^/OR%X!gR#h`R,b)]R)a%kT-j+]-kQ/V-mR/z/WR/z/X",nodeNames:"⚠ LineComment BlockComment Program ModuleDeclaration MarkerAnnotation Identifier ScopedIdentifier . Annotation ) ( AnnotationArgumentList AssignmentExpression FieldAccess IntegerLiteral FloatingPointLiteral BooleanLiteral CharacterLiteral StringLiteral TextBlock null ClassLiteral void PrimitiveType TypeName ScopedTypeName GenericType TypeArguments AnnotatedType Wildcard extends super , ArrayType ] Dimension [ class this ParenthesizedExpression ObjectCreationExpression new ArgumentList } { ClassBody ; FieldDeclaration Modifiers public protected private abstract static final strictfp default synchronized native transient volatile VariableDeclarator Definition AssignOp ArrayInitializer MethodDeclaration TypeParameters TypeParameter TypeBound FormalParameters ReceiverParameter FormalParameter SpreadParameter Throws throws Block ClassDeclaration Superclass SuperInterfaces implements InterfaceTypeList InterfaceDeclaration interface ExtendsInterfaces InterfaceBody ConstantDeclaration EnumDeclaration enum EnumBody EnumConstant EnumBodyDeclarations AnnotationTypeDeclaration AnnotationTypeBody AnnotationTypeElementDeclaration StaticInitializer ConstructorDeclaration ConstructorBody ExplicitConstructorInvocation ArrayAccess MethodInvocation MethodName MethodReference ArrayCreationExpression Dimension AssignOp BinaryExpression CompareOp CompareOp LogicOp LogicOp BitOp BitOp BitOp ArithOp ArithOp ArithOp BitOp InstanceofExpression instanceof LambdaExpression InferredParameters TernaryExpression LogicOp : UpdateExpression UpdateOp UnaryExpression LogicOp BitOp CastExpression ElementValueArrayInitializer ElementValuePair open module ModuleBody ModuleDirective requires transitive exports to opens uses provides with PackageDeclaration package ImportDeclaration import Asterisk ExpressionStatement LabeledStatement Label IfStatement if else WhileStatement while ForStatement for ForSpec LocalVariableDeclaration var EnhancedForStatement ForSpec AssertStatement assert SwitchStatement switch SwitchBlock SwitchLabel case DoStatement do BreakStatement break ContinueStatement continue ReturnStatement return SynchronizedStatement ThrowStatement throw TryStatement try CatchClause catch CatchFormalParameter CatchType FinallyClause finally TryWithResourcesStatement ResourceSpecification Resource ClassContent",maxTerm:276,nodeProps:[["isolate",-4,1,2,18,19,""],["group",-26,4,47,76,77,82,87,92,145,147,150,151,153,156,158,161,163,165,167,172,174,176,178,180,181,183,191,"Statement",-25,6,13,14,15,16,17,18,19,20,21,22,39,40,41,99,100,102,103,106,118,120,122,125,127,130,"Expression",-7,23,24,25,26,27,29,34,"Type"],["openedBy",10,"(",44,"{"],["closedBy",11,")",45,"}"]],propSources:[Z],skippedNodes:[0,1,2],repeatNodeCount:28,tokenData:"#'f_R!_OX%QXY'fYZ)bZ^'f^p%Qpq'fqr*|rs,^st%Qtu4euv5zvw7[wx8rxyAZyzAwz{Be{|CZ|}Dq}!OE_!O!PFx!P!Q! r!Q!R!,h!R![!0`![!]!>p!]!^!@Q!^!_!@n!_!`!BX!`!a!B{!a!b!Di!b!c!EX!c!}!LT!}#O!Mj#O#P%Q#P#Q!NW#Q#R!Nt#R#S4e#S#T%Q#T#o4e#o#p# h#p#q#!U#q#r##n#r#s#$[#s#y%Q#y#z'f#z$f%Q$f$g'f$g#BY4e#BY#BZ#$x#BZ$IS4e$IS$I_#$x$I_$I|4e$I|$JO#$x$JO$JT4e$JT$JU#$x$JU$KV4e$KV$KW#$x$KW&FU4e&FU&FV#$x&FV;'S4e;'S;=`5t<%lO4eS%VV&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QS%qO&YSS%tVOY&ZYZ%lZr&Zrs&ys;'S&Z;'S;=`'`<%lO&ZS&^VOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QS&vP;=`<%l%QS&|UOY&ZYZ%lZr&Zs;'S&Z;'S;=`'`<%lO&ZS'cP;=`<%l&Z_'mk&YS%yZOX%QXY'fYZ)bZ^'f^p%Qpq'fqr%Qrs%qs#y%Q#y#z'f#z$f%Q$f$g'f$g#BY%Q#BY#BZ'f#BZ$IS%Q$IS$I_'f$I_$I|%Q$I|$JO'f$JO$JT%Q$JT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I|4e$I|$JO#$x$JO$JT4e$JT$JU#$x$JU$KV4e$KV$KW#$x$KW&FU4e&FU&FV#$x&FV;'S4e;'S;=`5t<%lO4e",tokenizers:[0,1,2,3],topRules:{Program:[0,3],ClassContent:[1,194]},dynamicPrecedences:{27:1,232:-1,243:-1},specialized:[{term:231,get:Q=>n[Q]||-1}],tokenPrec:7144}),_=X.define({name:"java",parser:d.configure({props:[l.add({IfStatement:$({except:/^\s*({|else\b)/}),TryStatement:$({except:/^\s*({|catch|finally)\b/}),LabeledStatement:Y,SwitchBlock:Q=>{let P=Q.textAfter,i=/^\s*\}/.test(P),a=/^\s*(case|default)\b/.test(P);return Q.baseIndent+(i?0:a?1:2)*Q.unit},Block:S({closing:"}"}),BlockComment:()=>null,Statement:$({except:/^{/})}),o.add({"Block SwitchBlock ClassBody ElementValueArrayInitializer ModuleBody EnumBody ConstructorBody InterfaceBody ArrayInitializer":t,BlockComment(Q){return{from:Q.from+2,to:Q.to-2}}})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\})$/}});function c(){return new s(_)}export{c as java,_ as javaLanguage}; diff --git a/internal/relay/web-dist/assets/index-CR9U8Dqy.css b/internal/relay/web-dist/assets/index-CR9U8Dqy.css new file mode 100644 index 00000000..58582de3 --- /dev/null +++ b/internal/relay/web-dist/assets/index-CR9U8Dqy.css @@ -0,0 +1,32 @@ +.tabbar.drop-active[data-v-e57c51b9]{box-shadow:inset 0 -2px 0 var(--accent);background:color-mix(in srgb,var(--accent) 8%,transparent)}.tabbar[data-v-e57c51b9]{position:sticky;top:0;z-index:12;display:flex;align-items:stretch;background:var(--panel);flex:0 0 auto;height:28px;overflow:hidden}.tabs[data-v-e57c51b9]{display:flex;flex:1 1 auto;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}.tabs[data-v-e57c51b9]::-webkit-scrollbar{display:none}.tab[data-v-e57c51b9]{display:flex;align-items:center;gap:6px;padding:0 8px 0 12px;border-right:1px solid var(--border);font-size:12px;color:var(--fg-dim);cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap;min-width:110px;max-width:220px;transition:background .12s;touch-action:pan-y}.tab.dragging[data-v-e57c51b9]{opacity:.5}.tab[data-v-e57c51b9]:hover{background:#ffffff0a}.tab.active[data-v-e57c51b9]{background:var(--bg);color:var(--fg);box-shadow:inset 0 -2px 0 var(--accent)}.tab .num[data-v-e57c51b9]{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:var(--fg-dim)}.tab.active .num[data-v-e57c51b9]{color:var(--accent)}.tab .dot[data-v-e57c51b9]{font-size:9px;color:var(--good)}.tab .remote-dot[data-v-e57c51b9]{color:#d29922}.tab .remote-dot.disconnected[data-v-e57c51b9]{color:var(--fg-dim)}.tab.disconnected .title[data-v-e57c51b9]{color:var(--fg-dim);font-style:italic}.tab .layout-icon[data-v-e57c51b9]{font-size:11px;color:var(--fg-dim);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:-1px}.tab .title[data-v-e57c51b9]{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis}.tab .close[data-v-e57c51b9]{border:none;background:transparent;padding:0 4px;font-size:14px;line-height:1;color:var(--fg-dim);border-radius:4px;opacity:0;transition:opacity .12s,background .12s,color .12s}.tab:hover .close[data-v-e57c51b9],.tab.active .close[data-v-e57c51b9]{opacity:1}.tab .close[data-v-e57c51b9]:hover{background:#f851492e;color:var(--bad)}.profile-picker[data-v-e57c51b9]{max-width:120px;height:100%;border:none;border-left:1px solid var(--border);background:transparent;color:var(--fg-dim);font-size:11px;padding:0 6px;cursor:pointer}.profile-picker[data-v-e57c51b9]:hover{color:var(--fg)}.plus[data-v-e57c51b9]{border:none;background:transparent;color:var(--fg-dim);font-size:18px;line-height:1;padding:0 14px;cursor:pointer;border-left:1px solid var(--border);transition:color .12s,background .12s}.plus[data-v-e57c51b9]:hover:not(:disabled){color:var(--accent);background:#58a6ff14}.plus[data-v-e57c51b9]:disabled{opacity:.4;cursor:not-allowed}.ssh-btn[data-v-e57c51b9]{display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--fg-dim);padding:0 10px;cursor:pointer;border-left:1px solid var(--border);transition:color .12s,background .12s}.ssh-btn[data-v-e57c51b9]:hover{color:var(--accent);background:#58a6ff14}.ssh-btn svg[data-v-e57c51b9]{display:block}.settings-btn[data-v-e57c51b9]{position:relative;display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--fg-dim);padding:0 10px;cursor:pointer;border-left:1px solid var(--border);transition:color .12s,background .12s}.settings-btn[data-v-e57c51b9]:hover{color:var(--accent);background:#58a6ff14}.settings-btn svg[data-v-e57c51b9]{display:block}.settings-btn .dot[data-v-e57c51b9]{position:absolute;top:4px;right:4px;width:6px;height:6px;background:#d29922;border-radius:50%}.admin-btn[data-v-e57c51b9]{position:relative;display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--fg-dim);padding:0 10px;cursor:pointer;border-left:1px solid var(--border);transition:color .12s,background .12s}.admin-btn[data-v-e57c51b9]:hover,.admin-btn.active[data-v-e57c51b9]{color:var(--accent);background:#58a6ff14}.tab.unread[data-v-e57c51b9]{background:color-mix(in srgb,var(--unread-c) 10%,transparent)}.tab.unread .title[data-v-e57c51b9]{font-weight:600;color:#fff}.tab.unread[data-v-e57c51b9]:not(.active){box-shadow:inset 0 -2px 0 var(--unread-c)}@media (max-width: 767px){.tabbar[data-v-e57c51b9]{height:36px}.tab[data-v-e57c51b9]{min-width:86px;max-width:150px;padding:0 6px 0 10px;gap:4px}.tab .num[data-v-e57c51b9]{display:none}.tab .close[data-v-e57c51b9]{opacity:1;padding:0 2px}.settings-btn[data-v-e57c51b9],.admin-btn[data-v-e57c51b9]{min-width:40px;padding:0 12px}}.window-controls[data-v-1ccfd0fb]{display:inline-flex;align-items:stretch;height:100%;margin-left:8px}.wc-btn[data-v-1ccfd0fb]{display:inline-flex;align-items:center;justify-content:center;width:36px;border:none;background:transparent;color:var(--fg-dim);cursor:pointer;transition:background .12s,color .12s}.wc-btn[data-v-1ccfd0fb]:hover{background:#ffffff14;color:var(--fg)}.wc-close[data-v-1ccfd0fb]:hover{background:#e81123;color:#fff}.conn-health-pill[data-v-5daa187a]{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;height:20px;border-radius:999px;border:1px solid var(--border, #ccc);background:transparent;color:inherit;font-size:11px;font-variant-numeric:tabular-nums;cursor:pointer;line-height:1;white-space:nowrap}.conn-health-pill .dot[data-v-5daa187a]{font-size:8px;line-height:1}.band-green[data-v-5daa187a]{color:var(--good, #16a34a);border-color:color-mix(in srgb,var(--good, #16a34a) 35%,transparent)}.band-yellow[data-v-5daa187a]{color:var(--warn, #d97706);border-color:color-mix(in srgb,var(--warn, #d97706) 35%,transparent)}.band-red[data-v-5daa187a]{color:var(--bad, #dc2626);border-color:color-mix(in srgb,var(--bad, #dc2626) 35%,transparent)}.band-off[data-v-5daa187a]{color:var(--fg-dim, #888)}.band-reconnecting[data-v-5daa187a]{color:var(--warn, #d97706);animation:conn-health-pulse-5daa187a 1s ease-in-out infinite}@keyframes conn-health-pulse-5daa187a{0%,to{opacity:1}50%{opacity:.35}}@media (prefers-reduced-motion: reduce){.band-reconnecting[data-v-5daa187a]{animation:none}}.drawer[data-v-c8bb9e85]{position:fixed;top:36px;right:8px;z-index:1100;width:280px;background:var(--bg, #fff);color:var(--fg, #111);border:1px solid var(--border, #ddd);border-radius:8px;box-shadow:0 8px 24px #0000001f;padding:10px 12px;font-size:12px;display:flex;flex-direction:column;gap:8px}.head[data-v-c8bb9e85]{display:flex;align-items:center;justify-content:space-between;font-weight:600}.close[data-v-c8bb9e85]{background:transparent;border:0;cursor:pointer;font-size:16px;line-height:1;color:inherit}.row[data-v-c8bb9e85]{display:flex;justify-content:space-between;padding:2px 0}.metric-label[data-v-c8bb9e85]{color:var(--fg-dim, #666)}.metric-value[data-v-c8bb9e85]{font-variant-numeric:tabular-nums}.spark[data-v-c8bb9e85]{color:var(--good, #16a34a);display:block}.reconn-table[data-v-c8bb9e85]{width:100%;border-collapse:collapse;font-size:11px}.reconn-table th[data-v-c8bb9e85],.reconn-table td[data-v-c8bb9e85]{text-align:left;padding:2px 4px;border-top:1px solid var(--border, #eee)}.gaps[data-v-c8bb9e85]{color:var(--warn, #d97706)}.titlebar[data-v-2cf685eb]{position:relative;display:flex;align-items:center;gap:12px;padding:6px 14px;background:var(--panel);border-bottom:1px solid var(--border);flex:0 0 auto;--wails-draggable: drag}.window-title[data-v-2cf685eb]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);max-width:50%;font-size:12px;color:var(--fg);font-weight:500;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 8px}.status[data-v-2cf685eb]{font-size:12px;color:var(--fg-dim);--wails-draggable: no-drag;flex:0 0 auto;margin-left:auto}.status .bad[data-v-2cf685eb]{color:var(--bad)}.status .dim[data-v-2cf685eb]{color:var(--good)}.e2ee-off-chip[data-v-2cf685eb]{--wails-draggable: no-drag;flex:0 0 auto;display:inline-flex;align-items:center;gap:4px;margin-left:8px;padding:2px 8px;font-size:11px;font-weight:600;line-height:1.4;color:#1f1300;background:#f4b740;border-radius:999px;letter-spacing:.02em;white-space:nowrap}.e2ee-off-chip .chip-icon[data-v-2cf685eb]{font-size:12px;line-height:1}.titlebar[data-v-2cf685eb]:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:3px;background:repeating-linear-gradient(90deg,transparent 0px,transparent 200px,rgba(74,222,128,.3) 320px,#4ade80 500px,#bbf7d0 560px,#4ade80 620px,rgba(74,222,128,.3) 800px,transparent 920px,transparent 1120px);background-size:1120px 100%;background-position:var(--sweep-offset, 0px) 0;box-shadow:0 -1px 6px #4ade8066;opacity:0;transition:opacity .25s ease;pointer-events:none}.titlebar.is-running[data-v-2cf685eb]:after{opacity:1}@media (prefers-reduced-motion: reduce){.titlebar[data-v-2cf685eb]:after{background:#4ade80}}.last-output[data-v-ea632618]{display:inline-flex;align-items:center;gap:3px;flex:none;color:var(--fg-dim, #6e7681);white-space:nowrap;font-family:var(--font-mono, ui-monospace, monospace);font-size:9px;line-height:1;font-variant-numeric:tabular-nums}.last-output-clock[data-v-ea632618]{width:10px;height:10px;flex:none}.last-output.live[data-v-ea632618]{color:var(--accent, #58a6ff)}.row-main[data-v-81d1a3d4]{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:1px}.row-top[data-v-81d1a3d4]{display:flex;align-items:center;gap:6px;min-width:0}.state-label[data-v-81d1a3d4]{font-size:11px;opacity:.85;white-space:nowrap;flex-shrink:0}.cmd-and-cwd[data-v-81d1a3d4]{flex:1 1 auto;min-width:0;display:flex;gap:6px;overflow:hidden;align-items:baseline}.cmd[data-v-81d1a3d4]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-family:var(--font-mono);flex:1 1 auto;min-width:0}.row-meta[data-v-81d1a3d4]{display:flex;align-items:center;gap:6px;min-width:0;padding-left:18px}.cwd[data-v-81d1a3d4]{color:var(--fg-dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--font-mono);font-size:.85em;flex:1 1 auto;min-width:0}.row-tail[data-v-81d1a3d4]{flex:0 0 auto;min-width:46px;align-self:stretch;display:flex;flex-direction:column;align-items:flex-end;justify-content:space-between;gap:3px}.row-tail.time-only[data-v-81d1a3d4]{justify-content:flex-end}.row-tail[data-v-81d1a3d4] .last-output{opacity:.65}.kind[data-v-81d1a3d4]{font-size:8.5px;line-height:1.4;padding:1px 4px;border-radius:3px;border:1px solid var(--border);color:var(--fg-dim);white-space:nowrap;transition:opacity .1s}.row-close[data-v-81d1a3d4]{position:absolute;top:4px;right:6px;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:13px;line-height:1;cursor:pointer;color:var(--fg-dim);border-radius:4px}.row-close[data-v-81d1a3d4]:hover{background:#f851492e;color:var(--bad)}.session-row-menu[data-v-f6b9c7cb]{position:fixed;z-index:1000;min-width:140px;padding:4px;background:var(--menu-bg, #1f1f22);border:1px solid rgba(255,255,255,.12);border-radius:6px;box-shadow:0 8px 24px #0006}.menu-item[data-v-f6b9c7cb]{display:block;width:100%;padding:6px 10px;background:transparent;border:none;color:inherit;text-align:left;cursor:pointer;border-radius:4px;font-size:13px}.menu-item[data-v-f6b9c7cb]:hover:not(.disabled),.menu-item[data-v-f6b9c7cb]:focus:not(.disabled){background:#ffffff14;outline:none}.menu-item.disabled[data-v-f6b9c7cb]{opacity:.4;cursor:not-allowed}.menu-separator[data-v-f6b9c7cb]{height:1px;margin:4px 6px;background:#ffffff1f}.session-details-popover[data-v-9528360b]{position:fixed;z-index:1000;min-width:260px;max-width:420px;width:min(420px,calc(100vw - 16px));box-sizing:border-box;padding:8px 10px 10px;background:var(--menu-bg, #1f1f22);border:1px solid rgba(255,255,255,.14);border-radius:8px;box-shadow:0 12px 32px #00000073;font-size:12px}.popover-title[data-v-9528360b]{font-weight:600;padding-bottom:6px;border-bottom:1px solid rgba(255,255,255,.08);margin-bottom:6px}.rows[data-v-9528360b]{display:flex;flex-direction:column;gap:3px;max-height:380px;overflow-x:auto;overflow-y:auto;-webkit-overflow-scrolling:touch}.row[data-v-9528360b]{display:grid;grid-template-columns:96px 1fr auto;gap:8px;align-items:baseline;min-width:max-content}.label[data-v-9528360b]{color:var(--fg-dim);white-space:nowrap}.value[data-v-9528360b]{overflow:visible;text-overflow:clip;white-space:nowrap;font-family:var(--font-mono);min-width:0}.copy[data-v-9528360b]{border:none;background:transparent;color:var(--fg-dim);cursor:pointer;padding:0 3px;font-size:12px;border-radius:3px}.copy[data-v-9528360b]:hover{color:var(--fg);background:#ffffff14}.task-grouped-list[data-v-42b39ad3]{display:flex;flex-direction:column;gap:8px;font-size:12px}.host-header[data-v-42b39ad3]{display:flex;align-items:center;gap:6px;font-weight:500;padding:4px 6px;cursor:pointer;-webkit-user-select:none;user-select:none}.host-header[data-v-42b39ad3]:hover{background:#ffffff0a;border-radius:4px}.host-header .caret[data-v-42b39ad3]{font-size:9px;opacity:.7;width:9px;display:inline-block}.host-name[data-v-42b39ad3]{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.counts[data-v-42b39ad3]{margin-left:auto;display:inline-flex;gap:2px;align-items:center;flex-shrink:0}.unread-badge[data-v-42b39ad3]{font-size:10px;opacity:.8;background:#ffffff0f;border-radius:3px;padding:1px 4px;white-space:nowrap;flex-shrink:0}.local-chip[data-v-42b39ad3]{font-size:10px;color:var(--accent);border:1px solid color-mix(in srgb,var(--accent) 40%,transparent);border-radius:3px;padding:0 4px;line-height:1.3;white-space:nowrap;flex-shrink:0}.mark-all[data-v-42b39ad3]{background:none;border:none;cursor:pointer;padding:0 4px;color:inherit}.host-group[data-v-42b39ad3]{display:flex;flex-direction:column;gap:4px}.group-header[data-v-42b39ad3]{display:flex;align-items:center;gap:6px;font-weight:500;padding:4px 6px;cursor:pointer;-webkit-user-select:none;user-select:none}.group-header[data-v-42b39ad3]:hover{background:#ffffff0a;border-radius:4px}.group-header .caret[data-v-42b39ad3]{font-size:9px;opacity:.7;width:9px;display:inline-block}.pinned-group .pin-icon[data-v-42b39ad3]{font-size:11px}.group-title[data-v-42b39ad3]{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.group-count[data-v-42b39ad3]{margin-left:auto;font-size:10px;opacity:.8;background:#ffffff0f;border-radius:3px;padding:1px 4px}.task-row[data-v-42b39ad3]{display:flex;flex-direction:row;align-items:stretch;gap:6px;padding:5px 8px;border:1px solid rgba(255,255,255,.08);background:#ffffff05;width:100%;text-align:left;cursor:pointer;color:inherit;border-radius:6px;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:pan-y;position:relative}.task-row[data-v-42b39ad3] .row-close{opacity:0;transition:opacity .1s}.task-row[data-v-42b39ad3]:hover .row-close,.task-row[data-v-42b39ad3]:focus-within .row-close{opacity:1}.task-row[data-v-42b39ad3]:hover .kind,.task-row[data-v-42b39ad3]:focus-within .kind{opacity:0}@media (hover: none){.task-row[data-v-42b39ad3] .row-close{position:static;align-self:flex-start;opacity:1}.task-row[data-v-42b39ad3] .kind{opacity:1}}.task-row[data-v-42b39ad3]:hover{background:#ffffff0f;border-color:#ffffff29}.task-row.active[data-v-42b39ad3]{background:color-mix(in srgb,var(--accent) 10%,transparent);border-color:color-mix(in srgb,var(--accent) 28%,var(--border));box-shadow:inset 2px 0 0 var(--accent)}.task-row.active[data-v-42b39ad3]:hover{background:color-mix(in srgb,var(--accent) 14%,transparent)}.task-row.selected[data-v-42b39ad3]{outline:2px solid var(--accent);outline-offset:-2px}.task-row.unread[data-v-42b39ad3]{background:color-mix(in srgb,var(--unread-c) 7%,transparent);border-color:color-mix(in srgb,var(--unread-c) 24%,var(--border));box-shadow:inset 2px 0 0 var(--unread-c)}.task-row.unread[data-v-42b39ad3]:hover{background:color-mix(in srgb,var(--unread-c) 12%,transparent)}.task-row.unread[data-v-42b39ad3] .cmd{font-weight:600;color:#fff}.task-row.active.unread[data-v-42b39ad3]{background:color-mix(in srgb,var(--unread-c) 14%,transparent);border-color:color-mix(in srgb,var(--accent) 28%,var(--border));box-shadow:inset 2px 0 0 var(--unread-c)}.task-row.dim[data-v-42b39ad3]{opacity:.6}.task-row.dim.active[data-v-42b39ad3]{opacity:.9}.task-row.dim.unread[data-v-42b39ad3]{opacity:1}.row-main[data-v-42b39ad3]{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:1px}.row-top[data-v-42b39ad3]{display:flex;align-items:center;gap:6px;min-width:0}.state-label[data-v-42b39ad3]{font-size:11px;opacity:.85;white-space:nowrap;flex-shrink:0}.cmd-and-cwd[data-v-42b39ad3]{flex:1 1 auto;min-width:0;display:flex;gap:6px;overflow:hidden;align-items:baseline}.cmd[data-v-42b39ad3]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-family:var(--font-mono);flex:1 1 auto;min-width:0}.row-meta[data-v-42b39ad3]{display:flex;align-items:center;gap:6px;min-width:0;padding-left:18px}.cwd[data-v-42b39ad3]{color:var(--fg-dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--font-mono);font-size:.85em;flex:1 1 auto;min-width:0}.row-tail[data-v-42b39ad3]{flex:0 0 auto;min-width:46px;align-self:stretch;display:flex;flex-direction:column;align-items:flex-end;justify-content:space-between;gap:3px}.row-tail.time-only[data-v-42b39ad3]{justify-content:flex-end}.row-tail[data-v-42b39ad3] .last-output{opacity:.65}.kind[data-v-42b39ad3]{font-size:8.5px;line-height:1.4;padding:1px 4px;border-radius:3px;border:1px solid var(--border);color:var(--fg-dim);white-space:nowrap;transition:opacity .1s}.completed-row-close[data-v-42b39ad3]{position:absolute;top:5px;right:8px;border:none;background:transparent;color:var(--fg-dim);border-radius:4px;cursor:pointer;font-size:13px;line-height:1;padding:1px 4px}.completed-row-close[data-v-42b39ad3]:hover{background:#f851492e;color:var(--bad)}.completed-fold[data-v-42b39ad3]{border-top:1px solid rgba(255,255,255,.06);margin-top:6px;padding-top:4px;display:flex;flex-direction:column;gap:4px}.fold-toggle[data-v-42b39ad3]{background:none;border:none;cursor:pointer;padding:4px 6px;width:100%;text-align:left;color:inherit;opacity:.7}.fold-mark-all[data-v-42b39ad3]{background:none;border:1px solid rgba(255,255,255,.12);cursor:pointer;padding:4px 8px;margin:4px 6px;color:inherit;border-radius:3px}.empty-hint[data-v-42b39ad3]{padding:24px 12px;text-align:center;color:var(--fg);opacity:.55;font-size:12px}.bulk-bar[data-v-c912fe83]{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:6px 4px}.counter[data-v-c912fe83]{font-size:11px;color:var(--fg-dim);margin-right:4px;white-space:nowrap}.btn[data-v-c912fe83]{background:none;border:1px solid rgba(255,255,255,.14);color:inherit;cursor:pointer;padding:3px 8px;font-size:11px;border-radius:3px;line-height:1.4}.btn[data-v-c912fe83]:hover:not(:disabled){background:#ffffff0f}.btn[data-v-c912fe83]:disabled{opacity:.4;cursor:not-allowed}.btn.primary[data-v-c912fe83]{border-color:color-mix(in srgb,var(--accent) 40%,var(--border));color:var(--accent)}.btn.primary[data-v-c912fe83]:hover:not(:disabled){background:color-mix(in srgb,var(--accent) 12%,transparent)}.btn.ghost[data-v-c912fe83]{border-color:transparent;opacity:.75}.task-sidebar-shell[data-v-0741527d]{display:contents}.task-sidebar[data-v-0741527d]{position:relative;background:var(--panel);border-right:1px solid var(--border);color:var(--fg);display:flex;flex-direction:column;height:100%}.task-sidebar.collapsed[data-v-0741527d]{width:32px}.sidebar-hamburger[data-v-0741527d]{position:fixed;top:34px;left:8px;z-index:20;padding:4px 8px;background:var(--panel);border:1px solid var(--border);color:inherit;border-radius:4px;cursor:pointer;font-size:12px;line-height:1}.task-sidebar.drawer[data-v-0741527d]{position:fixed;top:0;bottom:0;left:0;z-index:15;transform:translate(-100%);transition:transform .2s ease;box-shadow:2px 0 8px #0000004d}.task-sidebar.drawer.open[data-v-0741527d]{transform:translate(0)}.expanded[data-v-0741527d]{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}.resize-handle[data-v-0741527d]{position:absolute;top:0;right:-2px;width:4px;height:100%;cursor:ew-resize;-webkit-user-select:none;user-select:none;z-index:1}.resize-handle[data-v-0741527d]:hover{background:#ffffff0f}.sidebar-header[data-v-0741527d]{display:flex;align-items:center;padding:8px 10px;border-bottom:1px solid var(--border)}.title[data-v-0741527d]{flex:1 1 auto;min-width:0;font-weight:500;margin-right:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.search-icon-btn[data-v-0741527d]{background:none;border:none;color:inherit;cursor:pointer;padding:2px 4px;margin-right:6px;opacity:.7;display:inline-flex;align-items:center;justify-content:center;border-radius:3px}.search-icon-btn[data-v-0741527d]:hover{opacity:1;background:#ffffff0d}.collapse-button[data-v-0741527d],.expand-button[data-v-0741527d]{background:none;border:none;cursor:pointer;color:inherit;font-size:14px}.group-toggle[data-v-0741527d]{background:none;border:1px solid var(--border);color:inherit;cursor:pointer;border-radius:3px;font-size:11px;padding:1px 6px;margin-right:6px;opacity:.8}.group-toggle[data-v-0741527d]:hover{opacity:1;background:#ffffff0d}.sidebar-search[data-v-0741527d]{flex:1 1 auto;min-width:60px;background:#ffffff08;border:1px solid transparent;color:inherit;border-radius:3px;padding:1px 6px;font-size:12px;font-family:inherit;line-height:20px;margin-right:6px;outline:none}.sidebar-search[data-v-0741527d]:focus{border-color:var(--border);background:#ffffff0d}.sidebar-search[data-v-0741527d]::placeholder{opacity:.5}.list-wrap[data-v-0741527d]{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;padding:4px;scrollbar-width:none}.list-wrap[data-v-0741527d]::-webkit-scrollbar{display:none}footer[data-v-0741527d]{padding:8px;border-top:1px solid var(--border)}.mark-all[data-v-0741527d]{background:none;border:1px solid var(--border);cursor:pointer;padding:6px 10px;color:inherit;border-radius:3px;width:100%}.rail[data-v-0741527d]{display:flex;flex-direction:column;align-items:center;padding:6px 0;gap:4px}.rail-badge[data-v-0741527d]{font-size:10px;background:#ef4444;color:#fff;border-radius:8px;padding:1px 5px}.rail-icon[data-v-0741527d]{cursor:pointer;padding:2px}@media (max-width: 767px){.sidebar-hamburger[data-v-0741527d]{top:calc(env(safe-area-inset-top) + 42px);left:calc(env(safe-area-inset-left) + 8px);min-height:32px}.task-sidebar.drawer[data-v-0741527d]{top:env(safe-area-inset-top);bottom:env(safe-area-inset-bottom);max-width:min(86vw,360px)}}.select-dropdown[data-v-65a81c06]{position:relative;width:100%}.trigger[data-v-65a81c06]{-moz-appearance:none;appearance:none;-webkit-appearance:none;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;height:32px;padding:6px 10px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;font-size:13px;font-family:inherit;line-height:1.3;cursor:pointer;text-align:left}.trigger[data-v-65a81c06]:after{content:"▾";color:var(--fg-dim);font-size:11px;transition:transform .15s ease;flex-shrink:0}.trigger[data-v-65a81c06]:hover:not(:disabled):after{color:var(--fg)}.trigger[data-v-65a81c06]:hover:not(:disabled){border-color:var(--fg-dim)}.trigger[data-v-65a81c06]:focus-visible{outline:none;box-shadow:0 0 0 2px var(--accent)}.trigger[data-v-65a81c06]:disabled{cursor:not-allowed;opacity:.6}.trigger-label[data-v-65a81c06]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.trigger-open[data-v-65a81c06]:after{transform:rotate(180deg)}.menu[data-v-65a81c06]{position:absolute;top:calc(100% + 4px);left:0;right:0;max-height:240px;overflow-y:auto;margin:0;padding:4px 0;list-style:none;background:var(--bg);border:1px solid var(--border);border-radius:6px;box-shadow:0 6px 16px #00000059;z-index:1000}.option[data-v-65a81c06]{position:relative;display:flex;flex-direction:column;gap:2px;padding:8px 10px;cursor:pointer}.option-label[data-v-65a81c06]{color:var(--fg);font-size:13px;line-height:1.3}.option-description[data-v-65a81c06]{color:var(--fg-dim);font-size:12px;line-height:1.3}.option-highlight[data-v-65a81c06]{background:#ffffff0f}.option-selected[data-v-65a81c06]:before{content:"";position:absolute;top:4px;bottom:4px;left:0;width:2px;background:var(--accent);border-radius:2px}.option-selected .option-label[data-v-65a81c06]{color:var(--fg);font-weight:500}.sp-switcher[data-v-c9d59669]{position:relative;display:inline-flex;align-items:center;gap:6px;pointer-events:auto}.sp-seg[data-v-c9d59669]{display:inline-flex;align-items:center;gap:2px;background:var(--terminal-overlay, rgba(13, 17, 23, .92));border:1px solid var(--border);border-radius:8px;padding:2px}.sp-seg button[data-v-c9d59669]{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;flex:0 0 auto;border:0;border-radius:5px;padding:4px 8px;color:var(--fg-dim);background:transparent;font:12px var(--font-mono);cursor:pointer}.sp-seg button[data-v-c9d59669]:hover{color:var(--fg);background:#ffffff0f}.sp-seg button.active[data-v-c9d59669]{color:var(--fg);background:#ffffff1a}.sp-seg button.reconnecting[data-v-c9d59669]{color:var(--warning, #d29922)}.sp-caret[data-v-c9d59669]{color:var(--fg-dim);font-size:10px}.sp-dot[data-v-c9d59669]{width:6px;height:6px;border-radius:50%;background:var(--good, #3fb950);flex:0 0 auto}.sp-dot.reconnecting[data-v-c9d59669]{background:var(--warning, #d29922);animation:sp-pulse-c9d59669 1s infinite}@keyframes sp-pulse-c9d59669{50%{opacity:.3}}.sp-actions[data-v-c9d59669]{display:inline-flex;align-items:center;gap:2px;background:var(--terminal-overlay, rgba(13, 17, 23, .92));border:1px solid var(--border);border-radius:8px;padding:2px}.sp-actions button[data-v-c9d59669]{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:5px;color:var(--fg-dim);background:transparent;cursor:pointer}.sp-actions button[data-v-c9d59669]:hover{color:var(--fg);background:#ffffff0f}.sp-actions button.close[data-v-c9d59669]:hover{color:var(--bad);background:#f851491f}.sp-ico[data-v-c9d59669]{display:inline-flex;align-items:center;justify-content:center}.sp-actions svg[data-v-c9d59669]{width:13px;height:13px;display:block}.sp-menu[data-v-c9d59669]{position:absolute;top:32px;left:0;z-index:20;min-width:210px;background:var(--terminal-overlay, rgba(13, 17, 23, .98));border:1px solid var(--border);border-radius:8px;padding:4px;box-shadow:0 12px 30px #00000073}.sp-item[data-v-c9d59669]{display:flex;align-items:center;gap:8px;width:100%;padding:6px 8px;border:0;border-radius:6px;background:transparent;color:var(--fg-dim);font:12px var(--font-mono);cursor:pointer;white-space:nowrap;text-align:left}.sp-item[data-v-c9d59669]:hover{color:var(--fg);background:#ffffff0f}.sp-item.active[data-v-c9d59669]{color:var(--fg);background:#ffffff1a}.sp-lbl[data-v-c9d59669]{flex:1}.sp-mini[data-v-c9d59669]{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border-radius:5px;color:var(--fg-dim);flex:0 0 auto}.sp-mini[data-v-c9d59669]:hover{color:var(--fg);background:#ffffff1a}.sp-mini svg[data-v-c9d59669]{width:13px;height:13px;display:block}.sp-x[data-v-c9d59669]{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border-radius:5px;color:var(--fg-dim);flex:0 0 auto}.sp-x[data-v-c9d59669]:hover{color:var(--bad);background:#f851491f}.sp-sep[data-v-c9d59669]{height:1px;background:var(--border);margin:4px 2px}.sp-add[data-v-c9d59669]{color:var(--good, #3fb950)}.popover[data-v-063a4cb7]{position:fixed;transform:translate(-50%);background:#2b2c30;color:#fff;border-radius:8px;display:flex;box-shadow:0 6px 20px #0006;font-family:-apple-system,system-ui,sans-serif;z-index:1000}.popover[data-v-063a4cb7]:after{content:"";position:absolute;left:50%;transform:translate(-50%);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent}.popover.arrow-down[data-v-063a4cb7]:after{bottom:-5px;border-top:5px solid #2b2c30}.popover.arrow-up[data-v-063a4cb7]:after{top:-5px;border-bottom:5px solid #2b2c30}.btn[data-v-063a4cb7]{position:relative;background:none;border:none;color:#fff;padding:4px 11px;font-size:11px;font-family:inherit;cursor:pointer;border-right:1px solid #3f4046}.btn[data-v-063a4cb7]:last-child{border-right:none}.btn.send[data-v-063a4cb7]{color:#60a5fa;font-weight:600}.btn.cancel[data-v-063a4cb7]{font-size:14px;line-height:1;padding:4px 8px}.btn[data-v-063a4cb7]:disabled{opacity:.5;cursor:not-allowed}.btn[data-v-063a4cb7]:before{content:"";position:absolute;top:-8px;bottom:-8px;left:0;right:0}.term-search[data-v-302a13f7]{position:absolute;top:8px;left:12px;z-index:6;display:flex;align-items:center;gap:4px;padding:4px 6px;border:1px solid var(--border);border-radius:6px;background:var(--panel);box-shadow:0 4px 12px #00000059}.term-search-input[data-v-302a13f7]{width:180px;padding:2px 6px;border:1px solid var(--border);border-radius:4px;background:var(--bg);color:var(--fg);font-size:12px;outline:none}.term-search-input[data-v-302a13f7]:focus{border-color:var(--accent)}.term-search-count[data-v-302a13f7]{min-width:52px;color:var(--fg-dim);font-size:11px;text-align:center;white-space:nowrap}.term-search-btn[data-v-302a13f7]{padding:1px 6px;border:1px solid var(--border);border-radius:4px;background:#21262d;color:var(--fg);font-size:11px;line-height:16px;cursor:pointer}.term-search-btn[data-v-302a13f7]:hover:not(:disabled){background:var(--border)}.term-search-btn[data-v-302a13f7]:disabled{opacity:.4;cursor:default}.term-view[data-v-3334b195]{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--terminal-bg);overflow:hidden}.term[data-v-3334b195]{position:absolute;left:0;right:0;top:0;bottom:30px}.service-preview-frame[data-v-3334b195]{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;border:0;background:#fff}.service-preview-reconnecting[data-v-3334b195]{position:absolute;top:0;right:0;bottom:0;left:0;z-index:9;display:flex;gap:10px;align-items:center;justify-content:center;color:var(--fg);background:var(--terminal-overlay, rgba(13, 17, 23, .9));font:13px var(--font-mono)}.service-preview-reconnecting-spinner[data-v-3334b195]{width:14px;height:14px;border:2px solid rgba(255,255,255,.25);border-top-color:var(--fg);border-radius:50%;animation:service-preview-spin-3334b195 .8s linear infinite}@keyframes service-preview-spin-3334b195{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.service-preview-reconnecting-spinner[data-v-3334b195]{animation:none}}.service-preview-controls{position:relative;display:flex;align-items:center;gap:6px;padding:0;pointer-events:auto}.service-preview-port-form{position:absolute;top:34px;right:0;z-index:8;width:330px;padding:8px;display:flex;flex-direction:column;align-items:stretch;gap:6px;border:1px solid var(--border);border-radius:8px;background:var(--terminal-overlay);box-shadow:0 8px 24px #00000052}.service-preview-port-form button:not(.trigger){border:0;border-radius:5px;padding:4px 8px;color:var(--fg-dim);background:transparent;font:12px var(--font-mono);cursor:pointer}.service-preview-port-form button[type=submit]{color:var(--fg);background:#ffffff1a}.service-preview-port-form button:disabled{opacity:.55;cursor:default}.service-preview-host{width:100%}.service-preview-host .trigger{height:27px;padding:3px 7px;border-radius:5px;background:var(--bg);font:12px var(--font-mono)}.service-preview-host .menu{background:var(--terminal-overlay);font:12px var(--font-mono)}.service-preview-host .option{padding:6px 8px}.service-preview-mapping-row{display:grid;grid-template-columns:76px minmax(0,1fr) 24px;align-items:center;gap:5px}.service-preview-mapping-row input{width:auto;min-width:0}.service-preview-mapping-row input+input{width:auto}.service-preview-mapping-row.root-mapping{grid-template-columns:76px minmax(0,1fr)}.service-preview-path{color:var(--fg-dim);font:12px var(--font-mono)}.preview-add-mapping{white-space:nowrap}.service-preview-form-actions{display:flex;align-items:center;gap:4px}.service-preview-form-spacer{flex:1}.service-preview-port-form input{width:76px;border:1px solid var(--border);border-radius:5px;padding:3px 6px;color:var(--fg);background:var(--bg);font:12px var(--font-mono);outline:none}.service-preview-port-form input:focus{border-color:var(--accent)}.service-preview-port-form .service-preview-mapping-row input{width:100%}.template-bar[data-v-3334b195]{position:absolute;left:0;right:0;bottom:0;height:30px;display:flex;align-items:center;gap:6px;overflow-x:auto;padding:2px 8px;border-top:1px solid var(--border);background:var(--panel);z-index:4;scrollbar-width:none}.template-bar[data-v-3334b195]::-webkit-scrollbar{display:none}.aux-key-bar[data-v-3334b195]{position:absolute;left:0;right:0;bottom:0;height:30px;display:flex;align-items:center;gap:6px;overflow:hidden;padding:2px 8px;border-top:1px solid var(--border);background:var(--panel);z-index:4}.aux-key-scroll[data-v-3334b195]{min-width:0;flex:1 1 auto;height:100%;display:flex;align-items:center;gap:6px;overflow-x:auto;scrollbar-width:none}.aux-key-scroll[data-v-3334b195]::-webkit-scrollbar{display:none}.file-picker-input[data-v-3334b195]{display:none}.template-btn[data-v-3334b195]{flex:0 0 auto;height:22px;padding:0 10px;border-radius:6px;background:var(--bg);border:1px solid var(--border);color:var(--fg);font-size:.76rem;font-family:var(--font-mono);cursor:pointer}.template-btn[data-v-3334b195]:hover{border-color:var(--accent);color:var(--accent)}.aux-key-btn[data-v-3334b195]{flex:0 0 auto;min-width:34px;height:22px;padding:0 9px;border-radius:6px;background:var(--bg);border:1px solid var(--border);color:var(--fg);font-size:.76rem;font-family:var(--font-mono);cursor:pointer}.aux-key-btn[data-v-3334b195]:hover:not(:disabled){border-color:var(--accent);color:var(--accent)}.aux-key-btn[data-v-3334b195]:disabled{color:var(--fg-dim);cursor:default;opacity:.55}.keyboard-toggle-btn[data-v-3334b195]{min-width:76px;font-weight:600}.template-confirm-panel[data-v-3334b195]{position:absolute;left:8px;right:8px;bottom:calc(60px + env(safe-area-inset-bottom));display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:6px;align-items:center;padding:7px;border:1px solid var(--border);border-radius:8px;background:var(--panel);z-index:6;box-shadow:0 8px 24px #0000004d}.template-confirm-copy[data-v-3334b195]{min-width:0}.template-confirm-label[data-v-3334b195]{color:var(--fg);font:600 .78rem var(--font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.template-confirm-text[data-v-3334b195]{margin-top:2px;color:var(--fg-dim);font:.72rem var(--font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.template-confirm-btn[data-v-3334b195]{height:30px;border-radius:6px;border:1px solid var(--border);background:var(--bg);color:var(--fg);padding:0 10px;cursor:pointer}.template-confirm-btn.primary[data-v-3334b195]{border-color:var(--accent);color:var(--accent)}.paste-confirm-panel[data-v-3334b195]{position:absolute;left:8px;right:8px;bottom:calc(30px + env(safe-area-inset-bottom));display:grid;grid-template-columns:1fr auto auto;gap:6px;align-items:center;padding:7px;border:1px solid var(--border);border-radius:8px;background:var(--panel);z-index:6;box-shadow:0 8px 24px #0000004d}.paste-confirm-input[data-v-3334b195]{min-width:0;resize:vertical;border-radius:6px;border:1px solid var(--border);background:var(--terminal-bg);color:var(--fg);padding:6px 8px;font:.78rem var(--font-mono)}.paste-confirm-btn[data-v-3334b195]{height:30px;border-radius:6px;border:1px solid var(--border);background:var(--bg);color:var(--fg);padding:0 10px;cursor:pointer}.paste-confirm-btn.primary[data-v-3334b195]{border-color:var(--accent);color:var(--accent)}.paste-confirm-btn[data-v-3334b195]:disabled{color:var(--fg-dim);border-color:var(--border);cursor:default;opacity:.55}.term[data-v-3334b195] .xterm{padding:6px 8px}.term[data-v-3334b195] .xterm-viewport{top:6px;right:8px;bottom:6px;left:8px;z-index:5;background:transparent!important;touch-action:pan-y;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.term[data-v-3334b195] .xterm-helper-textarea{caret-color:transparent}.overlay[data-v-3334b195]{position:absolute;top:8px;right:12px;background:var(--terminal-overlay);border:1px solid var(--border);border-radius:6px;padding:4px 10px;font-size:12px;color:var(--fg-dim);pointer-events:none}.overlay.avoid-top-right-badge[data-v-3334b195]{top:34px}.session-route-indicator{display:inline-flex;align-items:center;color:var(--fg-dim);pointer-events:auto}.session-route-indicator{content:"·";margin-right:6px;color:var(--fg-dim)}.session-route-indicator.route-connecting-direct{color:#d29922}.session-route-indicator.route-direct{color:#3fb950}.viewer-overlay[data-v-3334b195]{position:absolute;top:0;right:0;bottom:0;left:0;background:#00000059;display:flex;align-items:center;justify-content:center;pointer-events:none;-webkit-user-select:none;user-select:none;z-index:5}.viewer-overlay-card[data-v-3334b195]{background:var(--terminal-overlay);border:1px solid var(--border);border-radius:10px;padding:14px 22px;text-align:center;pointer-events:auto;box-shadow:0 10px 30px #00000059}.viewer-overlay-title[data-v-3334b195]{font-size:14px;font-weight:600;color:var(--fg)}.viewer-overlay-host[data-v-3334b195]{margin-top:4px;font-size:12px;color:var(--fg);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;opacity:.85}.viewer-overlay-hint[data-v-3334b195]{margin-top:6px;font-size:12px;color:var(--fg-dim)}.viewer-overlay-btn[data-v-3334b195]{margin-top:8px;padding:6px 14px;border:none;border-radius:8px;background:#3b82f6;color:#fff;font-weight:600;pointer-events:auto;cursor:pointer}.overlay .warn[data-v-3334b195]{color:#d29922}.overlay .bad[data-v-3334b195]{color:var(--bad)}.overlay .dim[data-v-3334b195]{color:var(--fg-dim)}.progress-track[data-v-3334b195]{width:190px;height:4px;margin-top:6px;border-radius:999px;background:#94a3b83d;overflow:hidden}.progress-fill[data-v-3334b195]{height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--accent),#4ade80);transition:width .12s ease}.term-context-menu[data-v-3334b195]{position:fixed;min-width:150px;padding:6px;border-radius:8px;border:1px solid var(--border);background:#0d1117f5;box-shadow:0 10px 30px #00000059;z-index:1000}.term-context-item[data-v-3334b195]{width:100%;border:none;background:transparent;color:var(--fg);text-align:left;padding:8px 10px;border-radius:6px;cursor:pointer}.term-context-item[data-v-3334b195]:hover:not(:disabled){background:#ffffff0f}.term-context-item[data-v-3334b195]:disabled{color:var(--fg-dim);cursor:default}.term-view.focused[data-v-3334b195]{box-shadow:inset 0 0 0 1px var(--accent)}.pane-splitter[data-v-442ddd17]{position:absolute;z-index:5;background:transparent;-webkit-user-select:none;user-select:none;touch-action:none}.pane-splitter.col[data-v-442ddd17]{top:0;bottom:0;width:6px;cursor:col-resize}.pane-splitter.row[data-v-442ddd17]{left:0;right:0;height:6px;cursor:row-resize}.pane-splitter[data-v-442ddd17]:hover,.pane-splitter[data-v-442ddd17]:active{background:#ffffff14}.pane-grid[data-v-a336e107]{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;gap:2px;background:var(--terminal-grid)}.pane-grid.single[data-v-a336e107]{grid-template:"a"}.cell[data-v-a336e107]{position:relative;background:var(--terminal-bg);overflow:hidden}.cell.drop-target[data-v-a336e107]{box-shadow:inset 0 0 0 2px var(--accent)}.cell.drop-target[data-v-a336e107]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background:color-mix(in srgb,var(--accent) 12%,transparent);pointer-events:none}.term-host[data-v-a336e107]{position:absolute;top:0;right:0;bottom:0;left:0}.empty[data-v-a336e107]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;color:var(--fg-dim);font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.cell-controls[data-v-a336e107]{position:absolute;top:6px;right:8px;display:flex;align-items:center;gap:4px;z-index:6;pointer-events:none}.service-preview-controls-slot[data-v-a336e107]{display:inline-flex;align-items:center;min-width:0;pointer-events:auto}.remote-badge[data-v-a336e107]{display:inline-flex;align-items:center;gap:6px;background:#0d1117d9;border:1px solid var(--border);border-radius:10px;padding:2px 8px;font-size:11px;line-height:1.5;color:#d29922;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;-webkit-user-select:none;user-select:none;pointer-events:none}.remote-preview-trigger[data-v-a336e107]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;border-radius:4px;color:inherit;background:transparent;cursor:pointer;pointer-events:auto}.remote-preview-trigger[data-v-a336e107]:hover{color:var(--fg);background:#ffffff1a}.remote-preview-trigger svg[data-v-a336e107]{display:block}.remote-badge svg[data-v-a336e107]{display:block}.viewers-badge[data-v-a336e107]{position:absolute;top:4px;right:4px;display:inline-flex;align-items:center;gap:4px;padding:1px 6px;border-radius:6px;background:#0000008c;color:var(--fg);font-size:11px;pointer-events:none}.viewers-badge svg[data-v-a336e107]{display:block}.remote-badge .who[data-v-a336e107]{font-weight:600}.remote-badge .who.dim[data-v-a336e107],.remote-badge .sid[data-v-a336e107]{color:var(--fg-dim);font-weight:400}.remote-badge .sid[data-v-a336e107]:before{content:"·";margin-right:4px}.route-indicator-slot[data-v-a336e107]{display:contents}.close-pane[data-v-a336e107]{border:none;background:#0d1117b3;color:var(--fg-dim);font-size:14px;line-height:1;padding:2px 6px;border-radius:4px;cursor:pointer;opacity:0;pointer-events:auto;transition:opacity .12s,background .12s,color .12s}.cell:hover .close-pane[data-v-a336e107]{opacity:1}.pane-grip[data-v-a336e107]{opacity:0;transition:opacity .1s;cursor:grab;pointer-events:auto;-webkit-user-drag:element;padding:0 3px;font-size:12px;line-height:1;color:var(--fg-dim);-webkit-user-select:none;user-select:none}.pane-grip[data-v-a336e107]:active{cursor:grabbing}.cell:hover .pane-grip[data-v-a336e107]{opacity:1}@media (hover: none){.pane-grip[data-v-a336e107]{display:none}}.close-pane[data-v-a336e107]:hover{background:#f851492e;color:var(--bad)}.create-form[data-v-b7ce3097]{margin-bottom:1rem}.field[data-v-b7ce3097]{display:flex;flex-direction:column;gap:.25rem}.field-label[data-v-b7ce3097]{font-size:.75rem;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.06em}.secret-alert[data-v-b7ce3097]{margin:.5rem 0}.secret-msg[data-v-b7ce3097]{color:var(--fg-dim);font-size:.85rem;margin-bottom:.5rem}.secret-display[data-v-b7ce3097]{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.85rem;color:var(--good);word-break:break-all;display:block;padding:.25rem 0}.empty[data-v-b7ce3097]{color:var(--fg-dim);font-size:.875rem;margin:.5rem 0 0}.secret-alert[data-v-b54d534a]{margin-bottom:.5rem}.secret-msg[data-v-b54d534a]{color:var(--fg-dim);font-size:.85rem;margin-bottom:.5rem}.secret-display[data-v-b54d534a]{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.85rem;color:var(--good);word-break:break-all;display:block;padding:.25rem 0}.form-error[data-v-b54d534a]{color:var(--bad);font-size:.875rem;margin:.5rem 0 0}.hint[data-v-be878b2d]{color:var(--fg-dim);font-size:.875rem;margin:0 0 1rem}.muted[data-v-be878b2d]{color:var(--fg-dim);font-size:.875rem}.warn[data-v-be878b2d]{color:var(--warn, #d89614);font-size:.8125rem}.actions[data-v-be878b2d]{margin-top:1rem}.version code[data-v-be878b2d]{color:var(--fg)}.form-error[data-v-be878b2d]{color:var(--bad);font-size:.875rem;margin:.5rem 0 0}.hint[data-v-b32379d1]{color:var(--fg-dim);font-size:.875rem;margin:0 0 1rem}.muted[data-v-b32379d1]{color:var(--fg-dim);font-size:.875rem}.warn[data-v-b32379d1]{color:var(--warn, #d89614);font-size:.8125rem}.actions[data-v-b32379d1]{margin-top:1rem}.form-error[data-v-b32379d1]{color:var(--bad);font-size:.875rem;margin:.5rem 0 0}.traffic-dashboard[data-v-ba91c8e7]{width:100%;max-width:1540px;margin:0 auto;color:var(--fg)}button[data-v-ba91c8e7],input[data-v-ba91c8e7]{font:inherit;letter-spacing:0}button[data-v-ba91c8e7]{color:inherit}.traffic-titlebar[data-v-ba91c8e7]{display:flex;align-items:flex-start;gap:16px;margin-bottom:14px}.traffic-titlebar h1[data-v-ba91c8e7]{margin:0 0 4px;font-size:18px;font-weight:650}.traffic-titlebar p[data-v-ba91c8e7],.panel-head p[data-v-ba91c8e7]{margin:0;color:var(--fg-dim);font-size:11px}.traffic-titlebar>button[data-v-ba91c8e7]{margin-left:auto}.icon-button[data-v-ba91c8e7]{width:32px;height:32px;padding:0;border:1px solid var(--border);border-radius:6px;background:var(--panel);display:inline-grid;place-items:center;cursor:pointer}.icon-button[data-v-ba91c8e7]:hover{border-color:var(--fg-dim);background:color-mix(in srgb,var(--panel) 88%,white)}.icon-button svg[data-v-ba91c8e7]{width:15px;height:15px}.icon-button.small[data-v-ba91c8e7]{width:27px;height:27px}.spinning[data-v-ba91c8e7]{animation:spin-ba91c8e7 .8s linear infinite}@keyframes spin-ba91c8e7{to{transform:rotate(360deg)}}.scope-section[data-v-ba91c8e7]{min-width:0}.scope-heading[data-v-ba91c8e7],.user-heading[data-v-ba91c8e7]{display:flex;align-items:flex-end;gap:18px;min-height:54px;padding:0 2px 9px}.scope-heading>div>span[data-v-ba91c8e7],.user-heading>div>span[data-v-ba91c8e7],.panel-head>div>span[data-v-ba91c8e7]{color:var(--fg-dim);font:700 9px ui-monospace,Menlo,monospace;text-transform:uppercase}.scope-heading h2[data-v-ba91c8e7],.user-heading h2[data-v-ba91c8e7]{margin:2px 0 0;font-size:14px}.scope-heading>small[data-v-ba91c8e7]{margin-left:auto;color:var(--good);display:flex;align-items:center;gap:5px;font:10px ui-monospace,Menlo,monospace}.scope-heading>small svg[data-v-ba91c8e7]{width:13px}.platform-strip[data-v-ba91c8e7],.kpi-strip[data-v-ba91c8e7]{border:1px solid var(--border);border-radius:8px;background:var(--panel);display:grid;grid-template-columns:repeat(4,minmax(0,1fr));overflow:hidden}.platform-strip+.platform-strip[data-v-ba91c8e7]{margin-top:8px}.platform-cell[data-v-ba91c8e7],.kpi-cell[data-v-ba91c8e7]{min-width:0;min-height:78px;padding:12px 15px;border-left:1px solid var(--border);display:flex;flex-direction:column;justify-content:space-between}.platform-cell[data-v-ba91c8e7]:first-child,.kpi-cell[data-v-ba91c8e7]:first-child{border-left:0}.platform-cell>span[data-v-ba91c8e7],.kpi-cell>span[data-v-ba91c8e7]{color:var(--fg-dim);display:flex;align-items:center;gap:6px;font-size:10px}.platform-cell svg[data-v-ba91c8e7]{width:13px;height:13px}.platform-cell strong[data-v-ba91c8e7]{font:650 20px ui-monospace,Menlo,monospace}.platform-cell small[data-v-ba91c8e7]{color:var(--fg-dim);font-size:9px}.platform-health[data-v-ba91c8e7]{background:color-mix(in srgb,var(--good) 5%,transparent)}.platform-health strong[data-v-ba91c8e7]{color:var(--good)}.user-section[data-v-ba91c8e7]{margin-top:22px;padding-top:4px;border-top:1px solid var(--border)}.user-heading[data-v-ba91c8e7]{align-items:center;padding-top:10px}.user-heading>div[data-v-ba91c8e7]:first-child{min-width:210px}.filterbar[data-v-ba91c8e7]{margin-left:auto;display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end}.segmented[data-v-ba91c8e7]{display:inline-flex;align-items:center;gap:2px;padding:2px;border:1px solid var(--border);border-radius:7px;background:color-mix(in srgb,var(--bg) 75%,transparent)}.segmented button[data-v-ba91c8e7]{height:26px;padding:0 9px;border:0;border-radius:5px;background:transparent;color:var(--fg-dim);cursor:pointer;font-size:11px;white-space:nowrap}.segmented button[data-v-ba91c8e7]:hover{color:var(--fg)}.segmented button.active[data-v-ba91c8e7]{color:var(--fg);background:color-mix(in srgb,var(--panel) 82%,white)}.user-selector[data-v-ba91c8e7]{position:relative}.selector-trigger[data-v-ba91c8e7]{width:min(260px,42vw);height:32px;padding:0 9px;border:1px solid var(--border);border-radius:6px;background:var(--panel);display:flex;align-items:center;gap:7px;cursor:pointer}.selector-trigger.active[data-v-ba91c8e7],.selector-trigger[data-v-ba91c8e7]:hover{border-color:var(--fg-dim)}.selector-trigger svg[data-v-ba91c8e7]{width:14px;flex:0 0 auto}.selector-trigger span[data-v-ba91c8e7]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}.selector-popover[data-v-ba91c8e7]{position:absolute;z-index:20;top:calc(100% + 6px);right:0;width:min(360px,calc(100vw - 32px));border:1px solid color-mix(in srgb,var(--border) 75%,white);border-radius:7px;background:var(--bg);box-shadow:0 18px 46px #0009;overflow:hidden}.selector-head[data-v-ba91c8e7],.selector-foot[data-v-ba91c8e7]{display:flex;align-items:center;gap:10px;padding:11px 12px;border-bottom:1px solid var(--border)}.selector-head>div[data-v-ba91c8e7]{flex:1;min-width:0}.selector-head strong[data-v-ba91c8e7],.selector-head span[data-v-ba91c8e7]{display:block}.selector-head span[data-v-ba91c8e7]{margin-top:2px;color:var(--fg-dim);font-size:10px}.selector-head button[data-v-ba91c8e7],.selector-foot button[data-v-ba91c8e7],.flat-panel .panel-head button[data-v-ba91c8e7],.selection-empty button[data-v-ba91c8e7]{border:1px solid var(--border);border-radius:5px;background:var(--panel);padding:5px 8px;cursor:pointer;font-size:11px}.selector-head button[data-v-ba91c8e7]{border:0;color:var(--accent);background:transparent}.search-box[data-v-ba91c8e7]{margin:10px 12px;height:31px;border:1px solid var(--border);border-radius:5px;display:flex;align-items:center;gap:7px;padding:0 8px;background:var(--panel)}.search-box svg[data-v-ba91c8e7]{width:13px;color:var(--fg-dim)}.search-box input[data-v-ba91c8e7]{width:100%;min-width:0;border:0;outline:0;background:transparent;color:var(--fg)}.selector-options[data-v-ba91c8e7]{max-height:278px;overflow-y:auto;padding:0 7px 7px}.selector-option[data-v-ba91c8e7]{min-height:49px;padding:5px 7px;display:flex;align-items:center;gap:8px;border-radius:5px}.selector-option[data-v-ba91c8e7]:hover{background:color-mix(in srgb,var(--panel) 70%,transparent)}.selector-option label[data-v-ba91c8e7]{flex:1;min-width:0;display:flex;align-items:center;gap:9px;cursor:pointer}.selector-option label>span[data-v-ba91c8e7]{min-width:0}.selector-option strong[data-v-ba91c8e7],.selector-option small[data-v-ba91c8e7]{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.selector-option small[data-v-ba91c8e7]{color:var(--fg-dim);margin-top:2px}.selector-option button[data-v-ba91c8e7]{border:0;background:transparent;color:var(--accent);cursor:pointer;font-size:10px}.selector-options>p[data-v-ba91c8e7]{padding:16px;color:var(--fg-dim);text-align:center}.selector-foot[data-v-ba91c8e7]{justify-content:flex-end;border-top:1px solid var(--border);border-bottom:0}.selector-foot .primary[data-v-ba91c8e7]{background:var(--accent);color:#08111e;border-color:var(--accent)}.selection-banner[data-v-ba91c8e7]{min-height:38px;margin-bottom:10px;padding:0 10px;border:1px solid color-mix(in srgb,var(--accent) 40%,var(--border));border-radius:6px;background:color-mix(in srgb,var(--accent) 8%,transparent);display:flex;align-items:center;gap:8px}.selection-banner>svg[data-v-ba91c8e7]{width:14px;color:var(--accent)}.selection-banner>span[data-v-ba91c8e7]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--fg-dim)}.selection-banner>button[data-v-ba91c8e7]{margin-left:auto;width:25px;height:25px;border:0;background:transparent;cursor:pointer}.selection-banner>button svg[data-v-ba91c8e7]{width:14px}.selection-empty[data-v-ba91c8e7]{min-height:260px;border:1px dashed var(--border);border-radius:8px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;color:var(--fg-dim);text-align:center}.selection-empty>svg[data-v-ba91c8e7]{width:38px;height:38px;padding:9px;border-radius:50%;background:color-mix(in srgb,var(--accent) 12%,transparent);color:var(--accent)}.selection-empty h3[data-v-ba91c8e7]{margin:0;color:var(--fg);font-size:14px}.kpi-cell>div[data-v-ba91c8e7]{display:flex;align-items:flex-end;gap:8px}.kpi-cell strong[data-v-ba91c8e7]{font:650 21px ui-monospace,Menlo,monospace}.kpi-cell small[data-v-ba91c8e7]{display:inline-flex;align-items:center;gap:2px;color:var(--fg-dim);font-size:9px}.kpi-cell small svg[data-v-ba91c8e7]{width:11px}.kpi-cell small.up[data-v-ba91c8e7]{color:var(--warn)}.kpi-cell small.down[data-v-ba91c8e7]{color:var(--good)}.timeline-panel[data-v-ba91c8e7],.flat-panel[data-v-ba91c8e7],.diagnostics[data-v-ba91c8e7]{margin-top:14px;border:1px solid var(--border);border-radius:8px;background:var(--panel);overflow:hidden}.panel-head[data-v-ba91c8e7]{min-height:62px;padding:12px 14px;display:flex;align-items:flex-start;gap:14px;border-bottom:1px solid var(--border)}.panel-head h3[data-v-ba91c8e7]{margin:2px 0 3px;font-size:13px}.timeline-head[data-v-ba91c8e7]{min-height:82px}.timeline-controls[data-v-ba91c8e7]{margin-left:auto;display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap;justify-content:flex-end}.timeline-controls>div[data-v-ba91c8e7]{display:flex;flex-direction:column;gap:4px}.timeline-controls small[data-v-ba91c8e7]{color:var(--fg-dim);font-size:9px}.chart-meta[data-v-ba91c8e7]{min-height:34px;padding:0 14px;background:color-mix(in srgb,var(--bg) 55%,transparent);display:flex;align-items:center;gap:8px;color:var(--fg-dim);font-size:10px}.chart-meta span[data-v-ba91c8e7]{padding:3px 6px;border:1px solid color-mix(in srgb,var(--accent) 35%,transparent);border-radius:4px;color:var(--accent);background:color-mix(in srgb,var(--accent) 8%,transparent)}.chart-empty[data-v-ba91c8e7]{min-height:320px;display:grid;place-items:center;color:var(--fg-dim)}.svg-chart[data-v-ba91c8e7]{position:relative;height:340px;padding:10px 12px 0}.svg-chart svg[data-v-ba91c8e7]{width:100%;height:300px;overflow:visible}.svg-chart text[data-v-ba91c8e7]{fill:var(--fg-dim);font-size:9px}.grid-lines line[data-v-ba91c8e7]{stroke:var(--border);stroke-width:1;vector-effect:non-scaling-stroke}.line[data-v-ba91c8e7]{fill:none;stroke-width:2;vector-effect:non-scaling-stroke}.line.outbound[data-v-ba91c8e7]{stroke:var(--accent)}.line.inbound[data-v-ba91c8e7]{stroke:#39c5cf}.legend[data-v-ba91c8e7],.series-legend[data-v-ba91c8e7]{display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:wrap;padding:6px 14px 12px;color:var(--fg-dim);font-size:10px}.legend span[data-v-ba91c8e7],.series-legend span[data-v-ba91c8e7]{display:flex;align-items:center;gap:5px}.legend i[data-v-ba91c8e7],.series-legend i[data-v-ba91c8e7]{width:9px;height:7px;border-radius:2px}.legend i.outbound[data-v-ba91c8e7]{background:var(--accent)}.legend i.inbound[data-v-ba91c8e7]{background:#39c5cf}.matrix-chart[data-v-ba91c8e7]{min-height:330px;padding:15px 14px 7px;overflow-x:auto}.matrix-grid[data-v-ba91c8e7]{min-width:720px;display:grid;grid-template-columns:190px minmax(510px,1fr);gap:3px 8px;align-items:center}.matrix-label[data-v-ba91c8e7]{min-width:0;display:flex;gap:5px;font-size:9px;overflow:hidden}.matrix-label strong[data-v-ba91c8e7],.matrix-label span[data-v-ba91c8e7]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.matrix-label strong[data-v-ba91c8e7]{max-width:105px}.matrix-label span[data-v-ba91c8e7]{color:var(--fg-dim)}.matrix-cells[data-v-ba91c8e7],.matrix-axis[data-v-ba91c8e7]{display:grid;grid-template-columns:repeat(var(--columns),minmax(12px,1fr));gap:2px}.matrix-cells i[data-v-ba91c8e7]{height:11px;border-radius:2px}.matrix-axis[data-v-ba91c8e7]{min-width:720px;margin:7px 0 0 198px;padding-right:8px}.matrix-axis span[data-v-ba91c8e7]{color:var(--fg-dim);text-align:center;font-size:8px;overflow:hidden}.bar-chart[data-v-ba91c8e7]{height:320px;padding:18px 20px 0 54px;display:flex;align-items:flex-end;gap:clamp(3px,1.1vw,13px);border-bottom:1px solid var(--border);background:repeating-linear-gradient(to bottom,transparent 0,transparent 63px,color-mix(in srgb,var(--border) 65%,transparent) 64px)}.bar-column[data-v-ba91c8e7]{flex:1;min-width:7px;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:7px}.bar-stack[data-v-ba91c8e7]{width:min(34px,82%);height:260px;display:flex;flex-direction:column-reverse;justify-content:flex-start}.bar-stack i[data-v-ba91c8e7]{display:block;min-height:0}.bar-column>span[data-v-ba91c8e7]{height:18px;color:var(--fg-dim);font-size:8px;white-space:nowrap}.timeline-table-wrap[data-v-ba91c8e7]{max-height:330px;overflow:auto;border-top:1px solid var(--border)}table[data-v-ba91c8e7]{border-collapse:collapse;width:100%}.timeline-table[data-v-ba91c8e7]{min-width:1050px;font-size:9px}th[data-v-ba91c8e7]{color:var(--fg-dim);font-weight:600;text-align:left}.timeline-table th[data-v-ba91c8e7],.timeline-table td[data-v-ba91c8e7]{height:34px;padding:0 9px;border-right:1px solid var(--border);border-bottom:1px solid var(--border);white-space:nowrap;text-align:right}.timeline-table th[data-v-ba91c8e7]:first-child,.timeline-table td[data-v-ba91c8e7]:first-child,.timeline-table th[data-v-ba91c8e7]:nth-child(2),.timeline-table td[data-v-ba91c8e7]:nth-child(2){text-align:left}.timeline-table thead[data-v-ba91c8e7]{position:sticky;top:0;background:var(--bg);z-index:2}.lower-grid[data-v-ba91c8e7]{display:grid;grid-template-columns:minmax(280px,.7fr) minmax(520px,1.5fr);gap:14px}.flat-panel .panel-head[data-v-ba91c8e7]{min-height:58px}.flat-panel .panel-head>button[data-v-ba91c8e7]{margin-left:auto}.category-list[data-v-ba91c8e7]{padding:7px}.category-list>button[data-v-ba91c8e7]{width:100%;min-height:52px;padding:7px 8px;border:1px solid transparent;border-radius:5px;background:transparent;display:grid;grid-template-columns:minmax(0,1fr) 82px;grid-template-areas:"name value" "meter value";gap:5px 9px;cursor:pointer;text-align:left}.category-list>button[data-v-ba91c8e7]:hover{background:color-mix(in srgb,var(--bg) 45%,transparent)}.category-list>button.active[data-v-ba91c8e7]{border-color:color-mix(in srgb,var(--accent) 45%,transparent);background:color-mix(in srgb,var(--accent) 8%,transparent)}.category-name[data-v-ba91c8e7]{grid-area:name;display:flex;align-items:center;gap:6px;min-width:0}.category-name>i[data-v-ba91c8e7]{width:7px;height:7px;border-radius:2px}.category-name strong[data-v-ba91c8e7]{font-size:10px}.category-name em[data-v-ba91c8e7]{margin-left:auto;color:var(--fg-dim);font: 9px ui-monospace,Menlo,monospace}.meter[data-v-ba91c8e7]{grid-area:meter;height:3px;border-radius:2px;background:var(--border);overflow:hidden}.meter i[data-v-ba91c8e7]{display:block;height:100%}.category-value[data-v-ba91c8e7]{grid-area:value;display:flex;flex-direction:column;justify-content:center;text-align:right}.category-value strong[data-v-ba91c8e7]{font:600 11px ui-monospace,Menlo,monospace}.category-value small[data-v-ba91c8e7]{margin-top:3px;color:var(--fg-dim);font-size:8px}.table-panel-head[data-v-ba91c8e7]{align-items:center}.user-detail-select[data-v-ba91c8e7]{width:min(290px,46%);margin-left:auto}.data-table-wrap[data-v-ba91c8e7]{overflow-x:auto}.data-table[data-v-ba91c8e7]{min-width:720px;font-size:10px}.data-table th[data-v-ba91c8e7],.data-table td[data-v-ba91c8e7]{height:42px;padding:0 10px;border-bottom:1px solid var(--border);white-space:nowrap}.data-table td:first-child strong[data-v-ba91c8e7],.data-table td:first-child small[data-v-ba91c8e7]{display:block;max-width:190px;overflow:hidden;text-overflow:ellipsis}.data-table td:first-child small[data-v-ba91c8e7]{color:var(--fg-dim);margin-top:2px;font-size:8px}.data-table td[data-v-ba91c8e7]:last-child{text-align:right}.positive[data-v-ba91c8e7]{color:var(--warn)}.negative[data-v-ba91c8e7]{color:var(--good)}.share[data-v-ba91c8e7]{display:inline-block;width:55px;height:3px;margin-right:6px;background:var(--border);vertical-align:middle}.share i[data-v-ba91c8e7]{display:block;height:100%;background:var(--accent)}.diagnostics[data-v-ba91c8e7]{margin-top:14px}.diagnostic-grid[data-v-ba91c8e7]{display:grid;grid-template-columns:1.35fr 1fr}.diagnostic-block[data-v-ba91c8e7]{min-width:0;min-height:230px;padding:14px;border-left:1px solid var(--border)}.diagnostic-block[data-v-ba91c8e7]:first-child{border-left:0}.diagnostic-block h4[data-v-ba91c8e7]{margin:0 0 14px;font-size:11px}.activity-grid[data-v-ba91c8e7]{overflow-x:auto;display:grid;grid-template-columns:120px minmax(400px,1fr);gap:4px 8px;align-items:center}.activity-grid>span[data-v-ba91c8e7]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--fg-dim);font-size:9px}.activity-grid>div[data-v-ba91c8e7]{display:grid;grid-template-columns:repeat(var(--columns),minmax(8px,1fr));gap:2px}.activity-grid i[data-v-ba91c8e7]{height:16px;border-radius:2px}.density-list>div[data-v-ba91c8e7]{min-height:38px;display:grid;grid-template-columns:90px minmax(70px,1fr) 84px;align-items:center;gap:8px;font-size:9px}.density-list>div>span[data-v-ba91c8e7]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.density-list>div>div[data-v-ba91c8e7]{height:4px;background:var(--border)}.density-list i[data-v-ba91c8e7]{display:block;height:100%}.density-list strong[data-v-ba91c8e7]{color:var(--fg-dim);text-align:right;font-weight:500}.drawer-backdrop[data-v-ba91c8e7]{position:fixed;z-index:100;top:0;right:0;bottom:0;left:0;background:#0008;display:flex;justify-content:flex-end}.user-drawer[data-v-ba91c8e7]{width:min(520px,100vw);height:100%;overflow-y:auto;border-left:1px solid var(--border);background:var(--bg);box-shadow:-18px 0 50px #0008}.drawer-head[data-v-ba91c8e7]{min-height:92px;padding:18px;border-bottom:1px solid var(--border);display:flex;gap:12px}.drawer-head>div[data-v-ba91c8e7]{min-width:0}.drawer-head>button[data-v-ba91c8e7]{margin-left:auto}.drawer-head span[data-v-ba91c8e7],.drawer-head small[data-v-ba91c8e7]{color:var(--fg-dim);font-size:10px}.drawer-head h3[data-v-ba91c8e7]{margin:5px 0;font-size:16px;overflow-wrap:anywhere}.drawer-kpis[data-v-ba91c8e7]{display:grid;grid-template-columns:repeat(3,1fr);border-bottom:1px solid var(--border)}.drawer-kpis>div[data-v-ba91c8e7]{min-width:0;min-height:74px;padding:13px;border-left:1px solid var(--border)}.drawer-kpis>div[data-v-ba91c8e7]:first-child{border-left:0}.drawer-kpis span[data-v-ba91c8e7],.drawer-kpis strong[data-v-ba91c8e7]{display:block}.drawer-kpis span[data-v-ba91c8e7]{color:var(--fg-dim);font-size:9px}.drawer-kpis strong[data-v-ba91c8e7]{margin-top:10px;font:600 14px ui-monospace,Menlo,monospace}.user-drawer section[data-v-ba91c8e7]{padding:16px 18px;border-bottom:1px solid var(--border)}.user-drawer section h4[data-v-ba91c8e7]{margin:0 0 14px;display:flex;align-items:center;gap:7px;font-size:11px}.user-drawer section h4 svg[data-v-ba91c8e7]{width:14px;color:var(--accent)}.drawer-bars[data-v-ba91c8e7]{height:190px;display:flex;align-items:flex-end;gap:4px}.drawer-bars>div[data-v-ba91c8e7]{flex:1;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:5px}.drawer-bars i[data-v-ba91c8e7]{width:min(18px,75%);min-height:1px;background:var(--accent);border-radius:2px 2px 0 0}.drawer-bars span[data-v-ba91c8e7]{color:var(--fg-dim);font-size:7px;white-space:nowrap}.user-drawer table[data-v-ba91c8e7]{font-size:9px}.user-drawer th[data-v-ba91c8e7],.user-drawer td[data-v-ba91c8e7]{height:34px;padding:0 6px;border-bottom:1px solid var(--border);text-align:right}.user-drawer th[data-v-ba91c8e7]:first-child,.user-drawer td[data-v-ba91c8e7]:first-child,.user-drawer th[data-v-ba91c8e7]:nth-child(2),.user-drawer td[data-v-ba91c8e7]:nth-child(2){text-align:left}button[data-v-ba91c8e7]:focus-visible,input[data-v-ba91c8e7]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}@media (max-width: 1100px){.timeline-head[data-v-ba91c8e7]{align-items:stretch;flex-direction:column}.timeline-controls[data-v-ba91c8e7]{margin-left:0;justify-content:flex-start}.lower-grid[data-v-ba91c8e7],.diagnostic-grid[data-v-ba91c8e7]{grid-template-columns:1fr}.diagnostic-block[data-v-ba91c8e7]{border-left:0;border-top:1px solid var(--border)}.diagnostic-block[data-v-ba91c8e7]:first-child{border-top:0}}@media (max-width: 760px){.traffic-titlebar[data-v-ba91c8e7]{padding-top:2px}.scope-heading[data-v-ba91c8e7],.user-heading[data-v-ba91c8e7]{align-items:flex-start;flex-direction:column;gap:8px}.scope-heading>small[data-v-ba91c8e7],.filterbar[data-v-ba91c8e7]{margin-left:0}.filterbar[data-v-ba91c8e7]{width:100%;justify-content:flex-start}.selector-trigger[data-v-ba91c8e7]{width:min(100%,310px)}.platform-strip[data-v-ba91c8e7],.kpi-strip[data-v-ba91c8e7]{grid-template-columns:repeat(2,minmax(0,1fr))}.platform-cell[data-v-ba91c8e7]:nth-child(3),.kpi-cell[data-v-ba91c8e7]:nth-child(3){border-left:0;border-top:1px solid var(--border)}.platform-cell[data-v-ba91c8e7]:nth-child(4),.kpi-cell[data-v-ba91c8e7]:nth-child(4){border-top:1px solid var(--border)}.timeline-controls[data-v-ba91c8e7]{width:100%}.timeline-controls>div[data-v-ba91c8e7]{width:100%}.timeline-controls .segmented[data-v-ba91c8e7]{width:100%;overflow-x:auto}.timeline-controls .segmented button[data-v-ba91c8e7]{flex:1}.matrix-grid[data-v-ba91c8e7]{grid-template-columns:135px minmax(500px,1fr)}.matrix-axis[data-v-ba91c8e7]{margin-left:143px}.bar-chart[data-v-ba91c8e7]{padding-left:15px;overflow-x:auto}.bar-column[data-v-ba91c8e7]{min-width:18px}.table-panel-head[data-v-ba91c8e7]{align-items:flex-start;flex-direction:column}.user-detail-select[data-v-ba91c8e7]{width:100%;margin-left:0}.drawer-kpis[data-v-ba91c8e7]{grid-template-columns:1fr}.drawer-kpis>div[data-v-ba91c8e7]{min-height:58px;border-left:0;border-top:1px solid var(--border)}.drawer-kpis>div[data-v-ba91c8e7]:first-child{border-top:0}}@media (prefers-reduced-motion: reduce){.spinning[data-v-ba91c8e7]{animation:none}}.admin-panel[data-v-6f7ef581]{display:flex;flex-direction:column;flex:1 1 auto;height:100%;min-height:0;min-width:0;overflow:hidden}.admin-tabs[data-v-6f7ef581]{display:flex;gap:2px;padding:8px 12px 0;border-bottom:1px solid var(--border);flex:0 0 auto}.admin-tabs button[data-v-6f7ef581]{background:transparent;border:none;border-bottom:2px solid transparent;color:var(--fg-dim);padding:8px 12px;cursor:pointer;font-size:13px}.admin-tabs button[data-v-6f7ef581]:hover{color:var(--fg)}.admin-tabs button.active[data-v-6f7ef581]{color:var(--accent);border-bottom-color:var(--accent);font-weight:600}.admin-body[data-v-6f7ef581]{flex:1 1 auto;min-height:0;overflow-y:auto;padding:20px 24px}.terminal-appearance[data-v-e31f8f67]{display:flex;flex-direction:column;gap:14px}.field-label[data-v-e31f8f67]{font-size:12px;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.05em}.hint[data-v-e31f8f67]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.error[data-v-e31f8f67]{color:var(--bad);font-size:12px;margin:0}.checkbox[data-v-e31f8f67]{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--fg)}.number-input[data-v-e31f8f67]{width:80px;padding:4px 8px;background:var(--bg);border:1px solid var(--border);border-radius:4px;color:var(--fg);font:inherit}.settings-field-grid .number-input[data-v-e31f8f67]{width:100%}.cursor-blink[data-v-e31f8f67]{min-height:18px}.scrollback-field[data-v-e31f8f67]{align-items:flex-start}.tab-pane[data-v-e7440565]{display:flex;flex-direction:column;gap:14px}.field-label[data-v-e7440565]{font-size:12px;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.05em}.hint[data-v-e7440565]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.error[data-v-e7440565]{color:var(--bad);font-size:12px;margin:0}.checkbox[data-v-e7440565]{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--fg)}.number-input[data-v-e7440565]{width:80px;padding:4px 8px;background:var(--bg);border:1px solid var(--border);border-radius:4px;color:var(--fg);font:inherit}.text-input[data-v-e7440565]{padding:6px 8px;background:var(--bg);border:1px solid var(--border);border-radius:4px;color:var(--fg);font:inherit}.custom-shell-row[data-v-e7440565]{display:flex;gap:8px}.custom-shell-row .text-input[data-v-e7440565]{flex:1 1 auto}.custom-shell-row button[data-v-e7440565]{padding:6px 10px;background:var(--panel);border:1px solid var(--border);border-radius:4px;color:var(--fg);font:inherit}.push-section[data-v-e7440565]{display:flex;flex-direction:column;gap:8px;padding-top:14px;border-top:1px solid var(--border)}.section-title[data-v-e7440565]{margin:0;font-size:12px;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.05em}.push-test-button[data-v-e7440565]{align-self:flex-start;padding:6px 10px;background:var(--panel);border:1px solid var(--border);border-radius:4px;color:var(--fg);font:inherit;cursor:pointer}.push-test-button[data-v-e7440565]:disabled{opacity:.5;cursor:not-allowed}.pair-consume[data-v-285ce5b2]{display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:12px;border:1px solid var(--border);border-radius:6px;background:#ffffff08}.pending[data-v-285ce5b2],.pair-error[data-v-285ce5b2]{display:flex;flex-direction:column;gap:6px;color:var(--fg-dim);font-size:13px}.pending p[data-v-285ce5b2],.pair-error p[data-v-285ce5b2]{margin:0}.step[data-v-285ce5b2],.elapsed[data-v-285ce5b2],.code[data-v-285ce5b2]{font-family:var(--font-mono);font-size:12px}.code[data-v-285ce5b2]{color:var(--bad)}.cancel[data-v-285ce5b2],.pair-error button[data-v-285ce5b2]{align-self:flex-start}.traffic-dashboard[data-v-35494cb0]{display:flex;flex-direction:column;gap:14px;min-width:0}.traffic-heading[data-v-35494cb0],.panel-head[data-v-35494cb0]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.traffic-heading h3[data-v-35494cb0],.panel-head>div>span[data-v-35494cb0]{margin:0;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--fg-dim)}.traffic-heading p[data-v-35494cb0],.panel-head p[data-v-35494cb0]{margin:4px 0 0;color:var(--fg-dim);font-size:11px}.panel-head h4[data-v-35494cb0]{margin:2px 0 0;color:var(--fg);font-size:13px;font-weight:650}.traffic-actions[data-v-35494cb0]{display:flex;align-items:center;gap:6px}.segmented[data-v-35494cb0]{display:inline-flex;border:1px solid var(--border);border-radius:6px;overflow:hidden}.segmented button[data-v-35494cb0]{min-width:40px;height:28px;padding:0 8px;border:0;border-right:1px solid var(--border);background:transparent;color:var(--fg-dim);cursor:pointer;font-size:11px;white-space:nowrap}.segmented button[data-v-35494cb0]:last-child{border-right:0}.segmented button.active[data-v-35494cb0]{background:var(--accent);color:#0d1117;font-weight:600}.segmented.compact button[data-v-35494cb0]{min-width:34px;height:24px;padding:0 6px;font-size:10px}.icon-button[data-v-35494cb0]{width:28px;height:28px;display:grid;place-items:center;border:1px solid var(--border);border-radius:6px;background:transparent;color:var(--fg-dim);cursor:pointer}.icon-button svg[data-v-35494cb0]{width:14px;height:14px}.icon-button[data-v-35494cb0]:disabled{opacity:.5}.spinning[data-v-35494cb0]{animation:traffic-spin-35494cb0 .8s linear infinite}.kpi-strip[data-v-35494cb0],.direct-strip[data-v-35494cb0]{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border:1px solid var(--border);border-radius:6px;overflow:hidden}.kpi-cell[data-v-35494cb0],.direct-strip>div[data-v-35494cb0]{min-width:0;padding:10px 12px;border-right:1px solid var(--border)}.kpi-cell[data-v-35494cb0]:last-child,.direct-strip>div[data-v-35494cb0]:last-child{border-right:0}.kpi-cell>span[data-v-35494cb0],.direct-strip span[data-v-35494cb0]{color:var(--fg-dim);font-size:10px}.kpi-cell>div[data-v-35494cb0]{display:flex;align-items:baseline;justify-content:space-between;gap:6px;margin-top:6px}.kpi-cell strong[data-v-35494cb0],.direct-strip strong[data-v-35494cb0]{color:var(--fg);font-size:17px;font-weight:650}.kpi-cell small[data-v-35494cb0]{display:flex;align-items:center;color:var(--fg-dim);font-size:9px;white-space:nowrap}.kpi-cell small svg[data-v-35494cb0]{width:10px;height:10px}.kpi-cell small.up[data-v-35494cb0]{color:var(--warn, #d29922)}.kpi-cell small.down[data-v-35494cb0]{color:var(--good, #3fb950)}.analysis-panel[data-v-35494cb0],.direct-panel[data-v-35494cb0]{border-top:1px solid var(--border);padding-top:12px}.analysis-controls[data-v-35494cb0]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}.analysis-controls>div[data-v-35494cb0]{display:flex;flex-direction:column;align-items:flex-end;gap:3px}.analysis-controls small[data-v-35494cb0]{color:var(--fg-dim);font-size:9px;text-transform:uppercase;letter-spacing:.05em}.bar-chart[data-v-35494cb0]{display:flex;align-items:stretch;gap:2px;height:150px;margin-top:12px}.bar-column[data-v-35494cb0]{flex:1 1 0;min-width:2px;display:flex;flex-direction:column;align-items:center}.bar-stack[data-v-35494cb0]{width:100%;height:128px;display:flex;flex-direction:column-reverse;justify-content:flex-start}.bar-stack i[data-v-35494cb0]{display:block;width:min(11px,84%);min-height:0;margin:0 auto}.bar-stack i[data-v-35494cb0]:first-child{border-radius:2px 2px 0 0}.bar-column>span[data-v-35494cb0]{min-height:12px;margin-top:4px;color:var(--fg-dim);font-size:8px;white-space:nowrap}.line-chart[data-v-35494cb0]{position:relative;height:174px;margin-top:10px}.line-chart svg[data-v-35494cb0]{width:100%;height:150px;overflow:visible}.grid-lines line[data-v-35494cb0]{stroke:var(--border);stroke-width:1;vector-effect:non-scaling-stroke}.line[data-v-35494cb0]{fill:none;stroke-width:2;vector-effect:non-scaling-stroke}.line.outbound[data-v-35494cb0],.legend i.outbound[data-v-35494cb0]{stroke:#58a6ff;background:#58a6ff}.line.inbound[data-v-35494cb0],.legend i.inbound[data-v-35494cb0]{stroke:#3fb950;background:#3fb950}.legend[data-v-35494cb0]{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;color:var(--fg-dim);font-size:9px}.legend span[data-v-35494cb0]{display:inline-flex;align-items:center;gap:4px}.legend i[data-v-35494cb0]{width:7px;height:7px;border-radius:2px}.series-legend[data-v-35494cb0]{margin-top:6px}.chart-empty[data-v-35494cb0],.detail-empty[data-v-35494cb0],.traffic-state[data-v-35494cb0]{min-height:96px;margin:0;display:flex;align-items:center;justify-content:center;color:var(--fg-dim);font-size:12px}.detail-grid[data-v-35494cb0]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;border-top:1px solid var(--border);padding-top:12px}.detail-panel[data-v-35494cb0]{min-width:0}.category-list[data-v-35494cb0]{margin-top:8px}.category-list>div[data-v-35494cb0]{display:grid;grid-template-columns:minmax(90px,.9fr) minmax(70px,1fr) minmax(96px,auto);align-items:center;gap:8px;min-height:34px;border-bottom:1px solid color-mix(in srgb,var(--border) 65%,transparent)}.category-name[data-v-35494cb0]{display:flex;align-items:center;min-width:0;gap:5px;font-size:10px}.category-name>i[data-v-35494cb0]{width:7px;height:7px;border-radius:2px;flex:0 0 auto}.category-name strong[data-v-35494cb0]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.category-name em[data-v-35494cb0]{color:var(--fg-dim);font-style:normal}.meter[data-v-35494cb0]{height:4px;overflow:hidden;background:color-mix(in srgb,var(--border) 55%,transparent);border-radius:2px}.meter i[data-v-35494cb0]{display:block;height:100%}.category-value[data-v-35494cb0]{text-align:right}.category-value strong[data-v-35494cb0],.category-value small[data-v-35494cb0]{display:block}.category-value strong[data-v-35494cb0]{color:var(--fg);font-size:10px}.category-value small[data-v-35494cb0]{color:var(--fg-dim);font-size:8px;white-space:nowrap}.frame-table-wrap[data-v-35494cb0]{overflow-x:auto;margin-top:8px}table[data-v-35494cb0]{width:100%;border-collapse:collapse;font-size:10px}th[data-v-35494cb0]{color:var(--fg-dim);font-weight:500;text-align:left}th[data-v-35494cb0],td[data-v-35494cb0]{padding:6px 5px;border-bottom:1px solid color-mix(in srgb,var(--border) 65%,transparent);white-space:nowrap}th[data-v-35494cb0]:not(:first-child),td[data-v-35494cb0]:not(:first-child){text-align:right}td strong[data-v-35494cb0],td small[data-v-35494cb0]{display:block}td small[data-v-35494cb0]{color:var(--fg-dim);font-size:8px}.direct-panel .panel-head>small[data-v-35494cb0]{display:flex;align-items:center;gap:4px;color:var(--fg-dim);font-size:9px}.direct-panel .panel-head>small svg[data-v-35494cb0]{width:12px;height:12px}.direct-strip[data-v-35494cb0]{margin-top:9px}.direct-strip span[data-v-35494cb0]{display:flex;align-items:center;gap:4px}.direct-strip span svg[data-v-35494cb0]{width:12px;height:12px}.direct-strip strong[data-v-35494cb0],.direct-strip small[data-v-35494cb0],.direct-strip em[data-v-35494cb0]{display:block;margin-top:5px}.direct-strip small[data-v-35494cb0]{min-height:24px;color:var(--fg-dim);font-size:9px;line-height:1.35;overflow-wrap:anywhere}.direct-strip em[data-v-35494cb0]{color:var(--fg-dim);font-size:9px;font-style:normal}.success-meter[data-v-35494cb0]{height:3px;background:color-mix(in srgb,var(--border) 65%,transparent)}.success-meter i[data-v-35494cb0]{display:block;height:100%;background:#3fb950;transition:width .16s ease}.traffic-state.error[data-v-35494cb0]{color:var(--bad);gap:8px}.traffic-state button[data-v-35494cb0]{border:0;background:transparent;color:var(--accent);cursor:pointer;padding:0}@keyframes traffic-spin-35494cb0{to{transform:rotate(360deg)}}@media (max-width: 760px){.traffic-heading[data-v-35494cb0],.panel-head[data-v-35494cb0]{flex-direction:column}.traffic-actions[data-v-35494cb0]{width:100%;justify-content:space-between}.analysis-controls[data-v-35494cb0]{width:100%;justify-content:flex-start}.analysis-controls>div[data-v-35494cb0]{align-items:flex-start}.kpi-strip[data-v-35494cb0],.direct-strip[data-v-35494cb0]{grid-template-columns:repeat(2,minmax(0,1fr))}.kpi-cell[data-v-35494cb0]:nth-child(2),.direct-strip>div[data-v-35494cb0]:nth-child(2){border-right:0}.kpi-cell[data-v-35494cb0]:nth-child(-n+2),.direct-strip>div[data-v-35494cb0]:nth-child(-n+2){border-bottom:1px solid var(--border)}.detail-grid[data-v-35494cb0]{grid-template-columns:1fr}}@media (max-width: 460px){.segmented.compact button[data-v-35494cb0]{min-width:30px;padding:0 4px}.kpi-cell>div[data-v-35494cb0]{align-items:flex-start;flex-direction:column}}.tab-pane[data-v-2c82ebe0]{display:flex;flex-direction:column;gap:12px}.account-section[data-v-2c82ebe0]{display:flex;flex-direction:column;gap:8px;padding-bottom:16px;border-bottom:1px solid var(--border)}.account-section[data-v-2c82ebe0]:last-child{border-bottom:none;padding-bottom:0}.account-section h3[data-v-2c82ebe0]{margin:0 0 4px;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--fg-dim)}.field-label[data-v-2c82ebe0]{font-size:12px;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.05em}.email-value[data-v-2c82ebe0]{margin:0;color:var(--fg);font-size:13px}.hint[data-v-2c82ebe0]{margin:0;color:var(--fg-dim);font-size:12px;line-height:1.5}.warning-text[data-v-2c82ebe0]{color:var(--bad)}.error[data-v-2c82ebe0]{color:var(--bad);font-size:12px;margin:0}.success[data-v-2c82ebe0]{color:var(--good);font-size:12px;margin:0}.relay-url-row[data-v-2c82ebe0]{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:8px}.checkbox-row[data-v-2c82ebe0]{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--fg-dim);font-size:12px}.checkbox-row input[data-v-2c82ebe0]{flex:0 0 auto}.inline-error[data-v-2c82ebe0]{color:var(--bad);font-size:12px;margin:0}input[type=text][data-v-2c82ebe0],input[type=email][data-v-2c82ebe0],select[data-v-2c82ebe0],input[type=password][data-v-2c82ebe0]{height:32px;padding:6px 10px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;font-size:13px}input[data-v-2c82ebe0]:focus{outline:none;box-shadow:0 0 0 2px var(--accent)}button.secondary[data-v-2c82ebe0]{align-self:flex-start;background:transparent;color:var(--fg-dim);border:1px solid var(--border);border-radius:6px;padding:6px 12px;font-size:13px;cursor:pointer}button.secondary[data-v-2c82ebe0]:hover:not(:disabled){color:var(--fg);background:#ffffff0a}button.secondary[data-v-2c82ebe0]:disabled{opacity:.5;cursor:not-allowed}button.primary-action[data-v-2c82ebe0]{background:var(--accent);border-color:var(--accent);color:#0d1117;font-weight:600}button.primary-action[data-v-2c82ebe0]:hover:not(:disabled){background:#79b8ff;color:#0d1117}.danger-btn[data-v-2c82ebe0]{align-self:flex-start;background:transparent;color:var(--bad);border:1px solid var(--bad);border-radius:6px;padding:6px 12px;font-size:13px;cursor:pointer}.danger-btn[data-v-2c82ebe0]:hover:not(:disabled){background:color-mix(in srgb,var(--bad) 8%,transparent 92%)}.danger-btn[data-v-2c82ebe0]:disabled{opacity:.5;cursor:not-allowed}.pairing-panel[data-v-45575575]{display:flex;flex-direction:column;gap:10px;padding:12px;border:1px solid var(--border);border-radius:10px}.title[data-v-45575575]{font-size:13px;font-weight:700;color:var(--fg)}.hint[data-v-45575575]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.45}.qr-wrap[data-v-45575575]{display:flex;flex-direction:column;align-items:center;gap:8px}.qr[data-v-45575575]{width:240px;height:240px;image-rendering:pixelated;background:#fff;padding:6px;border-radius:6px}.qr.dimmed[data-v-45575575]{opacity:.35}.countdown[data-v-45575575]{font-size:12px;color:var(--fg-dim)}.countdown.expired[data-v-45575575]{color:var(--bad)}.wrap-badge[data-v-45575575]{font-size:11px;color:var(--fg-dim);padding:2px 8px;border:1px solid var(--border);border-radius:4px}.wrap-warning[data-v-45575575]{font-size:11px;color:var(--warn);background:#ffc8000f;border-left:2px solid var(--warn);padding:6px 10px;margin:0;line-height:1.4;text-align:left;max-width:240px}.prefix[data-v-45575575]{font-family:ui-monospace,Menlo,monospace;font-size:11px;color:var(--fg-dim)}.error[data-v-45575575]{color:var(--bad);font-size:12px;margin:0}button[data-v-45575575]{height:30px;border:1px solid var(--accent);border-radius:7px;background:var(--accent);color:var(--bg);padding:0 12px;font-size:12px;font-weight:700;cursor:pointer}button[data-v-45575575]:disabled{opacity:.55}.url-label-row[data-v-9080bf55]{display:flex;align-items:center;justify-content:space-between;gap:10px}.insecure-inline[data-v-9080bf55]{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--fg-dim);text-transform:none;letter-spacing:normal;cursor:pointer;-webkit-user-select:none;user-select:none}.insecure-inline input[type=checkbox][data-v-9080bf55]{margin:0}.url-input[data-v-9080bf55]{display:flex;align-items:stretch;border:1px solid var(--border);border-radius:6px;background:var(--bg)}.url-input[data-v-9080bf55]:focus-within{box-shadow:0 0 0 2px var(--accent)}.url-scheme[data-v-9080bf55]{flex:0 0 90px}.url-scheme[data-v-9080bf55] .trigger{height:100%;min-height:30px;background:var(--panel);border:0;border-right:1px solid var(--border);border-radius:5px 0 0 5px}.url-scheme[data-v-9080bf55] .menu{min-width:100%}.url-input.insecure .url-scheme[data-v-9080bf55] .trigger-label{color:var(--warn, #d97706)}.url-input input[data-v-9080bf55]{flex:1;border:0;border-radius:0;background:transparent;min-width:0}.url-input input[data-v-9080bf55]:focus{box-shadow:none}.auth-switch[data-v-9080bf55]{-webkit-appearance:none;-moz-appearance:none;appearance:none;align-self:flex-start;background:transparent;border:0;padding:0;margin:-4px 0 0;font:inherit;font-size:12px;color:var(--fg-dim);cursor:pointer}.auth-switch[data-v-9080bf55]:disabled{cursor:not-allowed;opacity:.5}.auth-switch-action[data-v-9080bf55]{color:var(--accent);text-decoration:underline;text-underline-offset:2px}.auth-switch:hover:not(:disabled) .auth-switch-action[data-v-9080bf55]{text-decoration:none}.tab-pane[data-v-9080bf55]{display:flex;flex-direction:column;gap:12px}.traffic-section[data-v-9080bf55]{padding:14px 0;border-top:1px solid var(--border);border-bottom:1px solid var(--border)}.dim[data-v-9080bf55]{color:var(--fg-dim);font-size:13px}.uplink-toggle-row[data-v-9080bf55]{display:flex;align-items:center;flex-wrap:wrap;column-gap:28px;row-gap:10px}.connection-toggle-group[data-v-9080bf55]{display:flex;align-items:center;gap:10px}.connection-info[data-v-9080bf55]{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;margin:0 -4px;border:0;background:transparent;color:var(--fg-dim);cursor:help}.connection-info[data-v-9080bf55]:hover,.connection-info[data-v-9080bf55]:focus-visible{color:var(--accent)}.connection-info[data-v-9080bf55]:focus-visible{outline:1px solid var(--accent);outline-offset:2px;border-radius:50%}.toggle-switch[data-v-9080bf55]{display:inline-flex;align-items:center;gap:6px;cursor:pointer;-webkit-user-select:none;user-select:none}.toggle-switch.disabled[data-v-9080bf55]{opacity:.5;cursor:not-allowed}.toggle-switch input[type=checkbox][data-v-9080bf55]{position:absolute;opacity:0;width:0;height:0}.toggle-track[data-v-9080bf55]{position:relative;display:inline-block;width:32px;height:18px;background:var(--fg-dim);border-radius:9px;transition:background .15s}.toggle-switch input:checked+.toggle-track[data-v-9080bf55]{background:var(--good)}.toggle-thumb[data-v-9080bf55]{position:absolute;top:2px;left:2px;width:14px;height:14px;background:var(--fg);border-radius:50%;transition:transform .15s}.toggle-switch input:checked+.toggle-track .toggle-thumb[data-v-9080bf55]{transform:translate(14px)}.toggle-label[data-v-9080bf55]{font-size:12px;color:var(--fg-dim);min-width:2.2em}.status-pill[data-v-9080bf55]{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border:1px solid var(--border);border-radius:999px;font-size:12px;width:max-content}.status-pill .dot[data-v-9080bf55]{font-size:10px;line-height:1}.status-pill.on .dot[data-v-9080bf55]{color:var(--good)}.status-pill.off .dot[data-v-9080bf55]{color:var(--fg-dim)}.status-pill.on[data-v-9080bf55]{color:var(--good)}.status-pill.off[data-v-9080bf55]{color:var(--fg-dim)}.status-pill.warn[data-v-9080bf55],.status-pill.warn .dot[data-v-9080bf55]{color:var(--warn, #d97706)}.status-pill.error[data-v-9080bf55],.status-pill.error .dot[data-v-9080bf55]{color:var(--bad)}.hint[data-v-9080bf55]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.field-label[data-v-9080bf55]{font-size:12px;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.05em}.checkbox[data-v-9080bf55]{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--fg)}.error[data-v-9080bf55]{color:var(--bad);font-size:12px;margin:0}.warning[data-v-9080bf55]{color:var(--bad);font-size:12px;line-height:1.45;margin:0}input[type=text][data-v-9080bf55],input[type=email][data-v-9080bf55],input[type=password][data-v-9080bf55]{height:32px;padding:6px 10px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;font-size:13px}input[data-v-9080bf55]:focus{outline:none;box-shadow:0 0 0 2px var(--accent)}.password-field[data-v-9080bf55]{position:relative;display:block}.password-field input[data-v-9080bf55]{width:100%;padding-right:36px}.password-toggle[data-v-9080bf55]{position:absolute;top:50%;right:8px;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;background:transparent;color:var(--fg-dim);border-radius:4px;cursor:pointer;transition:color .15s ease,background .15s ease}.password-toggle[data-v-9080bf55]:hover:not(:disabled){color:var(--fg);background:color-mix(in srgb,var(--accent) 12%,transparent 88%)}.password-toggle[data-v-9080bf55]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.password-toggle[data-v-9080bf55]:disabled{opacity:.4;cursor:not-allowed}.danger-zone[data-v-9080bf55]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-top:8px;padding-top:12px;border-top:1px solid var(--border)}.danger-zone-text[data-v-9080bf55]{flex:1;min-width:0}.danger-btn[data-v-9080bf55]{align-self:flex-start;background:transparent;color:var(--bad);border:1px solid var(--bad);border-radius:6px;padding:6px 12px;font-size:13px;cursor:pointer}.danger-btn[data-v-9080bf55]:hover:not(:disabled){background:color-mix(in srgb,var(--bad) 8%,transparent 92%)}.danger-btn[data-v-9080bf55]:disabled{opacity:.5;cursor:not-allowed}.log-lines[data-v-c9e8e2b4]{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;line-height:1.45;white-space:pre-wrap;word-break:break-word}.log-line[data-v-c9e8e2b4]{display:block}.ts[data-v-c9e8e2b4]{color:var(--fg-dim);margin-right:6px}.lvl[data-v-c9e8e2b4]{margin-right:6px;font-weight:700}.tag[data-v-c9e8e2b4]{color:var(--accent);margin-right:6px}.msg[data-v-c9e8e2b4]{color:var(--fg)}.raw[data-v-c9e8e2b4],.lvl-DEBUG .lvl[data-v-c9e8e2b4],.lvl-DEBUG .msg[data-v-c9e8e2b4]{color:var(--fg-dim)}.lvl-INFO .lvl[data-v-c9e8e2b4]{color:var(--fg)}.lvl-WARN .lvl[data-v-c9e8e2b4],.lvl-WARN .msg[data-v-c9e8e2b4]{color:var(--warn, #d2a86a)}.lvl-ERROR .lvl[data-v-c9e8e2b4],.lvl-ERROR .msg[data-v-c9e8e2b4]{color:var(--bad)}.tab-pane[data-v-cd8d05fa]{display:flex;flex-direction:column;gap:14px}.dim[data-v-cd8d05fa]{color:var(--fg-dim);font-size:13px}.checkbox[data-v-cd8d05fa]{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--fg)}.checkbox-row[data-v-cd8d05fa]{display:flex;align-items:center;gap:6px}.level-row[data-v-cd8d05fa]{display:flex;align-items:center;gap:8px}.level-label[data-v-cd8d05fa]{font-size:13px;color:var(--fg)}.level-select[data-v-cd8d05fa]{width:104px}.info-icon[data-v-cd8d05fa]{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;border:1px solid var(--fg-dim);border-radius:50%;color:var(--fg-dim);font-size:10px;font-style:italic;line-height:1;cursor:help;-webkit-user-select:none;user-select:none}.info-icon[data-v-cd8d05fa]:hover{color:var(--fg);border-color:var(--fg)}.kv[data-v-cd8d05fa]{display:flex;align-items:flex-start;gap:12px;font-size:12px}.kv .k[data-v-cd8d05fa]{color:var(--fg-dim);width:130px}.kv .v[data-v-cd8d05fa]{color:var(--fg)}.kv .path[data-v-cd8d05fa]{flex:1;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow-wrap:anywhere}.actions[data-v-cd8d05fa]{display:flex;gap:8px}.error[data-v-cd8d05fa]{color:var(--bad);font-size:12px;margin:0}button[data-v-cd8d05fa]{height:32px;padding:6px 14px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;cursor:pointer;font-size:13px}button[data-v-cd8d05fa]:hover{background:#ffffff0a}.tail-wrap[data-v-cd8d05fa]{display:flex;flex-direction:column;gap:6px;margin-top:4px}.tail-header[data-v-cd8d05fa]{display:flex;align-items:center;gap:8px}.tail-label[data-v-cd8d05fa]{font-size:12px;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.04em;flex:1 1 auto}.tail-refresh[data-v-cd8d05fa]{height:24px;padding:2px 10px;font-size:12px}.tail-paused[data-v-cd8d05fa]{height:24px;padding:2px 10px;font-size:12px;flex:0 0 auto;color:var(--accent);border-color:var(--accent)}.tail-level[data-v-cd8d05fa]{width:104px;flex:0 0 auto}.tail-tag[data-v-cd8d05fa]{width:152px;flex:0 0 auto}.tail-empty[data-v-cd8d05fa]{color:var(--fg-dim);font-size:12px;margin:0}.tail-error[data-v-cd8d05fa]{color:var(--bad);font-size:12px;margin:0}.tail-content[data-v-cd8d05fa]{margin:0;background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:10px;color:var(--fg);font-size:11px;line-height:1.45;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;max-height:280px;overflow:auto;white-space:pre-wrap;word-break:break-word}.tab-pane[data-v-c859d0af]{display:flex;flex-direction:column;gap:14px}.dim[data-v-c859d0af]{color:var(--fg-dim);font-size:13px}.grid[data-v-c859d0af]{display:grid;gap:6px;font-size:12px}.kv[data-v-c859d0af]{display:flex;align-items:flex-start;gap:12px}.kv .k[data-v-c859d0af]{color:var(--fg-dim);width:130px}.kv .v[data-v-c859d0af]{color:var(--fg)}.kv .path[data-v-c859d0af]{flex:1;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow-wrap:anywhere}.checkbox[data-v-c859d0af]{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--fg)}.proxy-box[data-v-c859d0af]{display:grid;gap:6px}.field-label[data-v-c859d0af]{color:var(--fg-dim);font-size:12px}.proxy-row[data-v-c859d0af]{display:flex;gap:8px}.proxy-row input[data-v-c859d0af]{flex:1;min-width:0;height:32px;padding:6px 10px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;font:inherit;font-size:13px}.hint[data-v-c859d0af]{margin:0;color:var(--fg-dim);font-size:12px;line-height:1.4}.notes[data-v-c859d0af]{font-size:12px;color:var(--fg)}.notes summary[data-v-c859d0af]{color:var(--fg-dim);cursor:pointer}.notes pre[data-v-c859d0af]{background:var(--bg);border:1px solid var(--border);padding:8px;border-radius:6px;white-space:pre-wrap;word-break:break-word;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;max-height:160px;overflow-y:auto;font-size:11px}.version-lines[data-v-c859d0af]{display:grid;gap:6px;font-size:13px;color:var(--fg)}.version-line label[data-v-c859d0af]{display:flex;align-items:center;gap:8px;cursor:pointer}.actions[data-v-c859d0af]{display:flex;gap:8px}.error[data-v-c859d0af]{color:var(--bad);font-size:12px;margin:0}button[data-v-c859d0af]{height:32px;padding:6px 14px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;cursor:pointer;font-size:13px}button[data-v-c859d0af]:hover:not(:disabled){background:#ffffff0a}button[data-v-c859d0af]:disabled{opacity:.5;cursor:default}button.primary[data-v-c859d0af]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}button.primary[data-v-c859d0af]:hover:not(:disabled){background:#79b8ff;border-color:#79b8ff}button.primary.danger[data-v-c859d0af]{background:var(--bad);color:#0d1117;border-color:var(--bad)}button.primary.danger[data-v-c859d0af]:hover:not(:disabled){background:#ff6f6a;border-color:#ff6f6a}button.secondary[data-v-c859d0af]{background:transparent;color:var(--fg-dim);border:1px solid var(--border)}button.secondary[data-v-c859d0af]:hover:not(:disabled){color:var(--fg);background:#ffffff0a}.translate-settings[data-v-2b2be568]{margin-top:8px;padding-top:8px;border-top:1px solid #2d333b;font-size:12px;display:flex;flex-direction:column;gap:8px}.translate-settings label[data-v-2b2be568]{display:flex;flex-direction:column;gap:3px}.translate-settings label span[data-v-2b2be568]{opacity:.7;font-size:11px}.translate-settings input[data-v-2b2be568],.translate-settings select[data-v-2b2be568]{background:#00000040;color:inherit;border:1px solid #2d333b;border-radius:3px;padding:4px 6px;font-size:12px}.extra-params[data-v-2b2be568]{background:#00000040;color:inherit;border:1px solid #2d333b;border-radius:3px;padding:4px 6px;font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;resize:vertical;min-height:56px}.extra-params-error[data-v-2b2be568]{color:#f87171;font-size:11px}.hint[data-v-2b2be568]{opacity:.55;font-size:11px}.muted[data-v-2b2be568]{opacity:.55;font-size:11px;margin:4px 0 0}.settings-plugins[data-v-a25af5cc]{padding:12px 16px;color:var(--settings-fg, #c9d1d9)}.hint[data-v-a25af5cc]{margin:0 0 12px;font-size:12px;opacity:.7}.plugin-list[data-v-a25af5cc]{list-style:none;margin:0;padding:0}.plugin-row[data-v-a25af5cc]{border:1px solid #2d333b;border-radius:6px;padding:10px 12px;margin-bottom:8px}.row-head[data-v-a25af5cc]{display:flex;align-items:center;gap:8px;font-weight:600}.desc[data-v-a25af5cc]{margin:6px 0 0 24px;font-size:12px;opacity:.7}.empty[data-v-a25af5cc]{font-size:12px;opacity:.5}.fe-settings[data-v-a25af5cc]{margin-top:8px;padding-top:8px;border-top:1px solid #2d333b;font-size:12px;display:flex;flex-direction:column;gap:6px}.fe-settings label[data-v-a25af5cc]{display:inline-flex;align-items:center;gap:6px}.fe-settings .muted[data-v-a25af5cc]{margin:6px 0 0;opacity:.6;font-size:11px}.widget-settings[data-v-a25af5cc]{margin:8px 0 0 24px;padding-top:8px;border-top:1px solid #2d333b;font-size:12px}.widget-settings label[data-v-a25af5cc]{display:inline-flex;align-items:center;gap:6px}.widget-settings .muted[data-v-a25af5cc]{margin:6px 0 0;opacity:.6;font-size:11px}.hotkey-cell[data-v-80cabc38]{font-family:SF Mono,Menlo,monospace;font-size:12px;background:#0d1117;border:1px solid #2d333b;color:#c9d1d9;padding:3px 8px;border-radius:4px;cursor:pointer;min-width:160px;text-align:left}.hotkey-cell[data-v-80cabc38]:hover{background:#161b22}.hotkey-cell.capturing[data-v-80cabc38]{background:#58a6ff1f;border-color:var(--accent);color:var(--accent)}.hotkey-cell.empty[data-v-80cabc38]{color:#6e7681;font-style:italic}.shortcut-settings[data-v-05d9d72b]{padding:8px 4px;font-size:12px;color:var(--fg)}.shortcut-group[data-v-05d9d72b]{margin-bottom:18px}.shortcut-group h3[data-v-05d9d72b]{margin:4px 0 8px;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--fg-dim)}.shortcut-row[data-v-05d9d72b]{display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:8px;padding:4px 0}.label[data-v-05d9d72b]{color:var(--fg)}.reset-row[data-v-05d9d72b]{background:transparent;border:1px solid #2d333b;color:var(--fg-dim);padding:2px 8px;border-radius:4px;cursor:pointer}.reset-row[data-v-05d9d72b]:hover{background:#ffffff0a;color:var(--fg)}.conflict[data-v-05d9d72b]{grid-column:1 / -1;color:#f85149;font-size:11px;padding-left:4px}.actions-row[data-v-05d9d72b]{display:flex;gap:8px;margin-top:12px;align-items:center}.spacer[data-v-05d9d72b]{flex:1}.actions-row button[data-v-05d9d72b]{background:#21262d;border:1px solid #2d333b;color:#c9d1d9;padding:4px 12px;border-radius:4px;cursor:pointer}.actions-row button[data-v-05d9d72b]:disabled{opacity:.4;cursor:default}.actions-row .save[data-v-05d9d72b]{background:var(--accent);color:#0d1117;border-color:var(--accent)}.actions-row .save[data-v-05d9d72b]:disabled{background:#21262d;color:#c9d1d9;border-color:#2d333b}.error[data-v-05d9d72b]{color:#f85149;font-size:12px;margin:8px 0 0}@media (max-width: 640px){.shortcut-row[data-v-05d9d72b]{grid-template-columns:minmax(0,1fr) minmax(0,140px) auto}.shortcut-row[data-v-05d9d72b] .hotkey-cell{min-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.actions-row[data-v-05d9d72b]{flex-wrap:wrap}}.diag[data-v-1a4e377a]{display:flex;flex-direction:column;gap:10px}.hint[data-v-1a4e377a]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.preview[data-v-1a4e377a]{background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:10px;font-family:ui-monospace,Menlo,monospace;font-size:11px;line-height:1.4;max-height:320px;overflow:auto;white-space:pre;color:var(--fg);margin:0}.row[data-v-1a4e377a]{display:flex;gap:8px;align-items:center}button[data-v-1a4e377a]{height:30px;border:1px solid var(--accent);border-radius:7px;background:var(--accent);color:var(--bg);padding:0 12px;font-size:12px;font-weight:700;cursor:pointer}.status[data-v-1a4e377a]{font-size:12px;color:var(--fg-dim)}.configio[data-v-9ef7411c]{display:flex;flex-direction:column;gap:16px;margin-top:12px;padding-top:12px;border-top:1px solid var(--border)}.configio-section[data-v-9ef7411c]{display:flex;flex-direction:column;gap:8px}.section-title[data-v-9ef7411c]{margin:0;font-size:13px}.hint[data-v-9ef7411c]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.checkbox[data-v-9ef7411c]{display:flex;align-items:center;gap:6px;font-size:12px}.row[data-v-9ef7411c]{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.status[data-v-9ef7411c]{font-size:12px;color:var(--fg-dim)}.status.error[data-v-9ef7411c]{color:var(--bad)}.file-input[data-v-9ef7411c]{display:none}.configio-preview[data-v-9ef7411c],.configio-report[data-v-9ef7411c]{border:1px solid var(--border);border-radius:6px;padding:10px;background:var(--bg);display:flex;flex-direction:column;gap:6px}.configio-preview h5[data-v-9ef7411c],.configio-report h5[data-v-9ef7411c]{margin:0;font-size:12px}.configio-preview h6[data-v-9ef7411c],.configio-report h6[data-v-9ef7411c]{margin:4px 0 2px;font-size:11px;color:var(--fg-dim)}.configio-preview ul[data-v-9ef7411c],.configio-report ul[data-v-9ef7411c]{margin:0;padding-left:18px;font-size:12px}button[data-v-9ef7411c]{height:30px;border:1px solid var(--accent);border-radius:7px;background:var(--accent);color:var(--bg);padding:0 12px;font-size:12px;font-weight:700;cursor:pointer}button[data-v-9ef7411c]:disabled{opacity:.5;cursor:default}.snippet-run-overlay[data-v-ca33db20]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0000008c;display:flex;align-items:center;justify-content:center;z-index:60}.snippet-run-panel[data-v-ca33db20]{background:#11182b;border:1px solid #1e2638;border-radius:11px;padding:16px 18px;min-width:360px;max-width:560px;max-height:80vh;overflow-y:auto;display:flex;flex-direction:column;gap:12px;color:#e6e7ea}.hint[data-v-ca33db20]{font-size:12px;color:var(--fg-dim);margin:0}.host-list[data-v-ca33db20]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;max-height:40vh;overflow-y:auto}.host-list label[data-v-ca33db20]{display:flex;align-items:center;gap:8px;font-size:.85rem}.rows[data-v-ca33db20]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.row[data-v-ca33db20]{border:1px solid var(--border);border-radius:6px;padding:8px 10px;background:var(--bg);display:flex;flex-direction:column;gap:4px}.row-head[data-v-ca33db20]{display:flex;justify-content:space-between;align-items:center;gap:8px}.row-host[data-v-ca33db20]{font-weight:600;font-family:var(--font-mono);font-size:.85rem}.row-state[data-v-ca33db20]{font-size:.78rem}.row.state-ok .row-state[data-v-ca33db20]{color:var(--good, #3fb950)}.row.state-failed .row-state[data-v-ca33db20],.row.state-error .row-state[data-v-ca33db20]{color:var(--bad)}.row.state-running .row-state[data-v-ca33db20]{color:var(--accent)}.row-exitcode[data-v-ca33db20]{font-size:.74rem;color:var(--fg-dim);font-family:var(--font-mono)}.row-output[data-v-ca33db20]{font-family:var(--font-mono);font-size:.76rem;white-space:pre-wrap;word-break:break-word;background:#ffffff08;border-radius:4px;padding:6px 8px;margin:0;max-height:30vh;overflow-y:auto}.row-truncated[data-v-ca33db20]{font-size:.72rem;color:var(--fg-dim);margin:0;font-style:italic}.error[data-v-ca33db20]{color:var(--bad);font-size:.75rem;margin:0}.footer[data-v-ca33db20]{display:flex;gap:8px;justify-content:flex-end}.footer .primary[data-v-ca33db20]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.tab-pane[data-v-d57ad1d6]{display:flex;flex-direction:column;gap:10px}.hint[data-v-d57ad1d6]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.show-toggle[data-v-d57ad1d6]{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--fg)}.list[data-v-d57ad1d6]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.row[data-v-d57ad1d6]{display:grid;grid-template-columns:7rem 1fr 5rem auto;gap:8px;align-items:center;padding:8px 10px;background:var(--bg);border:1px solid var(--border);border-radius:6px}.label[data-v-d57ad1d6]{font-weight:600;font-family:var(--font-mono);font-size:.85rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text[data-v-d57ad1d6]{font-family:var(--font-mono);font-size:.78rem;color:var(--fg-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hotkey[data-v-d57ad1d6]{font-family:var(--font-mono);font-size:.74rem;color:var(--fg-dim);text-align:center}.actions[data-v-d57ad1d6]{display:flex;gap:4px}.actions button[data-v-d57ad1d6]{height:24px;padding:0 8px;font-size:.74rem}.actions .del[data-v-d57ad1d6]{color:var(--bad);border-color:#f8514966}.edit-row[data-v-d57ad1d6]{display:flex;flex-direction:column;gap:8px;padding:10px;background:var(--panel);border:1px solid var(--accent);border-radius:6px}.edit-top[data-v-d57ad1d6]{display:grid;grid-template-columns:1fr 8rem;gap:8px}.edit-row input[data-v-d57ad1d6],.edit-row textarea[data-v-d57ad1d6]{padding:6px 8px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:4px;font-size:.85rem;font-family:var(--font-mono);width:100%;box-sizing:border-box}.edit-row input[data-v-d57ad1d6]{height:28px}.edit-row textarea[data-v-d57ad1d6]{resize:vertical;min-height:60px;line-height:1.4}.edit-actions[data-v-d57ad1d6]{display:flex;gap:6px;justify-content:flex-end}.edit-actions button[data-v-d57ad1d6]{height:28px;padding:0 14px;font-size:.78rem}.edit-actions .primary[data-v-d57ad1d6]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.footer[data-v-d57ad1d6]{display:flex;gap:8px;align-items:center}.error[data-v-d57ad1d6]{color:var(--bad);font-size:.75rem}.dialog-backdrop[data-v-d57ad1d6]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0000008c;display:flex;align-items:center;justify-content:center;z-index:50}.dialog[data-v-d57ad1d6]{background:#11182b;padding:14px 18px;border:1px solid #1e2638;border-radius:11px;max-width:320px;display:flex;flex-direction:column;gap:10px;color:#e6e7ea}@media (max-width: 640px){.row[data-v-d57ad1d6]{grid-template-columns:minmax(0,1fr) auto}.text[data-v-d57ad1d6]{grid-column:1 / -1;grid-row:2}.hotkey[data-v-d57ad1d6]{grid-column:2;grid-row:1}.actions[data-v-d57ad1d6]{grid-column:1 / -1;flex-wrap:wrap}.edit-top[data-v-d57ad1d6]{grid-template-columns:minmax(0,1fr)}}.tab-pane[data-v-41aa374f]{display:flex;flex-direction:column;gap:10px}.hint[data-v-41aa374f]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.list[data-v-41aa374f]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.row[data-v-41aa374f]{display:grid;grid-template-columns:9rem 1fr 1fr auto;gap:8px;align-items:center;padding:8px 10px;background:var(--bg);border:1px solid var(--border);border-radius:6px}.name[data-v-41aa374f]{font-weight:600;font-size:.85rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:flex;align-items:center;gap:6px}.badge[data-v-41aa374f]{font-size:.65rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--accent);border:1px solid var(--accent);border-radius:3px;padding:1px 4px}.detail[data-v-41aa374f]{font-family:var(--font-mono);font-size:.78rem;color:var(--fg-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.actions[data-v-41aa374f]{display:flex;gap:4px}.actions button[data-v-41aa374f]{height:24px;padding:0 8px;font-size:.74rem}.actions .del[data-v-41aa374f]{color:var(--bad);border-color:#f8514966}.edit-row[data-v-41aa374f]{display:flex;flex-direction:column;gap:8px;padding:10px;background:var(--panel);border:1px solid var(--accent);border-radius:6px}.edit-input[data-v-41aa374f]{padding:6px 8px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:4px;font-size:.85rem;font-family:var(--font-mono);width:100%;box-sizing:border-box;height:28px}.edit-textarea[data-v-41aa374f]{height:auto;resize:vertical;min-height:60px;line-height:1.4}.checkbox[data-v-41aa374f]{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--fg)}.edit-actions[data-v-41aa374f]{display:flex;gap:6px;justify-content:flex-end}.edit-actions button[data-v-41aa374f]{height:28px;padding:0 14px;font-size:.78rem}.edit-actions .primary[data-v-41aa374f]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.footer[data-v-41aa374f]{display:flex;gap:8px;align-items:center}.error[data-v-41aa374f]{color:var(--bad);font-size:.75rem}@media (max-width: 640px){.row[data-v-41aa374f]{grid-template-columns:repeat(2,minmax(0,1fr))}.name[data-v-41aa374f]{grid-column:1 / -1}.actions[data-v-41aa374f]{grid-column:1 / -1;flex-wrap:wrap;justify-content:flex-end}}.section-title[data-v-d7749d1b]{font-size:14px;font-weight:500;margin:0 0 12px}.preset-list[data-v-d7749d1b]{display:flex;flex-direction:column;gap:12px;margin-bottom:16px}.preset-option[data-v-d7749d1b]{display:flex;gap:10px;padding:10px;border:1px solid rgba(255,255,255,.08);border-radius:4px;cursor:pointer}.preset-option[data-v-d7749d1b]:hover{background:#ffffff08}.preset-name[data-v-d7749d1b]{font-weight:500}.preset-desc[data-v-d7749d1b]{font-size:12px;opacity:.7;margin:4px 0}.preset-preview[data-v-d7749d1b]{display:flex;gap:10px;margin-top:6px}.expand-toggle[data-v-d7749d1b]{display:flex;align-items:center;gap:8px;padding:6px 0}.group-by-row[data-v-d7749d1b]{display:flex;align-items:center;gap:14px;margin-bottom:10px;flex-wrap:wrap}.group-by-label[data-v-d7749d1b]{font-size:13px}.group-by-option[data-v-d7749d1b]{display:flex;align-items:center;gap:4px;font-size:13px;cursor:pointer}.feishu-fieldset[data-v-2aad46af]{border:none;padding:0;margin:0}.field-label[data-v-2aad46af]{display:flex;flex-direction:column;gap:.25rem;font-size:13px;color:var(--fg-dim)}.field-input[data-v-2aad46af]{padding:6px 10px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;font-size:13px}.actions[data-v-2aad46af]{display:flex;gap:.5rem;margin-top:.25rem}.feishu-configured[data-v-2aad46af]{display:flex;flex-direction:column;gap:.75rem}.configured-line[data-v-2aad46af]{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin:0;font-size:13px}.configured-badge[data-v-2aad46af]{display:inline-block;padding:2px 8px;border-radius:4px;background:var(--good);color:var(--bg);font-size:12px}.configured-appid[data-v-2aad46af]{color:var(--fg-dim);font-family:var(--mono, monospace)}.callback-row[data-v-2aad46af]{display:flex;gap:.5rem;align-items:center}.callback-row .field-input[data-v-2aad46af]{flex:1;font-family:var(--mono, monospace)}.btn-secondary[data-v-2aad46af]{background:transparent;color:var(--fg-dim);border:1px solid var(--border);border-radius:6px;padding:6px 12px;font-size:13px;cursor:pointer}.error[data-v-2aad46af]{color:#f87171;font-size:13px}.test-send[data-v-2aad46af]{border-top:1px solid var(--border);border-bottom:1px solid var(--border);padding:12px 0;margin:4px 0;display:flex;flex-direction:column;gap:6px}.test-send__title[data-v-2aad46af]{font-size:13px;font-weight:600;color:var(--fg);margin:0}.test-send .hint[data-v-2aad46af]{margin:0}.test-send__buttons[data-v-2aad46af]{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}.test-send__buttons .btn-secondary[data-v-2aad46af]:disabled{opacity:.5;cursor:default}.test-send__ok[data-v-2aad46af]{color:var(--good);font-size:13px;margin:0}.pair-hint[data-v-2aad46af]{font-size:13px;color:var(--fg-dim);margin-top:.5rem}.hint[data-v-2aad46af]{font-size:13px;color:var(--fg-dim);margin:0 0 1rem}.feishu-status-error[data-v-2aad46af]{display:flex;align-items:center;gap:8px;color:var(--warn)}.hook-install[data-v-2aad46af]{padding:8px 0 12px;border-bottom:1px solid var(--border);margin-bottom:12px}.hook-install__row[data-v-2aad46af]{display:flex;align-items:center;gap:8px}.hook-install__dot[data-v-2aad46af]{display:inline-block;width:8px;height:8px;border-radius:50%}.hook-install__dot--green[data-v-2aad46af]{background:var(--good)}.hook-install__dot--amber[data-v-2aad46af]{background:var(--warn)}.hook-install__dot--gray[data-v-2aad46af]{background:var(--neutral)}.hook-install__label[data-v-2aad46af]{flex:1;font-size:13px}.hook-install__toggle[data-v-2aad46af]{display:flex;gap:4px;align-items:center;font-size:12px}.hook-install__retry[data-v-2aad46af]{font-size:12px;padding:2px 8px}.hook-install__error[data-v-2aad46af]{font-size:12px;color:var(--warn);margin:6px 0 0}.ai-only[data-v-2aad46af]{padding:0 0 12px;border-bottom:1px solid var(--border);margin-bottom:12px}.ai-only__toggle[data-v-2aad46af]{display:flex;gap:6px;align-items:center;font-size:13px}.remote-terminal[data-v-2aad46af]{padding:0 0 12px;border-bottom:1px solid var(--border);margin-bottom:12px;display:flex;flex-direction:column;gap:8px}.remote-terminal__toggle[data-v-2aad46af]{display:flex;gap:6px;align-items:center;font-size:13px}.remote-terminal__attach-label[data-v-2aad46af]{display:flex;gap:8px;align-items:center;font-size:13px;color:var(--fg-dim);padding-left:22px}.remote-terminal__attach-select[data-v-2aad46af]{width:220px}.feishu-mode[data-v-2aad46af]{margin:8px 0}.feishu-mode__label[data-v-2aad46af]{display:flex;gap:8px;align-items:center;font-size:13px;color:var(--fg-dim)}.feishu-mode__label-text[data-v-2aad46af]{flex-shrink:0}.feishu-mode__select[data-v-2aad46af]{width:240px}.feishu-mode__effective[data-v-2aad46af]{margin:4px 0 0;font-size:12px;color:var(--fg-dim, #999)}.feishu-mode__warn[data-v-2aad46af]{color:var(--warn, #d89614);margin-left:8px}.tab-pane[data-v-6015f38d]{display:flex;flex-direction:column;gap:12px}.dim[data-v-6015f38d]{color:var(--fg-dim);font-size:13px}.hint[data-v-6015f38d]{margin:0;color:var(--fg-dim);font-size:12px;line-height:1.5}.error[data-v-6015f38d]{color:var(--bad);font-size:12px;margin:0}.header-row[data-v-6015f38d]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.header-actions[data-v-6015f38d]{display:flex;align-items:center;gap:8px;flex-shrink:0}.icon-btn[data-v-6015f38d]{width:28px;height:28px;padding:0;border:1px solid var(--border);border-radius:6px;background:transparent;color:var(--fg-dim);cursor:pointer;font-size:14px}.icon-btn[data-v-6015f38d]:hover:not(:disabled){color:var(--fg);background:#ffffff0a}.icon-btn[data-v-6015f38d]:disabled{opacity:.5;cursor:not-allowed}button.secondary[data-v-6015f38d]{background:transparent;color:var(--fg-dim);border:1px solid var(--border);border-radius:6px;padding:6px 12px;font-size:13px;cursor:pointer}button.secondary[data-v-6015f38d]:hover:not(:disabled){color:var(--fg);background:#ffffff0a}button.secondary[data-v-6015f38d]:disabled{opacity:.5;cursor:not-allowed}.device-list[data-v-6015f38d]{display:flex;flex-direction:column;border-top:1px solid var(--border)}.device-row[data-v-6015f38d]{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--border)}.device-info[data-v-6015f38d]{flex:1;min-width:0}.ua[data-v-6015f38d]{color:var(--fg);font-size:13px;overflow-wrap:anywhere}.meta[data-v-6015f38d]{color:var(--fg-dim);font-size:12px;margin-top:2px}.current-tag[data-v-6015f38d]{color:var(--fg-dim);font-size:12px;padding:2px 8px;border:1px solid var(--border);border-radius:999px;flex-shrink:0}.danger-btn[data-v-6015f38d]{background:transparent;color:var(--bad);border:1px solid var(--bad);border-radius:6px;padding:6px 12px;font-size:13px;cursor:pointer;flex-shrink:0}.danger-btn[data-v-6015f38d]:hover:not(:disabled){background:color-mix(in srgb,var(--bad) 8%,transparent 92%)}.danger-btn[data-v-6015f38d]:disabled{opacity:.5;cursor:not-allowed}.received-files[data-v-4b01c574]{display:flex;flex-direction:column;gap:12px;padding:8px 4px}.header[data-v-4b01c574]{display:flex;justify-content:space-between;align-items:center}.actions[data-v-4b01c574]{display:flex;gap:8px}.actions button[data-v-4b01c574]{padding:4px 10px}.actions button.danger[data-v-4b01c574]{color:#d33}.muted[data-v-4b01c574]{color:var(--fg-dim, #999);font-size:.875rem}.error[data-v-4b01c574]{color:#d33;padding:4px 0;font-size:.875rem}.sessions[data-v-4b01c574]{list-style:none;padding:0;margin:0}.session[data-v-4b01c574]{border-bottom:1px solid var(--border, #333);padding:8px 0}.session-row[data-v-4b01c574]{display:flex;align-items:center;gap:8px;cursor:pointer}.session-name[data-v-4b01c574]{font-weight:500}.session-clear[data-v-4b01c574]{margin-left:auto;padding:2px 8px;font-size:.85rem}.session-clear.danger[data-v-4b01c574]{color:#d33}.files[data-v-4b01c574]{list-style:none;padding-left:16px;margin:4px 0 0}.files li[data-v-4b01c574]{display:flex;align-items:center;gap:8px;padding:2px 0}.file-name[data-v-4b01c574]{font-family:monospace;font-size:.875rem}.file-delete[data-v-4b01c574]{margin-left:auto;font-size:.8rem;padding:1px 6px}.file-delete.danger[data-v-4b01c574]{color:#d33}.empty[data-v-4b01c574]{color:var(--fg-dim, #999);padding:8px 0}@media (max-width: 640px){.header[data-v-4b01c574]{flex-wrap:wrap;align-items:flex-start;gap:8px}.actions[data-v-4b01c574],.session-row[data-v-4b01c574],.files li[data-v-4b01c574]{flex-wrap:wrap}.file-name[data-v-4b01c574]{min-width:0;overflow-wrap:anywhere}}.mobile-profiles[data-v-1c4c4dd0]{display:flex;flex-direction:column;gap:12px}.hint[data-v-1c4c4dd0]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.status[data-v-1c4c4dd0]{font-size:13px;color:var(--fg-dim);margin:0}.status.error[data-v-1c4c4dd0]{color:var(--bad)}.profile-list[data-v-1c4c4dd0]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}.profile-item[data-v-1c4c4dd0]{border:1px solid var(--border);border-radius:8px;padding:10px 12px;background:var(--bg)}.profile-header[data-v-1c4c4dd0]{display:flex;align-items:center;gap:8px;margin-bottom:6px}.profile-name[data-v-1c4c4dd0]{font-weight:600;font-size:13px;color:var(--fg);flex:1}.badge[data-v-1c4c4dd0]{font-size:11px;padding:1px 6px;border-radius:4px;background:#58a6ff29;color:var(--accent)}.host-picker[data-v-1c4c4dd0]{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--fg-dim)}.host-picker select[data-v-1c4c4dd0]{font-size:12px;padding:2px 6px}.open-btn[data-v-1c4c4dd0]{font-size:12px;padding:3px 10px;border-radius:6px;border:1px solid var(--border);background:var(--bg);color:var(--fg);cursor:pointer}.open-btn[data-v-1c4c4dd0]:disabled{opacity:.5;cursor:default}.profile-fields[data-v-1c4c4dd0]{margin:0;display:grid;grid-template-columns:auto 1fr;gap:2px 10px;font-size:12px}.profile-fields dt[data-v-1c4c4dd0]{color:var(--fg-dim)}.profile-fields dd[data-v-1c4c4dd0]{margin:0;color:var(--fg);word-break:break-all}.env-list[data-v-1c4c4dd0]{list-style:none;margin:0;padding:0}.mobile-hosts[data-v-721a37c4]{display:flex;flex-direction:column;gap:12px}.hint[data-v-721a37c4]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.status[data-v-721a37c4]{font-size:13px;color:var(--fg-dim);margin:0}.status.error[data-v-721a37c4]{color:var(--bad)}.host-list[data-v-721a37c4]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}.host-item[data-v-721a37c4]{border:1px solid var(--border);border-radius:8px;padding:10px 12px;background:var(--bg)}.host-header[data-v-721a37c4]{display:flex;align-items:center;gap:8px;margin-bottom:6px;flex-wrap:wrap}.host-alias[data-v-721a37c4]{font-weight:600;font-size:13px;color:var(--fg)}.host-target[data-v-721a37c4]{font-size:12px;color:var(--fg-dim)}.badge[data-v-721a37c4]{font-size:11px;padding:1px 6px;border-radius:4px;background:#58a6ff29;color:var(--accent)}.badge-warn[data-v-721a37c4]{background:#f8514929;color:var(--bad)}.host-fields[data-v-721a37c4]{margin:0;display:grid;grid-template-columns:auto 1fr;gap:2px 10px;font-size:12px}.host-fields dt[data-v-721a37c4]{color:var(--fg-dim)}.host-fields dd[data-v-721a37c4]{margin:0;color:var(--fg);word-break:break-all}.sync-indicator[data-v-3da58fd3]{display:flex;flex-direction:column;gap:4px;font-size:.78rem}.sync-row[data-v-3da58fd3]{display:flex;align-items:center;gap:8px}.sync-dot[data-v-3da58fd3]{width:8px;height:8px;border-radius:50%;flex-shrink:0;background:var(--fg-dim)}.sync-dot.state-idle[data-v-3da58fd3]{background:var(--good, #3fb950)}.sync-dot.state-syncing[data-v-3da58fd3]{background:var(--accent)}.sync-dot.state-offline[data-v-3da58fd3]{background:var(--fg-dim)}.sync-dot.state-error[data-v-3da58fd3]{background:var(--bad)}.sync-state[data-v-3da58fd3]{color:var(--fg)}.sync-state[data-state=error][data-v-3da58fd3]{color:var(--bad)}.sync-state[data-state=offline][data-v-3da58fd3],.sync-last[data-v-3da58fd3],.sync-pending[data-v-3da58fd3]{color:var(--fg-dim)}.sync-pending[data-v-3da58fd3]{font-weight:600}.sync-now-btn[data-v-3da58fd3]{margin-left:auto;font-size:.76rem;padding:2px 8px}.sync-error[data-v-3da58fd3]{color:var(--bad);margin:0}.sync-notice[data-v-3da58fd3]{display:flex;flex-direction:column;gap:4px;border:1px solid var(--border);border-radius:6px;padding:6px 8px;background:var(--bg)}.sync-notice-adopted[data-v-3da58fd3],.sync-notice-conflict[data-v-3da58fd3]{margin:0}.sync-notice-dismiss[data-v-3da58fd3]{align-self:flex-end;font-size:.72rem;padding:2px 8px}.backdrop[data-v-3b3531ba]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:110}.dialog[data-v-3b3531ba]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:460px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:12px}.dialog h2[data-v-3b3531ba]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.dialog p[data-v-3b3531ba]{margin:0;font-size:13px;color:var(--fg);line-height:1.5}.dialog ul[data-v-3b3531ba]{margin:0;padding-left:18px;font-size:13px;color:var(--fg);line-height:1.6}.dialog .dim[data-v-3b3531ba]{color:var(--fg-dim);font-size:12px}.dialog .warn[data-v-3b3531ba]{color:#d29922;font-size:12px}.row[data-v-3b3531ba]{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}.primary[data-v-3b3531ba]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.primary[data-v-3b3531ba]:hover{background:#79b8ff;border-color:#79b8ff;color:#0d1117}.primary.danger[data-v-3b3531ba]{background:var(--bad);color:#0d1117;border-color:var(--bad)}.primary.danger[data-v-3b3531ba]:hover{background:#ff6f6a;border-color:#ff6f6a;color:#0d1117}.backdrop[data-v-b060bffd]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:110}.dialog[data-v-b060bffd]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:min(860px,calc(100vw - 32px));max-height:calc(100vh - 32px);box-sizing:border-box;display:flex;flex-direction:column;gap:12px}.header[data-v-b060bffd]{display:flex;flex-direction:column;gap:4px}.header h2[data-v-b060bffd]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.path[data-v-b060bffd]{color:var(--fg-dim);font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow-wrap:anywhere}.content-wrap[data-v-b060bffd]{min-height:0;display:flex;flex-direction:column;gap:8px}.content[data-v-b060bffd]{margin:0;background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:12px;overflow:auto;min-height:200px;max-height:calc(100vh - 220px);color:var(--fg);font-size:11px;line-height:1.45;white-space:pre-wrap;word-break:break-word;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.row[data-v-b060bffd]{display:flex;justify-content:flex-end;gap:8px}.hint[data-v-b060bffd],.empty[data-v-b060bffd]{color:var(--fg-dim);font-size:12px}.error[data-v-b060bffd]{color:var(--bad);font-size:12px}.primary[data-v-b060bffd]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.lvl-filter[data-v-b060bffd]{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--fg-dim);margin-right:auto}.lvl-filter-select[data-v-b060bffd]{width:104px}.tag-filter-select[data-v-b060bffd]{width:168px}.backdrop[data-v-6ddc3008]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:100}.settings-dialog[data-v-6ddc3008]{background:var(--panel);border:1px solid var(--border);border-radius:8px;width:1040px;height:720px;max-width:calc(100vw - 32px);max-height:calc(100vh - 32px);box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden}.settings-header[data-v-6ddc3008]{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--border)}.settings-header h2[data-v-6ddc3008]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.header-sync-indicator[data-v-6ddc3008]{flex:1;min-width:0;margin:0 16px}.close-btn[data-v-6ddc3008]{background:transparent;border:none;color:var(--fg-dim);font-size:18px;line-height:1;cursor:pointer;padding:4px 8px;border-radius:4px}.close-btn[data-v-6ddc3008]:hover:not(:disabled){background:#ffffff0f;color:var(--fg)}.settings-body[data-v-6ddc3008]{flex:1 1 auto;display:flex;min-height:0}.settings-nav[data-v-6ddc3008]{width:160px;flex:0 0 160px;border-right:1px solid var(--border);display:flex;flex-direction:column;padding:8px 6px;gap:2px}.settings-nav-item[data-v-6ddc3008]{display:flex;align-items:center;gap:8px;width:100%;text-align:left;background:transparent;border:none;color:var(--fg-dim);padding:8px 12px;border-radius:6px;cursor:pointer;font-size:13px}.settings-nav-item .nav-icon[data-v-6ddc3008]{display:inline-flex;width:16px;height:16px;flex:0 0 16px;color:var(--fg-dim)}.settings-nav-item .nav-icon[data-v-6ddc3008] svg{width:16px;height:16px}.settings-nav-item.active .nav-icon[data-v-6ddc3008]{color:var(--accent)}.settings-nav-item .nav-label[data-v-6ddc3008]{flex:1 1 auto;min-width:0}.settings-nav-item[data-v-6ddc3008]:hover{background:#ffffff0a;color:var(--fg)}.settings-nav-item.active[data-v-6ddc3008]{background:#58a6ff1f;color:var(--accent);font-weight:600}.settings-pane[data-v-6ddc3008]{flex:1 1 auto;padding:20px 24px;overflow-y:auto}.settings-pane-header[data-v-6ddc3008]{display:flex;align-items:baseline;gap:10px;margin:0 0 16px}.settings-pane-title[data-v-6ddc3008]{margin:0;font-size:20px;font-weight:600;letter-spacing:-.01em;color:var(--fg)}.settings-pane-subtitle[data-v-6ddc3008]{font-size:12px;color:var(--fg-dim)}.settings-footer[data-v-6ddc3008]{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid var(--border)}.settings-footer button[data-v-6ddc3008]{height:32px;padding:6px 14px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;cursor:pointer;font-size:13px}.settings-footer button[data-v-6ddc3008]:hover:not(:disabled){background:#ffffff0a}.settings-footer button[data-v-6ddc3008]:disabled{opacity:.5;cursor:default}.settings-footer .primary[data-v-6ddc3008]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.settings-footer .primary[data-v-6ddc3008]:hover:not(:disabled){background:#79b8ff;border-color:#79b8ff}.settings-footer .danger[data-v-6ddc3008]{border-color:var(--bad);color:var(--bad)}.settings-footer .danger[data-v-6ddc3008]:hover:not(:disabled){background:#f851491a}.version-footer[data-v-6ddc3008]{flex:0 0 auto;padding:4px 16px 8px;font-size:11px;color:var(--fg-dim);text-align:right}.diag-merged[data-v-6ddc3008]{display:flex;flex-direction:column;gap:20px}.merged-section[data-v-6ddc3008]{display:flex;flex-direction:column;gap:10px}.merged-section+.merged-section[data-v-6ddc3008]{border-top:1px solid var(--border);padding-top:18px}.merged-section-title[data-v-6ddc3008]{margin:0;font-size:13px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.discard-backdrop[data-v-6ddc3008]{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:105}.discard-dialog[data-v-6ddc3008]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:380px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:12px}.discard-dialog h3[data-v-6ddc3008]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.discard-dialog p[data-v-6ddc3008]{margin:0;font-size:13px;color:var(--fg);line-height:1.5}.discard-row[data-v-6ddc3008]{display:flex;justify-content:flex-end;gap:8px}.discard-row button[data-v-6ddc3008]{height:32px;padding:6px 14px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;cursor:pointer;font-size:13px}.discard-row button[data-v-6ddc3008]:hover{background:#ffffff0a}.discard-row .danger[data-v-6ddc3008]{border-color:var(--bad);color:var(--bad)}.discard-row .danger[data-v-6ddc3008]:hover{background:#f851491a}@media (max-width: 640px){.backdrop[data-v-6ddc3008]{align-items:stretch;justify-content:stretch;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}.settings-dialog[data-v-6ddc3008]{width:100vw;height:auto;max-width:100vw;max-height:100dvh;border-left:none;border-right:none;border-radius:0}.settings-header[data-v-6ddc3008]{padding:10px 12px}.settings-body[data-v-6ddc3008]{flex-direction:column}.settings-nav[data-v-6ddc3008]{width:100%;flex:0 0 auto;flex-direction:row;overflow-x:auto;overflow-y:hidden;border-right:none;border-bottom:1px solid var(--border);padding:6px 8px;scrollbar-width:none}.settings-nav[data-v-6ddc3008]::-webkit-scrollbar{display:none}.settings-nav-item[data-v-6ddc3008]{flex:0 0 auto;width:auto;min-height:34px;padding:6px 10px;white-space:nowrap}.settings-pane[data-v-6ddc3008]{min-height:0;padding:14px 16px 18px}.settings-pane-header[data-v-6ddc3008]{margin-bottom:12px}.settings-pane-title[data-v-6ddc3008]{font-size:18px}.settings-footer[data-v-6ddc3008]{padding:10px 12px}.version-footer[data-v-6ddc3008]{padding:4px 12px 8px}}.backdrop[data-v-c791c224]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:110}.dialog[data-v-c791c224]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:460px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:10px}.dialog h2[data-v-c791c224]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.dialog label[data-v-c791c224]{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--fg-dim)}.dialog label.inline[data-v-c791c224]{flex-direction:row;align-items:center;gap:6px;color:var(--fg)}.dialog input[data-v-c791c224],.dialog textarea[data-v-c791c224]{background:var(--bg);border:1px solid var(--border);border-radius:4px;padding:6px 8px;color:var(--fg);font-size:13px}.row[data-v-c791c224]{display:flex;gap:12px}.row.end[data-v-c791c224]{justify-content:flex-end;margin-top:4px}.tofu[data-v-c791c224]{display:flex;flex-direction:column;gap:6px;border:1px solid #d29922;border-radius:6px;padding:10px}.tofu code[data-v-c791c224]{font-size:12px;word-break:break-all;color:var(--fg)}.warn[data-v-c791c224]{color:#d29922;font-size:12px;margin:0}.error[data-v-c791c224]{color:var(--bad);font-size:12px;margin:0}.primary[data-v-c791c224]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.ssh-overlay[data-v-d1c3506a]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:120;background:#010409b8;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);display:flex;align-items:center;justify-content:center}.ssh-shell[data-v-d1c3506a]{position:relative;width:min(1040px,calc(100vw - 48px));height:min(720px,calc(100vh - 48px));background:radial-gradient(120% 80% at 100% 0%,rgba(88,166,255,.06),transparent 55%),var(--bg);border:1px solid var(--border);border-radius:12px;box-shadow:0 24px 64px #0000008c;overflow:hidden;display:flex;flex-direction:column}.ssh-header[data-v-d1c3506a]{display:flex;align-items:center;gap:12px;padding:10px 16px;border-bottom:1px solid var(--border);background:var(--panel)}.tabs[data-v-d1c3506a]{display:flex;gap:4px}.tab[data-v-d1c3506a]{display:inline-flex;align-items:center;gap:6px;background:transparent;border:1px solid transparent;color:var(--fg-dim);font-size:12px;font-weight:600;letter-spacing:.04em;padding:6px 12px;border-radius:7px;cursor:pointer;transition:all .12s}.tab[data-v-d1c3506a]:hover{color:var(--fg)}.tab.on[data-v-d1c3506a]{color:var(--fg);background:var(--bg);border-color:var(--border)}.tab-count[data-v-d1c3506a]{font-size:10px;color:var(--fg-dim);background:#8b949e29;padding:1px 6px;border-radius:999px}.search[data-v-d1c3506a]{flex:1;max-width:360px;display:flex;align-items:center;gap:7px;background:var(--bg);border:1px solid var(--border);border-radius:7px;padding:0 10px}.search-spacer[data-v-d1c3506a]{flex:1}.search-icon[data-v-d1c3506a]{color:var(--fg-dim);flex:none}.search input[data-v-d1c3506a]{flex:1;background:transparent;border:none;outline:none;color:var(--fg);font-size:13px;padding:7px 0}.new-btn[data-v-d1c3506a]{display:inline-flex;align-items:center;gap:5px;background:var(--accent);color:#04101f;border:none;font-size:12px;font-weight:600;padding:7px 12px;border-radius:7px;cursor:pointer;transition:filter .12s}.new-btn[data-v-d1c3506a]:hover{filter:brightness(1.1)}.new-btn.ghost[data-v-d1c3506a]{background:transparent;color:var(--accent);border:1px solid var(--accent)}.close-x[data-v-d1c3506a]{display:inline-flex;align-items:center;justify-content:center;background:transparent;border:none;color:var(--fg-dim);cursor:pointer;padding:4px;border-radius:6px;transition:color .12s,background .12s}.close-x[data-v-d1c3506a]:hover{color:var(--fg);background:#8b949e1f}.ssh-error[data-v-d1c3506a]{margin:0;padding:8px 16px;font-size:12px;color:var(--bad);background:#f8514914;border-bottom:1px solid rgba(248,81,73,.2)}.ssh-error.inline[data-v-d1c3506a]{border-bottom:none;border-radius:6px}.ssh-tofu[data-v-d1c3506a]{margin:0;padding:10px 16px;display:flex;flex-direction:column;gap:6px;background:#d2992214;border-bottom:1px solid rgba(210,153,34,.3)}.ssh-tofu p[data-v-d1c3506a]{margin:0;font-size:12px;line-height:1.5}.ssh-tofu .tofu-title[data-v-d1c3506a]{font-weight:600;color:var(--warn, #d29922)}.ssh-tofu .tofu-msg[data-v-d1c3506a]{color:var(--fg)}.ssh-tofu .tofu-note[data-v-d1c3506a]{color:var(--fg-dim);font-size:11px}.ssh-tofu .tofu-fp[data-v-d1c3506a]{font-size:12px;word-break:break-all;color:var(--fg)}.ssh-tofu .tofu-actions[data-v-d1c3506a]{display:flex;gap:8px;justify-content:flex-end}.ssh-success[data-v-d1c3506a]{margin:0;padding:8px 16px;font-size:12px;color:var(--good, #3fb950);background:#3fb95014;border-bottom:1px solid rgba(63,185,80,.2)}.ssh-body[data-v-d1c3506a]{flex:1;overflow-y:auto;padding:18px 16px 24px}.tag-bar[data-v-d1c3506a]{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 2px 14px}.tag-pill[data-v-d1c3506a]{background:var(--panel);border:1px solid var(--border);color:var(--fg-dim);font-size:11px;padding:4px 10px;border-radius:999px;cursor:pointer;transition:color .12s,border-color .12s,background .12s}.tag-pill[data-v-d1c3506a]:hover{color:var(--fg);border-color:var(--neutral)}.tag-pill.on[data-v-d1c3506a]{color:#04101f;background:var(--accent);border-color:var(--accent);font-weight:600}.tag-clear[data-v-d1c3506a]{display:inline-flex;align-items:center;gap:3px;background:transparent;border:none;color:var(--fg-dim);font-size:11px;padding:4px 6px;cursor:pointer}.tag-clear[data-v-d1c3506a]:hover{color:var(--fg)}.card-proxy[data-v-d1c3506a]{display:flex;margin-top:5px}.card-proxy .proxy-badge[data-v-d1c3506a]{max-width:100%;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.card-tags[data-v-d1c3506a]{display:flex;flex-wrap:wrap;gap:4px;margin-top:5px}.card-tag[data-v-d1c3506a]{font-size:10px;color:var(--fg-dim);background:#8b949e29;padding:1px 7px;border-radius:999px;white-space:nowrap}.card-grid[data-v-d1c3506a]{display:grid;gap:10px;grid-template-columns:repeat(auto-fill,minmax(288px,1fr))}.card[data-v-d1c3506a]{position:relative;display:flex;align-items:center;gap:11px;padding:12px;background:var(--panel);border:1px solid var(--border);border-radius:10px;transition:border-color .14s,transform .14s,box-shadow .14s}.card[data-v-d1c3506a]:hover{border-color:var(--accent);transform:translateY(-1px);box-shadow:0 6px 18px #00000059}.card.busy[data-v-d1c3506a]{opacity:.6}.card-glyph[data-v-d1c3506a]{flex:none;width:34px;height:34px;border-radius:8px;display:flex;align-items:center;justify-content:center;color:var(--accent);background:#58a6ff1a;border:1px solid rgba(88,166,255,.18)}.card-main[data-v-d1c3506a]{flex:1;min-width:0}.card-label[data-v-d1c3506a]{font-size:13px;font-weight:600;color:var(--fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.card-sub[data-v-d1c3506a]{font-size:11px;color:var(--fg-dim);font-family:var(--font-mono-strict);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}.card-actions[data-v-d1c3506a]{flex:none;display:flex;gap:4px;align-items:center}.act[data-v-d1c3506a]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;background:var(--bg);border:1px solid var(--border);color:var(--fg);cursor:pointer;transition:color .12s,background .12s,border-color .12s}.act svg[data-v-d1c3506a]{display:block;flex:none;width:15px;height:15px}.act[data-v-d1c3506a]:hover{color:#fff;border-color:var(--neutral);background:#8b949e2e}.act.connect[data-v-d1c3506a]{background:var(--accent);border-color:var(--accent);color:#04101f}.act.connect[data-v-d1c3506a]:hover:not(:disabled){filter:brightness(1.12)}.act.danger[data-v-d1c3506a]{color:var(--fg-dim)}.act.danger[data-v-d1c3506a]:hover{color:#fff;border-color:var(--bad);background:#f8514933}.act[data-v-d1c3506a]:disabled{opacity:.5;cursor:default}.empty[data-v-d1c3506a]{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:var(--fg-dim)}.empty-icon[data-v-d1c3506a]{color:var(--neutral);opacity:.5;margin-bottom:6px}.empty-title[data-v-d1c3506a]{margin:0;font-size:14px;color:var(--fg);font-weight:600}.empty-sub[data-v-d1c3506a]{margin:0 0 12px;font-size:12px}.drawer[data-v-d1c3506a]{position:absolute;top:0;right:0;bottom:0;width:360px;max-width:84%;background:var(--panel);border-left:1px solid var(--border);box-shadow:-20px 0 48px #00000073;display:flex;flex-direction:column}.drawer.wide[data-v-d1c3506a]{width:480px}.drawer-head[data-v-d1c3506a]{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--border);font-size:12px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--fg-dim)}.drawer-body[data-v-d1c3506a]{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px}.field[data-v-d1c3506a]{display:flex;flex-direction:column;gap:5px}.field-row[data-v-d1c3506a]{display:flex;gap:10px}.field.grow[data-v-d1c3506a]{flex:1}.field.port[data-v-d1c3506a]{width:78px;flex:none}.fl[data-v-d1c3506a]{font-size:11px;color:var(--fg-dim)}.fl em[data-v-d1c3506a]{color:var(--neutral);font-style:normal}.field input[data-v-d1c3506a],.field textarea[data-v-d1c3506a]{background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:7px 9px;color:var(--fg);font-size:13px;outline:none;transition:border-color .12s}.field input[data-v-d1c3506a]:focus,.field textarea[data-v-d1c3506a]:focus{border-color:var(--accent)}.field textarea[data-v-d1c3506a]{resize:vertical;font-family:var(--font-mono-strict);font-size:12px}.hint[data-v-d1c3506a]{font-size:12px;color:var(--fg-dim);margin:0}.tag-editor[data-v-d1c3506a]{position:relative;display:flex;flex-wrap:wrap;align-items:center;gap:4px;background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:5px 6px;transition:border-color .12s}.tag-editor[data-v-d1c3506a]:focus-within{border-color:var(--accent)}.tag-editor .chip[data-v-d1c3506a]{display:inline-flex;align-items:center;gap:3px;font-size:11px;color:var(--fg);background:#58a6ff24;border:1px solid rgba(88,166,255,.28);padding:1px 4px 1px 8px;border-radius:999px}.chip-x[data-v-d1c3506a]{display:inline-flex;align-items:center;justify-content:center;background:transparent;border:none;color:var(--fg-dim);cursor:pointer;padding:1px;border-radius:999px;line-height:1}.chip-x[data-v-d1c3506a]:hover{color:#fff;background:#f8514959}.tag-input[data-v-d1c3506a]{flex:1;min-width:90px;background:transparent;border:none;outline:none;color:var(--fg);font-size:13px;padding:2px 3px}.combo[data-v-d1c3506a]{position:relative;display:flex}.combo input[data-v-d1c3506a]{flex:1;padding-right:26px;width:100%}.combo-caret[data-v-d1c3506a]{position:absolute;right:6px;top:50%;transform:translateY(-50%);background:transparent;border:none;color:var(--fg-dim);cursor:pointer;font-size:11px;padding:2px 4px;line-height:1}.combo-caret[data-v-d1c3506a]:hover{color:var(--fg)}.combo-menu[data-v-d1c3506a]{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:10;margin:0;padding:4px 0;list-style:none;max-height:180px;overflow-y:auto;background:var(--bg);border:1px solid var(--border);border-radius:6px;box-shadow:0 6px 16px #00000059}.combo-opt[data-v-d1c3506a]{padding:7px 10px;font-size:13px;color:var(--fg);cursor:pointer}.combo-opt[data-v-d1c3506a]:hover{background:#ffffff0f}.identity-hint[data-v-d1c3506a]{margin:-4px 0 0;display:flex;flex-direction:column;gap:3px;font-size:11px;color:var(--fg-dim);line-height:1.4}.identity-hint code[data-v-d1c3506a]{font-family:var(--font-mono-strict);font-size:11px;color:var(--fg);background:var(--bg);border:1px solid var(--border);border-radius:5px;padding:4px 7px;word-break:break-all}.identity-hint.proxy[data-v-d1c3506a]{color:var(--warn, #d29922)}.empty-keys-hint[data-v-d1c3506a]{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.enc-hint[data-v-d1c3506a]{margin:-4px 0 0;font-size:11px;color:var(--warn, #d29922)}.import-block[data-v-d1c3506a]{margin-top:4px;display:flex;flex-direction:column;gap:8px}.file-input[data-v-d1c3506a]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.dropzone[data-v-d1c3506a]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:18px 12px;text-align:center;border:1px dashed var(--border);border-radius:8px;color:var(--fg-dim);font-size:11px;line-height:1.4;transition:border-color .12s,background .12s,color .12s}.dropzone-icon[data-v-d1c3506a]{color:var(--neutral)}.dropzone.over[data-v-d1c3506a]{border-color:var(--accent);color:var(--fg);background:#58a6ff14}.dropzone.over .dropzone-icon[data-v-d1c3506a]{color:var(--accent)}.btn.import[data-v-d1c3506a]{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%}.btn.import svg[data-v-d1c3506a]{display:block}.btn.import[data-v-d1c3506a]:hover{background:#8b949e1a}.btn.sm[data-v-d1c3506a]{display:inline-flex;align-items:center;gap:5px;padding:6px 11px;font-size:12px}.btn.sm svg[data-v-d1c3506a]{display:block}.seg[data-v-d1c3506a]{display:flex;background:var(--bg);border:1px solid var(--border);border-radius:7px;padding:3px;gap:3px}.seg button[data-v-d1c3506a]{flex:1;background:transparent;border:none;color:var(--fg-dim);font-size:12px;padding:6px 0;border-radius:5px;cursor:pointer;transition:all .12s}.seg button.on[data-v-d1c3506a]{background:var(--accent);color:#04101f;font-weight:600}.drawer-foot[data-v-d1c3506a]{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid var(--border)}.btn[data-v-d1c3506a]{font-size:12px;padding:8px 14px;border-radius:7px;cursor:pointer;border:1px solid var(--border);background:transparent;color:var(--fg);transition:all .12s}.btn.ghost[data-v-d1c3506a]:hover{background:#8b949e1a}.btn.primary[data-v-d1c3506a]{background:var(--accent);color:#04101f;border-color:var(--accent);font-weight:600}.btn.primary[data-v-d1c3506a]:hover:not(:disabled){filter:brightness(1.1)}.btn.primary[data-v-d1c3506a]:disabled{opacity:.4;cursor:default}.drawer-enter-active[data-v-d1c3506a],.drawer-leave-active[data-v-d1c3506a]{transition:transform .18s ease,opacity .18s ease}.drawer-enter-from[data-v-d1c3506a],.drawer-leave-to[data-v-d1c3506a]{transform:translate(24px);opacity:0}.config-section-title[data-v-d1c3506a]{margin:4px 0 2px;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--fg-dim)}.config-entry-list[data-v-d1c3506a]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.config-entry[data-v-d1c3506a]{background:var(--bg);border:1px solid var(--border);border-radius:8px}.config-entry-label[data-v-d1c3506a]{display:flex;align-items:center;gap:10px;padding:9px 10px;cursor:pointer}.config-entry-main[data-v-d1c3506a]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.config-entry-alias[data-v-d1c3506a]{font-size:13px;font-weight:600;color:var(--fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.config-entry-sub[data-v-d1c3506a]{font-size:11px;color:var(--fg-dim);font-family:var(--font-mono-strict);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.config-entry-badges[data-v-d1c3506a]{flex:none;display:flex;flex-direction:column;align-items:flex-end;gap:4px}.proxy-badge[data-v-d1c3506a]{flex:none;font-size:10px;color:var(--fg-dim);background:#8b949e1f;border:1px solid rgba(139,148,158,.3);padding:3px 8px;border-radius:999px;max-width:150px;line-height:1.3;text-align:right}.proxy-badge.blocked[data-v-d1c3506a]{color:var(--warn, #d29922);background:#d299221f;border-color:#d299224d}.overwrite-badge[data-v-d1c3506a]{flex:none;font-size:10px;color:var(--fg-dim);background:#8b949e29;border:1px solid var(--border);padding:3px 8px;border-radius:999px;line-height:1.3;white-space:nowrap}.config-skipped[data-v-d1c3506a]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}.skip-row[data-v-d1c3506a]{display:flex;align-items:baseline;gap:8px;padding:6px 10px;background:#8b949e14;border-radius:6px}.skip-alias[data-v-d1c3506a]{font-size:12px;font-weight:600;color:var(--fg);flex:none}.skip-reason[data-v-d1c3506a]{font-size:11px;color:var(--fg-dim)}.config-note[data-v-d1c3506a]{margin:6px 0 0;font-size:11px;color:var(--fg-dim);line-height:1.5}.config-foot[data-v-d1c3506a]{flex-direction:column;align-items:stretch;gap:8px}.foot-actions[data-v-d1c3506a]{display:flex;justify-content:flex-end;gap:8px}.fwd-section[data-v-d1c3506a]{display:flex;flex-direction:column;gap:8px;padding-top:12px;border-top:1px solid var(--border)}.fwd-section-head[data-v-d1c3506a]{display:flex;align-items:center;justify-content:space-between;gap:8px}.fwd-section-head .fl[data-v-d1c3506a]{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}.fwd-rule[data-v-d1c3506a]{display:flex;flex-direction:column;gap:8px;padding:10px;background:var(--bg);border:1px solid var(--border);border-radius:8px}.fwd-rule-head[data-v-d1c3506a]{display:flex;align-items:center;gap:8px}.fwd-rule-head .seg[data-v-d1c3506a]{flex:1}.seg.sm button[data-v-d1c3506a]{font-size:11px;padding:4px 0}.fwd-warn[data-v-d1c3506a]{margin:0;padding:8px 9px;font-size:11px;line-height:1.5;color:var(--warn, #d29922);background:#d299221a;border:1px solid rgba(210,153,34,.32);border-radius:6px}.fwd-host[data-v-d1c3506a]{margin-bottom:16px}.fwd-host-head[data-v-d1c3506a]{display:flex;align-items:baseline;gap:8px;margin-bottom:6px}.fwd-host-name[data-v-d1c3506a]{font-size:13px;font-weight:600;color:var(--fg)}.fwd-host-sub[data-v-d1c3506a]{font-size:11px;color:var(--fg-dim);font-family:var(--font-mono-strict)}.fwd-proxy-reason[data-v-d1c3506a]{margin:0 0 8px;font-size:11px;line-height:1.5;color:var(--warn, #d29922)}.fwd-card[data-v-d1c3506a]{align-items:flex-start}.fwd-card-side[data-v-d1c3506a]{flex:none;display:flex;flex-direction:column;align-items:flex-end;gap:6px}.fwd-card .card-label[data-v-d1c3506a]{display:flex;align-items:baseline;gap:6px}.fwd-route[data-v-d1c3506a]{white-space:normal;overflow:visible;word-break:break-all}.fwd-kind[data-v-d1c3506a]{font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--accent)}.fwd-note[data-v-d1c3506a]{font-size:12px;color:var(--fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.fwd-row-conns[data-v-d1c3506a]{margin-top:2px;font-size:10px;color:var(--fg-dim)}.fwd-row-error[data-v-d1c3506a]{margin:5px 0 0;font-size:11px;line-height:1.5;color:var(--bad)}.fwd-state[data-v-d1c3506a]{flex:none;font-size:10px;padding:3px 9px;border-radius:999px;border:1px solid var(--border);color:var(--fg-dim);background:#8b949e24}.fwd-state.running[data-v-d1c3506a]{color:var(--good, #3fb950);border-color:#3fb95059;background:#3fb9501f}.fwd-state.stopped[data-v-d1c3506a]{color:var(--bad);border-color:#f8514959;background:#f851491f}.pem-label[data-v-d1c3506a]{display:flex;align-items:center;justify-content:space-between;gap:8px}.pem-tools[data-v-d1c3506a]{display:flex;gap:4px}.backdrop[data-v-380786e4]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:110}.dialog[data-v-380786e4]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:460px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:12px}.dialog h2[data-v-380786e4]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.dialog p[data-v-380786e4]{margin:0;font-size:13px;color:var(--fg);line-height:1.5}.dialog ul[data-v-380786e4]{margin:0;padding-left:18px;font-size:13px;color:var(--fg);line-height:1.6}.dialog .dim[data-v-380786e4]{color:var(--fg-dim);font-size:12px}.dialog .warn[data-v-380786e4]{color:#d29922;font-size:12px}.row[data-v-380786e4]{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}.primary[data-v-380786e4]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.primary[data-v-380786e4]:hover{background:#79b8ff;border-color:#79b8ff;color:#0d1117}.primary.danger[data-v-380786e4]{background:var(--bad);color:#0d1117;border-color:var(--bad)}.primary.danger[data-v-380786e4]:hover{background:#ff6f6a;border-color:#ff6f6a;color:#0d1117}.startup-fatal[data-v-ad8304f2]{flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;padding:24px;background:#0d1117}.startup-fatal-panel[data-v-ad8304f2]{width:min(680px,100%);display:flex;flex-direction:column;gap:14px;color:var(--fg)}.startup-fatal-panel h1[data-v-ad8304f2]{margin:0;font-size:20px;font-weight:650}.startup-fatal-panel p[data-v-ad8304f2]{margin:0;color:var(--fg-dim);line-height:1.5}.startup-fatal-panel pre[data-v-ad8304f2]{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;padding:12px;border:1px solid #30363d;border-radius:6px;background:#161b22;color:#ffb3b3;font-size:12px;line-height:1.45}.startup-fatal-log[data-v-ad8304f2]{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:8px;align-items:baseline;color:var(--fg-dim);font-size:12px}.startup-fatal-log code[data-v-ad8304f2]{min-width:0;overflow-wrap:anywhere;color:var(--fg)}.startup-fatal-actions[data-v-ad8304f2]{display:flex;gap:8px;flex-wrap:wrap}.startup-fatal-actions button[data-v-ad8304f2]{height:30px;padding:0 12px;border:1px solid #30363d;border-radius:6px;background:#21262d;color:var(--fg);cursor:pointer}.startup-fatal-actions button[data-v-ad8304f2]:hover{background:#30363d}.startup-fatal-actions button.danger[data-v-ad8304f2]{border-color:#8b2e2e;color:#ffb3b3}.startup-fatal-copy-status[data-v-ad8304f2]{margin:0;color:var(--fg-dim);font-size:12px}.backdrop[data-v-e95fa892]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:111}.dialog[data-v-e95fa892]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:430px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:12px}.dialog h2[data-v-e95fa892]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.dialog p[data-v-e95fa892]{margin:0;font-size:13px;color:var(--fg);line-height:1.5}.dialog ul[data-v-e95fa892]{margin:0;padding-left:18px;font-size:13px;color:var(--fg);line-height:1.6}.row[data-v-e95fa892]{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}.primary[data-v-e95fa892]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.primary.danger[data-v-e95fa892]{background:var(--bad);color:#0d1117;border-color:var(--bad)}.primary.danger[data-v-e95fa892]:hover{background:#ff6f6a;border-color:#ff6f6a;color:#0d1117}.recovery-dialog-backdrop[data-v-4735cb7a]{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000073;display:flex;align-items:center;justify-content:center;z-index:200}.recovery-dialog[data-v-4735cb7a]{background:var(--bg, #0d1117);color:var(--fg, #d1d5db);border-radius:8px;min-width:480px;max-width:720px;max-height:80vh;overflow:hidden;display:flex;flex-direction:column}.recovery-dialog header[data-v-4735cb7a]{padding:16px 20px 0}.recovery-dialog h2[data-v-4735cb7a]{font-size:1.1rem;margin:0}.subtitle[data-v-4735cb7a]{font-size:.85rem;opacity:.7;margin:4px 0 12px}.tab-list[data-v-4735cb7a]{list-style:none;padding:0 20px;margin:0;overflow:auto}.tab-row[data-v-4735cb7a]{display:flex;align-items:center;gap:8px;padding:6px 0;cursor:default}.caret[data-v-4735cb7a]{background:transparent;border:0;color:inherit;cursor:pointer;padding:0 4px}.tab-title[data-v-4735cb7a]{flex:1}.tab-meta[data-v-4735cb7a]{opacity:.6;font-size:.8rem}.pane-list[data-v-4735cb7a]{list-style:none;padding-left:36px;margin:4px 0 8px;font-size:.85rem}.pane-list li[data-v-4735cb7a]{display:flex;gap:8px;padding:2px 0}.pane-shell[data-v-4735cb7a]{font-family:monospace}.pane-cwd[data-v-4735cb7a]{opacity:.7;flex:1}.pane-badge[data-v-4735cb7a]{opacity:.85;font-size:.75rem}footer[data-v-4735cb7a]{display:flex;justify-content:flex-end;gap:8px;padding:12px 20px 16px}.btn-primary[data-v-4735cb7a]{background:#2563eb;color:#fff;border:0;padding:6px 12px;border-radius:4px;cursor:pointer}.btn-primary[data-v-4735cb7a]:disabled{opacity:.4;cursor:not-allowed}.btn-secondary[data-v-4735cb7a]{background:transparent;color:inherit;border:1px solid #444;padding:6px 12px;border-radius:4px;cursor:pointer}.startup-update-backdrop[data-v-cb1e98fb]{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000073;display:flex;align-items:center;justify-content:center;z-index:210}.startup-update-dialog[data-v-cb1e98fb]{background:var(--bg, #0d1117);color:var(--fg, #d1d5db);border-radius:8px;min-width:420px;max-width:640px;max-height:80vh;overflow:hidden;display:flex;flex-direction:column;padding:16px 20px;gap:12px}.startup-update-dialog header[data-v-cb1e98fb]{display:flex;flex-direction:column;gap:4px}.startup-update-dialog h2[data-v-cb1e98fb]{font-size:1.1rem;margin:0}.subtitle[data-v-cb1e98fb]{font-size:.85rem;opacity:.7;margin:0;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.status[data-v-cb1e98fb]{font-size:.85rem;margin:0}.notes[data-v-cb1e98fb]{font-size:12px}.notes summary[data-v-cb1e98fb]{opacity:.7;cursor:pointer}.notes pre[data-v-cb1e98fb]{background:var(--bg);border:1px solid var(--border, #444);padding:8px;border-radius:6px;white-space:pre-wrap;word-break:break-word;max-height:160px;overflow-y:auto;font-size:11px;margin:6px 0 0}footer[data-v-cb1e98fb]{display:flex;justify-content:flex-end;gap:8px}.btn-primary[data-v-cb1e98fb]{background:var(--accent, #2563eb);color:#0d1117;border:0;padding:6px 12px;border-radius:4px;cursor:pointer;font-weight:600}.btn-primary.danger[data-v-cb1e98fb]{background:var(--bad, #ef4444)}.btn-primary[data-v-cb1e98fb]:disabled{opacity:.5;cursor:default}.btn-secondary[data-v-cb1e98fb]{background:transparent;color:inherit;border:1px solid var(--border, #444);padding:6px 12px;border-radius:4px;cursor:pointer}.hints-backdrop[data-v-f52d16ed]{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:200;pointer-events:none}.hints-panel[data-v-f52d16ed]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:480px;max-width:calc(100vw - 32px);max-height:calc(100vh - 32px);overflow-y:auto;color:var(--fg);pointer-events:auto}.hints-header[data-v-f52d16ed]{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--fg-dim);margin-bottom:12px}.hints-group[data-v-f52d16ed]{margin-bottom:14px}.hints-group[data-v-f52d16ed]:last-child{margin-bottom:0}.hints-group h3[data-v-f52d16ed]{margin:0 0 6px;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--fg-dim)}.hint-row[data-v-f52d16ed]{display:grid;grid-template-columns:120px 1fr;gap:12px;padding:3px 0;font-size:12px}.hint-row.disabled[data-v-f52d16ed]{color:var(--fg-dim)}.chord[data-v-f52d16ed]{font-family:SF Mono,Menlo,monospace;text-align:right}.label[data-v-f52d16ed]{color:inherit}.fade-enter-active[data-v-f52d16ed],.fade-leave-active[data-v-f52d16ed]{transition:opacity .1s ease}.fade-enter-from[data-v-f52d16ed],.fade-leave-to[data-v-f52d16ed]{opacity:0}.paste-preview-host[data-v-6eda1305]{position:fixed;top:88px;right:.75rem;z-index:50;display:flex;flex-direction:column;gap:8px;pointer-events:none}.paste-toast[data-v-6eda1305]{pointer-events:auto;width:200px;padding:8px;background:var(--bg, #1f2024);color:var(--fg, #e6e6e6);border:1px solid var(--border, #3a3b40);border-radius:6px;box-shadow:0 4px 14px #00000059;display:flex;flex-direction:column;gap:4px;position:relative}.paste-toast-thumb[data-v-6eda1305]{width:100%;max-height:120px;object-fit:contain;cursor:zoom-in;border-radius:4px;background:#000}.paste-toast-name[data-v-6eda1305]{font-size:12px;opacity:.8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.paste-toast-close[data-v-6eda1305]{position:absolute;top:4px;right:6px;background:transparent;border:none;color:inherit;font-size:16px;line-height:1;cursor:pointer;opacity:.7}.paste-toast-close[data-v-6eda1305]:hover{opacity:1}.paste-lightbox[data-v-6eda1305]{position:fixed;top:0;right:0;bottom:0;left:0;background:#000000d9;z-index:100;display:flex;align-items:center;justify-content:center;cursor:zoom-out;pointer-events:auto}.paste-lightbox img[data-v-6eda1305]{max-width:90vw;max-height:90vh;cursor:default}.paste-file-host[data-v-436c1298]{position:fixed;top:88px;right:.75rem;z-index:50;display:flex;flex-direction:column;gap:8px;pointer-events:none}.paste-file-toast[data-v-436c1298]{pointer-events:auto;padding:8px 12px;background:var(--bg, #1f2024);color:var(--fg, #e6e6e6);border:1px solid var(--border, #3a3b40);border-radius:6px;box-shadow:0 4px 14px #00000059;display:flex;align-items:center;gap:6px;font-size:12px;max-width:260px}.paste-file-icon[data-v-436c1298]{opacity:.7}.paste-file-name[data-v-436c1298]{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.paste-file-size[data-v-436c1298]{opacity:.7}.paste-file-close[data-v-436c1298]{margin-left:auto;background:transparent;border:none;color:inherit;font-size:16px;line-height:1;cursor:pointer;opacity:.7}.paste-file-close[data-v-436c1298]:hover{opacity:1}.plugin-host[data-v-db2df210]{display:contents}.plugin-host.slot-right-panel[data-v-db2df210]{display:flex;flex-direction:column;height:100%}.plugin-host.slot-bottom-toolbar[data-v-db2df210]{display:flex;flex-direction:row;align-items:center;min-height:0}.translate-panel[data-v-be75a3d1]{position:fixed;width:480px;max-height:70vh;overflow:auto;background:var(--ed-tab-bg, #21262d);border:1px solid var(--ed-border, #2d333b);border-radius:6px;box-shadow:0 8px 24px #00000080;color:var(--ed-row-fg, #c9d1d9);z-index:9999;display:flex;flex-direction:column}.translate-panel__handle[data-v-be75a3d1]{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;cursor:grab;background:var(--ed-row-hover, #30363d);border-bottom:1px solid var(--ed-border, #2d333b);-webkit-user-select:none;user-select:none}.translate-panel__title[data-v-be75a3d1]{font-weight:600;font-size:13px}.translate-panel__close[data-v-be75a3d1]{background:transparent;border:none;color:inherit;font-size:18px;cursor:pointer;padding:0 4px}.translate-panel__label[data-v-be75a3d1]{font-size:11px;opacity:.7;text-transform:uppercase;letter-spacing:.04em;padding:6px 12px 0}.translate-panel__detected[data-v-be75a3d1]{text-transform:none;opacity:.6}.translate-panel__pre[data-v-be75a3d1]{margin:4px 12px 8px;padding:6px;background:#00000040;border-radius:4px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;max-height:200px;overflow:auto;white-space:pre-wrap}.translate-panel__target-row[data-v-be75a3d1]{display:flex;align-items:center;gap:8px;padding:8px 12px;border-top:1px solid var(--ed-border, #2d333b)}.translate-panel__target-select[data-v-be75a3d1]{flex:1}.translate-panel__result[data-v-be75a3d1]{padding:12px;border-top:1px solid var(--ed-border, #2d333b);min-height:60px}.translate-panel__loading[data-v-be75a3d1]{opacity:.7}.translate-panel__error[data-v-be75a3d1]{color:#f87171;font-size:12px;display:flex;flex-direction:column;gap:6px}.translate-panel__text[data-v-be75a3d1]{font-size:13px;max-height:240px;overflow:auto;white-space:pre-wrap}.translate-panel__placeholder[data-v-be75a3d1]{opacity:.5;font-size:12px}.translate-panel__history[data-v-be75a3d1]{padding:8px 12px;border-top:1px solid var(--ed-border, #2d333b);font-size:12px}.translate-panel__history summary[data-v-be75a3d1]{cursor:pointer;opacity:.8}.translate-panel__history ul[data-v-be75a3d1]{list-style:none;margin:6px 0 0;padding:0}.translate-panel__history-row[data-v-be75a3d1]{display:block;width:100%;text-align:left;background:transparent;border:none;color:inherit;cursor:pointer;padding:4px 0;font-size:11px}.translate-panel__history-row[data-v-be75a3d1]:hover{opacity:.85}.translate-panel__history-source[data-v-be75a3d1]{opacity:.7}.translate-panel__history-arrow[data-v-be75a3d1]{margin:0 6px;opacity:.5}.fe-theme-dimmed{--ed-shell-bg: #22272e;--ed-tree-bg: #2d333b;--ed-tree-header-bg: #22272e;--ed-tree-header-fg: rgba(173, 186, 199, .7);--ed-row-fg: #adbac7;--ed-row-hover: #373e47;--ed-row-selected: #444c56;--ed-folder: #d4a14a;--ed-chevron: rgba(173, 186, 199, .7);--ed-indent-guide: rgba(173, 186, 199, .1);--ed-tab-bg: #2d333b;--ed-tab-fg: #768390;--ed-tab-hover-fg: #adbac7;--ed-tab-active-bg: #22272e;--ed-tab-active-fg: #cdd9e5;--ed-tab-active-bar: #539bf5;--ed-border: #444c56;--ed-editor-bg: #22272e;--ed-editor-fg: #adbac7;--ed-gutter-bg: #22272e;--ed-gutter-fg: #545d68;--ed-muted: rgba(173, 186, 199, .6);--ed-error: #f47067}.fe-theme-light{--ed-shell-bg: #ffffff;--ed-tree-bg: #f6f8fa;--ed-tree-header-bg: #eef0f4;--ed-tree-header-fg: rgba(36, 41, 47, .7);--ed-row-fg: #24292f;--ed-row-hover: rgba(36, 41, 47, .06);--ed-row-selected: rgba(0, 92, 197, .13);--ed-folder: #54aeff;--ed-chevron: rgba(36, 41, 47, .55);--ed-indent-guide: rgba(36, 41, 47, .08);--ed-tab-bg: #eef0f4;--ed-tab-fg: #57606a;--ed-tab-hover-fg: #24292f;--ed-tab-active-bg: #ffffff;--ed-tab-active-fg: #24292f;--ed-tab-active-bar: #fd8c73;--ed-border: #d0d7de;--ed-editor-bg: #ffffff;--ed-editor-fg: #24292f;--ed-gutter-bg: #f6f8fa;--ed-gutter-fg: #6e7781;--ed-muted: rgba(36, 41, 47, .6);--ed-error: #cf222e}.app[data-v-d9036ca9]{display:flex;flex-direction:column;height:100vh}.app.is-maximized[data-v-d9036ca9]{padding:8px}.auth-error-banner[data-v-d9036ca9]{display:flex;align-items:center;gap:8px;padding:7px 16px;background:#5a1e1e;border-bottom:1px solid #8b2e2e;color:#ffb3b3;font-size:12px;flex:0 0 auto}.auth-error-msg[data-v-d9036ca9]{flex:1 1 auto}.auth-error-action[data-v-d9036ca9]{flex:0 0 auto;border:1px solid #8b2e2e;background:transparent;color:#ffb3b3;border-radius:4px;padding:2px 8px;font-size:12px;cursor:pointer}.auth-error-action[data-v-d9036ca9]:hover{background:#ffb3b31a}.auth-error-dismiss[data-v-d9036ca9]{flex:0 0 auto;border:none;background:transparent;color:#ffb3b3;font-size:16px;line-height:1;cursor:pointer;padding:0 4px}.auth-error-dismiss[data-v-d9036ca9]:hover{color:#fff}.main-row[data-v-d9036ca9]{display:flex;flex:1 1 auto;min-height:0}.main[data-v-d9036ca9]{flex:1 1 auto;display:flex;flex-direction:column;position:relative;background:#000;overflow:hidden;min-width:0}.right-resizer[data-v-d9036ca9]{width:4px;cursor:col-resize;background:transparent;flex:0 0 4px}.right-resizer[data-v-d9036ca9]:hover{background:var(--ed-border, #2d333b)}.panel-toggle[data-v-d9036ca9]{background:var(--ed-tab-bg, #21262d);border:1px solid var(--ed-border, #2d333b);color:var(--ed-row-fg, #c9d1d9);cursor:pointer;padding:0 4px;font-size:11px;align-self:stretch;flex:0 0 auto}.panel-toggle[data-v-d9036ca9]:hover{background:var(--ed-row-hover, #30363d);color:var(--ed-tab-hover-fg, #ffffff)}.right-panel[data-v-d9036ca9]:empty{display:none}.right-panel[data-v-d9036ca9]{border-left:1px solid var(--ed-border, #2d333b);overflow:hidden}.bottom-toolbar[data-v-d9036ca9]:empty{display:none}.bottom-toolbar[data-v-d9036ca9]{flex:0 0 24px;height:24px;background:var(--ed-tab-bg, var(--terminal-bg));border-top:1px solid var(--ed-border, rgba(255, 255, 255, .08))}.empty[data-v-d9036ca9]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;color:var(--fg-dim);font-size:13px}.toast[data-v-d9036ca9]{position:absolute;bottom:36px;left:50%;transform:translate(-50%);background:#0d1117eb;border:1px solid var(--border);color:var(--fg);padding:6px 12px;border-radius:6px;font-size:12px;pointer-events:none}@media (max-width: 767px){.app[data-v-d9036ca9]{height:100dvh;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);background:var(--bg);overflow:hidden}.main-row[data-v-d9036ca9],.main[data-v-d9036ca9]{min-width:0}.auth-error-banner[data-v-d9036ca9]{padding:7px 10px;gap:6px}.auth-error-action[data-v-d9036ca9]{padding:2px 6px}.toast[data-v-d9036ca9]{bottom:calc(12px + env(safe-area-inset-bottom));max-width:calc(100vw - 24px);text-align:center}}/** + * Copyright (c) 2014 The xterm.js authors. All rights reserved. + * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) + * https://github.com/chjj/term.js + * @license MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Originally forked from (with the author's permission): + * Fabrice Bellard's javascript vt100 for jslinux: + * http://bellard.org/jslinux/ + * Copyright (c) 2011 Fabrice Bellard + * The original design remains. The terminal itself + * has been extended to include xterm CSI codes, among + * other features. + */.xterm{cursor:text;position:relative;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 .xterm-scroll-area{visibility:hidden}.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,.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.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{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{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}:root{--bg: #0d1117;--panel: #161b22;--border: #30363d;--fg: #c9d1d9;--fg-dim: #8b949e;--accent: #58a6ff;--good: #3fb950;--bad: #f85149;--warn: #d29922;--neutral: #6e7681;--terminal-bg: #000000;--terminal-grid: #11161d;--terminal-overlay: rgba(13, 17, 23, .85);--font-sans: "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;--font-mono: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", ui-monospace, Menlo, Consolas, "Roboto Mono", monospace;--font-mono-strict: ui-monospace, Menlo, Consolas, "Roboto Mono", monospace}*{box-sizing:border-box}html,body{margin:0;padding:0;height:100%;background:var(--bg);color:var(--fg);font-family:var(--font-sans);font-size:14px}#app{height:100%}@supports (height: 100dvh){html,body,#app{height:100dvh}}.xterm-viewport::-webkit-scrollbar{width:10px;height:10px}.xterm-viewport::-webkit-scrollbar-track{background:transparent}.xterm-viewport::-webkit-scrollbar-thumb{background:#ffffff1a;border-radius:5px;border:2px solid transparent;background-clip:padding-box}.xterm-viewport::-webkit-scrollbar-thumb:hover{background:#ffffff40;background-clip:padding-box}.xterm-viewport::-webkit-scrollbar-corner{background:transparent}button,input,select{font:inherit;color:var(--fg)}button{background:transparent;border:1px solid var(--border);border-radius:6px;padding:6px 12px;cursor:pointer;transition:border-color .12s,color .12s}button:hover{border-color:var(--accent);color:var(--accent)}button.primary{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}button.primary:hover{background:#79b8ff;border-color:#79b8ff;color:#0d1117}input,select{background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:6px 10px}input:focus,select:focus{outline:none;border-color:var(--accent)}.settings-field-grid{display:grid;gap:14px 12px;min-width:0}.settings-field-grid--two{grid-template-columns:repeat(2,minmax(0,1fr))}.settings-field-grid--compact{grid-template-columns:minmax(72px,.65fr) minmax(72px,.65fr) minmax(90px,.85fr) minmax(170px,1.6fr)}.settings-field{display:flex;flex-direction:column;gap:6px;min-width:0}.settings-field--full{grid-column:1 / -1}.settings-field>input,.settings-field>.select-dropdown,.settings-field>.password-field{min-width:0;width:100%}@media (max-width: 640px){.settings-field-grid--two,.settings-field-grid--compact{grid-template-columns:minmax(0,1fr)}.settings-field--full{grid-column:auto}} diff --git a/internal/relay/web-dist/assets/index-Di5PmtZ2.js b/internal/relay/web-dist/assets/index-CehbsLvs.js similarity index 98% rename from internal/relay/web-dist/assets/index-Di5PmtZ2.js rename to internal/relay/web-dist/assets/index-CehbsLvs.js index 43d1b846..7822ce19 100644 --- a/internal/relay/web-dist/assets/index-Di5PmtZ2.js +++ b/internal/relay/web-dist/assets/index-CehbsLvs.js @@ -1,4 +1,4 @@ -import{L as s,E as R,a as Y,C as x}from"./index-DRFRE0Ca.js";import{J as w,Q as O,g as d,L as k,z as h,v as f,r as l,u,x as y,w as g,O as j,j as U,I as G}from"./FileExplorer-BumK3wPT.js";import{i as b,c as Z,s as X}from"./index-DblmzGAc.js";import"./useI18n-lwZlSdSx.js";import"./index-Ci2MtInW.js";import"./prefsSync-C5tz9Q-s.js";import"./client-DMh7GjbV.js";import"./Switch-DguIL3dU.js";import"./auth-B3RxKR1W.js";const _=177,q=179,E=184,v=12,C=13,D=17,z=20,F=25,B=53,N=95,I=142,L=144,A=145,J=148,M=10,H=13,K=32,OO=9,$=47,QO=41,eO=125,aO=new R((Q,e)=>{for(let n=0,a=Q.next;(e.context&&(a<0||a==M||a==H||a==$&&Q.peek(n+1)==$)||a==QO||a==eO)&&Q.acceptToken(_),!(a!=K&&a!=OO);)a=Q.peek(++n)},{contextual:!0});let tO=new Set([N,E,z,v,D,L,A,I,J,C,B,F]);const iO=new x({start:!1,shift:(Q,e)=>e==q?Q:tO.has(e)}),XO=w({"func interface struct chan map const type var":O.definitionKeyword,"import package":O.moduleKeyword,"switch for go select return break continue goto fallthrough case if else defer":O.controlKeyword,range:O.keyword,Bool:O.bool,String:O.string,Rune:O.character,Number:O.number,Nil:O.null,VariableName:O.variableName,DefName:O.definition(O.variableName),TypeName:O.typeName,LabelName:O.labelName,FieldName:O.propertyName,"FunctionDecl/DefName":O.function(O.definition(O.variableName)),"TypeSpec/DefName":O.definition(O.typeName),"CallExpr/VariableName":O.function(O.variableName),LineComment:O.lineComment,BlockComment:O.blockComment,LogicOp:O.logicOperator,ArithOp:O.arithmeticOperator,BitOp:O.bitwiseOperator,"DerefOp .":O.derefOperator,"UpdateOp IncDecOp":O.updateOperator,CompareOp:O.compareOperator,"= :=":O.definitionOperator,"<-":O.operator,'~ "*"':O.modifier,"; ,":O.separator,"... :":O.punctuation,"( )":O.paren,"[ ]":O.squareBracket,"{ }":O.brace}),nO={__proto__:null,package:10,import:18,true:380,false:380,nil:383,struct:48,func:68,interface:78,chan:94,map:118,make:157,new:159,const:204,type:212,var:224,if:236,else:238,switch:242,case:248,default:250,for:260,range:266,go:270,select:274,return:284,break:288,continue:290,goto:292,fallthrough:296,defer:300},PO=s.deserialize({version:14,states:"!=xO#{QQOOP$SOQOOO&UQTO'#CbO&]QRO'#FlO]QQOOOOQP'#Cn'#CnOOQP'#Co'#CoO&eQQO'#C|O(kQQO'#C{O)]QRO'#GiO+tQQO'#D_OOQP'#Ge'#GeO+{QQO'#GeO.aQTO'#GaO.hQQO'#D`OOQP'#Gm'#GmO.mQRO'#GdO/hQQO'#DgOOQP'#Gd'#GdO/uQQO'#DrO2bQQO'#DsO4QQTO'#GqO,^QTO'#GaO4XQQO'#DxO4^QQO'#D{OOQO'#EQ'#EQOOQO'#ER'#EROOQO'#ES'#ESOOQO'#ET'#ETO4cQQO'#EPO5}QQO'#EPOOQP'#Ga'#GaO6UQQO'#E`O6^QQO'#EcOOQP'#G`'#G`O6cQQO'#EsOOQP'#G_'#G_O&]QRO'#FnOOQO'#Fn'#FnO9QQQO'#G^QOQQOOO&]QROOO9XQQO'#C`O9^QSO'#CdO9lQQO'#C}O9tQQO'#DSO9yQQO'#D[O:kQQO'#CsO:pQQO'#DhO:uQQO'#EeO:}QQO'#EiO;VQQO'#EoO;_QQO'#EuOPQSO7+%hOOQP7+%h7+%hO4cQQO7+%hOOQP1G0Q1G0QO!>^QQO1G0QOOQP1G0U1G0UO!>fQQO1G0UOF|QQO1G0UOOQO,5nAN>nO4cQQOAN>nO!IsQSOAN>nOOQP<nQQO'#FrOOQO,5vAN>vO!LtQQOAN>vP.hQQO'#F|OOQPG25XG25XO!LyQQOG25bO!MOQQO'#FPOOQPG25bG25bO!MZQQOG25bOOQPLD)tLD)tOOQPG24bG24bO!JqQQOLD*|O!9OQQO'#GQO!McQQO,5;kOOQP,5;k,5;kO?tQQO'#FQO!MnQQO'#FQO!MsQQOLD*|OOQP!$'Nh!$'NhOOQO,5VO^!hOh!POr-TOw}O!P-_O!Q-`O!W-^O!]-eO%O!eO%Y!fO~OZ!sO~O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(Q&OQ(Y&WQ(d&`Q(p&mU)k'e)l*pQ)z'|Q*[(cS*^(i-[Q+P*`R-c-dS#w|!pS$w!j-TQ&T#xQ(R&QQ(W&UR(X&VT%|#u&OhqOScw!U!V#O#k#n&|'Y+gU$Q!R$R&jU$W!T$X&uQ$e!WY%y#u&O'})|*wQ)`']V-S'W)W*kS&[#y&]S*R(S(oR*z*QY&Y#y&](S(o*QR*W(['``OSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&W&]&`&g&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*Q*`*h*k*l*n*o*p*r*w+R+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-dS&_#}&dW(S&S*S*|+^Q(e&bQ(o&lR*x*PS%U!t*`R+q+jR%S!qQ#PcQ(}&|Q)Z'YR+n+ghpOScw!U!V#O#k#n&|'Y+gQ$d!WQ$n!ZQ%g#VU%p#i'T,bU%q#j'U,cQ(j&gQ(u&sQ)Q'PQ)_']Q)y'wQ*_(kQ*a(tV-R'W)W*kT(U&S&l",nodeNames:"⚠ LineComment BlockComment SourceFile PackageClause package DefName ; ImportDecl import ImportSpec . String ) ( SpecList ExprStatement Number Bool Nil Rune VariableName TypedLiteral StructType struct } { StructBody FieldDecl FieldName , PointerType * FunctionType func Parameters Parameter ... InterfaceType interface InterfaceBody MethodElem UnderlyingType ~ TypeElem LogicOp ChannelType chan <- ParenthesizedType QualifiedType TypeName ParameterizedType ] [ TypeArgs ArrayType SliceType MapType map LiteralValue Element Key : Element Key ParenthesizedExpr FunctionLiteral Block Conversion SelectorExpr IndexExpr SliceExpr TypeAssertion CallExpr ParameterizedExpr Arguments CallExpr make new Arguments UnaryExp ArithOp LogicOp BitOp DerefOp BinaryExp ArithOp BitOp BitOp CompareOp LogicOp LogicOp SendStatement IncDecStatement IncDecOp Assignment = UpdateOp VarDecl := ConstDecl const ConstSpec SpecList TypeDecl type TypeSpec TypeParams TypeParam SpecList VarDecl var VarSpec SpecList LabeledStatement LabelName IfStatement if else SwitchStatement switch SwitchBlock Case case default TypeSwitchStatement SwitchBlock Case ForStatement for ForClause RangeClause range GoStatement go SelectStatement select SelectBlock Case ReceiveStatement ReturnStatement return GotoStatement break continue goto FallthroughStatement fallthrough DeferStatement defer FunctionDecl MethodDecl",maxTerm:218,context:iO,nodeProps:[["isolate",-3,2,12,20,""],["group",-18,12,17,18,19,20,21,22,66,67,69,70,71,72,73,74,77,81,86,"Expr",-20,16,68,93,94,96,99,101,105,111,115,117,120,126,129,134,136,141,143,147,149,"Statement",-12,23,31,33,38,46,49,50,51,52,56,57,58,"Type"],["openedBy",13,"(",25,"{",53,"["],["closedBy",14,")",26,"}",54,"]"]],propSources:[XO],skippedNodes:[0,1,2,153],repeatNodeCount:23,tokenData:":b~RvXY#iYZ#i]^#ipq#iqr#zrs$Xuv&Pvw&^wx&yxy(qyz(vz{({{|)T|})e}!O)j!O!P)u!P!Q+}!Q!R,y!R![-t![!]2^!]!^2k!^!_2p!_!`3]!`!a3e!c!}3x!}#O4j#P#Q4o#Q#R4t#R#S4|#S#T9X#T#o3x#o#p9q#p#q9v#q#r:W#r#s:]$g;'S3x;'S;=`4d<%lO3x~#nS$y~XY#iYZ#i]^#ipq#iU$PP%hQ!_!`$SS$XO!|S~$^W[~OY$XZr$Xrs$vs#O$X#O#P${#P;'S$X;'S;=`%y<%lO$X~${O[~~%ORO;'S$X;'S;=`%X;=`O$X~%^X[~OY$XZr$Xrs$vs#O$X#O#P${#P;'S$X;'S;=`%y;=`<%l$X<%lO$X~%|P;=`<%l$X~&UP%l~!_!`&X~&^O#U~~&cR%j~vw&l!_!`&X#Q#R&q~&qO%p~~&vP%o~!_!`&X~'O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`$S~3TO!Q~~3YP%m~!_!`&X~3bP#T~!_!`$S~3jQ!|S!_!`$S!`!a3p~3uP%n~!_!`&X~3}V%O~!Q![3x!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~4gP;=`<%l3x~4oO!W~~4tO!V~~4yP%i~!_!`&X~5RV%O~!Q![5h!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~5o^aQ%O~!O!P*`!Q![5h!c!g3x!g!h6k!h!}3x#R#S4|#T#X3x#X#Y6k#Y#]3x#]#^8k#^#o3x$g;'S3x;'S;=`4d<%lO3x~6pX%O~{|+T}!O+T!Q![7]!c!}3x#R#S8P#T#o3x$g;'S3x;'S;=`4d<%lO3x~7dXaQ%O~!Q![7]!c!}3x#R#S8P#T#]3x#]#^8k#^#o3x$g;'S3x;'S;=`4d<%lO3x~8UV%O~!Q![7]!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~8rVaQ%O~!Q![3x!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~9[TO#S9X#S#T$v#T;'S9X;'S;=`9k<%lO9X~9nP;=`<%l9X~9vOj~~9{Q%`~!_!`&X#p#q:R~:WO%q~~:]Oi~~:bO{~",tokenizers:[aO,1,2,new Y("j~RQYZXz{^~^O$|~~aP!P!Qd~iO$}~~",25,181)],topRules:{SourceFile:[0,3]},dynamicPrecedences:{19:1,51:-1,55:2,69:-1,108:-1},specialized:[{term:184,get:Q=>nO[Q]||-1}],tokenPrec:5451}),oO=[X("func ${name}(${params}) ${type} {\n ${}\n}",{label:"func",detail:"declaration",type:"keyword"}),X("func (${receiver}) ${name}(${params}) ${type} {\n ${}\n}",{label:"func",detail:"method declaration",type:"keyword"}),X("var ${name} = ${value}",{label:"var",detail:"declaration",type:"keyword"}),X("type ${name} ${type}",{label:"type",detail:"declaration",type:"keyword"}),X("const ${name} = ${value}",{label:"const",detail:"declaration",type:"keyword"}),X("type ${name} = ${type}",{label:"type",detail:"alias declaration",type:"keyword"}),X("for ${init}; ${test}; ${update} {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),X("for ${i} := range ${value} {\n ${}\n}",{label:"for",detail:"range",type:"keyword"}),X(`select { +import{L as s,E as R,a as Y,C as x}from"./index-Bf0-KgBD.js";import{J as w,Q as O,g as d,L as k,z as h,v as f,r as l,u,x as y,w as g,O as j,j as U,I as G}from"./FileExplorer-BmPzqkbb.js";import{i as b,c as Z,s as X}from"./index-DDP-KCe3.js";import"./useI18n-D4u8zssu.js";import"./index-zrZBIArQ.js";import"./prefsSync-Dj3wNxrO.js";import"./client-n-fLEpOg.js";import"./Switch-BlSJOKEO.js";import"./auth-BBmiA1GG.js";const _=177,q=179,E=184,v=12,C=13,D=17,z=20,F=25,B=53,N=95,I=142,L=144,A=145,J=148,M=10,H=13,K=32,OO=9,$=47,QO=41,eO=125,aO=new R((Q,e)=>{for(let n=0,a=Q.next;(e.context&&(a<0||a==M||a==H||a==$&&Q.peek(n+1)==$)||a==QO||a==eO)&&Q.acceptToken(_),!(a!=K&&a!=OO);)a=Q.peek(++n)},{contextual:!0});let tO=new Set([N,E,z,v,D,L,A,I,J,C,B,F]);const iO=new x({start:!1,shift:(Q,e)=>e==q?Q:tO.has(e)}),XO=w({"func interface struct chan map const type var":O.definitionKeyword,"import package":O.moduleKeyword,"switch for go select return break continue goto fallthrough case if else defer":O.controlKeyword,range:O.keyword,Bool:O.bool,String:O.string,Rune:O.character,Number:O.number,Nil:O.null,VariableName:O.variableName,DefName:O.definition(O.variableName),TypeName:O.typeName,LabelName:O.labelName,FieldName:O.propertyName,"FunctionDecl/DefName":O.function(O.definition(O.variableName)),"TypeSpec/DefName":O.definition(O.typeName),"CallExpr/VariableName":O.function(O.variableName),LineComment:O.lineComment,BlockComment:O.blockComment,LogicOp:O.logicOperator,ArithOp:O.arithmeticOperator,BitOp:O.bitwiseOperator,"DerefOp .":O.derefOperator,"UpdateOp IncDecOp":O.updateOperator,CompareOp:O.compareOperator,"= :=":O.definitionOperator,"<-":O.operator,'~ "*"':O.modifier,"; ,":O.separator,"... :":O.punctuation,"( )":O.paren,"[ ]":O.squareBracket,"{ }":O.brace}),nO={__proto__:null,package:10,import:18,true:380,false:380,nil:383,struct:48,func:68,interface:78,chan:94,map:118,make:157,new:159,const:204,type:212,var:224,if:236,else:238,switch:242,case:248,default:250,for:260,range:266,go:270,select:274,return:284,break:288,continue:290,goto:292,fallthrough:296,defer:300},PO=s.deserialize({version:14,states:"!=xO#{QQOOP$SOQOOO&UQTO'#CbO&]QRO'#FlO]QQOOOOQP'#Cn'#CnOOQP'#Co'#CoO&eQQO'#C|O(kQQO'#C{O)]QRO'#GiO+tQQO'#D_OOQP'#Ge'#GeO+{QQO'#GeO.aQTO'#GaO.hQQO'#D`OOQP'#Gm'#GmO.mQRO'#GdO/hQQO'#DgOOQP'#Gd'#GdO/uQQO'#DrO2bQQO'#DsO4QQTO'#GqO,^QTO'#GaO4XQQO'#DxO4^QQO'#D{OOQO'#EQ'#EQOOQO'#ER'#EROOQO'#ES'#ESOOQO'#ET'#ETO4cQQO'#EPO5}QQO'#EPOOQP'#Ga'#GaO6UQQO'#E`O6^QQO'#EcOOQP'#G`'#G`O6cQQO'#EsOOQP'#G_'#G_O&]QRO'#FnOOQO'#Fn'#FnO9QQQO'#G^QOQQOOO&]QROOO9XQQO'#C`O9^QSO'#CdO9lQQO'#C}O9tQQO'#DSO9yQQO'#D[O:kQQO'#CsO:pQQO'#DhO:uQQO'#EeO:}QQO'#EiO;VQQO'#EoO;_QQO'#EuOPQSO7+%hOOQP7+%h7+%hO4cQQO7+%hOOQP1G0Q1G0QO!>^QQO1G0QOOQP1G0U1G0UO!>fQQO1G0UOF|QQO1G0UOOQO,5nAN>nO4cQQOAN>nO!IsQSOAN>nOOQP<nQQO'#FrOOQO,5vAN>vO!LtQQOAN>vP.hQQO'#F|OOQPG25XG25XO!LyQQOG25bO!MOQQO'#FPOOQPG25bG25bO!MZQQOG25bOOQPLD)tL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,c,{,|,}-O-P-Q-^S!gW-]Q!nYS#{!O-_Q$u!hS%T!t+jS%X!z-UQ%n#e[%o#h#|$x-V-W-XW%w#u'})|*wU&P#v$v,h[&X#y&](S([(o*QQ&f$PQ&h$QQ&n$TQ&r$WS'h%W-YS'i%Y-ZW'l%a(|+R+lS'{%x%yQ(Q&OQ(Y&WQ(d&`Q(p&mU)k'e)l*pQ)z'|Q*[(cS*^(i-[Q+P*`R-c-dS#w|!pS$w!j-TQ&T#xQ(R&QQ(W&UR(X&VT%|#u&OhqOScw!U!V#O#k#n&|'Y+gU$Q!R$R&jU$W!T$X&uQ$e!WY%y#u&O'})|*wQ)`']V-S'W)W*kS&[#y&]S*R(S(oR*z*QY&Y#y&](S(o*QR*W(['``OSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&W&]&`&g&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*Q*`*h*k*l*n*o*p*r*w+R+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-dS&_#}&dW(S&S*S*|+^Q(e&bQ(o&lR*x*PS%U!t*`R+q+jR%S!qQ#PcQ(}&|Q)Z'YR+n+ghpOScw!U!V#O#k#n&|'Y+gQ$d!WQ$n!ZQ%g#VU%p#i'T,bU%q#j'U,cQ(j&gQ(u&sQ)Q'PQ)_']Q)y'wQ*_(kQ*a(tV-R'W)W*kT(U&S&l",nodeNames:"⚠ LineComment BlockComment SourceFile PackageClause package DefName ; ImportDecl import ImportSpec . String ) ( SpecList ExprStatement Number Bool Nil Rune VariableName TypedLiteral StructType struct } { StructBody FieldDecl FieldName , PointerType * FunctionType func Parameters Parameter ... InterfaceType interface InterfaceBody MethodElem UnderlyingType ~ TypeElem LogicOp ChannelType chan <- ParenthesizedType QualifiedType TypeName ParameterizedType ] [ TypeArgs ArrayType SliceType MapType map LiteralValue Element Key : Element Key ParenthesizedExpr FunctionLiteral Block Conversion SelectorExpr IndexExpr SliceExpr TypeAssertion CallExpr ParameterizedExpr Arguments CallExpr make new Arguments UnaryExp ArithOp LogicOp BitOp DerefOp BinaryExp ArithOp BitOp BitOp CompareOp LogicOp LogicOp SendStatement IncDecStatement IncDecOp Assignment = UpdateOp VarDecl := ConstDecl const ConstSpec SpecList TypeDecl type TypeSpec TypeParams TypeParam SpecList VarDecl var VarSpec SpecList LabeledStatement LabelName IfStatement if else SwitchStatement switch SwitchBlock Case case default TypeSwitchStatement SwitchBlock Case ForStatement for ForClause RangeClause range GoStatement go SelectStatement select SelectBlock Case ReceiveStatement ReturnStatement return GotoStatement break continue goto FallthroughStatement fallthrough DeferStatement defer FunctionDecl MethodDecl",maxTerm:218,context:iO,nodeProps:[["isolate",-3,2,12,20,""],["group",-18,12,17,18,19,20,21,22,66,67,69,70,71,72,73,74,77,81,86,"Expr",-20,16,68,93,94,96,99,101,105,111,115,117,120,126,129,134,136,141,143,147,149,"Statement",-12,23,31,33,38,46,49,50,51,52,56,57,58,"Type"],["openedBy",13,"(",25,"{",53,"["],["closedBy",14,")",26,"}",54,"]"]],propSources:[XO],skippedNodes:[0,1,2,153],repeatNodeCount:23,tokenData:":b~RvXY#iYZ#i]^#ipq#iqr#zrs$Xuv&Pvw&^wx&yxy(qyz(vz{({{|)T|})e}!O)j!O!P)u!P!Q+}!Q!R,y!R![-t![!]2^!]!^2k!^!_2p!_!`3]!`!a3e!c!}3x!}#O4j#P#Q4o#Q#R4t#R#S4|#S#T9X#T#o3x#o#p9q#p#q9v#q#r:W#r#s:]$g;'S3x;'S;=`4d<%lO3x~#nS$y~XY#iYZ#i]^#ipq#iU$PP%hQ!_!`$SS$XO!|S~$^W[~OY$XZr$Xrs$vs#O$X#O#P${#P;'S$X;'S;=`%y<%lO$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0k#]#^+r#d#e*tQ1YR!Q![0k!c!i0k#T#Z0kQ1hWaQ!O!P0k!Q![1c!c!i1c!r!s*t#R#S2Q#T#Z1c#]#^+r#d#e*tQ2TR!Q![1c!c!i1c#T#Z1c~2cP!a~!_!`2f~2kO#W~~2pOV~~2uR!|S}!O3O!^!_3T!_!`$S~3TO!Q~~3YP%m~!_!`&X~3bP#T~!_!`$S~3jQ!|S!_!`$S!`!a3p~3uP%n~!_!`&X~3}V%O~!Q![3x!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~4gP;=`<%l3x~4oO!W~~4tO!V~~4yP%i~!_!`&X~5RV%O~!Q![5h!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~5o^aQ%O~!O!P*`!Q![5h!c!g3x!g!h6k!h!}3x#R#S4|#T#X3x#X#Y6k#Y#]3x#]#^8k#^#o3x$g;'S3x;'S;=`4d<%lO3x~6pX%O~{|+T}!O+T!Q![7]!c!}3x#R#S8P#T#o3x$g;'S3x;'S;=`4d<%lO3x~7dXaQ%O~!Q![7]!c!}3x#R#S8P#T#]3x#]#^8k#^#o3x$g;'S3x;'S;=`4d<%lO3x~8UV%O~!Q![7]!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~8rVaQ%O~!Q![3x!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~9[TO#S9X#S#T$v#T;'S9X;'S;=`9k<%lO9X~9nP;=`<%l9X~9vOj~~9{Q%`~!_!`&X#p#q:R~:WO%q~~:]Oi~~:bO{~",tokenizers:[aO,1,2,new Y("j~RQYZXz{^~^O$|~~aP!P!Qd~iO$}~~",25,181)],topRules:{SourceFile:[0,3]},dynamicPrecedences:{19:1,51:-1,55:2,69:-1,108:-1},specialized:[{term:184,get:Q=>nO[Q]||-1}],tokenPrec:5451}),oO=[X("func ${name}(${params}) ${type} {\n ${}\n}",{label:"func",detail:"declaration",type:"keyword"}),X("func (${receiver}) ${name}(${params}) ${type} {\n ${}\n}",{label:"func",detail:"method declaration",type:"keyword"}),X("var ${name} = ${value}",{label:"var",detail:"declaration",type:"keyword"}),X("type ${name} ${type}",{label:"type",detail:"declaration",type:"keyword"}),X("const ${name} = ${value}",{label:"const",detail:"declaration",type:"keyword"}),X("type ${name} = ${type}",{label:"type",detail:"alias declaration",type:"keyword"}),X("for ${init}; ${test}; ${update} {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),X("for ${i} := range ${value} {\n ${}\n}",{label:"for",detail:"range",type:"keyword"}),X(`select { \${} }`,{label:"select",detail:"statement",type:"keyword"}),X("case ${}:\n${}",{label:"case",type:"keyword"}),X("switch ${} {\n ${}\n}",{label:"switch",detail:"statement",type:"keyword"}),X("switch ${}.(${type}) {\n ${}\n}",{label:"switch",detail:"type statement",type:"keyword"}),X("if ${} {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),X(`if \${} { \${} diff --git a/internal/relay/web-dist/assets/index-BKUnbiGw.js b/internal/relay/web-dist/assets/index-ChT88caY.js similarity index 99% rename from internal/relay/web-dist/assets/index-BKUnbiGw.js rename to internal/relay/web-dist/assets/index-ChT88caY.js index e83e84b7..271d28c1 100644 --- a/internal/relay/web-dist/assets/index-BKUnbiGw.js +++ b/internal/relay/web-dist/assets/index-ChT88caY.js @@ -1,3 +1,3 @@ -import{L as D,E as h,C as L}from"./index-DRFRE0Ca.js";import{J as H,Q as n,g as B,L as K,z as M,u as f,x as OO,w as eO,O as iO,j as aO,I as nO}from"./FileExplorer-BumK3wPT.js";import{i as rO,c as QO,s as d}from"./index-DblmzGAc.js";import"./useI18n-lwZlSdSx.js";import"./index-Ci2MtInW.js";import"./prefsSync-C5tz9Q-s.js";import"./client-DMh7GjbV.js";import"./Switch-DguIL3dU.js";import"./auth-B3RxKR1W.js";const tO=1,Z=194,j=195,oO=196,x=197,dO=198,sO=199,lO=200,TO=2,E=3,u=201,SO=24,pO=25,qO=49,gO=50,mO=55,PO=56,$O=57,hO=59,cO=60,fO=61,XO=62,yO=63,zO=65,WO=238,vO=71,RO=241,kO=242,_O=243,xO=244,uO=245,UO=246,bO=247,VO=248,Y=72,GO=249,wO=250,ZO=251,jO=252,EO=253,YO=254,FO=255,CO=256,JO=73,AO=77,IO=263,NO=112,DO=130,LO=151,HO=152,BO=155,p=10,q=13,k=32,c=9,_=35,KO=40,MO=46,R=123,U=125,F=39,C=34,b=92,Oe=111,ee=120,ie=78,ae=117,ne=85,re=new Set([pO,qO,gO,IO,zO,DO,PO,$O,WO,XO,yO,Y,JO,AO,cO,fO,LO,HO,BO,NO]);function X(O){return O==p||O==q}function y(O){return O>=48&&O<=57||O>=65&&O<=70||O>=97&&O<=102}const Qe=new h((O,e)=>{let i;if(O.next<0)O.acceptToken(sO);else if(e.context.flags&P)X(O.next)&&O.acceptToken(dO,1);else if(((i=O.peek(-1))<0||X(i))&&e.canShift(x)){let a=0;for(;O.next==k||O.next==c;)O.advance(),a++;(O.next==p||O.next==q||O.next==_)&&O.acceptToken(x,-a)}else X(O.next)&&O.acceptToken(oO,1)},{contextual:!0}),te=new h((O,e)=>{let i=e.context;if(i.flags)return;let a=O.peek(-1);if(a==p||a==q){let r=0,Q=0;for(;;){if(O.next==k)r++;else if(O.next==c)r+=8-r%8;else break;O.advance(),Q++}r!=i.indent&&O.next!=p&&O.next!=q&&O.next!=_&&(r[O,e|J])),se=new L({start:oe,reduce(O,e,i,a){return O.flags&P&&re.has(e)||(e==vO||e==Y)&&O.flags&J?O.parent:O},shift(O,e,i,a){return e==Z?new $(O,de(a.read(a.pos,i.pos)),0):e==j?O.parent:e==SO||e==mO||e==hO||e==E?new $(O,0,P):V.has(e)?new $(O,0,V.get(e)|O.flags&P):O},hash(O){return O.hash}}),le=new h(O=>{for(let e=0;e<5;e++){if(O.next!="print".charCodeAt(e))return;O.advance()}if(!/\w/.test(String.fromCharCode(O.next)))for(let e=0;;e++){let i=O.peek(e);if(!(i==k||i==c)){i!=KO&&i!=MO&&i!=p&&i!=q&&i!=_&&O.acceptToken(tO);return}}}),Te=new h((O,e)=>{let{flags:i}=e.context,a=i&s?C:F,r=(i&l)>0,Q=!(i&T),t=(i&S)>0,o=O.pos;for(;!(O.next<0);)if(t&&O.next==R)if(O.peek(1)==R)O.advance(2);else{if(O.pos==o){O.acceptToken(E,1);return}break}else if(Q&&O.next==b){if(O.pos==o){O.advance();let g=O.next;g>=0&&(O.advance(),Se(O,g)),O.acceptToken(TO);return}break}else if(O.next==b&&!Q&&O.peek(1)>-1)O.advance(2);else if(O.next==a&&(!r||O.peek(1)==a&&O.peek(2)==a)){if(O.pos==o){O.acceptToken(u,r?3:1);return}break}else if(O.next==p){if(r)O.advance();else if(O.pos==o){O.acceptToken(u);return}break}else O.advance();O.pos>o&&O.acceptToken(lO)});function Se(O,e){if(e==Oe)for(let i=0;i<2&&O.next>=48&&O.next<=55;i++)O.advance();else if(e==ee)for(let i=0;i<2&&y(O.next);i++)O.advance();else if(e==ae)for(let i=0;i<4&&y(O.next);i++)O.advance();else if(e==ne)for(let i=0;i<8&&y(O.next);i++)O.advance();else if(e==ie&&O.next==R){for(O.advance();O.next>=0&&O.next!=U&&O.next!=F&&O.next!=C&&O.next!=p;)O.advance();O.next==U&&O.advance()}}const pe=H({'async "*" "**" FormatConversion FormatSpec':n.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":n.controlKeyword,"in not and or is del":n.operatorKeyword,"from def class global nonlocal lambda":n.definitionKeyword,import:n.moduleKeyword,"with as print":n.keyword,Boolean:n.bool,None:n.null,VariableName:n.variableName,"CallExpression/VariableName":n.function(n.variableName),"FunctionDefinition/VariableName":n.function(n.definition(n.variableName)),"ClassDefinition/VariableName":n.definition(n.className),PropertyName:n.propertyName,"CallExpression/MemberExpression/PropertyName":n.function(n.propertyName),Comment:n.lineComment,Number:n.number,String:n.string,FormatString:n.special(n.string),Escape:n.escape,UpdateOp:n.updateOperator,"ArithOp!":n.arithmeticOperator,BitOp:n.bitwiseOperator,CompareOp:n.compareOperator,AssignOp:n.definitionOperator,Ellipsis:n.punctuation,At:n.meta,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace,".":n.derefOperator,", ;":n.separator}),qe={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},ge=D.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59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%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[le,te,Qe,Te,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:O=>qe[O]||-1}],tokenPrec:7668}),G=new aO,A=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function m(O){return(e,i,a)=>{if(a)return!1;let r=e.node.getChild("VariableName");return r&&i(r,O),!0}}const me={FunctionDefinition:m("function"),ClassDefinition:m("class"),ForStatement(O,e,i){if(i){for(let a=O.node.firstChild;a;a=a.nextSibling)if(a.name=="VariableName")e(a,"variable");else if(a.name=="in")break}},ImportStatement(O,e){var i,a;let{node:r}=O,Q=((i=r.firstChild)===null||i===void 0?void 0:i.name)=="from";for(let t=r.getChild("import");t;t=t.nextSibling)t.name=="VariableName"&&((a=t.nextSibling)===null||a===void 0?void 0:a.name)!="as"&&e(t,Q?"variable":"namespace")},AssignStatement(O,e){for(let i=O.node.firstChild;i;i=i.nextSibling)if(i.name=="VariableName")e(i,"variable");else if(i.name==":"||i.name=="AssignOp")break},ParamList(O,e){for(let i=null,a=O.node.firstChild;a;a=a.nextSibling)a.name=="VariableName"&&(!i||!/\*|AssignOp/.test(i.name))&&e(a,"variable"),i=a},CapturePattern:m("variable"),AsPattern:m("variable"),__proto__:null};function I(O,e){let i=G.get(e);if(i)return i;let a=[],r=!0;function Q(t,o){let g=O.sliceString(t.from,t.to);a.push({label:g,type:o})}return e.cursor(nO.IncludeAnonymous).iterate(t=>{if(t.name){let o=me[t.name];if(o&&o(t,Q,r)||!r&&A.has(t.name))return!1;r=!1}else if(t.to-t.from>8192){for(let o of I(O,t.node))a.push(o);return!1}}),G.set(e,a),a}const w=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,N=["String","FormatString","Comment","PropertyName"];function Pe(O){let e=iO(O.state).resolveInner(O.pos,-1);if(N.indexOf(e.name)>-1)return null;let i=e.name=="VariableName"||e.to-e.from<20&&w.test(O.state.sliceDoc(e.from,e.to));if(!i&&!O.explicit)return null;let a=[];for(let r=e;r;r=r.parent)A.has(r.name)&&(a=a.concat(I(O.state.doc,r)));return{options:a,from:i?e.from:O.pos,validFor:w}}const $e=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(O=>({label:O,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(O=>({label:O,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(O=>({label:O,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(O=>({label:O,type:"function"}))),he=[d("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),d("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),d("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),d("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),d(`if \${}: +import{L as D,E as h,C as L}from"./index-Bf0-KgBD.js";import{J as H,Q as n,g as B,L as K,z as M,u as f,x as OO,w as eO,O as iO,j as aO,I as nO}from"./FileExplorer-BmPzqkbb.js";import{i as rO,c as QO,s as d}from"./index-DDP-KCe3.js";import"./useI18n-D4u8zssu.js";import"./index-zrZBIArQ.js";import"./prefsSync-Dj3wNxrO.js";import"./client-n-fLEpOg.js";import"./Switch-BlSJOKEO.js";import"./auth-BBmiA1GG.js";const tO=1,Z=194,j=195,oO=196,x=197,dO=198,sO=199,lO=200,TO=2,E=3,u=201,SO=24,pO=25,qO=49,gO=50,mO=55,PO=56,$O=57,hO=59,cO=60,fO=61,XO=62,yO=63,zO=65,WO=238,vO=71,RO=241,kO=242,_O=243,xO=244,uO=245,UO=246,bO=247,VO=248,Y=72,GO=249,wO=250,ZO=251,jO=252,EO=253,YO=254,FO=255,CO=256,JO=73,AO=77,IO=263,NO=112,DO=130,LO=151,HO=152,BO=155,p=10,q=13,k=32,c=9,_=35,KO=40,MO=46,R=123,U=125,F=39,C=34,b=92,Oe=111,ee=120,ie=78,ae=117,ne=85,re=new Set([pO,qO,gO,IO,zO,DO,PO,$O,WO,XO,yO,Y,JO,AO,cO,fO,LO,HO,BO,NO]);function X(O){return O==p||O==q}function y(O){return O>=48&&O<=57||O>=65&&O<=70||O>=97&&O<=102}const Qe=new h((O,e)=>{let i;if(O.next<0)O.acceptToken(sO);else if(e.context.flags&P)X(O.next)&&O.acceptToken(dO,1);else if(((i=O.peek(-1))<0||X(i))&&e.canShift(x)){let a=0;for(;O.next==k||O.next==c;)O.advance(),a++;(O.next==p||O.next==q||O.next==_)&&O.acceptToken(x,-a)}else X(O.next)&&O.acceptToken(oO,1)},{contextual:!0}),te=new h((O,e)=>{let i=e.context;if(i.flags)return;let a=O.peek(-1);if(a==p||a==q){let r=0,Q=0;for(;;){if(O.next==k)r++;else if(O.next==c)r+=8-r%8;else break;O.advance(),Q++}r!=i.indent&&O.next!=p&&O.next!=q&&O.next!=_&&(r[O,e|J])),se=new L({start:oe,reduce(O,e,i,a){return O.flags&P&&re.has(e)||(e==vO||e==Y)&&O.flags&J?O.parent:O},shift(O,e,i,a){return e==Z?new $(O,de(a.read(a.pos,i.pos)),0):e==j?O.parent:e==SO||e==mO||e==hO||e==E?new $(O,0,P):V.has(e)?new $(O,0,V.get(e)|O.flags&P):O},hash(O){return O.hash}}),le=new h(O=>{for(let e=0;e<5;e++){if(O.next!="print".charCodeAt(e))return;O.advance()}if(!/\w/.test(String.fromCharCode(O.next)))for(let e=0;;e++){let i=O.peek(e);if(!(i==k||i==c)){i!=KO&&i!=MO&&i!=p&&i!=q&&i!=_&&O.acceptToken(tO);return}}}),Te=new h((O,e)=>{let{flags:i}=e.context,a=i&s?C:F,r=(i&l)>0,Q=!(i&T),t=(i&S)>0,o=O.pos;for(;!(O.next<0);)if(t&&O.next==R)if(O.peek(1)==R)O.advance(2);else{if(O.pos==o){O.acceptToken(E,1);return}break}else if(Q&&O.next==b){if(O.pos==o){O.advance();let g=O.next;g>=0&&(O.advance(),Se(O,g)),O.acceptToken(TO);return}break}else if(O.next==b&&!Q&&O.peek(1)>-1)O.advance(2);else if(O.next==a&&(!r||O.peek(1)==a&&O.peek(2)==a)){if(O.pos==o){O.acceptToken(u,r?3:1);return}break}else if(O.next==p){if(r)O.advance();else if(O.pos==o){O.acceptToken(u);return}break}else O.advance();O.pos>o&&O.acceptToken(lO)});function Se(O,e){if(e==Oe)for(let i=0;i<2&&O.next>=48&&O.next<=55;i++)O.advance();else if(e==ee)for(let i=0;i<2&&y(O.next);i++)O.advance();else if(e==ae)for(let i=0;i<4&&y(O.next);i++)O.advance();else if(e==ne)for(let i=0;i<8&&y(O.next);i++)O.advance();else if(e==ie&&O.next==R){for(O.advance();O.next>=0&&O.next!=U&&O.next!=F&&O.next!=C&&O.next!=p;)O.advance();O.next==U&&O.advance()}}const pe=H({'async "*" "**" FormatConversion FormatSpec':n.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":n.controlKeyword,"in not and or is del":n.operatorKeyword,"from def class global nonlocal lambda":n.definitionKeyword,import:n.moduleKeyword,"with as print":n.keyword,Boolean:n.bool,None:n.null,VariableName:n.variableName,"CallExpression/VariableName":n.function(n.variableName),"FunctionDefinition/VariableName":n.function(n.definition(n.variableName)),"ClassDefinition/VariableName":n.definition(n.className),PropertyName:n.propertyName,"CallExpression/MemberExpression/PropertyName":n.function(n.propertyName),Comment:n.lineComment,Number:n.number,String:n.string,FormatString:n.special(n.string),Escape:n.escape,UpdateOp:n.updateOperator,"ArithOp!":n.arithmeticOperator,BitOp:n.bitwiseOperator,CompareOp:n.compareOperator,AssignOp:n.definitionOperator,Ellipsis:n.punctuation,At:n.meta,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace,".":n.derefOperator,", ;":n.separator}),qe={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},ge=D.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#H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#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[le,te,Qe,Te,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:O=>qe[O]||-1}],tokenPrec:7668}),G=new aO,A=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function m(O){return(e,i,a)=>{if(a)return!1;let r=e.node.getChild("VariableName");return r&&i(r,O),!0}}const me={FunctionDefinition:m("function"),ClassDefinition:m("class"),ForStatement(O,e,i){if(i){for(let a=O.node.firstChild;a;a=a.nextSibling)if(a.name=="VariableName")e(a,"variable");else if(a.name=="in")break}},ImportStatement(O,e){var i,a;let{node:r}=O,Q=((i=r.firstChild)===null||i===void 0?void 0:i.name)=="from";for(let t=r.getChild("import");t;t=t.nextSibling)t.name=="VariableName"&&((a=t.nextSibling)===null||a===void 0?void 0:a.name)!="as"&&e(t,Q?"variable":"namespace")},AssignStatement(O,e){for(let i=O.node.firstChild;i;i=i.nextSibling)if(i.name=="VariableName")e(i,"variable");else if(i.name==":"||i.name=="AssignOp")break},ParamList(O,e){for(let i=null,a=O.node.firstChild;a;a=a.nextSibling)a.name=="VariableName"&&(!i||!/\*|AssignOp/.test(i.name))&&e(a,"variable"),i=a},CapturePattern:m("variable"),AsPattern:m("variable"),__proto__:null};function I(O,e){let i=G.get(e);if(i)return i;let a=[],r=!0;function Q(t,o){let g=O.sliceString(t.from,t.to);a.push({label:g,type:o})}return e.cursor(nO.IncludeAnonymous).iterate(t=>{if(t.name){let o=me[t.name];if(o&&o(t,Q,r)||!r&&A.has(t.name))return!1;r=!1}else if(t.to-t.from>8192){for(let o of I(O,t.node))a.push(o);return!1}}),G.set(e,a),a}const w=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,N=["String","FormatString","Comment","PropertyName"];function Pe(O){let e=iO(O.state).resolveInner(O.pos,-1);if(N.indexOf(e.name)>-1)return null;let i=e.name=="VariableName"||e.to-e.from<20&&w.test(O.state.sliceDoc(e.from,e.to));if(!i&&!O.explicit)return null;let a=[];for(let r=e;r;r=r.parent)A.has(r.name)&&(a=a.concat(I(O.state.doc,r)));return{options:a,from:i?e.from:O.pos,validFor:w}}const $e=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(O=>({label:O,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(O=>({label:O,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(O=>({label:O,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(O=>({label:O,type:"function"}))),he=[d("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),d("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),d("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),d("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),d(`if \${}: `,{label:"if",detail:"block",type:"keyword"}),d("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),d("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),d("import ${module}",{label:"import",detail:"statement",type:"keyword"}),d("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],ce=rO(N,QO($e.concat(he)));function z(O){let{node:e,pos:i}=O,a=O.lineIndent(i,-1),r=null;for(;;){let Q=e.childBefore(i);if(Q)if(Q.name=="Comment")i=Q.from;else if(Q.name=="Body"||Q.name=="MatchBody")O.baseIndentFor(Q)+O.unit<=a&&(r=Q),e=Q;else if(Q.name=="MatchClause")e=Q;else if(Q.type.is("Statement"))e=Q;else break;else break}return r}function W(O,e){let i=O.baseIndentFor(e),a=O.lineAt(O.pos,-1),r=a.from+a.text.length;return/^\s*($|#)/.test(a.text)&&O.node.toi?null:i+O.unit}const v=K.define({name:"python",parser:ge.configure({props:[M.add({Body:O=>{var e;let i=/^\s*(#|$)/.test(O.textAfter)&&z(O)||O.node;return(e=W(O,i))!==null&&e!==void 0?e:O.continue()},MatchBody:O=>{var e;let i=z(O);return(e=W(O,i||O.node))!==null&&e!==void 0?e:O.continue()},IfStatement:O=>/^\s*(else:|elif )/.test(O.textAfter)?O.baseIndent:O.continue(),"ForStatement WhileStatement":O=>/^\s*else:/.test(O.textAfter)?O.baseIndent:O.continue(),TryStatement:O=>/^\s*(except[ :]|finally:|else:)/.test(O.textAfter)?O.baseIndent:O.continue(),MatchStatement:O=>/^\s*case /.test(O.textAfter)?O.baseIndent+O.unit:O.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":f({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":f({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":f({closing:"]"}),MemberExpression:O=>O.baseIndent+O.unit,"String FormatString":()=>null,Script:O=>{var e;let i=z(O);return(e=i&&W(O,i))!==null&&e!==void 0?e:O.continue()}}),OO.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":eO,Body:(O,e)=>({from:O.from+1,to:O.to-(O.to==e.doc.length?0:1)}),"String FormatString":(O,e)=>({from:e.doc.lineAt(O.from).to,to:O.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function xe(){return new B(v,[v.data.of({autocomplete:Pe}),v.data.of({autocomplete:ce})])}export{ce as globalCompletion,Pe as localCompletionSource,xe as python,v as pythonLanguage}; diff --git a/internal/relay/web-dist/assets/index-Ci2MtInW.js b/internal/relay/web-dist/assets/index-Ci2MtInW.js deleted file mode 100644 index 782e7504..00000000 --- a/internal/relay/web-dist/assets/index-Ci2MtInW.js +++ /dev/null @@ -1,2110 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FileExplorer-BumK3wPT.js","assets/useI18n-lwZlSdSx.js","assets/FileExplorer-DKo_tolh.css","assets/sessions-RpM2fLHY.js","assets/client-DMh7GjbV.js","assets/auth-B3RxKR1W.js","assets/prefsSync-C5tz9Q-s.js","assets/version-Dm8mqW3q.js"])))=>i.map(i=>d[i]); -var pb=Object.defineProperty;var vb=(e,t,n)=>t in e?pb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Y=(e,t,n)=>vb(e,typeof t!="symbol"?t+"":t,n);import{bH as H,bf as Lu,at as ng,aR as Ut,aM as gb,bF as ia,b9 as bl,b8 as sg,c5 as mb,aE as _b,bu as Ql,cv as _t,bj as un,c7 as yb,a7 as q,aL as B,ap as Ae,br as Vt,bw as $,ad as F,bl as tn,ac as Z,aa as b,F as Ie,bt as Dt,bk as lt,bJ as at,ca as C,c3 as L,ak as Te,ab as bt,cA as dt,v as Ct,ai as ot,cz as Xn,cy as rt,cr as Tt,_ as co,bY as ig,cs as Ss,T as wl,ah as bb,bG as Ad,aD as rg,bq as wb,bm as zn,bo as Wn,af as ds,cf as Zt,a as Sb,bC as kn,b as Cb,c6 as ct,cj as Du,b4 as Sa,V as Id,bg as nr,bp as kb,bs as og,aq as so,bD as Gn,bK as ag,ae as Mu,aK as Dr,bN as $c,cu as Mr,aJ as Zl,bU as ec,bx as xb,b7 as Rb,aZ as Au,w as Tb,aY as uo,A as lg,c8 as ko,M as $d,c as Pb,q as Vh,ax as Eb,U as Kh,a$ as Wh,o as ll,bc as Lb,b6 as jh,b5 as Db,Q as Mb,c4 as Iu,b2 as Ab,b0 as Ib,aX as $b,b1 as cg,aC as Od,z as Ob,aP as Fb,y as Bb,x as Hb,bM as $u,H as Ce,K as Ge,G as ze,d as Kn,cb as mn,cl as Ht,av as Nb,ce as Qs,ag as Mt,cm as Un,bI as ui,s as ks,a1 as zb,L as Ve,O as Cn,bS as Us,e as tc,S as As,bQ as Jt,ci as pi,aV as Ub,aH as io,J as Vb,bA as Kb,cw as Vs,aB as ls,bb as qh,u as dg,$ as Wb,r as jb,ch as ss,P as Je,ar as ug,a2 as qb,R as wn,N as Yb,a0 as Yh,t as Gb,f as Xb,aW as Jb,c2 as Ft,b_ as Ai,aF as Ca,aw as hg,ba as Qb,cc as ar,aO as Gr,aT as fg,aU as pg,l as vg,Y as Zb,bB as gg,bd as mg,bn as Ou,bW as e0,m as Is,by as t0,bE as _g,c9 as n0,cg as yg,au as s0,ck as i0,B as gn,aN as r0,as as o0,C as a0,a8 as l0,al as c0,bv as nc,bL as d0,an as u0,X as fi,bR as xs,c0 as bg,c1 as h0,ao as f0,bh as p0,aj as v0,aS as g0,D as m0,bT as _0,W as y0,bz as b0,az as w0,bZ as S0,g as sc,cx as qt,cd as xo,aA as wg,j as Sg,k as qi,bi as Gh,aI as C0,n as k0,am as x0,h as R0,cq as Cg,cn as ho,co as T0,cp as Fd,bP as P0,bV as kg,Z as xg,aQ as E0,bX as Xh,a9 as L0,be as D0}from"./useI18n-lwZlSdSx.js";import{PrefsSyncEngine as M0,localStorageAdapter as A0,apiRelayClient as I0,setSharedPrefsSync as $0}from"./prefsSync-C5tz9Q-s.js";import{a as vn,A as Xs}from"./client-DMh7GjbV.js";import{f as Rg,g as O0,a as Ns,N as Tg,b as Sl}from"./Switch-DguIL3dU.js";import{c as F0,o as B0,S as H0,b as N0,l as z0}from"./auth-B3RxKR1W.js";/*! - * pinia v3.0.4 - * (c) 2025 Eduardo San Martin Morote - * @license MIT - */let Pg;const ic=e=>Pg=e,Eg=Symbol();function Bd(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var ra;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(ra||(ra={}));function U0(){const e=ng(!0),t=e.run(()=>H({}));let n=[],s=[];const i=Lu({install(a){ic(i),i._a=a,a.provide(Eg,i),a.config.globalProperties.$pinia=i,s.forEach(d=>n.push(d)),s=[]},use(a){return this._a?n.push(a):s.push(a),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}const Lg=()=>{};function Jh(e,t,n,s=Lg){e.add(t);const i=()=>{e.delete(t)&&s()};return!n&&_b()&&Ql(i),i}function Vr(e,...t){e.forEach(n=>{n(...t)})}const V0=e=>e(),Qh=Symbol(),Oc=Symbol();function Hd(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,s)=>e.set(s,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const s=t[n],i=e[n];Bd(i)&&Bd(s)&&e.hasOwnProperty(n)&&!bl(s)&&!sg(s)?e[n]=Hd(i,s):e[n]=s}return e}const K0=Symbol();function W0(e){return!Bd(e)||!Object.prototype.hasOwnProperty.call(e,K0)}const{assign:Wi}=Object;function j0(e){return!!(bl(e)&&e.effect)}function q0(e,t,n,s){const{state:i,actions:a,getters:d}=t,r=n.state.value[e];let o;function c(){r||(n.state.value[e]=i?i():{});const p=yb(n.state.value[e]);return Wi(p,a,Object.keys(d||{}).reduce((u,g)=>(u[g]=Lu(q(()=>{ic(n);const m=n._s.get(e);return d[g].call(m,m)})),u),{}))}return o=Dg(e,c,t,n,s,!0),o}function Dg(e,t,n={},s,i,a){let d;const r=Wi({actions:{}},n),o={deep:!0};let c,p,u=new Set,g=new Set,m;const y=s.state.value[e];!a&&!y&&(s.state.value[e]={}),H({});let v;function l(w){let T;c=p=!1,typeof w=="function"?(w(s.state.value[e]),T={type:ra.patchFunction,storeId:e,events:m}):(Hd(s.state.value[e],w),T={type:ra.patchObject,payload:w,storeId:e,events:m});const A=v=Symbol();un().then(()=>{v===A&&(c=!0)}),p=!0,Vr(u,T,s.state.value[e])}const h=a?function(){const{state:T}=n,A=T?T():{};this.$patch(E=>{Wi(E,A)})}:Lg;function f(){d.stop(),u.clear(),g.clear(),s._s.delete(e)}const _=(w,T="")=>{if(Qh in w)return w[Oc]=T,w;const A=function(){ic(s);const E=Array.from(arguments),R=new Set,D=new Set;function I(W){R.add(W)}function O(W){D.add(W)}Vr(g,{args:E,name:A[Oc],store:k,after:I,onError:O});let U;try{U=w.apply(this&&this.$id===e?this:k,E)}catch(W){throw Vr(D,W),W}return U instanceof Promise?U.then(W=>(Vr(R,W),W)).catch(W=>(Vr(D,W),Promise.reject(W))):(Vr(R,U),U)};return A[Qh]=!0,A[Oc]=T,A},S={_p:s,$id:e,$onAction:Jh.bind(null,g),$patch:l,$reset:h,$subscribe(w,T={}){const A=Jh(u,w,T.detached,()=>E()),E=d.run(()=>_t(()=>s.state.value[e],R=>{(T.flush==="sync"?p:c)&&w({storeId:e,type:ra.direct,events:m},R)},Wi({},o,T)));return A},$dispose:f},k=ia(S);s._s.set(e,k);const M=(s._a&&s._a.runWithContext||V0)(()=>s._e.run(()=>(d=ng()).run(()=>t({action:_}))));for(const w in M){const T=M[w];if(bl(T)&&!j0(T)||sg(T))a||(y&&W0(T)&&(bl(T)?T.value=y[w]:Hd(T,y[w])),s.state.value[e][w]=T);else if(typeof T=="function"){const A=_(T,w);M[w]=A,r.actions[w]=T}}return Wi(k,M),Wi(mb(k),M),Object.defineProperty(k,"$state",{get:()=>s.state.value[e],set:w=>{l(T=>{Wi(T,w)})}}),s._p.forEach(w=>{Wi(k,d.run(()=>w({store:k,app:s._a,pinia:s,options:r})))}),y&&a&&n.hydrate&&n.hydrate(k.$state,y),c=!0,p=!0,k}/*! #__NO_SIDE_EFFECTS__ */function Fu(e,t,n){let s;const i=typeof t=="function";s=i?n:t;function a(d,r){const o=gb();return d=d||(o?Ut(Eg,null):null),d&&ic(d),d=Pg,d._s.has(e)||(i?Dg(e,t,s,d):q0(e,s,d)),d._s.get(e)}return a.$id=e,a}const Y0=64,G0=1e3,cl=512,X0=/pass|token|key|secret|cred|auth/i;let xi=[],ro=null,Xr=0,Fc=!1,jo=[];function Mg(){var e,t,n;return typeof window<"u"&&typeof((n=(t=(e=window.go)==null?void 0:e.main)==null?void 0:t.App)==null?void 0:n.AppendFrontendLogs)=="function"}function J0(e){if(!e)return"";const t=[];for(const[n,s]of Object.entries(e)){if(s===void 0)continue;const i=X0.test(n)?"***":String(s);t.push(`${n}=${JSON.stringify(i)}`)}return t.length?" "+t.join(" "):""}function Q0(e){switch(e){case"ERROR":return console.error;case"WARN":return console.warn;case"DEBUG":return console.debug;default:return console.info}}function Z0(e,t,n){if(xi.push({timestamp_ms:Date.now(),level:e,tag:t,message:n}),xi.length>cl&&(Xr+=xi.length-cl,xi=xi.slice(-cl)),e==="ERROR"||xi.length>=Y0){Cl();return}ew()}function ew(){ro===null&&(ro=setTimeout(()=>{ro=null,Cl()},G0))}async function Cl(){if(ro!==null&&(clearTimeout(ro),ro=null),Fc)return;if(!Mg()){xi=[],jo=[],Xr=0;return}const e=jo.concat(xi);if(jo=[],xi=[],Xr>0&&(e.push({timestamp_ms:Date.now(),level:"WARN",tag:"log",message:`dropped ${Xr} log record(s): renderer buffer overflow`}),Xr=0),e.length!==0){Fc=!0;try{await window.go.main.App.AppendFrontendLogs(e)}catch{jo.length===0?jo=e.slice(-cl):Xr+=e.length}finally{Fc=!1}}}function rc(e,t,n,s){const i=n+J0(s);Mg()||Q0(e)(`[${t}] ${i}`),Z0(e,t,i)}function Js(e,t,n){rc("DEBUG",e,t,n)}function tw(e,t,n){rc("INFO",e,t,n)}function Lt(e,t,n){rc("WARN",e,t,n)}function Ks(e,t,n){rc("ERROR",e,t,n)}function Rt(e){if(e instanceof Error)return`${e.name}: ${e.message}`;if(typeof e=="string")return e;try{return String(e)}catch{return"unknown error"}}function nw(){typeof window>"u"||(window.addEventListener("beforeunload",()=>void Cl()),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Cl()}))}/** - * @license lucide-vue-next v1.0.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=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/** - * @license lucide-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Zh=e=>e==="";/** - * @license lucide-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const iw=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/** - * @license lucide-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ef=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** - * @license lucide-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rw=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());/** - * @license lucide-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ow=e=>{const t=rw(e);return t.charAt(0).toUpperCase()+t.slice(1)};/** - * @license lucide-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var qo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/** - * @license lucide-vue-next v1.0.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=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":s,strokeWidth:i,"stroke-width":a,size:d=qo.width,color:r=qo.stroke,...o},{slots:c})=>B("svg",{...qo,...o,width:d,height:d,stroke:r,"stroke-width":Zh(n)||Zh(s)||n===!0||s===!0?Number(i||a||qo["stroke-width"])*24/Number(d):i||a||qo["stroke-width"],class:iw("lucide",o.class,...e?[`lucide-${ef(ow(e))}-icon`,`lucide-${ef(e)}`]:["lucide-icon"]),...!c.default&&!sw(o)&&{"aria-hidden":"true"}},[...t.map(p=>B(...p)),...c.default?[c.default()]:[]]);/** - * @license lucide-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pn=(e,t)=>(n,{slots:s,attrs:i})=>B(aw,{...i,...n,iconNode:t,name:e},s);/** - * @license lucide-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const tf=pn("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** - * @license lucide-vue-next v1.0.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=pn("arrow-down-right",[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]);/** - * @license lucide-vue-next v1.0.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=pn("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/** - * @license lucide-vue-next v1.0.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=pn("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** - * @license lucide-vue-next v1.0.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=pn("clock-3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]);/** - * @license lucide-vue-next v1.0.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=pn("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** - * @license lucide-vue-next v1.0.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=pn("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** - * @license lucide-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ag=pn("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** - * @license lucide-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nf=pn("file-down",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/** - * @license lucide-vue-next v1.0.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=pn("file-up",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/** - * @license lucide-vue-next v1.0.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=pn("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/** - * @license lucide-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ja=pn("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/** - * @license lucide-vue-next v1.0.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=pn("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/** - * @license lucide-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dl=pn("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-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bc=pn("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** - * @license lucide-vue-next v1.0.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=pn("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);/** - * @license lucide-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Hi=pn("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** - * @license lucide-vue-next v1.0.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=pn("radio",[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** - * @license lucide-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ig=pn("refresh-cw",[["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-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $g=pn("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);/** - * @license lucide-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Qr=pn("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-vue-next v1.0.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=pn("shield-user",[["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:"M6.376 18.91a6 6 0 0 1 11.249.003",key:"hnjrf2"}],["circle",{cx:"12",cy:"11",r:"4",key:"1gt34v"}]]);/** - * @license lucide-vue-next v1.0.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=pn("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** - * @license lucide-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qa=pn("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/** - * @license lucide-vue-next v1.0.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=pn("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);/** - * @license lucide-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Hc=pn("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);/** - * @license lucide-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ai=pn("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** - * @license lucide-vue-next v1.0.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=pn("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Cw={common:{language:"Language",system:"System",english:"English",simplifiedChinese:"Simplified Chinese",save:"Save",cancel:"Cancel",close:"Close",refresh:"Refresh",copy:"Copy",paste:"Paste",send:"Send",disconnect:"Disconnect",connect:"Connect",settings:"Settings",loading:"loading...",disabled:"disabled",discard:"discard",stay:"stay",delete:"Delete",retry:"Retry",unknown:"(unknown)",countSessions:"{count} sessions",countSessionsOne:"1 session",minimize:"Minimize",maximize:"Maximize",restore:"Restore",yes:"Yes",no:"No"},app:{authInvalidToken:"Invalid or revoked API token. Generate a new one in web settings.",authUserDisabled:"Account disabled. Contact your relay admin.",sessionIdOwnerMismatch:"Session id collision. Restart the desktop app.",forbidden:"Not authorized to connect to this relay.",openSettings:"Open settings",dismiss:"Dismiss",showPanel:"Show panel",hidePanel:"Hide panel",startingFirstSession:"starting first session...",waitingForSessionSelection:"waiting for session selection...",noShellsFound:"no shells found on this machine",wailsBindingsUnavailable:"Wails bindings unavailable",wailsBindingsNotReady:"Wails bindings not ready",sessionAlreadyInTab:"Session is already open in this tab",paneFull:"pane full - close one first",splitFailed:"split failed: {message}",noActiveSession:"No active session",noEndpoint:"No endpoint",pluginFailedToLoad:'Plugin "{title}" failed to load',startupFailureTitle:"AT Term could not start",startupFailureIntro:"The desktop backend hit a fatal startup error. Your terminal sessions were not started.",startupFailureLogPath:"Log file",startupFailureCopy:"Copy diagnostics",startupFailureCopied:"Startup diagnostics copied"},titlebar:{e2eeOffChip:"Plaintext",e2eeOffTitle:"End-to-end encryption is disabled: this desktop's agent is sending terminal output, session title / cwd / current command, and command-finished notifications to the relay in clear text. Turn it back on in Settings → Remote relay."},terminal:{connecting:"connecting...",reconnecting:"reconnecting...",ended:"session ended",sessionEndedBanner:"[AT Term] session ended (exit {exitCode})",connectionError:"connection error",remoteHasTakenControl:"remote has taken control",byHost:"by {host}",pressSpaceToTakeBack:"press space to take back",takeControl:"Take control",clearBuffer:"clear buffer",search:{placeholder:"Find",next:"Next match",prev:"Previous match",close:"Close search",noResults:"No results"},sendSelection:"send",pickImage:"image",pickFile:"file",emptyPaneHint:"[empty pane - press Cmd+N / Ctrl+N to fill]",remote:"remote",remotePrefix:"[remote] ",shellFallback:"shell",emptyTab:"(empty)",tabDisconnectedSuffix:"(disconnected)",closePaneTitle:"close pane (Cmd+W / Ctrl+W)",dragPaneOut:"drag onto the tab bar for its own tab",detachToTab:"Own tab",alreadyOwnTab:"Session already has its own tab",remoteViewerWatching:"{count} remote viewer(s) watching",relaySettings:"relay settings",adminPanel:"admin panel",newTab:"new tab",starting:"starting...",newTabProfileLabel:"profile for new tabs / splits",useDefaultProfile:"Default profile",layoutVertical:"side-by-side split",layoutHorizontal:"stacked split",layoutGrid2x2:"2x2 grid split",sessionStatusOne:"{count} session",sessionStatusMany:"{count} sessions",uplinkOn:"uplink on",imagePasteRequiresFull:"image paste requires full remote permission",pasteSessionNotWritable:"session is not writable right now",clipboardEmpty:"clipboard has no text or image",clipboardImageTooLarge:"clipboard image is too large",clipboardImageToolsMissing:"install xclip, wl-paste, or xsel to paste images",readOnlySession:"session is read-only",websocketNotOpen:"websocket is not open",imageTooLarge:"image too large: {size} bytes exceeds {limit}",copyFailed:"copy failed",pasteFailed:"paste failed",driverNow:"you are now the driver",viewerNow:"you are now a viewer",preview:{open:"Preview web service",opening:"Opening…",portPrompt:"Enter the loopback port of the web service on the remote desktop (for example 3000)",targetHost:"Remote service loopback address",additionalPort:"Additional service port",pathPrefix:"Path prefix",addMapping:"Add service mapping",removeMapping:"Remove service mapping",invalidPathPrefix:"Additional mappings need distinct path prefixes (for example /api or /ws)",desktopOnly:"Remote Preview is available in the desktop app",requiresConnection:"Wait for the remote session to connect before opening Preview",requiresDriver:"Take control of the remote session before opening Preview",requiresFullPermission:"Remote Preview requires full permission from the host",invalidPort:"Port must be an integer from 1 to 65535",noLongerAllowed:"Preview permission was withdrawn while opening",openFailed:"Could not open remote preview: {error}",terminal:"Terminal",previewPort:"Preview :{port}",switch:"Switch preview",closeThis:"Close this preview",newPreview:"New preview…",reconnecting:"Reconnecting…",frameTitle:"Remote web preview :{port}",openInBrowser:"Open in system browser",copyURL:"Copy preview URL",urlCopied:"Preview URL copied",browserOpenFailed:"Could not open the system browser",copyFailed:"Could not copy the preview URL"},bellNotification:"Bell in {session}",commandFinishedNotification:"Command finished - exit {exitCode} - {elapsed} - {session}",loadingHistoryBytes:"loading history - {bytes}",loadingHistoryProgress:"loading history {pct}% - {bytes} / {total}",contextMenu:{openLink:"Open Link",copyLink:"Copy Link"},resize:"Fit PTY to terminal",link:{openFailed:"Failed to open link",openFailedNoHome:"Cannot resolve ~ (home directory unavailable)"}},sessions:{local:"local",remote:"remote",remoteSessions:"remote sessions",hostIdTitle:"host_id {hostId}",sessionTitle:"session {sessionId}",cancelEsc:"cancel (esc)",endLocalSessionOne:"End {count} local shell session",endLocalSessionMany:"End {count} local shell sessions",detachRemoteSessionOne:"Detach from {count} remote session",detachRemoteSessionMany:"Detach from {count} remote sessions",runningProcessesTerminated:"(running processes will be terminated)",remotePtyKeepsRunning:"(the remote PTY keeps running on its host)",saveWorkFirst:"Save your work first.",quitTitle:"quit AT Term",closingWill:"Closing AT Term will:",quit:"quit",closeSessionTitle:"Close session?",closeSessionBody:'Close "{title}"?',closeSessionManyBody:"Close {count} sessions?",closeAiSessionWarning:"This is an AI session. Confirm the task is finished or the context is saved before closing.",closeRunningSessionWarning:"This session is still running. Closing it may interrupt the active command.",closeLocalTerminateHint:"Local sessions will be ended and running processes will be terminated.",closeRemoteDetachHint:"Remote sessions will be detached from this window; the remote PTY keeps running.",closeSessionConfirm:"Close session",unknownHost:"unknown host",thisMachine:"this machine"},ssh:{tabHosts:"Hosts",tabKeys:"Keys",filterPlaceholder:"Filter hosts…",newHost:"New Host",newKey:"New Key",edit:"Edit",subtitleAuthKey:"key",subtitleAuthPassword:"password",importedHosts:"Imported {count} host(s)",hosts:{emptyTitle:"No saved hosts",emptySub:"Add a host to connect and take it over from any device.",clearTags:"Clear",noMatchTitle:"No hosts match",noMatchSub:"Loosen the filter or clear the selected tags.",menuConnect:"Connect",menuEdit:"Edit Host Details",menuDuplicate:"Duplicate",menuCopySsh:"Copy SSH command",menuRemove:"Remove"},keys:{emptyTitle:"No keys yet",emptySub:"Add a private key here, then reference it from a host.",typeLabel:"Type {type}",genericSubtitle:"SSH key"},proxy:{jumpBadge:"Via {target}",commandBadge:"ProxyCommand",jumpReason:"Connects through jump host {target}. Every hop on the chain must itself be a saved host in atterm — atterm signs in to each one with that host's own credential, and never sends this host's.",commandReason:"Configured with a ProxyCommand ({command}) — atterm never runs that command, so this host cannot be connected directly."},hostKey:{title:"Unknown host key",direct:"Unknown host key. Verify this fingerprint before trusting it:",jumpHop:"This fingerprint belongs to {name}, hop {hop} on the route to {target} — it is not {target} itself. Check it against {name} before trusting it:",targetHop:"This fingerprint belongs to {target}, the host you asked to connect (reached as hop {hop}). Verify it before trusting it:",chainNote:"Each machine on the route is asked about separately; accepting this one accepts nothing else.",accept:"Accept & Connect",reject:"Cancel"},hostDrawer:{titleNew:"New Host",titleEdit:"Edit Host",address:"Address",addressPlaceholder:"IP or hostname",label:"Label",labelPlaceholder:"optional",port:"Port",tags:"Tags",tagsPlaceholder:"comma separated",removeTag:"Remove {tag}",username:"Username",usernamePlaceholder:"user",authPassword:"Password",authKey:"Key",identityFileLabel:"From ~/.ssh/config",identityFileHint:"Import this key under Keys, then select it below.",password:"Password",keepBlank:"(leave blank to keep)",keyPicker:"Key",keyPickerAria:"SSH key",noKeys:"No keys yet.",addKey:"Add a key",submitNew:"Add Host"},keyDrawer:{titleNew:"New Key",titleEdit:"Edit Key",name:"Name",namePlaceholder:"e.g. aws",pem:"Private key (PEM)",keepBlank:"(leave blank to keep)",passphrase:"Passphrase",encryptedHint:"This key is encrypted — enter its passphrase above.",dropzone:"Drag and drop a private key file to import",importFromFile:"Import from key file",submitNew:"Add Key",reveal:"Show the stored private key",hide:"Hide",copy:"Copy the private key"},startup:{sectionTitle:"Startup command",sectionHint:"For a bastion that shows a menu instead of a shell. Each line is typed and followed by Enter, one per prompt — for JumpServer that is the asset at Opt>, then the system user at ID>.",placeholder:"one answer per line",delay:"Step interval (ms)",steps:"{count} steps will be sent after login."},forwards:{tab:"Tunnels",sectionTitle:"Port forwarding",sectionHint:"Rules are configuration only. Nothing starts until you start it under Tunnels.",add:"Add rule",remove:"Remove this rule",noRules:"No forwarding rules yet.",kindLocal:"Local",kindRemote:"Remote",kindDynamic:"Dynamic",kindLocalHint:"This machine listens; each connection is opened from the SSH host to the target (ssh -L).",kindRemoteHint:"The SSH host listens; each connection it accepts is opened from this machine to the target (ssh -R).",kindDynamicHint:"This machine listens as a SOCKS5 proxy; every connection names its own destination, resolved on the SSH host (ssh -D).",bindAddr:"Bind address",bindPort:"Port",targetHost:"Target host",targetPort:"Target port",label:"Label",labelPlaceholder:"optional",warnLocal:"Binding {addr} instead of 127.0.0.1 puts this forwarded service in front of anyone on the same network, with no SSH credential — they reach it through your machine. This rule syncs to every device you sign in on and binds the same way there.",warnRemote:"Binding {addr} instead of 127.0.0.1 asks the SSH host to accept connections from anyone on the same network as that host, with no SSH credential, and hand them to the target below through your machine. Most sshd configs refuse it unless GatewayPorts is on. This rule syncs to every device you sign in on.",warnDynamic:"Binding {addr} instead of 127.0.0.1 makes this an unauthenticated SOCKS5 open proxy: anyone on the same network can reach everything this SSH host can reach, to any destination they name, using your SSH credential and appearing in the far side's logs as you. This rule syncs to every device you sign in on and binds the same way there.",emptyTitle:"No forwarding rules",emptySub:"Create one here, or add a rule in a host's Port forwarding section.",new:"New tunnel",newNeedsHost:"Save an SSH host first — a tunnel runs over one.",drawerTitleNew:"New tunnel",drawerTitleEdit:"Edit tunnel",hostPicker:"SSH host",hostPickerAria:"SSH host this tunnel runs over",hostPickerHint:"The tunnel runs over this host's connection — the bastion, when the target is behind one. It is saved as one of that host's forwarding rules.",saveAndStart:"Save and start",start:"Start",stop:"Stop",dismiss:"Dismiss",stateIdle:"Not started",stateRunning:"Running",stateStopped:"Stopped",conns:"{count} accepted",dynamicTarget:"SOCKS5 (destination per connection)",proxyBlocked:"Tunnels cannot be started for this host.",refresh:"Refresh"},configImport:{open:"Import from ~/.ssh/config",title:"Import from ~/.ssh/config",loading:"Reading ~/.ssh/config…",emptyTitle:"No importable hosts",emptySub:"No usable Host entries were found in ~/.ssh/config.",importableTitle:"Importable hosts ({count})",skippedTitle:"Skipped ({count})",overwriteBadge:"Updates existing",overwriteTitle:"A saved host already uses this label — importing updates it in place",proxyBadge:"{label} — not directly connectable",importing:"Importing…",confirm:"Import selected hosts ({count})"}},settings:{title:"Settings",tabs:{general:"General",relay:"Relay",logging:"Logging",updates:"Updates",plugins:"Plugins",shortcuts:"Shortcuts",devices:"Signed-in devices",receivedFiles:"Received files",mobileProfiles:"Synced profiles",mobileHosts:"SSH hosts"},discardRelayTitle:"Discard unsaved relay changes?",discardRelayBody:"Your edits to relay URL, token, permissions, or insecure mode are not saved yet.",general:{languageLabel:"Language",languageHint:"Use System to follow your device language.",terminalTheme:"terminal theme",terminalThemeHint:"Applies to all terminal panes immediately and is saved as your local desktop preference.",terminalFont:"terminal font",terminalFontHint:"Your choice is placed ahead of the built-in fallback chain; CJK glyphs keep using the bundled families.",terminalFontSize:"font size",terminalLineHeight:"line height",terminalCursorStyle:"cursor style",terminalCursorStyleBlock:"Block",terminalCursorStyleUnderline:"Underline",terminalCursorStyleBar:"Bar",terminalCursorBlink:"blink the cursor",terminalScrollback:"scrollback lines",terminalScrollbackHint:"Roughly {mb} MB per pane at this setting. Every open pane pays it.",notificationsBell:"Show system notifications on terminal bell",notificationsHint:"Only fires when the AT Term window is not focused.",shellIntegration:"Enable shell integration",shellIntegrationHint:"Injects OSC 133 hooks into zsh / bash / fish / pwsh at session start so we can detect when a command finishes. Only affects new sessions.",recoveryEnabled:"Show recovery prompt at launch",recoveryEnabledHint:"Ask before restoring last session's tabs and panes.",defaultShell:"default shell",auto:"Auto",customPath:"Custom path...",defaultShellHint:"Auto chooses a platform default for new local sessions. Pick a detected shell or save a custom shell path if you prefer Git Bash, PowerShell 7, or another terminal program.",customShellPath:"custom shell path",customShellRequired:"custom shell path is required",saveCustom:"save custom",webglRenderer:"Use WebGL terminal renderer",webglHint:"GPU-rasterized rendering keeps light themes free of cell ghosting on dense TUI output. Off by default on Linux because NVIDIA proprietary + X11 + WebKitGTK paint the cursor / last cell a frame late, which surfaces as visible typing lag. Affects new terminal sessions only.",commandNotifyThreshold:"Command-finished notification threshold (seconds)",commandNotifyHint:"Commands shorter than this duration do not produce a notification. Requires shell integration to be enabled.",pushNotifications:{title:"Push notifications",enable:"Enable push notifications",test:"Send test notification",errors:{denied:"Browser denied the notification permission.",disabled:"Push notifications are disabled on the server.",keyFailed:"Could not fetch the push key from the relay.",subscribeFailed:"Browser subscription failed.",subscribeRejected:"The relay rejected the subscription.",generic:"Push notification request failed."}},themes:{classicLabel:"AT Term Classic",classicDescription:"Current black terminal look.",nordLabel:"Nord / Arctic",nordDescription:"Cool low-contrast dark palette.",solarizedDarkLabel:"Solarized Dark",solarizedDarkDescription:"Classic warm low-contrast dark palette.",daylightLabel:"Daylight",daylightDescription:"Light palette for bright environments."}},configio:{title:"Import & export",export:{title:"Export",hint:"Save your preferences, SSH hosts, and session profiles to a JSON file you can move to another machine. Your SSH passwords and private keys are never included in this file.",includeEnvLabel:"Include profile environment variables that aren't set to sync — these can contain API tokens and other secrets",button:"Export…",exporting:"Exporting…",success:"Saved to {path}"},import:{title:"Import",hint:"Choose a previously exported JSON file. Nothing is applied until you confirm. Imported SSH hosts never bring a credential with them: new hosts need a password or key added here afterward, and if an existing host's address changed, its saved credential is cleared for safety and needs to be re-entered too.",pickFile:"Choose file…",fileLabel:"File: {name}",previewing:"Reading file…",fileReadError:"Could not read file",previewError:"Could not read this file: {error}",previewTitle:"Preview — nothing applied yet",changesAdd:"Add",changesReplace:"Replace",changesUnchanged:"Unchanged",noChanges:"Nothing would change.",skippedTitle:"Skipped",apply:"Apply import",applying:"Applying…",applyError:"Import failed: {error}",appliedTitle:"Import applied",appliedSummary:"Applied {count} change(s)."}},relay:{uplink:"Uplink",off:"OFF",on:"ON",connectedAs:"connected as {identity}",notConfigured:"not configured",paused:"paused (config kept)",connecting:"Connecting…",relayInvalid:"Invalid relay address",versionProbeFailed:"Failed to reach relay: {reason}",loginFailedInline:"Login failed: {reason}",credentialsRequired:"Email and password required",hint:"configure a remote atterm-relay so this machine's sessions can be attached from other devices. when no one is attached, no bytes leave this machine.",relayUrl:"relay url",email:"Email",password:"Password",passwordShow:"Show password",passwordHide:"Hide password",modeLogin:"Log in",modeRegister:"Register",noAccountPrompt:"Need an account?",haveAccountPrompt:"Have an account?",claimToken:"Claim token (optional)",claimTokenPlaceholder:"claim_…",claimTokenHint:"Paste the token printed by `atterm-relay` bootstrap to claim an admin account. Leave empty for a regular user.",insecureMode:"trust self-signed cert",insecureWarning:"Skips TLS certificate verification for this relay, so a relay serving a self-signed certificate is reachable. The connection is still encrypted, but an attacker able to intercept it could impersonate the relay. Enable only for a relay you control (e.g. atterm-relay's self-signed quick-start); prefer a real certificate for anything public.",disableE2EE:"disable end-to-end encryption (testing / debug only)",disableE2EEWarning:"Session content (terminal output, session title / cwd / current command, command-finished notifications) is sent to the relay without end-to-end sealing, so the relay server itself can read it. Transport TLS (if enabled) still applies. Your account key stays loaded — only outbound sealing is paused. The title bar keeps a ⚠ Plaintext indicator while this is on.",saving:"saving...",saveConnect:"save & connect",clearTitle:"Clear relay info",clearHint:"Removes the saved relay address, account, and login info from this device. Open terminals are not affected.",clearAction:"Clear",clearing:"Clearing…",clearConfirm:"Clear all relay info saved on this device?",clearFailed:"Clear failed: {reason}",pairing:{title:"Mobile pairing",hint:"Generate a single-use QR code so a phone can attach to this relay without copy-pasting tokens.",generate:"Generate QR",generating:"generating...",regenerate:"Regenerate",expiresIn:"expires in",expired:"expired - generate a new code",wrappedBadge:"includes E2EE key",unwrappedWarning:"E2EE key is locked — mobile will connect but sealed session details won't decrypt. Log in with email + password in the Relay settings above to unlock."}},logging:{title:"desktop logs",noContent:"no log file content is available yet.",truncated:"showing the most recent portion of the log file.",writeLogs:"write logs to file",currentFile:"current log file",changeLocation:"change location",resetDefault:"reset default",viewLogs:"view logs",liveTail:"Live tail (auto-refreshes every 3s)",levelFilter:"Show",tagFilter:"Subsystem",tagFilterAll:"All",writeLevel:"Log level",writeLevelHint:"Minimum severity written to the file. DEBUG adds per-frame and per-keystroke tracing — useful when reproducing a problem, noisy otherwise.",ptyInputDebug:"Log terminal input bytes",ptyInputDebugHint:"Diagnose stuck or dropped input. Recorded regardless of the log level above.",tailPaused:"Paused",tailPausedHint:"Following paused while scrolled up — click or scroll to the bottom to resume"},updates:{devDisabled:"development build - auto-update disabled",checking:"checking...",readyToInstall:"{version} downloaded - ready to install",downloadingStatus:"downloading {version} ({pct}%)",available:"{version} available",upToDate:"up to date - last checked {ago}",notChecked:"not checked yet",justNow:"just now",minutesAgo:"{count} min ago",hoursAgo:"{count} h ago",daysAgo:"{count} d ago",currentVersion:"current version",status:"status",downloadPath:"download path",autoCheck:"automatically check for updates",ghProxy:"GitHub download proxy",proxyHint:"Optional. Only GitHub Release file downloads use this proxy; update checks and signature verification stay unchanged.",releaseNotes:"release notes",checkNow:"check now",versionLine:"{minor} line",downloadVersion:"download {version}",cancelDownload:"Cancel ({pct}%)",cancelling:"Cancelling…",redownload:"Redownload",redownloadPrompt:"{version} is already downloaded on this device. Redownload?",forceInstallRestart:"force install & restart",installTitle:"install AT Term {version}",installIntro:"AT Term will quit and relaunch on the new version.",installThisWill:" This will:",forceInstall:"force install",installRestart:"install & restart"},plugins:{hint:"Plugins are loaded on demand. Disabled plugins do not affect startup time or memory.",panelDragHint:"Panel width and inner ratio are adjusted by dragging in the panel. View options live in the file tree's context menu.",noneRegistered:"No plugins registered."},shortcuts:{keyboardShortcuts:"Keyboard Shortcuts",pane:"Pane",tab:"Tab",sidebar:"Sidebar",pressKey:"Press a key...",resetTo:"Reset to {binding}",conflictsWith:"Conflicts with: {labels}",resetAll:"Reset all to defaults",splitPaneVertically:"Split pane vertically",splitPaneHorizontally:"Split pane horizontally",closePane:"Close pane",focusPaneLeft:"Focus pane left",focusPaneRight:"Focus pane right",focusPaneUp:"Focus pane up",focusPaneDown:"Focus pane down",newTab:"New tab",previousTab:"Previous tab",nextTab:"Next tab",focusSidebarSearch:"Focus sidebar search",terminalSearch:"Search terminal"},diagnostics:{tab:"Diagnostics",section:"Diagnostics snapshot",hint:"Snapshot of the desktop runtime, with API tokens and headers redacted. Useful for bug reports.",copy:"Copy",export:"Export…",refresh:"Refresh",copied:"Copied to clipboard.",copyFailed:"Copy failed.",exported:"Saved to {path}"},feishu:{title:"Feishu Integration",disabled:"Feishu integration is not active.",relay_disabled:"The server (relay) has Feishu integration turned off.",load_error:"Couldn't fetch Feishu status: {error}",retry_status:"Retry",mode:{label:"Mode",options:{auto:"Auto (follow Relay login)",local:"Force Local (local LongConn)",relay:"Force Relay (depend on Relay)"},effective:{label:"Effective mode",fallbackWarn:"Relay requested but not effectively logged in"}},bound:"Bound to open_id: {open_id}",save:"Save Credentials",begin_pair:"Start Pair",pair_hint:'Send "/bind {code}" to the bot in private chat within 15 minutes.',delete:"Delete Binding",configured:"Credentials saved",app_id_label:"App ID",callback_label:"Event callback URL",callback_hint_relay:'In Feishu "Event Subscriptions", choose "Send events to developer server" and paste the URL above.',longconn_hint_local:'Local long-connection mode: in Feishu "Event Subscriptions", choose "Receive events via long connection" — no callback URL needed.',copy:"Copy",copied:"Copied",reconfigure:"Re-enter credentials",aiOnlyNotifications:"Notify for AI sessions only",remoteTerminal:{enable:"Enable Feishu remote terminal",autoAttachLabel:"Auto-attach sessions",autoAttach:{ai:"AI sessions only",all:"All sessions",none:"Never (manual attach)"}},hook_install:{enable:"Auto-install Claude Code hook",retry:"Retry",healthy:"Hook installed and healthy",needs_attention:"Hook needs attention",disabled:"Hook auto-install disabled"},test_send:{title:"Test send",hint:"Send a sample card to your bound Feishu account to verify the notification path works.",command_success:"Command finished (success)",command_failure:"Command finished (failure)",command_sealed:"Command finished (this device only)",waiting_input:"Waiting for input",sending:"Sending…",sent:"Sent — check Feishu",failed:"Send failed: {error}"}},templates:{tab:"Templates",intro:"Each template sends its text to the active session when clicked.",add:"Add template",label:"Label",text:"Send text",hotkey:"Hotkey (e.g. Alt+1)",showBar:"Show template bar above the terminal",save:"Save",edit:"Edit",delete:"Delete",reset:"Reset to defaults",resetConfirm:"Replace your list with the defaults?"},profiles:{tab:"Session profiles",intro:"A profile is a named launch configuration for new tabs and splits: shell, working directory, startup command, and environment variables.",precedenceHint:"New session order: an explicitly picked profile wins, then the default profile below, then falls back to General → default shell + your home directory. default shell is not replaced by profiles — it's what runs when no profile applies.",envPrivacyIntro:`Environment variables stay on this machine by default and are never synced. Turn on "sync these environment variables" per profile to send that profile's env, end-to-end encrypted, to your other devices.`,empty:"No profiles yet.",add:"Add profile",edit:"Edit",delete:"Delete",save:"Save",name:"Name",shellPlaceholder:"Shell path (leave blank to use default shell)",cwdPlaceholder:"Working directory (leave blank to use home)",shellUnset:"default shell",cwdUnset:"home directory",startupCmdPlaceholder:"Startup command (optional)",startupCmdHint:"Runs once the shell's first prompt appears, same as AI-session resume — not sent as raw keystrokes.",envPlaceholder:"KEY=value, one per line",envHint:"TERM is always protected: a profile can never override it, to keep terminal rendering correct.",syncEnv:"Sync these environment variables to my other devices",syncEnvOffHint:"Off (default): these environment variables stay on this machine only and are stripped before anything is synced. Every other field (name, shell, cwd, startup command) still syncs.",syncEnvOnHint:"On: these environment variables travel encrypted to your other signed-in devices, end-to-end sealed so the relay cannot read them.",setDefault:"Set as default",clearDefault:"Unset default",defaultBadge:"Default",nameRequired:"Name is required."},mobileSync:{locked:"Waiting for your account key — make sure you're signed in.",noData:"Nothing has synced from a desktop yet.",error:"Couldn't read the synced data: {error}"},mobileProfiles:{intro:"Profiles synced from your desktop, for reference only. Edit them on the machine that runs them.",empty:"Your desktop has no session profiles configured.",defaultBadge:"Default",shell:"Shell",cwd:"Working directory",startupCmd:"Startup command",env:"Environment",envNone:"None",envNotSynced:"Not synced from that machine",hostLabel:"Open on",noHosts:"No desktop found. Open a session on a desktop from this account first, so this phone can find it.",openButton:"Open",opening:"Opening…",openErrors:{unknown_profile:"That profile no longer exists on the desktop.",permission_denied:"That desktop is published read-only — it cannot start new sessions from a phone.",request_in_flight:"A session is already being created. Wait for it to finish before trying again.",duplicate_request_id:"That request was already sent. Wait for it to finish.",unknown_host_id:"That desktop isn't reachable right now.",invalid_request:"Couldn't send that request. Try again.",upstream_unavailable:"Couldn't reach that desktop. Try again.",session_create_busy:"That desktop is busy right now. Try again in a moment.",timeout:"Timed out waiting for that desktop to respond. It was not retried — check the desktop before trying again.",relay_not_configured:"Sign in to a relay on this phone first.",generic:"Couldn't start a session: {error}"}},mobileHosts:{intro:"SSH hosts synced from your desktop, for reference only. This device cannot connect to them.",empty:"Your desktop has no SSH hosts configured.",user:"User",port:"Port",tags:"Tags",note:"Note",jumpChain:"Reaches this host via a jump chain",proxyCommand:"Uses ProxyCommand — not dialable",key:"Key"},devices:{hint:"Devices signed in to this relay account.",refresh:"Refresh",signOutOthers:"Sign out other devices",signingOut:"Signing out…",signOutOthersConfirm:"Sign out every device except this one?",revoke:"Revoke",revoking:"Revoking…",revokeConfirm:"Revoke this device ({ua})?",currentTag:"Current",loginLine:"Signed in {time} · {ip}",timeFormat:"{y}-{m}-{d} {hh}:{mm}",empty:"No signed-in devices yet.",unknownUA:"Unknown device",notAuthenticated:"Log in to your relay account first (Settings → Relay)."},account:{title:"Account",email:"Email",logout:{button:"Log out",submitting:"Logging out..."},changePassword:{title:"Change password",oldPassword:"Current password",newPassword:"New password",confirmPassword:"Confirm new password",hintLength:"New password must be at least 8 characters.",hintMismatch:"Passwords do not match.",submit:"Update password",submitting:"Updating…",successToast:"Password updated"},dangerZone:{title:"Danger zone",warning:"Deleting your account is permanent and cannot be undone.",toggle:"Delete account",currentPassword:"Current password",typeEmailToConfirm:"Type your email to confirm",deleteButton:"Delete account",deleting:"Deleting…",confirmPrompt:"This action cannot be undone."},errors:{wrongPassword:"Current password is incorrect.",sessionExpired:"Your session has expired, please log in again.",rateLimited:"Too many attempts, please try again later.",network:"Network error.",generic:"Something went wrong, please try again."}}},mobile:{relayUrl:"Relay URL",email:"Email",password:"Password",passwordShow:"Show password",passwordHide:"Hide password",emailRequired:"Email is required",passwordRequired:"Password is required",invalidCredentials:"Invalid email or password",rateLimited:"Too many attempts, please try again later",loginButton:"Log in",allowInsecure:"Allow insecure HTTP/WS (non-loopback)",originRejected:"Relay rejected the origin. Start the relay with ATTERM_ORIGINS containing capacitor://localhost.",cannotReachRelay:"Cannot reach relay: {message}",relayUrlRequired:"relay URL is required",relayUrlMalformed:"invalid or malformed relay URL",relayUrlProtocol:"relay URL must start with http:// or https://",relayUrlNoPath:"relay URL must not contain a path, query, or fragment",relayUrlInsecure:'enable "Allow insecure HTTP/WS" to use http:// with a non-loopback host',taskSections:{needs_attention:"Needs attention",running:"Running",completed:"Completed",failed:"Failed",disconnected:"Disconnected"},taskStates:{idle:"idle",running:"running",waiting_input:"waiting input",completed:"completed",failed:"failed",disconnected:"disconnected",closed:"closed"},taskTypes:{ai:"AI",test:"Test",build:"Build",deploy:"Deploy"},started:"started",lastOutput:"last output",openBadge:"open",back:"Back",pasteClipboard:"Paste",pasteImage:"Image",pasteConfirm:"Paste",pastePreview:"Clipboard text",protectMode:{banner:"Tap-protect mode · enable Control mode below to type"},settings:{title:"Settings",back:"Back",language:"Language",templates:"Quick templates",auxKeys:"Shortcut keys",logout:"Log out",add:"Add",edit:"Edit",delete:"Delete",reset:"Reset to defaults",resetConfirm:"Replace your list with the defaults?",label:"Label",text:"Send text",seq:"Send bytes (\\r \\n \\t \\e \\xNN ^X)",showBar:"Show template bar above the terminal",save:"Save"},image:{prompt:"Add image",fromLibrary:"Photo Library",takePhoto:"Take Photo"},pairing:{connecting:"Pairing…",failed:"Pairing failed.",back:"Try again",scan:"Scan QR code",cameraDenied:"Camera permission required to scan the QR code.",noQrDetected:"No QR code detected — try again.",scanNotAvailable:"QR scanning is not available in this build — enter the relay URL manually below.",errInvalidUrl:"The QR code does not contain a valid pairing link.",errInvalidScheme:"QR scheme must be https. To pair with http, enable the insecure HTTP/WS toggle on the setup screen and rescan.",errPlatformUnsupported:"This platform does not support QR pairing.",errCannotReachRelay:"Cannot reach the relay. Check the QR address or your network, then try again.",errTimeout:"Pairing timed out after 15s. Confirm the relay is reachable, then try again.",errPairInvalid:"The pairing token is invalid or expired. Generate a new QR.",errCancelled:"Pairing cancelled.",errGeneric:"Pairing failed: {message}",stepParsing:"Parsing QR…",stepRequesting:"Contacting relay…",stepSaving:"Saving config…"},insecure:{warning:{title:"Insecure relay (HTTP)",body:"API tokens and terminal output are transmitted unencrypted. Use HTTPS in production.",dismiss:"Dismiss"}},selection:{copy:"Copy",send:"Send",cancel:"Cancel",copied:"Copied to clipboard",copyFailed:"Copy failed"}},tasks:{bulk:{selectedCount:"{count} selected",mergeTab:"Merge tab",mergeTooMany:"Merge up to 4",close:"Close ({count})",closeHint:"Close {count} open panes",closeNoneOpen:"None of the selected sessions are open in this window",cancel:"Cancel"},details:{title:"Session details",sessionId:"Session ID",type:"Type",host:"Host",cwd:"CWD",command:"Command",state:"State",startedAt:"Started",commandStartedAt:"Cmd started",commandEndedAt:"Cmd ended",commandDuration:"Cmd duration",commandExitCode:"Cmd exit code",unread:"Unread",pinned:"Pinned",paneLocation:"Open in",paneAt:"Tab {tab} · Pane {pane}",paneNone:"Not open in this window"},rowMenu:{details:"Details",merge:"Merge into new tab ({n})",closeSelected:"Close selected ({n})"},sidebar:{title:"Sessions",collapse:"Collapse sidebar (Cmd/Ctrl+B)",expand:"Expand sidebar (Cmd/Ctrl+B)",searchPlaceholder:"Search",openDrawer:"Open sidebar",closeDrawer:"Close sidebar"},preset:{iconOnly:{name:"Icon only",description:"Color + glyph carry the state. Most compact."},iconLabel:{name:"Icon + label",description:"Adds a short status label (Running / Waiting / Done) next to the icon. More explicit."}},pinned:{title:"Pinned",menuPin:"Pin to top",menuUnpin:"Unpin"},search:{empty:'No sessions match "{q}"'},markAllRead:"Mark all read",completedFold:"Completed",unreadBadge:"{count} unread",settings:{section:"Session bar",preset:"Display style",expandByDefault:"Expand session bar by default",groupBy:"Group by",groupByHost:"Host",groupByState:"State"}},plugins:{fileExplorer:{title:"File Explorer",description:"Side panel with file tree and read-only syntax-highlighted preview. Follows the active pane's cwd.",noActivePaneShort:"(no active pane)",noActivePane:"No active pane.",selectFile:"Select a file.",pinCurrentCwd:"Pin current cwd",unpinFollow:"Unpin (follow active pane)",showHidden:"Show hidden files",showLineNumbers:"Show line numbers in editor",searchFiles:"Search files",noSearchResults:"No matching files.",searchTruncated:"Showing first 200 matches.",fileChanged:"File changed on disk",reload:"Reload",tooLarge:"File too large to preview. Open externally.",binary:"Binary file - no preview.",errorPrefix:"Error: {message}",unexpectedContentType:"Unexpected file content type",unknownError:"Preview failed for an unknown reason",openInSystem:"Open in System App",unsupportedPreview:"Inline preview unavailable for this file type.",showAsCode:"View as code",showAsRender:"View as image",save:"Save",dontSave:"Don't Save",cancel:"Cancel",dirty:"Unsaved changes",staleModTime:"File was modified on disk since you opened it.",overwrite:"Overwrite",reloadDiscard:"Reload (discard changes)",confirmCloseTitle:"Save changes to {name}?",newFile:"New File",newFolder:"New Folder",rename:"Rename",delete:"Delete",copyPath:"Copy Path",sendToTerminal:"Send to Terminal",pathCopied:"Path copied",moveToTrash:"Move to Trash",confirmTrash:"Move {name} to Trash?",confirmHardDelete:"Permanently delete {name}? This cannot be undone.",saveFailed:"Save failed: {message}",sourceLabel:"File source",sourceActivePane:"Active pane",listingTruncated:"{path}: the host returned {shown} of {total} entries; the rest were not listed.",sshUpload:"Upload a file to {dir}",sshUploadDone:"Uploaded {name} to {dir}",sshUploadExists:"{path} already exists on the remote host. Nothing was written — there is no trash there, so an overwrite could not be undone. Rename or delete it first.",sshNoOpenExternal:"There is no way to hand a file on an SSH host to this machine's system apps.",sshNoInlineAsset:"This file type cannot be previewed inline from an SSH host.",sshNoRecursiveDelete:"{path} is a directory on an SSH host. Deleting one would remove everything inside it, permanently — there is no trash there and no way to undo it — so the panel does not offer it. Delete it from a terminal on that host instead.",sshBridgeDisposed:"This SSH file source was closed.",treeLoadFailed:"Could not list {path}: {message}",retry:"Try again"},deskWidget:{title:"Desk Widget",description:"A small always-on-top window showing which sessions are running, failed, or waiting for you — AI agents and plain shells alike. Click a row to jump to that tab.",aiOnly:"Only show AI sessions",aiOnlyHint:"Limits the widget to sessions running claude / codex / aider. Off by default: session state comes from OSC 133, so it works for any command."},translate:{title:"Translate",description:"Translate the selected text via an OpenAI-compatible API; result shown in a floating panel.",selection:"Translate selection",notConfigured:"Translate plugin not configured",closePanel:"Close translate panel",source:"Source",detected:"detected {lang}",target:"Target",translating:"Translating...",noResult:"No result yet.",recent:"Recent ({count})",baseUrl:"Base URL",apiKey:"API Key",model:"Model",defaultTargetLanguage:"Default target language",keyStoredPlaintext:"API key is stored plaintext in {path}.",extraParams:"Extra params",extraParamsHint:"JSON object merged into every request body (e.g. stream, top_p, max_tokens). Wins over defaults.",extraParamsInvalid:"Not a valid JSON object.",invalidExtraParams:"invalid extra params: {detail}",simplifiedChinese:"Chinese (Simplified)",targetEnglish:"English",targetJapanese:"Japanese",targetKorean:"Korean",targetGerman:"German",targetFrench:"French",targetSpanish:"Spanish",userCancelled:"user cancelled",requestTimedOut:"request timed out after {seconds}s",authFailed:"auth failed ({status})",rateLimited:"rate limited (429)",serverError:"server error ({status})",providerNonJson:"provider returned non-JSON outer envelope",missingTranslated:"missing translated",responseFormatUnsupported:"response_format unsupported"}},connHealth:{pillLabelConnecting:"connecting…",pillLabelReconnecting:"reconnecting…",pillLabelOff:"off",drawerTitle:"Connection health",drawerRttNow:"RTT (now)",drawerRttP50P95:"p50 / p95 (5 min)",drawerBytesIn:"↓ in",drawerBytesOut:"↑ out",drawerState:"State",drawerReconnectsLastHour:"Reconnects (1 h)",drawerReconnectsTime:"time",drawerReconnectsReason:"reason",drawerReconnectsDowntime:"downtime",drawerSeqGaps:"Seq gaps observed:"},startupUpdate:{title:"Update available",currentToLatest:"{current} → {latest}",releaseNotes:"release notes",statusAvailable:"{version} is available",statusDownloading:"downloading {version} ({pct}%)",statusReady:"{version} downloaded — ready to install",downloadInstall:"Download & install",cancel:"Cancel ({pct}%)",cancelling:"Cancelling…",installRestart:"Install & restart",later:"Later"},recovery:{dialog:{title:"Restore your previous session?",subtitleClean:"Last cleanly exited · {minutes} min ago",subtitleUnclean:"Last session ended unexpectedly · {minutes} min ago",btnRestoreAll:"Restore all {count}",btnRestoreSelected:"Restore {count} selected",btnDiscard:"Discard all",badgeResumable:"resumable",badgeFresh:"fresh (sid not captured)",badgeShell:"(no AI)",badgeUnclassified:"not classified as AI"},pane:{failed:"(failed)"}},snippets:{runOnHosts:"Run on hosts…",selectHosts:"Select hosts",pending:"Pending",running:"Running…",ok:"OK",failed:"Failed",error:"Error",exitCode:"Exit code {code}",truncated:"Output truncated",copyAll:"Copy all",cancel:"Cancel",noHostsSelected:"Select at least one host"},sync:{stateIdle:"Up to date",stateSyncing:"Syncing…",stateOffline:"Not syncing",stateError:"Sync failed",syncNow:"Sync now",lastSyncedNever:"Never synced",lastSyncedAt:"Last synced {time}",pendingKeys:"{count} change(s) waiting to sync",pulledAdopted:"Updated from another device: {keys}",pulledConflict:"Kept this device's version (changed elsewhere too): {keys}",keys:{locale_preference:"Language",quick_templates:"Quick templates",notifications_enabled:"Notifications",ai_notifications_only:"AI-only notifications",command_notify_threshold_seconds:"Command-finished notification threshold",shell_integration_enabled:"Shell integration",pinned_session_ids:"Pinned sessions",ssh_hosts_encrypted:"SSH hosts",terminal_theme:"Terminal theme",terminal_font_head:"Terminal font",terminal_font_size:"Terminal font size",terminal_line_height:"Terminal line height",terminal_cursor_style:"Cursor style",terminal_cursor_blink:"Cursor blink",terminal_scrollback:"Scrollback lines",default_shell:"Default shell",shortcut_bindings:"Keyboard shortcuts",profiles_encrypted:"Session profiles"}}},kw={common:{language:"语言",system:"跟随系统",english:"英语",simplifiedChinese:"简体中文",save:"保存",cancel:"取消",close:"关闭",refresh:"刷新",copy:"复制",paste:"粘贴",send:"发送",disconnect:"断开连接",connect:"连接",settings:"设置",loading:"加载中...",disabled:"已禁用",discard:"放弃",stay:"留在此处",delete:"删除",retry:"重试",unknown:"(未知)",countSessions:"{count} 个会话",countSessionsOne:"1 个会话",minimize:"最小化",maximize:"最大化",restore:"还原",yes:"是",no:"否"},app:{authInvalidToken:"API token 无效或已撤销。请在网页设置中生成新的 token。",authUserDisabled:"账号已禁用。请联系 relay 管理员。",sessionIdOwnerMismatch:"会话 ID 冲突。请重启桌面应用。",forbidden:"无权连接到此 relay。",openSettings:"打开设置",dismiss:"关闭提示",showPanel:"显示面板",hidePanel:"隐藏面板",startingFirstSession:"正在启动第一个会话...",waitingForSessionSelection:"等待会话选择...",noShellsFound:"此机器上找不到 shell",wailsBindingsUnavailable:"Wails 绑定不可用",wailsBindingsNotReady:"Wails 绑定尚未就绪",sessionAlreadyInTab:"该会话已在当前标签页",paneFull:"面板已满 - 请先关闭一个",splitFailed:"分屏失败:{message}",noActiveSession:"没有活动会话",noEndpoint:"没有 endpoint",pluginFailedToLoad:"插件“{title}”加载失败",startupFailureTitle:"AT Term 启动失败",startupFailureIntro:"桌面后端遇到了致命启动错误。终端会话尚未启动。",startupFailureLogPath:"日志文件",startupFailureCopy:"复制诊断信息",startupFailureCopied:"启动诊断信息已复制"},titlebar:{e2eeOffChip:"明文",e2eeOffTitle:"已禁用端到端加密:本机 agent 现在以明文向 relay 发送终端输出、会话标题 / cwd / 当前命令、命令完成通知。在 Settings → Remote relay 关闭即可恢复加密。"},terminal:{connecting:"连接中...",reconnecting:"重新连接中...",ended:"会话已结束",sessionEndedBanner:"[AT Term] 会话已结束(退出码 {exitCode})",connectionError:"连接错误",remoteHasTakenControl:"远端已接管控制",byHost:"来自 {host}",pressSpaceToTakeBack:"按空格取回控制",takeControl:"接管控制",clearBuffer:"清空缓冲区",search:{placeholder:"查找",next:"下一个匹配",prev:"上一个匹配",close:"关闭搜索",noResults:"无匹配"},sendSelection:"发送",pickImage:"图片",pickFile:"文件",emptyPaneHint:"[空面板 - 按 Cmd+N / Ctrl+N 填充]",remote:"远端",remotePrefix:"[远端] ",shellFallback:"shell",emptyTab:"(空)",tabDisconnectedSuffix:"(已断开)",closePaneTitle:"关闭面板 (Cmd+W / Ctrl+W)",dragPaneOut:"拖到标签条可独立成标签页",detachToTab:"独立标签页",alreadyOwnTab:"该会话已是独立标签页",remoteViewerWatching:"{count} 个远端查看者正在观看",relaySettings:"relay 设置",adminPanel:"管理面板",newTab:"新建标签页",starting:"启动中...",newTabProfileLabel:"新建标签页 / 分屏用的配置档",useDefaultProfile:"默认配置档",layoutVertical:"左右分屏",layoutHorizontal:"上下分屏",layoutGrid2x2:"2x2 网格分屏",sessionStatusOne:"{count} 个会话",sessionStatusMany:"{count} 个会话",uplinkOn:"uplink 已开启",imagePasteRequiresFull:"粘贴图片需要 full 远端权限",pasteSessionNotWritable:"当前会话暂时不可写入",clipboardEmpty:"剪贴板没有可粘贴的文本或图片",clipboardImageTooLarge:"剪贴板图片过大",clipboardImageToolsMissing:"请安装 xclip、wl-paste 或 xsel 以粘贴图片",readOnlySession:"会话为只读",websocketNotOpen:"websocket 未打开",imageTooLarge:"图片过大:{size} 字节,超过 {limit}",copyFailed:"复制失败",pasteFailed:"粘贴失败",driverNow:"你现在是控制者",viewerNow:"你现在是查看者",preview:{open:"预览 Web 服务",opening:"正在打开…",portPrompt:"输入远端桌面上 Web 服务的 loopback 端口(例如 3000)",targetHost:"远程服务 loopback 地址",additionalPort:"附加服务端口",pathPrefix:"路径前缀",addMapping:"添加服务映射",removeMapping:"移除服务映射",invalidPathPrefix:"附加服务映射必须使用不同的路径前缀(例如 /api、/ws)",desktopOnly:"远程预览仅在桌面客户端可用",requiresConnection:"请等待远程会话连接后再打开预览",requiresDriver:"请先接管远程会话,再打开预览",requiresFullPermission:"远程预览需要主机授予完整权限",invalidPort:"端口必须是 1–65535 的整数",noLongerAllowed:"打开过程中 Preview 权限已失效",openFailed:"无法打开远程预览:{error}",terminal:"终端",previewPort:"预览 :{port}",switch:"切换预览",closeThis:"关闭此预览",newPreview:"新开预览…",reconnecting:"正在重连…",frameTitle:"远程 Web 预览 :{port}",openInBrowser:"在系统浏览器打开",copyURL:"复制预览地址",urlCopied:"预览地址已复制",browserOpenFailed:"无法打开系统浏览器",copyFailed:"复制预览地址失败"},bellNotification:"{session} 中有响铃",commandFinishedNotification:"命令已完成 - 退出码 {exitCode} - {elapsed} - {session}",loadingHistoryBytes:"正在加载历史 - {bytes}",loadingHistoryProgress:"正在加载历史 {pct}% - {bytes} / {total}",contextMenu:{openLink:"打开链接",copyLink:"复制链接"},resize:"适配终端尺寸",link:{openFailed:"无法打开链接",openFailedNoHome:"无法解析 ~(拿不到 home 目录)"}},sessions:{local:"本地",remote:"远端",remoteSessions:"远端会话",hostIdTitle:"host_id {hostId}",sessionTitle:"会话 {sessionId}",cancelEsc:"取消 (esc)",endLocalSessionOne:"结束 {count} 个本地 shell 会话",endLocalSessionMany:"结束 {count} 个本地 shell 会话",detachRemoteSessionOne:"从 {count} 个远端会话分离",detachRemoteSessionMany:"从 {count} 个远端会话分离",runningProcessesTerminated:"(运行中的进程将被终止)",remotePtyKeepsRunning:"(远端 PTY 会继续在其主机上运行)",saveWorkFirst:"请先保存你的工作。",quitTitle:"退出 AT Term",closingWill:"关闭 AT Term 将会:",quit:"退出",closeSessionTitle:"关闭会话?",closeSessionBody:"确认关闭「{title}」?",closeSessionManyBody:"确认关闭 {count} 个会话?",closeAiSessionWarning:"这是 AI 会话,关闭前请确认任务已经结束或已保存需要的上下文。",closeRunningSessionWarning:"这是运行中的会话,关闭可能中断正在执行的命令。",closeLocalTerminateHint:"本地会话会被结束,运行中的进程将被终止。",closeRemoteDetachHint:"远端会话会从当前窗口分离,远端 PTY 会继续运行。",closeSessionConfirm:"确认关闭",unknownHost:"未知主机",thisMachine:"本机"},ssh:{tabHosts:"主机",tabKeys:"密钥",filterPlaceholder:"筛选主机…",newHost:"新建主机",newKey:"新建密钥",edit:"编辑",subtitleAuthKey:"密钥",subtitleAuthPassword:"密码",importedHosts:"已导入 {count} 台主机",hosts:{emptyTitle:"还没有保存的主机",emptySub:"添加一台主机后就能连接它,并在任意设备上接管这个会话。",clearTags:"清除",noMatchTitle:"没有匹配的主机",noMatchSub:"放宽筛选条件,或清除已选中的标签。",menuConnect:"连接",menuEdit:"编辑主机信息",menuDuplicate:"复制一份",menuCopySsh:"复制 SSH 命令",menuRemove:"移除"},keys:{emptyTitle:"还没有密钥",emptySub:"先在这里添加私钥,再在主机里引用它。",typeLabel:"类型 {type}",genericSubtitle:"SSH 密钥"},proxy:{jumpBadge:"经 {target}",commandBadge:"ProxyCommand",jumpReason:"经跳板机 {target} 连接。链路上每一跳都必须是 atterm 里已保存的主机——atterm 用那台主机自己的凭据登录它,绝不会把这台主机的凭据发过去。",commandReason:"配置了 ProxyCommand({command}):atterm 不会执行这条命令,所以这台主机不能直接连。"},hostKey:{title:"未知的主机密钥",direct:"未知的主机密钥。信任之前请先核对这个指纹:",jumpHop:"这个指纹属于 {name},是通往 {target} 途中的第 {hop} 跳,不是 {target} 本身。请对着 {name} 核对之后再信任:",targetHop:"这个指纹属于 {target},也就是你要连的那台主机(在链路上是第 {hop} 跳)。核对之后再信任:",chainNote:"链路上每台机器都会单独询问一次;接受这一台不代表接受其它任何一台。",accept:"接受并连接",reject:"取消"},hostDrawer:{titleNew:"新建主机",titleEdit:"编辑主机",address:"地址",addressPlaceholder:"IP 或主机名",label:"别名",labelPlaceholder:"可不填",port:"端口",tags:"标签",tagsPlaceholder:"用逗号分隔",removeTag:"移除 {tag}",username:"用户名",usernamePlaceholder:"user",authPassword:"密码",authKey:"密钥",identityFileLabel:"来自 ~/.ssh/config",identityFileHint:"先到「密钥」里导入这个私钥,再回来在下面选中它。",password:"密码",keepBlank:"(留空表示不修改)",keyPicker:"密钥",keyPickerAria:"SSH 密钥",noKeys:"还没有密钥。",addKey:"添加密钥",submitNew:"添加主机"},keyDrawer:{titleNew:"新建密钥",titleEdit:"编辑密钥",name:"名称",namePlaceholder:"例如 aws",pem:"私钥(PEM)",keepBlank:"(留空表示不修改)",passphrase:"口令",encryptedHint:"这个私钥是加密的,请在上面填写它的口令。",dropzone:"把私钥文件拖到这里导入",importFromFile:"从密钥文件导入",submitNew:"添加密钥",reveal:"查看已保存的私钥",hide:"隐藏",copy:"复制私钥"},startup:{sectionTitle:"启动命令",sectionHint:"给那些登录后先给一个菜单、而不是直接给 shell 的堡垒机用。每行会依次输入并回车,一行对应一个提示符——JumpServer 就是先在 Opt> 选资产,再在 ID> 选系统用户。",placeholder:"一行一个回答",delay:"步骤间隔(毫秒)",steps:"登录后会依次发送 {count} 步。"},forwards:{tab:"隧道",sectionTitle:"端口转发",sectionHint:"规则只是配置,要到「隧道」里手动启动才会生效。",add:"添加规则",remove:"删除这条规则",noRules:"还没有转发规则。",kindLocal:"本地",kindRemote:"远程",kindDynamic:"动态",kindLocalHint:"本机监听,每条连接由 SSH 主机去连目标(ssh -L)。",kindRemoteHint:"SSH 主机监听,它收到的每条连接由本机去连目标(ssh -R)。",kindDynamicHint:"本机以 SOCKS5 代理监听,每条连接自带目标地址,由 SSH 主机解析(ssh -D)。",bindAddr:"监听地址",bindPort:"端口",targetHost:"目标主机",targetPort:"目标端口",label:"备注",labelPlaceholder:"可不填",warnLocal:"监听 {addr} 而不是 127.0.0.1,意味着同网段的任何人都能经由你这台机器访问这个被转发的服务,不需要任何 SSH 凭据。这条规则会同步到你登录的每台设备,在那些设备上也这样监听。",warnRemote:"监听 {addr} 而不是 127.0.0.1,意味着 SSH 主机会接受同网段任何人的连接(不需要任何 SSH 凭据),并经由你这台机器转给下面的目标。远端 sshd 默认的 GatewayPorts 通常会拒绝这种绑定。这条规则会同步到你登录的每台设备。",warnDynamic:"监听 {addr} 而不是 127.0.0.1,会让它变成一个无认证的 SOCKS5 开放代理:同网段的任何人都能访问这台 SSH 主机能访问的一切,目标由调用方自己指定,用的是你的 SSH 凭据,在对端日志里显示成你。这条规则会同步到你登录的每台设备,在那些设备上也这样监听。",emptyTitle:"还没有转发规则",emptySub:"可以直接在这里新建,也可以在某台主机的「端口转发」里添加。",new:"新建隧道",newNeedsHost:"先保存一台 SSH 主机——隧道要跑在主机的连接上。",drawerTitleNew:"新建隧道",drawerTitleEdit:"编辑隧道",hostPicker:"SSH 主机",hostPickerAria:"这条隧道所走的 SSH 主机",hostPickerHint:"隧道走这台主机的连接——目标在跳板机后面时,这里选的就是跳板机。它会保存成这台主机的一条转发规则。",saveAndStart:"保存并启动",start:"启动",stop:"停止",dismiss:"清除",stateIdle:"未启动",stateRunning:"运行中",stateStopped:"已停止",conns:"已接受 {count} 条",dynamicTarget:"SOCKS5(目标由每条连接指定)",proxyBlocked:"这台主机不能启动隧道。",refresh:"刷新"},configImport:{open:"从 ~/.ssh/config 导入",title:"从 ~/.ssh/config 导入",loading:"正在读取 ~/.ssh/config…",emptyTitle:"没有可导入的主机",emptySub:"在 ~/.ssh/config 里没有找到可用的 Host 条目。",importableTitle:"可导入的主机({count})",skippedTitle:"已跳过({count})",overwriteBadge:"更新已有",overwriteTitle:"已保存的主机里已经有这个别名,导入会就地更新它",proxyBadge:"{label} · 不能直接连接",importing:"导入中…",confirm:"导入选中的主机({count})"}},settings:{title:"设置",tabs:{general:"通用",relay:"Relay",logging:"日志",updates:"更新",plugins:"插件",shortcuts:"快捷键",devices:"已登录设备",receivedFiles:"接收文件",mobileProfiles:"同步的配置",mobileHosts:"SSH 主机"},discardRelayTitle:"放弃未保存的 relay 更改?",discardRelayBody:"你对 relay URL、token、权限或 insecure mode 的编辑尚未保存。",general:{languageLabel:"语言",languageHint:"选择跟随系统时,会使用设备语言。",terminalTheme:"终端主题",terminalThemeHint:"立即应用到所有终端面板,并保存为本地桌面偏好。",terminalFont:"终端字体",terminalFontHint:"所选字体会排在内置回退链之前;中日韩字符仍由内置字体族渲染。",terminalFontSize:"字号",terminalLineHeight:"行高",terminalCursorStyle:"光标样式",terminalCursorStyleBlock:"方块",terminalCursorStyleUnderline:"下划线",terminalCursorStyleBar:"竖线",terminalCursorBlink:"光标闪烁",terminalScrollback:"回滚行数",terminalScrollbackHint:"当前设置下每个 pane 约占 {mb} MB,开几个就是几份。",notificationsBell:"终端响铃时显示系统通知",notificationsHint:"仅在 AT Term 窗口未聚焦时触发。",shellIntegration:"启用 shell 集成",shellIntegrationHint:"在会话启动时向 zsh / bash / fish / pwsh 注入 OSC 133 hooks,用于检测命令何时完成。仅影响新会话。",recoveryEnabled:"启动时检测并提示恢复上次会话",recoveryEnabledHint:"在启动时询问是否恢复上次的标签页和分屏。",defaultShell:"默认 shell",auto:"自动",customPath:"自定义路径...",defaultShellHint:"自动为新本地会话选择平台默认 shell。也可以选择检测到的 shell,或保存自定义 shell 路径,例如 Git Bash、PowerShell 7 或其他终端程序。",customShellPath:"自定义 shell 路径",customShellRequired:"必须填写自定义 shell 路径",saveCustom:"保存自定义项",webglRenderer:"使用 WebGL 终端渲染器",webglHint:"GPU 光栅化渲染可避免浅色主题在密集 TUI 输出中出现单元格残影。Linux 默认关闭,因为 NVIDIA 专有驱动 + X11 + WebKitGTK 会让光标/最后一个单元格晚一帧绘制,表现为可见输入延迟。仅影响新终端会话。",commandNotifyThreshold:"命令完成通知阈值(秒)",commandNotifyHint:"短于此时长的命令不会产生通知。需要启用 shell 集成。",pushNotifications:{title:"推送通知",enable:"启用推送通知",test:"发送测试通知",errors:{denied:"浏览器拒绝了通知权限。",disabled:"服务器已禁用推送通知。",keyFailed:"无法从 relay 获取推送密钥。",subscribeFailed:"浏览器订阅失败。",subscribeRejected:"relay 拒绝了此订阅。",generic:"推送通知请求失败。"}},themes:{classicLabel:"AT Term 经典",classicDescription:"当前的黑色终端外观。",nordLabel:"Nord / Arctic",nordDescription:"冷色低对比度深色调色板。",solarizedDarkLabel:"Solarized Dark",solarizedDarkDescription:"经典暖色低对比度深色调色板。",daylightLabel:"Daylight",daylightDescription:"适合明亮环境的浅色调色板。"}},configio:{title:"导入与导出",export:{title:"导出",hint:"将偏好设置、SSH 主机和会话配置导出为 JSON 文件,可拷贝到另一台设备上使用。文件中不会包含你的 SSH 密码或私钥。",includeEnvLabel:"包含未设置同步的会话配置环境变量(可能含有 API token 等敏感信息)",button:"导出…",exporting:"导出中…",success:"已保存到 {path}"},import:{title:"导入",hint:"选择之前导出的 JSON 文件。确认前不会应用任何更改。导入的 SSH 主机不会带来凭据:新增的主机需要之后在这里补充密码或私钥;如果某个已有主机的地址发生了变化,其已保存的凭据会为安全起见被清除,同样需要重新填写。",pickFile:"选择文件…",fileLabel:"文件:{name}",previewing:"正在读取文件…",fileReadError:"无法读取文件",previewError:"无法读取该文件:{error}",previewTitle:"预览 — 尚未应用",changesAdd:"新增",changesReplace:"替换",changesUnchanged:"无变化",noChanges:"没有需要变更的内容。",skippedTitle:"已跳过",apply:"应用导入",applying:"应用中…",applyError:"导入失败:{error}",appliedTitle:"导入已应用",appliedSummary:"已应用 {count} 项变更。"}},relay:{uplink:"Uplink",off:"关",on:"开",connectedAs:"已连接为 {identity}",notConfigured:"未配置",paused:"已暂停(保留配置)",connecting:"正在连接…",relayInvalid:"relay 地址无效",versionProbeFailed:"无法连接到 relay:{reason}",loginFailedInline:"登录失败:{reason}",credentialsRequired:"请填邮箱和密码",hint:"配置远端 atterm-relay 后,此机器上的会话可从其他设备附加。无人附加时,不会有字节离开此机器。",relayUrl:"relay url",email:"邮箱",password:"密码",passwordShow:"显示密码",passwordHide:"隐藏密码",modeLogin:"登录",modeRegister:"注册",noAccountPrompt:"没有账号?",haveAccountPrompt:"已有账号?",claimToken:"领取码(可选)",claimTokenPlaceholder:"claim_…",claimTokenHint:"粘贴 `atterm-relay` bootstrap 输出的领取码以注册为管理员账户;留空则注册为普通用户。",insecureMode:"信任自签证书",insecureWarning:"跳过该 relay 的 TLS 证书校验,使自签证书的 relay 可被连接。连接仍然是加密的,但能够中间人拦截的攻击者可冒充该 relay。仅对你自己掌控的 relay 启用(例如 atterm-relay 的自签 quick-start);对外公开服务请使用正式证书。",disableE2EE:"禁用端到端加密(测试 / 调试用)",disableE2EEWarning:"会话内容(终端输出、标题 / cwd / 当前命令、命令完成通知)将不经端到端封装直接发送给 relay,relay 服务器本身即可读取。传输层 TLS(若启用)仍然生效。账号密钥仍保留,仅暂停本机出站封装。开启期间标题栏会持续显示 ⚠ Plaintext 提醒。",saving:"保存中...",saveConnect:"保存并连接",clearTitle:"清理 relay 信息",clearHint:"这将清除本机保存的 relay 地址、账号和登录信息。已经打开的本地终端不受影响。",clearAction:"清理",clearing:"清理中…",clearConfirm:"确定要清除本机保存的 relay 信息吗?",clearFailed:"清理失败:{reason}",pairing:{title:"移动端配对",hint:"生成一次性二维码,让手机无需复制 token 即可接入此 relay。",generate:"生成二维码",generating:"生成中...",regenerate:"重新生成",expiresIn:"剩余",expired:"已过期 - 请重新生成",wrappedBadge:"含 E2EE 密钥",unwrappedWarning:"当前 E2EE 密钥未解锁 — 手机端扫码后将看不到会话详情。请先在上方 Relay 设置里用邮箱/密码登录以解锁。"}},logging:{title:"桌面日志",noContent:"暂时没有可用的日志文件内容。",truncated:"正在显示日志文件的最近部分。",writeLogs:"将日志写入文件",currentFile:"当前日志文件",changeLocation:"更改位置",resetDefault:"重置默认值",viewLogs:"查看日志",liveTail:"实时尾部(每 3 秒刷新)",levelFilter:"显示",tagFilter:"子系统",tagFilterAll:"全部",writeLevel:"日志级别",writeLevelHint:"写入文件的最低级别。DEBUG 会记录逐帧、逐按键的细节——复现问题时有用,平时很吵。",ptyInputDebug:"记录终端输入字节",ptyInputDebugHint:"排查输入丢失 / 卡死。不受上面的日志级别限制,勾选即记录。",tailPaused:"已暂停",tailPausedHint:"向上滚动时已暂停跟随 —— 点此或滚动到底部恢复"},updates:{devDisabled:"开发构建 - 自动更新已禁用",checking:"检查中...",readyToInstall:"{version} 已下载 - 可安装",downloadingStatus:"正在下载 {version} ({pct}%)",available:"{version} 可用",upToDate:"已是最新 - 上次检查 {ago}",notChecked:"尚未检查",justNow:"刚刚",minutesAgo:"{count} 分钟前",hoursAgo:"{count} 小时前",daysAgo:"{count} 天前",currentVersion:"当前版本",status:"状态",downloadPath:"下载路径",autoCheck:"自动检查更新",ghProxy:"GitHub 下载代理",proxyHint:"可选。只有 GitHub Release 文件下载会使用此代理;更新检查与签名验证保持不变。",releaseNotes:"发布说明",checkNow:"立即检查",versionLine:"{minor} 线",downloadVersion:"下载 {version}",cancelDownload:"取消 ({pct}%)",cancelling:"取消中…",redownload:"重新下载",redownloadPrompt:"本机已下载过 {version} 的安装包。是否重新下载?",forceInstallRestart:"强制安装并重启",installTitle:"安装 AT Term {version}",installIntro:"AT Term 将退出并以新版本重新启动。",installThisWill:" 这将:",forceInstall:"强制安装",installRestart:"安装并重启"},plugins:{hint:"插件按需加载。禁用的插件不会影响启动时间或内存。",panelDragHint:"可在面板中拖拽调整面板宽度和内部比例。显示选项在文件树的右键菜单中。",noneRegistered:"未注册插件。"},shortcuts:{keyboardShortcuts:"键盘快捷键",pane:"面板",tab:"标签页",sidebar:"侧栏",pressKey:"按一个键...",resetTo:"重置为 {binding}",conflictsWith:"冲突:{labels}",resetAll:"全部重置为默认值",splitPaneVertically:"垂直分割面板",splitPaneHorizontally:"水平分割面板",closePane:"关闭面板",focusPaneLeft:"聚焦左侧面板",focusPaneRight:"聚焦右侧面板",focusPaneUp:"聚焦上方面板",focusPaneDown:"聚焦下方面板",newTab:"新建标签页",previousTab:"上一个标签页",nextTab:"下一个标签页",focusSidebarSearch:"聚焦侧栏搜索",terminalSearch:"搜索终端"},diagnostics:{tab:"诊断",section:"诊断快照",hint:"桌面端运行时快照,API token 和请求头已脱敏。适合反馈问题时附上。",copy:"复制",export:"导出…",refresh:"刷新",copied:"已复制到剪贴板",copyFailed:"复制失败",exported:"已保存到 {path}"},feishu:{title:"飞书集成",disabled:"飞书集成尚未启用。",relay_disabled:"服务端(relay)已关闭飞书集成。",load_error:"无法获取飞书状态:{error}",retry_status:"重试",mode:{label:"模式",options:{auto:"自动(跟随 Relay 登录态)",local:"强制 Local(本机 LongConn)",relay:"强制 Relay(依赖 Relay 转发)"},effective:{label:"生效模式",fallbackWarn:"已请求 relay 但未登录 / UPLINK 关闭"}},bound:"已绑定到 open_id:{open_id}",save:"保存凭据",begin_pair:"开始绑定",pair_hint:"请在 15 分钟内向机器人发送私聊:/bind {code}",delete:"解绑",configured:"凭据已保存",app_id_label:"App ID",callback_label:"事件回调地址",callback_hint_relay:"在飞书「事件订阅」选择『将事件发送至开发者服务器』,并填入上面的地址。",longconn_hint_local:"本地长连接模式:在飞书「事件订阅」选择『使用长连接接收事件』,无需填回调地址。",copy:"复制",copied:"已复制",reconfigure:"重新配置凭据",aiOnlyNotifications:"仅 AI 会话通知",remoteTerminal:{enable:"启用飞书远程接管",autoAttachLabel:"自动接管会话",autoAttach:{ai:"仅 AI 会话",all:"所有会话",none:"不自动接管"}},hook_install:{enable:"自动安装 Claude Code Hook",retry:"重试",healthy:"Hook 已安装且健康",needs_attention:"Hook 需要修复",disabled:"Hook 自动安装已关闭"},test_send:{title:"测试发送",hint:"向已绑定的飞书账号发送一张测试卡片,验证通知链路是否打通。",command_success:"命令完成(成功)",command_failure:"命令完成(失败)",command_sealed:"命令完成(仅本机可见)",waiting_input:"等待输入",sending:"发送中…",sent:"已发送,请在飞书查看",failed:"发送失败:{error}"}},templates:{tab:"快捷模板",intro:"每个模板被点击时会把它的文本发到当前会话。",add:"新增模板",label:"标签",text:"发送文本",hotkey:"快捷键(如 Alt+1)",showBar:"在终端上方显示快捷模板栏",save:"保存",edit:"编辑",delete:"删除",reset:"恢复默认",resetConfirm:"用默认列表覆盖当前模板?"},profiles:{tab:"会话配置档",intro:"配置档(profile)是新开 tab / split 时用的一组命名启动配置:shell、启动目录、启动命令、环境变量。",precedenceHint:"新建会话的优先级:显式选的配置档 > 下面设置的默认配置档 > 通用设置里的默认 shell + 主目录。配置档不会取代默认 shell——没有配置档生效时,用的还是它。",envPrivacyIntro:"环境变量默认只留在这台机器,不会同步。想同步某个配置档的环境变量,在它上面单独打开「同步这些环境变量」。",empty:"还没有配置档。",add:"新增配置档",edit:"编辑",delete:"删除",save:"保存",name:"名称",shellPlaceholder:"shell 路径(留空则用默认 shell)",cwdPlaceholder:"启动目录(留空则用主目录)",shellUnset:"默认 shell",cwdUnset:"主目录",startupCmdPlaceholder:"启动命令(可选)",startupCmdHint:"在 shell 出现第一个提示符后执行一次,走的是 AI 会话恢复同一条路径——不是按原始按键发送。",envPlaceholder:"KEY=值,一行一个",envHint:"TERM 始终受保护:配置档无法覆盖它,以保证终端渲染正常。",syncEnv:"把这些环境变量同步到我的其他设备",syncEnvOffHint:"关闭(默认):这些环境变量只留在这台机器,同步前会被剥离;名称、shell、目录、启动命令等其余字段仍会同步。",syncEnvOnHint:"开启:这些环境变量会加密同步到你其他已登录的设备,端到端封装,relay 读不到明文。",setDefault:"设为默认",clearDefault:"取消默认",defaultBadge:"默认",nameRequired:"请填写名称。"},mobileSync:{locked:"正在等待账户密钥——请确认已登录。",noData:"还没有任何桌面同步过数据。",error:"无法读取同步的数据:{error}"},mobileProfiles:{intro:"从桌面同步的配置,仅供查看。请在运行它们的机器上编辑。",empty:"桌面上还没有会话配置。",defaultBadge:"默认",shell:"Shell",cwd:"工作目录",startupCmd:"启动命令",env:"环境变量",envNone:"无",envNotSynced:"未从该机器同步",hostLabel:"在此桌面打开",noHosts:"没有找到可用的桌面。请先在这个账号下的某台桌面上打开一个会话,这样手机才能发现它。",openButton:"打开",opening:"正在打开…",openErrors:{unknown_profile:"该配置在桌面上已不存在。",permission_denied:"该桌面以只读方式发布,无法从手机新建会话。",request_in_flight:"已有一个创建请求正在处理,请等它完成后再试。",duplicate_request_id:"该请求已发送过,请等它完成。",unknown_host_id:"暂时无法连接到该桌面。",invalid_request:"请求发送失败,请重试。",upstream_unavailable:"无法连接到该桌面,请重试。",session_create_busy:"该桌面当前繁忙,请稍后重试。",timeout:"等待桌面响应超时,系统不会自动重试——请先检查桌面状态再重试。",relay_not_configured:"请先在此手机上登录 relay。",generic:"无法创建会话:{error}"}},mobileHosts:{intro:"从桌面同步的 SSH 主机,仅供查看。此设备无法连接它们。",empty:"你的桌面还没有配置 SSH 主机。",user:"用户",port:"端口",tags:"标签",note:"备注",jumpChain:"需要通过跳板链才能到达此主机",proxyCommand:"使用 ProxyCommand——不能直接连接",key:"密钥"},devices:{hint:"此账号已登录的浏览器 / 桌面 / 移动设备。",refresh:"刷新",signOutOthers:"登出其他设备",signingOut:"登出中…",signOutOthersConfirm:"确定要登出除本机外的所有设备吗?",revoke:"撤销",revoking:"撤销中…",revokeConfirm:"确定要撤销此设备 ({ua}) 吗?",currentTag:"当前",loginLine:"登录于 {time} · {ip}",timeFormat:"{y}年{m}月{d}日 {hh}:{mm}",empty:"尚未有登录设备。",unknownUA:"未知设备",notAuthenticated:'请先在 "Relay" 页登录 relay 账号。'},account:{title:"账号",email:"邮箱",logout:{button:"退出登录",submitting:"退出中..."},changePassword:{title:"修改密码",oldPassword:"当前密码",newPassword:"新密码",confirmPassword:"确认新密码",hintLength:"新密码至少需要 8 位。",hintMismatch:"两次输入的密码不一致。",submit:"更新密码",submitting:"更新中…",successToast:"密码已更新"},dangerZone:{title:"危险区",warning:"注销账号是永久性操作,无法撤销。",toggle:"注销账号",currentPassword:"当前密码",typeEmailToConfirm:"输入你的邮箱以确认",deleteButton:"注销账号",deleting:"注销中…",confirmPrompt:"此操作不可恢复。"},errors:{wrongPassword:"旧密码不正确。",sessionExpired:"会话已过期,请重新登录。",rateLimited:"请稍后重试。",network:"网络错误。",generic:"操作失败,请重试。"}}},mobile:{relayUrl:"Relay URL",email:"邮箱",password:"密码",passwordShow:"显示密码",passwordHide:"隐藏密码",emailRequired:"请输入邮箱",passwordRequired:"请输入密码",invalidCredentials:"邮箱或密码错误",rateLimited:"操作过于频繁,请稍后再试",loginButton:"登录",allowInsecure:"允许 insecure HTTP/WS(非 loopback)",originRejected:"Relay 拒绝了此 origin。请启动 relay 时让 ATTERM_ORIGINS 包含 capacitor://localhost。",cannotReachRelay:"无法连接 relay:{message}",relayUrlRequired:"必须填写 relay URL",relayUrlMalformed:"relay URL 无效或格式错误",relayUrlProtocol:"relay URL 必须以 http:// 或 https:// 开头",relayUrlNoPath:"relay URL 不能包含路径、查询或片段",relayUrlInsecure:'若要将 http:// 用于非 loopback 主机,请启用 "允许 insecure HTTP/WS"',taskSections:{needs_attention:"需要处理",running:"运行中",completed:"已完成",failed:"失败",disconnected:"已断开"},taskStates:{idle:"空闲",running:"运行中",waiting_input:"等待输入",completed:"已完成",failed:"失败",disconnected:"已断开",closed:"已关闭"},taskTypes:{ai:"AI",test:"测试",build:"构建",deploy:"部署"},started:"开始于",lastOutput:"最近输出",openBadge:"已打开",back:"返回",pasteClipboard:"粘贴",pasteImage:"图片",pasteConfirm:"确认粘贴",pastePreview:"剪贴板文本",protectMode:{banner:"防误触模式 · 打开下方控制模式可输入"},settings:{title:"设置",back:"返回",language:"语言",templates:"快捷模板",auxKeys:"快捷按键",logout:"退出登录",add:"新增",edit:"编辑",delete:"删除",reset:"恢复默认",resetConfirm:"用默认列表覆盖当前设置?",label:"标签",text:"发送文本",seq:"发送字节(\\r \\n \\t \\e \\xNN ^X)",showBar:"在终端上方显示快捷模板栏",save:"保存"},image:{prompt:"添加图片",fromLibrary:"从相册选择",takePhoto:"拍照"},pairing:{connecting:"配对中…",failed:"配对失败",back:"重试",scan:"扫描二维码",cameraDenied:"需要相机权限才能扫描二维码",noQrDetected:"未识别到二维码,请重试",scanNotAvailable:"此版本暂不支持扫码功能,请在下方手动填入 relay 地址",errInvalidUrl:"二维码内容不是合法的配对链接",errInvalidScheme:"二维码地址不是 https,无法配对(如需 http 请回到设置打开 insecure 开关)",errPlatformUnsupported:"当前平台不支持二维码配对",errCannotReachRelay:"无法连接 relay,请检查二维码地址或网络后重试",errTimeout:"配对请求超时(15s),请确认 relay 可达后重试",errPairInvalid:"二维码配对令牌无效或已过期,请重新生成",errCancelled:"已取消配对",errGeneric:"配对失败:{message}",stepParsing:"解析二维码…",stepRequesting:"请求 relay 服务器…",stepSaving:"保存配置…"},insecure:{warning:{title:"不安全的 relay (HTTP)",body:"API token 和终端输出会以明文方式传输。生产环境请使用 HTTPS。",dismiss:"知道了"}},selection:{copy:"复制",send:"发送",cancel:"取消",copied:"已复制到剪贴板",copyFailed:"复制失败"}},tasks:{bulk:{selectedCount:"已选 {count}",mergeTab:"合并 tab",mergeTooMany:"最多合并 4 个",close:"关闭 ({count})",closeHint:"关闭 {count} 个已打开的 pane",closeNoneOpen:"选中集合中没有本窗口已打开的会话",cancel:"取消"},details:{title:"会话详细信息",sessionId:"Session ID",type:"类型",host:"主机",cwd:"工作目录",command:"命令",state:"状态",startedAt:"开始于",commandStartedAt:"命令开始",commandEndedAt:"命令结束",commandDuration:"命令耗时",commandExitCode:"退出码",unread:"未读",pinned:"已置顶",paneLocation:"所在位置",paneAt:"Tab {tab} · Pane {pane}",paneNone:"本窗口未打开"},rowMenu:{details:"详细信息",merge:"合并 tab ({n})",closeSelected:"关闭已打开 ({n})"},sidebar:{title:"会话",collapse:"折叠侧栏 (Cmd/Ctrl+B)",expand:"展开侧栏 (Cmd/Ctrl+B)",searchPlaceholder:"搜索",openDrawer:"打开侧栏",closeDrawer:"关闭侧栏"},preset:{iconOnly:{name:"仅图标",description:"用颜色 + 图标传达状态。最紧凑。"},iconLabel:{name:"图标 + 文案",description:"图标旁加一段「运行中 / 等待输入 / 已完成」文字。更直观。"}},pinned:{title:"置顶",menuPin:"置顶",menuUnpin:"取消置顶"},search:{empty:'搜索 "{q}" 无匹配会话'},markAllRead:"全部标已读",completedFold:"已完成",unreadBadge:"{count} 条未读",settings:{section:"会话栏",preset:"显示样式",expandByDefault:"默认展开会话栏",groupBy:"分组方式",groupByHost:"按主机",groupByState:"按状态"}},plugins:{fileExplorer:{title:"文件浏览器",description:"侧边面板,包含文件树和只读语法高亮预览。跟随当前面板的 cwd。",noActivePaneShort:"(无活动面板)",noActivePane:"无活动面板。",selectFile:"选择一个文件。",pinCurrentCwd:"固定当前 cwd",unpinFollow:"取消固定(跟随活动面板)",showHidden:"显示隐藏文件",showLineNumbers:"在编辑器中显示行号",searchFiles:"搜索文件名",noSearchResults:"没有匹配的文件。",searchTruncated:"仅显示前 200 个匹配项。",fileChanged:"磁盘上的文件已更改",reload:"重新加载",tooLarge:"文件过大,无法预览。请在外部打开。",binary:"二进制文件 - 无法预览。",errorPrefix:"错误:{message}",unexpectedContentType:"文件内容类型异常",unknownError:"预览失败,原因未知",openInSystem:"用系统应用打开",unsupportedPreview:"此文件类型暂不支持内嵌预览。",showAsCode:"看源码",showAsRender:"看渲染",save:"保存",dontSave:"不保存",cancel:"取消",dirty:"有未保存的更改",staleModTime:"文件在你打开后已被外部修改。",overwrite:"覆盖",reloadDiscard:"重新加载(放弃更改)",confirmCloseTitle:"是否保存对 {name} 的更改?",newFile:"新建文件",newFolder:"新建文件夹",rename:"重命名",delete:"删除",copyPath:"复制路径",sendToTerminal:"终端引用",pathCopied:"路径已复制",moveToTrash:"移到回收站",confirmTrash:"把 {name} 移到回收站?",confirmHardDelete:"永久删除 {name}?此操作无法撤销。",saveFailed:"保存失败:{message}",sourceLabel:"文件来源",sourceActivePane:"当前面板",listingTruncated:"{path}:共 {total} 项,主机只返回了 {shown} 项,其余未列出。",sshUpload:"上传文件到 {dir}",sshUploadDone:"已把 {name} 上传到 {dir}",sshUploadExists:"远端已存在 {path},没有写入任何内容——那边没有回收站,覆盖无法撤销。请先重命名或删除它。",sshNoOpenExternal:"SSH 主机上的文件无法交给本机的系统应用打开。",sshNoInlineAsset:"SSH 主机上的这类文件无法内嵌预览。",sshNoRecursiveDelete:"{path} 是 SSH 主机上的目录。删除它会连同里面的一切一起永久删除——那边没有回收站,也无法撤销——所以面板不提供这个操作。请在该主机的终端里删除。",sshBridgeDisposed:"该 SSH 文件来源已关闭。",treeLoadFailed:"无法列出 {path}:{message}",retry:"重试"},deskWidget:{title:"桌面挂件",description:"一个置顶的小窗口,显示哪些会话在跑、失败了、或者在等你输入——AI agent 和普通 shell 一视同仁。点会话行可直接跳到对应标签页。",aiOnly:"仅显示 AI 会话",aiOnlyHint:"只显示跑着 claude / codex / aider 的会话。默认关闭:会话状态来自 OSC 133,任何命令都适用。"},translate:{title:"翻译",description:"通过兼容 OpenAI 的 API 翻译选中文本,并在浮动面板中显示结果。",selection:"翻译选中文本",notConfigured:"翻译插件尚未配置",closePanel:"关闭翻译面板",source:"原文",detected:"检测到 {lang}",target:"目标语言",translating:"翻译中...",noResult:"还没有结果。",recent:"最近 ({count})",baseUrl:"Base URL",apiKey:"API Key",model:"模型",defaultTargetLanguage:"默认目标语言",keyStoredPlaintext:"API key 以明文存储在 {path}。",extraParams:"额外参数",extraParamsHint:"合并进每次请求 body 的 JSON 对象(例如 stream、top_p、max_tokens),会覆盖默认值。",extraParamsInvalid:"不是合法的 JSON 对象。",invalidExtraParams:"额外参数无效:{detail}",simplifiedChinese:"中文(简体)",targetEnglish:"英语",targetJapanese:"日语",targetKorean:"韩语",targetGerman:"德语",targetFrench:"法语",targetSpanish:"西班牙语",userCancelled:"用户已取消",requestTimedOut:"请求在 {seconds}s 后超时",authFailed:"认证失败 ({status})",rateLimited:"请求过于频繁 (429)",serverError:"服务器错误 ({status})",providerNonJson:"provider 返回的外层响应不是 JSON",missingTranslated:"缺少 translated 字段",responseFormatUnsupported:"不支持 response_format"}},connHealth:{pillLabelConnecting:"连接中…",pillLabelReconnecting:"重连中…",pillLabelOff:"已关闭",drawerTitle:"连接质量",drawerRttNow:"RTT(当前)",drawerRttP50P95:"p50 / p95(最近 5 分钟)",drawerBytesIn:"↓ 接收",drawerBytesOut:"↑ 发送",drawerState:"状态",drawerReconnectsLastHour:"最近 1 小时重连",drawerReconnectsTime:"时间",drawerReconnectsReason:"原因",drawerReconnectsDowntime:"断开时长",drawerSeqGaps:"观察到的序号跳跃:"},startupUpdate:{title:"有可用更新",currentToLatest:"{current} → {latest}",releaseNotes:"更新说明",statusAvailable:"{version} 可用",statusDownloading:"正在下载 {version}({pct}%)",statusReady:"{version} 已下载 — 可安装",downloadInstall:"下载并安装",cancel:"取消({pct}%)",cancelling:"正在取消…",installRestart:"安装并重启",later:"稍后"},recovery:{dialog:{title:"恢复上次的会话?",subtitleClean:"上次正常退出 · {minutes} 分钟前",subtitleUnclean:"上次异常结束 · {minutes} 分钟前",btnRestoreAll:"恢复全部 {count} 个",btnRestoreSelected:"恢复选中的 {count} 个",btnDiscard:"全部丢弃",badgeResumable:"可续接",badgeFresh:"无 sid(不自动续接)",badgeShell:"(无 AI)",badgeUnclassified:"未识别为 AI"},pane:{failed:"(已失败)"}},snippets:{runOnHosts:"在多台主机上运行…",selectHosts:"选择主机",pending:"等待中",running:"运行中…",ok:"成功",failed:"失败",error:"出错",exitCode:"退出码 {code}",truncated:"输出已截断",copyAll:"复制全部",cancel:"取消",noHostsSelected:"请至少选择一台主机"},sync:{stateIdle:"已是最新",stateSyncing:"同步中…",stateOffline:"未同步",stateError:"同步失败",syncNow:"立即同步",lastSyncedNever:"从未同步",lastSyncedAt:"上次同步 {time}",pendingKeys:"还有 {count} 项改动待同步",pulledAdopted:"已从其他设备更新:{keys}",pulledConflict:"保留了本机版本(其他设备也改过):{keys}",keys:{locale_preference:"语言",quick_templates:"快捷模板",notifications_enabled:"通知",ai_notifications_only:"仅 AI 通知",command_notify_threshold_seconds:"命令完成通知阈值",shell_integration_enabled:"Shell 集成",pinned_session_ids:"置顶会话",ssh_hosts_encrypted:"SSH 主机",terminal_theme:"终端主题",terminal_font_head:"终端字体",terminal_font_size:"终端字号",terminal_line_height:"终端行高",terminal_cursor_style:"光标样式",terminal_cursor_blink:"光标闪烁",terminal_scrollback:"回滚行数",default_shell:"默认 shell",shortcut_bindings:"键盘快捷键",profiles_encrypted:"会话配置"}}},sf={en:Cw,"zh-CN":kw},xw=[{labelKey:"common.system",value:"system"},{labelKey:"common.english",value:"en"},{labelKey:"common.simplifiedChinese",value:"zh-CN"}],er=H("system"),oc=H("en");let ul,Og=Bg,Yo;function Rw(e,t){if(e!=="system")return e;for(const n of t){const s=n.trim().toLowerCase();if(s!==""){if(s==="zh"||s.startsWith("zh-"))return"zh-CN";if(s==="en"||s.startsWith("en-"))return"en"}}return"en"}async function Tw(e={}){Yo==null||Yo(),Yo=void 0,ul=e.savePreference,Og=e.getLanguages??Bg;const t=e.loadPreference?await e.loadPreference():"system";er.value=Lw(t),Nd(),Yo=(e.listenLanguageChange??Aw)(()=>{Nd()})}async function Pw(e){const t=er.value,n=oc.value;er.value=e,Nd();try{await(ul==null?void 0:ul(e))}catch(s){throw er.value=t,Fg(n),s}}function on(e,t={}){const n=rf(sf[oc.value],e)??rf(sf.en,e);return n===void 0?e:Dw(n,t)}function Nd(){Fg(Rw(er.value,Og()))}function Fg(e){oc.value=e,Ew(e)}function Ew(e){typeof document>"u"||(document.documentElement.lang=e)}function Lw(e){return e==="en"||e==="zh-CN"||e==="system"?e:"system"}function rf(e,t){let n=e;for(const s of t.split(".")){if(!Mw(n)||!(s in n))return;n=n[s]}return typeof n=="string"?n:void 0}function Dw(e,t){return e.replace(/\{([A-Za-z0-9_]+)\}/g,(n,s)=>{const i=t[s];return i===void 0?n:String(i)})}function Mw(e){return typeof e=="object"&&e!==null}function Bg(){return typeof navigator>"u"?[]:navigator.languages.length>0?navigator.languages:[navigator.language]}function Aw(e){return typeof window>"u"?()=>{}:(window.addEventListener("languagechange",e),()=>window.removeEventListener("languagechange",e))}function $t(){return{t:on,languageOptions:xw,localePreference:er,resolvedLocale:oc,setLocalePreference:Pw}}function Iw(){return window.runtime.InitializeNotifications()}function $w(){return window.runtime.IsNotificationAvailable()}function Ow(){return window.runtime.RequestNotificationAuthorization()}function Fw(){return window.runtime.CheckNotificationAuthorization()}function Bw(e){return window.runtime.SendNotification(e)}function He(){var t,n;const e=(n=(t=window.go)==null?void 0:t.main)==null?void 0:n.App;if(!e)throw new Error(on("app.wailsBindingsNotReady"));return e}const Hg=1,Yi=6,Xi=16,Sn={OPEN:1,IN:2,OUT:3,RESIZE:4,META:5,CLOSE:6,ATTACH:16,LIST:17,LIST_RESP:18,REPLAY_PROGRESS:19,PREFS_CHANGED:20,PING:32,PONG:33,PASTE_IMAGE:51,CLAIM_DRIVER:52,PASTE_FILE:55,FS_REQUEST:56,FS_RESPONSE:57,FS_EVENT:58,SESSION_CREATE:59,SESSION_CREATED:60,SERVICE_OPEN:61,SERVICE_OPENED:62,SERVICE_CLOSE:63},Hw=new TextEncoder,Nw=new TextDecoder;function zw(e){const t=e.replace(/-/g,"");if(t.length!==32)throw new Error("bad uuid");const n=new Uint8Array(Xi);for(let s=0;s= 0, got ${e}`)}}function fa(e,t,n=""){const s=Kw(e),i=e==null?void 0:e.length;if(!s||t!==void 0){const d=n&&`"${n}" `,r="",o=s?`length=${i}`:`type=${typeof e}`,c=d+"expected Uint8Array"+r+", got "+o;throw s?new RangeError(c):new TypeError(c)}return e}function Bu(e){if(typeof e!="function"||typeof e.create!="function")throw new TypeError("Hash must wrapped by utils.createHasher");if(kl(e.outputLen),kl(e.blockLen),e.outputLen<1)throw new Error('"outputLen" must be >= 1');if(e.blockLen<1)throw new Error('"blockLen" must be >= 1')}function xl(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function zg(e,t){fa(e,void 0,"digestInto() output");const n=t.outputLen;if(e.length='+n)}function pa(...e){for(let t=0;t>>t}function ac(e){if(typeof e!="string")throw new TypeError("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Ww(e,t={}){const n=(i,a)=>e(a).update(i).digest(),s=e(void 0);return n.outputLen=s.outputLen,n.blockLen=s.blockLen,n.canXOF=s.canXOF,n.create=i=>e(i),Object.assign(n,t),Object.freeze(n)}function jw(e=32){kl(e,"bytesLength");const t=typeof globalThis=="object"?globalThis.crypto:null;if(typeof(t==null?void 0:t.getRandomValues)!="function")throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const qw=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function Yw(e,t,n){return e&t^~e&n}function Gw(e,t,n){return e&t^e&n^t&n}class Xw{constructor(t,n,s,i){Y(this,"blockLen");Y(this,"outputLen");Y(this,"canXOF",!1);Y(this,"padOffset");Y(this,"isLE");Y(this,"buffer");Y(this,"view");Y(this,"finished",!1);Y(this,"length",0);Y(this,"pos",0);Y(this,"destroyed",!1);this.blockLen=t,this.outputLen=n,this.padOffset=s,this.isLE=i,this.buffer=new Uint8Array(t),this.view=Nc(this.buffer)}update(t){xl(this),fa(t);const{view:n,buffer:s,blockLen:i}=this,a=t.length;for(let d=0;di-d&&(this.process(s,0),d=0);for(let u=d;up.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;ue<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,os=Er?e=>e:e=>Ug(e)>>>0,e1=e=>{for(let t=0;te:e1;function t1(e,t){if(t==null||typeof t!="object")throw new Error("options must be defined");return Object.assign(e,t)}function n1(e,t){if(e.length!==t.length)return!1;let n=0;for(let s=0;s[],a=(r,o)=>s(o,...i(r)).update(r).digest(),d=s(new Uint8Array(e),...i(new Uint8Array(0)));return a.outputLen=d.outputLen,a.blockLen=d.blockLen,a.create=(r,...o)=>s(r,...o),a}const i1=(e,t)=>{function n(s,...i){if(as(s,void 0,"key"),e.nonceLength!==void 0){const p=i[0];as(p,e.varSizeNonce?void 0:e.nonceLength,"nonce")}const a=e.tagLength;a&&i[1]!==void 0&&as(i[1],void 0,"AAD");const d=t(s,...i),r=(p,u)=>{if(u!==void 0){if(p!==2)throw new Error("cipher output not supported");as(u,void 0,"output")}};let o=!1;return{encrypt(p,u){if(o)throw new Error("cannot encrypt() twice with same key + nonce");return o=!0,as(p),r(d.encrypt.length,u),d.encrypt(p,u)},decrypt(p,u){if(as(p),a&&p.lengthUint8Array.from(e.split(""),t=>t.charCodeAt(0)),o1=Ji(Ei(Vg("expand 16-byte k"))),a1=Ji(Ei(Vg("expand 32-byte k")));function kt(e,t){return e<>>32-t}const Go=64,l1=16,Kd=2**32-1,lf=Uint32Array.of();function c1(e,t,n,s,i,a,d,r){const o=i.length,c=new Uint8Array(Go),p=Ei(c),u=Er&&va(i)&&va(a),g=u?Ei(i):lf,m=u?Ei(a):lf;if(!Er){for(let y=0;y=Kd)throw new Error("arx: counter overflow");const v=Math.min(Go,o-y);for(let l=0,h;l=Kd)throw new Error("arx: counter overflow");const v=Math.min(Go,o-y);if(u&&v===Go){const l=y/4;if(y%4!==0)throw new Error("arx: invalid block position");for(let h=0,f;h{as(r,void 0,"key"),as(o,void 0,"nonce"),as(c,void 0,"data");const g=c.length;if(p=Vd(g,p,!1),oa(u),u<0||u>=Kd)throw new Error("arx: counter overflow");const m=[];let y=r.length,v,l;if(y===32)m.push(v=Rl(r)),l=a1;else if(y===16&&n)v=new Uint8Array(32),v.set(r),v.set(r,16),l=o1,m.push(v);else throw as(r,32,"arx key"),new Error("invalid key size");(!Er||!va(o))&&m.push(o=Rl(o));let h=Ei(v);if(s){if(o.length!==24)throw new Error("arx: extended nonce must be 24 bytes");const S=o.subarray(0,16);if(Er)s(l,h,Ei(S),h);else{const k=Ji(Uint32Array.from(l));s(k,h,Ei(S),h),tr(k),Ji(h)}o=o.subarray(16)}else Er||Ji(h);const f=16-i;if(f!==o.length)throw new Error(`arx: nonce must be ${f} or 16 bytes`);if(f!==12){const S=new Uint8Array(12);S.set(o,a?0:12-o.length),o=S,m.push(o)}const _=Ji(Ei(o));try{return c1(e,l,h,_,c,p,u,d),p}finally{tr(...m)}}}function Zn(e,t){return e[t++]&255|(e[t++]&255)<<8}class u1{constructor(t){Y(this,"blockLen",16);Y(this,"outputLen",16);Y(this,"buffer",new Uint8Array(16));Y(this,"r",new Uint16Array(10));Y(this,"h",new Uint16Array(10));Y(this,"pad",new Uint16Array(8));Y(this,"pos",0);Y(this,"finished",!1);Y(this,"destroyed",!1);t=Rl(as(t,32,"key"));const n=Zn(t,0),s=Zn(t,2),i=Zn(t,4),a=Zn(t,6),d=Zn(t,8),r=Zn(t,10),o=Zn(t,12),c=Zn(t,14);this.r[0]=n&8191,this.r[1]=(n>>>13|s<<3)&8191,this.r[2]=(s>>>10|i<<6)&7939,this.r[3]=(i>>>7|a<<9)&8191,this.r[4]=(a>>>4|d<<12)&255,this.r[5]=d>>>1&8190,this.r[6]=(d>>>14|r<<2)&8191,this.r[7]=(r>>>11|o<<5)&8065,this.r[8]=(o>>>8|c<<8)&8191,this.r[9]=c>>>5&127;for(let p=0;p<8;p++)this.pad[p]=Zn(t,16+2*p)}process(t,n,s=!1){const i=s?0:2048,{h:a,r:d}=this,r=d[0],o=d[1],c=d[2],p=d[3],u=d[4],g=d[5],m=d[6],y=d[7],v=d[8],l=d[9],h=Zn(t,n+0),f=Zn(t,n+2),_=Zn(t,n+4),S=Zn(t,n+6),k=Zn(t,n+8),P=Zn(t,n+10),M=Zn(t,n+12),w=Zn(t,n+14);let T=a[0]+(h&8191),A=a[1]+((h>>>13|f<<3)&8191),E=a[2]+((f>>>10|_<<6)&8191),R=a[3]+((_>>>7|S<<9)&8191),D=a[4]+((S>>>4|k<<12)&8191),I=a[5]+(k>>>1&8191),O=a[6]+((k>>>14|P<<2)&8191),U=a[7]+((P>>>11|M<<5)&8191),W=a[8]+((M>>>8|w<<8)&8191),N=a[9]+(w>>>5|i),z=0,V=z+T*r+A*(5*l)+E*(5*v)+R*(5*y)+D*(5*m);z=V>>>13,V&=8191,V+=I*(5*g)+O*(5*u)+U*(5*p)+W*(5*c)+N*(5*o),z+=V>>>13,V&=8191;let j=z+T*o+A*r+E*(5*l)+R*(5*v)+D*(5*y);z=j>>>13,j&=8191,j+=I*(5*m)+O*(5*g)+U*(5*u)+W*(5*p)+N*(5*c),z+=j>>>13,j&=8191;let G=z+T*c+A*o+E*r+R*(5*l)+D*(5*v);z=G>>>13,G&=8191,G+=I*(5*y)+O*(5*m)+U*(5*g)+W*(5*u)+N*(5*p),z+=G>>>13,G&=8191;let te=z+T*p+A*c+E*o+R*r+D*(5*l);z=te>>>13,te&=8191,te+=I*(5*v)+O*(5*y)+U*(5*m)+W*(5*g)+N*(5*u),z+=te>>>13,te&=8191;let oe=z+T*u+A*p+E*c+R*o+D*r;z=oe>>>13,oe&=8191,oe+=I*(5*l)+O*(5*v)+U*(5*y)+W*(5*m)+N*(5*g),z+=oe>>>13,oe&=8191;let re=z+T*g+A*u+E*p+R*c+D*o;z=re>>>13,re&=8191,re+=I*r+O*(5*l)+U*(5*v)+W*(5*y)+N*(5*m),z+=re>>>13,re&=8191;let ye=z+T*m+A*g+E*u+R*p+D*c;z=ye>>>13,ye&=8191,ye+=I*o+O*r+U*(5*l)+W*(5*v)+N*(5*y),z+=ye>>>13,ye&=8191;let K=z+T*y+A*m+E*g+R*u+D*p;z=K>>>13,K&=8191,K+=I*c+O*o+U*r+W*(5*l)+N*(5*v),z+=K>>>13,K&=8191;let J=z+T*v+A*y+E*m+R*g+D*u;z=J>>>13,J&=8191,J+=I*p+O*c+U*o+W*r+N*(5*l),z+=J>>>13,J&=8191;let Q=z+T*l+A*v+E*y+R*m+D*g;z=Q>>>13,Q&=8191,Q+=I*u+O*p+U*c+W*o+N*r,z+=Q>>>13,Q&=8191,z=(z<<2)+z|0,z=z+V|0,V=z&8191,z=z>>>13,j+=z,a[0]=V,a[1]=j,a[2]=G,a[3]=te,a[4]=oe,a[5]=re,a[6]=ye,a[7]=K,a[8]=J,a[9]=Q}finalize(){const{h:t,pad:n}=this,s=new Uint16Array(10);let i=t[1]>>>13;t[1]&=8191;for(let r=2;r<10;r++)t[r]+=i,i=t[r]>>>13,t[r]&=8191;t[0]+=i*5,i=t[0]>>>13,t[0]&=8191,t[1]+=i,i=t[1]>>>13,t[1]&=8191,t[2]+=i,s[0]=t[0]+5,i=s[0]>>>13,s[0]&=8191;for(let r=1;r<10;r++)s[r]=t[r]+i,i=s[r]>>>13,s[r]&=8191;s[9]-=8192;let a=(i^1)-1;for(let r=0;r<10;r++)s[r]&=a;a=~a;for(let r=0;r<10;r++)t[r]=t[r]&a|s[r];t[0]=(t[0]|t[1]<<13)&65535,t[1]=(t[1]>>>3|t[2]<<10)&65535,t[2]=(t[2]>>>6|t[3]<<7)&65535,t[3]=(t[3]>>>9|t[4]<<4)&65535,t[4]=(t[4]>>>12|t[5]<<1|t[6]<<14)&65535,t[5]=(t[6]>>>2|t[7]<<11)&65535,t[6]=(t[7]>>>5|t[8]<<8)&65535,t[7]=(t[8]>>>8|t[9]<<5)&65535;let d=t[0]+n[0];t[0]=d&65535;for(let r=1;r<8;r++)d=(t[r]+n[r]|0)+(d>>>16)|0,t[r]=d&65535;tr(s)}update(t){af(this),as(t),t=Rl(t);const{buffer:n,blockLen:s}=this,i=t.length;for(let a=0;a>>0,t[a++]=s[d]>>>8}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const s=t.slice(0,n);return this.destroy(),s}}const h1=s1(32,e=>new u1(e));function f1(e,t,n,s,i,a=20){let d=e[0],r=e[1],o=e[2],c=e[3],p=t[0],u=t[1],g=t[2],m=t[3],y=t[4],v=t[5],l=t[6],h=t[7],f=i,_=n[0],S=n[1],k=n[2],P=d,M=r,w=o,T=c,A=p,E=u,R=g,D=m,I=y,O=v,U=l,W=h,N=f,z=_,V=S,j=k;for(let te=0;te{e.update(t);const n=t.length%16;n&&e.update(g1.subarray(n))},m1=new Uint8Array(32);function df(e,t,n,s,i){i!==void 0&&as(i,void 0,"AAD");const a=e(t,n,m1),d=r1(s.length,i?i.length:0,!0),r=h1.create(a);i&&cf(r,i),cf(r,s),r.update(d);const o=r.digest();return tr(a,d),o}const _1=e=>(t,n,s)=>({encrypt(a,d){const r=a.length;d=Vd(r+16,d,!1),d.set(a);const o=d.subarray(0,-16);e(t,n,o,o,1);const c=df(e,t,n,o,s);return d.set(c,r),tr(c),d},decrypt(a,d){d=Vd(a.length-16,d,!1);const r=a.subarray(0,-16),o=a.subarray(-16),c=df(e,t,n,r,s);if(!n1(o,c))throw tr(c),new Error("invalid tag");return d.set(a.subarray(0,-16)),e(t,n,d,d,1),tr(c),d}}),lc=i1({blockSize:64,nonceLength:24,tagLength:16},_1(v1));class uf{constructor(t,n){Y(this,"oHash");Y(this,"iHash");Y(this,"blockLen");Y(this,"outputLen");Y(this,"canXOF",!1);Y(this,"finished",!1);Y(this,"destroyed",!1);if(Bu(t),fa(n,void 0,"key"),this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,i=new Uint8Array(s);i.set(n.length>s?t.create().update(n).digest():n);for(let a=0;a{const e=(t,n,s)=>new uf(t,n).update(s).digest();return e.create=(t,n)=>new uf(t,n),e})();function y1(e,t,n){return Bu(e),n===void 0&&(n=new Uint8Array(e.outputLen)),Kg(e,n,t)}const zc=Uint8Array.of(0),hf=Uint8Array.of();function b1(e,t,n,s=32){Bu(e),kl(s,"length"),fa(t,void 0,"prk");const i=e.outputLen;if(t.length255*i)throw new Error("Length must be <= 255*HashLen");const a=Math.ceil(s/i);n===void 0?n=hf:fa(n,void 0,"info");const d=new Uint8Array(a*i),r=Kg.create(e,t),o=r._cloneInto(),c=new Uint8Array(r.outputLen);for(let p=0;pb1(e,y1(e,t,n),s,i),w1=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),zi=new Uint32Array(64);class S1 extends Xw{constructor(t){super(64,t,8,!1)}get(){const{A:t,B:n,C:s,D:i,E:a,F:d,G:r,H:o}=this;return[t,n,s,i,a,d,r,o]}set(t,n,s,i,a,d,r,o){this.A=t|0,this.B=n|0,this.C=s|0,this.D=i|0,this.E=a|0,this.F=d|0,this.G=r|0,this.H=o|0}process(t,n){for(let u=0;u<16;u++,n+=4)zi[u]=t.getUint32(n,!1);for(let u=16;u<64;u++){const g=zi[u-15],m=zi[u-2],y=ri(g,7)^ri(g,18)^g>>>3,v=ri(m,17)^ri(m,19)^m>>>10;zi[u]=v+zi[u-7]+y+zi[u-16]|0}let{A:s,B:i,C:a,D:d,E:r,F:o,G:c,H:p}=this;for(let u=0;u<64;u++){const g=ri(r,6)^ri(r,11)^ri(r,25),m=p+g+Yw(r,o,c)+w1[u]+zi[u]|0,v=(ri(s,2)^ri(s,13)^ri(s,22))+Gw(s,i,a)|0;p=c,c=o,o=r,r=d+m|0,d=a,a=i,i=s,s=m+v|0}s=s+this.A|0,i=i+this.B|0,a=a+this.C|0,d=d+this.D|0,r=r+this.E|0,o=o+this.F|0,c=c+this.G|0,p=p+this.H|0,this.set(s,i,a,d,r,o,c,p)}roundClean(){pa(zi)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),pa(this.buffer)}}class C1 extends S1{constructor(){super(32);Y(this,"A",Ni[0]|0);Y(this,"B",Ni[1]|0);Y(this,"C",Ni[2]|0);Y(this,"D",Ni[3]|0);Y(this,"E",Ni[4]|0);Y(this,"F",Ni[5]|0);Y(this,"G",Ni[6]|0);Y(this,"H",Ni[7]|0)}}const jg=Ww(()=>new C1,qw(1));ac("atterm-account-key-v1");function Hu(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),s=atob(t+n),i=new Uint8Array(s.length);for(let a=0;a255)throw new Error(`fs segments: bad segment count ${e.length}`);let t=1;for(const a of e){if(a.length>Xg)throw new Error("fs segments: segment too large");t+=4+a.length}const n=new Uint8Array(t),s=new DataView(n.buffer);n[0]=e.length;let i=1;for(const a of e)s.setUint32(i,a.length,!1),i+=4,n.set(a,i),i+=a.length;return n}function pf(e){if(e.length<1)return null;const t=e[0];if(t===0)return null;const n=new DataView(e.buffer,e.byteOffset,e.byteLength),s=[];let i=1;for(let a=0;ae.length)return null;const d=n.getUint32(i,!1);if(d>Xg||(i+=4,i+d>e.length))return null;s.push(e.slice(i,i+d)),i+=d}return i!==e.length?null:s}const vf=10*1024*1024,D1=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,M1=3e4,A1=3e4;function gf(e,t){return e!==WebSocket.OPEN?on("terminal.websocketNotOpen"):t>vf?on("terminal.imageTooLarge",{size:t,limit:vf}):null}function Wd(e){const t=new Uint8Array(e);let n="";const s=32768;for(let i=0;it?`${s}…`:s}class mf{constructor(t,n){Y(this,"ws",null);Y(this,"reconnectAttempts",0);Y(this,"reconnectTimer",null);Y(this,"detached",!1);Y(this,"listParseFailures",0);this.endpoint=t,this.handlers=n}attach(){this.detached||this.openWS()}detach(){if(this.detached=!0,this.reconnectTimer!==null&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws){try{this.ws.close()}catch{}this.ws=null}}openWS(){var s,i;if(this.detached)return;const t=Jg(this.endpoint,"/client-sessions");let n;try{n=t.protocols?new WebSocket(t.url,t.protocols):new WebSocket(t.url)}catch(a){this.handleOpenFailure(a,t);return}n.binaryType="arraybuffer",this.ws=n,(i=(s=this.handlers).onStatus)==null||i.call(s,this.reconnectAttempts===0?"connecting":"reconnecting"),n.onopen=()=>{var a,d;(d=(a=this.handlers).onStatus)==null||d.call(a,"attached")},n.onmessage=a=>{var o,c;let d;try{d=Ng(new Uint8Array(a.data))}catch{return}if(this.reconnectAttempts=0,d.type===Sn.PREFS_CHANGED){(c=(o=this.handlers).onPrefsChanged)==null||c.call(o);return}if(d.type!==Sn.LIST_RESP)return;let r;try{r=Zg(JSON.parse(Ci(d.payload)))}catch(p){this.noteUnusableListFrame(d.payload,p);return}this.listParseFailures=0;try{this.handlers.onSessions(r)}catch(p){Lt("conn","session list handler threw",{url:this.endpoint.url,error:Rt(p)})}},n.onclose=()=>{var d,r;if(this.ws=null,this.detached)return;(r=(d=this.handlers).onStatus)==null||r.call(d,"reconnecting");const a=Math.min(8e3,500*Math.pow(2,this.reconnectAttempts++));this.reconnectTimer=window.setTimeout(()=>this.openWS(),a)},n.onerror=()=>{}}noteUnusableListFrame(t,n){this.listParseFailures++;const s=this.listParseFailures;s!==1&&s%100!==0||Lt("conn","dropping unusable LIST_RESP",{url:this.endpoint.url,consecutive:s,payload_len:t.length,payload_head:U1(t),error:Rt(n)})}handleOpenFailure(t,n){var a,d,r;const s=t;if(Ks("conn","session-list: new WebSocket failed",{url:n.url,protocols:(a=n.protocols)==null?void 0:a.join(","),name:s==null?void 0:s.name,message:(s==null?void 0:s.message)??String(t)}),this.ws=null,(r=(d=this.handlers).onStatus)==null||r.call(d,"error"),this.detached)return;const i=Math.min(8e3,500*Math.pow(2,this.reconnectAttempts++));this.reconnectTimer=window.setTimeout(()=>this.openWS(),i)}}function V1(e,t){const n=Ti();if(!n)return ff([Fs(JSON.stringify(e))]);const s=Fs(JSON.stringify({path:e.path,new_path:e.new_path})),i=Gg(n,t,Sn.FS_REQUEST,s),a={...e};return delete a.path,delete a.new_path,ff([Fs(JSON.stringify(a)),i])}function _f(e){let t="";for(const n of e)t+=String.fromCharCode(n);return btoa(t)}class Qg{constructor(t,n,s={},i={}){Y(this,"ws",null);Y(this,"sidBytes");Y(this,"lastSeq",0);Y(this,"reconnectAttempts",0);Y(this,"reconnectTimer",null);Y(this,"detached",!1);Y(this,"suspended",!1);Y(this,"pendingResize",null);Y(this,"pendingInputs",[]);Y(this,"clientID");Y(this,"clientName");Y(this,"remote");Y(this,"currentDriverClientID","");Y(this,"isDriverRole",!1);Y(this,"recoverDriverIfVacant",!1);Y(this,"pendingFSRequests",new Map);Y(this,"retiredFSRequestIDs",new Set);Y(this,"fsEventHandlers",new Set);Y(this,"pendingServiceOpens",new Map);this.endpoint=t,this.sessionId=n,this.handlers=s,this.sidBytes=zw(n),this.clientID=crypto.randomUUID(),this.clientName=(i.clientName??"").trim()||$1(),this.remote=i.remote??!1}decryptOut(t,n){if(t.length<41||t[0]!==1)return t;const i=Ti();return i?T1(t,i,this.sessionId,n):null}attach(){this.detached||(this.suspended=!1,!(this.ws||this.reconnectTimer!==null)&&this.openWS())}suspend(){if(!this.detached&&(this.suspended=!0,this.rejectPendingFSRequests(new Error("filesystem request failed: connection suspended")),this.rejectPendingServiceOpens(new Error("service preview failed: connection suspended")),this.retiredFSRequestIDs.clear(),this.reconnectTimer!==null&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws)){try{this.ws.close()}catch{}this.ws=null}}detach(){if(this.detached=!0,this.suspended=!1,this.rejectPendingFSRequests(new Error("filesystem request failed: connection detached")),this.rejectPendingServiceOpens(new Error("service preview failed: connection detached")),this.retiredFSRequestIDs.clear(),this.reconnectTimer!==null&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws){try{this.ws.close()}catch{}this.ws=null}}sendFSRequest(t,n=M1){const s=this.ws;if(!s||s.readyState!==WebSocket.OPEN)return Promise.reject(new Error("filesystem request failed: websocket is not open"));const i=t.request_id||this.newUniqueFSRequestID();if(this.pendingFSRequests.has(i))return Promise.reject(new Error(`duplicate filesystem request_id: ${i}`));if(this.retiredFSRequestIDs.has(i))return Promise.reject(new Error(`retired filesystem request_id after timeout: ${i}`));const a={...t,request_id:i},d=V1(a,this.sessionId);return new Promise((r,o)=>{const c=window.setTimeout(()=>{this.pendingFSRequests.delete(i),this.retiredFSRequestIDs.add(i),o(new Error(`filesystem request timed out: ${i}`))},n);this.pendingFSRequests.set(i,{resolve:r,reject:o,timer:c});try{s.send(Ys(Sn.FS_REQUEST,this.sidBytes,d))}catch(p){window.clearTimeout(c),this.pendingFSRequests.delete(i),o(p instanceof Error?p:new Error(String(p)))}})}openService(t,n="localhost",s=A1){const i=this.ws;if(!i||i.readyState!==WebSocket.OPEN)return Promise.reject(new Error("service preview failed: websocket is not open"));if(!Number.isInteger(t)||t<1||t>65535)return Promise.reject(new Error("service preview failed: invalid port"));if(!["localhost","127.0.0.1","::1"].includes(n))return Promise.reject(new Error("service preview failed: target must be loopback"));const a=Ti();if(!a||a.length!==32)return Promise.reject(new Error("service preview requires unlocked E2EE"));const d=crypto.randomUUID(),r=crypto.randomUUID(),o=L1(a,r),c=Gg(a,this.sessionId,Sn.SERVICE_OPEN,Fs(JSON.stringify({port:t,scheme:"http",host:n}))),p=Fs(JSON.stringify({request_id:d,service_id:r,sealed:_f(c)}));return new Promise((u,g)=>{const m=window.setTimeout(()=>{this.pendingServiceOpens.delete(d),g(new Error("service preview timed out"))},s);this.pendingServiceOpens.set(d,{serviceId:r,resolve:u,reject:g,timer:m,clientToHostKey:o.clientToHost,hostToClientKey:o.hostToClient});try{i.send(Ys(Sn.SERVICE_OPEN,this.sidBytes,p))}catch(y){window.clearTimeout(m),this.pendingServiceOpens.delete(d),g(y instanceof Error?y:new Error(String(y)))}})}closeService(t){const n=this.ws;if(!(!n||n.readyState!==WebSocket.OPEN))try{n.send(Ys(Sn.SERVICE_CLOSE,this.sidBytes,Fs(JSON.stringify({service_id:t}))))}catch{}}onFSEvent(t){return this.fsEventHandlers.add(t),()=>{this.fsEventHandlers.delete(t)}}sendInput(t){if(!this.ws||this.ws.readyState===WebSocket.CONNECTING){this.pendingInputs.push(t);return}this.ws.readyState===WebSocket.OPEN&&this.ws.send(Ys(Sn.IN,this.sidBytes,Fs(t)))}claimDriver(){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)return;const t=Fs(JSON.stringify({client_id:this.clientID,client_name:this.clientName}));this.ws.send(Ys(Sn.CLAIM_DRIVER,this.sidBytes,t))}async sendPasteImage(t,n="clipboard-image"){var d,r;const s=this.ws,i=gf(s==null?void 0:s.readyState,t.size);if(i||!s)throw(r=(d=this.handlers).onStatus)==null||r.call(d,"error"),new Error(i??"websocket is not open");const a=Fs(JSON.stringify({filename:n,content_type:t.type||"image/png",data:Wd(await t.arrayBuffer())}));return Js("conn","sending paste image",{filename:n,contentType:t.type||"image/png",bytes:t.size}),s.send(Ys(Sn.PASTE_IMAGE,this.sidBytes,a)),!0}async sendPasteFile(t,n){var d,r;const s=this.ws,i=gf(s==null?void 0:s.readyState,t.size);if(i||!s)throw(r=(d=this.handlers).onStatus)==null||r.call(d,"error"),new Error(i??"websocket is not open");const a=Fs(JSON.stringify({filename:n,content_type:t.type||"application/octet-stream",data:Wd(await t.arrayBuffer())}));return Js("conn","sending paste file",{filename:n,contentType:t.type||"application/octet-stream",bytes:t.size}),s.send(Ys(Sn.PASTE_FILE,this.sidBytes,a)),!0}sendResize(t,n){if(this.ws&&this.ws.readyState===WebSocket.OPEN){this.ws.send(Ys(Sn.RESIZE,this.sidBytes,of(t,n))),this.pendingResize=null;return}this.pendingResize={cols:t,rows:n}}openWS(){var s,i;if(this.detached)return;const t=Jg(this.endpoint,"/client");let n;try{n=t.protocols?new WebSocket(t.url,t.protocols):new WebSocket(t.url)}catch(a){this.handleOpenFailure(a,t);return}n.binaryType="arraybuffer",this.ws=n,(i=(s=this.handlers).onStatus)==null||i.call(s,this.reconnectAttempts===0?"connecting":"reconnecting"),n.onopen=()=>{var d,r;this.retiredFSRequestIDs.clear(),this.recoverDriverIfVacant=this.isDriverRole,(r=(d=this.handlers).onStatus)==null||r.call(d,"attached");const a=Fs(JSON.stringify({session_id:this.sessionId,since_seq:this.lastSeq,client_id:this.clientID,client_name:this.clientName}));if(n.send(Ys(Sn.ATTACH,this.sidBytes,a)),this.pendingResize){const{cols:o,rows:c}=this.pendingResize;this.pendingResize=null,n.send(Ys(Sn.RESIZE,this.sidBytes,of(o,c)))}if(this.pendingInputs.length>0){const o=this.pendingInputs;this.pendingInputs=[];for(const c of o)n.send(Ys(Sn.IN,this.sidBytes,Fs(c)))}},n.onmessage=a=>{var r,o,c,p,u,g,m,y,v,l,h,f,_,S;let d;try{d=Ng(new Uint8Array(a.data))}catch{return}if(this.reconnectAttempts=0,d.type===Sn.OUT){const{seq:k,data:P}=Uw(d.payload);if(k>0&&k<=this.lastSeq){Js("conn","dropping duplicate OUT",{sessionId:this.sessionId,seq:k,lastSeq:this.lastSeq});return}const M=this.remote?this.decryptOut(P,k):P;M&&((o=(r=this.handlers).onOutput)==null||o.call(r,M)),k>this.lastSeq&&(this.lastSeq=k)}else if(d.type===Sn.CLOSE){try{const k=JSON.parse(Ci(d.payload));(p=(c=this.handlers).onClose)==null||p.call(c,k)}catch{(g=(u=this.handlers).onClose)==null||g.call(u,{exit_code:0})}(y=(m=this.handlers).onStatus)==null||y.call(m,"ended")}else if(d.type===Sn.META)try{const k=JSON.parse(Ci(d.payload)),P=Ti();if(P&&typeof k.sealed=="string"&&k.sealed.length>0){const A=Hu(k.sealed),E=E1(A,P,this.sessionId);E&&(E.cwd!==void 0&&(k.cwd=E.cwd),E.title!==void 0&&(k.title=E.title),E.current_command!==void 0&&(k.current_command=E.current_command))}(l=(v=this.handlers).onMeta)==null||l.call(v,k);const M=String(k.driver_client_id??""),w=String(k.driver_client_name??""),T=this.recoverDriverIfVacant;if(this.recoverDriverIfVacant=!1,T&&M==="")this.claimDriver();else if(M!==this.currentDriverClientID){this.currentDriverClientID=M;const A=M!==""&&M===this.clientID;this.isDriverRole=A,(f=(h=this.handlers).onDriverChange)==null||f.call(h,M,A,w)}}catch{}else if(d.type===Sn.REPLAY_PROGRESS)try{(S=(_=this.handlers).onReplayProgress)==null||S.call(_,JSON.parse(Ci(d.payload)))}catch{}else d.type===Sn.FS_RESPONSE?this.handleFSResponse(d.payload):d.type===Sn.FS_EVENT?this.handleFSEvent(d.payload):d.type===Sn.SERVICE_OPENED&&this.handleServiceOpened(d.payload)},n.onclose=a=>{var r,o;if(this.ws!==n||(this.ws=null,this.rejectPendingFSRequests(new Error("filesystem request failed: websocket closed")),this.rejectPendingServiceOpens(new Error("service preview failed: websocket closed")),this.retiredFSRequestIDs.clear(),this.detached||this.suspended))return;Lt("conn","session websocket closed",{sessionId:this.sessionId,code:a==null?void 0:a.code,reason:a==null?void 0:a.reason,wasClean:a==null?void 0:a.wasClean,attempt:this.reconnectAttempts}),(o=(r=this.handlers).onStatus)==null||o.call(r,"reconnecting");const d=Math.min(8e3,500*Math.pow(2,this.reconnectAttempts++));this.reconnectTimer=window.setTimeout(()=>this.openWS(),d)},n.onerror=()=>{}}handleOpenFailure(t,n){var a,d,r;const s=t;if(Ks("conn","session: new WebSocket failed",{url:n.url,protocols:(a=n.protocols)==null?void 0:a.join(","),sessionId:this.sessionId,name:s==null?void 0:s.name,message:(s==null?void 0:s.message)??String(t)}),this.ws=null,(r=(d=this.handlers).onStatus)==null||r.call(d,"error"),this.detached)return;const i=Math.min(8e3,500*Math.pow(2,this.reconnectAttempts++));this.reconnectTimer=window.setTimeout(()=>this.openWS(),i)}newFSRequestID(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`fs-${crypto.randomUUID()}`:`fs-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}handleServiceOpened(t){let n;try{n=JSON.parse(Ci(t))}catch{return}if(!n.request_id)return;const s=this.pendingServiceOpens.get(n.request_id);if(s){if(window.clearTimeout(s.timer),this.pendingServiceOpens.delete(n.request_id),!n.ok||!n.client_ticket||n.service_id!==s.serviceId){s.reject(new Error(n.error||"service preview rejected"));return}s.resolve({serviceId:s.serviceId,clientTicket:n.client_ticket,clientToHostKey:s.clientToHostKey,hostToClientKey:s.hostToClientKey})}}rejectPendingServiceOpens(t){for(const n of this.pendingServiceOpens.values())window.clearTimeout(n.timer),n.reject(t);this.pendingServiceOpens.clear()}newUniqueFSRequestID(){for(let t=0;t<5;t++){const n=this.newFSRequestID();if(!this.pendingFSRequests.has(n))return n}return`fs-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}handleFSResponse(t){const n=pf(t);if(!n)return;let s;try{const a=JSON.parse(Ci(n[0]));if(!z1(a))return;s=a}catch{return}if(n.length>1&&!this.openSealedFSResponse(s,n))return;const i=this.pendingFSRequests.get(s.request_id);i&&(window.clearTimeout(i.timer),this.pendingFSRequests.delete(s.request_id),i.resolve(s))}handleFSEvent(t){const n=pf(t);if(!n)return;let s;try{const i=JSON.parse(Ci(n[0]));if(!i||typeof i.watch_id!="string"||typeof i.event!="string")return;if(n.length>1){const a=Ti();if(!a)return;const d=hl(a,this.sessionId,Sn.FS_EVENT,n[1]);if(!d)return;const r=JSON.parse(Ci(d));i.path=r.path??""}if(typeof i.path!="string")return;s=i}catch{return}for(const i of this.fsEventHandlers)try{i(s)}catch(a){Lt("conn","fs event handler threw",{error:Rt(a)})}}openSealedFSResponse(t,n){const s=Ti();if(!s)return!1;const i=hl(s,this.sessionId,Sn.FS_RESPONSE,n[1]);if(!i)return!1;try{Object.assign(t,JSON.parse(Ci(i)))}catch{return!1}if(n.length>2){const a=hl(s,this.sessionId,Sn.FS_RESPONSE,n[2]);if(!a)return!1;const d=_f(a);t.content?t.content.data=d:t.chunk&&(t.chunk.data=d)}return!0}rejectPendingFSRequests(t){if(this.pendingFSRequests.size===0)return;const n=Array.from(this.pendingFSRequests.values());this.pendingFSRequests.clear();for(const s of n)window.clearTimeout(s.timer),s.reject(t)}}function Zg(e){const t=Ti();return t?e.map(n=>{if(!n.sealed)return n;try{const s=x1(Hu(n.sealed),t,n.id);if(!s)return n;const i={...n};return s.title!==void 0&&(i.title=s.title),s.cwd!==void 0&&(i.cwd=s.cwd),s.command!==void 0&&(i.command=s.command),s.current_command!==void 0&&(i.current_command=s.current_command),i}catch{return n}}):e}function K1(){return He().GetUplinkHealth()}function Tl(){return He().GetRelayConfig()}function yf(e){return He().SetRelayConfig({url:e.url,token:e.token,session_expires_at:e.session_expires_at??0,allow_insecure_relay:e.allow_insecure_relay??!1,disable_e2ee:e.disable_e2ee??!1,remote_permission:e.remote_permission??"full",last_email:e.last_email??"",connected:!1})}function W1(){return He().ClearRelayConfig()}function j1(e){return He().SetRelayDisableE2EE(e)}function q1(e){return He().SetUplinkPaused(e)}function Y1(e,t,n,s){return He().LoginRemoteRelay(e,t,n,s)}function G1(e,t,n,s,i){return He().RegisterRemoteRelay(e,t,n,s,i)}function X1(){return He().LoadSavedRelayPassword()}function J1(e){return He().RememberRelayPassword(e)}function Q1(e,t){return He().ProbeRelayVersion(e,t)}function bf(){return He().FetchRelayMe()}function Z1(){return He().CreatePairingToken()}function eS(e){return He().GetDiagnostics(e)}function tS(e){return He().ExportDiagnostics(e)}async function nS(){const e=await He().ListRemoteSessions(),t=JSON.parse(e);return Zg(t??[])}const sS={host:"",fingerprint:""};function iS(e){return He().NewSshSession(e)}function em(e,t=sS){return He().NewSshSessionByID(e,t)}function tm(){return He().ListSSHHosts()}function wf(e,t){return He().AddSSHHost(e,t)}function Vc(e,t){return He().UpdateSSHHost(e,t)}function rS(e){return He().DeleteSSHHost(e)}function oS(){return He().PreviewSSHConfigImport()}function aS(e){return He().ImportSSHHosts(e)}function lS(e,t){return He().StartForward(e,t)}function Sf(e,t){return He().StopForward(e,t)}function cS(){return He().ListActiveForwards()}function cZ(){return He().ListSFTPHosts()}function dZ(e,t){return He().SFTPListDir(e,t)}function uZ(e,t){return He().SFTPFileMeta(e,t)}function hZ(e,t,n){return He().SFTPReadFile(e,t,n)}function fZ(e,t,n,s,i){return He().SFTPWriteFile(e,t,Array.from(n),s,i)}function pZ(e,t){return He().SFTPCreateFile(e,t)}function vZ(e,t){return He().SFTPMkdir(e,t)}function gZ(e,t,n){return He().SFTPRename(e,t,n)}function mZ(e,t,n){return He().SFTPRemove(e,t,n)}function _Z(e){return He().SFTPDisconnect(e)}function dS(){return He().ListSSHKeys()}function uS(e,t,n){return He().AddSSHKey(e,t,n)}function hS(e,t,n,s){return He().UpdateSSHKey(e,t,n,s)}function fS(e){return He().DeleteSSHKey(e)}function Cf(e){return He().RevealSSHKey(e)}function kf(){return He().GetFeishuModePref()}function pS(e){return He().SetFeishuModePref(e)}function xf(){return He().GetFeishuEffectiveMode()}function Kc(){return He().GetFeishuRemoteTerminalSettings()}function Rf(e,t){return He().SetFeishuRemoteTerminalSettings(e,t)}function vS(){return He().GetFeishuStatus()}function gS(e){return He().SetFeishuCredentials(e)}function mS(){return He().BeginFeishuPair()}function _S(){return He().DeleteFeishuBinding()}function yS(e){return He().SendFeishuTestCard(e)}function bS(){return He().GetHookInstallState()}function Tf(e){return He().SetHookInstallEnabled(e)}function nm(){return He().GetTaskPreset()}function wS(e){return He().SetTaskPreset(e)}function SS(){return He().GetTaskGroupBy()}function CS(e){return He().SetTaskGroupBy(e)}function sm(){return He().GetTaskSidebarCollapsed()}function im(e){return He().SetTaskSidebarCollapsed(e)}function kS(){return He().GetTaskSidebarWidth()}function xS(e){return He().SetTaskSidebarWidth(e)}function RS(e){return"all"in e&&e.all?He().MarkSessionsSeen([],!0):He().MarkSessionsSeen(e.ids,!1)}function TS(e,t,n,s){return He().BroadcastCommandFinished(e,t,n,s)}function fo(){return He().GetUpdateState()}function rm(){return He().CheckUpdate()}function om(){return He().StartDownload()}function PS(e){return He().DownloadVersion(e)}function am(){return He().CancelDownload()}function Pf(e){return He().ForceRedownload(e)}function lm(){return He().InstallUpdate()}function cm(){return He().GetAutoCheckUpdates()}function ES(e){return He().SetAutoCheckUpdates(e)}function Ef(){return He().GetUpdateGHProxyURL()}function LS(e){return He().SetUpdateGHProxyURL(e)}function DS(){return He().LoadRecoverySnapshot()}function MS(e){return He().SaveRecoverySnapshot(JSON.stringify(e))}function AS(){return He().DiscardRecoverySnapshot()}function dm(){return He().GetRecoveryDialogEnabled()}function IS(e){return He().SetRecoveryDialogEnabled(e)}function $S(e,t,n){return He().RunSnippetOnHosts(e,t,n)}function OS(e){return He().CancelSnippetRun(e)}function FS(){return He().GetSyncStatus()}function BS(){return He().SyncNow()}function HS(e){return He().ExportConfig(e)}function NS(e){return He().PreviewConfigImport(e)}function zS(e){return He().ApplyConfigImport(e)}let fl,Yd=0;function US(){fl=void 0,Yd=0}async function VS(){return fl||(fl=(async()=>{try{return await $w()?(await Iw(),await Fw()?!0:await Ow()):!1}catch{return!1}})()),fl}function KS(){return He().GetClipboardPastePayload()}function WS(){const e=He();return e.GetStartupError?e.GetStartupError():Promise.resolve({fatal:!1,message:"",log_path:""})}function jS(){return He().GetEndpoint()}function um(e){return He().NewSession(e)}function Lf(e){return He().CloseSession(e)}let Zo=null;function Nu(){return Zo||(Zo=He().ListShells().catch(e=>{throw Zo=null,e})),Zo}function hm(){return He().GetHostInfo()}function Xo(){return He().GetLoggingConfig()}function Ya(e){return He().SetLoggingConfig({enabled:e.enabled,path:e.path??"",effective_path:"",dev_dual_output:!1,level:e.level??""})}function qS(){return He().PickLogFilePath()}function fm(){return He().GetLogPreview()}function pm(){return He().GetTerminalTheme()}function YS(e){return He().SetTerminalTheme(e)}function vm(){return He().GetShortcutBindings()}function GS(e){return He().SetShortcutBindings(e)}function gm(){return He().GetTerminalFontHead()}function XS(e){return He().SetTerminalFontHead(e)}function mm(){return He().GetTerminalFontSize()}function JS(e){return He().SetTerminalFontSize(e)}function _m(){return He().GetTerminalLineHeight()}function QS(e){return He().SetTerminalLineHeight(e)}function ym(){return He().GetTerminalCursorStyle()}function ZS(e){return He().SetTerminalCursorStyle(e)}function bm(){return He().GetTerminalCursorBlink()}function eC(e){return He().SetTerminalCursorBlink(e)}function wm(){return He().GetTerminalScrollback()}function tC(e){return He().SetTerminalScrollback(e)}function nC(){return He().GetLocalePreference()}function sC(){return He().GetDefaultShell()}async function Df(e){await He().SetDefaultShell(e),Zo=null}function Wc(){return He().ConfirmQuit()}function Sm(){return He().GetNotificationsEnabled()}function iC(e){return He().SetNotificationsEnabled(e)}function Mf(){return He().GetAINotificationsOnly()}function rC(e){return He().SetAINotificationsOnly(e)}function oC(){return He().GetPtyInputDebugEnabled()}function aC(e){return He().SetPtyInputDebugEnabled(e)}async function Af(e,t,n){try{if(!await Sm())return}catch(s){Js("notify","enabled-lookup failed; defaulting to allow",{error:Rt(s)})}if(await VS())try{Yd+=1,await Bw({id:`atterm-${Date.now()}-${Yd}`,title:e,body:t,...n?{data:n}:{}});return}catch{US()}return He().ShowNotification(e,t)}function lC(){return He().GetShellIntegrationEnabled()}function cC(e){return He().SetShellIntegrationEnabled(e)}function Cm(){return He().GetWebglRendererEnabled()}function dC(e){return He().SetWebglRendererEnabled(e)}function km(){return He().GetCommandNotifyThresholdSeconds()}function uC(e){return He().SetCommandNotifyThresholdSeconds(e)}function zu(){return He().GetUserHomeDir()}function xm(){const e=He();return e.GetProfiles?e.GetProfiles():Promise.resolve([])}function hC(e){const t=He();return t.SetProfiles?t.SetProfiles(e):Promise.reject(new Error("SetProfiles binding is not available"))}function fC(){const e=He();return e.GetDefaultProfileID?e.GetDefaultProfileID():Promise.resolve("")}function pC(e){const t=He();return t.SetDefaultProfileID?t.SetDefaultProfileID(e):Promise.reject(new Error("SetDefaultProfileID binding is not available"))}const Rm={idle:"#6b7280",running:"#06b6d4",waiting_input:"#f59e0b",completed:"#22c55e",failed:"#ef4444",disconnected:"#6b7280",closed:"#6b7280"};function Tm(e){return Rm[e]}function If(e,t){return{id:e,i18nKey:`tasks.preset.${e}`,colorOf:n=>Rm[n],textOpacity:1,showLabel:t}}const ea={iconOnly:If("iconOnly",!1),iconLabel:If("iconLabel",!0)};function Pm(e){const t=H(e.defaultValue);let n=!1;async function s(){try{const r=await e.load();if(e.isValid(r)){t.value=r;return}}catch{}if(typeof localStorage<"u"){const r=localStorage.getItem(e.storageKey);e.isValid(r)&&(t.value=r)}}function i(){n||(n=!0,s())}async function a(r){t.value=r;try{await e.save(r)}catch{typeof localStorage<"u"&&localStorage.setItem(e.storageKey,String(r))}}function d(){n=!1,t.value=e.defaultValue}return{activeId:t,ensureLoaded:i,set:a,__resetForTests:d}}function vC(e){return e==="iconOnly"||e==="iconLabel"}const Ga=Pm({defaultValue:"iconOnly",storageKey:"taskPreset",load:()=>nm(),save:e=>wS(e),isValid:vC});function Uu(){Ga.ensureLoaded();const e=q(()=>ea[Ga.activeId.value]);return{activeId:Ga.activeId,active:e,setPreset:Ga.set}}const gC=125,Em=H(0);let oo=0,ao=null,Gd=0;function Lm(e){e-Gd>=gC&&(Gd=e,Em.value++),oo>0&&(ao=requestAnimationFrame(Lm))}function mC(){oo++,oo===1&&ao===null&&(Gd=performance.now(),ao=requestAnimationFrame(Lm))}function _C(){oo!==0&&(oo--,oo===0&&ao!==null&&(cancelAnimationFrame(ao),ao=null))}function Dm(){return{phase:Em,acquire:mC,release:_C}}const yC=["data-state","data-unread"],bC=["width","height"],wC=["fill"],SC=["transform"],CC=["stroke","transform"],kC=["stroke"],xC=["stroke"],RC=["stroke"],TC=["r","fill"],PC=["fill"],$f="#0d1117",hi=Ae({__name:"TaskStateIcon",props:{state:{},size:{default:12},preset:{},unread:{type:Boolean,default:!1}},setup(e){const t=e,n=Uu(),s=q(()=>t.preset??n.active.value),i=q(()=>t.unread),a=q(()=>s.value.colorOf(t.state)),d=q(()=>i.value?$f:a.value),r=Dm(),o=q(()=>t.state==="running"),c=q(()=>o.value?r.phase.value*30%360:0),p=q(()=>o.value?`rotate(${c.value} 8 8)`:void 0);let u=!1;return _t(o,g=>{g&&!u?(u=!0,r.acquire()):!g&&u&&(u=!1,r.release())},{immediate:!0}),Vt(()=>{u&&(u=!1,r.release())}),(g,m)=>($(),F("span",{class:"task-state-icon",style:tn({color:a.value,display:"inline-flex",alignItems:"center",gap:"2px"}),"data-state":g.state,"data-unread":i.value?"true":void 0},[($(),F("svg",{width:g.size,height:g.size,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{overflow:"visible"}},[i.value?($(),F("circle",{key:0,class:"task-unread-disc",cx:"8",cy:"8",r:"7.5",fill:a.value},null,8,wC)):Z("",!0),b("g",{transform:i.value?"translate(8,8) scale(0.62) translate(-8,-8)":void 0},[g.state==="running"?($(),F("path",{key:0,class:"task-running-arc",d:"M14 8 a6 6 0 1 1 -3 -5.196",stroke:d.value,"stroke-width":"2","stroke-linecap":"round",transform:p.value},null,8,CC)):g.state==="completed"?($(),F("path",{key:1,class:"task-completed-check",d:"M3 8 l3 3 l7 -7",stroke:d.value,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,kC)):g.state==="failed"?($(),F("path",{key:2,d:"M4 4 L12 12 M12 4 L4 12",stroke:d.value,"stroke-width":"2","stroke-linecap":"round"},null,8,xC)):g.state==="waiting_input"?($(),F("path",{key:3,class:"task-waiting-prompt",d:"M3 4.5 L6.5 8 L3 11.5 M8 11.5 H13",stroke:d.value,"stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,8,RC)):($(),F("circle",{key:4,cx:"8",cy:"8",r:i.value?3.2:2,fill:d.value},null,8,TC))],8,SC),i.value?($(),F(Ie,{key:1},[b("circle",{cx:"12.6",cy:"3.4",r:"3.3",fill:$f}),b("circle",{class:"task-unread-dot",cx:"12.6",cy:"3.4",r:"2.5",fill:a.value},null,8,PC)],64)):Z("",!0)],8,bC))],12,yC))}});function Vu(e,t){switch(e){case"running":return t("mobile.taskStates.running");case"waiting_input":return t("mobile.taskStates.waiting_input");case"completed":return t("mobile.taskStates.completed");case"failed":return t("mobile.taskStates.failed");case"disconnected":return t("mobile.taskStates.disconnected");case"closed":return t("mobile.taskStates.closed");default:return t("mobile.taskStates.idle")}}function Mm(e){return e.current_command||e.title||e.session_id.slice(0,8)}function Or(e){const t=Mm(e),n=t.split(/\s+/)[0]||t;return n.split("/").pop()||n}function Am(e){const t=Mm(e);return e.cwd?`${t} -${e.cwd}`:t}function EC(e){const t=(e??"").replace(/\/+$/,"");return t?t.split("/").pop()??"":""}function LC(e){return e.replace(/^[\s::;·•∙.∷⋮⋯\u2800-\u28ff]+/u,"").trim()}function Im(e,t,n){if(!t)return"";const s=EC(n);if(!s)return"";const i=LC(e);return Or({current_command:t,title:"",session_id:""})!=="codex"?"":i===s?i:""}function DC(e){if(e.type!=="ai")return"";const t=(e.title??"").trim();if(!t)return"";const n=Im(t,e.current_command,e.cwd);return n||t}function MC(e){const t=(e.title??"").trim();if(!t)return"";const n=Im(t,e.current_command,e.cwd);if(n)return n;const s=Or(e);if(t===s)return"";const i=t.split("/").pop();return i&&i===s?"":t}function Pl(e){const t=MC(e);return t||Or(e)}function AC(e,t,n){const s=t==null?void 0:t[0];return(s==null?void 0:s.host)||e||n}function IC(e,t){var i;if(!t)return new Map;const n=[];for(const a of Object.keys(e)){const d=e[a];d&&d.length>0&&(((i=d[0])==null?void 0:i.host)??"")===t&&n.push(a)}if(n.length<2)return new Map;n.sort();const s=new Map;return n.forEach((a,d)=>s.set(a,d+1)),s}function $C(e,t,n,s){const i=AC(e,t,n);return s&&s>=1?`${i} #${s}`:i}const ga="application/x-atterm-session";function El(e){return!!e&&Array.prototype.includes.call(e,ga)}let Ku="";function $m(e){Ku=e}function Om(){return Ku}function Zr(){Ku=""}function OC(e,t){if(!t)return null;for(const n of e){const s=n.panes.findIndex(i=>i.sessionId===t);if(s!==-1)return{pane:{...n.panes[s]},from:{tabId:n.id,paneIdx:s}}}return{pane:{sessionId:t,remote:!0}}}function Of(e,t){if(!t)return null;for(const n of e){const s=n.panes.findIndex(i=>i.sessionId===t);if(s!==-1)return n.panes.length<2?null:{tabId:n.id,paneIdx:s,pane:{...n.panes[s]}}}return null}function FC(e,t,n){const s=e.map(a=>({...a}));if(t===n||t<0||n<0||t>=s.length||n>=s.length)return s;const i=s[t];return s[t]=s[n],s[n]=i,s}const BC=["data-tab-id","title","onClick","onPointerdown"],HC={class:"num"},NC=["title"],zC={class:"title"},UC=["onClick"],VC=["aria-label","title","value"],KC={value:""},WC=["value"],jC=["disabled","title"],qC=["title"],YC=["title"],GC={key:0,class:"dot"},XC=4,Xa=40,Ff=8,JC=Ae({__name:"TabBar",props:{tabs:{},currentId:{},starting:{type:Boolean},canNewLocal:{type:Boolean,default:!0},updateBadge:{type:Boolean,default:!1},isAdmin:{type:Boolean,default:!1},adminOpen:{type:Boolean,default:!1},profiles:{default:()=>[]},selectedProfileId:{default:""}},emits:["activate","close","new","new-ssh","reorder","open-settings","toggle-admin","detach-session","select-profile"],setup(e,{emit:t}){const n=t,s=H(null),i=H(null);let a=0,d=null;function r(E){var D;const R=E.target;return!!R&&!!((D=R.closest)!=null&&D.call(R,".close"))}function o(E,R){R.button===0&&(r(R)||(s.value={fromId:E,startX:R.clientX,active:!1,pointerId:R.pointerId,overId:null,position:null,hadDrag:!1}))}function c(E){if(!i.value)return null;const R=Array.from(i.value.querySelectorAll(".tab"));if(R.length===0)return null;for(const I of R){const O=I.getBoundingClientRect();if(E>=O.left&&E<=O.right){const U=(O.left+O.right)/2;return{id:I.dataset.tabId,position:E{D.stopPropagation(),D.preventDefault(),E.removeEventListener("click",R,!0)};E.addEventListener("click",R,!0),setTimeout(()=>E.removeEventListener("click",R,!0),0)}function m(E){const R=s.value;R&&(R.hadDrag&&!E&&g(),s.value=null,d!==null&&(cancelAnimationFrame(d),d=null))}function y(E){!s.value||E.pointerId!==s.value.pointerId||m(!1)}function v(E){!s.value||E.pointerId!==s.value.pointerId||m(!0)}Dt(()=>{window.addEventListener("pointermove",u),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",v)}),Vt(()=>{window.removeEventListener("pointermove",u),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",v),d!==null&&cancelAnimationFrame(d)});const{t:l}=$t();function h(E){if(!E)return l("terminal.emptyTab");if(E.cwd){const D=E.cwd.replace(/\/+$/,"");if(D==="")return"/";const I=D.split("/").pop();if(I)return I}const R=(E.command||"").split(/\s+/)[0]||l("terminal.shellFallback");return R.split("/").pop()||R}function f(E){if((E==null?void 0:E.unread)===!0)return{"--unread-c":Tm(E.task_state??"idle")}}function _(E){if(E){const R=DC({type:E.type,title:E.title,current_command:E.current_command,cwd:E.cwd});if(R)return R}return h(E)}function S(E){switch(E.layout){case"single":return"";case"vertical":return"▮▮";case"horizontal":return`▬ -▬`;case"grid2x2":return"▦"}}function k(E){switch(E.layout){case"single":return"";case"vertical":return l("terminal.layoutVertical");case"horizontal":return l("terminal.layoutHorizontal");case"grid2x2":return l("terminal.layoutGrid2x2")}}function P(E,R){E.stopPropagation(),n("close",R)}const M=H(!1);function w(E){var R;El((R=E.dataTransfer)==null?void 0:R.types)&&(E.preventDefault(),E.dataTransfer&&(E.dataTransfer.dropEffect="move"),M.value=!0)}function T(E){const R=E.relatedTarget;R&&E.currentTarget instanceof Node&&E.currentTarget.contains(R)||(M.value=!1)}function A(E){var D,I;if(M.value=!1,!El((D=E.dataTransfer)==null?void 0:D.types))return;E.preventDefault();const R=Om()||(((I=E.dataTransfer)==null?void 0:I.getData(ga))??"");R&&n("detach-session",R)}return(E,R)=>($(),F("div",{class:lt(["tabbar",{"drop-active":M.value}]),"data-test":"tabbar",onDragover:w,onDragleave:T,onDrop:A},[b("div",{class:"tabs",ref_key:"tabsEl",ref:i},[($(!0),F(Ie,null,at(E.tabs,(D,I)=>{var O,U,W,N,z,V,j,G;return $(),F("div",{key:D.id,"data-tab-id":D.id,class:lt(["tab",{active:D.id===E.currentId,unread:((O=D.activeSession)==null?void 0:O.unread)===!0,remote:D.activeRemote,disconnected:D.disconnected,dragging:((U=s.value)==null?void 0:U.active)&&((W=s.value)==null?void 0:W.fromId)===D.id}]),style:tn(f(D.activeSession)),title:(D.activeRemote?C(l)("terminal.remotePrefix"):"")+(D.disconnected?C(l)("terminal.tabDisconnectedSuffix")+" ":"")+(((N=D.activeSession)==null?void 0:N.command)??""),onClick:te=>n("activate",D.id),onPointerdown:te=>o(D.id,te)},[b("span",HC,L(I+1)+":",1),D.layout!=="single"?($(),F("span",{key:0,class:"layout-icon",title:k(D)},L(S(D)),9,NC)):D.activeRemote?($(),F("span",{key:1,class:lt(["dot remote-dot",{disconnected:D.disconnected}])},[Te(hi,{state:((z=D.activeSession)==null?void 0:z.task_state)??"idle",unread:((V=D.activeSession)==null?void 0:V.unread)===!0,size:10},null,8,["state","unread"])],2)):($(),bt(hi,{key:2,state:((j=D.activeSession)==null?void 0:j.task_state)??"idle",unread:((G=D.activeSession)==null?void 0:G.unread)===!0,size:10},null,8,["state","unread"])),b("span",zC,L(_(D.activeSession)),1),b("button",{class:"close",onPointerdown:R[0]||(R[0]=dt(()=>{},["stop"])),onClick:te=>P(te,D.id)},"×",40,UC)],46,BC)}),128))],512),E.canNewLocal&&E.profiles.length>0?($(),F("select",{key:0,class:"profile-picker","data-test":"new-tab-profile","aria-label":C(l)("terminal.newTabProfileLabel"),title:C(l)("terminal.newTabProfileLabel"),value:E.selectedProfileId,onChange:R[1]||(R[1]=D=>n("select-profile",D.target.value)),onClick:R[2]||(R[2]=dt(()=>{},["stop"]))},[b("option",KC,L(C(l)("terminal.useDefaultProfile")),1),($(!0),F(Ie,null,at(E.profiles,D=>($(),F("option",{key:D.id,value:D.id},L(D.name),9,WC))),128))],40,VC)):Z("",!0),E.canNewLocal?($(),F("button",{key:1,class:"plus","data-test":"new-local-shell",disabled:E.starting,title:E.starting?C(l)("terminal.starting"):C(l)("terminal.newTab"),onClick:R[3]||(R[3]=D=>n("new"))},"+",8,jC)):Z("",!0),E.canNewLocal?($(),F("button",{key:2,class:"ssh-btn",type:"button","data-test":"new-ssh",title:"SSH hosts",onClick:R[4]||(R[4]=D=>n("new-ssh"))},[Te(C(Qr),{size:14})])):Z("",!0),E.isAdmin?($(),F("button",{key:3,class:lt(["admin-btn",{active:E.adminOpen}]),type:"button","data-test":"admin-button",title:C(l)("terminal.adminPanel"),onClick:R[5]||(R[5]=D=>n("toggle-admin"))},[Te(C(yw),{size:14})],10,qC)):Z("",!0),b("button",{class:"settings-btn",type:"button","data-test":"tabbar-settings",title:C(l)("terminal.relaySettings"),onClick:R[6]||(R[6]=D=>n("open-settings"))},[R[7]||(R[7]=b("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[b("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"}),b("circle",{cx:"12",cy:"12",r:"3"})],-1)),E.updateBadge?($(),F("span",GC)):Z("",!0)],8,YC)],34))}}),QC=Ct(JC,[["__scopeId","data-v-e57c51b9"]]);let aa=null;function ZC(e){if(aa)return aa;const t=e();return aa=t,t}function hn(){if(!aa)throw new Error("platform: call initPlatform() in main.ts before usePlatform()");return aa}const Ll=H(!1);let Bf=!1;function ek(){Bf||(Bf=!0,Promise.resolve().then(()=>{const t=hn().system.windowIsMaximized;return t?t():Promise.resolve(!1)}).then(e=>{Ll.value=!!e}).catch(()=>{Ll.value=!1}))}function Wu(){return ek(),Ll}function Fm(e){Ll.value=e}const tk={class:"window-controls",style:{"--wails-draggable":"no-drag"}},nk=["aria-label"],sk=["aria-label"],ik={key:0,width:"10",height:"10",viewBox:"0 0 10 10","aria-hidden":"true"},rk={key:1,width:"10",height:"10",viewBox:"0 0 10 10","aria-hidden":"true"},ok=["aria-label"],ak=Ae({__name:"WindowControls",setup(e){const t=hn(),{t:n}=$t(),s=Wu(),i=q(()=>s.value?n("common.restore"):n("common.maximize"));function a(c){try{c()}catch(p){Lt("window","runtime call failed",{error:Rt(p)})}}function d(){a(()=>{var c,p;(p=(c=t.system).windowMinimize)==null||p.call(c)})}function r(){a(()=>{var c,p;(p=(c=t.system).windowToggleMaximize)==null||p.call(c),Fm(!s.value)})}function o(){a(()=>{var c,p;(p=(c=t.system).quit)==null||p.call(c)})}return(c,p)=>($(),F("div",tk,[b("button",{class:"wc-btn",type:"button","data-testid":"window-min","aria-label":C(n)("common.minimize"),onClick:d},p[0]||(p[0]=[b("svg",{width:"10",height:"10",viewBox:"0 0 10 10","aria-hidden":"true"},[b("rect",{x:"1",y:"4.5",width:"8",height:"1",fill:"currentColor"})],-1)]),8,nk),b("button",{class:"wc-btn",type:"button","data-testid":"window-max","aria-label":i.value,onClick:r},[C(s)?($(),F("svg",rk,p[2]||(p[2]=[b("rect",{x:"1",y:"3",width:"6",height:"6",fill:"none",stroke:"currentColor"},null,-1),b("rect",{x:"3",y:"1",width:"6",height:"6",fill:"none",stroke:"currentColor"},null,-1)]))):($(),F("svg",ik,p[1]||(p[1]=[b("rect",{x:"1",y:"1",width:"8",height:"8",fill:"none",stroke:"currentColor"},null,-1)])))],8,sk),b("button",{class:"wc-btn wc-close",type:"button","data-testid":"window-close","aria-label":C(n)("common.close"),onClick:o},p[3]||(p[3]=[b("svg",{width:"10",height:"10",viewBox:"0 0 10 10","aria-hidden":"true"},[b("path",{d:"M1 1 L9 9 M9 1 L1 9",stroke:"currentColor","stroke-width":"1",fill:"none"})],-1)]),8,ok)]))}}),lk=Ct(ak,[["__scopeId","data-v-1ccfd0fb"]]),ck={state:"closed",rtt:{last_ms:null,p50_ms:null,p95_ms:null},rtt_samples:[],reconnect:{count_last_hour:0,last_at_ms:null,last_reason:"",history:[]},bytes:{in_per_sec:0,out_per_sec:0},seq_gaps:0};function dk(e={}){const t=H(ck);let n=null,s=!1;async function i(){try{t.value=await K1()}catch(d){Js("uplink","health poll failed; keeping last value",{error:Rt(d)})}}function a(){var r;if(n!==null&&clearTimeout(n),s)return;const d=(r=e.fast)!=null&&r.call(e)?1e3:5e3;n=setTimeout(async()=>{await i(),a()},d)}return Dt(()=>{i(),a()}),Vt(()=>{s=!0,n!==null&&clearTimeout(n)}),t}const uk=["aria-label"],hk={class:"text"},fk=Ae({__name:"ConnHealthPill",props:{health:{},labels:{}},setup(e){const t=e,n=q(()=>{var a,d,r,o;return{connecting:((a=t.labels)==null?void 0:a.connecting)??"connecting…",reconnecting:((d=t.labels)==null?void 0:d.reconnecting)??"reconnecting…",off:((r=t.labels)==null?void 0:r.off)??"off",unknownMS:((o=t.labels)==null?void 0:o.unknownMS)??"—"}}),s=q(()=>{if(t.health.state==="reconnecting"||t.health.state==="connecting")return"band-reconnecting";if(t.health.state==="closed")return"band-off";const a=t.health.rtt.last_ms;return a===null||a<150?"band-green":a<500?"band-yellow":"band-red"}),i=q(()=>{if(t.health.state==="reconnecting")return n.value.reconnecting;if(t.health.state==="connecting")return n.value.connecting;if(t.health.state==="closed")return n.value.off;const a=t.health.rtt.last_ms;return a===null?n.value.unknownMS:`${a} ms`});return(a,d)=>($(),F("button",{class:lt(["conn-health-pill",s.value]),type:"button","aria-label":i.value},[d[0]||(d[0]=b("span",{class:"dot"},"●",-1)),b("span",hk,L(i.value),1)],10,uk))}}),pk=Ct(fk,[["__scopeId","data-v-5daa187a"]]),vk=["aria-label"],gk={class:"head"},mk=["aria-label"],_k={class:"rtt"},yk={class:"row"},bk={class:"metric-label"},wk={class:"metric-value"},Sk={class:"row"},Ck={class:"metric-label"},kk={class:"metric-value"},xk={width:"240",height:"60",class:"spark","aria-hidden":"true"},Rk=["d"],Tk={class:"bytes"},Pk={class:"row"},Ek={class:"metric-label"},Lk={class:"metric-value"},Dk={class:"row"},Mk={class:"metric-label"},Ak={class:"metric-value"},Ik={class:"recon"},$k={class:"row"},Ok={class:"metric-label"},Fk={class:"metric-value"},Bk={class:"row"},Hk={class:"metric-label"},Nk={class:"metric-value"},zk={key:0,class:"reconn-table"},Uk={key:0,class:"gaps"},Vk=Ae({__name:"ConnHealthDrawer",props:{health:{},open:{type:Boolean},labels:{}},emits:["close"],setup(e){const t=e,n=q(()=>{var r,o,c,p,u,g,m,y,v,l,h,f;return{title:((r=t.labels)==null?void 0:r.title)??"Connection health",rttNow:((o=t.labels)==null?void 0:o.rttNow)??"RTT (now)",rttP50P95:((c=t.labels)==null?void 0:c.rttP50P95)??"p50 / p95 (5 min)",bytesIn:((p=t.labels)==null?void 0:p.bytesIn)??"↓ in",bytesOut:((u=t.labels)==null?void 0:u.bytesOut)??"↑ out",state:((g=t.labels)==null?void 0:g.state)??"State",reconnectsLastHour:((m=t.labels)==null?void 0:m.reconnectsLastHour)??"Reconnects (1 h)",reconnectsTime:((y=t.labels)==null?void 0:y.reconnectsTime)??"time",reconnectsReason:((v=t.labels)==null?void 0:v.reconnectsReason)??"reason",reconnectsDowntime:((l=t.labels)==null?void 0:l.reconnectsDowntime)??"downtime",seqGaps:((h=t.labels)==null?void 0:h.seqGaps)??"Seq gaps observed:",close:((f=t.labels)==null?void 0:f.close)??"Close"}}),s=q(()=>{const r=t.health.rtt_samples;if(r.length<2)return"";const o=240,c=60,p=4,u=h=>p+h/(r.length-1)*(o-2*p),g=r.map(h=>h.rtt_ms),m=Math.min(...g),y=Math.max(...g),v=Math.max(1,y-m),l=h=>p+(1-(h-m)/v)*(c-2*p);return r.map((h,f)=>`${f===0?"M":"L"} ${u(f).toFixed(1)} ${l(h.rtt_ms).toFixed(1)}`).join(" ")}),i=r=>`${(r/1024).toFixed(1)} KB/s`,a=r=>r<1e3?`${r} ms`:`${Math.round(r/1e3)} s`,d=r=>new Date(r).toLocaleTimeString();return(r,o)=>r.open?($(),F("aside",{key:0,class:"drawer",role:"dialog","aria-label":n.value.title},[b("header",gk,[b("span",null,L(n.value.title),1),b("button",{class:"close",type:"button","aria-label":n.value.close,onClick:o[0]||(o[0]=c=>r.$emit("close"))},"×",8,mk)]),b("section",_k,[b("div",yk,[b("span",bk,L(n.value.rttNow),1),b("span",wk,L(r.health.rtt.last_ms??"—")+" ms",1)]),b("div",Sk,[b("span",Ck,L(n.value.rttP50P95),1),b("span",kk,L(r.health.rtt.p50_ms??"—")+" / "+L(r.health.rtt.p95_ms??"—")+" ms",1)]),($(),F("svg",xk,[b("path",{d:s.value,fill:"none",stroke:"currentColor","stroke-width":"1.5"},null,8,Rk)]))]),b("section",Tk,[b("div",Pk,[b("span",Ek,L(n.value.bytesIn),1),b("span",Lk,L(i(r.health.bytes.in_per_sec)),1)]),b("div",Dk,[b("span",Mk,L(n.value.bytesOut),1),b("span",Ak,L(i(r.health.bytes.out_per_sec)),1)])]),b("section",Ik,[b("div",$k,[b("span",Ok,L(n.value.state),1),b("span",Fk,L(r.health.state),1)]),b("div",Bk,[b("span",Hk,L(n.value.reconnectsLastHour),1),b("span",Nk,L(r.health.reconnect.count_last_hour),1)]),r.health.reconnect.history.length>0?($(),F("table",zk,[b("thead",null,[b("tr",null,[b("th",null,L(n.value.reconnectsTime),1),b("th",null,L(n.value.reconnectsReason),1),b("th",null,L(n.value.reconnectsDowntime),1)])]),b("tbody",null,[($(!0),F(Ie,null,at(r.health.reconnect.history,c=>($(),F("tr",{key:c.at_ms},[b("td",null,L(d(c.at_ms)),1),b("td",null,L(c.reason),1),b("td",null,L(a(c.duration_ms)),1)]))),128))])])):Z("",!0)]),r.health.seq_gaps>0?($(),F("section",Uk,L(n.value.seqGaps)+" "+L(r.health.seq_gaps),1)):Z("",!0)],8,vk)):Z("",!0)}}),Kk=Ct(Vk,[["__scopeId","data-v-c8bb9e85"]]),Wk=["title"],jk={class:"status"},qk={key:1,class:"bad"},Yk={key:0,class:"dim"},Gk=["title"],Xk=1120,Jk=40,Qk=Ae({__name:"TitleBar",props:{status:{},errorMsg:{},sessionCount:{},remoteEndpoint:{},currentTitle:{},currentTaskState:{}},setup(e){const t=hn(),{t:n}=$t(),s=H(!1),i=dk({fast:()=>s.value}),a=q(()=>({connecting:n("connHealth.pillLabelConnecting"),reconnecting:n("connHealth.pillLabelReconnecting"),off:n("connHealth.pillLabelOff")})),d=q(()=>({title:n("connHealth.drawerTitle"),rttNow:n("connHealth.drawerRttNow"),rttP50P95:n("connHealth.drawerRttP50P95"),bytesIn:n("connHealth.drawerBytesIn"),bytesOut:n("connHealth.drawerBytesOut"),state:n("connHealth.drawerState"),reconnectsLastHour:n("connHealth.drawerReconnectsLastHour"),reconnectsTime:n("connHealth.drawerReconnectsTime"),reconnectsReason:n("connHealth.drawerReconnectsReason"),reconnectsDowntime:n("connHealth.drawerReconnectsDowntime"),seqGaps:n("connHealth.drawerSeqGaps"),close:n("common.close")})),r=e,o=q(()=>r.currentTaskState==="running"),c=Dm(),p=q(()=>o.value?c.phase.value*Jk%Xk:0);let u=!1;_t(o,k=>{k&&!u?(u=!0,c.acquire()):!k&&u&&(u=!1,c.release())},{immediate:!0}),Vt(()=>{u&&(u=!1,c.release())});const g=H(!1),m=q(()=>n("titlebar.e2eeOffTitle")),y=q(()=>n("titlebar.e2eeOffChip"));Dt(async()=>{try{const k=await Tl();g.value=k.disable_e2ee??!1}catch{}}),t.events.on("e2ee-mode-changed",k=>{const P=k==null?void 0:k.disabled;typeof P=="boolean"&&(g.value=P)});const v=H("linux");Dt(async()=>{try{const k=await t.system.getEnvironment();if(k==null){Lt("titlebar","getEnvironment() returned null, falling back to linux");return}const P=(k.platform??"").toLowerCase();P==="darwin"||P==="windows"||P==="linux"?v.value=P:Lt("titlebar","unknown platform, falling back to linux",{platform:String(P)})}catch(k){Lt("titlebar","getEnvironment() failed, falling back to linux",{error:Rt(k)})}});const l=q(()=>({"padding-left":v.value==="darwin"?"80px":void 0,"--sweep-offset":o.value?`${p.value}px`:void 0})),h=q(()=>v.value!=="darwin"),f=Wu(),_=q(()=>r.sessionCount===1?"terminal.sessionStatusOne":"terminal.sessionStatusMany");function S(){var k,P;(P=(k=t.system).windowToggleMaximize)==null||P.call(k),Fm(!f.value)}return(k,P)=>($(),F("header",{class:lt(["titlebar",{"is-running":o.value}]),"data-testid":"titlebar-root",style:tn(l.value),onDblclick:dt(S,["self"])},[b("div",{class:"window-title","data-testid":"titlebar-current-title",title:k.currentTitle||"",onDblclick:dt(S,["self"])},L(k.currentTitle||""),41,Wk),b("div",jk,[k.status==="loading"?($(),F(Ie,{key:0},[ot(L(C(n)("terminal.starting")),1)],64)):k.status==="error"?($(),F("span",qk,L(k.errorMsg),1)):($(),F(Ie,{key:2},[ot(L(C(n)(_.value,{count:k.sessionCount}))+" ",1),k.remoteEndpoint?($(),F("span",Yk," · "+L(C(n)("terminal.uplinkOn")),1)):Z("",!0)],64))]),g.value?($(),F("div",{key:0,class:"e2ee-off-chip",role:"status","data-testid":"titlebar-e2ee-off",title:m.value},[P[2]||(P[2]=b("span",{class:"chip-icon","aria-hidden":"true"},"⚠",-1)),b("span",null,L(y.value),1)],8,Gk)):Z("",!0),k.remoteEndpoint?($(),bt(pk,{key:1,health:C(i),labels:a.value,class:"titlebar-conn-pill","data-testid":"titlebar-conn-health-pill",onClick:P[0]||(P[0]=M=>s.value=!s.value)},null,8,["health","labels"])):Z("",!0),k.remoteEndpoint?($(),bt(Kk,{key:2,health:C(i),open:s.value,labels:d.value,onClose:P[1]||(P[1]=M=>s.value=!1)},null,8,["health","open","labels"])):Z("",!0),h.value?($(),bt(lk,{key:3})):Z("",!0)],38))}}),Zk=Ct(Qk,[["__scopeId","data-v-2cf685eb"]]);function Bm(e,t,n){if(!e||!Number.isFinite(e)||e<=0)return null;if(t==="running")return{text:"live",live:!0,title:"Output active"};const s=n-e*1e3,i=Math.max(0,s),a=Math.floor(i/1e3);if(a<60)return{text:"now",live:!1,title:"Last output just now"};if(a<60*60){const r=`${Math.floor(a/60)}m`;return{text:r,live:!1,title:`Last output ${r} ago`}}if(a<24*60*60){const r=`${Math.floor(a/3600)}h`;return{text:r,live:!1,title:`Last output ${r} ago`}}const d=`${Math.floor(a/(24*60*60))}d`;return{text:d,live:!1,title:`Last output ${d} ago`}}const ex=["title","aria-label"],tx=Ae({__name:"LastOutputIndicator",props:{lastOutputAt:{},taskState:{},nowMs:{}},setup(e){const t=e,n=q(()=>Bm(t.lastOutputAt,t.taskState,t.nowMs));return(s,i)=>n.value?($(),F("span",{key:0,class:lt(["last-output",{live:n.value.live}]),title:n.value.title,"aria-label":n.value.title,"data-test":"last-output"},[i[0]||(i[0]=b("svg",{class:"last-output-clock",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round","aria-hidden":"true"},[b("circle",{cx:"6",cy:"6",r:"4.5"}),b("path",{d:"M6 3.3v3l2 1.2"})],-1)),b("span",null,L(n.value.text),1)],10,ex)):Z("",!0)}}),Hm=Ct(tx,[["__scopeId","data-v-ea632618"]]);function Dl(e,t){if(!e)return"";let n=e;if(t){if(n===t)return"~";n.startsWith(t+"/")&&(n="~"+n.slice(t.length))}const a=(n.startsWith("~/")?n.slice(2):n.replace(/^\//,"")).split("/").filter(Boolean);return a.length<=2?n:"…/"+a.slice(-2).join("/")}const nx={class:"row-main"},sx={class:"row-top"},ix={key:0,class:"state-label","data-test":"state-label"},rx=["title"],ox={class:"cmd"},ax={key:0,class:"row-meta","data-test":"row-meta"},lx={class:"cwd","data-test":"row-cwd"},cx={key:0,class:"kind","data-test":"row-kind"},dx=["title","aria-label"],ux=Ae({__name:"TaskRowInner",props:{session:{},showStateLabel:{type:Boolean,default:!1},home:{default:""},showClose:{type:Boolean,default:!1},nowMs:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:i}=$t(),a=q(()=>Dl(n.session.cwd,n.home));q(()=>Bm(n.session.last_output_at,n.session.task_state,n.nowMs)!==null);const d=q(()=>n.session.type==="ai"?Or(n.session):"");function r(o){return Vu(o,i)}return(o,c)=>($(),F(Ie,null,[b("span",nx,[b("span",sx,[Te(hi,{state:n.session.task_state??"idle",unread:n.session.unread===!0},null,8,["state","unread"]),o.showStateLabel?($(),F("span",ix,L(r(n.session.task_state)),1)):Z("",!0),b("span",{class:"cmd-and-cwd",title:C(Am)(n.session)},[b("span",ox,L(C(Pl)(n.session)),1)],8,rx)]),a.value?($(),F("span",ax,[b("span",lx,L(a.value),1)])):Z("",!0)]),b("span",{class:lt(["row-tail",{"time-only":!d.value}]),"data-test":"row-tail"},[d.value?($(),F("span",cx,L(d.value),1)):Z("",!0),Te(Hm,{"last-output-at":n.session.last_output_at,"task-state":n.session.task_state,"now-ms":n.nowMs},null,8,["last-output-at","task-state","now-ms"])],2),n.showClose?($(),F("span",{key:0,class:"row-close","data-test":"row-close",role:"button",tabindex:"0",title:C(i)("common.close"),"aria-label":C(i)("common.close"),onClick:c[0]||(c[0]=dt(p=>s("close"),["stop"])),onKeydown:[c[1]||(c[1]=Xn(dt(p=>s("close"),["stop","prevent"]),["enter"])),c[2]||(c[2]=Xn(dt(p=>s("close"),["stop","prevent"]),["space"]))]}," × ",40,dx)):Z("",!0)],64))}}),Hf=Ct(ux,[["__scopeId","data-v-81d1a3d4"]]),hx=["data-test"],fx=["data-test","disabled","onClick"],px=Ae({__name:"SessionRowMenu",props:{open:{type:Boolean,default:!1},x:{},y:{},items:{}},emits:["close","select"],setup(e,{emit:t}){const n=e,s=t,i=H(null),a=H(0),d=H(0);function r(){if(!i.value){a.value=n.x,d.value=n.y;return}const m=i.value.getBoundingClientRect(),y=window.innerWidth,v=window.innerHeight;a.value=n.x+m.width>y?Math.max(0,n.x-m.width):n.x,d.value=n.y+m.height>v?Math.max(0,n.y-m.height):n.y}const o=q(()=>({left:a.value+"px",top:d.value+"px"}));function c(m){m.disabled||(s("select",m.key),s("close"))}function p(m){m.key==="Escape"&&s("close")}function u(m){i.value&&(i.value.contains(m.target)||s("close"))}function g(m){if(!i.value)return;const y=m.relatedTarget;(!y||!i.value.contains(y))&&s("close")}return _t(()=>n.open,m=>{m?(a.value=n.x,d.value=n.y,requestAnimationFrame(r),window.addEventListener("keydown",p),window.addEventListener("mousedown",u)):(window.removeEventListener("keydown",p),window.removeEventListener("mousedown",u))},{immediate:!0}),Dt(()=>{n.open&&requestAnimationFrame(r)}),Vt(()=>{window.removeEventListener("keydown",p),window.removeEventListener("mousedown",u)}),(m,y)=>m.open?($(),F("div",{key:0,ref_key:"menuRef",ref:i,class:"session-row-menu","data-test":"session-row-menu",role:"menu",style:tn(o.value),onFocusoutCapture:g,onContextmenu:y[0]||(y[0]=dt(()=>{},["prevent"]))},[($(!0),F(Ie,null,at(m.items,v=>($(),F(Ie,{key:v.key},[v.separatorBefore?($(),F("div",{key:0,class:"menu-separator","data-test":`session-row-menu-separator-${v.key}`,role:"separator"},null,8,hx)):Z("",!0),b("button",{class:lt(["menu-item",{disabled:v.disabled}]),"data-test":`session-row-menu-item-${v.key}`,role:"menuitem",type:"button",disabled:v.disabled,onClick:dt(l=>c(v),["stop"])},L(v.label),11,fx)],64))),128))],36)):Z("",!0)}}),Nm=Ct(px,[["__scopeId","data-v-f6b9c7cb"]]),ms=H(new Set);let Nf=!1,Jo=null,Rr=null,zf=!1;const vx=300;async function ju(){try{const e=await hn().sessions.getPins();ms.value=new Set(e)}catch{}}async function Uf(){if(!Nf)return Jo||(Jo=(async()=>{try{await ju()}finally{Nf=!0,Jo=null}})(),Jo)}function qu(){Rr&&clearTimeout(Rr),Rr=setTimeout(()=>{Rr=null,hn().sessions.setPins(Array.from(ms.value)).catch(e=>{Lt("pins","schedulePersist failed",{error:Rt(e)})})},vx)}function gx(){zf||(zf=!0,hn().events.on("prefs:changed",()=>{ju()}))}function Vf(e){if(!e||ms.value.has(e))return;const t=new Set(ms.value);t.add(e),ms.value=t,qu()}function Kf(e){if(!ms.value.has(e))return;const t=new Set(ms.value);t.delete(e),ms.value=t,qu()}function mx(e,t){if(!e||!t||e===t||!ms.value.has(e))return;const n=new Set(ms.value);n.delete(e),n.add(t),ms.value=n,qu()}async function _x(){Rr&&(clearTimeout(Rr),Rr=null);try{await hn().sessions.setPins(Array.from(ms.value))}catch(e){Lt("pins","flushNow persist failed",{error:Rt(e)})}}function Yu(){return Uf(),gx(),{pinnedIds:ms,isPinned:e=>ms.value.has(e),pin:Vf,unpin:Kf,toggle:e=>ms.value.has(e)?Kf(e):Vf(e),rename:mx,flushNow:_x,ready:()=>Uf(),reload:()=>ju()}}const yx=["aria-label"],bx={class:"popover-title"},wx={class:"rows"},Sx=["data-test"],Cx={class:"label"},kx=["title"],xx=["title","aria-label","onClick"],Rx=Ae({__name:"SessionDetailsPopover",props:{open:{type:Boolean,default:!1},x:{},y:{},session:{},paneLocation:{},tabIndexById:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:i}=$t(),a=Yu(),d=H(null),r=H(0),o=H(0);function c(){if(!d.value){r.value=n.x,o.value=n.y;return}const f=d.value.getBoundingClientRect(),_=window.innerWidth,S=window.innerHeight;r.value=n.x+f.width>_?Math.max(0,n.x-f.width):n.x,o.value=n.y+f.height>S?Math.max(0,n.y-f.height):n.y}const p=q(()=>({left:r.value+"px",top:o.value+"px"}));function u(f){return f?new Date(f*1e3).toISOString().replace("T"," ").replace(/\.\d+Z$/,"Z"):""}function g(f){if(f==null)return"";if(f<1e3)return`${f}ms`;const _=f/1e3;if(_<60)return`${_.toFixed(1)}s`;const S=Math.floor(_/60),k=Math.round(_-S*60);return`${S}m${k}s`}async function m(f){try{await navigator.clipboard.writeText(f)}catch{}}const y=q(()=>{const f=n.session;if(!f)return[];const _=[];_.push({key:"sessionId",label:i("tasks.details.sessionId"),value:f.session_id,copy:!0}),f.type&&_.push({key:"type",label:i("tasks.details.type"),value:f.type});const S=[f.user,f.host].filter(Boolean).join("@");(S||f.host_id)&&_.push({key:"host",label:i("tasks.details.host"),value:S||f.host_id,copy:!0}),f.cwd&&_.push({key:"cwd",label:i("tasks.details.cwd"),value:f.cwd,copy:!0});const k=f.current_command||f.title;k&&_.push({key:"command",label:i("tasks.details.command"),value:k,copy:!0}),f.task_state&&_.push({key:"state",label:i("tasks.details.state"),value:Vu(f.task_state,i)}),f.started_at&&_.push({key:"startedAt",label:i("tasks.details.startedAt"),value:u(f.started_at)}),f.command_started_at&&_.push({key:"commandStartedAt",label:i("tasks.details.commandStartedAt"),value:u(f.command_started_at)}),f.command_ended_at&&_.push({key:"commandEndedAt",label:i("tasks.details.commandEndedAt"),value:u(f.command_ended_at)});const P=g(f.command_duration_ms);P&&_.push({key:"commandDuration",label:i("tasks.details.commandDuration"),value:P}),typeof f.command_exit_code=="number"&&_.push({key:"commandExitCode",label:i("tasks.details.commandExitCode"),value:String(f.command_exit_code)}),_.push({key:"unread",label:i("tasks.details.unread"),value:f.unread?i("common.yes"):i("common.no")}),_.push({key:"pinned",label:i("tasks.details.pinned"),value:a.isPinned(f.session_id)?i("common.yes"):i("common.no")});const M=n.paneLocation,w=M?i("tasks.details.paneAt",{tab:n.tabIndexById(M.tabId),pane:M.paneIdx+1}):i("tasks.details.paneNone");return _.push({key:"paneLocation",label:i("tasks.details.paneLocation"),value:w}),_});function v(f){f.key==="Escape"&&s("close")}function l(f){d.value&&(d.value.contains(f.target)||s("close"))}function h(f){if(!d.value)return;const _=f.relatedTarget;(!_||!d.value.contains(_))&&s("close")}return _t(()=>n.open,f=>{f?(r.value=n.x,o.value=n.y,requestAnimationFrame(c),window.addEventListener("keydown",v),window.addEventListener("mousedown",l)):(window.removeEventListener("keydown",v),window.removeEventListener("mousedown",l))},{immediate:!0}),Dt(()=>{n.open&&requestAnimationFrame(c)}),Vt(()=>{window.removeEventListener("keydown",v),window.removeEventListener("mousedown",l)}),(f,_)=>f.open&&f.session?($(),F("div",{key:0,ref_key:"popoverRef",ref:d,class:"session-details-popover","data-test":"session-details-popover",role:"dialog","aria-label":C(i)("tasks.details.title"),tabindex:"-1",style:tn(p.value),onFocusoutCapture:h,onContextmenu:_[0]||(_[0]=dt(()=>{},["prevent"]))},[b("div",bx,L(C(i)("tasks.details.title")),1),b("div",wx,[($(!0),F(Ie,null,at(y.value,S=>($(),F("div",{key:S.key,class:"row","data-test":`details-field-${S.key}`},[b("span",Cx,L(S.label),1),b("span",{class:"value",title:S.value},L(S.value),9,kx),S.copy?($(),F("button",{key:0,class:"copy",type:"button",title:C(i)("common.copy"),"aria-label":C(i)("common.copy"),onClick:dt(k=>m(S.value),["stop"])},"⧉",8,xx)):Z("",!0)],8,Sx))),128))])],44,yx)):Z("",!0)}}),Tx=Ct(Rx,[["__scopeId","data-v-9528360b"]]),oi=H(new Set),yr=H(null);function Gu(){const e=q(()=>oi.value.size);function t(d){return oi.value.has(d)}function n(d){const r=new Set(oi.value);r.has(d)?r.delete(d):r.add(d),oi.value=r,yr.value=d}function s(d){oi.value=new Set([d]),yr.value=d}function i(d,r){if(!yr.value)return n(d);const o=r.indexOf(yr.value),c=r.indexOf(d);if(o<0||c<0)return n(d);const[p,u]=o0?Math.floor(t/Px):0}function zm(e,t){const n=Wf(t)-Wf(e);if(n!==0)return n;const s=jf(t)-jf(e);return s!==0?s:(e.session_id??"").localeCompare(t.session_id??"")}function Ml(e,t){const n=po(e.task_state)-po(t.task_state);if(n!==0)return n;const s=(e.unread?0:1)-(t.unread?0:1);return s!==0?s:zm(e,t)}function Ex(e,t){return zm(e,t)}const Lx={class:"task-grouped-list"},Dx=["aria-expanded"],Mx={class:"caret","aria-hidden":"true"},Ax={width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor"},Ix={key:0,d:"M3 1 L7 5 L3 9 Z"},$x={key:1,d:"M1 3 L9 3 L5 8 Z"},Ox={class:"group-title"},Fx={class:"group-count"},Bx=["data-session-id","data-active","data-selected","onClick","onContextmenu","onPointerdown","onDragstart"],Hx=["data-test"],Nx=["aria-expanded","onClick","onKeydown"],zx={class:"caret","aria-hidden":"true"},Ux={width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor"},Vx={key:0,d:"M3 1 L7 5 L3 9 Z"},Kx={key:1,d:"M1 3 L9 3 L5 8 Z"},Wx={class:"host-name"},jx={key:0,class:"local-chip","data-test":"local-chip"},qx={class:"counts"},Yx={class:"count"},Gx={key:1,class:"unread-badge"},Xx=["title","aria-label","onClick"],Jx=["data-session-id","data-active","data-selected","onClick","onContextmenu","onPointerdown","onDragstart"],Qx={key:1,class:"empty-hint","data-test":"search-empty"},Zx={key:2,class:"completed-fold"},e2={width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor","aria-hidden":"true"},t2={key:0,d:"M1 3 L9 3 L5 8 Z"},n2={key:1,d:"M3 1 L7 5 L3 9 Z"},s2=["data-active","data-selected","onClick","onContextmenu","onPointerdown"],i2={class:"row-main"},r2={class:"row-top"},o2={key:0,class:"state-label","data-test":"state-label"},a2=["title"],l2={class:"cmd"},c2={key:0,class:"row-meta","data-test":"row-meta"},d2={class:"cwd"},u2={key:0,class:"kind","data-test":"row-kind"},h2=["title","aria-label","onClick"],br="__pinned__",f2=1e3,qf=10,p2=Ae({__name:"TaskGroupedList",props:{byHost:{},primaryStateForHost:{},completedSeen:{},groupBy:{default:"host"},byState:{default:()=>({})},activeSessionId:{default:null},localHostId:{default:""},localHost:{default:""},openSessionIds:{default:()=>[]},searchQuery:{default:""},paneLocationFor:{type:Function,default:()=>null},tabIndexById:{type:Function,default:()=>0},canDetachSession:{type:Function,default:()=>!1}},emits:["open","close","markSeen","merge-selected","close-selected","detach-session"],setup(e,{emit:t}){const n=Uu(),s=q(()=>n.active.value.showLabel),i=e,a=t,{t:d}=$t(),r=Gu(),o=pl,c=Yu(),p=q(()=>i.searchQuery.trim().toLocaleLowerCase()),u=q(()=>new Set(i.openSessionIds)),g=q(()=>i.groupBy==="state"?i.byState:i.byHost),m=q(()=>{const ae={};for(const[be,he]of Object.entries(g.value))ae[be]=he.filter(Le=>!c.isPinned(Le.session_id)&&jc(Le,p.value));return ae}),y=q(()=>{if(i.groupBy==="state")return o.filter(he=>(m.value[he]??[]).length>0);const ae=Object.keys(g.value).sort().filter(he=>(m.value[he]??[]).length>0);if(!i.localHostId)return ae;const be=ae.indexOf(i.localHostId);return be<=0?ae:[i.localHostId,...ae.slice(0,be),...ae.slice(be+1)]}),v=H(!1),l=H(new Set);function h(ae){return p.value?!1:l.value.has(ae)}function f(ae){const be=new Set(l.value);be.has(ae)?be.delete(ae):be.add(ae),l.value=be}const _=H(""),S=H(Date.now());let k=null;Dt(async()=>{k=window.setInterval(()=>{S.value=Date.now()},1e3);try{_.value=await zu()}catch{}}),Vt(()=>{k!==null&&window.clearInterval(k)});const P=q(()=>{const ae=[],be=new Set,he=i.groupBy==="state"?i.byState??{}:i.byHost??{};for(const Le of Object.values(he))for(const et of Le)be.has(et.session_id)||c.isPinned(et.session_id)&&jc(et,p.value)&&(be.add(et.session_id),ae.push(et));return ae.sort(Ml),ae}),M=q(()=>i.completedSeen.filter(ae=>jc(ae,p.value))),w=q(()=>P.value.length>0||y.value.length>0||M.value.length>0),T=q(()=>{const ae=[];if(!h(br))for(const be of P.value)ae.push(be.session_id);for(const be of y.value)if(!h(be))for(const he of m.value[be]??[])ae.push(he.session_id);if(v.value)for(const be of M.value)ae.push(be.session_id);return ae});function A(ae,be){if(U===be.session_id){U="",ae.preventDefault();return}if(ae.shiftKey){r.selectRange(be.session_id,T.value);return}if(ae.metaKey||ae.ctrlKey){r.toggle(be.session_id);return}r.clear(),a("open",be)}const E=H({open:!1,x:0,y:0,session:null});function R(ae,be,he){E.value={open:!0,x:ae,y:be,session:he}}function D(ae,be){ae.preventDefault(),R(ae.clientX,ae.clientY,be)}let I=null,O=null,U="";function W(){I&&(clearTimeout(I),I=null),O=null}function N(ae,be){ae.pointerType==="mouse"||ae.button!==0||(W(),O={x:ae.clientX,y:ae.clientY,sessionId:be.session_id},I=setTimeout(()=>{I=null,U=be.session_id,R(ae.clientX,ae.clientY,be)},f2))}function z(ae){if(!O)return;const be=Math.abs(ae.clientX-O.x),he=Math.abs(ae.clientY-O.y);(be>qf||he>qf)&&W()}function V(){W()}function j(ae,be){$m(be.session_id),ae.dataTransfer&&(ae.dataTransfer.setData(ga,be.session_id),ae.dataTransfer.effectAllowed="move")}function G(){Zr()}Vt(W);function te(){E.value={...E.value,open:!1,session:null}}const oe=q(()=>{const ae=E.value.session;if(!ae)return[];const be=r.size.value;if(be>=2&&r.isSelected(ae.session_id)){const et=Array.from(r.selectedIds.value).filter(je=>u.value.has(je)).length;return[{key:"merge",label:d("tasks.rowMenu.merge",{n:be}),disabled:be>4},{key:"close",label:d("tasks.rowMenu.closeSelected",{n:et}),disabled:et===0},{key:c.isPinned(ae.session_id)?"unpin":"pin",label:c.isPinned(ae.session_id)?d("tasks.pinned.menuUnpin"):d("tasks.pinned.menuPin")},{key:"details",label:d("tasks.rowMenu.details"),disabled:!0}]}const Le=[{key:c.isPinned(ae.session_id)?"unpin":"pin",label:c.isPinned(ae.session_id)?d("tasks.pinned.menuUnpin"):d("tasks.pinned.menuPin")}];return Le.push({key:"details",label:d("tasks.rowMenu.details")}),i.canDetachSession(ae.session_id)&&Le.push({key:"detach",label:d("terminal.detachToTab")}),Le}),re=H({open:!1,x:0,y:0,session:null});function ye(ae){const be=E.value.session;be&&(ae==="pin"||ae==="unpin"?c.toggle(be.session_id):ae==="details"?re.value={open:!0,x:E.value.x,y:E.value.y,session:be}:ae==="merge"?a("merge-selected"):ae==="close"?a("close-selected"):ae==="detach"&&a("detach-session",be.session_id))}function K(){re.value={...re.value,open:!1,session:null}}const J=q(()=>IC(i.byHost,i.localHost??""));function Q(ae){return $C(ae,g.value[ae],d("sessions.unknownHost"),J.value.get(ae))}function de(ae){return i.groupBy==="state"?ce(ae):Q(ae)}function De(ae){if(i.groupBy==="state")return ae;const be=m.value[ae]??[];let he=be[0];for(const Le of be)po(Le.task_state)be.unread).map(be=>be.session_id)}function st(ae){a("markSeen",{ids:Ye(ae)})}function yt(){a("markSeen",{ids:i.completedSeen.map(ae=>ae.session_id)})}function ce(ae){return Vu(ae,d)}return(ae,be)=>($(),F("div",Lx,[P.value.length>0?($(),F(Ie,{key:0},[b("div",{class:"group-header pinned-group","data-test":"pinned-group-header",role:"button",tabindex:"0","aria-expanded":!h(br),onClick:be[0]||(be[0]=he=>f(br)),onKeydown:[be[1]||(be[1]=Xn(dt(he=>f(br),["prevent"]),["enter"])),be[2]||(be[2]=Xn(dt(he=>f(br),["prevent"]),["space"]))]},[b("span",Mx,[($(),F("svg",Ax,[h(br)?($(),F("path",Ix)):($(),F("path",$x))]))]),be[7]||(be[7]=b("span",{class:"pin-icon","aria-hidden":"true"},[b("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true"},[b("path",{d:"M4 2 h8 v12 l-4 -3 l-4 3 z"})])],-1)),b("span",Ox,L(C(d)("tasks.pinned.title")),1),b("span",Fx,L(P.value.length),1)],40,Dx),h(br)?Z("",!0):($(!0),F(Ie,{key:0},at(P.value,he=>($(),F("button",{key:he.session_id,class:lt(["task-row",{active:he.session_id===ae.activeSessionId,selected:C(r).isSelected(he.session_id),unread:he.unread===!0}]),style:tn(Pe(he)),"data-test":"task-row","data-session-id":he.session_id,"data-active":he.session_id===ae.activeSessionId?"true":void 0,"data-selected":C(r).isSelected(he.session_id)?"true":void 0,onClick:Le=>A(Le,he),onContextmenu:Le=>D(Le,he),onPointerdown:Le=>N(Le,he),onPointermove:be[3]||(be[3]=Le=>z(Le)),onPointerup:V,onPointercancel:V,onPointerleave:V,draggable:"true",onDragstart:Le=>j(Le,he),onDragend:G},[Te(Hf,{session:he,"show-state-label":s.value,home:_.value,"show-close":u.value.has(he.session_id),"now-ms":S.value,onClose:Le=>a("close",he)},null,8,["session","show-state-label","home","show-close","now-ms","onClose"])],46,Bx))),128))],64)):Z("",!0),($(!0),F(Ie,null,at(y.value,he=>($(),F(Ie,{key:he},[(m.value[he]??[]).length>0?($(),F("section",{key:0,class:"host-group","data-test":`host-group-${he}`},[b("header",{class:"host-header","data-test":"host-header",role:"button",tabindex:"0","aria-expanded":!h(he),onClick:Le=>f(he),onKeydown:[Xn(dt(Le=>f(he),["prevent"]),["enter"]),Xn(dt(Le=>f(he),["prevent"]),["space"])]},[b("span",zx,[($(),F("svg",Ux,[h(he)?($(),F("path",Vx)):($(),F("path",Kx))]))]),b("span",Wx,L(de(he)),1),ae.groupBy==="host"&&ae.localHostId&&he===ae.localHostId?($(),F("span",jx,L(C(d)("sessions.thisMachine")),1)):Z("",!0),b("span",qx,[Te(hi,{state:De(he),size:10},null,8,["state"]),b("span",Yx,L((m.value[he]??[]).length),1)]),Ye(he).length>0?($(),F("span",Gx,L(C(d)("tasks.unreadBadge",{count:Ye(he).length})),1)):Z("",!0),Ye(he).length>0?($(),F("button",{key:2,class:"mark-all","data-test":"host-mark-all",title:C(d)("tasks.markAllRead"),"aria-label":C(d)("tasks.markAllRead"),onClick:dt(Le=>st(he),["stop"])},be[8]||(be[8]=[b("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[b("path",{d:"M3 8 l3 3 l7 -7"})],-1)]),8,Xx)):Z("",!0)],40,Nx),($(!0),F(Ie,null,at(h(he)?[]:m.value[he],Le=>($(),F("button",{key:Le.session_id,class:lt(["task-row",{active:Le.session_id===ae.activeSessionId,selected:C(r).isSelected(Le.session_id),unread:Le.unread===!0}]),style:tn(Pe(Le)),"data-test":"task-row","data-session-id":Le.session_id,"data-active":Le.session_id===ae.activeSessionId?"true":void 0,"data-selected":C(r).isSelected(Le.session_id)?"true":void 0,onClick:et=>A(et,Le),onContextmenu:et=>D(et,Le),onPointerdown:et=>N(et,Le),onPointermove:be[4]||(be[4]=et=>z(et)),onPointerup:V,onPointercancel:V,onPointerleave:V,draggable:"true",onDragstart:et=>j(et,Le),onDragend:G},[Te(Hf,{session:Le,"show-state-label":s.value,home:_.value,"show-close":u.value.has(Le.session_id),"now-ms":S.value,onClose:et=>a("close",Le)},null,8,["session","show-state-label","home","show-close","now-ms","onClose"])],46,Jx))),128))],8,Hx)):Z("",!0)],64))),128)),p.value&&!w.value?($(),F("div",Qx,L(C(d)("tasks.search.empty",{q:i.searchQuery})),1)):Z("",!0),M.value.length>0?($(),F("section",Zx,[b("button",{class:"fold-toggle","data-test":"completed-fold-toggle",onClick:be[5]||(be[5]=he=>v.value=!v.value)},[($(),F("svg",e2,[v.value?($(),F("path",t2)):($(),F("path",n2))])),ot(" "+L(C(d)("tasks.completedFold"))+" ("+L(M.value.length)+") ",1)]),v.value?($(),F(Ie,{key:0},[($(!0),F(Ie,null,at(M.value,he=>($(),F("div",{key:he.session_id,class:lt(["task-row dim",{active:he.session_id===ae.activeSessionId,selected:C(r).isSelected(he.session_id),unread:he.unread===!0}]),style:tn(Pe(he)),"data-test":"completed-fold-row","data-active":he.session_id===ae.activeSessionId?"true":void 0,"data-selected":C(r).isSelected(he.session_id)?"true":void 0,onClick:Le=>A(Le,he),onContextmenu:Le=>D(Le,he),onPointerdown:Le=>N(Le,he),onPointermove:be[6]||(be[6]=Le=>z(Le)),onPointerup:V,onPointercancel:V,onPointerleave:V},[b("span",i2,[b("span",r2,[Te(hi,{state:he.task_state??"idle",unread:he.unread===!0},null,8,["state","unread"]),s.value?($(),F("span",o2,L(ce(he.task_state)),1)):Z("",!0),b("span",{class:"cmd-and-cwd",title:C(Am)(he)},[b("span",l2,L(C(Pl)(he)),1)],8,a2)]),C(Dl)(he.cwd,_.value)?($(),F("span",c2,[b("span",d2,L(C(Dl)(he.cwd,_.value)),1)])):Z("",!0)]),b("span",{class:lt(["row-tail",{"time-only":he.type!=="ai"}]),"data-test":"row-tail"},[he.type==="ai"?($(),F("span",u2,L(C(Or)(he)),1)):Z("",!0),Te(Hm,{"last-output-at":he.last_output_at,"task-state":he.task_state,"now-ms":S.value},null,8,["last-output-at","task-state","now-ms"])],2),u.value.has(he.session_id)?($(),F("button",{key:0,class:"row-close completed-row-close","data-test":"row-close",title:C(d)("common.close"),"aria-label":C(d)("common.close"),onClick:dt(Le=>a("close",he),["stop"])}," × ",8,h2)):Z("",!0)],46,s2))),128)),b("button",{class:"fold-mark-all","data-test":"fold-mark-all",onClick:yt},L(C(d)("tasks.markAllRead")),1)],64)):Z("",!0)])):Z("",!0),Te(Nm,{open:E.value.open,x:E.value.x,y:E.value.y,items:oe.value,onClose:te,onSelect:ye},null,8,["open","x","y","items"]),Te(Tx,{open:re.value.open,x:re.value.x,y:re.value.y,session:re.value.session,"pane-location":re.value.session?ae.paneLocationFor(re.value.session.session_id):null,"tab-index-by-id":ae.tabIndexById,onClose:K},null,8,["open","x","y","session","pane-location","tab-index-by-id"])]))}}),v2=Ct(p2,[["__scopeId","data-v-42b39ad3"]]),g2={class:"bulk-bar","data-test":"bulk-action-bar",role:"toolbar"},m2={class:"counter","data-test":"bulk-selected-count"},_2=["disabled","title"],y2=["disabled","title"],b2=["title"],w2=Ae({__name:"BulkActionBar",props:{count:{},openCount:{},canMerge:{type:Boolean}},emits:["merge","close-selected","clear"],setup(e,{emit:t}){const n=e,s=t,{t:i}=$t(),a=q(()=>n.count>4?i("tasks.bulk.mergeTooMany"):i("tasks.bulk.mergeTab")),d=q(()=>n.openCount===0?i("tasks.bulk.closeNoneOpen"):i("tasks.bulk.closeHint",{count:n.openCount}));function r(){n.canMerge&&s("merge")}function o(){n.openCount!==0&&s("close-selected")}function c(){s("clear")}return(p,u)=>($(),F("div",g2,[b("span",m2,L(C(i)("tasks.bulk.selectedCount",{count:p.count})),1),b("button",{class:"btn primary","data-test":"bulk-merge",type:"button",disabled:!p.canMerge,title:a.value,onClick:r},L(C(i)("tasks.bulk.mergeTab"))+" ("+L(p.count)+") ",9,_2),b("button",{class:"btn","data-test":"bulk-close",type:"button",disabled:p.openCount===0,title:d.value,onClick:o},L(C(i)("tasks.bulk.close",{count:p.openCount})),9,y2),b("button",{class:"btn ghost","data-test":"bulk-clear",type:"button",title:C(i)("tasks.bulk.cancel"),onClick:c},L(C(i)("tasks.bulk.cancel")),9,b2)]))}}),S2=Ct(w2,[["__scopeId","data-v-c912fe83"]]);function C2(e){return e==="host"||e==="state"}const qc=Pm({defaultValue:"host",storageKey:"taskGroupBy",load:()=>SS(),save:e=>CS(e),isValid:C2});function Um(){return qc.ensureLoaded(),{activeId:qc.activeId,setGroupBy:qc.set}}const k2={class:"task-sidebar-shell"},x2=["aria-label"],R2={key:1,class:"rail","data-test":"sidebar-rail"},T2=["title","aria-label"],P2={key:0,class:"rail-badge","data-test":"sidebar-rail-badge"},E2=["aria-label","onClick","onKeydown"],L2={key:2,class:"expanded"},D2={class:"sidebar-header"},M2={key:0,class:"title"},A2=["title","aria-label"],I2=["placeholder","aria-label","onKeydown"],$2=["title"],O2=["title","aria-label"],F2={class:"list-wrap","data-test":"task-grouped-list"},B2={key:0},H2={key:1},N2=180,z2=480,U2=Ae({__name:"TaskSidebar",props:{collapsed:{type:Boolean},byHost:{},primaryStateForHost:{},completedSeen:{},totalUnread:{},byStateGroups:{default:()=>({})},activeSessionId:{default:null},openSessionIds:{default:()=>[]},localHostId:{default:""},localHost:{default:""},paneLocationFor:{type:Function,default:()=>null},canDetachSession:{type:Function,default:()=>!1},tabIndexById:{type:Function,default:()=>0}},emits:["update:collapsed","open","close","markSeen","merge-selected","close-selected","detach-session"],setup(e,{expose:t,emit:n}){const{t:s}=$t(),i=Um(),a=e,d=n,r=Gu(),o=q(()=>{const z=new Set(a.openSessionIds??[]);let V=0;for(const j of r.selectedIds.value)z.has(j)&&V++;return V}),c=q(()=>r.size.value>=1&&r.size.value<=4);function p(z){z.key==="Escape"&&r.size.value>0&&(z.preventDefault(),r.clear())}function u(z){if(r.size.value===0)return;const V=z.target;V&&(V.closest(".task-row, .host-header, .group-header, .bulk-bar, .session-row-menu, .session-details-popover, .resize-handle")||r.clear())}const g=H(240);let m=0,y=0,v=!1;const l=H(""),h=H(null),f=H(!1);async function _(){var z,V;f.value=!0,await un(),(z=h.value)==null||z.focus(),(V=h.value)==null||V.select()}function S(){l.value===""&&(f.value=!1)}function k(){if(l.value!==""){l.value="";return}f.value=!1}async function P(){a.collapsed&&(d("update:collapsed",!1),await un()),await _()}t({focusSearch:P}),Dt(async()=>{try{const z=await kS();z>0&&(g.value=M(z))}catch{}});function M(z){return Math.max(N2,Math.min(z2,z))}const w=H(!1),T=H(!1);function A(){const z=w.value;w.value=window.innerWidth<768,z&&!w.value&&(T.value=!1)}function E(z){z.key==="Escape"&&T.value&&(T.value=!1,z.preventDefault())}Dt(()=>{A(),window.addEventListener("resize",A),window.addEventListener("keydown",E)}),Vt(()=>{window.removeEventListener("resize",A),window.removeEventListener("keydown",E)});function R(z){if(!a.collapsed){v=!0,m=z.clientX,y=g.value;try{z.target.setPointerCapture(z.pointerId)}catch{}}}function D(z){v&&(g.value=M(y+(z.clientX-m)))}async function I(z){if(v){v=!1;try{z.target.releasePointerCapture(z.pointerId)}catch{}try{await xS(g.value)}catch{}}}const O=["waiting_input","failed","running","completed","idle","disconnected","closed"];function U(z){if(!z)return O.length;const V=O.indexOf(z);return V===-1?O.length:V}function W(){const z=i.activeId.value==="state"?"host":"state";i.setGroupBy(z)}const N=q(()=>{const z=[];for(const V of Object.values(a.byHost))z.push(...V);return z.sort((V,j)=>U(V.task_state)-U(j.task_state)),z.slice(0,20)});return(z,V)=>($(),F("div",k2,[w.value?($(),F("button",{key:0,"data-test":"sidebar-hamburger",class:"sidebar-hamburger","aria-label":T.value?C(s)("tasks.sidebar.closeDrawer"):C(s)("tasks.sidebar.openDrawer"),onClick:V[0]||(V[0]=j=>T.value=!T.value)},V[14]||(V[14]=[b("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[b("line",{x1:"3",y1:"4.5",x2:"13",y2:"4.5"}),b("line",{x1:"3",y1:"8",x2:"13",y2:"8"}),b("line",{x1:"3",y1:"11.5",x2:"13",y2:"11.5"})],-1)]),8,x2)):Z("",!0),b("aside",{class:lt(["task-sidebar",{collapsed:z.collapsed,drawer:w.value,open:w.value&&T.value}]),style:tn(z.collapsed?void 0:{width:g.value+"px"}),tabindex:"-1",onKeydown:p,onClickCapture:u},[z.collapsed?Z("",!0):($(),F("div",{key:0,class:"resize-handle","data-test":"sidebar-resize-handle",onPointerdown:R,onPointermove:D,onPointerup:I,onPointercancel:I},null,32)),z.collapsed?($(),F("div",R2,[b("button",{class:"expand-button",title:C(s)("tasks.sidebar.expand"),"aria-label":C(s)("tasks.sidebar.expand"),onClick:V[1]||(V[1]=j=>d("update:collapsed",!1))},V[15]||(V[15]=[b("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[b("polyline",{points:"3 2 7 6 3 10"}),b("polyline",{points:"6 2 10 6 6 10"})],-1)]),8,T2),z.totalUnread>0?($(),F("span",P2,L(z.totalUnread),1)):Z("",!0),($(!0),F(Ie,null,at(N.value,j=>($(),F("span",{key:j.session_id,class:"rail-icon","data-test":"sidebar-rail-icon",role:"button",tabindex:"0","aria-label":j.current_command||j.title||j.session_id.slice(0,8),onClick:G=>d("open",j),onKeydown:[Xn(dt(G=>d("open",j),["prevent"]),["enter"]),Xn(dt(G=>d("open",j),["prevent"]),["space"])]},[Te(hi,{state:j.task_state??"idle",unread:j.unread===!0,size:14},null,8,["state","unread"])],40,E2))),128))])):($(),F("div",L2,[b("header",D2,[f.value||l.value?Z("",!0):($(),F("span",M2,L(C(s)("tasks.sidebar.title")),1)),f.value||l.value?rt(($(),F("input",{key:2,ref_key:"searchEl",ref:h,"onUpdate:modelValue":V[2]||(V[2]=j=>l.value=j),type:"search",class:"sidebar-search","data-test":"sidebar-search",placeholder:C(s)("tasks.sidebar.searchPlaceholder"),"aria-label":C(s)("tasks.sidebar.searchPlaceholder"),onKeydown:Xn(dt(k,["prevent"]),["esc"]),onBlur:S},null,40,I2)),[[Tt,l.value]]):($(),F("button",{key:1,class:"search-icon-btn","data-test":"sidebar-search-toggle",title:C(s)("tasks.sidebar.searchPlaceholder"),"aria-label":C(s)("tasks.sidebar.searchPlaceholder"),onClick:_},V[16]||(V[16]=[b("svg",{width:"14",height:"14",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false"},[b("circle",{cx:"7",cy:"7",r:"4.5",fill:"none",stroke:"currentColor","stroke-width":"1.5"}),b("line",{x1:"10.5",y1:"10.5",x2:"14",y2:"14",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)]),8,A2)),f.value||l.value?Z("",!0):($(),F("button",{key:3,class:"group-toggle","data-test":"group-toggle",title:C(s)("tasks.settings.groupBy"),onClick:W},L(C(i).activeId.value==="state"?C(s)("tasks.settings.groupByState"):C(s)("tasks.settings.groupByHost")),9,$2)),b("button",{class:"collapse-button","data-test":"collapse-button",title:C(s)("tasks.sidebar.collapse"),"aria-label":C(s)("tasks.sidebar.collapse"),onClick:V[3]||(V[3]=j=>d("update:collapsed",!0))},V[17]||(V[17]=[b("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[b("polyline",{points:"9 2 5 6 9 10"}),b("polyline",{points:"6 2 2 6 6 10"})],-1)]),8,O2)]),b("div",F2,[Te(v2,{"by-host":z.byHost,"primary-state-for-host":z.primaryStateForHost,"completed-seen":z.completedSeen,"group-by":C(i).activeId.value,"by-state":z.byStateGroups,"active-session-id":z.activeSessionId,"open-session-ids":z.openSessionIds,"local-host-id":z.localHostId,"local-host":z.localHost,"search-query":l.value,"pane-location-for":z.paneLocationFor,"can-detach-session":z.canDetachSession,"tab-index-by-id":z.tabIndexById,onOpen:V[4]||(V[4]=j=>d("open",j)),onClose:V[5]||(V[5]=j=>d("close",j)),onMarkSeen:V[6]||(V[6]=j=>d("markSeen",j)),onMergeSelected:V[7]||(V[7]=j=>d("merge-selected")),onCloseSelected:V[8]||(V[8]=j=>d("close-selected")),onDetachSession:V[9]||(V[9]=j=>d("detach-session",j))},null,8,["by-host","primary-state-for-host","completed-seen","group-by","by-state","active-session-id","open-session-ids","local-host-id","local-host","search-query","pane-location-for","can-detach-session","tab-index-by-id"])]),C(r).size.value>=1?($(),F("footer",B2,[Te(S2,{count:C(r).size.value,"open-count":o.value,"can-merge":c.value,onMerge:V[10]||(V[10]=j=>d("merge-selected")),onCloseSelected:V[11]||(V[11]=j=>d("close-selected")),onClear:V[12]||(V[12]=j=>C(r).clear())},null,8,["count","open-count","can-merge"])])):z.totalUnread>0?($(),F("footer",H2,[b("button",{class:"mark-all","data-test":"sidebar-mark-all",onClick:V[13]||(V[13]=j=>d("markSeen",{all:!0}))},L(C(s)("tasks.markAllRead")),1)])):Z("",!0)]))],38)]))}}),V2=Ct(U2,[["__scopeId","data-v-0741527d"]]);var Vm={exports:{}};(function(e,t){(function(n,s){e.exports=s()})(self,()=>(()=>{var n={4567:function(d,r,o){var c=this&&this.__decorate||function(_,S,k,P){var M,w=arguments.length,T=w<3?S:P===null?P=Object.getOwnPropertyDescriptor(S,k):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(_,S,k,P);else for(var A=_.length-1;A>=0;A--)(M=_[A])&&(T=(w<3?M(T):w>3?M(S,k,T):M(S,k))||T);return w>3&&T&&Object.defineProperty(S,k,T),T},p=this&&this.__param||function(_,S){return function(k,P){S(k,P,_)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const u=o(9042),g=o(6114),m=o(9924),y=o(844),v=o(5596),l=o(4725),h=o(3656);let f=r.AccessibilityManager=class extends y.Disposable{constructor(_,S){super(),this._terminal=_,this._renderService=S,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let k=0;kthis._handleBoundaryFocus(k,0),this._bottomBoundaryFocusListener=k=>this._handleBoundaryFocus(k,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new m.TimeBasedDebouncer(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(k=>this._handleResize(k.rows))),this.register(this._terminal.onRender(k=>this._refreshRows(k.start,k.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(k=>this._handleChar(k))),this.register(this._terminal.onLineFeed(()=>this._handleChar(` -`))),this.register(this._terminal.onA11yTab(k=>this._handleTab(k))),this.register(this._terminal.onKey(k=>this._handleKey(k.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new v.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,h.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,y.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(_){for(let S=0;S<_;S++)this._handleChar(" ")}_handleChar(_){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==_&&(this._charsToAnnounce+=_):this._charsToAnnounce+=_,_===` -`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)),g.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,g.isMac&&this._liveRegion.remove()}_handleKey(_){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(_)||this._charsToConsume.push(_)}_refreshRows(_,S){this._liveRegionDebouncer.refresh(_,S,this._terminal.rows)}_renderRows(_,S){const k=this._terminal.buffer,P=k.lines.length.toString();for(let M=_;M<=S;M++){const w=k.translateBufferLineToString(k.ydisp+M,!0),T=(k.ydisp+M+1).toString(),A=this._rowElements[M];A&&(w.length===0?A.innerText=" ":A.textContent=w,A.setAttribute("aria-posinset",T),A.setAttribute("aria-setsize",P))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(_,S){const k=_.target,P=this._rowElements[S===0?1:this._rowElements.length-2];if(k.getAttribute("aria-posinset")===(S===0?"1":`${this._terminal.buffer.lines.length}`)||_.relatedTarget!==P)return;let M,w;if(S===0?(M=k,w=this._rowElements.pop(),this._rowContainer.removeChild(w)):(M=this._rowElements.shift(),w=k,this._rowContainer.removeChild(M)),M.removeEventListener("focus",this._topBoundaryFocusListener),w.removeEventListener("focus",this._bottomBoundaryFocusListener),S===0){const T=this._createAccessibilityTreeNode();this._rowElements.unshift(T),this._rowContainer.insertAdjacentElement("afterbegin",T)}else{const T=this._createAccessibilityTreeNode();this._rowElements.push(T),this._rowContainer.appendChild(T)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(S===0?-1:1),this._rowElements[S===0?1:this._rowElements.length-2].focus(),_.preventDefault(),_.stopImmediatePropagation()}_handleResize(_){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let S=this._rowContainer.children.length;S_;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const _=document.createElement("div");return _.setAttribute("role","listitem"),_.tabIndex=-1,this._refreshRowDimensions(_),_}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let _=0;_{function o(g){return g.replace(/\r?\n/g,"\r")}function c(g,m){return m?"\x1B[200~"+g+"\x1B[201~":g}function p(g,m,y,v){g=c(g=o(g),y.decPrivateModes.bracketedPasteMode&&v.rawOptions.ignoreBracketedPasteMode!==!0),y.triggerDataEvent(g,!0),m.value=""}function u(g,m,y){const v=y.getBoundingClientRect(),l=g.clientX-v.left-10,h=g.clientY-v.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${l}px`,m.style.top=`${h}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=o,r.bracketTextForPaste=c,r.copyHandler=function(g,m){g.clipboardData&&g.clipboardData.setData("text/plain",m.selectionText),g.preventDefault()},r.handlePasteEvent=function(g,m,y,v){g.stopPropagation(),g.clipboardData&&p(g.clipboardData.getData("text/plain"),m,y,v)},r.paste=p,r.moveTextAreaUnderMouseCursor=u,r.rightClickHandler=function(g,m,y,v,l){u(g,m,y),l&&v.rightClickSelect(g),m.value=v.selectionText,m.select()}},7239:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const c=o(1505);r.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(p,u,g){this._css.set(p,u,g)}getCss(p,u){return this._css.get(p,u)}setColor(p,u,g){this._color.set(p,u,g)}getColor(p,u){return this._color.get(p,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(o,c,p,u){o.addEventListener(c,p,u);let g=!1;return{dispose:()=>{g||(g=!0,o.removeEventListener(c,p,u))}}}},6465:function(d,r,o){var c=this&&this.__decorate||function(l,h,f,_){var S,k=arguments.length,P=k<3?h:_===null?_=Object.getOwnPropertyDescriptor(h,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(l,h,f,_);else for(var M=l.length-1;M>=0;M--)(S=l[M])&&(P=(k<3?S(P):k>3?S(h,f,P):S(h,f))||P);return k>3&&P&&Object.defineProperty(h,f,P),P},p=this&&this.__param||function(l,h){return function(f,_){h(f,_,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier2=void 0;const u=o(3656),g=o(8460),m=o(844),y=o(2585);let v=r.Linkifier2=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(l){super(),this._bufferService=l,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(l){return this._linkProviders.push(l),{dispose:()=>{const h=this._linkProviders.indexOf(l);h!==-1&&this._linkProviders.splice(h,1)}}}attachToDom(l,h,f){this._element=l,this._mouseService=h,this._renderService=f,this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(l){if(this._lastMouseEvent=l,!this._element||!this._mouseService)return;const h=this._positionFromMouseEvent(l,this._element,this._mouseService);if(!h)return;this._isMouseOut=!1;const f=l.composedPath();for(let _=0;_{k==null||k.forEach(P=>{P.link.dispose&&P.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=l.y);let S=!1;for(const[k,P]of this._linkProviders.entries())h?!((_=this._activeProviderReplies)===null||_===void 0)&&_.get(k)&&(S=this._checkLinkProviderResult(k,l,S)):P.provideLinks(l.y,M=>{var w,T;if(this._isMouseOut)return;const A=M==null?void 0:M.map(E=>({link:E}));(w=this._activeProviderReplies)===null||w===void 0||w.set(k,A),S=this._checkLinkProviderResult(k,l,S),((T=this._activeProviderReplies)===null||T===void 0?void 0:T.size)===this._linkProviders.length&&this._removeIntersectingLinks(l.y,this._activeProviderReplies)})}_removeIntersectingLinks(l,h){const f=new Set;for(let _=0;_l?this._bufferService.cols:P.link.range.end.x;for(let T=M;T<=w;T++){if(f.has(T)){S.splice(k--,1);break}f.add(T)}}}}_checkLinkProviderResult(l,h,f){var _;if(!this._activeProviderReplies)return f;const S=this._activeProviderReplies.get(l);let k=!1;for(let P=0;Pthis._linkAtPosition(M.link,h));P&&(f=!0,this._handleNewLink(P))}if(this._activeProviderReplies.size===this._linkProviders.length&&!f)for(let P=0;Pthis._linkAtPosition(w.link,h));if(M){f=!0,this._handleNewLink(M);break}}return f}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(l){if(!this._element||!this._mouseService||!this._currentLink)return;const h=this._positionFromMouseEvent(l,this._element,this._mouseService);h&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,h)&&this._currentLink.link.activate(l,this._currentLink.link.text)}_clearCurrentLink(l,h){this._element&&this._currentLink&&this._lastMouseEvent&&(!l||!h||this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=h)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(l){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const h=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);h&&this._linkAtPosition(l.link,h)&&(this._currentLink=l,this._currentLink.state={decorations:{underline:l.link.decorations===void 0||l.link.decorations.underline,pointerCursor:l.link.decorations===void 0||l.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,l.link,this._lastMouseEvent),l.link.decorations={},Object.defineProperties(l.link.decorations,{pointerCursor:{get:()=>{var f,_;return(_=(f=this._currentLink)===null||f===void 0?void 0:f.state)===null||_===void 0?void 0:_.decorations.pointerCursor},set:f=>{var _,S;!((_=this._currentLink)===null||_===void 0)&&_.state&&this._currentLink.state.decorations.pointerCursor!==f&&(this._currentLink.state.decorations.pointerCursor=f,this._currentLink.state.isHovered&&((S=this._element)===null||S===void 0||S.classList.toggle("xterm-cursor-pointer",f)))}},underline:{get:()=>{var f,_;return(_=(f=this._currentLink)===null||f===void 0?void 0:f.state)===null||_===void 0?void 0:_.decorations.underline},set:f=>{var _,S,k;!((_=this._currentLink)===null||_===void 0)&&_.state&&((k=(S=this._currentLink)===null||S===void 0?void 0:S.state)===null||k===void 0?void 0:k.decorations.underline)!==f&&(this._currentLink.state.decorations.underline=f,this._currentLink.state.isHovered&&this._fireUnderlineEvent(l.link,f))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(f=>{if(!this._currentLink)return;const _=f.start===0?0:f.start+1+this._bufferService.buffer.ydisp,S=this._bufferService.buffer.ydisp+1+f.end;if(this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=S&&(this._clearCurrentLink(_,S),this._lastMouseEvent&&this._element)){const k=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);k&&this._askForLink(k,!1)}})))}_linkHover(l,h,f){var _;!((_=this._currentLink)===null||_===void 0)&&_.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(h,!0),this._currentLink.state.decorations.pointerCursor&&l.classList.add("xterm-cursor-pointer")),h.hover&&h.hover(f,h.text)}_fireUnderlineEvent(l,h){const f=l.range,_=this._bufferService.buffer.ydisp,S=this._createLinkUnderlineEvent(f.start.x-1,f.start.y-_-1,f.end.x,f.end.y-_-1,void 0);(h?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(S)}_linkLeave(l,h,f){var _;!((_=this._currentLink)===null||_===void 0)&&_.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(h,!1),this._currentLink.state.decorations.pointerCursor&&l.classList.remove("xterm-cursor-pointer")),h.leave&&h.leave(f,h.text)}_linkAtPosition(l,h){const f=l.range.start.y*this._bufferService.cols+l.range.start.x,_=l.range.end.y*this._bufferService.cols+l.range.end.x,S=h.y*this._bufferService.cols+h.x;return f<=S&&S<=_}_positionFromMouseEvent(l,h,f){const _=f.getCoords(l,h,this._bufferService.cols,this._bufferService.rows);if(_)return{x:_[0],y:_[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(l,h,f,_,S){return{x1:l,y1:h,x2:f,y2:_,cols:this._bufferService.cols,fg:S}}};r.Linkifier2=v=c([p(0,y.IBufferService)],v)},9042:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(d,r,o){var c=this&&this.__decorate||function(v,l,h,f){var _,S=arguments.length,k=S<3?l:f===null?f=Object.getOwnPropertyDescriptor(l,h):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(v,l,h,f);else for(var P=v.length-1;P>=0;P--)(_=v[P])&&(k=(S<3?_(k):S>3?_(l,h,k):_(l,h))||k);return S>3&&k&&Object.defineProperty(l,h,k),k},p=this&&this.__param||function(v,l){return function(h,f){l(h,f,v)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const u=o(511),g=o(2585);let m=r.OscLinkProvider=class{constructor(v,l,h){this._bufferService=v,this._optionsService=l,this._oscLinkService=h}provideLinks(v,l){var h;const f=this._bufferService.buffer.lines.get(v-1);if(!f)return void l(void 0);const _=[],S=this._optionsService.rawOptions.linkHandler,k=new u.CellData,P=f.getTrimmedLength();let M=-1,w=-1,T=!1;for(let A=0;AS?S.activate(I,O,R):y(0,O),hover:(I,O)=>{var U;return(U=S==null?void 0:S.hover)===null||U===void 0?void 0:U.call(S,I,O,R)},leave:(I,O)=>{var U;return(U=S==null?void 0:S.leave)===null||U===void 0?void 0:U.call(S,I,O,R)}})}T=!1,k.hasExtendedAttrs()&&k.extended.urlId?(w=A,M=k.extended.urlId):(w=-1,M=-1)}}l(_)}};function y(v,l){if(confirm(`Do you want to navigate to ${l}? - -WARNING: This link could potentially be dangerous`)){const h=window.open();if(h){try{h.opener=null}catch{}h.location.href=l}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=m=c([p(0,g.IBufferService),p(1,g.IOptionsService),p(2,g.IOscLinkService)],m)},6193:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(o,c){this._parentWindow=o,this._renderCallback=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(o,c,p){this._rowCount=p,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},5596:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ScreenDprMonitor=void 0;const c=o(844);class p extends c.Disposable{constructor(g){super(),this._parentWindow=g,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,c.toDisposable)(()=>{this.clearListener()}))}setListener(g){this._listener&&this.clearListener(),this._listener=g,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var g;this._outerListener&&((g=this._resolutionMediaMatchList)===null||g===void 0||g.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._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}r.ScreenDprMonitor=p},3236:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const c=o(3614),p=o(3656),u=o(6465),g=o(9042),m=o(3730),y=o(1680),v=o(3107),l=o(5744),h=o(2950),f=o(1296),_=o(428),S=o(4269),k=o(5114),P=o(8934),M=o(3230),w=o(9312),T=o(4725),A=o(6731),E=o(8055),R=o(8969),D=o(8460),I=o(844),O=o(6114),U=o(8437),W=o(2584),N=o(7399),z=o(5941),V=o(9074),j=o(2585),G=o(5435),te=o(4567),oe=typeof window<"u"?window.document:null;class re extends R.CoreTerminal{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}constructor(K={}){super(K),this.browser=O,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new I.MutableDisposable),this._onCursorMove=this.register(new D.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new D.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new D.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new D.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new D.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new D.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new D.EventEmitter),this._onBlur=this.register(new D.EventEmitter),this._onA11yCharEmitter=this.register(new D.EventEmitter),this._onA11yTabEmitter=this.register(new D.EventEmitter),this._onWillOpen=this.register(new D.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(u.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(V.DecorationService),this._instantiationService.setService(j.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((J,Q)=>this.refresh(J,Q))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(J=>this._reportWindowsOptions(J))),this.register(this._inputHandler.onColor(J=>this._handleColorEvent(J))),this.register((0,D.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,D.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(J=>this._afterResize(J.cols,J.rows))),this.register((0,I.toDisposable)(()=>{var J,Q;this._customKeyEventHandler=void 0,(Q=(J=this.element)===null||J===void 0?void 0:J.parentNode)===null||Q===void 0||Q.removeChild(this.element)}))}_handleColorEvent(K){if(this._themeService)for(const J of K){let Q,de="";switch(J.index){case 256:Q="foreground",de="10";break;case 257:Q="background",de="11";break;case 258:Q="cursor",de="12";break;default:Q="ansi",de="4;"+J.index}switch(J.type){case 0:const De=E.color.toColorRGB(Q==="ansi"?this._themeService.colors.ansi[J.index]:this._themeService.colors[Q]);this.coreService.triggerDataEvent(`${W.C0.ESC}]${de};${(0,z.toRgbString)(De)}${W.C1_ESCAPED.ST}`);break;case 1:if(Q==="ansi")this._themeService.modifyColors(Pe=>Pe.ansi[J.index]=E.rgba.toColor(...J.color));else{const Pe=Q;this._themeService.modifyColors(Ye=>Ye[Pe]=E.rgba.toColor(...J.color))}break;case 2:this._themeService.restoreColor(J.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(K){K?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(te.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(K){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.C0.ESC+"[I"),this.updateCursorStyle(K),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var K;return(K=this.textarea)===null||K===void 0?void 0:K.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const K=this.buffer.ybase+this.buffer.y,J=this.buffer.lines.get(K);if(!J)return;const Q=Math.min(this.buffer.x,this.cols-1),de=this._renderService.dimensions.css.cell.height,De=J.getWidth(Q),Pe=this._renderService.dimensions.css.cell.width*De,Ye=this.buffer.y*this._renderService.dimensions.css.cell.height,st=Q*this._renderService.dimensions.css.cell.width;this.textarea.style.left=st+"px",this.textarea.style.top=Ye+"px",this.textarea.style.width=Pe+"px",this.textarea.style.height=de+"px",this.textarea.style.lineHeight=de+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",J=>{this.hasSelection()&&(0,c.copyHandler)(J,this._selectionService)}));const K=J=>(0,c.handlePasteEvent)(J,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",K)),this.register((0,p.addDisposableDomListener)(this.element,"paste",K)),O.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",J=>{J.button===2&&(0,c.rightClickHandler)(J,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",J=>{(0,c.rightClickHandler)(J,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),O.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",J=>{J.button===1&&(0,c.moveTextAreaUnderMouseCursor)(J,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",K=>this._keyUp(K),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",K=>this._keyDown(K),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",K=>this._keyPress(K),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",K=>this._compositionHelper.compositionupdate(K))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,p.addDisposableDomListener)(this.textarea,"input",K=>this._inputEvent(K),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(K){var J;if(!K)throw new Error("Terminal requires a parent element.");K.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=K.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),K.appendChild(this.element);const Q=oe.createDocumentFragment();this._viewportElement=oe.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),Q.appendChild(this._viewportElement),this._viewportScrollArea=oe.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=oe.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=oe.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),Q.appendChild(this.screenElement),this.textarea=oe.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),O.isChromeOS||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._coreBrowserService=this._instantiationService.createInstance(k.CoreBrowserService,this.textarea,(J=this._document.defaultView)!==null&&J!==void 0?J:window),this._instantiationService.setService(T.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",de=>this._handleTextAreaFocus(de))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(_.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(T.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(A.ThemeService),this._instantiationService.setService(T.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(T.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(T.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(de=>this._onRender.fire(de))),this.onResize(de=>this._renderService.resize(de.cols,de.rows)),this._compositionView=oe.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(h.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(Q);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(P.MouseService),this._instantiationService.setService(T.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(y.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(de=>this.scrollLines(de.amount,de.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),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.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(w.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(T.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(de=>this.scrollLines(de.amount,de.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(de=>this._renderService.handleSelectionChanged(de.start,de.end,de.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(de=>{this.textarea.value=de,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(de=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(v.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",de=>this._selectionService.handleMouseDown(de))),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(te.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",de=>this._handleScreenReaderModeOptionChange(de))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",de=>{!this._overviewRulerRenderer&&de&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const K=this,J=this.element;function Q(Pe){const Ye=K._mouseService.getMouseReportCoords(Pe,K.screenElement);if(!Ye)return!1;let st,yt;switch(Pe.overrideType||Pe.type){case"mousemove":yt=32,Pe.buttons===void 0?(st=3,Pe.button!==void 0&&(st=Pe.button<3?Pe.button:3)):st=1&Pe.buttons?0:4&Pe.buttons?1:2&Pe.buttons?2:3;break;case"mouseup":yt=0,st=Pe.button<3?Pe.button:3;break;case"mousedown":yt=1,st=Pe.button<3?Pe.button:3;break;case"wheel":if(K.viewport.getLinesScrolled(Pe)===0)return!1;yt=Pe.deltaY<0?0:1,st=4;break;default:return!1}return!(yt===void 0||st===void 0||st>4)&&K.coreMouseService.triggerMouseEvent({col:Ye.col,row:Ye.row,x:Ye.x,y:Ye.y,button:st,action:yt,ctrl:Pe.ctrlKey,alt:Pe.altKey,shift:Pe.shiftKey})}const de={mouseup:null,wheel:null,mousedrag:null,mousemove:null},De={mouseup:Pe=>(Q(Pe),Pe.buttons||(this._document.removeEventListener("mouseup",de.mouseup),de.mousedrag&&this._document.removeEventListener("mousemove",de.mousedrag)),this.cancel(Pe)),wheel:Pe=>(Q(Pe),this.cancel(Pe,!0)),mousedrag:Pe=>{Pe.buttons&&Q(Pe)},mousemove:Pe=>{Pe.buttons||Q(Pe)}};this.register(this.coreMouseService.onProtocolChange(Pe=>{Pe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Pe)),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()),8&Pe?de.mousemove||(J.addEventListener("mousemove",De.mousemove),de.mousemove=De.mousemove):(J.removeEventListener("mousemove",de.mousemove),de.mousemove=null),16&Pe?de.wheel||(J.addEventListener("wheel",De.wheel,{passive:!1}),de.wheel=De.wheel):(J.removeEventListener("wheel",de.wheel),de.wheel=null),2&Pe?de.mouseup||(J.addEventListener("mouseup",De.mouseup),de.mouseup=De.mouseup):(this._document.removeEventListener("mouseup",de.mouseup),J.removeEventListener("mouseup",de.mouseup),de.mouseup=null),4&Pe?de.mousedrag||(de.mousedrag=De.mousedrag):(this._document.removeEventListener("mousemove",de.mousedrag),de.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(J,"mousedown",Pe=>{if(Pe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Pe))return Q(Pe),de.mouseup&&this._document.addEventListener("mouseup",de.mouseup),de.mousedrag&&this._document.addEventListener("mousemove",de.mousedrag),this.cancel(Pe)})),this.register((0,p.addDisposableDomListener)(J,"wheel",Pe=>{if(!de.wheel){if(!this.buffer.hasScrollback){const Ye=this.viewport.getLinesScrolled(Pe);if(Ye===0)return;const st=W.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Pe.deltaY<0?"A":"B");let yt="";for(let ce=0;ce{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Pe),this.cancel(Pe)},{passive:!0})),this.register((0,p.addDisposableDomListener)(J,"touchmove",Pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Pe)?void 0:this.cancel(Pe)},{passive:!1}))}refresh(K,J){var Q;(Q=this._renderService)===null||Q===void 0||Q.refreshRows(K,J)}updateCursorStyle(K){var J;!((J=this._selectionService)===null||J===void 0)&&J.shouldColumnSelect(K)?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(K,J,Q=0){var de;Q===1?(super.scrollLines(K,J,Q),this.refresh(0,this.rows-1)):(de=this.viewport)===null||de===void 0||de.scrollLines(K)}paste(K){(0,c.paste)(K,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(K){this._customKeyEventHandler=K}registerLinkProvider(K){return this.linkifier2.registerLinkProvider(K)}registerCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const J=this._characterJoinerService.register(K);return this.refresh(0,this.rows-1),J}deregisterCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(K)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(K){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+K)}registerDecoration(K){return this._decorationService.registerDecoration(K)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(K,J,Q){this._selectionService.setSelection(K,J,Q)}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 K;(K=this._selectionService)===null||K===void 0||K.clearSelection()}selectAll(){var K;(K=this._selectionService)===null||K===void 0||K.selectAll()}selectLines(K,J){var Q;(Q=this._selectionService)===null||Q===void 0||Q.selectLines(K,J)}_keyDown(K){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;const J=this.browser.isMac&&this.options.macOptionIsMeta&&K.altKey;if(!J&&!this._compositionHelper.keydown(K))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;J||K.key!=="Dead"&&K.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const Q=(0,N.evaluateKeyboardEvent)(K,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(K),Q.type===3||Q.type===2){const de=this.rows-1;return this.scrollLines(Q.type===2?-de:de),this.cancel(K,!0)}return Q.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,K)||(Q.cancel&&this.cancel(K,!0),!Q.key||!!(K.key&&!K.ctrlKey&&!K.altKey&&!K.metaKey&&K.key.length===1&&K.key.charCodeAt(0)>=65&&K.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(Q.key!==W.C0.ETX&&Q.key!==W.C0.CR||(this.textarea.value=""),this._onKey.fire({key:Q.key,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(Q.key,!0),!this.optionsService.rawOptions.screenReaderMode||K.altKey||K.ctrlKey?this.cancel(K,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(K,J){const Q=K.isMac&&!this.options.macOptionIsMeta&&J.altKey&&!J.ctrlKey&&!J.metaKey||K.isWindows&&J.altKey&&J.ctrlKey&&!J.metaKey||K.isWindows&&J.getModifierState("AltGraph");return J.type==="keypress"?Q:Q&&(!J.keyCode||J.keyCode>47)}_keyUp(K){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1||(function(J){return J.keyCode===16||J.keyCode===17||J.keyCode===18}(K)||this.focus(),this.updateCursorStyle(K),this._keyPressHandled=!1)}_keyPress(K){let J;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;if(this.cancel(K),K.charCode)J=K.charCode;else if(K.which===null||K.which===void 0)J=K.keyCode;else{if(K.which===0||K.charCode===0)return!1;J=K.which}return!(!J||(K.altKey||K.ctrlKey||K.metaKey)&&!this._isThirdLevelShift(this.browser,K)||(J=String.fromCharCode(J),this._onKey.fire({key:J,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(J,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(K){if(K.data&&K.inputType==="insertText"&&(!K.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const J=K.data;return this.coreService.triggerDataEvent(J,!0),this.cancel(K),!0}return!1}resize(K,J){K!==this.cols||J!==this.rows?super.resize(K,J):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(K,J){var Q,de;(Q=this._charSizeService)===null||Q===void 0||Q.measure(),(de=this.viewport)===null||de===void 0||de.syncScrollArea(!0)}clear(){var K;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 J=1;J{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(o,c=1e3){this._renderCallback=o,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,c,p){this._rowCount=p,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=u-this._lastRefreshMs,m=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},m)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c)}}},1680:function(d,r,o){var c=this&&this.__decorate||function(h,f,_,S){var k,P=arguments.length,M=P<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(h,f,_,S);else for(var w=h.length-1;w>=0;w--)(k=h[w])&&(M=(P<3?k(M):P>3?k(f,_,M):k(f,_))||M);return P>3&&M&&Object.defineProperty(f,_,M),M},p=this&&this.__param||function(h,f){return function(_,S){f(_,S,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const u=o(3656),g=o(4725),m=o(8460),y=o(844),v=o(2585);let l=r.Viewport=class extends y.Disposable{constructor(h,f,_,S,k,P,M,w){super(),this._viewportElement=h,this._scrollArea=f,this._bufferService=_,this._optionsService=S,this._charSizeService=k,this._renderService=P,this._coreBrowserService=M,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(T=>this._activeBuffer=T.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(T=>this._renderDimensions=T)),this._handleThemeChange(w.colors),this.register(w.onChangeColors(T=>this._handleThemeChange(T))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(h){this._viewportElement.style.backgroundColor=h.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(h){if(h)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const f=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==f&&(this._lastRecordedBufferHeight=f,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const h=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==h&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=h),this._refreshAnimationFrame=null}syncScrollArea(h=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(h);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(h)}_handleScroll(h){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const f=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const h=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(h*(this._smoothScrollState.target-this._smoothScrollState.origin)),h<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(h,f){const _=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(f<0&&this._viewportElement.scrollTop!==0||f>0&&_0&&(S=R),k=""}}return{bufferElements:P,cursorElement:S}}getLinesScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let f=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(f/=this._currentRowHeight+0,this._wheelPartialScroll+=f,f=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._bufferService.rows),f}_applyScrollModifier(h,f){const _=this._optionsService.rawOptions.fastScrollModifier;return _==="alt"&&f.altKey||_==="ctrl"&&f.ctrlKey||_==="shift"&&f.shiftKey?h*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:h*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(h){this._lastTouchY=h.touches[0].pageY}handleTouchMove(h){const f=this._lastTouchY-h.touches[0].pageY;return this._lastTouchY=h.touches[0].pageY,f!==0&&(this._viewportElement.scrollTop+=f,this._bubbleScroll(h,f))}};r.Viewport=l=c([p(2,v.IBufferService),p(3,v.IOptionsService),p(4,g.ICharSizeService),p(5,g.IRenderService),p(6,g.ICoreBrowserService),p(7,g.IThemeService)],l)},3107:function(d,r,o){var c=this&&this.__decorate||function(l,h,f,_){var S,k=arguments.length,P=k<3?h:_===null?_=Object.getOwnPropertyDescriptor(h,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(l,h,f,_);else for(var M=l.length-1;M>=0;M--)(S=l[M])&&(P=(k<3?S(P):k>3?S(h,f,P):S(h,f))||P);return k>3&&P&&Object.defineProperty(h,f,P),P},p=this&&this.__param||function(l,h){return function(f,_){h(f,_,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const u=o(3656),g=o(4725),m=o(844),y=o(2585);let v=r.BufferDecorationRenderer=class extends m.Disposable{constructor(l,h,f,_){super(),this._screenElement=l,this._bufferService=h,this._decorationService=f,this._renderService=_,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((0,u.addDisposableDomListener)(window,"resize",()=>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(S=>this._removeDecoration(S))),this.register((0,m.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const l of this._decorationService.decorations)this._renderDecoration(l);this._dimensionsChanged=!1}_renderDecoration(l){this._refreshStyle(l),this._dimensionsChanged&&this._refreshXPosition(l)}_createElement(l){var h,f;const _=document.createElement("div");_.classList.add("xterm-decoration"),_.classList.toggle("xterm-decoration-top-layer",((h=l==null?void 0:l.options)===null||h===void 0?void 0:h.layer)==="top"),_.style.width=`${Math.round((l.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,_.style.height=(l.options.height||1)*this._renderService.dimensions.css.cell.height+"px",_.style.top=(l.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",_.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const S=(f=l.options.x)!==null&&f!==void 0?f:0;return S&&S>this._bufferService.cols&&(_.style.display="none"),this._refreshXPosition(l,_),_}_refreshStyle(l){const h=l.marker.line-this._bufferService.buffers.active.ydisp;if(h<0||h>=this._bufferService.rows)l.element&&(l.element.style.display="none",l.onRenderEmitter.fire(l.element));else{let f=this._decorationElements.get(l);f||(f=this._createElement(l),l.element=f,this._decorationElements.set(l,f),this._container.appendChild(f),l.onDispose(()=>{this._decorationElements.delete(l),f.remove()})),f.style.top=h*this._renderService.dimensions.css.cell.height+"px",f.style.display=this._altBufferIsActive?"none":"block",l.onRenderEmitter.fire(f)}}_refreshXPosition(l,h=l.element){var f;if(!h)return;const _=(f=l.options.x)!==null&&f!==void 0?f:0;(l.options.anchor||"left")==="right"?h.style.right=_?_*this._renderService.dimensions.css.cell.width+"px":"":h.style.left=_?_*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(l){var h;(h=this._decorationElements.get(l))===null||h===void 0||h.remove(),this._decorationElements.delete(l),l.dispose()}};r.BufferDecorationRenderer=v=c([p(1,y.IBufferService),p(2,y.IDecorationService),p(3,g.IRenderService)],v)},5871:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.ColorZoneStore=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(o){if(o.options.overviewRulerOptions){for(const c of this._zones)if(c.color===o.options.overviewRulerOptions.color&&c.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,o.marker.line))return;if(this._lineAdjacentToZone(c,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(c,o.marker.line)}if(this._zonePoolIndex=o.startBufferLine&&c<=o.endBufferLine}_lineAdjacentToZone(o,c,p){return c>=o.startBufferLine-this._linePadding[p||"full"]&&c<=o.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(o,c){o.startBufferLine=Math.min(o.startBufferLine,c),o.endBufferLine=Math.max(o.endBufferLine,c)}}},5744:function(d,r,o){var c=this&&this.__decorate||function(S,k,P,M){var w,T=arguments.length,A=T<3?k:M===null?M=Object.getOwnPropertyDescriptor(k,P):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(S,k,P,M);else for(var E=S.length-1;E>=0;E--)(w=S[E])&&(A=(T<3?w(A):T>3?w(k,P,A):w(k,P))||A);return T>3&&A&&Object.defineProperty(k,P,A),A},p=this&&this.__param||function(S,k){return function(P,M){k(P,M,S)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const u=o(5871),g=o(3656),m=o(4725),y=o(844),v=o(2585),l={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0};let _=r.OverviewRulerRenderer=class extends y.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(S,k,P,M,w,T,A){var E;super(),this._viewportElement=S,this._screenElement=k,this._bufferService=P,this._decorationService=M,this._renderService=w,this._optionsService=T,this._coreBrowseService=A,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(E=this._viewportElement.parentElement)===null||E===void 0||E.insertBefore(this._canvas,this._viewportElement);const R=this._canvas.getContext("2d");if(!R)throw new Error("Ctx cannot be null");this._ctx=R,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,y.toDisposable)(()=>{var D;(D=this._canvas)===null||D===void 0||D.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){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())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register((0,g.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const S=Math.floor(this._canvas.width/3),k=Math.ceil(this._canvas.width/3);h.full=this._canvas.width,h.left=S,h.center=k,h.right=S,this._refreshDrawHeightConstants(),f.full=0,f.left=0,f.center=h.left,f.right=h.left+h.center}_refreshDrawHeightConstants(){l.full=Math.round(2*this._coreBrowseService.dpr);const S=this._canvas.height/this._bufferService.buffer.lines.length,k=Math.round(Math.max(Math.min(S,12),6)*this._coreBrowseService.dpr);l.left=k,l.center=k,l.right=k}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.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._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.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(const k of this._decorationService.decorations)this._colorZoneStore.addDecoration(k);this._ctx.lineWidth=1;const S=this._colorZoneStore.zones;for(const k of S)k.position!=="full"&&this._renderColorZone(k);for(const k of S)k.position==="full"&&this._renderColorZone(k);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(S){this._ctx.fillStyle=S.color,this._ctx.fillRect(f[S.position||"full"],Math.round((this._canvas.height-1)*(S.startBufferLine/this._bufferService.buffers.active.lines.length)-l[S.position||"full"]/2),h[S.position||"full"],Math.round((this._canvas.height-1)*((S.endBufferLine-S.startBufferLine)/this._bufferService.buffers.active.lines.length)+l[S.position||"full"]))}_queueRefresh(S,k){this._shouldUpdateDimensions=S||this._shouldUpdateDimensions,this._shouldUpdateAnchor=k||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};r.OverviewRulerRenderer=_=c([p(2,v.IBufferService),p(3,v.IDecorationService),p(4,m.IRenderService),p(5,v.IOptionsService),p(6,m.ICoreBrowserService)],_)},2950:function(d,r,o){var c=this&&this.__decorate||function(v,l,h,f){var _,S=arguments.length,k=S<3?l:f===null?f=Object.getOwnPropertyDescriptor(l,h):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(v,l,h,f);else for(var P=v.length-1;P>=0;P--)(_=v[P])&&(k=(S<3?_(k):S>3?_(l,h,k):_(l,h))||k);return S>3&&k&&Object.defineProperty(l,h,k),k},p=this&&this.__param||function(v,l){return function(h,f){l(h,f,v)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const u=o(4725),g=o(2585),m=o(2584);let y=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(v,l,h,f,_,S){this._textarea=v,this._compositionView=l,this._bufferService=h,this._optionsService=f,this._coreService=_,this._renderService=S,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(v){this._compositionView.textContent=v.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(v){if(this._isComposing||this._isSendingComposition){if(v.keyCode===229||v.keyCode===16||v.keyCode===17||v.keyCode===18)return!1;this._finalizeComposition(!1)}return v.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(v){if(this._compositionView.classList.remove("active"),this._isComposing=!1,v){const l={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let h;this._isSendingComposition=!1,l.start+=this._dataAlreadySent.length,h=this._isComposing?this._textarea.value.substring(l.start,l.end):this._textarea.value.substring(l.start),h.length>0&&this._coreService.triggerDataEvent(h,!0)}},0)}else{this._isSendingComposition=!1;const l=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(l,!0)}}_handleAnyTextareaChanges(){const v=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const l=this._textarea.value,h=l.replace(v,"");this._dataAlreadySent=h,l.length>v.length?this._coreService.triggerDataEvent(h,!0):l.lengththis.updateCompositionElements(!0),0)}}};r.CompositionHelper=y=c([p(2,g.IBufferService),p(3,g.IOptionsService),p(4,g.ICoreService),p(5,u.IRenderService)],y)},9806:(d,r)=>{function o(c,p,u){const g=u.getBoundingClientRect(),m=c.getComputedStyle(u),y=parseInt(m.getPropertyValue("padding-left")),v=parseInt(m.getPropertyValue("padding-top"));return[p.clientX-g.left-y,p.clientY-g.top-v]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=o,r.getCoords=function(c,p,u,g,m,y,v,l,h){if(!y)return;const f=o(c,p,u);return f?(f[0]=Math.ceil((f[0]+(h?v/2:0))/v),f[1]=Math.ceil(f[1]/l),f[0]=Math.min(Math.max(f[0],1),g+(h?1:0)),f[1]=Math.min(Math.max(f[1],1),m),f):void 0}},9504:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const c=o(2584);function p(l,h,f,_){const S=l-u(l,f),k=h-u(h,f),P=Math.abs(S-k)-function(M,w,T){let A=0;const E=M-u(M,T),R=w-u(w,T);for(let D=0;D=0&&lh?"A":"B"}function m(l,h,f,_,S,k){let P=l,M=h,w="";for(;P!==f||M!==_;)P+=S?1:-1,S&&P>k.cols-1?(w+=k.buffer.translateBufferLineToString(M,!1,l,P),P=0,l=0,M++):!S&&P<0&&(w+=k.buffer.translateBufferLineToString(M,!1,0,l+1),P=k.cols-1,l=P,M--);return w+k.buffer.translateBufferLineToString(M,!1,l,P)}function y(l,h){const f=h?"O":"[";return c.C0.ESC+f+l}function v(l,h){l=Math.floor(l);let f="";for(let _=0;_0?E-u(E,R):T;const O=E,U=function(W,N,z,V,j,G){let te;return te=p(z,V,j,G).length>0?V-u(V,j):N,W=z&&tel?"D":"C",v(Math.abs(S-l),y(P,_));P=k>h?"D":"C";const M=Math.abs(k-h);return v(function(w,T){return T.cols-w}(k>h?l:S,f)+(M-1)*f.cols+1+((k>h?S:l)-1),y(P,_))}},1296:function(d,r,o){var c=this&&this.__decorate||function(R,D,I,O){var U,W=arguments.length,N=W<3?D:O===null?O=Object.getOwnPropertyDescriptor(D,I):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(R,D,I,O);else for(var z=R.length-1;z>=0;z--)(U=R[z])&&(N=(W<3?U(N):W>3?U(D,I,N):U(D,I))||N);return W>3&&N&&Object.defineProperty(D,I,N),N},p=this&&this.__param||function(R,D){return function(I,O){D(I,O,R)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const u=o(3787),g=o(2550),m=o(2223),y=o(6171),v=o(4725),l=o(8055),h=o(8460),f=o(844),_=o(2585),S="xterm-dom-renderer-owner-",k="xterm-rows",P="xterm-fg-",M="xterm-bg-",w="xterm-focus",T="xterm-selection";let A=1,E=r.DomRenderer=class extends f.Disposable{constructor(R,D,I,O,U,W,N,z,V,j){super(),this._element=R,this._screenElement=D,this._viewportElement=I,this._linkifier2=O,this._charSizeService=W,this._optionsService=N,this._bufferService=z,this._coreBrowserService=V,this._themeService=j,this._terminalClass=A++,this._rowElements=[],this.onRequestRedraw=this.register(new h.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(k),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,y.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(G=>this._injectCss(G))),this._injectCss(this._themeService.colors),this._rowFactory=U.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(S+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(G=>this._handleLinkHover(G))),this.register(this._linkifier2.onHideLinkUnderline(G=>this._handleLinkLeave(G))),this.register((0,f.toDisposable)(()=>{this._element.classList.remove(S+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new g.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const R=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*R,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*R),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/R),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/R),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(const I of this._rowElements)I.style.width=`${this.dimensions.css.canvas.width}px`,I.style.height=`${this.dimensions.css.cell.height}px`,I.style.lineHeight=`${this.dimensions.css.cell.height}px`,I.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const D=`${this._terminalSelector} .${k} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=D,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(R){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let D=`${this._terminalSelector} .${k} { color: ${R.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;D+=`${this._terminalSelector} .${k} .xterm-dim { color: ${l.color.multiplyOpacity(R.foreground,.5).css};}`,D+=`${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;}`,D+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",D+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${R.cursor.css}; color: ${R.cursorAccent.css}; } 50% { background-color: inherit; color: ${R.cursor.css}; }}`,D+=`${this._terminalSelector} .${k}.${w} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${k}.${w} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block { background-color: ${R.cursor.css}; color: ${R.cursorAccent.css};}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${R.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${R.cursor.css} inset;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${R.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,D+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${R.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${R.selectionInactiveBackgroundOpaque.css};}`;for(const[I,O]of R.ansi.entries())D+=`${this._terminalSelector} .${P}${I} { color: ${O.css}; }${this._terminalSelector} .${P}${I}.xterm-dim { color: ${l.color.multiplyOpacity(O,.5).css}; }${this._terminalSelector} .${M}${I} { background-color: ${O.css}; }`;D+=`${this._terminalSelector} .${P}${m.INVERTED_DEFAULT_COLOR} { color: ${l.color.opaque(R.background).css}; }${this._terminalSelector} .${P}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${l.color.multiplyOpacity(l.color.opaque(R.background),.5).css}; }${this._terminalSelector} .${M}${m.INVERTED_DEFAULT_COLOR} { background-color: ${R.foreground.css}; }`,this._themeStyleElement.textContent=D}_setDefaultSpacing(){const R=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${R}px`,this._rowFactory.defaultSpacing=R}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(R,D){for(let I=this._rowElements.length;I<=D;I++){const O=document.createElement("div");this._rowContainer.appendChild(O),this._rowElements.push(O)}for(;this._rowElements.length>D;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(R,D){this._refreshRowElements(R,D),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(w)}handleFocus(){this._rowContainer.classList.add(w),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(R,D,I){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(R,D,I),this.renderRows(0,this._bufferService.rows-1),!R||!D)return;const O=R[1]-this._bufferService.buffer.ydisp,U=D[1]-this._bufferService.buffer.ydisp,W=Math.max(O,0),N=Math.min(U,this._bufferService.rows-1);if(W>=this._bufferService.rows||N<0)return;const z=document.createDocumentFragment();if(I){const V=R[0]>D[0];z.appendChild(this._createSelectionElement(W,V?D[0]:R[0],V?R[0]:D[0],N-W+1))}else{const V=O===W?R[0]:0,j=W===U?D[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(W,V,j));const G=N-W-1;if(z.appendChild(this._createSelectionElement(W+1,0,this._bufferService.cols,G)),W!==N){const te=U===N?D[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(N,0,te))}}this._selectionContainer.appendChild(z)}_createSelectionElement(R,D,I,O=1){const U=document.createElement("div");return U.style.height=O*this.dimensions.css.cell.height+"px",U.style.top=R*this.dimensions.css.cell.height+"px",U.style.left=D*this.dimensions.css.cell.width+"px",U.style.width=this.dimensions.css.cell.width*(I-D)+"px",U}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(const R of this._rowElements)R.replaceChildren()}renderRows(R,D){const I=this._bufferService.buffer,O=I.ybase+I.y,U=Math.min(I.x,this._bufferService.cols-1),W=this._optionsService.rawOptions.cursorBlink,N=this._optionsService.rawOptions.cursorStyle,z=this._optionsService.rawOptions.cursorInactiveStyle;for(let V=R;V<=D;V++){const j=V+I.ydisp,G=this._rowElements[V],te=I.lines.get(j);if(!G||!te)break;G.replaceChildren(...this._rowFactory.createRow(te,j,j===O,N,z,U,W,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${S}${this._terminalClass}`}_handleLinkHover(R){this._setCellUnderline(R.x1,R.x2,R.y1,R.y2,R.cols,!0)}_handleLinkLeave(R){this._setCellUnderline(R.x1,R.x2,R.y1,R.y2,R.cols,!1)}_setCellUnderline(R,D,I,O,U,W){I<0&&(R=0),O<0&&(D=0);const N=this._bufferService.rows-1;I=Math.max(Math.min(I,N),0),O=Math.max(Math.min(O,N),0),U=Math.min(U,this._bufferService.cols);const z=this._bufferService.buffer,V=z.ybase+z.y,j=Math.min(z.x,U-1),G=this._optionsService.rawOptions.cursorBlink,te=this._optionsService.rawOptions.cursorStyle,oe=this._optionsService.rawOptions.cursorInactiveStyle;for(let re=I;re<=O;++re){const ye=re+z.ydisp,K=this._rowElements[re],J=z.lines.get(ye);if(!K||!J)break;K.replaceChildren(...this._rowFactory.createRow(J,ye,ye===V,te,oe,j,G,this.dimensions.css.cell.width,this._widthCache,W?re===I?R:0:-1,W?(re===O?D:U)-1:-1))}}};r.DomRenderer=E=c([p(4,_.IInstantiationService),p(5,v.ICharSizeService),p(6,_.IOptionsService),p(7,_.IBufferService),p(8,v.ICoreBrowserService),p(9,v.IThemeService)],E)},3787:function(d,r,o){var c=this&&this.__decorate||function(P,M,w,T){var A,E=arguments.length,R=E<3?M:T===null?T=Object.getOwnPropertyDescriptor(M,w):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(P,M,w,T);else for(var D=P.length-1;D>=0;D--)(A=P[D])&&(R=(E<3?A(R):E>3?A(M,w,R):A(M,w))||R);return E>3&&R&&Object.defineProperty(M,w,R),R},p=this&&this.__param||function(P,M){return function(w,T){M(w,T,P)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;const u=o(2223),g=o(643),m=o(511),y=o(2585),v=o(8055),l=o(4725),h=o(4269),f=o(6171),_=o(3734);let S=r.DomRendererRowFactory=class{constructor(P,M,w,T,A,E,R){this._document=P,this._characterJoinerService=M,this._optionsService=w,this._coreBrowserService=T,this._coreService=A,this._decorationService=E,this._themeService=R,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(P,M,w){this._selectionStart=P,this._selectionEnd=M,this._columnSelectMode=w}createRow(P,M,w,T,A,E,R,D,I,O,U){const W=[],N=this._characterJoinerService.getJoinedCharacters(M),z=this._themeService.colors;let V,j=P.getNoBgTrimmedLength();w&&j0&&Ye===N[0][0]){yt=!0;const Ze=N.shift();ae=new h.JoinedCellData(this._workCell,P.translateToString(!0,Ze[0],Ze[1]),Ze[1]-Ze[0]),ce=Ze[1]-1,st=ae.getWidth()}const be=this._isCellInSelection(Ye,M),he=w&&Ye===E,Le=Pe&&Ye>=O&&Ye<=U;let et=!1;this._decorationService.forEachDecorationAtCell(Ye,M,void 0,Ze=>{et=!0});let je=ae.getChars()||g.WHITESPACE_CELL_CHAR;if(je===" "&&(ae.isUnderline()||ae.isOverline())&&(je=" "),de=st*D-I.get(je,ae.isBold(),ae.isItalic()),V){if(G&&(be&&Q||!be&&!Q&&ae.bg===oe)&&(be&&Q&&z.selectionForeground||ae.fg===re)&&ae.extended.ext===ye&&Le===K&&de===J&&!he&&!yt&&!et){te+=je,G++;continue}G&&(V.textContent=te),V=this._document.createElement("span"),G=0,te=""}else V=this._document.createElement("span");if(oe=ae.bg,re=ae.fg,ye=ae.extended.ext,K=Le,J=de,Q=be,yt&&E>=Ye&&E<=ce&&(E=Ye),!this._coreService.isCursorHidden&&he){if(De.push("xterm-cursor"),this._coreBrowserService.isFocused)R&&De.push("xterm-cursor-blink"),De.push(T==="bar"?"xterm-cursor-bar":T==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(A)switch(A){case"outline":De.push("xterm-cursor-outline");break;case"block":De.push("xterm-cursor-block");break;case"bar":De.push("xterm-cursor-bar");break;case"underline":De.push("xterm-cursor-underline")}}if(ae.isBold()&&De.push("xterm-bold"),ae.isItalic()&&De.push("xterm-italic"),ae.isDim()&&De.push("xterm-dim"),te=ae.isInvisible()?g.WHITESPACE_CELL_CHAR:ae.getChars()||g.WHITESPACE_CELL_CHAR,ae.isUnderline()&&(De.push(`xterm-underline-${ae.extended.underlineStyle}`),te===" "&&(te=" "),!ae.isUnderlineColorDefault()))if(ae.isUnderlineColorRGB())V.style.textDecorationColor=`rgb(${_.AttributeData.toColorRGB(ae.getUnderlineColor()).join(",")})`;else{let Ze=ae.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ae.isBold()&&Ze<8&&(Ze+=8),V.style.textDecorationColor=z.ansi[Ze].css}ae.isOverline()&&(De.push("xterm-overline"),te===" "&&(te=" ")),ae.isStrikethrough()&&De.push("xterm-strikethrough"),Le&&(V.style.textDecoration="underline");let _e=ae.getFgColor(),ie=ae.getFgColorMode(),we=ae.getBgColor(),Ee=ae.getBgColorMode();const x=!!ae.isInverse();if(x){const Ze=_e;_e=we,we=Ze;const wt=ie;ie=Ee,Ee=wt}let Re,Xe,Ue,xt=!1;switch(this._decorationService.forEachDecorationAtCell(Ye,M,void 0,Ze=>{Ze.options.layer!=="top"&&xt||(Ze.backgroundColorRGB&&(Ee=50331648,we=Ze.backgroundColorRGB.rgba>>8&16777215,Re=Ze.backgroundColorRGB),Ze.foregroundColorRGB&&(ie=50331648,_e=Ze.foregroundColorRGB.rgba>>8&16777215,Xe=Ze.foregroundColorRGB),xt=Ze.options.layer==="top")}),!xt&&be&&(Re=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,we=Re.rgba>>8&16777215,Ee=50331648,xt=!0,z.selectionForeground&&(ie=50331648,_e=z.selectionForeground.rgba>>8&16777215,Xe=z.selectionForeground)),xt&&De.push("xterm-decoration-top"),Ee){case 16777216:case 33554432:Ue=z.ansi[we],De.push(`xterm-bg-${we}`);break;case 50331648:Ue=v.rgba.toColor(we>>16,we>>8&255,255&we),this._addStyle(V,`background-color:#${k((we>>>0).toString(16),"0",6)}`);break;default:x?(Ue=z.foreground,De.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):Ue=z.background}switch(Re||ae.isDim()&&(Re=v.color.multiplyOpacity(Ue,.5)),ie){case 16777216:case 33554432:ae.isBold()&&_e<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(_e+=8),this._applyMinimumContrast(V,Ue,z.ansi[_e],ae,Re,void 0)||De.push(`xterm-fg-${_e}`);break;case 50331648:const Ze=v.rgba.toColor(_e>>16&255,_e>>8&255,255&_e);this._applyMinimumContrast(V,Ue,Ze,ae,Re,Xe)||this._addStyle(V,`color:#${k(_e.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(V,Ue,z.foreground,ae,Re,void 0)||x&&De.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}De.length&&(V.className=De.join(" "),De.length=0),he||yt||et?V.textContent=te:G++,de!==this.defaultSpacing&&(V.style.letterSpacing=`${de}px`),W.push(V),Ye=ce}return V&&G&&(V.textContent=te),W}_applyMinimumContrast(P,M,w,T,A,E){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.excludeFromContrastRatioDemands)(T.getCode()))return!1;const R=this._getContrastCache(T);let D;if(A||E||(D=R.getColor(M.rgba,w.rgba)),D===void 0){const I=this._optionsService.rawOptions.minimumContrastRatio/(T.isDim()?2:1);D=v.color.ensureContrastRatio(A||M,E||w,I),R.setColor((A||M).rgba,(E||w).rgba,D??null)}return!!D&&(this._addStyle(P,`color:${D.css}`),!0)}_getContrastCache(P){return P.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(P,M){P.setAttribute("style",`${P.getAttribute("style")||""}${M};`)}_isCellInSelection(P,M){const w=this._selectionStart,T=this._selectionEnd;return!(!w||!T)&&(this._columnSelectMode?w[0]<=T[0]?P>=w[0]&&M>=w[1]&&P=w[1]&&P>=T[0]&&M<=T[1]:M>w[1]&&M=w[0]&&P=w[0])}};function k(P,M,w){for(;P.length{Object.defineProperty(r,"__esModule",{value:!0}),r.WidthCache=void 0,r.WidthCache=class{constructor(o){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.createElement("div"),this._container.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const c=o.createElement("span"),p=o.createElement("span");p.style.fontWeight="bold";const u=o.createElement("span");u.style.fontStyle="italic";const g=o.createElement("span");g.style.fontWeight="bold",g.style.fontStyle="italic",this._measureElements=[c,p,u,g],this._container.appendChild(c),this._container.appendChild(p),this._container.appendChild(u),this._container.appendChild(g),o.body.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(o,c,p,u){o===this._font&&c===this._fontSize&&p===this._weight&&u===this._weightBold||(this._font=o,this._fontSize=c,this._weight=p,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(o,c,p){let u=0;if(!c&&!p&&o.length===1&&(u=o.charCodeAt(0))<256)return this._flat[u]!==-9999?this._flat[u]:this._flat[u]=this._measure(o,0);let g=o;c&&(g+="B"),p&&(g+="I");let m=this._holey.get(g);if(m===void 0){let y=0;c&&(y|=1),p&&(y|=2),m=this._measure(o,y),this._holey.set(g,m)}return m}_measure(o,c){const p=this._measureElements[c];return p.textContent=o.repeat(32),p.offsetWidth/32}}},2223:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const c=o(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(d,r)=>{function o(c){return 57508<=c&&c<=57558}Object.defineProperty(r,"__esModule",{value:!0}),r.createRenderDimensions=r.excludeFromContrastRatioDemands=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},r.isPowerlineGlyph=o,r.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},r.excludeFromContrastRatioDemands=function(c){return o(c)||function(p){return 9472<=p&&p<=9631}(c)},r.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(o){this._bufferService=o,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,c=this.selectionEnd;return!(!o||!c)&&(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(d,r,o){var c=this&&this.__decorate||function(l,h,f,_){var S,k=arguments.length,P=k<3?h:_===null?_=Object.getOwnPropertyDescriptor(h,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(l,h,f,_);else for(var M=l.length-1;M>=0;M--)(S=l[M])&&(P=(k<3?S(P):k>3?S(h,f,P):S(h,f))||P);return k>3&&P&&Object.defineProperty(h,f,P),P},p=this&&this.__param||function(l,h){return function(f,_){h(f,_,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const u=o(2585),g=o(8460),m=o(844);let y=r.CharSizeService=class extends m.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(l,h,f){super(),this._optionsService=f,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new v(l,h,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const l=this._measureStrategy.measure();l.width===this.width&&l.height===this.height||(this.width=l.width,this.height=l.height,this._onCharSizeChange.fire())}};r.CharSizeService=y=c([p(2,u.IOptionsService)],y);class v{constructor(h,f,_){this._document=h,this._parentElement=f,this._optionsService=_,this._result={width:0,height:0},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(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const h={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return h.width!==0&&h.height!==0&&(this._result.width=h.width/32,this._result.height=Math.ceil(h.height)),this._result}}},4269:function(d,r,o){var c=this&&this.__decorate||function(h,f,_,S){var k,P=arguments.length,M=P<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(h,f,_,S);else for(var w=h.length-1;w>=0;w--)(k=h[w])&&(M=(P<3?k(M):P>3?k(f,_,M):k(f,_))||M);return P>3&&M&&Object.defineProperty(f,_,M),M},p=this&&this.__param||function(h,f){return function(_,S){f(_,S,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const u=o(3734),g=o(643),m=o(511),y=o(2585);class v extends u.AttributeData{constructor(f,_,S){super(),this.content=0,this.combinedData="",this.fg=f.fg,this.bg=f.bg,this.combinedData=_,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(f){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=v;let l=r.CharacterJoinerService=class Km{constructor(f){this._bufferService=f,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(f){const _={id:this._nextCharacterJoinerId++,handler:f};return this._characterJoiners.push(_),_.id}deregister(f){for(let _=0;_1){const R=this._getJoinedRanges(k,w,M,_,P);for(let D=0;D1){const E=this._getJoinedRanges(k,w,M,_,P);for(let R=0;R{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0,r.CoreBrowserService=class{constructor(o,c){this._textarea=o,this.window=c,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}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}}},8934:function(d,r,o){var c=this&&this.__decorate||function(y,v,l,h){var f,_=arguments.length,S=_<3?v:h===null?h=Object.getOwnPropertyDescriptor(v,l):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(y,v,l,h);else for(var k=y.length-1;k>=0;k--)(f=y[k])&&(S=(_<3?f(S):_>3?f(v,l,S):f(v,l))||S);return _>3&&S&&Object.defineProperty(v,l,S),S},p=this&&this.__param||function(y,v){return function(l,h){v(l,h,y)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const u=o(4725),g=o(9806);let m=r.MouseService=class{constructor(y,v){this._renderService=y,this._charSizeService=v}getCoords(y,v,l,h,f){return(0,g.getCoords)(window,y,v,l,h,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,f)}getMouseReportCoords(y,v){const l=(0,g.getCoordsRelativeToElement)(window,y,v);if(this._charSizeService.hasValidSize)return l[0]=Math.min(Math.max(l[0],0),this._renderService.dimensions.css.canvas.width-1),l[1]=Math.min(Math.max(l[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(l[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(l[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(l[0]),y:Math.floor(l[1])}}};r.MouseService=m=c([p(0,u.IRenderService),p(1,u.ICharSizeService)],m)},3230:function(d,r,o){var c=this&&this.__decorate||function(S,k,P,M){var w,T=arguments.length,A=T<3?k:M===null?M=Object.getOwnPropertyDescriptor(k,P):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(S,k,P,M);else for(var E=S.length-1;E>=0;E--)(w=S[E])&&(A=(T<3?w(A):T>3?w(k,P,A):w(k,P))||A);return T>3&&A&&Object.defineProperty(k,P,A),A},p=this&&this.__param||function(S,k){return function(P,M){k(P,M,S)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const u=o(3656),g=o(6193),m=o(5596),y=o(4725),v=o(8460),l=o(844),h=o(7226),f=o(2585);let _=r.RenderService=class extends l.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(S,k,P,M,w,T,A,E){if(super(),this._rowCount=S,this._charSizeService=M,this._renderer=this.register(new l.MutableDisposable),this._pausedResizeTask=new h.DebouncedIdleTask,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 v.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new v.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new v.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new v.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new g.RenderDebouncer(A.window,(R,D)=>this._renderRows(R,D)),this.register(this._renderDebouncer),this._screenDprMonitor=new m.ScreenDprMonitor(A.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(T.onResize(()=>this._fullRefresh())),this.register(T.buffers.onBufferActivate(()=>{var R;return(R=this._renderer.value)===null||R===void 0?void 0:R.clear()})),this.register(P.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(w.onDecorationRegistered(()=>this._fullRefresh())),this.register(w.onDecorationRemoved(()=>this._fullRefresh())),this.register(P.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(T.cols,T.rows),this._fullRefresh()})),this.register(P.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(T.buffer.y,T.buffer.y,!0))),this.register((0,u.addDisposableDomListener)(A.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(E.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in A.window){const R=new A.window.IntersectionObserver(D=>this._handleIntersectionChange(D[D.length-1]),{threshold:0});R.observe(k),this.register({dispose:()=>R.disconnect()})}}_handleIntersectionChange(S){this._isPaused=S.isIntersecting===void 0?S.intersectionRatio===0:!S.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(S,k,P=!1){this._isPaused?this._needsFullRefresh=!0:(P||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(S,k,this._rowCount))}_renderRows(S,k){this._renderer.value&&(S=Math.min(S,this._rowCount-1),k=Math.min(k,this._rowCount-1),this._renderer.value.renderRows(S,k),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:S,end:k}),this._onRender.fire({start:S,end:k}),this._isNextRenderRedrawOnly=!0)}resize(S,k){this._rowCount=k,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(S){this._renderer.value=S,this._renderer.value.onRequestRedraw(k=>this.refreshRows(k.start,k.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(S){return this._renderDebouncer.addRefreshCallback(S)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var S,k;this._renderer.value&&((k=(S=this._renderer.value).clearTextureAtlas)===null||k===void 0||k.call(S),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(S,k){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(S,k)):this._renderer.value.handleResize(S,k),this._fullRefresh())}handleCharSizeChanged(){var S;(S=this._renderer.value)===null||S===void 0||S.handleCharSizeChanged()}handleBlur(){var S;(S=this._renderer.value)===null||S===void 0||S.handleBlur()}handleFocus(){var S;(S=this._renderer.value)===null||S===void 0||S.handleFocus()}handleSelectionChanged(S,k,P){var M;this._selectionState.start=S,this._selectionState.end=k,this._selectionState.columnSelectMode=P,(M=this._renderer.value)===null||M===void 0||M.handleSelectionChanged(S,k,P)}handleCursorMove(){var S;(S=this._renderer.value)===null||S===void 0||S.handleCursorMove()}clear(){var S;(S=this._renderer.value)===null||S===void 0||S.clear()}};r.RenderService=_=c([p(2,f.IOptionsService),p(3,y.ICharSizeService),p(4,f.IDecorationService),p(5,f.IBufferService),p(6,y.ICoreBrowserService),p(7,y.IThemeService)],_)},9312:function(d,r,o){var c=this&&this.__decorate||function(w,T,A,E){var R,D=arguments.length,I=D<3?T:E===null?E=Object.getOwnPropertyDescriptor(T,A):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(w,T,A,E);else for(var O=w.length-1;O>=0;O--)(R=w[O])&&(I=(D<3?R(I):D>3?R(T,A,I):R(T,A))||I);return D>3&&I&&Object.defineProperty(T,A,I),I},p=this&&this.__param||function(w,T){return function(A,E){T(A,E,w)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const u=o(9806),g=o(9504),m=o(456),y=o(4725),v=o(8460),l=o(844),h=o(6114),f=o(4841),_=o(511),S=o(2585),k=" ",P=new RegExp(k,"g");let M=r.SelectionService=class extends l.Disposable{constructor(w,T,A,E,R,D,I,O,U){super(),this._element=w,this._screenElement=T,this._linkifier=A,this._bufferService=E,this._coreService=R,this._mouseService=D,this._optionsService=I,this._renderService=O,this._coreBrowserService=U,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new _.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new v.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new v.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new v.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=W=>this._handleMouseMove(W),this._mouseUpListener=W=>this._handleMouseUp(W),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(W=>this._handleTrim(W)),this.register(this._bufferService.buffers.onBufferActivate(W=>this._handleBufferActivate(W))),this.enable(),this._model=new m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,l.toDisposable)(()=>{this._removeMouseDownListeners()}))}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(){const w=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;return!(!w||!T||w[0]===T[0]&&w[1]===T[1])}get selectionText(){const w=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;if(!w||!T)return"";const A=this._bufferService.buffer,E=[];if(this._activeSelectionMode===3){if(w[0]===T[0])return"";const R=w[0]R.replace(P," ")).join(h.isWindows?`\r -`:` -`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(w){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),h.isLinux&&w&&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(w){const T=this._getMouseBufferCoords(w),A=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;return!!(A&&E&&T)&&this._areCoordsInSelection(T,A,E)}isCellInSelection(w,T){const A=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;return!(!A||!E)&&this._areCoordsInSelection([w,T],A,E)}_areCoordsInSelection(w,T,A){return w[1]>T[1]&&w[1]=T[0]&&w[0]=T[0]}_selectWordAtCursor(w,T){var A,E;const R=(E=(A=this._linkifier.currentLink)===null||A===void 0?void 0:A.link)===null||E===void 0?void 0:E.range;if(R)return this._model.selectionStart=[R.start.x-1,R.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(R,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const D=this._getMouseBufferCoords(w);return!!D&&(this._selectWordAt(D,T),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(w,T){this._model.clearSelection(),w=Math.max(w,0),T=Math.min(T,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,w],this._model.selectionEnd=[this._bufferService.cols,T],this.refresh(),this._onSelectionChange.fire()}_handleTrim(w){this._model.handleTrim(w)&&this.refresh()}_getMouseBufferCoords(w){const T=this._mouseService.getCoords(w,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(T)return T[0]--,T[1]--,T[1]+=this._bufferService.buffer.ydisp,T}_getMouseEventScrollAmount(w){let T=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,w,this._screenElement)[1];const A=this._renderService.dimensions.css.canvas.height;return T>=0&&T<=A?0:(T>A&&(T-=A),T=Math.min(Math.max(T,-50),50),T/=50,T/Math.abs(T)+Math.round(14*T))}shouldForceSelection(w){return h.isMac?w.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:w.shiftKey}handleMouseDown(w){if(this._mouseDownTimeStamp=w.timeStamp,(w.button!==2||!this.hasSelection)&&w.button===0){if(!this._enabled){if(!this.shouldForceSelection(w))return;w.stopPropagation()}w.preventDefault(),this._dragScrollAmount=0,this._enabled&&w.shiftKey?this._handleIncrementalClick(w):w.detail===1?this._handleSingleClick(w):w.detail===2?this._handleDoubleClick(w):w.detail===3&&this._handleTripleClick(w),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(),50)}_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(w){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(w))}_handleSingleClick(w){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(w)?3:0,this._model.selectionStart=this._getMouseBufferCoords(w),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const 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(w){this._selectWordAtCursor(w,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(w){const T=this._getMouseBufferCoords(w);T&&(this._activeSelectionMode=2,this._selectLineAt(T[1]))}shouldColumnSelect(w){return w.altKey&&!(h.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(w){if(w.stopImmediatePropagation(),!this._model.selectionStart)return;const T=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(w),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const A=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(w.ydisp+this._bufferService.rows,w.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=w.ydisp),this.refresh()}}_handleMouseUp(w){const T=w.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&T<500&&w.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const A=this._mouseService.getCoords(w,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(A&&A[0]!==void 0&&A[1]!==void 0){const E=(0,g.moveToCellSequence)(A[0]-1,A[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(E,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const w=this._model.finalSelectionStart,T=this._model.finalSelectionEnd,A=!(!w||!T||w[0]===T[0]&&w[1]===T[1]);A?w&&T&&(this._oldSelectionStart&&this._oldSelectionEnd&&w[0]===this._oldSelectionStart[0]&&w[1]===this._oldSelectionStart[1]&&T[0]===this._oldSelectionEnd[0]&&T[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(w,T,A)):this._oldHasSelection&&this._fireOnSelectionChange(w,T,A)}_fireOnSelectionChange(w,T,A){this._oldSelectionStart=w,this._oldSelectionEnd=T,this._oldHasSelection=A,this._onSelectionChange.fire()}_handleBufferActivate(w){this.clearSelection(),this._trimListener.dispose(),this._trimListener=w.activeBuffer.lines.onTrim(T=>this._handleTrim(T))}_convertViewportColToCharacterIndex(w,T){let A=T;for(let E=0;T>=E;E++){const R=w.loadCell(E,this._workCell).getChars().length;this._workCell.getWidth()===0?A--:R>1&&T!==E&&(A+=R-1)}return A}setSelection(w,T,A){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[w,T],this._model.selectionStartLength=A,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(w){this._isClickInSelection(w)||(this._selectWordAtCursor(w,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(w,T,A=!0,E=!0){if(w[0]>=this._bufferService.cols)return;const R=this._bufferService.buffer,D=R.lines.get(w[1]);if(!D)return;const I=R.translateBufferLineToString(w[1],!1);let O=this._convertViewportColToCharacterIndex(D,w[0]),U=O;const W=w[0]-O;let N=0,z=0,V=0,j=0;if(I.charAt(O)===" "){for(;O>0&&I.charAt(O-1)===" ";)O--;for(;U1&&(j+=ye-1,U+=ye-1);oe>0&&O>0&&!this._isCharWordSeparator(D.loadCell(oe-1,this._workCell));){D.loadCell(oe-1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===0?(N++,oe--):K>1&&(V+=K-1,O-=K-1),O--,oe--}for(;re1&&(j+=K-1,U+=K-1),U++,re++}}U++;let G=O+W-N+V,te=Math.min(this._bufferService.cols,U-O+N+z-V-j);if(T||I.slice(O,U).trim()!==""){if(A&&G===0&&D.getCodePoint(0)!==32){const oe=R.lines.get(w[1]-1);if(oe&&D.isWrapped&&oe.getCodePoint(this._bufferService.cols-1)!==32){const re=this._getWordAt([this._bufferService.cols-1,w[1]-1],!1,!0,!1);if(re){const ye=this._bufferService.cols-re.start;G-=ye,te+=ye}}}if(E&&G+te===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const oe=R.lines.get(w[1]+1);if(oe!=null&&oe.isWrapped&&oe.getCodePoint(0)!==32){const re=this._getWordAt([0,w[1]+1],!1,!1,!0);re&&(te+=re.length)}}return{start:G,length:te}}}_selectWordAt(w,T){const A=this._getWordAt(w,T);if(A){for(;A.start<0;)A.start+=this._bufferService.cols,w[1]--;this._model.selectionStart=[A.start,w[1]],this._model.selectionStartLength=A.length}}_selectToWordAt(w){const T=this._getWordAt(w,!0);if(T){let A=w[1];for(;T.start<0;)T.start+=this._bufferService.cols,A--;if(!this._model.areSelectionValuesReversed())for(;T.start+T.length>this._bufferService.cols;)T.length-=this._bufferService.cols,A++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?T.start:T.start+T.length,A]}}_isCharWordSeparator(w){return w.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(w.getChars())>=0}_selectLineAt(w){const T=this._bufferService.buffer.getWrappedRangeForLine(w),A={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=(0,f.getRangeLength)(A,this._bufferService.cols)}};r.SelectionService=M=c([p(3,S.IBufferService),p(4,S.ICoreService),p(5,y.IMouseService),p(6,S.IOptionsService),p(7,y.IRenderService),p(8,y.ICoreBrowserService)],M)},4725:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;const c=o(8343);r.ICharSizeService=(0,c.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),r.IMouseService=(0,c.createDecorator)("MouseService"),r.IRenderService=(0,c.createDecorator)("RenderService"),r.ISelectionService=(0,c.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,c.createDecorator)("ThemeService")},6731:function(d,r,o){var c=this&&this.__decorate||function(M,w,T,A){var E,R=arguments.length,D=R<3?w:A===null?A=Object.getOwnPropertyDescriptor(w,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(M,w,T,A);else for(var I=M.length-1;I>=0;I--)(E=M[I])&&(D=(R<3?E(D):R>3?E(w,T,D):E(w,T))||D);return R>3&&D&&Object.defineProperty(w,T,D),D},p=this&&this.__param||function(M,w){return function(T,A){w(T,A,M)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const u=o(7239),g=o(8055),m=o(8460),y=o(844),v=o(2585),l=g.css.toColor("#ffffff"),h=g.css.toColor("#000000"),f=g.css.toColor("#ffffff"),_=g.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],w=[0,95,135,175,215,255];for(let T=0;T<216;T++){const A=w[T/36%6|0],E=w[T/6%6|0],R=w[T%6];M.push({css:g.channels.toCss(A,E,R),rgba:g.channels.toRgba(A,E,R)})}for(let T=0;T<24;T++){const A=8+10*T;M.push({css:g.channels.toCss(A,A,A),rgba:g.channels.toRgba(A,A,A)})}return M})());let k=r.ThemeService=class extends y.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:l,background:h,cursor:f,cursorAccent:_,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:g.color.blend(h,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:g.color.blend(h,S),ansi:r.DEFAULT_ANSI_COLORS.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)))}_setTheme(M={}){const w=this._colors;if(w.foreground=P(M.foreground,l),w.background=P(M.background,h),w.cursor=P(M.cursor,f),w.cursorAccent=P(M.cursorAccent,_),w.selectionBackgroundTransparent=P(M.selectionBackground,S),w.selectionBackgroundOpaque=g.color.blend(w.background,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundTransparent=P(M.selectionInactiveBackground,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundOpaque=g.color.blend(w.background,w.selectionInactiveBackgroundTransparent),w.selectionForeground=M.selectionForeground?P(M.selectionForeground,g.NULL_COLOR):void 0,w.selectionForeground===g.NULL_COLOR&&(w.selectionForeground=void 0),g.color.isOpaque(w.selectionBackgroundTransparent)&&(w.selectionBackgroundTransparent=g.color.opacity(w.selectionBackgroundTransparent,.3)),g.color.isOpaque(w.selectionInactiveBackgroundTransparent)&&(w.selectionInactiveBackgroundTransparent=g.color.opacity(w.selectionInactiveBackgroundTransparent,.3)),w.ansi=r.DEFAULT_ANSI_COLORS.slice(),w.ansi[0]=P(M.black,r.DEFAULT_ANSI_COLORS[0]),w.ansi[1]=P(M.red,r.DEFAULT_ANSI_COLORS[1]),w.ansi[2]=P(M.green,r.DEFAULT_ANSI_COLORS[2]),w.ansi[3]=P(M.yellow,r.DEFAULT_ANSI_COLORS[3]),w.ansi[4]=P(M.blue,r.DEFAULT_ANSI_COLORS[4]),w.ansi[5]=P(M.magenta,r.DEFAULT_ANSI_COLORS[5]),w.ansi[6]=P(M.cyan,r.DEFAULT_ANSI_COLORS[6]),w.ansi[7]=P(M.white,r.DEFAULT_ANSI_COLORS[7]),w.ansi[8]=P(M.brightBlack,r.DEFAULT_ANSI_COLORS[8]),w.ansi[9]=P(M.brightRed,r.DEFAULT_ANSI_COLORS[9]),w.ansi[10]=P(M.brightGreen,r.DEFAULT_ANSI_COLORS[10]),w.ansi[11]=P(M.brightYellow,r.DEFAULT_ANSI_COLORS[11]),w.ansi[12]=P(M.brightBlue,r.DEFAULT_ANSI_COLORS[12]),w.ansi[13]=P(M.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),w.ansi[14]=P(M.brightCyan,r.DEFAULT_ANSI_COLORS[14]),w.ansi[15]=P(M.brightWhite,r.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const T=Math.min(w.ansi.length-16,M.extendedAnsi.length);for(let A=0;A{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const c=o(8460),p=o(844);class u extends p.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(m){if(this._maxLength===m)return;const y=new Array(m);for(let v=0;vthis._length)for(let y=this._length;y=m;l--)this._array[this._getCyclicIndex(l+v.length)]=this._array[this._getCyclicIndex(l)];for(let l=0;lthis._maxLength){const l=this._length+v.length-this._maxLength;this._startIndex+=l,this._length=this._maxLength,this.onTrimEmitter.fire(l)}else this._length+=v.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,y,v){if(!(y<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+v<0)throw new Error("Cannot shift elements in list beyond index 0");if(v>0){for(let h=y-1;h>=0;h--)this.set(m+h+v,this.get(m+h));const l=m+y+v-this._length;if(l>0)for(this._length+=l;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let l=0;l{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function o(c,p=5){if(typeof c!="object")return c;const u=Array.isArray(c)?[]:{};for(const g in c)u[g]=p<=1?c[g]:c[g]&&o(c[g],p-1);return u}},8055:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;const c=o(6114);let p=0,u=0,g=0,m=0;var y,v,l,h,f;function _(k){const P=k.toString(16);return P.length<2?"0"+P:P}function S(k,P){return k>>0}}(y||(r.channels=y={})),function(k){function P(M,w){return m=Math.round(255*w),[p,u,g]=f.toChannels(M.rgba),{css:y.toCss(p,u,g,m),rgba:y.toRgba(p,u,g,m)}}k.blend=function(M,w){if(m=(255&w.rgba)/255,m===1)return{css:w.css,rgba:w.rgba};const T=w.rgba>>24&255,A=w.rgba>>16&255,E=w.rgba>>8&255,R=M.rgba>>24&255,D=M.rgba>>16&255,I=M.rgba>>8&255;return p=R+Math.round((T-R)*m),u=D+Math.round((A-D)*m),g=I+Math.round((E-I)*m),{css:y.toCss(p,u,g),rgba:y.toRgba(p,u,g)}},k.isOpaque=function(M){return(255&M.rgba)==255},k.ensureContrastRatio=function(M,w,T){const A=f.ensureContrastRatio(M.rgba,w.rgba,T);if(A)return f.toColor(A>>24&255,A>>16&255,A>>8&255)},k.opaque=function(M){const w=(255|M.rgba)>>>0;return[p,u,g]=f.toChannels(w),{css:y.toCss(p,u,g),rgba:w}},k.opacity=P,k.multiplyOpacity=function(M,w){return m=255&M.rgba,P(M,m*w/255)},k.toColorRGB=function(M){return[M.rgba>>24&255,M.rgba>>16&255,M.rgba>>8&255]}}(v||(r.color=v={})),function(k){let P,M;if(!c.isNode){const w=document.createElement("canvas");w.width=1,w.height=1;const T=w.getContext("2d",{willReadFrequently:!0});T&&(P=T,P.globalCompositeOperation="copy",M=P.createLinearGradient(0,0,1,1))}k.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return p=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),g=parseInt(w.slice(3,4).repeat(2),16),f.toColor(p,u,g);case 5:return p=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),g=parseInt(w.slice(3,4).repeat(2),16),m=parseInt(w.slice(4,5).repeat(2),16),f.toColor(p,u,g,m);case 7:return{css:w,rgba:(parseInt(w.slice(1),16)<<8|255)>>>0};case 9:return{css:w,rgba:parseInt(w.slice(1),16)>>>0}}const T=w.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return p=parseInt(T[1]),u=parseInt(T[2]),g=parseInt(T[3]),m=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),f.toColor(p,u,g,m);if(!P||!M)throw new Error("css.toColor: Unsupported css format");if(P.fillStyle=M,P.fillStyle=w,typeof P.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(P.fillRect(0,0,1,1),[p,u,g,m]=P.getImageData(0,0,1,1).data,m!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:y.toRgba(p,u,g,m),css:w}}}(l||(r.css=l={})),function(k){function P(M,w,T){const A=M/255,E=w/255,R=T/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.0722*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}k.relativeLuminance=function(M){return P(M>>16&255,M>>8&255,255&M)},k.relativeLuminance2=P}(h||(r.rgb=h={})),function(k){function P(w,T,A){const E=w>>24&255,R=w>>16&255,D=w>>8&255;let I=T>>24&255,O=T>>16&255,U=T>>8&255,W=S(h.relativeLuminance2(I,O,U),h.relativeLuminance2(E,R,D));for(;W0||O>0||U>0);)I-=Math.max(0,Math.ceil(.1*I)),O-=Math.max(0,Math.ceil(.1*O)),U-=Math.max(0,Math.ceil(.1*U)),W=S(h.relativeLuminance2(I,O,U),h.relativeLuminance2(E,R,D));return(I<<24|O<<16|U<<8|255)>>>0}function M(w,T,A){const E=w>>24&255,R=w>>16&255,D=w>>8&255;let I=T>>24&255,O=T>>16&255,U=T>>8&255,W=S(h.relativeLuminance2(I,O,U),h.relativeLuminance2(E,R,D));for(;W>>0}k.ensureContrastRatio=function(w,T,A){const E=h.relativeLuminance(w>>8),R=h.relativeLuminance(T>>8);if(S(E,R)>8));if(US(E,h.relativeLuminance(W>>8))?O:W}return O}const D=M(w,T,A),I=S(E,h.relativeLuminance(D>>8));if(IS(E,h.relativeLuminance(O>>8))?D:O}return D}},k.reduceLuminance=P,k.increaseLuminance=M,k.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]},k.toColor=function(w,T,A,E){return{css:y.toCss(w,T,A,E),rgba:y.toRgba(w,T,A,E)}}}(f||(r.rgba=f={})),r.toPaddedHex=_,r.contrastRatio=S},8969:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const c=o(844),p=o(2585),u=o(4348),g=o(7866),m=o(744),y=o(7302),v=o(6975),l=o(8460),h=o(1753),f=o(1480),_=o(7994),S=o(9282),k=o(5435),P=o(5981),M=o(2660);let w=!1;class T extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new l.EventEmitter),this._onScroll.event(E=>{var R;(R=this._onScrollApi)===null||R===void 0||R.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(const R in E)this.optionsService.options[R]=E[R]}constructor(E){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new l.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new l.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new l.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new y.OptionsService(E)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(v.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(h.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(_.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new k.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,l.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,l.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,l.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,l.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(R=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(R=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new P.WriteBuffer((R,D)=>this._inputHandler.parse(R,D))),this.register((0,l.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(E,R){this._writeBuffer.write(E,R)}writeSync(E,R){this._logService.logLevel<=p.LogLevelEnum.WARN&&!w&&(this._logService.warn("writeSync is unreliable and will be removed soon."),w=!0),this._writeBuffer.writeSync(E,R)}resize(E,R){isNaN(E)||isNaN(R)||(E=Math.max(E,m.MINIMUM_COLS),R=Math.max(R,m.MINIMUM_ROWS),this._bufferService.resize(E,R))}scroll(E,R=!1){this._bufferService.scroll(E,R)}scrollLines(E,R,D){this._bufferService.scrollLines(E,R,D)}scrollPages(E){this.scrollLines(E*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(E){const R=E-this._bufferService.buffer.ydisp;R!==0&&this.scrollLines(R)}registerEscHandler(E,R){return this._inputHandler.registerEscHandler(E,R)}registerDcsHandler(E,R){return this._inputHandler.registerDcsHandler(E,R)}registerCsiHandler(E,R){return this._inputHandler.registerCsiHandler(E,R)}registerOscHandler(E,R){return this._inputHandler.registerOscHandler(E,R)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let E=!1;const R=this.optionsService.rawOptions.windowsPty;R&&R.buildNumber!==void 0&&R.buildNumber!==void 0?E=R.backend==="conpty"&&R.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(E=!0),E?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const E=[];E.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),E.push(this.registerCsiHandler({final:"H"},()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)(()=>{for(const R of E)R.dispose()})}}}r.CoreTerminal=T},8460:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;cc.fire(p))}},5435:function(d,r,o){var c=this&&this.__decorate||function(W,N,z,V){var j,G=arguments.length,te=G<3?N:V===null?V=Object.getOwnPropertyDescriptor(N,z):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")te=Reflect.decorate(W,N,z,V);else for(var oe=W.length-1;oe>=0;oe--)(j=W[oe])&&(te=(G<3?j(te):G>3?j(N,z,te):j(N,z))||te);return G>3&&te&&Object.defineProperty(N,z,te),te},p=this&&this.__param||function(W,N){return function(z,V){N(z,V,W)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const u=o(2584),g=o(7116),m=o(2015),y=o(844),v=o(482),l=o(8437),h=o(8460),f=o(643),_=o(511),S=o(3734),k=o(2585),P=o(6242),M=o(6351),w=o(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},A=131072;function E(W,N){if(W>24)return N.setWinLines||!1;switch(W){case 1:return!!N.restoreWin;case 2:return!!N.minimizeWin;case 3:return!!N.setWinPosition;case 4:return!!N.setWinSizePixels;case 5:return!!N.raiseWin;case 6:return!!N.lowerWin;case 7:return!!N.refreshWin;case 8:return!!N.setWinSizeChars;case 9:return!!N.maximizeWin;case 10:return!!N.fullscreenWin;case 11:return!!N.getWinState;case 13:return!!N.getWinPosition;case 14:return!!N.getWinSizePixels;case 15:return!!N.getScreenSizePixels;case 16:return!!N.getCellSizePixels;case 18:return!!N.getWinSizeChars;case 19:return!!N.getScreenSizeChars;case 20:return!!N.getIconTitle;case 21:return!!N.getWinTitle;case 22:return!!N.pushTitle;case 23:return!!N.popTitle;case 24:return!!N.setWinLines}return!1}var R;(function(W){W[W.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",W[W.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(R||(r.WindowsOptionsReportType=R={}));let D=0;class I extends y.Disposable{getAttrData(){return this._curAttrData}constructor(N,z,V,j,G,te,oe,re,ye=new m.EscapeSequenceParser){super(),this._bufferService=N,this._charsetService=z,this._coreService=V,this._logService=j,this._optionsService=G,this._oscLinkService=te,this._coreMouseService=oe,this._unicodeService=re,this._parser=ye,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new v.StringToUtf32,this._utf8Decoder=new v.Utf8ToUtf32,this._workCell=new _.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new h.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new h.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new h.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new h.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new h.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new h.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new h.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new h.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new h.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new h.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new h.EventEmitter),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 O(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(K=>this._activeBuffer=K.activeBuffer)),this._parser.setCsiHandlerFallback((K,J)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(K),params:J.toArray()})}),this._parser.setEscHandlerFallback(K=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(K)})}),this._parser.setExecuteHandlerFallback(K=>{this._logService.debug("Unknown EXECUTE code: ",{code:K})}),this._parser.setOscHandlerFallback((K,J,Q)=>{this._logService.debug("Unknown OSC code: ",{identifier:K,action:J,data:Q})}),this._parser.setDcsHandlerFallback((K,J,Q)=>{J==="HOOK"&&(Q=Q.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(K),action:J,payload:Q})}),this._parser.setPrintHandler((K,J,Q)=>this.print(K,J,Q)),this._parser.registerCsiHandler({final:"@"},K=>this.insertChars(K)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},K=>this.scrollLeft(K)),this._parser.registerCsiHandler({final:"A"},K=>this.cursorUp(K)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},K=>this.scrollRight(K)),this._parser.registerCsiHandler({final:"B"},K=>this.cursorDown(K)),this._parser.registerCsiHandler({final:"C"},K=>this.cursorForward(K)),this._parser.registerCsiHandler({final:"D"},K=>this.cursorBackward(K)),this._parser.registerCsiHandler({final:"E"},K=>this.cursorNextLine(K)),this._parser.registerCsiHandler({final:"F"},K=>this.cursorPrecedingLine(K)),this._parser.registerCsiHandler({final:"G"},K=>this.cursorCharAbsolute(K)),this._parser.registerCsiHandler({final:"H"},K=>this.cursorPosition(K)),this._parser.registerCsiHandler({final:"I"},K=>this.cursorForwardTab(K)),this._parser.registerCsiHandler({final:"J"},K=>this.eraseInDisplay(K,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},K=>this.eraseInDisplay(K,!0)),this._parser.registerCsiHandler({final:"K"},K=>this.eraseInLine(K,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},K=>this.eraseInLine(K,!0)),this._parser.registerCsiHandler({final:"L"},K=>this.insertLines(K)),this._parser.registerCsiHandler({final:"M"},K=>this.deleteLines(K)),this._parser.registerCsiHandler({final:"P"},K=>this.deleteChars(K)),this._parser.registerCsiHandler({final:"S"},K=>this.scrollUp(K)),this._parser.registerCsiHandler({final:"T"},K=>this.scrollDown(K)),this._parser.registerCsiHandler({final:"X"},K=>this.eraseChars(K)),this._parser.registerCsiHandler({final:"Z"},K=>this.cursorBackwardTab(K)),this._parser.registerCsiHandler({final:"`"},K=>this.charPosAbsolute(K)),this._parser.registerCsiHandler({final:"a"},K=>this.hPositionRelative(K)),this._parser.registerCsiHandler({final:"b"},K=>this.repeatPrecedingCharacter(K)),this._parser.registerCsiHandler({final:"c"},K=>this.sendDeviceAttributesPrimary(K)),this._parser.registerCsiHandler({prefix:">",final:"c"},K=>this.sendDeviceAttributesSecondary(K)),this._parser.registerCsiHandler({final:"d"},K=>this.linePosAbsolute(K)),this._parser.registerCsiHandler({final:"e"},K=>this.vPositionRelative(K)),this._parser.registerCsiHandler({final:"f"},K=>this.hVPosition(K)),this._parser.registerCsiHandler({final:"g"},K=>this.tabClear(K)),this._parser.registerCsiHandler({final:"h"},K=>this.setMode(K)),this._parser.registerCsiHandler({prefix:"?",final:"h"},K=>this.setModePrivate(K)),this._parser.registerCsiHandler({final:"l"},K=>this.resetMode(K)),this._parser.registerCsiHandler({prefix:"?",final:"l"},K=>this.resetModePrivate(K)),this._parser.registerCsiHandler({final:"m"},K=>this.charAttributes(K)),this._parser.registerCsiHandler({final:"n"},K=>this.deviceStatus(K)),this._parser.registerCsiHandler({prefix:"?",final:"n"},K=>this.deviceStatusPrivate(K)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},K=>this.softReset(K)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},K=>this.setCursorStyle(K)),this._parser.registerCsiHandler({final:"r"},K=>this.setScrollRegion(K)),this._parser.registerCsiHandler({final:"s"},K=>this.saveCursor(K)),this._parser.registerCsiHandler({final:"t"},K=>this.windowOptions(K)),this._parser.registerCsiHandler({final:"u"},K=>this.restoreCursor(K)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},K=>this.insertColumns(K)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},K=>this.deleteColumns(K)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},K=>this.selectProtected(K)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},K=>this.requestMode(K,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},K=>this.requestMode(K,!1)),this._parser.setExecuteHandler(u.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(u.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(u.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(u.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(u.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(u.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(u.C1.IND,()=>this.index()),this._parser.setExecuteHandler(u.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(u.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new P.OscHandler(K=>(this.setTitle(K),this.setIconName(K),!0))),this._parser.registerOscHandler(1,new P.OscHandler(K=>this.setIconName(K))),this._parser.registerOscHandler(2,new P.OscHandler(K=>this.setTitle(K))),this._parser.registerOscHandler(4,new P.OscHandler(K=>this.setOrReportIndexedColor(K))),this._parser.registerOscHandler(8,new P.OscHandler(K=>this.setHyperlink(K))),this._parser.registerOscHandler(10,new P.OscHandler(K=>this.setOrReportFgColor(K))),this._parser.registerOscHandler(11,new P.OscHandler(K=>this.setOrReportBgColor(K))),this._parser.registerOscHandler(12,new P.OscHandler(K=>this.setOrReportCursorColor(K))),this._parser.registerOscHandler(104,new P.OscHandler(K=>this.restoreIndexedColor(K))),this._parser.registerOscHandler(110,new P.OscHandler(K=>this.restoreFgColor(K))),this._parser.registerOscHandler(111,new P.OscHandler(K=>this.restoreBgColor(K))),this._parser.registerOscHandler(112,new P.OscHandler(K=>this.restoreCursorColor(K))),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(const K in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:K},()=>this.selectCharset("("+K)),this._parser.registerEscHandler({intermediates:")",final:K},()=>this.selectCharset(")"+K)),this._parser.registerEscHandler({intermediates:"*",final:K},()=>this.selectCharset("*"+K)),this._parser.registerEscHandler({intermediates:"+",final:K},()=>this.selectCharset("+"+K)),this._parser.registerEscHandler({intermediates:"-",final:K},()=>this.selectCharset("-"+K)),this._parser.registerEscHandler({intermediates:".",final:K},()=>this.selectCharset("."+K)),this._parser.registerEscHandler({intermediates:"/",final:K},()=>this.selectCharset("/"+K));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(K=>(this._logService.error("Parsing error: ",K),K)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new M.DcsHandler((K,J)=>this.requestStatusString(K,J)))}_preserveStack(N,z,V,j){this._parseStack.paused=!0,this._parseStack.cursorStartX=N,this._parseStack.cursorStartY=z,this._parseStack.decodedLength=V,this._parseStack.position=j}_logSlowResolvingAsync(N){this._logService.logLevel<=k.LogLevelEnum.WARN&&Promise.race([N,new Promise((z,V)=>setTimeout(()=>V("#SLOW_TIMEOUT"),5e3))]).catch(z=>{if(z!=="#SLOW_TIMEOUT")throw z;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(N,z){let V,j=this._activeBuffer.x,G=this._activeBuffer.y,te=0;const oe=this._parseStack.paused;if(oe){if(V=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,z))return this._logSlowResolvingAsync(V),V;j=this._parseStack.cursorStartX,G=this._parseStack.cursorStartY,this._parseStack.paused=!1,N.length>A&&(te=this._parseStack.position+A)}if(this._logService.logLevel<=k.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof N=="string"?` "${N}"`:` "${Array.prototype.map.call(N,re=>String.fromCharCode(re)).join("")}"`),typeof N=="string"?N.split("").map(re=>re.charCodeAt(0)):N),this._parseBuffer.lengthA)for(let re=te;re0&&Q.getWidth(this._activeBuffer.x-1)===2&&Q.setCellFromCodePoint(this._activeBuffer.x-1,0,1,J.fg,J.bg,J.extended);for(let de=z;de=re){if(ye){for(;this._activeBuffer.x=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=re-1,G===2)continue}if(K&&(Q.insertCells(this._activeBuffer.x,G,this._activeBuffer.getNullCell(J),J),Q.getWidth(re-1)===2&&Q.setCellFromCodePoint(re-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,J.fg,J.bg,J.extended)),Q.setCellFromCodePoint(this._activeBuffer.x++,j,G,J.fg,J.bg,J.extended),G>0)for(;--G;)Q.setCellFromCodePoint(this._activeBuffer.x++,0,0,J.fg,J.bg,J.extended)}else Q.getWidth(this._activeBuffer.x-1)?Q.addCodepointToCell(this._activeBuffer.x-1,j):Q.addCodepointToCell(this._activeBuffer.x-2,j)}V-z>0&&(Q.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x0&&Q.getWidth(this._activeBuffer.x)===0&&!Q.hasContent(this._activeBuffer.x)&&Q.setCellFromCodePoint(this._activeBuffer.x,0,1,J.fg,J.bg,J.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(N,z){return N.final!=="t"||N.prefix||N.intermediates?this._parser.registerCsiHandler(N,z):this._parser.registerCsiHandler(N,V=>!E(V.params[0],this._optionsService.rawOptions.windowOptions)||z(V))}registerDcsHandler(N,z){return this._parser.registerDcsHandler(N,new M.DcsHandler(z))}registerEscHandler(N,z){return this._parser.registerEscHandler(N,z)}registerOscHandler(N,z){return this._parser.registerOscHandler(N,new P.OscHandler(z))}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 N;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&&(!((N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||N===void 0)&&N.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);z.hasWidth(this._activeBuffer.x)&&!z.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const N=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-N),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(N=this._bufferService.cols-1){this._activeBuffer.x=Math.min(N,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(N,z){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=N,this._activeBuffer.y=this._activeBuffer.scrollTop+z):(this._activeBuffer.x=N,this._activeBuffer.y=z),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(N,z){this._restrictCursor(),this._setCursor(this._activeBuffer.x+N,this._activeBuffer.y+z)}cursorUp(N){const z=this._activeBuffer.y-this._activeBuffer.scrollTop;return z>=0?this._moveCursor(0,-Math.min(z,N.params[0]||1)):this._moveCursor(0,-(N.params[0]||1)),!0}cursorDown(N){const z=this._activeBuffer.scrollBottom-this._activeBuffer.y;return z>=0?this._moveCursor(0,Math.min(z,N.params[0]||1)):this._moveCursor(0,N.params[0]||1),!0}cursorForward(N){return this._moveCursor(N.params[0]||1,0),!0}cursorBackward(N){return this._moveCursor(-(N.params[0]||1),0),!0}cursorNextLine(N){return this.cursorDown(N),this._activeBuffer.x=0,!0}cursorPrecedingLine(N){return this.cursorUp(N),this._activeBuffer.x=0,!0}cursorCharAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(N){return this._setCursor(N.length>=2?(N.params[1]||1)-1:0,(N.params[0]||1)-1),!0}charPosAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(N){return this._moveCursor(N.params[0]||1,0),!0}linePosAbsolute(N){return this._setCursor(this._activeBuffer.x,(N.params[0]||1)-1),!0}vPositionRelative(N){return this._moveCursor(0,N.params[0]||1),!0}hVPosition(N){return this.cursorPosition(N),!0}tabClear(N){const z=N.params[0];return z===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:z===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let z=N.params[0]||1;for(;z--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let z=N.params[0]||1;for(;z--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(N){const z=N.params[0];return z===1&&(this._curAttrData.bg|=536870912),z!==2&&z!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(N,z,V,j=!1,G=!1){const te=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);te.replaceCells(z,V,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),G),j&&(te.isWrapped=!1)}_resetBufferLine(N,z=!1){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);V&&(V.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),z),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+N),V.isWrapped=!1)}eraseInDisplay(N,z=!1){let V;switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:for(V=this._activeBuffer.y,this._dirtyRowTracker.markDirty(V),this._eraseInBufferLine(V++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,z);V=this._bufferService.cols&&(this._activeBuffer.lines.get(V+1).isWrapped=!1);V--;)this._resetBufferLine(V,z);this._dirtyRowTracker.markDirty(0);break;case 2:for(V=this._bufferService.rows,this._dirtyRowTracker.markDirty(V-1);V--;)this._resetBufferLine(V,z);this._dirtyRowTracker.markDirty(0);break;case 3:const j=this._activeBuffer.lines.length-this._bufferService.rows;j>0&&(this._activeBuffer.lines.trimStart(j),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-j,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-j,0),this._onScroll.fire(0))}return!0}eraseInLine(N,z=!1){switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,z);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,z);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,z)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(N){this._restrictCursor();let z=N.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.y0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(N){return N.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(N.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(N){return(this._optionsService.rawOptions.termName+"").indexOf(N)===0}setMode(N){for(let z=0;zYe?1:2,de=N.params[0];return De=de,Pe=z?de===2?4:de===4?Q(te.modes.insertMode):de===12?3:de===20?Q(J.convertEol):0:de===1?Q(V.applicationCursorKeys):de===3?J.windowOptions.setWinLines?re===80?2:re===132?1:0:0:de===6?Q(V.origin):de===7?Q(V.wraparound):de===8?3:de===9?Q(j==="X10"):de===12?Q(J.cursorBlink):de===25?Q(!te.isCursorHidden):de===45?Q(V.reverseWraparound):de===66?Q(V.applicationKeypad):de===67?4:de===1e3?Q(j==="VT200"):de===1002?Q(j==="DRAG"):de===1003?Q(j==="ANY"):de===1004?Q(V.sendFocus):de===1005?4:de===1006?Q(G==="SGR"):de===1015?4:de===1016?Q(G==="SGR_PIXELS"):de===1048?1:de===47||de===1047||de===1049?Q(ye===K):de===2004?Q(V.bracketedPasteMode):0,te.triggerDataEvent(`${u.C0.ESC}[${z?"":"?"}${De};${Pe}$y`),!0;var De,Pe}_updateAttrColor(N,z,V,j,G){return z===2?(N|=50331648,N&=-16777216,N|=S.AttributeData.fromColorRGB([V,j,G])):z===5&&(N&=-50331904,N|=33554432|255&V),N}_extractColor(N,z,V){const j=[0,0,-1,0,0,0];let G=0,te=0;do{if(j[te+G]=N.params[z+te],N.hasSubParams(z+te)){const oe=N.getSubParams(z+te);let re=0;do j[1]===5&&(G=1),j[te+re+1+G]=oe[re];while(++re=2||j[1]===2&&te+G>=5)break;j[1]&&(G=1)}while(++te+z5)&&(N=1),z.extended.underlineStyle=N,z.fg|=268435456,N===0&&(z.fg&=-268435457),z.updateExtended()}_processSGR0(N){N.fg=l.DEFAULT_ATTR_DATA.fg,N.bg=l.DEFAULT_ATTR_DATA.bg,N.extended=N.extended.clone(),N.extended.underlineStyle=0,N.extended.underlineColor&=-67108864,N.updateExtended()}charAttributes(N){if(N.length===1&&N.params[0]===0)return this._processSGR0(this._curAttrData),!0;const z=N.length;let V;const j=this._curAttrData;for(let G=0;G=30&&V<=37?(j.fg&=-50331904,j.fg|=16777216|V-30):V>=40&&V<=47?(j.bg&=-50331904,j.bg|=16777216|V-40):V>=90&&V<=97?(j.fg&=-50331904,j.fg|=16777224|V-90):V>=100&&V<=107?(j.bg&=-50331904,j.bg|=16777224|V-100):V===0?this._processSGR0(j):V===1?j.fg|=134217728:V===3?j.bg|=67108864:V===4?(j.fg|=268435456,this._processUnderline(N.hasSubParams(G)?N.getSubParams(G)[0]:1,j)):V===5?j.fg|=536870912:V===7?j.fg|=67108864:V===8?j.fg|=1073741824:V===9?j.fg|=2147483648:V===2?j.bg|=134217728:V===21?this._processUnderline(2,j):V===22?(j.fg&=-134217729,j.bg&=-134217729):V===23?j.bg&=-67108865:V===24?(j.fg&=-268435457,this._processUnderline(0,j)):V===25?j.fg&=-536870913:V===27?j.fg&=-67108865:V===28?j.fg&=-1073741825:V===29?j.fg&=2147483647:V===39?(j.fg&=-67108864,j.fg|=16777215&l.DEFAULT_ATTR_DATA.fg):V===49?(j.bg&=-67108864,j.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):V===38||V===48||V===58?G+=this._extractColor(N,G,j):V===53?j.bg|=1073741824:V===55?j.bg&=-1073741825:V===59?(j.extended=j.extended.clone(),j.extended.underlineColor=-1,j.updateExtended()):V===100?(j.fg&=-67108864,j.fg|=16777215&l.DEFAULT_ATTR_DATA.fg,j.bg&=-67108864,j.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",V);return!0}deviceStatus(N){switch(N.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const z=this._activeBuffer.y+1,V=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${z};${V}R`)}return!0}deviceStatusPrivate(N){if(N.params[0]===6){const z=this._activeBuffer.y+1,V=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${z};${V}R`)}return!0}softReset(N){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=l.DEFAULT_ATTR_DATA.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(N){const z=N.params[0]||1;switch(z){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const V=z%2==1;return this._optionsService.options.cursorBlink=V,!0}setScrollRegion(N){const z=N.params[0]||1;let V;return(N.length<2||(V=N.params[1])>this._bufferService.rows||V===0)&&(V=this._bufferService.rows),V>z&&(this._activeBuffer.scrollTop=z-1,this._activeBuffer.scrollBottom=V-1,this._setCursor(0,0)),!0}windowOptions(N){if(!E(N.params[0],this._optionsService.rawOptions.windowOptions))return!0;const z=N.length>1?N.params[1]:0;switch(N.params[0]){case 14:z!==2&&this._onRequestWindowsOptionsReport.fire(R.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(R.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:z!==0&&z!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),z!==0&&z!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:z!==0&&z!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),z!==0&&z!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(N){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(N){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(N){return this._windowTitle=N,this._onTitleChange.fire(N),!0}setIconName(N){return this._iconName=N,!0}setOrReportIndexedColor(N){const z=[],V=N.split(";");for(;V.length>1;){const j=V.shift(),G=V.shift();if(/^\d+$/.exec(j)){const te=parseInt(j);if(U(te))if(G==="?")z.push({type:0,index:te});else{const oe=(0,w.parseColor)(G);oe&&z.push({type:1,index:te,color:oe})}}}return z.length&&this._onColor.fire(z),!0}setHyperlink(N){const z=N.split(";");return!(z.length<2)&&(z[1]?this._createHyperlink(z[0],z[1]):!z[0]&&this._finishHyperlink())}_createHyperlink(N,z){this._getCurrentLinkId()&&this._finishHyperlink();const V=N.split(":");let j;const G=V.findIndex(te=>te.startsWith("id="));return G!==-1&&(j=V[G].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:j,uri:z}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(N,z){const V=N.split(";");for(let j=0;j=this._specialColors.length);++j,++z)if(V[j]==="?")this._onColor.fire([{type:0,index:this._specialColors[z]}]);else{const G=(0,w.parseColor)(V[j]);G&&this._onColor.fire([{type:1,index:this._specialColors[z],color:G}])}return!0}setOrReportFgColor(N){return this._setOrReportSpecialColor(N,0)}setOrReportBgColor(N){return this._setOrReportSpecialColor(N,1)}setOrReportCursorColor(N){return this._setOrReportSpecialColor(N,2)}restoreIndexedColor(N){if(!N)return this._onColor.fire([{type:2}]),!0;const z=[],V=N.split(";");for(let j=0;j=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){const N=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,N,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=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(N){return this._charsetService.setgLevel(N),!0}screenAlignmentPattern(){const N=new _.CellData;N.content=4194373,N.fg=this._curAttrData.fg,N.bg=this._curAttrData.bg,this._setCursor(0,0);for(let z=0;z(this._coreService.triggerDataEvent(`${u.C0.ESC}${G}${u.C0.ESC}\\`),!0))(N==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:N==='"p'?'P1$r61;1"p':N==="r"?`P1$r${V.scrollTop+1};${V.scrollBottom+1}r`:N==="m"?"P1$r0m":N===" q"?`P1$r${{block:2,underline:4,bar:6}[j.cursorStyle]-(j.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(N,z){this._dirtyRowTracker.markRangeDirty(N,z)}}r.InputHandler=I;let O=class{constructor(W){this._bufferService=W,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(W){Wthis.end&&(this.end=W)}markRangeDirty(W,N){W>N&&(D=W,W=N,N=D),Wthis.end&&(this.end=N)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function U(W){return 0<=W&&W<256}O=c([p(0,k.IBufferService)],O)},844:(d,r)=>{function o(c){for(const p of c)p.dispose();c.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const p=this._disposables.indexOf(c);p!==-1&&this._disposables.splice(p,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var p;this._isDisposed||c===this._value||((p=this._value)===null||p===void 0||p.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)===null||c===void 0||c.dispose(),this._value=void 0}},r.toDisposable=function(c){return{dispose:c}},r.disposeArray=o,r.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},1505:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(p,u,g){this._data[p]||(this._data[p]={}),this._data[p][u]=g}get(p,u){return this._data[p]?this._data[p][u]:void 0}clear(){this._data={}}}r.TwoKeyMap=o,r.FourKeyMap=class{constructor(){this._data=new o}set(c,p,u,g,m){this._data.get(c,p)||this._data.set(c,p,new o),this._data.get(c,p).set(u,g,m)}get(c,p,u,g){var m;return(m=this._data.get(c,p))===null||m===void 0?void 0:m.get(u,g)}clear(){this._data.clear()}}},6114:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof navigator>"u";const o=r.isNode?"node":navigator.userAgent,c=r.isNode?"node":navigator.platform;r.isFirefox=o.includes("Firefox"),r.isLegacyEdge=o.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(o),r.getSafariVersion=function(){if(!r.isSafari)return 0;const p=o.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),r.isIpad=c==="iPad",r.isIphone=c==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),r.isLinux=c.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(o)},6106:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let o=0;r.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(o=this._search(this._getKey(c)),this._array.splice(o,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const p=this._getKey(c);if(p===void 0||(o=this._search(p),o===-1)||this._getKey(this._array[o])!==p)return!1;do if(this._array[o]===c)return this._array.splice(o,1),!0;while(++o=this._array.length)&&this._getKey(this._array[o])===c))do yield this._array[o];while(++o=this._array.length)&&this._getKey(this._array[o])===c))do p(this._array[o]);while(++o=p;){let g=p+u>>1;const m=this._getKey(this._array[g]);if(m>c)u=g-1;else{if(!(m0&&this._getKey(this._array[g-1])===c;)g--;return g}p=g+1}}return p}}},7226:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const c=o(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._ih)return l-y<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(l-y))}ms`),void this._start();l=h}this.clear()}}class u extends p{_requestCallback(m){return setTimeout(()=>m(this._createDeadline(16)))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const y=Date.now()+m;return{timeRemaining:()=>Math.max(0,y-Date.now())}}}r.PriorityTaskQueue=u,r.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:u,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const c=o(643);r.updateWindowsModeWrappedState=function(p){const u=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),g=u==null?void 0:u.get(p.cols-1),m=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);m&&g&&(m.isWrapped=g[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&g[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new o;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}r.AttributeData=o;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}constructor(u=0,g=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=g}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=c},9092:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const c=o(6349),p=o(7226),u=o(3734),g=o(8437),m=o(4634),y=o(511),v=o(643),l=o(4863),h=o(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(f,_,S){this._hasScrollback=f,this._optionsService=_,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=h.DEFAULT_CHARSET,this.markers=[],this._nullCell=y.CellData.fromCharData([0,v.NULL_CELL_CHAR,v.NULL_CELL_WIDTH,v.NULL_CELL_CODE]),this._whitespaceCell=y.CellData.fromCharData([0,v.WHITESPACE_CELL_CHAR,v.WHITESPACE_CELL_WIDTH,v.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(f){return f?(this._nullCell.fg=f.fg,this._nullCell.bg=f.bg,this._nullCell.extended=f.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(f){return f?(this._whitespaceCell.fg=f.fg,this._whitespaceCell.bg=f.bg,this._whitespaceCell.extended=f.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(f,_){return new g.BufferLine(this._bufferService.cols,this.getNullCell(f),_)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const f=this.ybase+this.y-this.ydisp;return f>=0&&fr.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:_}fillViewportRows(f){if(this.lines.length===0){f===void 0&&(f=g.DEFAULT_ATTR_DATA);let _=this._rows;for(;_--;)this.lines.push(this.getBlankLine(f))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(f,_){const S=this.getNullCell(g.DEFAULT_ATTR_DATA);let k=0;const P=this._getCorrectBufferLength(_);if(P>this.lines.maxLength&&(this.lines.maxLength=P),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(f,S)));else for(let w=this._rows;w>_;w--)this.lines.length>_+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(P0&&(this.lines.trimStart(w),this.ybase=Math.max(this.ybase-w,0),this.ydisp=Math.max(this.ydisp-w,0),this.savedY=Math.max(this.savedY-w,0)),this.lines.maxLength=P}this.x=Math.min(this.x,f-1),this.y=Math.min(this.y,_-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,f-1),this.scrollTop=0}if(this.scrollBottom=_-1,this._isReflowEnabled&&(this._reflow(f,_),this._cols>f))for(let M=0;M.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let f=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,f=!1);let _=0;for(;this._memoryCleanupPosition100)return!0;return f}get _isReflowEnabled(){const f=this._optionsService.rawOptions.windowsPty;return f&&f.buildNumber?this._hasScrollback&&f.backend==="conpty"&&f.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(f,_){this._cols!==f&&(f>this._cols?this._reflowLarger(f,_):this._reflowSmaller(f,_))}_reflowLarger(f,_){const S=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,f,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(S.length>0){const k=(0,m.reflowLargerCreateNewLayout)(this.lines,S);(0,m.reflowLargerApplyNewLayout)(this.lines,k.layout),this._reflowLargerAdjustViewport(f,_,k.countRemoved)}}_reflowLargerAdjustViewport(f,_,S){const k=this.getNullCell(g.DEFAULT_ATTR_DATA);let P=S;for(;P-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<_&&this.lines.push(new g.BufferLine(f,k))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(f,_){const S=this.getNullCell(g.DEFAULT_ATTR_DATA),k=[];let P=0;for(let M=this.lines.length-1;M>=0;M--){let w=this.lines.get(M);if(!w||!w.isWrapped&&w.getTrimmedLength()<=f)continue;const T=[w];for(;w.isWrapped&&M>0;)w=this.lines.get(--M),T.unshift(w);const A=this.ybase+this.y;if(A>=M&&A0&&(k.push({start:M+T.length+P,newLines:O}),P+=O.length),T.push(...O);let U=R.length-1,W=R[U];W===0&&(U--,W=R[U]);let N=T.length-D-1,z=E;for(;N>=0;){const j=Math.min(z,W);if(T[U]===void 0)break;if(T[U].copyCellsFrom(T[N],z-j,W-j,j,!0),W-=j,W===0&&(U--,W=R[U]),z-=j,z===0){N--;const G=Math.max(N,0);z=(0,m.getWrappedLineTrimmedLength)(T,G,this._cols)}}for(let j=0;j0;)this.ybase===0?this.y<_-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase0){const M=[],w=[];for(let U=0;U=0;U--)if(R&&R.start>A+D){for(let W=R.newLines.length-1;W>=0;W--)this.lines.set(U--,R.newLines[W]);U++,M.push({index:A+1,amount:R.newLines.length}),D+=R.newLines.length,R=k[++E]}else this.lines.set(U,w[A--]);let I=0;for(let U=M.length-1;U>=0;U--)M[U].index+=I,this.lines.onInsertEmitter.fire(M[U]),I+=M[U].amount;const O=Math.max(0,T+P-this.lines.maxLength);O>0&&this.lines.onTrimEmitter.fire(O)}}translateBufferLineToString(f,_,S=0,k){const P=this.lines.get(f);return P?P.translateToString(_,S,k):""}getWrappedRangeForLine(f){let _=f,S=f;for(;_>0&&this.lines.get(_).isWrapped;)_--;for(;S+10;);return f>=this._cols?this._cols-1:f<0?0:f}nextStop(f){for(f==null&&(f=this.x);!this.tabs[++f]&&f=this._cols?this._cols-1:f<0?0:f}clearMarkers(f){this._isClearing=!0;for(let _=0;_{_.line-=S,_.line<0&&_.dispose()})),_.register(this.lines.onInsert(S=>{_.line>=S.index&&(_.line+=S.amount)})),_.register(this.lines.onDelete(S=>{_.line>=S.index&&_.lineS.index&&(_.line-=S.amount)})),_.register(_.onDispose(()=>this._removeMarker(_))),_}_removeMarker(f){this._isClearing||this.markers.splice(this.markers.indexOf(f),1)}}},8437:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const c=o(3734),p=o(511),u=o(643),g=o(482);r.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let m=0;class y{constructor(l,h,f=!1){this.isWrapped=f,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*l);const _=h||p.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let S=0;S>22,2097152&h?this._combined[l].charCodeAt(this._combined[l].length-1):f]}set(l,h){this._data[3*l+1]=h[u.CHAR_DATA_ATTR_INDEX],h[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[l]=h[1],this._data[3*l+0]=2097152|l|h[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*l+0]=h[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|h[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(l){return this._data[3*l+0]>>22}hasWidth(l){return 12582912&this._data[3*l+0]}getFg(l){return this._data[3*l+1]}getBg(l){return this._data[3*l+2]}hasContent(l){return 4194303&this._data[3*l+0]}getCodePoint(l){const h=this._data[3*l+0];return 2097152&h?this._combined[l].charCodeAt(this._combined[l].length-1):2097151&h}isCombined(l){return 2097152&this._data[3*l+0]}getString(l){const h=this._data[3*l+0];return 2097152&h?this._combined[l]:2097151&h?(0,g.stringFromCodePoint)(2097151&h):""}isProtected(l){return 536870912&this._data[3*l+2]}loadCell(l,h){return m=3*l,h.content=this._data[m+0],h.fg=this._data[m+1],h.bg=this._data[m+2],2097152&h.content&&(h.combinedData=this._combined[l]),268435456&h.bg&&(h.extended=this._extendedAttrs[l]),h}setCell(l,h){2097152&h.content&&(this._combined[l]=h.combinedData),268435456&h.bg&&(this._extendedAttrs[l]=h.extended),this._data[3*l+0]=h.content,this._data[3*l+1]=h.fg,this._data[3*l+2]=h.bg}setCellFromCodePoint(l,h,f,_,S,k){268435456&S&&(this._extendedAttrs[l]=k),this._data[3*l+0]=h|f<<22,this._data[3*l+1]=_,this._data[3*l+2]=S}addCodepointToCell(l,h){let f=this._data[3*l+0];2097152&f?this._combined[l]+=(0,g.stringFromCodePoint)(h):(2097151&f?(this._combined[l]=(0,g.stringFromCodePoint)(2097151&f)+(0,g.stringFromCodePoint)(h),f&=-2097152,f|=2097152):f=h|4194304,this._data[3*l+0]=f)}insertCells(l,h,f,_){if((l%=this.length)&&this.getWidth(l-1)===2&&this.setCellFromCodePoint(l-1,0,1,(_==null?void 0:_.fg)||0,(_==null?void 0:_.bg)||0,(_==null?void 0:_.extended)||new c.ExtendedAttrs),h=0;--k)this.setCell(l+h+k,this.loadCell(l+k,S));for(let k=0;kthis.length){if(this._data.buffer.byteLength>=4*f)this._data=new Uint32Array(this._data.buffer,0,f);else{const _=new Uint32Array(f);_.set(this._data),this._data=_}for(let _=this.length;_=l&&delete this._combined[P]}const S=Object.keys(this._extendedAttrs);for(let k=0;k=l&&delete this._extendedAttrs[P]}}return this.length=l,4*f*2=0;--l)if(4194303&this._data[3*l+0])return l+(this._data[3*l+0]>>22);return 0}getNoBgTrimmedLength(){for(let l=this.length-1;l>=0;--l)if(4194303&this._data[3*l+0]||50331648&this._data[3*l+2])return l+(this._data[3*l+0]>>22);return 0}copyCellsFrom(l,h,f,_,S){const k=l._data;if(S)for(let M=_-1;M>=0;M--){for(let w=0;w<3;w++)this._data[3*(f+M)+w]=k[3*(h+M)+w];268435456&k[3*(h+M)+2]&&(this._extendedAttrs[f+M]=l._extendedAttrs[h+M])}else for(let M=0;M<_;M++){for(let w=0;w<3;w++)this._data[3*(f+M)+w]=k[3*(h+M)+w];268435456&k[3*(h+M)+2]&&(this._extendedAttrs[f+M]=l._extendedAttrs[h+M])}const P=Object.keys(l._combined);for(let M=0;M=h&&(this._combined[w-h+f]=l._combined[w])}}translateToString(l=!1,h=0,f=this.length){l&&(f=Math.min(f,this.getTrimmedLength()));let _="";for(;h>22||1}return _}}r.BufferLine=y},4841:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(o,c){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return c*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(d,r)=>{function o(c,p,u){if(p===c.length-1)return c[p].getTrimmedLength();const g=!c[p].hasContent(u-1)&&c[p].getWidth(u-1)===1,m=c[p+1].getWidth(0)===2;return g&&m?u-1:u}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(c,p,u,g,m){const y=[];for(let v=0;v=v&&g0&&(w>_||f[w].getTrimmedLength()===0);w--)M++;M>0&&(y.push(v+f.length-M),y.push(M)),v+=f.length-1}return y},r.reflowLargerCreateNewLayout=function(c,p){const u=[];let g=0,m=p[g],y=0;for(let v=0;vo(c,f,p)).reduce((h,f)=>h+f);let y=0,v=0,l=0;for(;lh&&(y-=h,v++);const f=c[v].getWidth(y-1)===2;f&&y--;const _=f?u-1:u;g.push(_),l+=_}return g},r.getWrappedLineTrimmedLength=o},5295:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const c=o(8460),p=o(844),u=o(9092);class g extends p.Disposable{constructor(y,v){super(),this._optionsService=y,this._bufferService=v,this._onBufferActivate=this.register(new c.EventEmitter),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 u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!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(y){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(y),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(y,v){this._normal.resize(y,v),this._alt.resize(y,v),this.setupTabStops(y)}setupTabStops(y){this._normal.setupTabStops(y),this._alt.setupTabStops(y)}}r.BufferSet=g},511:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const c=o(482),p=o(643),u=o(3734);class g extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const v=new g;return v.setFromCharData(y),v}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(y){this.fg=y[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(y[p.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(y[p.CHAR_DATA_CHAR_INDEX].length===2){const l=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=l&&l<=56319){const h=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(l-55296)+h-56320+65536|y[p.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[p.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=y[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=g},643:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const c=o(8460),p=o(844);class u{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}r.Marker=u,u._nextId=1},7116:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.CHARSETS[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:"≥","{":"π","|":"≠","}":"£","~":"·"},r.CHARSETS.A={"#":"£"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},r.CHARSETS.C=r.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},r.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},r.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},r.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},r.CHARSETS.E=r.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},r.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},r.CHARSETS.H=r.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(d,r)=>{var o,c,p;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=` -`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""}(o||(r.C0=o={})),function(u){u.PAD="€",u.HOP="",u.BPH="‚",u.NBH="ƒ",u.IND="„",u.NEL="…",u.SSA="†",u.ESA="‡",u.HTS="ˆ",u.HTJ="‰",u.VTS="Š",u.PLD="‹",u.PLU="Œ",u.RI="",u.SS2="Ž",u.SS3="",u.DCS="",u.PU1="‘",u.PU2="’",u.STS="“",u.CCH="”",u.MW="•",u.SPA="–",u.EPA="—",u.SOS="˜",u.SGCI="™",u.SCI="š",u.CSI="›",u.ST="œ",u.OSC="",u.PM="ž",u.APC="Ÿ"}(c||(r.C1=c={})),function(u){u.ST=`${o.ESC}\\`}(p||(r.C1_ESCAPED=p={}))},7399:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const c=o(2584),p={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:["'",'"']};r.evaluateKeyboardEvent=function(u,g,m,y){const v={type:0,cancel:!1,key:void 0},l=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?v.key=g?c.C0.ESC+"OA":c.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?v.key=g?c.C0.ESC+"OD":c.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?v.key=g?c.C0.ESC+"OC":c.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(v.key=g?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:if(u.altKey){v.key=c.C0.ESC+c.C0.DEL;break}v.key=c.C0.DEL;break;case 9:if(u.shiftKey){v.key=c.C0.ESC+"[Z";break}v.key=c.C0.HT,v.cancel=!0;break;case 13:v.key=u.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,v.cancel=!0;break;case 27:v.key=c.C0.ESC,u.altKey&&(v.key=c.C0.ESC+c.C0.ESC),v.cancel=!0;break;case 37:if(u.metaKey)break;l?(v.key=c.C0.ESC+"[1;"+(l+1)+"D",v.key===c.C0.ESC+"[1;3D"&&(v.key=c.C0.ESC+(m?"b":"[1;5D"))):v.key=g?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(u.metaKey)break;l?(v.key=c.C0.ESC+"[1;"+(l+1)+"C",v.key===c.C0.ESC+"[1;3C"&&(v.key=c.C0.ESC+(m?"f":"[1;5C"))):v.key=g?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(u.metaKey)break;l?(v.key=c.C0.ESC+"[1;"+(l+1)+"A",m||v.key!==c.C0.ESC+"[1;3A"||(v.key=c.C0.ESC+"[1;5A")):v.key=g?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(u.metaKey)break;l?(v.key=c.C0.ESC+"[1;"+(l+1)+"B",m||v.key!==c.C0.ESC+"[1;3B"||(v.key=c.C0.ESC+"[1;5B")):v.key=g?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(v.key=c.C0.ESC+"[2~");break;case 46:v.key=l?c.C0.ESC+"[3;"+(l+1)+"~":c.C0.ESC+"[3~";break;case 36:v.key=l?c.C0.ESC+"[1;"+(l+1)+"H":g?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:v.key=l?c.C0.ESC+"[1;"+(l+1)+"F":g?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:u.shiftKey?v.type=2:u.ctrlKey?v.key=c.C0.ESC+"[5;"+(l+1)+"~":v.key=c.C0.ESC+"[5~";break;case 34:u.shiftKey?v.type=3:u.ctrlKey?v.key=c.C0.ESC+"[6;"+(l+1)+"~":v.key=c.C0.ESC+"[6~";break;case 112:v.key=l?c.C0.ESC+"[1;"+(l+1)+"P":c.C0.ESC+"OP";break;case 113:v.key=l?c.C0.ESC+"[1;"+(l+1)+"Q":c.C0.ESC+"OQ";break;case 114:v.key=l?c.C0.ESC+"[1;"+(l+1)+"R":c.C0.ESC+"OR";break;case 115:v.key=l?c.C0.ESC+"[1;"+(l+1)+"S":c.C0.ESC+"OS";break;case 116:v.key=l?c.C0.ESC+"[15;"+(l+1)+"~":c.C0.ESC+"[15~";break;case 117:v.key=l?c.C0.ESC+"[17;"+(l+1)+"~":c.C0.ESC+"[17~";break;case 118:v.key=l?c.C0.ESC+"[18;"+(l+1)+"~":c.C0.ESC+"[18~";break;case 119:v.key=l?c.C0.ESC+"[19;"+(l+1)+"~":c.C0.ESC+"[19~";break;case 120:v.key=l?c.C0.ESC+"[20;"+(l+1)+"~":c.C0.ESC+"[20~";break;case 121:v.key=l?c.C0.ESC+"[21;"+(l+1)+"~":c.C0.ESC+"[21~";break;case 122:v.key=l?c.C0.ESC+"[23;"+(l+1)+"~":c.C0.ESC+"[23~";break;case 123:v.key=l?c.C0.ESC+"[24;"+(l+1)+"~":c.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(m&&!y||!u.altKey||u.metaKey)!m||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?v.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(v.key=c.C0.US),u.key==="@"&&(v.key=c.C0.NUL)):u.keyCode===65&&(v.type=1);else{const h=p[u.keyCode],f=h==null?void 0:h[u.shiftKey?1:0];if(f)v.key=c.C0.ESC+f;else if(u.keyCode>=65&&u.keyCode<=90){const _=u.ctrlKey?u.keyCode-64:u.keyCode+32;let S=String.fromCharCode(_);u.shiftKey&&(S=S.toUpperCase()),v.key=c.C0.ESC+S}else if(u.keyCode===32)v.key=c.C0.ESC+(u.ctrlKey?c.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let _=u.code.slice(3,4);u.shiftKey||(_=_.toLowerCase()),v.key=c.C0.ESC+_,v.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?v.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?v.key=c.C0.NUL:u.keyCode>=51&&u.keyCode<=55?v.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?v.key=c.C0.DEL:u.keyCode===219?v.key=c.C0.ESC:u.keyCode===220?v.key=c.C0.FS:u.keyCode===221&&(v.key=c.C0.GS)}return v}},482:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},r.utf32ToString=function(o,c=0,p=o.length){let u="";for(let g=c;g65535?(m-=65536,u+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):u+=String.fromCharCode(m)}return u},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,c){const p=o.length;if(!p)return 0;let u=0,g=0;if(this._interim){const m=o.charCodeAt(g++);56320<=m&&m<=57343?c[u++]=1024*(this._interim-55296)+m-56320+65536:(c[u++]=this._interim,c[u++]=m),this._interim=0}for(let m=g;m=p)return this._interim=y,u;const v=o.charCodeAt(m);56320<=v&&v<=57343?c[u++]=1024*(y-55296)+v-56320+65536:(c[u++]=y,c[u++]=v)}else y!==65279&&(c[u++]=y)}return u}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,c){const p=o.length;if(!p)return 0;let u,g,m,y,v=0,l=0,h=0;if(this.interim[0]){let S=!1,k=this.interim[0];k&=(224&k)==192?31:(240&k)==224?15:7;let P,M=0;for(;(P=63&this.interim[++M])&&M<4;)k<<=6,k|=P;const w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,T=w-M;for(;h=p)return 0;if(P=o[h++],(192&P)!=128){h--,S=!0;break}this.interim[M++]=P,k<<=6,k|=63&P}S||(w===2?k<128?h--:c[v++]=k:w===3?k<2048||k>=55296&&k<=57343||k===65279||(c[v++]=k):k<65536||k>1114111||(c[v++]=k)),this.interim.fill(0)}const f=p-4;let _=h;for(;_=p)return this.interim[0]=u,v;if(g=o[_++],(192&g)!=128){_--;continue}if(l=(31&u)<<6|63&g,l<128){_--;continue}c[v++]=l}else if((240&u)==224){if(_>=p)return this.interim[0]=u,v;if(g=o[_++],(192&g)!=128){_--;continue}if(_>=p)return this.interim[0]=u,this.interim[1]=g,v;if(m=o[_++],(192&m)!=128){_--;continue}if(l=(15&u)<<12|(63&g)<<6|63&m,l<2048||l>=55296&&l<=57343||l===65279)continue;c[v++]=l}else if((248&u)==240){if(_>=p)return this.interim[0]=u,v;if(g=o[_++],(192&g)!=128){_--;continue}if(_>=p)return this.interim[0]=u,this.interim[1]=g,v;if(m=o[_++],(192&m)!=128){_--;continue}if(_>=p)return this.interim[0]=u,this.interim[1]=g,this.interim[2]=m,v;if(y=o[_++],(192&y)!=128){_--;continue}if(l=(7&u)<<18|(63&g)<<12|(63&m)<<6|63&y,l<65536||l>1114111)continue;c[v++]=l}}return v}}},225:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const o=[[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]],c=[[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]];let p;r.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let u=0;um[l][1])return!1;for(;l>=v;)if(y=v+l>>1,g>m[y][1])v=y+1;else{if(!(g=131072&&u<=196605||u>=196608&&u<=262141?2:1}}},5981:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const c=o(8460),p=o(844);class u extends p.Disposable{constructor(m){super(),this._action=m,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(m,y){if(y!==void 0&&this._syncCalls>y)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let v;for(this._isSyncWriting=!0;v=this._writeBuffer.shift();){this._action(v);const l=this._callbacks.shift();l&&l()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,y){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(y),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(y)}_innerWrite(m=0,y=!0){const v=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const l=this._writeBuffer[this._bufferOffset],h=this._action(l,y);if(h){const _=S=>Date.now()-v>=12?setTimeout(()=>this._innerWrite(0,S)):this._innerWrite(v,S);return void h.catch(S=>(queueMicrotask(()=>{throw S}),Promise.resolve(!1))).then(_)}const f=this._callbacks[this._bufferOffset];if(f&&f(),this._bufferOffset++,this._pendingData-=l.length,Date.now()-v>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(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()}}r.WriteBuffer=u},5941:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;const o=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,c=/^[\da-f]+$/;function p(u,g){const m=u.toString(16),y=m.length<2?"0"+m:m;switch(g){case 4:return m[0];case 8:return y;case 12:return(y+y).slice(0,3);default:return y+y}}r.parseColor=function(u){if(!u)return;let g=u.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const m=o.exec(g);if(m){const y=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/y*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/y*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/y*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),c.exec(g)&&[3,6,9,12].includes(g.length))){const m=g.length/3,y=[0,0,0];for(let v=0;v<3;++v){const l=parseInt(g.slice(m*v,m*v+m),16);y[v]=m===1?l<<4:m===2?l:m===3?l>>4:l>>8}return y}},r.toRgbString=function(u,g=16){const[m,y,v]=u;return`rgb:${p(m,g)}/${p(y,g)}/${p(v,g)}`}},5770:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const c=o(482),p=o(8742),u=o(5770),g=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(y,v){this._handlers[y]===void 0&&(this._handlers[y]=[]);const l=this._handlers[y];return l.push(v),{dispose:()=>{const h=l.indexOf(v);h!==-1&&l.splice(h,1)}}}clearHandler(y){this._handlers[y]&&delete this._handlers[y]}setHandlerFallback(y){this._handlerFb=y}reset(){if(this._active.length)for(let y=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;y>=0;--y)this._active[y].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(y,v){if(this.reset(),this._ident=y,this._active=this._handlers[y]||g,this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].hook(v);else this._handlerFb(this._ident,"HOOK",v)}put(y,v,l){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(y,v,l);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(y,v,l))}unhook(y,v=!0){if(this._active.length){let l=!1,h=this._active.length-1,f=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,l=v,f=this._stack.fallThrough,this._stack.paused=!1),!f&&l===!1){for(;h>=0&&(l=this._active[h].unhook(y),l!==!0);h--)if(l instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,l;h--}for(;h>=0;h--)if(l=this._active[h].unhook(!1),l instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,l}else this._handlerFb(this._ident,"UNHOOK",y);this._active=g,this._ident=0}};const m=new p.Params;m.addParam(0),r.DcsHandler=class{constructor(y){this._handler=y,this._data="",this._params=m,this._hitLimit=!1}hook(y){this._params=y.length>1||y.params[0]?y.clone():m,this._data="",this._hitLimit=!1}put(y,v,l){this._hitLimit||(this._data+=(0,c.utf32ToString)(y,v,l),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(y){let v=!1;if(this._hitLimit)v=!1;else if(y&&(v=this._handler(this._data,this._params),v instanceof Promise))return v.then(l=>(this._params=m,this._data="",this._hitLimit=!1,l));return this._params=m,this._data="",this._hitLimit=!1,v}}},2015:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const c=o(844),p=o(8742),u=o(6242),g=o(6351);class m{constructor(h){this.table=new Uint8Array(h)}setDefault(h,f){this.table.fill(h<<4|f)}add(h,f,_,S){this.table[f<<8|h]=_<<4|S}addMany(h,f,_,S){for(let k=0;kw),f=(M,w)=>h.slice(M,w),_=f(32,127),S=f(0,24);S.push(25),S.push.apply(S,f(28,32));const k=f(0,14);let P;for(P in l.setDefault(1,0),l.addMany(_,0,2,0),k)l.addMany([24,26,153,154],P,3,0),l.addMany(f(128,144),P,3,0),l.addMany(f(144,152),P,3,0),l.add(156,P,0,0),l.add(27,P,11,1),l.add(157,P,4,8),l.addMany([152,158,159],P,0,7),l.add(155,P,11,3),l.add(144,P,11,9);return l.addMany(S,0,3,0),l.addMany(S,1,3,1),l.add(127,1,0,1),l.addMany(S,8,0,8),l.addMany(S,3,3,3),l.add(127,3,0,3),l.addMany(S,4,3,4),l.add(127,4,0,4),l.addMany(S,6,3,6),l.addMany(S,5,3,5),l.add(127,5,0,5),l.addMany(S,2,3,2),l.add(127,2,0,2),l.add(93,1,4,8),l.addMany(_,8,5,8),l.add(127,8,5,8),l.addMany([156,27,24,26,7],8,6,0),l.addMany(f(28,32),8,0,8),l.addMany([88,94,95],1,0,7),l.addMany(_,7,0,7),l.addMany(S,7,0,7),l.add(156,7,0,0),l.add(127,7,0,7),l.add(91,1,11,3),l.addMany(f(64,127),3,7,0),l.addMany(f(48,60),3,8,4),l.addMany([60,61,62,63],3,9,4),l.addMany(f(48,60),4,8,4),l.addMany(f(64,127),4,7,0),l.addMany([60,61,62,63],4,0,6),l.addMany(f(32,64),6,0,6),l.add(127,6,0,6),l.addMany(f(64,127),6,0,0),l.addMany(f(32,48),3,9,5),l.addMany(f(32,48),5,9,5),l.addMany(f(48,64),5,0,6),l.addMany(f(64,127),5,7,0),l.addMany(f(32,48),4,9,5),l.addMany(f(32,48),1,9,2),l.addMany(f(32,48),2,9,2),l.addMany(f(48,127),2,10,0),l.addMany(f(48,80),1,10,0),l.addMany(f(81,88),1,10,0),l.addMany([89,90,92],1,10,0),l.addMany(f(96,127),1,10,0),l.add(80,1,11,9),l.addMany(S,9,0,9),l.add(127,9,0,9),l.addMany(f(28,32),9,0,9),l.addMany(f(32,48),9,9,12),l.addMany(f(48,60),9,8,10),l.addMany([60,61,62,63],9,9,10),l.addMany(S,11,0,11),l.addMany(f(32,128),11,0,11),l.addMany(f(28,32),11,0,11),l.addMany(S,10,0,10),l.add(127,10,0,10),l.addMany(f(28,32),10,0,10),l.addMany(f(48,60),10,8,10),l.addMany([60,61,62,63],10,0,11),l.addMany(f(32,48),10,9,12),l.addMany(S,12,0,12),l.add(127,12,0,12),l.addMany(f(28,32),12,0,12),l.addMany(f(32,48),12,9,12),l.addMany(f(48,64),12,0,11),l.addMany(f(64,127),12,12,13),l.addMany(f(64,127),10,12,13),l.addMany(f(64,127),9,12,13),l.addMany(S,13,13,13),l.addMany(_,13,13,13),l.add(127,13,0,13),l.addMany([27,156,24,26],13,14,0),l.add(y,0,2,0),l.add(y,8,5,8),l.add(y,6,0,6),l.add(y,11,0,11),l.add(y,13,13,13),l}();class v extends c.Disposable{constructor(h=r.VT500_TRANSITION_TABLE){super(),this._transitions=h,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(f,_,S)=>{},this._executeHandlerFb=f=>{},this._csiHandlerFb=(f,_)=>{},this._escHandlerFb=f=>{},this._errorHandlerFb=f=>f,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(h,f=[64,126]){let _=0;if(h.prefix){if(h.prefix.length>1)throw new Error("only one byte as prefix supported");if(_=h.prefix.charCodeAt(0),_&&60>_||_>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(h.intermediates){if(h.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let k=0;kP||P>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");_<<=8,_|=P}}if(h.final.length!==1)throw new Error("final must be a single byte");const S=h.final.charCodeAt(0);if(f[0]>S||S>f[1])throw new Error(`final must be in range ${f[0]} .. ${f[1]}`);return _<<=8,_|=S,_}identToString(h){const f=[];for(;h;)f.push(String.fromCharCode(255&h)),h>>=8;return f.reverse().join("")}setPrintHandler(h){this._printHandler=h}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(h,f){const _=this._identifier(h,[48,126]);this._escHandlers[_]===void 0&&(this._escHandlers[_]=[]);const S=this._escHandlers[_];return S.push(f),{dispose:()=>{const k=S.indexOf(f);k!==-1&&S.splice(k,1)}}}clearEscHandler(h){this._escHandlers[this._identifier(h,[48,126])]&&delete this._escHandlers[this._identifier(h,[48,126])]}setEscHandlerFallback(h){this._escHandlerFb=h}setExecuteHandler(h,f){this._executeHandlers[h.charCodeAt(0)]=f}clearExecuteHandler(h){this._executeHandlers[h.charCodeAt(0)]&&delete this._executeHandlers[h.charCodeAt(0)]}setExecuteHandlerFallback(h){this._executeHandlerFb=h}registerCsiHandler(h,f){const _=this._identifier(h);this._csiHandlers[_]===void 0&&(this._csiHandlers[_]=[]);const S=this._csiHandlers[_];return S.push(f),{dispose:()=>{const k=S.indexOf(f);k!==-1&&S.splice(k,1)}}}clearCsiHandler(h){this._csiHandlers[this._identifier(h)]&&delete this._csiHandlers[this._identifier(h)]}setCsiHandlerFallback(h){this._csiHandlerFb=h}registerDcsHandler(h,f){return this._dcsParser.registerHandler(this._identifier(h),f)}clearDcsHandler(h){this._dcsParser.clearHandler(this._identifier(h))}setDcsHandlerFallback(h){this._dcsParser.setHandlerFallback(h)}registerOscHandler(h,f){return this._oscParser.registerHandler(h,f)}clearOscHandler(h){this._oscParser.clearHandler(h)}setOscHandlerFallback(h){this._oscParser.setHandlerFallback(h)}setErrorHandler(h){this._errorHandler=h}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.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(h,f,_,S,k){this._parseStack.state=h,this._parseStack.handlers=f,this._parseStack.handlerPos=_,this._parseStack.transition=S,this._parseStack.chunkPos=k}parse(h,f,_){let S,k=0,P=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(_===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const w=this._parseStack.handlers;let T=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(_===!1&&T>-1){for(;T>=0&&(S=w[T](this._params),S!==!0);T--)if(S instanceof Promise)return this._parseStack.handlerPos=T,S}this._parseStack.handlers=[];break;case 4:if(_===!1&&T>-1){for(;T>=0&&(S=w[T](),S!==!0);T--)if(S instanceof Promise)return this._parseStack.handlerPos=T,S}this._parseStack.handlers=[];break;case 6:if(k=h[this._parseStack.chunkPos],S=this._dcsParser.unhook(k!==24&&k!==26,_),S)return S;k===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(k=h[this._parseStack.chunkPos],S=this._oscParser.end(k!==24&&k!==26,_),S)return S;k===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let w=M;w>4){case 2:for(let D=w+1;;++D){if(D>=f||(k=h[D])<32||k>126&&k=f||(k=h[D])<32||k>126&&k=f||(k=h[D])<32||k>126&&k=f||(k=h[D])<32||k>126&&k=0&&(S=T[A](this._params),S!==!0);A--)if(S instanceof Promise)return this._preserveStack(3,T,A,P,w),S;A<0&&this._csiHandlerFb(this._collect<<8|k,this._params),this.precedingCodepoint=0;break;case 8:do switch(k){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(k-48)}while(++w47&&k<60);w--;break;case 9:this._collect<<=8,this._collect|=k;break;case 10:const E=this._escHandlers[this._collect<<8|k];let R=E?E.length-1:-1;for(;R>=0&&(S=E[R](),S!==!0);R--)if(S instanceof Promise)return this._preserveStack(4,E,R,P,w),S;R<0&&this._escHandlerFb(this._collect<<8|k),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|k,this._params);break;case 13:for(let D=w+1;;++D)if(D>=f||(k=h[D])===24||k===26||k===27||k>127&&k=f||(k=h[D])<32||k>127&&k{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const c=o(5770),p=o(482),u=[];r.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,m){this._handlers[g]===void 0&&(this._handlers[g]=[]);const y=this._handlers[g];return y.push(m),{dispose:()=>{const v=y.indexOf(m);v!==-1&&y.splice(v,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,m,y){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(g,m,y);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(g,m,y))}start(){this.reset(),this._state=1}put(g,m,y){if(this._state!==3){if(this._state===1)for(;m0&&this._put(g,m,y)}}end(g,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let y=!1,v=this._active.length-1,l=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,y=m,l=this._stack.fallThrough,this._stack.paused=!1),!l&&y===!1){for(;v>=0&&(y=this._active[v].end(g),y!==!0);v--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,y;v--}for(;v>=0;v--)if(y=this._active[v].end(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,y}else this._handlerFb(this._id,"END",g);this._active=u,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,m,y){this._hitLimit||(this._data+=(0,p.utf32ToString)(g,m,y),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let m=!1;if(this._hitLimit)m=!1;else if(g&&(m=this._handler(this._data),m instanceof Promise))return m.then(y=>(this._data="",this._hitLimit=!1,y));return this._data="",this._hitLimit=!1,m}}},8742:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const o=2147483647;class c{static fromArray(u){const g=new c;if(!u.length)return g;for(let m=Array.isArray(u[0])?1:0;m256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new c(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let g=0;g>8,y=255&this._subParamsIdx[g];y-m>0&&u.push(Array.prototype.slice.call(this._subParams,m,y))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>o?o:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>o?o:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const g=this._subParamsIdx[u]>>8,m=255&this._subParamsIdx[u];return m-g>0?this._subParams.subarray(g,m):null}getSubParamsAll(){const u={};for(let g=0;g>8,y=255&this._subParamsIdx[g];y-m>0&&(u[g]=this._subParams.slice(m,y))}return u}addDigit(u){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,y=m[g-1];m[g-1]=~y?Math.min(10*y+u,o):u}}r.Params=c},5741:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let o=this._addons.length-1;o>=0;o--)this._addons[o].instance.dispose()}loadAddon(o,c){const p={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(p),c.dispose=()=>this._wrappedAddonDispose(p),c.activate(o)}_wrappedAddonDispose(o){if(o.isDisposed)return;let c=-1;for(let p=0;p{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const c=o(3785),p=o(511);r.BufferApiView=class{constructor(u,g){this._buffer=u,this.type=g}init(u){return this._buffer=u,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(u){const g=this._buffer.lines.get(u);if(g)return new c.BufferLineApiView(g)}getNullCell(){return new p.CellData}}},3785:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;const c=o(511);r.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,u){if(!(p<0||p>=this._line.length))return u?(this._line.loadCell(p,u),u):this._line.loadCell(p,new c.CellData)}translateToString(p,u,g){return this._line.translateToString(p,u,g)}}},8285:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const c=o(8771),p=o(8460),u=o(844);class g extends u.Disposable{constructor(y){super(),this._core=y,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(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)}}r.BufferNamespaceApi=g},7975:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(o){this._core=o}registerCsiHandler(o,c){return this._core.registerCsiHandler(o,p=>c(p.toArray()))}addCsiHandler(o,c){return this.registerCsiHandler(o,c)}registerDcsHandler(o,c){return this._core.registerDcsHandler(o,(p,u)=>c(p,u.toArray()))}addDcsHandler(o,c){return this.registerDcsHandler(o,c)}registerEscHandler(o,c){return this._core.registerEscHandler(o,c)}addEscHandler(o,c){return this.registerEscHandler(o,c)}registerOscHandler(o,c){return this._core.registerOscHandler(o,c)}addOscHandler(o,c){return this.registerOscHandler(o,c)}}},7090:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(o){this._core=o}register(o){this._core.unicodeService.register(o)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(o){this._core.unicodeService.activeVersion=o}}},744:function(d,r,o){var c=this&&this.__decorate||function(l,h,f,_){var S,k=arguments.length,P=k<3?h:_===null?_=Object.getOwnPropertyDescriptor(h,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(l,h,f,_);else for(var M=l.length-1;M>=0;M--)(S=l[M])&&(P=(k<3?S(P):k>3?S(h,f,P):S(h,f))||P);return k>3&&P&&Object.defineProperty(h,f,P),P},p=this&&this.__param||function(l,h){return function(f,_){h(f,_,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;const u=o(8460),g=o(844),m=o(5295),y=o(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let v=r.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(l){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(l.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(l.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(l,this))}resize(l,h){this.cols=l,this.rows=h,this.buffers.resize(l,h),this._onResize.fire({cols:l,rows:h})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(l,h=!1){const f=this.buffer;let _;_=this._cachedBlankLine,_&&_.length===this.cols&&_.getFg(0)===l.fg&&_.getBg(0)===l.bg||(_=f.getBlankLine(l,h),this._cachedBlankLine=_),_.isWrapped=h;const S=f.ybase+f.scrollTop,k=f.ybase+f.scrollBottom;if(f.scrollTop===0){const P=f.lines.isFull;k===f.lines.length-1?P?f.lines.recycle().copyFrom(_):f.lines.push(_.clone()):f.lines.splice(k+1,0,_.clone()),P?this.isUserScrolling&&(f.ydisp=Math.max(f.ydisp-1,0)):(f.ybase++,this.isUserScrolling||f.ydisp++)}else{const P=k-S+1;f.lines.shiftElements(S+1,P-1,-1),f.lines.set(k,_.clone())}this.isUserScrolling||(f.ydisp=f.ybase),this._onScroll.fire(f.ydisp)}scrollLines(l,h,f){const _=this.buffer;if(l<0){if(_.ydisp===0)return;this.isUserScrolling=!0}else l+_.ydisp>=_.ybase&&(this.isUserScrolling=!1);const S=_.ydisp;_.ydisp=Math.max(Math.min(_.ydisp+l,_.ybase),0),S!==_.ydisp&&(h||this._onScroll.fire(_.ydisp))}};r.BufferService=v=c([p(0,y.IOptionsService)],v)},7994:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(o){this.glevel=o,this.charset=this._charsets[o]}setgCharset(o,c){this._charsets[o]=c,this.glevel===o&&(this.charset=c)}}},1753:function(d,r,o){var c=this&&this.__decorate||function(_,S,k,P){var M,w=arguments.length,T=w<3?S:P===null?P=Object.getOwnPropertyDescriptor(S,k):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(_,S,k,P);else for(var A=_.length-1;A>=0;A--)(M=_[A])&&(T=(w<3?M(T):w>3?M(S,k,T):M(S,k))||T);return w>3&&T&&Object.defineProperty(S,k,T),T},p=this&&this.__param||function(_,S){return function(k,P){S(k,P,_)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const u=o(2585),g=o(8460),m=o(844),y={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:_=>_.button!==4&&_.action===1&&(_.ctrl=!1,_.alt=!1,_.shift=!1,!0)},VT200:{events:19,restrict:_=>_.action!==32},DRAG:{events:23,restrict:_=>_.action!==32||_.button!==3},ANY:{events:31,restrict:_=>!0}};function v(_,S){let k=(_.ctrl?16:0)|(_.shift?4:0)|(_.alt?8:0);return _.button===4?(k|=64,k|=_.action):(k|=3&_.button,4&_.button&&(k|=64),8&_.button&&(k|=128),_.action===32?k|=32:_.action!==0||S||(k|=3)),k}const l=String.fromCharCode,h={DEFAULT:_=>{const S=[v(_,!1)+32,_.col+32,_.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${l(S[0])}${l(S[1])}${l(S[2])}`},SGR:_=>{const S=_.action===0&&_.button!==4?"m":"M";return`\x1B[<${v(_,!0)};${_.col};${_.row}${S}`},SGR_PIXELS:_=>{const S=_.action===0&&_.button!==4?"m":"M";return`\x1B[<${v(_,!0)};${_.x};${_.y}${S}`}};let f=r.CoreMouseService=class extends m.Disposable{constructor(_,S){super(),this._bufferService=_,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const k of Object.keys(y))this.addProtocol(k,y[k]);for(const k of Object.keys(h))this.addEncoding(k,h[k]);this.reset()}addProtocol(_,S){this._protocols[_]=S}addEncoding(_,S){this._encodings[_]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(_){if(!this._protocols[_])throw new Error(`unknown protocol "${_}"`);this._activeProtocol=_,this._onProtocolChange.fire(this._protocols[_].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(_){if(!this._encodings[_])throw new Error(`unknown encoding "${_}"`);this._activeEncoding=_}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(_){if(_.col<0||_.col>=this._bufferService.cols||_.row<0||_.row>=this._bufferService.rows||_.button===4&&_.action===32||_.button===3&&_.action!==32||_.button!==4&&(_.action===2||_.action===3)||(_.col++,_.row++,_.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,_,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(_))return!1;const S=this._encodings[this._activeEncoding](_);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=_,!0}explainEvents(_){return{down:!!(1&_),up:!!(2&_),drag:!!(4&_),move:!!(8&_),wheel:!!(16&_)}}_equalEvents(_,S,k){if(k){if(_.x!==S.x||_.y!==S.y)return!1}else if(_.col!==S.col||_.row!==S.row)return!1;return _.button===S.button&&_.action===S.action&&_.ctrl===S.ctrl&&_.alt===S.alt&&_.shift===S.shift}};r.CoreMouseService=f=c([p(0,u.IBufferService),p(1,u.ICoreService)],f)},6975:function(d,r,o){var c=this&&this.__decorate||function(f,_,S,k){var P,M=arguments.length,w=M<3?_:k===null?k=Object.getOwnPropertyDescriptor(_,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(f,_,S,k);else for(var T=f.length-1;T>=0;T--)(P=f[T])&&(w=(M<3?P(w):M>3?P(_,S,w):P(_,S))||w);return M>3&&w&&Object.defineProperty(_,S,w),w},p=this&&this.__param||function(f,_){return function(S,k){_(S,k,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const u=o(1439),g=o(8460),m=o(844),y=o(2585),v=Object.freeze({insertMode:!1}),l=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let h=r.CoreService=class extends m.Disposable{constructor(f,_,S){super(),this._bufferService=f,this._logService=_,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(v),this.decPrivateModes=(0,u.clone)(l)}reset(){this.modes=(0,u.clone)(v),this.decPrivateModes=(0,u.clone)(l)}triggerDataEvent(f,_=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;_&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),_&&this._onUserInput.fire(),this._logService.debug(`sending data "${f}"`,()=>f.split("").map(k=>k.charCodeAt(0))),this._onData.fire(f)}triggerBinaryEvent(f){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${f}"`,()=>f.split("").map(_=>_.charCodeAt(0))),this._onBinary.fire(f))}};r.CoreService=h=c([p(0,y.IBufferService),p(1,y.ILogService),p(2,y.IOptionsService)],h)},9074:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const c=o(8055),p=o(8460),u=o(844),g=o(6106);let m=0,y=0;class v extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList(f=>f==null?void 0:f.marker.line),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)(()=>this.reset()))}registerDecoration(f){if(f.marker.isDisposed)return;const _=new l(f);if(_){const S=_.marker.onDispose(()=>_.dispose());_.onDispose(()=>{_&&(this._decorations.delete(_)&&this._onDecorationRemoved.fire(_),S.dispose())}),this._decorations.insert(_),this._onDecorationRegistered.fire(_)}return _}reset(){for(const f of this._decorations.values())f.dispose();this._decorations.clear()}*getDecorationsAtCell(f,_,S){var k,P,M;let w=0,T=0;for(const A of this._decorations.getKeyIterator(_))w=(k=A.options.x)!==null&&k!==void 0?k:0,T=w+((P=A.options.width)!==null&&P!==void 0?P:1),f>=w&&f{var M,w,T;m=(M=P.options.x)!==null&&M!==void 0?M:0,y=m+((w=P.options.width)!==null&&w!==void 0?w:1),f>=m&&f{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const c=o(2585),p=o(8343);class u{constructor(...m){this._entries=new Map;for(const[y,v]of m)this.set(y,v)}set(m,y){const v=this._entries.get(m);return this._entries.set(m,y),v}forEach(m){for(const[y,v]of this._entries.entries())m(y,v)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}r.ServiceCollection=u,r.InstantiationService=class{constructor(){this._services=new u,this._services.set(c.IInstantiationService,this)}setService(g,m){this._services.set(g,m)}getService(g){return this._services.get(g)}createInstance(g,...m){const y=(0,p.getServiceDependencies)(g).sort((h,f)=>h.index-f.index),v=[];for(const h of y){const f=this._services.get(h.id);if(!f)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${h.id}.`);v.push(f)}const l=y.length>0?y[0].index:m.length;if(m.length!==l)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${l+1} conflicts with ${m.length} static arguments`);return new g(...m,...v)}}},7866:function(d,r,o){var c=this&&this.__decorate||function(l,h,f,_){var S,k=arguments.length,P=k<3?h:_===null?_=Object.getOwnPropertyDescriptor(h,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(l,h,f,_);else for(var M=l.length-1;M>=0;M--)(S=l[M])&&(P=(k<3?S(P):k>3?S(h,f,P):S(h,f))||P);return k>3&&P&&Object.defineProperty(h,f,P),P},p=this&&this.__param||function(l,h){return function(f,_){h(f,_,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const u=o(844),g=o(2585),m={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let y,v=r.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(l){super(),this._optionsService=l,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),y=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(l){for(let h=0;hJSON.stringify(P)).join(", ")})`);const k=_.apply(this,S);return y.trace(`GlyphRenderer#${_.name} return`,k),k}}},7302:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const c=o(8460),p=o(844),u=o(6114);r.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends p.Disposable{constructor(v){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const l=Object.assign({},r.DEFAULT_OPTIONS);for(const h in v)if(h in l)try{const f=v[h];l[h]=this._sanitizeAndValidateOption(h,f)}catch(f){console.error(f)}this.rawOptions=l,this.options=Object.assign({},l),this._setupOptions()}onSpecificOptionChange(v,l){return this.onOptionChange(h=>{h===v&&l(this.rawOptions[v])})}onMultipleOptionChange(v,l){return this.onOptionChange(h=>{v.indexOf(h)!==-1&&l()})}_setupOptions(){const v=h=>{if(!(h in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);return this.rawOptions[h]},l=(h,f)=>{if(!(h in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);f=this._sanitizeAndValidateOption(h,f),this.rawOptions[h]!==f&&(this.rawOptions[h]=f,this._onOptionChange.fire(h))};for(const h in this.rawOptions){const f={get:v.bind(this,h),set:l.bind(this,h)};Object.defineProperty(this.options,h,f)}}_sanitizeAndValidateOption(v,l){switch(v){case"cursorStyle":if(l||(l=r.DEFAULT_OPTIONS[v]),!function(h){return h==="block"||h==="underline"||h==="bar"}(l))throw new Error(`"${l}" is not a valid value for ${v}`);break;case"wordSeparator":l||(l=r.DEFAULT_OPTIONS[v]);break;case"fontWeight":case"fontWeightBold":if(typeof l=="number"&&1<=l&&l<=1e3)break;l=g.includes(l)?l:r.DEFAULT_OPTIONS[v];break;case"cursorWidth":l=Math.floor(l);case"lineHeight":case"tabStopWidth":if(l<1)throw new Error(`${v} cannot be less than 1, value: ${l}`);break;case"minimumContrastRatio":l=Math.max(1,Math.min(21,Math.round(10*l)/10));break;case"scrollback":if((l=Math.min(l,4294967295))<0)throw new Error(`${v} cannot be less than 0, value: ${l}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(l<=0)throw new Error(`${v} cannot be less than or equal to 0, value: ${l}`);break;case"rows":case"cols":if(!l&&l!==0)throw new Error(`${v} must be numeric, value: ${l}`);break;case"windowsPty":l=l??{}}return l}}r.OptionsService=m},2660:function(d,r,o){var c=this&&this.__decorate||function(m,y,v,l){var h,f=arguments.length,_=f<3?y:l===null?l=Object.getOwnPropertyDescriptor(y,v):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(m,y,v,l);else for(var S=m.length-1;S>=0;S--)(h=m[S])&&(_=(f<3?h(_):f>3?h(y,v,_):h(y,v))||_);return f>3&&_&&Object.defineProperty(y,v,_),_},p=this&&this.__param||function(m,y){return function(v,l){y(v,l,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const u=o(2585);let g=r.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const y=this._bufferService.buffer;if(m.id===void 0){const S=y.addMarker(y.ybase+y.y),k={data:m,id:this._nextId++,lines:[S]};return S.onDispose(()=>this._removeMarkerFromLink(k,S)),this._dataByLinkId.set(k.id,k),k.id}const v=m,l=this._getEntryIdKey(v),h=this._entriesWithId.get(l);if(h)return this.addLineToLink(h.id,y.ybase+y.y),h.id;const f=y.addMarker(y.ybase+y.y),_={id:this._nextId++,key:this._getEntryIdKey(v),data:v,lines:[f]};return f.onDispose(()=>this._removeMarkerFromLink(_,f)),this._entriesWithId.set(_.key,_),this._dataByLinkId.set(_.id,_),_.id}addLineToLink(m,y){const v=this._dataByLinkId.get(m);if(v&&v.lines.every(l=>l.line!==y)){const l=this._bufferService.buffer.addMarker(y);v.lines.push(l),l.onDispose(()=>this._removeMarkerFromLink(v,l))}}getLinkData(m){var y;return(y=this._dataByLinkId.get(m))===null||y===void 0?void 0:y.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,y){const v=m.lines.indexOf(y);v!==-1&&(m.lines.splice(v,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};r.OscLinkService=g=c([p(0,u.IBufferService)],g)},8343:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const o="di$target",c="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(p){return p[c]||[]},r.createDecorator=function(p){if(r.serviceRegistry.has(p))return r.serviceRegistry.get(p);const u=function(g,m,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,l,h){l[o]===l?l[c].push({id:v,index:h}):(l[c]=[{id:v,index:h}],l[o]=l)})(u,g,y)};return u.toString=()=>p,r.serviceRegistry.set(p,u),u}},2585:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const c=o(8343);var p;r.IBufferService=(0,c.createDecorator)("BufferService"),r.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),r.ICoreService=(0,c.createDecorator)("CoreService"),r.ICharsetService=(0,c.createDecorator)("CharsetService"),r.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(p||(r.LogLevelEnum=p={})),r.ILogService=(0,c.createDecorator)("LogService"),r.IOptionsService=(0,c.createDecorator)("OptionsService"),r.IOscLinkService=(0,c.createDecorator)("OscLinkService"),r.IUnicodeService=(0,c.createDecorator)("UnicodeService"),r.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const c=o(8460),p=o(225);r.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const u=new p.UnicodeV6;this.register(u),this._active=u.version,this._activeProvider=u}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(u){if(!this._providers[u])throw new Error(`unknown Unicode version "${u}"`);this._active=u,this._activeProvider=this._providers[u],this._onChange.fire(u)}register(u){this._providers[u.version]=u}wcwidth(u){return this._activeProvider.wcwidth(u)}getStringCellWidth(u){let g=0;const m=u.length;for(let y=0;y=m)return g+this.wcwidth(v);const l=u.charCodeAt(y);56320<=l&&l<=57343?v=1024*(v-55296)+l-56320+65536:g+=this.wcwidth(l)}g+=this.wcwidth(v)}return g}}}},s={};function i(d){var r=s[d];if(r!==void 0)return r.exports;var o=s[d]={exports:{}};return n[d].call(o.exports,o,o.exports,i),o.exports}var a={};return(()=>{var d=a;Object.defineProperty(d,"__esModule",{value:!0}),d.Terminal=void 0;const r=i(9042),o=i(3236),c=i(844),p=i(5741),u=i(8285),g=i(7975),m=i(7090),y=["cols","rows"];class v extends c.Disposable{constructor(h){super(),this._core=this.register(new o.Terminal(h)),this._addonManager=this.register(new p.AddonManager),this._publicOptions=Object.assign({},this._core.options);const f=S=>this._core.options[S],_=(S,k)=>{this._checkReadonlyOptions(S),this._core.options[S]=k};for(const S in this._core.options){const k={get:f.bind(this,S),set:_.bind(this,S)};Object.defineProperty(this._publicOptions,S,k)}}_checkReadonlyOptions(h){if(y.includes(h))throw new Error(`Option "${h}" 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 g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.UnicodeApi(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 u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const h=this._core.coreService.decPrivateModes;let f="none";switch(this._core.coreMouseService.activeProtocol){case"X10":f="x10";break;case"VT200":f="vt200";break;case"DRAG":f="drag";break;case"ANY":f="any"}return{applicationCursorKeysMode:h.applicationCursorKeys,applicationKeypadMode:h.applicationKeypad,bracketedPasteMode:h.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:f,originMode:h.origin,reverseWraparoundMode:h.reverseWraparound,sendFocusMode:h.sendFocus,wraparoundMode:h.wraparound}}get options(){return this._publicOptions}set options(h){for(const f in h)this._publicOptions[f]=h[f]}blur(){this._core.blur()}focus(){this._core.focus()}resize(h,f){this._verifyIntegers(h,f),this._core.resize(h,f)}open(h){this._core.open(h)}attachCustomKeyEventHandler(h){this._core.attachCustomKeyEventHandler(h)}registerLinkProvider(h){return this._core.registerLinkProvider(h)}registerCharacterJoiner(h){return this._checkProposedApi(),this._core.registerCharacterJoiner(h)}deregisterCharacterJoiner(h){this._checkProposedApi(),this._core.deregisterCharacterJoiner(h)}registerMarker(h=0){return this._verifyIntegers(h),this._core.registerMarker(h)}registerDecoration(h){var f,_,S;return this._checkProposedApi(),this._verifyPositiveIntegers((f=h.x)!==null&&f!==void 0?f:0,(_=h.width)!==null&&_!==void 0?_:0,(S=h.height)!==null&&S!==void 0?S:0),this._core.registerDecoration(h)}hasSelection(){return this._core.hasSelection()}select(h,f,_){this._verifyIntegers(h,f,_),this._core.select(h,f,_)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(h,f){this._verifyIntegers(h,f),this._core.selectLines(h,f)}dispose(){super.dispose()}scrollLines(h){this._verifyIntegers(h),this._core.scrollLines(h)}scrollPages(h){this._verifyIntegers(h),this._core.scrollPages(h)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(h){this._verifyIntegers(h),this._core.scrollToLine(h)}clear(){this._core.clear()}write(h,f){this._core.write(h,f)}writeln(h,f){this._core.write(h),this._core.write(`\r -`,f)}paste(h){this._core.paste(h)}refresh(h,f){this._verifyIntegers(h,f),this._core.refresh(h,f)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(h){this._addonManager.loadAddon(this,h)}static get strings(){return r}_verifyIntegers(...h){for(const f of h)if(f===1/0||isNaN(f)||f%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...h){for(const f of h)if(f&&(f===1/0||isNaN(f)||f%1!=0||f<0))throw new Error("This API only accepts positive integers")}}d.Terminal=v})(),a})())})(Vm);var Wm=Vm.exports,jm={exports:{}};(function(e,t){(function(n,s){e.exports=s()})(self,()=>(()=>{var n={};return(()=>{var s=n;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(i){this._terminal=i}dispose(){}fit(){const i=this.proposeDimensions();if(!i||!this._terminal||isNaN(i.cols)||isNaN(i.rows))return;const a=this._terminal._core;this._terminal.rows===i.rows&&this._terminal.cols===i.cols||(a._renderService.clear(),this._terminal.resize(i.cols,i.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const i=this._terminal._core,a=i._renderService.dimensions;if(a.css.cell.width===0||a.css.cell.height===0)return;const d=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(r.getPropertyValue("height")),c=Math.max(0,parseInt(r.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),u=o-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),g=c-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-d;return{cols:Math.max(2,Math.floor(g/a.css.cell.width)),rows:Math.max(1,Math.floor(u/a.css.cell.height))}}}})(),n})())})(jm);var qm=jm.exports,Ym={exports:{}};(function(e,t){(function(n,s){e.exports=s()})(self,()=>(()=>{var n={965:function(d,r,o){var c=this&&this.__decorate||function(M,w,T,A){var E,R=arguments.length,D=R<3?w:A===null?A=Object.getOwnPropertyDescriptor(w,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(M,w,T,A);else for(var I=M.length-1;I>=0;I--)(E=M[I])&&(D=(R<3?E(D):R>3?E(w,T,D):E(w,T))||D);return R>3&&D&&Object.defineProperty(w,T,D),D};Object.defineProperty(r,"__esModule",{value:!0}),r.GlyphRenderer=void 0;const p=o(374),u=o(509),g=o(855),m=o(859),y=o(776),v=o(381),l=11,h=l*Float32Array.BYTES_PER_ELEMENT;let f,_=0,S=0,k=0;class P extends m.Disposable{constructor(w,T,A){super(),this._terminal=w,this._gl=T,this._dimensions=A,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const E=this._gl;u.TextureAtlas.maxAtlasPages===void 0&&(u.TextureAtlas.maxAtlasPages=Math.min(32,(0,p.throwIfFalsy)(E.getParameter(E.MAX_TEXTURE_IMAGE_UNITS))),u.TextureAtlas.maxTextureSize=(0,p.throwIfFalsy)(E.getParameter(E.MAX_TEXTURE_SIZE))),this._program=(0,p.throwIfFalsy)((0,v.createProgram)(E,`#version 300 es -layout (location = 0) in vec2 a_unitquad; -layout (location = 1) in vec2 a_cellpos; -layout (location = 2) in vec2 a_offset; -layout (location = 3) in vec2 a_size; -layout (location = 4) in float a_texpage; -layout (location = 5) in vec2 a_texcoord; -layout (location = 6) in vec2 a_texsize; - -uniform mat4 u_projection; -uniform vec2 u_resolution; - -out vec2 v_texcoord; -flat out int v_texpage; - -void main() { - vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size); - gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0); - v_texpage = int(a_texpage); - v_texcoord = a_texcoord + a_unitquad * a_texsize; -}`,function(W){let N="";for(let z=1;zE.deleteProgram(this._program))),this._projectionLocation=(0,p.throwIfFalsy)(E.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,p.throwIfFalsy)(E.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,p.throwIfFalsy)(E.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=E.createVertexArray(),E.bindVertexArray(this._vertexArrayObject);const R=new Float32Array([0,0,1,0,0,1,1,1]),D=E.createBuffer();this.register((0,m.toDisposable)(()=>E.deleteBuffer(D))),E.bindBuffer(E.ARRAY_BUFFER,D),E.bufferData(E.ARRAY_BUFFER,R,E.STATIC_DRAW),E.enableVertexAttribArray(0),E.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const I=new Uint8Array([0,1,2,3]),O=E.createBuffer();this.register((0,m.toDisposable)(()=>E.deleteBuffer(O))),E.bindBuffer(E.ELEMENT_ARRAY_BUFFER,O),E.bufferData(E.ELEMENT_ARRAY_BUFFER,I,E.STATIC_DRAW),this._attributesBuffer=(0,p.throwIfFalsy)(E.createBuffer()),this.register((0,m.toDisposable)(()=>E.deleteBuffer(this._attributesBuffer))),E.bindBuffer(E.ARRAY_BUFFER,this._attributesBuffer),E.enableVertexAttribArray(2),E.vertexAttribPointer(2,2,E.FLOAT,!1,h,0),E.vertexAttribDivisor(2,1),E.enableVertexAttribArray(3),E.vertexAttribPointer(3,2,E.FLOAT,!1,h,2*Float32Array.BYTES_PER_ELEMENT),E.vertexAttribDivisor(3,1),E.enableVertexAttribArray(4),E.vertexAttribPointer(4,1,E.FLOAT,!1,h,4*Float32Array.BYTES_PER_ELEMENT),E.vertexAttribDivisor(4,1),E.enableVertexAttribArray(5),E.vertexAttribPointer(5,2,E.FLOAT,!1,h,5*Float32Array.BYTES_PER_ELEMENT),E.vertexAttribDivisor(5,1),E.enableVertexAttribArray(6),E.vertexAttribPointer(6,2,E.FLOAT,!1,h,7*Float32Array.BYTES_PER_ELEMENT),E.vertexAttribDivisor(6,1),E.enableVertexAttribArray(1),E.vertexAttribPointer(1,2,E.FLOAT,!1,h,9*Float32Array.BYTES_PER_ELEMENT),E.vertexAttribDivisor(1,1),E.useProgram(this._program);const U=new Int32Array(u.TextureAtlas.maxAtlasPages);for(let W=0;WE.deleteTexture(N.texture))),E.activeTexture(E.TEXTURE0+W),E.bindTexture(E.TEXTURE_2D,N.texture),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_S,E.CLAMP_TO_EDGE),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_T,E.CLAMP_TO_EDGE),E.texImage2D(E.TEXTURE_2D,0,E.RGBA,1,1,0,E.RGBA,E.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[W]=N}E.enable(E.BLEND),E.blendFunc(E.SRC_ALPHA,E.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(w,T,A,E,R,D,I,O){this._updateCell(this._vertices.attributes,w,T,A,E,R,D,I,O)}_updateCell(w,T,A,E,R,D,I,O,U){_=(A*this._terminal.cols+T)*l,E!==g.NULL_CELL_CODE&&E!==void 0?this._atlas&&(f=O&&O.length>1?this._atlas.getRasterizedGlyphCombinedChar(O,R,D,I,!1):this._atlas.getRasterizedGlyph(E,R,D,I,!1),S=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),R!==U&&f.offset.x>S?(k=f.offset.x-S,w[_]=-(f.offset.x-k)+this._dimensions.device.char.left,w[_+1]=-f.offset.y+this._dimensions.device.char.top,w[_+2]=(f.size.x-k)/this._dimensions.device.canvas.width,w[_+3]=f.size.y/this._dimensions.device.canvas.height,w[_+4]=f.texturePage,w[_+5]=f.texturePositionClipSpace.x+k/this._atlas.pages[f.texturePage].canvas.width,w[_+6]=f.texturePositionClipSpace.y,w[_+7]=f.sizeClipSpace.x-k/this._atlas.pages[f.texturePage].canvas.width,w[_+8]=f.sizeClipSpace.y):(w[_]=-f.offset.x+this._dimensions.device.char.left,w[_+1]=-f.offset.y+this._dimensions.device.char.top,w[_+2]=f.size.x/this._dimensions.device.canvas.width,w[_+3]=f.size.y/this._dimensions.device.canvas.height,w[_+4]=f.texturePage,w[_+5]=f.texturePositionClipSpace.x,w[_+6]=f.texturePositionClipSpace.y,w[_+7]=f.sizeClipSpace.x,w[_+8]=f.sizeClipSpace.y)):w.fill(0,_,_+l-1-2)}clear(){const w=this._terminal,T=w.cols*w.rows*l;this._vertices.count!==T?this._vertices.attributes=new Float32Array(T):this._vertices.attributes.fill(0);let A=0;for(;A{Object.defineProperty(r,"__esModule",{value:!0}),r.RectangleRenderer=void 0;const c=o(374),p=o(859),u=o(310),g=o(381),m=8*Float32Array.BYTES_PER_ELEMENT;class y{constructor(){this.attributes=new Float32Array(160),this.count=0}}let v=0,l=0,h=0,f=0,_=0,S=0,k=0;class P extends p.Disposable{constructor(w,T,A,E){super(),this._terminal=w,this._gl=T,this._dimensions=A,this._themeService=E,this._vertices=new y,this._verticesCursor=new y;const R=this._gl;this._program=(0,c.throwIfFalsy)((0,g.createProgram)(R,`#version 300 es -layout (location = 0) in vec2 a_position; -layout (location = 1) in vec2 a_size; -layout (location = 2) in vec4 a_color; -layout (location = 3) in vec2 a_unitquad; - -uniform mat4 u_projection; - -out vec4 v_color; - -void main() { - vec2 zeroToOne = a_position + (a_unitquad * a_size); - gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0); - v_color = a_color; -}`,`#version 300 es -precision lowp float; - -in vec4 v_color; - -out vec4 outColor; - -void main() { - outColor = v_color; -}`)),this.register((0,p.toDisposable)(()=>R.deleteProgram(this._program))),this._projectionLocation=(0,c.throwIfFalsy)(R.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=R.createVertexArray(),R.bindVertexArray(this._vertexArrayObject);const D=new Float32Array([0,0,1,0,0,1,1,1]),I=R.createBuffer();this.register((0,p.toDisposable)(()=>R.deleteBuffer(I))),R.bindBuffer(R.ARRAY_BUFFER,I),R.bufferData(R.ARRAY_BUFFER,D,R.STATIC_DRAW),R.enableVertexAttribArray(3),R.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const O=new Uint8Array([0,1,2,3]),U=R.createBuffer();this.register((0,p.toDisposable)(()=>R.deleteBuffer(U))),R.bindBuffer(R.ELEMENT_ARRAY_BUFFER,U),R.bufferData(R.ELEMENT_ARRAY_BUFFER,O,R.STATIC_DRAW),this._attributesBuffer=(0,c.throwIfFalsy)(R.createBuffer()),this.register((0,p.toDisposable)(()=>R.deleteBuffer(this._attributesBuffer))),R.bindBuffer(R.ARRAY_BUFFER,this._attributesBuffer),R.enableVertexAttribArray(0),R.vertexAttribPointer(0,2,R.FLOAT,!1,m,0),R.vertexAttribDivisor(0,1),R.enableVertexAttribArray(1),R.vertexAttribPointer(1,2,R.FLOAT,!1,m,2*Float32Array.BYTES_PER_ELEMENT),R.vertexAttribDivisor(1,1),R.enableVertexAttribArray(2),R.vertexAttribPointer(2,4,R.FLOAT,!1,m,4*Float32Array.BYTES_PER_ELEMENT),R.vertexAttribDivisor(2,1),this._updateCachedColors(E.colors),this.register(this._themeService.onChangeColors(W=>{this._updateCachedColors(W),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(w){const T=this._gl;T.useProgram(this._program),T.bindVertexArray(this._vertexArrayObject),T.uniformMatrix4fv(this._projectionLocation,!1,g.PROJECTION_MATRIX),T.bindBuffer(T.ARRAY_BUFFER,this._attributesBuffer),T.bufferData(T.ARRAY_BUFFER,w.attributes,T.DYNAMIC_DRAW),T.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,T.UNSIGNED_BYTE,0,w.count)}handleResize(){this._updateViewportRectangle()}setDimensions(w){this._dimensions=w}_updateCachedColors(w){this._bgFloat=this._colorToFloat32Array(w.background),this._cursorFloat=this._colorToFloat32Array(w.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(w){const T=this._terminal,A=this._vertices;let E,R,D,I,O,U,W,N,z,V,j,G=1;for(E=0;E>24&255)/255,_=(v>>16&255)/255,S=(v>>8&255)/255,k=1,this._addRectangle(w.attributes,T,l,h,(D-R)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,f,_,S,k)}_addRectangle(w,T,A,E,R,D,I,O,U,W){w[T]=A/this._dimensions.device.canvas.width,w[T+1]=E/this._dimensions.device.canvas.height,w[T+2]=R/this._dimensions.device.canvas.width,w[T+3]=D/this._dimensions.device.canvas.height,w[T+4]=I,w[T+5]=O,w[T+6]=U,w[T+7]=W}_addRectangleFloat(w,T,A,E,R,D,I){w[T]=A/this._dimensions.device.canvas.width,w[T+1]=E/this._dimensions.device.canvas.height,w[T+2]=R/this._dimensions.device.canvas.width,w[T+3]=D/this._dimensions.device.canvas.height,w[T+4]=I[0],w[T+5]=I[1],w[T+6]=I[2],w[T+7]=I[3]}_colorToFloat32Array(w){return new Float32Array([(w.rgba>>24&255)/255,(w.rgba>>16&255)/255,(w.rgba>>8&255)/255,(255&w.rgba)/255])}}r.RectangleRenderer=P},310:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderModel=r.COMBINED_CHAR_BIT_MASK=r.RENDER_MODEL_EXT_OFFSET=r.RENDER_MODEL_FG_OFFSET=r.RENDER_MODEL_BG_OFFSET=r.RENDER_MODEL_INDICIES_PER_CELL=void 0;const c=o(296);r.RENDER_MODEL_INDICIES_PER_CELL=4,r.RENDER_MODEL_BG_OFFSET=1,r.RENDER_MODEL_FG_OFFSET=2,r.RENDER_MODEL_EXT_OFFSET=3,r.COMBINED_CHAR_BIT_MASK=2147483648,r.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,c.createSelectionRenderModel)()}resize(p,u){const g=p*u*r.RENDER_MODEL_INDICIES_PER_CELL;g!==this.cells.length&&(this.cells=new Uint32Array(g),this.lineLengths=new Uint32Array(u))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:function(d,r,o){var c=this&&this.__decorate||function(D,I,O,U){var W,N=arguments.length,z=N<3?I:U===null?U=Object.getOwnPropertyDescriptor(I,O):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(D,I,O,U);else for(var V=D.length-1;V>=0;V--)(W=D[V])&&(z=(N<3?W(z):N>3?W(I,O,z):W(I,O))||z);return N>3&&z&&Object.defineProperty(I,O,z),z};Object.defineProperty(r,"__esModule",{value:!0}),r.JoinedCellData=r.WebglRenderer=void 0;const p=o(820),u=o(274),g=o(627),m=o(457),y=o(56),v=o(374),l=o(345),h=o(859),f=o(147),_=o(782),S=o(855),k=o(776),P=o(965),M=o(742),w=o(310),T=o(733);class A extends h.Disposable{constructor(I,O,U,W,N,z,V,j,G){super(),this._terminal=I,this._characterJoinerService=O,this._charSizeService=U,this._coreBrowserService=W,this._coreService=N,this._decorationService=z,this._optionsService=V,this._themeService=j,this._cursorBlinkStateManager=new h.MutableDisposable,this._charAtlasDisposable=this.register(new h.MutableDisposable),this._model=new w.RenderModel,this._workCell=new _.CellData,this._rectangleRenderer=this.register(new h.MutableDisposable),this._glyphRenderer=this.register(new h.MutableDisposable),this._onChangeTextureAtlas=this.register(new l.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new l.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new l.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new l.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new l.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new u.CellColorResolver(this._terminal,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new T.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier2,this._coreBrowserService,V,this._themeService)],this.dimensions=(0,v.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(V.onOptionChange(()=>this._handleOptionsChanged())),this._canvas=document.createElement("canvas");const te={antialias:!1,depth:!1,preserveDrawingBuffer:G};if(this._gl=this._canvas.getContext("webgl2",te),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,p.addDisposableDomListener)(this._canvas,"webglcontextlost",oe=>{console.log("webglcontextlost event received"),oe.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(oe)},3e3)})),this.register((0,p.addDisposableDomListener)(this._canvas,"webglcontextrestored",oe=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,g.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this.register((0,y.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(oe,re)=>this._setCanvasDevicePixelDimensions(oe,re))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,h.toDisposable)(()=>{var oe;for(const re of this._renderLayers)re.dispose();(oe=this._canvas.parentElement)===null||oe===void 0||oe.removeChild(this._canvas),(0,g.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){var I;return(I=this._charAtlas)===null||I===void 0?void 0:I.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(I,O){var U,W,N,z;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const V of this._renderLayers)V.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(U=this._rectangleRenderer.value)===null||U===void 0||U.setDimensions(this.dimensions),(W=this._rectangleRenderer.value)===null||W===void 0||W.handleResize(),(N=this._glyphRenderer.value)===null||N===void 0||N.setDimensions(this.dimensions),(z=this._glyphRenderer.value)===null||z===void 0||z.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var I;for(const O of this._renderLayers)O.handleBlur(this._terminal);(I=this._cursorBlinkStateManager.value)===null||I===void 0||I.pause(),this._requestRedrawViewport()}handleFocus(){var I;for(const O of this._renderLayers)O.handleFocus(this._terminal);(I=this._cursorBlinkStateManager.value)===null||I===void 0||I.resume(),this._requestRedrawViewport()}handleSelectionChanged(I,O,U){for(const W of this._renderLayers)W.handleSelectionChanged(this._terminal,I,O,U);this._model.selection.update(this._terminal,I,O,U),this._requestRedrawViewport()}handleCursorMove(){var I;for(const O of this._renderLayers)O.handleCursorMove(this._terminal);(I=this._cursorBlinkStateManager.value)===null||I===void 0||I.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new M.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new P.GlyphRenderer(this._terminal,this._gl,this.dimensions),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var I;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const O=(0,g.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==O&&(this._onChangeTextureAtlas.fire(O.pages[0].canvas),this._charAtlasDisposable.value=(0,h.getDisposeArrayDisposable)([(0,l.forwardEvent)(O.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,l.forwardEvent)(O.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=O,this._charAtlas.warmUp(),(I=this._glyphRenderer.value)===null||I===void 0||I.setAtlas(this._charAtlas)}_clearModel(I){var O;this._model.clear(),I&&((O=this._glyphRenderer.value)===null||O===void 0||O.clear())}clearTextureAtlas(){var I;(I=this._charAtlas)===null||I===void 0||I.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var I;this._clearModel(!0);for(const O of this._renderLayers)O.reset(this._terminal);(I=this._cursorBlinkStateManager.value)===null||I===void 0||I.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(I){return-1}deregisterCharacterJoiner(I){return!1}renderRows(I,O){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const U of this._renderLayers)U.handleGridChanged(this._terminal,I,O);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(I,O),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new m.CursorBlinkStateManager(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(I,O){const U=this._core;let W,N,z,V,j,G,te,oe,re,ye,K,J,Q,de=this._workCell;I=R(I,U.rows-1,0),O=R(O,U.rows-1,0);const De=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,Pe=Math.min(this._terminal.buffer.active.cursorX,U.cols-1);let Ye=-1;const st=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let yt=!1;for(N=I;N<=O;N++)for(z=N+U.buffer.ydisp,V=U.buffer.lines.get(z),this._model.lineLengths[N]=0,j=this._characterJoinerService.getJoinedCharacters(z),J=0;J0&&J===j[0][0]&&(G=!0,oe=j.shift(),de=new E(de,V.translateToString(!0,oe[0],oe[1]),oe[1]-oe[0]),te=oe[1]-1),re=de.getChars(),ye=de.getCode(),K=(N*U.cols+J)*w.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(de,J,z),st&&z===De&&(J===Pe&&(this._model.cursor={x:Pe,y:this._terminal.buffer.active.cursorY,width:de.getWidth(),style:this._coreBrowserService.isFocused?U.options.cursorStyle||"block":U.options.cursorInactiveStyle,cursorWidth:U.options.cursorWidth,dpr:this._devicePixelRatio},Ye=Pe+de.getWidth()-1),J>=Pe&&J<=Ye&&(this._coreBrowserService.isFocused&&(U.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&U.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),ye!==S.NULL_CELL_CODE&&(this._model.lineLengths[N]=J+1),(this._model.cells[K]!==ye||this._model.cells[K+w.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[K+w.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[K+w.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(yt=!0,re.length>1&&(ye|=w.COMBINED_CHAR_BIT_MASK),this._model.cells[K]=ye,this._model.cells[K+w.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[K+w.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[K+w.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,this._glyphRenderer.value.updateCell(J,N,ye,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,re,W),G))for(de=this._workCell,J++;J{Object.defineProperty(r,"__esModule",{value:!0}),r.GLTexture=r.expandFloat32Array=r.createShader=r.createProgram=r.PROJECTION_MATRIX=void 0;const c=o(374);function p(u,g,m){const y=(0,c.throwIfFalsy)(u.createShader(g));if(u.shaderSource(y,m),u.compileShader(y),u.getShaderParameter(y,u.COMPILE_STATUS))return y;console.error(u.getShaderInfoLog(y)),u.deleteShader(y)}r.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),r.createProgram=function(u,g,m){const y=(0,c.throwIfFalsy)(u.createProgram());if(u.attachShader(y,(0,c.throwIfFalsy)(p(u,u.VERTEX_SHADER,g))),u.attachShader(y,(0,c.throwIfFalsy)(p(u,u.FRAGMENT_SHADER,m))),u.linkProgram(y),u.getProgramParameter(y,u.LINK_STATUS))return y;console.error(u.getProgramInfoLog(y)),u.deleteProgram(y)},r.createShader=p,r.expandFloat32Array=function(u,g){const m=Math.min(2*u.length,g),y=new Float32Array(m);for(let v=0;v{Object.defineProperty(r,"__esModule",{value:!0}),r.BaseRenderLayer=void 0;const c=o(627),p=o(237),u=o(374),g=o(859);class m extends g.Disposable{constructor(v,l,h,f,_,S,k,P){super(),this._container=l,this._alpha=_,this._coreBrowserService=S,this._optionsService=k,this._themeService=P,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add(`xterm-${h}-layer`),this._canvas.style.zIndex=f.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors(M=>{this._refreshCharAtlas(v,M),this.reset(v)})),this.register((0,g.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,u.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(v){}handleFocus(v){}handleCursorMove(v){}handleGridChanged(v,l,h){}handleSelectionChanged(v,l,h,f=!1){}_setTransparency(v,l){if(l===this._alpha)return;const h=this._canvas;this._alpha=l,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,h),this._refreshCharAtlas(v,this._themeService.colors),this.handleGridChanged(v,0,v.rows-1)}_refreshCharAtlas(v,l){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,c.acquireTextureAtlas)(v,this._optionsService.rawOptions,l,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(v,l){this._deviceCellWidth=l.device.cell.width,this._deviceCellHeight=l.device.cell.height,this._deviceCharWidth=l.device.char.width,this._deviceCharHeight=l.device.char.height,this._deviceCharLeft=l.device.char.left,this._deviceCharTop=l.device.char.top,this._canvas.width=l.device.canvas.width,this._canvas.height=l.device.canvas.height,this._canvas.style.width=`${l.css.canvas.width}px`,this._canvas.style.height=`${l.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(v,this._themeService.colors)}_fillBottomLineAtCells(v,l,h=1){this._ctx.fillRect(v*this._deviceCellWidth,(l+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,h*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(v,l,h,f){this._alpha?this._ctx.clearRect(v*this._deviceCellWidth,l*this._deviceCellHeight,h*this._deviceCellWidth,f*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(v*this._deviceCellWidth,l*this._deviceCellHeight,h*this._deviceCellWidth,f*this._deviceCellHeight))}_fillCharTrueColor(v,l,h,f){this._ctx.font=this._getFont(v,!1,!1),this._ctx.textBaseline=p.TEXT_BASELINE,this._clipCell(h,f,l.getWidth()),this._ctx.fillText(l.getChars(),h*this._deviceCellWidth+this._deviceCharLeft,f*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(v,l,h){this._ctx.beginPath(),this._ctx.rect(v*this._deviceCellWidth,l*this._deviceCellHeight,h*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(v,l,h){return`${h?"italic":""} ${l?v.options.fontWeightBold:v.options.fontWeight} ${v.options.fontSize*this._coreBrowserService.dpr}px ${v.options.fontFamily}`}}r.BaseRenderLayer=m},733:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkRenderLayer=void 0;const c=o(197),p=o(237),u=o(592);class g extends u.BaseRenderLayer{constructor(y,v,l,h,f,_,S){super(l,y,"link",v,!0,f,_,S),this.register(h.onShowLinkUnderline(k=>this._handleShowLinkUnderline(k))),this.register(h.onHideLinkUnderline(k=>this._handleHideLinkUnderline(k)))}resize(y,v){super.resize(y,v),this._state=void 0}reset(y){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const y=this._state.y2-this._state.y1-1;y>0&&this._clearCells(0,this._state.y1+1,this._state.cols,y),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(y){if(y.fg===p.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:y.fg!==void 0&&(0,c.is256Color)(y.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[y.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,y.y1===y.y2)this._fillBottomLineAtCells(y.x1,y.y1,y.x2-y.x1);else{this._fillBottomLineAtCells(y.x1,y.y1,y.cols-y.x1);for(let v=y.y1+1;v{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(o,c,p,u){o.addEventListener(c,p,u);let g=!1;return{dispose:()=>{g||(g=!0,o.removeEventListener(c,p,u))}}}},274:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellColorResolver=void 0;let o,c=0,p=0,u=!1,g=!1,m=!1;r.CellColorResolver=class{constructor(y,v,l,h,f){this._terminal=y,this._selectionRenderModel=v,this._decorationService=l,this._coreBrowserService=h,this._themeService=f,this.result={fg:0,bg:0,ext:0}}resolve(y,v,l){this.result.bg=y.bg,this.result.fg=y.fg,this.result.ext=268435456&y.bg?y.extended.ext:0,p=0,c=0,g=!1,u=!1,m=!1,o=this._themeService.colors,this._decorationService.forEachDecorationAtCell(v,l,"bottom",h=>{h.backgroundColorRGB&&(p=h.backgroundColorRGB.rgba>>8&16777215,g=!0),h.foregroundColorRGB&&(c=h.foregroundColorRGB.rgba>>8&16777215,u=!0)}),m=this._selectionRenderModel.isCellSelected(this._terminal,v,l),m&&(p=(this._coreBrowserService.isFocused?o.selectionBackgroundOpaque:o.selectionInactiveBackgroundOpaque).rgba>>8&16777215,g=!0,o.selectionForeground&&(c=o.selectionForeground.rgba>>8&16777215,u=!0)),this._decorationService.forEachDecorationAtCell(v,l,"top",h=>{h.backgroundColorRGB&&(p=h.backgroundColorRGB.rgba>>8&16777215,g=!0),h.foregroundColorRGB&&(c=h.foregroundColorRGB.rgba>>8&16777215,u=!0)}),g&&(p=m?-16777216&y.bg&-134217729|p|50331648:-16777216&y.bg|p|50331648),u&&(c=-16777216&y.fg&-67108865|c|50331648),67108864&this.result.fg&&(g&&!u&&(c=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&o.background.rgba>>8|50331648,u=!0),!g&&u&&(p=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&o.foreground.rgba>>8|50331648,g=!0)),o=void 0,this.result.bg=g?p:this.result.bg,this.result.fg=u?c:this.result.fg}}},627:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.removeTerminalFromCache=r.acquireTextureAtlas=void 0;const c=o(509),p=o(197),u=[];r.acquireTextureAtlas=function(g,m,y,v,l,h,f,_){const S=(0,p.generateConfig)(v,l,h,f,m,y,_);for(let M=0;M=0){if((0,p.configEquals)(w.config,S))return w.atlas;w.ownedBy.length===1?(w.atlas.dispose(),u.splice(M,1)):w.ownedBy.splice(T,1);break}}for(let M=0;M{Object.defineProperty(r,"__esModule",{value:!0}),r.is256Color=r.configEquals=r.generateConfig=void 0;const c=o(160);r.generateConfig=function(p,u,g,m,y,v,l){const h={foreground:v.foreground,background:v.background,cursor:c.NULL_COLOR,cursorAccent:c.NULL_COLOR,selectionForeground:c.NULL_COLOR,selectionBackgroundTransparent:c.NULL_COLOR,selectionBackgroundOpaque:c.NULL_COLOR,selectionInactiveBackgroundTransparent:c.NULL_COLOR,selectionInactiveBackgroundOpaque:c.NULL_COLOR,ansi:v.ansi.slice(),contrastCache:v.contrastCache,halfContrastCache:v.halfContrastCache};return{customGlyphs:y.customGlyphs,devicePixelRatio:l,letterSpacing:y.letterSpacing,lineHeight:y.lineHeight,deviceCellWidth:p,deviceCellHeight:u,deviceCharWidth:g,deviceCharHeight:m,fontFamily:y.fontFamily,fontSize:y.fontSize,fontWeight:y.fontWeight,fontWeightBold:y.fontWeightBold,allowTransparency:y.allowTransparency,drawBoldTextInBrightColors:y.drawBoldTextInBrightColors,minimumContrastRatio:y.minimumContrastRatio,colors:h}},r.configEquals=function(p,u){for(let g=0;g{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const c=o(399);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},457:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CursorBlinkStateManager=void 0,r.CursorBlinkStateManager=class{constructor(o,c){this._renderCallback=o,this._coreBrowserService=c,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(o=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const c=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,c>0)return void this._restartInterval(c)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const c=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(c)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},o)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tryDrawCustomChar=r.powerlineDefinitions=r.boxDrawingDefinitions=r.blockElementDefinitions=void 0;const c=o(374);r.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const p={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};r.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(v,l)=>`M0,${.5-l} L1,${.5-l} M0,${.5+l} L1,${.5+l}`},"║":{1:(v,l)=>`M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1`},"╒":{1:(v,l)=>`M.5,1 L.5,${.5-l} L1,${.5-l} M.5,${.5+l} L1,${.5+l}`},"╓":{1:(v,l)=>`M${.5-v},1 L${.5-v},.5 L1,.5 M${.5+v},.5 L${.5+v},1`},"╔":{1:(v,l)=>`M1,${.5-l} L${.5-v},${.5-l} L${.5-v},1 M1,${.5+l} L${.5+v},${.5+l} L${.5+v},1`},"╕":{1:(v,l)=>`M0,${.5-l} L.5,${.5-l} L.5,1 M0,${.5+l} L.5,${.5+l}`},"╖":{1:(v,l)=>`M${.5+v},1 L${.5+v},.5 L0,.5 M${.5-v},.5 L${.5-v},1`},"╗":{1:(v,l)=>`M0,${.5+l} L${.5-v},${.5+l} L${.5-v},1 M0,${.5-l} L${.5+v},${.5-l} L${.5+v},1`},"╘":{1:(v,l)=>`M.5,0 L.5,${.5+l} L1,${.5+l} M.5,${.5-l} L1,${.5-l}`},"╙":{1:(v,l)=>`M1,.5 L${.5-v},.5 L${.5-v},0 M${.5+v},.5 L${.5+v},0`},"╚":{1:(v,l)=>`M1,${.5-l} L${.5+v},${.5-l} L${.5+v},0 M1,${.5+l} L${.5-v},${.5+l} L${.5-v},0`},"╛":{1:(v,l)=>`M0,${.5+l} L.5,${.5+l} L.5,0 M0,${.5-l} L.5,${.5-l}`},"╜":{1:(v,l)=>`M0,.5 L${.5+v},.5 L${.5+v},0 M${.5-v},.5 L${.5-v},0`},"╝":{1:(v,l)=>`M0,${.5-l} L${.5-v},${.5-l} L${.5-v},0 M0,${.5+l} L${.5+v},${.5+l} L${.5+v},0`},"╞":{1:(v,l)=>`M.5,0 L.5,1 M.5,${.5-l} L1,${.5-l} M.5,${.5+l} L1,${.5+l}`},"╟":{1:(v,l)=>`M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1 M${.5+v},.5 L1,.5`},"╠":{1:(v,l)=>`M${.5-v},0 L${.5-v},1 M1,${.5+l} L${.5+v},${.5+l} L${.5+v},1 M1,${.5-l} L${.5+v},${.5-l} L${.5+v},0`},"╡":{1:(v,l)=>`M.5,0 L.5,1 M0,${.5-l} L.5,${.5-l} M0,${.5+l} L.5,${.5+l}`},"╢":{1:(v,l)=>`M0,.5 L${.5-v},.5 M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1`},"╣":{1:(v,l)=>`M${.5+v},0 L${.5+v},1 M0,${.5+l} L${.5-v},${.5+l} L${.5-v},1 M0,${.5-l} L${.5-v},${.5-l} L${.5-v},0`},"╤":{1:(v,l)=>`M0,${.5-l} L1,${.5-l} M0,${.5+l} L1,${.5+l} M.5,${.5+l} L.5,1`},"╥":{1:(v,l)=>`M0,.5 L1,.5 M${.5-v},.5 L${.5-v},1 M${.5+v},.5 L${.5+v},1`},"╦":{1:(v,l)=>`M0,${.5-l} L1,${.5-l} M0,${.5+l} L${.5-v},${.5+l} L${.5-v},1 M1,${.5+l} L${.5+v},${.5+l} L${.5+v},1`},"╧":{1:(v,l)=>`M.5,0 L.5,${.5-l} M0,${.5-l} L1,${.5-l} M0,${.5+l} L1,${.5+l}`},"╨":{1:(v,l)=>`M0,.5 L1,.5 M${.5-v},.5 L${.5-v},0 M${.5+v},.5 L${.5+v},0`},"╩":{1:(v,l)=>`M0,${.5+l} L1,${.5+l} M0,${.5-l} L${.5-v},${.5-l} L${.5-v},0 M1,${.5-l} L${.5+v},${.5-l} L${.5+v},0`},"╪":{1:(v,l)=>`M.5,0 L.5,1 M0,${.5-l} L1,${.5-l} M0,${.5+l} L1,${.5+l}`},"╫":{1:(v,l)=>`M0,.5 L1,.5 M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1`},"╬":{1:(v,l)=>`M0,${.5+l} L${.5-v},${.5+l} L${.5-v},1 M1,${.5+l} L${.5+v},${.5+l} L${.5+v},1 M0,${.5-l} L${.5-v},${.5-l} L${.5-v},0 M1,${.5-l} L${.5+v},${.5-l} L${.5+v},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L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M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(v,l)=>`M.5,1 L.5,${.5+l/.15*.5} C.5,${.5+l/.15*.5},.5,.5,1,.5`},"╮":{1:(v,l)=>`M.5,1 L.5,${.5+l/.15*.5} C.5,${.5+l/.15*.5},.5,.5,0,.5`},"╯":{1:(v,l)=>`M.5,0 L.5,${.5-l/.15*.5} C.5,${.5-l/.15*.5},.5,.5,0,.5`},"╰":{1:(v,l)=>`M.5,0 L.5,${.5-l/.15*.5} C.5,${.5-l/.15*.5},.5,.5,1,.5`}},r.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},r.powerlineDefinitions[""]=r.powerlineDefinitions[""],r.powerlineDefinitions[""]=r.powerlineDefinitions[""],r.tryDrawCustomChar=function(v,l,h,f,_,S,k,P){const M=r.blockElementDefinitions[l];if(M)return function(E,R,D,I,O,U){for(let W=0;W7&&parseInt(N.slice(7,9),16)||1;else{if(!N.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${N}" when drawing pattern glyph`);[re,ye,K,J]=N.substring(5,N.length-1).split(",").map(Q=>parseFloat(Q))}for(let Q=0;Qv.bezierCurveTo(l[0],l[1],l[2],l[3],l[4],l[5]),L:(v,l)=>v.lineTo(l[0],l[1]),M:(v,l)=>v.moveTo(l[0],l[1])};function y(v,l,h,f,_,S,k,P=0,M=0){const w=v.map(T=>parseFloat(T)||parseInt(T));if(w.length<2)throw new Error("Too few arguments for instruction");for(let T=0;T{Object.defineProperty(r,"__esModule",{value:!0}),r.observeDevicePixelDimensions=void 0;const c=o(859);r.observeDevicePixelDimensions=function(p,u,g){let m=new u.ResizeObserver(y=>{const v=y.find(f=>f.target===p);if(!v)return;if(!("devicePixelContentBoxSize"in v))return m==null||m.disconnect(),void(m=void 0);const l=v.devicePixelContentBoxSize[0].inlineSize,h=v.devicePixelContentBoxSize[0].blockSize;l>0&&h>0&&g(l,h)});try{m.observe(p,{box:["device-pixel-content-box"]})}catch{m.disconnect(),m=void 0}return(0,c.toDisposable)(()=>m==null?void 0:m.disconnect())}},374:(d,r)=>{function o(c){return 57508<=c&&c<=57558}Object.defineProperty(r,"__esModule",{value:!0}),r.createRenderDimensions=r.excludeFromContrastRatioDemands=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},r.isPowerlineGlyph=o,r.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},r.excludeFromContrastRatioDemands=function(c){return o(c)||function(p){return 9472<=p&&p<=9631}(c)},r.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},296:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSelectionRenderModel=void 0;class o{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(p,u,g,m=!1){if(this.selectionStart=u,this.selectionEnd=g,!u||!g||u[0]===g[0]&&u[1]===g[1])return void this.clear();const y=u[1]-p.buffer.active.viewportY,v=g[1]-p.buffer.active.viewportY,l=Math.max(y,0),h=Math.min(v,p.rows-1);l>=p.rows||h<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=y,this.viewportEndRow=v,this.viewportCappedStartRow=l,this.viewportCappedEndRow=h,this.startCol=u[0],this.endCol=g[0])}isCellSelected(p,u,g){return!!this.hasSelection&&(g-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&g>=this.viewportCappedStartRow&&u=this.viewportCappedStartRow&&u>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g=this.startCol&&u=this.startCol)}}r.createSelectionRenderModel=function(){return new o}},509:function(d,r,o){var c=this&&this.__decorate||function(A,E,R,D){var I,O=arguments.length,U=O<3?E:D===null?D=Object.getOwnPropertyDescriptor(E,R):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(A,E,R,D);else for(var W=A.length-1;W>=0;W--)(I=A[W])&&(U=(O<3?I(U):O>3?I(E,R,U):I(E,R))||U);return O>3&&U&&Object.defineProperty(E,R,U),U};Object.defineProperty(r,"__esModule",{value:!0}),r.TextureAtlas=void 0;const p=o(237),u=o(860),g=o(374),m=o(160),y=o(345),v=o(485),l=o(385),h=o(147),f=o(855),_=o(776),S={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let k;class P{get pages(){return this._pages}constructor(E,R,D){this._document=E,this._config=R,this._unicodeService=D,this._didWarmUp=!1,this._cacheMap=new v.FourKeyMap,this._cacheMapCombined=new v.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new h.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new y.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new y.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=T(E,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,g.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const E of this.pages)E.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const E=new l.IdleTaskQueue;for(let R=33;R<126;R++)E.enqueue(()=>{if(!this._cacheMap.get(R,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT)){const D=this._drawToCache(R,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT);this._cacheMap.set(R,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT,D)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const E of this._pages)E.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(P.maxAtlasPages&&this._pages.length>=Math.max(4,P.maxAtlasPages)){const R=this._pages.filter(z=>2*z.canvas.width<=(P.maxTextureSize||4096)).sort((z,V)=>V.canvas.width!==z.canvas.width?V.canvas.width-z.canvas.width:V.percentageUsed-z.percentageUsed);let D=-1,I=0;for(let z=0;zz.glyphs[0].texturePage).sort((z,V)=>z>V?1:-1),W=this.pages.length-O.length,N=this._mergePages(O,W);N.version++;for(let z=U.length-1;z>=0;z--)this._deletePage(U[z]);this.pages.push(N),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(N.canvas)}const E=new M(this._document,this._textureSize);return this._pages.push(E),this._activePages.push(E),this._onAddTextureAtlasCanvas.fire(E.canvas),E}_mergePages(E,R){const D=2*E[0].canvas.width,I=new M(this._document,D,E);for(const[O,U]of E.entries()){const W=O*U.canvas.width%D,N=Math.floor(O/2)*U.canvas.height;I.ctx.drawImage(U.canvas,W,N);for(const V of U.glyphs)V.texturePage=R,V.sizeClipSpace.x=V.size.x/D,V.sizeClipSpace.y=V.size.y/D,V.texturePosition.x+=W,V.texturePosition.y+=N,V.texturePositionClipSpace.x=V.texturePosition.x/D,V.texturePositionClipSpace.y=V.texturePosition.y/D;this._onRemoveTextureAtlasCanvas.fire(U.canvas);const z=this._activePages.indexOf(U);z!==-1&&this._activePages.splice(z,1)}return I}_deletePage(E){this._pages.splice(E,1);for(let R=E;R=this._config.colors.ansi.length)throw new Error("No color found for idx "+E);return this._config.colors.ansi[E]}_getBackgroundColor(E,R,D,I){if(this._config.allowTransparency)return m.NULL_COLOR;let O;switch(E){case 16777216:case 33554432:O=this._getColorFromAnsiIndex(R);break;case 50331648:const U=h.AttributeData.toColorRGB(R);O=m.rgba.toColor(U[0],U[1],U[2]);break;default:O=D?m.color.opaque(this._config.colors.foreground):this._config.colors.background}return O}_getForegroundColor(E,R,D,I,O,U,W,N,z,V){const j=this._getMinimumContrastColor(E,R,D,I,O,U,!1,z,N,V);if(j)return j;let G;switch(O){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&z&&U<8&&(U+=8),G=this._getColorFromAnsiIndex(U);break;case 50331648:const te=h.AttributeData.toColorRGB(U);G=m.rgba.toColor(te[0],te[1],te[2]);break;default:G=W?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(G=m.color.opaque(G)),N&&(G=m.color.multiplyOpacity(G,p.DIM_OPACITY)),G}_resolveBackgroundRgba(E,R,D){switch(E){case 16777216:case 33554432:return this._getColorFromAnsiIndex(R).rgba;case 50331648:return R<<8;default:return D?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(E,R,D,I){switch(E){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&I&&R<8&&(R+=8),this._getColorFromAnsiIndex(R).rgba;case 50331648:return R<<8;default:return D?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(E,R,D,I,O,U,W,N,z,V){if(this._config.minimumContrastRatio===1||V)return;const j=this._getContrastCache(z),G=j.getColor(E,I);if(G!==void 0)return G||void 0;const te=this._resolveBackgroundRgba(R,D,W),oe=this._resolveForegroundRgba(O,U,W,N),re=m.rgba.ensureContrastRatio(te,oe,this._config.minimumContrastRatio/(z?2:1));if(!re)return void j.setColor(E,I,null);const ye=m.rgba.toColor(re>>24&255,re>>16&255,re>>8&255);return j.setColor(E,I,ye),ye}_getContrastCache(E){return E?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(E,R,D,I,O=!1){const U=typeof E=="number"?String.fromCharCode(E):E,W=Math.min(this._config.deviceCellWidth*Math.max(U.length,2)+4,this._textureSize);this._tmpCanvas.width=12&&!this._config.allowTransparency&&U!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const xt=this._tmpCtx.measureText(U);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in xt&&xt.actualBoundingBoxDescent>0){this._tmpCtx.save();const Ze=new Path2D;Ze.rect(x,Re-Math.ceil(we/2),this._config.deviceCellWidth*be,Ue-Re+Math.ceil(we/2)),this._tmpCtx.clip(Ze),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=de.css,this._tmpCtx.strokeText(U,ce,ce+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(re){const we=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Ee=we%2==1?.5:0;this._tmpCtx.lineWidth=we,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ce,ce+Ee),this._tmpCtx.lineTo(ce+this._config.deviceCharWidth*be,ce+Ee),this._tmpCtx.stroke()}if(ae||this._tmpCtx.fillText(U,ce,ce+this._config.deviceCharHeight),U==="_"&&!this._config.allowTransparency){let we=w(this._tmpCtx.getImageData(ce,ce,this._config.deviceCellWidth,this._config.deviceCellHeight),de,yt,he);if(we)for(let Ee=1;Ee<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=de.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(U,ce,ce+this._config.deviceCharHeight-Ee),we=w(this._tmpCtx.getImageData(ce,ce,this._config.deviceCellWidth,this._config.deviceCellHeight),de,yt,he),we);Ee++);}if(oe){const we=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),Ee=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=we,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ce,ce+Math.floor(this._config.deviceCharHeight/2)-Ee),this._tmpCtx.lineTo(ce+this._config.deviceCharWidth*be,ce+Math.floor(this._config.deviceCharHeight/2)-Ee),this._tmpCtx.stroke()}this._tmpCtx.restore();const Le=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let et;if(et=this._config.allowTransparency?function(we){for(let Ee=0;Ee0)return!1;return!0}(Le):w(Le,de,yt,he),et)return S;const je=this._findGlyphBoundingBox(Le,this._workBoundingBox,W,st,ae,ce);let _e,ie;for(;;){if(this._activePages.length===0){const we=this._createNewPage();_e=we,ie=we.currentRow,ie.height=je.size.y;break}_e=this._activePages[this._activePages.length-1],ie=_e.currentRow;for(const we of this._activePages)je.size.y<=we.currentRow.height&&(_e=we,ie=we.currentRow);for(let we=this._activePages.length-1;we>=0;we--)for(const Ee of this._activePages[we].fixedRows)Ee.height<=ie.height&&je.size.y<=Ee.height&&(_e=this._activePages[we],ie=Ee);if(ie.y+je.size.y>=_e.canvas.height||ie.height>je.size.y+2){let we=!1;if(_e.currentRow.y+_e.currentRow.height+je.size.y>=_e.canvas.height){let Ee;for(const x of this._activePages)if(x.currentRow.y+x.currentRow.height+je.size.y=P.maxAtlasPages&&ie.y+je.size.y<=_e.canvas.height&&ie.height>=je.size.y&&ie.x+je.size.x<=_e.canvas.width)we=!0;else{const x=this._createNewPage();_e=x,ie=x.currentRow,ie.height=je.size.y,we=!0}}we||(_e.currentRow.height>0&&_e.fixedRows.push(_e.currentRow),ie={x:0,y:_e.currentRow.y+_e.currentRow.height,height:je.size.y},_e.fixedRows.push(ie),_e.currentRow={x:0,y:ie.y+ie.height,height:0})}if(ie.x+je.size.x<=_e.canvas.width)break;ie===_e.currentRow?(ie.x=0,ie.y+=ie.height,ie.height=0):_e.fixedRows.splice(_e.fixedRows.indexOf(ie),1)}return je.texturePage=this._pages.indexOf(_e),je.texturePosition.x=ie.x,je.texturePosition.y=ie.y,je.texturePositionClipSpace.x=ie.x/_e.canvas.width,je.texturePositionClipSpace.y=ie.y/_e.canvas.height,je.sizeClipSpace.x/=_e.canvas.width,je.sizeClipSpace.y/=_e.canvas.height,ie.height=Math.max(ie.height,je.size.y),ie.x+=je.size.x,_e.ctx.putImageData(Le,je.texturePosition.x-this._workBoundingBox.left,je.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,je.size.x,je.size.y),_e.addGlyph(je),_e.version++,je}_findGlyphBoundingBox(E,R,D,I,O,U){R.top=0;const W=I?this._config.deviceCellHeight:this._tmpCanvas.height,N=I?this._config.deviceCellWidth:D;let z=!1;for(let V=0;V=U;V--){for(let j=0;j=0;V--){for(let j=0;j>>24,O=E.rgba>>>16&255,U=E.rgba>>>8&255,W=R.rgba>>>24,N=R.rgba>>>16&255,z=R.rgba>>>8&255,V=Math.floor((Math.abs(I-W)+Math.abs(O-N)+Math.abs(U-z))/12);let j=!0;for(let G=0;G{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;const c=o(399);let p=0,u=0,g=0,m=0;var y,v,l,h,f;function _(k){const P=k.toString(16);return P.length<2?"0"+P:P}function S(k,P){return k>>0}}(y||(r.channels=y={})),function(k){function P(M,w){return m=Math.round(255*w),[p,u,g]=f.toChannels(M.rgba),{css:y.toCss(p,u,g,m),rgba:y.toRgba(p,u,g,m)}}k.blend=function(M,w){if(m=(255&w.rgba)/255,m===1)return{css:w.css,rgba:w.rgba};const T=w.rgba>>24&255,A=w.rgba>>16&255,E=w.rgba>>8&255,R=M.rgba>>24&255,D=M.rgba>>16&255,I=M.rgba>>8&255;return p=R+Math.round((T-R)*m),u=D+Math.round((A-D)*m),g=I+Math.round((E-I)*m),{css:y.toCss(p,u,g),rgba:y.toRgba(p,u,g)}},k.isOpaque=function(M){return(255&M.rgba)==255},k.ensureContrastRatio=function(M,w,T){const A=f.ensureContrastRatio(M.rgba,w.rgba,T);if(A)return f.toColor(A>>24&255,A>>16&255,A>>8&255)},k.opaque=function(M){const w=(255|M.rgba)>>>0;return[p,u,g]=f.toChannels(w),{css:y.toCss(p,u,g),rgba:w}},k.opacity=P,k.multiplyOpacity=function(M,w){return m=255&M.rgba,P(M,m*w/255)},k.toColorRGB=function(M){return[M.rgba>>24&255,M.rgba>>16&255,M.rgba>>8&255]}}(v||(r.color=v={})),function(k){let P,M;if(!c.isNode){const w=document.createElement("canvas");w.width=1,w.height=1;const T=w.getContext("2d",{willReadFrequently:!0});T&&(P=T,P.globalCompositeOperation="copy",M=P.createLinearGradient(0,0,1,1))}k.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return p=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),g=parseInt(w.slice(3,4).repeat(2),16),f.toColor(p,u,g);case 5:return p=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),g=parseInt(w.slice(3,4).repeat(2),16),m=parseInt(w.slice(4,5).repeat(2),16),f.toColor(p,u,g,m);case 7:return{css:w,rgba:(parseInt(w.slice(1),16)<<8|255)>>>0};case 9:return{css:w,rgba:parseInt(w.slice(1),16)>>>0}}const T=w.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return p=parseInt(T[1]),u=parseInt(T[2]),g=parseInt(T[3]),m=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),f.toColor(p,u,g,m);if(!P||!M)throw new Error("css.toColor: Unsupported css format");if(P.fillStyle=M,P.fillStyle=w,typeof P.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(P.fillRect(0,0,1,1),[p,u,g,m]=P.getImageData(0,0,1,1).data,m!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:y.toRgba(p,u,g,m),css:w}}}(l||(r.css=l={})),function(k){function P(M,w,T){const A=M/255,E=w/255,R=T/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.0722*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}k.relativeLuminance=function(M){return P(M>>16&255,M>>8&255,255&M)},k.relativeLuminance2=P}(h||(r.rgb=h={})),function(k){function P(w,T,A){const E=w>>24&255,R=w>>16&255,D=w>>8&255;let I=T>>24&255,O=T>>16&255,U=T>>8&255,W=S(h.relativeLuminance2(I,O,U),h.relativeLuminance2(E,R,D));for(;W0||O>0||U>0);)I-=Math.max(0,Math.ceil(.1*I)),O-=Math.max(0,Math.ceil(.1*O)),U-=Math.max(0,Math.ceil(.1*U)),W=S(h.relativeLuminance2(I,O,U),h.relativeLuminance2(E,R,D));return(I<<24|O<<16|U<<8|255)>>>0}function M(w,T,A){const E=w>>24&255,R=w>>16&255,D=w>>8&255;let I=T>>24&255,O=T>>16&255,U=T>>8&255,W=S(h.relativeLuminance2(I,O,U),h.relativeLuminance2(E,R,D));for(;W>>0}k.ensureContrastRatio=function(w,T,A){const E=h.relativeLuminance(w>>8),R=h.relativeLuminance(T>>8);if(S(E,R)>8));if(US(E,h.relativeLuminance(W>>8))?O:W}return O}const D=M(w,T,A),I=S(E,h.relativeLuminance(D>>8));if(IS(E,h.relativeLuminance(O>>8))?D:O}return D}},k.reduceLuminance=P,k.increaseLuminance=M,k.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]},k.toColor=function(w,T,A,E){return{css:y.toCss(w,T,A,E),rgba:y.toRgba(w,T,A,E)}}}(f||(r.rgba=f={})),r.toPaddedHex=_,r.contrastRatio=S},345:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;cc.fire(p))}},859:(d,r)=>{function o(c){for(const p of c)p.dispose();c.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const p=this._disposables.indexOf(c);p!==-1&&this._disposables.splice(p,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var p;this._isDisposed||c===this._value||((p=this._value)===null||p===void 0||p.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)===null||c===void 0||c.dispose(),this._value=void 0}},r.toDisposable=function(c){return{dispose:c}},r.disposeArray=o,r.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},485:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(p,u,g){this._data[p]||(this._data[p]={}),this._data[p][u]=g}get(p,u){return this._data[p]?this._data[p][u]:void 0}clear(){this._data={}}}r.TwoKeyMap=o,r.FourKeyMap=class{constructor(){this._data=new o}set(c,p,u,g,m){this._data.get(c,p)||this._data.set(c,p,new o),this._data.get(c,p).set(u,g,m)}get(c,p,u,g){var m;return(m=this._data.get(c,p))===null||m===void 0?void 0:m.get(u,g)}clear(){this._data.clear()}}},399:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof navigator>"u";const o=r.isNode?"node":navigator.userAgent,c=r.isNode?"node":navigator.platform;r.isFirefox=o.includes("Firefox"),r.isLegacyEdge=o.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(o),r.getSafariVersion=function(){if(!r.isSafari)return 0;const p=o.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),r.isIpad=c==="iPad",r.isIphone=c==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),r.isLinux=c.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(o)},385:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const c=o(399);class p{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._ih)return l-y<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(l-y))}ms`),void this._start();l=h}this.clear()}}class u extends p{_requestCallback(m){return setTimeout(()=>m(this._createDeadline(16)))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const y=Date.now()+m;return{timeRemaining:()=>Math.max(0,y-Date.now())}}}r.PriorityTaskQueue=u,r.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:u,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},147:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new o;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}r.AttributeData=o;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}constructor(u=0,g=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=g}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=c},782:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const c=o(133),p=o(855),u=o(147);class g extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const v=new g;return v.setFromCharData(y),v}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(y){this.fg=y[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(y[p.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(y[p.CHAR_DATA_CHAR_INDEX].length===2){const l=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=l&&l<=56319){const h=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(l-55296)+h-56320+65536|y[p.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[p.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=y[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=g},855:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},133:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},r.utf32ToString=function(o,c=0,p=o.length){let u="";for(let g=c;g65535?(m-=65536,u+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):u+=String.fromCharCode(m)}return u},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,c){const p=o.length;if(!p)return 0;let u=0,g=0;if(this._interim){const m=o.charCodeAt(g++);56320<=m&&m<=57343?c[u++]=1024*(this._interim-55296)+m-56320+65536:(c[u++]=this._interim,c[u++]=m),this._interim=0}for(let m=g;m=p)return this._interim=y,u;const v=o.charCodeAt(m);56320<=v&&v<=57343?c[u++]=1024*(y-55296)+v-56320+65536:(c[u++]=y,c[u++]=v)}else y!==65279&&(c[u++]=y)}return u}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,c){const p=o.length;if(!p)return 0;let u,g,m,y,v=0,l=0,h=0;if(this.interim[0]){let S=!1,k=this.interim[0];k&=(224&k)==192?31:(240&k)==224?15:7;let P,M=0;for(;(P=63&this.interim[++M])&&M<4;)k<<=6,k|=P;const w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,T=w-M;for(;h=p)return 0;if(P=o[h++],(192&P)!=128){h--,S=!0;break}this.interim[M++]=P,k<<=6,k|=63&P}S||(w===2?k<128?h--:c[v++]=k:w===3?k<2048||k>=55296&&k<=57343||k===65279||(c[v++]=k):k<65536||k>1114111||(c[v++]=k)),this.interim.fill(0)}const f=p-4;let _=h;for(;_=p)return this.interim[0]=u,v;if(g=o[_++],(192&g)!=128){_--;continue}if(l=(31&u)<<6|63&g,l<128){_--;continue}c[v++]=l}else if((240&u)==224){if(_>=p)return this.interim[0]=u,v;if(g=o[_++],(192&g)!=128){_--;continue}if(_>=p)return this.interim[0]=u,this.interim[1]=g,v;if(m=o[_++],(192&m)!=128){_--;continue}if(l=(15&u)<<12|(63&g)<<6|63&m,l<2048||l>=55296&&l<=57343||l===65279)continue;c[v++]=l}else if((248&u)==240){if(_>=p)return this.interim[0]=u,v;if(g=o[_++],(192&g)!=128){_--;continue}if(_>=p)return this.interim[0]=u,this.interim[1]=g,v;if(m=o[_++],(192&m)!=128){_--;continue}if(_>=p)return this.interim[0]=u,this.interim[1]=g,this.interim[2]=m,v;if(y=o[_++],(192&y)!=128){_--;continue}if(l=(7&u)<<18|(63&g)<<12|(63&m)<<6|63&y,l<65536||l>1114111)continue;c[v++]=l}}return v}}},776:function(d,r,o){var c=this&&this.__decorate||function(l,h,f,_){var S,k=arguments.length,P=k<3?h:_===null?_=Object.getOwnPropertyDescriptor(h,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(l,h,f,_);else for(var M=l.length-1;M>=0;M--)(S=l[M])&&(P=(k<3?S(P):k>3?S(h,f,P):S(h,f))||P);return k>3&&P&&Object.defineProperty(h,f,P),P},p=this&&this.__param||function(l,h){return function(f,_){h(f,_,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const u=o(859),g=o(97),m={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let y,v=r.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(l){super(),this._optionsService=l,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),y=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(l){for(let h=0;hJSON.stringify(P)).join(", ")})`);const k=_.apply(this,S);return y.trace(`GlyphRenderer#${_.name} return`,k),k}}},726:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const o="di$target",c="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(p){return p[c]||[]},r.createDecorator=function(p){if(r.serviceRegistry.has(p))return r.serviceRegistry.get(p);const u=function(g,m,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,l,h){l[o]===l?l[c].push({id:v,index:h}):(l[c]=[{id:v,index:h}],l[o]=l)})(u,g,y)};return u.toString=()=>p,r.serviceRegistry.set(p,u),u}},97:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const c=o(726);var p;r.IBufferService=(0,c.createDecorator)("BufferService"),r.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),r.ICoreService=(0,c.createDecorator)("CoreService"),r.ICharsetService=(0,c.createDecorator)("CharsetService"),r.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(p||(r.LogLevelEnum=p={})),r.ILogService=(0,c.createDecorator)("LogService"),r.IOptionsService=(0,c.createDecorator)("OptionsService"),r.IOscLinkService=(0,c.createDecorator)("OscLinkService"),r.IUnicodeService=(0,c.createDecorator)("UnicodeService"),r.IDecorationService=(0,c.createDecorator)("DecorationService")}},s={};function i(d){var r=s[d];if(r!==void 0)return r.exports;var o=s[d]={exports:{}};return n[d].call(o.exports,o,o.exports,i),o.exports}var a={};return(()=>{var d=a;Object.defineProperty(d,"__esModule",{value:!0}),d.WebglAddon=void 0;const r=i(345),o=i(859),c=i(399),p=i(666),u=i(776);class g extends o.Disposable{constructor(y){if(c.isSafari&&(0,c.getSafariVersion)()<16)throw new Error("Webgl2 is only supported on Safari 16 and above");super(),this._preserveDrawingBuffer=y,this._onChangeTextureAtlas=this.register(new r.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new r.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new r.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new r.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(y){const v=y._core;if(!y.element)return void this.register(v.onWillOpen(()=>this.activate(y)));this._terminal=y;const l=v.coreService,h=v.optionsService,f=v,_=f._renderService,S=f._characterJoinerService,k=f._charSizeService,P=f._coreBrowserService,M=f._decorationService,w=f._logService,T=f._themeService;(0,u.setTraceLogger)(w),this._renderer=this.register(new p.WebglRenderer(y,S,k,P,l,M,h,T,this._preserveDrawingBuffer)),this.register((0,r.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,r.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,r.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,r.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),_.setRenderer(this._renderer),this.register((0,o.toDisposable)(()=>{const A=this._terminal._core._renderService;A.setRenderer(this._terminal._core._createRenderer()),A.handleResize(y.cols,y.rows)}))}get textureAtlas(){var y;return(y=this._renderer)===null||y===void 0?void 0:y.textureAtlas}clearTextureAtlas(){var y;(y=this._renderer)===null||y===void 0||y.clearTextureAtlas()}}d.WebglAddon=g})(),a})())})(Ym);var K2=Ym.exports,Gm={exports:{}};(function(e,t){(function(n,s){e.exports=s()})(self,()=>(()=>{var n={345:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;cc.fire(p))}},859:(d,r)=>{function o(c){for(const p of c)p.dispose();c.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const p=this._disposables.indexOf(c);p!==-1&&this._disposables.splice(p,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var p;this._isDisposed||c===this._value||((p=this._value)===null||p===void 0||p.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)===null||c===void 0||c.dispose(),this._value=void 0}},r.toDisposable=function(c){return{dispose:c}},r.disposeArray=o,r.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}}},s={};function i(d){var r=s[d];if(r!==void 0)return r.exports;var o=s[d]={exports:{}};return n[d](o,o.exports,i),o.exports}var a={};return(()=>{var d=a;Object.defineProperty(d,"__esModule",{value:!0}),d.SearchAddon=void 0;const r=i(345),o=i(859),c=" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?";class p extends o.Disposable{constructor(g){var m;super(),this._highlightedLines=new Set,this._highlightDecorations=[],this._selectedDecoration=this.register(new o.MutableDisposable),this._linesCacheTimeoutId=0,this._onDidChangeResults=this.register(new r.EventEmitter),this.onDidChangeResults=this._onDidChangeResults.event,this._highlightLimit=(m=g==null?void 0:g.highlightLimit)!==null&&m!==void 0?m:1e3}activate(g){this._terminal=g,this.register(this._terminal.onWriteParsed(()=>this._updateMatches())),this.register(this._terminal.onResize(()=>this._updateMatches())),this.register((0,o.toDisposable)(()=>this.clearDecorations()))}_updateMatches(){var g;this._highlightTimeout&&window.clearTimeout(this._highlightTimeout),this._cachedSearchTerm&&(!((g=this._lastSearchOptions)===null||g===void 0)&&g.decorations)&&(this._highlightTimeout=setTimeout(()=>{const m=this._cachedSearchTerm;this._cachedSearchTerm=void 0,this.findPrevious(m,Object.assign(Object.assign({},this._lastSearchOptions),{incremental:!0,noScroll:!0}))},200))}clearDecorations(g){this._selectedDecoration.clear(),(0,o.disposeArray)(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear(),g||(this._cachedSearchTerm=void 0)}findNext(g,m){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");this._lastSearchOptions=m,m!=null&&m.decorations&&(this._cachedSearchTerm!==void 0&&g===this._cachedSearchTerm||this._highlightAllMatches(g,m));const y=this._findNextAndSelect(g,m);return this._fireResults(m),this._cachedSearchTerm=g,y}_highlightAllMatches(g,m){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!g||g.length===0)return void this.clearDecorations();m=m||{},this.clearDecorations(!0);const y=[];let v,l=this._find(g,0,0,m);for(;l&&((v==null?void 0:v.row)!==l.row||(v==null?void 0:v.col)!==l.col)&&!(y.length>=this._highlightLimit);)v=l,y.push(v),l=this._find(g,v.col+v.term.length>=this._terminal.cols?v.row+1:v.row,v.col+v.term.length>=this._terminal.cols?0:v.col+1,m);for(const h of y){const f=this._createResultDecoration(h,m.decorations);f&&(this._highlightedLines.add(f.marker.line),this._highlightDecorations.push({decoration:f,match:h,dispose(){f.dispose()}}))}}_find(g,m,y,v){var l;if(!this._terminal||!g||g.length===0)return(l=this._terminal)===null||l===void 0||l.clearSelection(),void this.clearDecorations();if(y>this._terminal.cols)throw new Error(`Invalid col: ${y} to search in terminal of ${this._terminal.cols} cols`);let h;this._initLinesCache();const f={startRow:m,startCol:y};if(h=this._findInLine(g,f,v),!h)for(let _=m+1;_=0&&(_.startRow=k,S=this._findInLine(g,_,m,f),!S);k--);}if(!S&&l!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let k=this._terminal.buffer.active.baseY+this._terminal.rows-1;k>=l&&(_.startRow=k,S=this._findInLine(g,_,m,f),!S);k--);return this._selectResult(S,m==null?void 0:m.decorations,m==null?void 0:m.noScroll)}_initLinesCache(){const g=this._terminal;this._linesCache||(this._linesCache=new Array(g.buffer.active.length),this._cursorMoveListener=g.onCursorMove(()=>this._destroyLinesCache()),this._resizeListener=g.onResize(()=>this._destroyLinesCache())),window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=window.setTimeout(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._cursorMoveListener&&(this._cursorMoveListener.dispose(),this._cursorMoveListener=void 0),this._resizeListener&&(this._resizeListener.dispose(),this._resizeListener=void 0),this._linesCacheTimeoutId&&(window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=0)}_isWholeWord(g,m,y){return(g===0||c.includes(m[g-1]))&&(g+y.length===m.length||c.includes(m[g+y.length]))}_findInLine(g,m,y={},v=!1){var l;const h=this._terminal,f=m.startRow,_=m.startCol,S=h.buffer.active.getLine(f);if(S!=null&&S.isWrapped)return v?void(m.startCol+=h.cols):(m.startRow--,m.startCol+=h.cols,this._findInLine(g,m,y));let k=(l=this._linesCache)===null||l===void 0?void 0:l[f];k||(k=this._translateBufferLineToStringWithWrap(f,!0),this._linesCache&&(this._linesCache[f]=k));const[P,M]=k,w=this._bufferColsToStringOffset(f,_),T=y.caseSensitive?g:g.toLowerCase(),A=y.caseSensitive?P:P.toLowerCase();let E=-1;if(y.regex){const R=RegExp(T,"g");let D;if(v)for(;D=R.exec(A.slice(0,w));)E=R.lastIndex-D[0].length,g=D[0],R.lastIndex-=g.length-1;else D=R.exec(A.slice(w)),D&&D[0].length>0&&(E=w+(R.lastIndex-D[0].length),g=D[0])}else v?w-T.length>=0&&(E=A.lastIndexOf(T,w-T.length)):E=A.indexOf(T,w);if(E>=0){if(y.wholeWord&&!this._isWholeWord(E,A,g))return;let R=0;for(;R=M[R+1];)R++;let D=R;for(;D=M[D+1];)D++;const I=E-M[R],O=E+g.length-M[D],U=this._stringLengthToBufferSize(f+R,I);return{term:g,col:U,row:f+R,size:this._stringLengthToBufferSize(f+D,O)-U+h.cols*(D-R)}}}_stringLengthToBufferSize(g,m){const y=this._terminal.buffer.active.getLine(g);if(!y)return 0;for(let v=0;v1&&(m-=h.length-1);const f=y.getCell(v+1);f&&f.getWidth()===0&&m++}return m}_bufferColsToStringOffset(g,m){const y=this._terminal;let v=g,l=0,h=y.buffer.active.getLine(v);for(;m>0&&h;){for(let f=0;fthis._applyStyles(_,m.activeMatchBorder,!0))),f.push(h.onDispose(()=>(0,o.disposeArray)(f))),this._selectedDecoration.value={decoration:h,match:g,dispose(){h.dispose()}}}}}if(!y&&(g.row>=v.buffer.active.viewportY+v.rows||g.rowthis._applyStyles(f,m.matchBorder,!1))),h.push(l.onDispose(()=>(0,o.disposeArray)(h)))}return l}}d.SearchAddon=p})(),a})())})(Gm);var W2=Gm.exports;/*! Capacitor: https://capacitorjs.com/ - MIT License */var vo;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(vo||(vo={}));class Ri extends Error{constructor(t,n,s){super(t),this.message=t,this.code=n,this.data=s}}const j2=e=>{var t,n;return e!=null&&e.androidBridge?"android":!((n=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||n===void 0)&&n.bridge?"ios":"web"},q2=e=>{const t=e.CapacitorCustomPlatform||null,n=e.Capacitor||{},s=n.Plugins=n.Plugins||{},i=()=>t!==null?t.name:j2(e),a=()=>i()!=="web",d=u=>{const g=c.get(u);return!!(g!=null&&g.platforms.has(i())||r(u))},r=u=>{var g;return(g=n.PluginHeaders)===null||g===void 0?void 0:g.find(m=>m.name===u)},o=u=>e.console.error(u),c=new Map,p=(u,g={})=>{const m=c.get(u);if(m)return console.warn(`Capacitor plugin "${u}" already registered. Cannot register plugins twice.`),m.proxy;const y=i(),v=r(u);let l;const h=async()=>(!l&&y in g?l=typeof g[y]=="function"?l=await g[y]():l=g[y]:t!==null&&!l&&"web"in g&&(l=typeof g.web=="function"?l=await g.web():l=g.web),l),f=(w,T)=>{var A,E;if(v){const R=v==null?void 0:v.methods.find(D=>T===D.name);if(R)return R.rtype==="promise"?D=>n.nativePromise(u,T.toString(),D):(D,I)=>n.nativeCallback(u,T.toString(),D,I);if(w)return(A=w[T])===null||A===void 0?void 0:A.bind(w)}else{if(w)return(E=w[T])===null||E===void 0?void 0:E.bind(w);throw new Ri(`"${u}" plugin is not implemented on ${y}`,vo.Unimplemented)}},_=w=>{let T;const A=(...E)=>{const R=h().then(D=>{const I=f(D,w);if(I){const O=I(...E);return T=O==null?void 0:O.remove,O}else throw new Ri(`"${u}.${w}()" is not implemented on ${y}`,vo.Unimplemented)});return w==="addListener"&&(R.remove=async()=>T()),R};return A.toString=()=>`${w.toString()}() { [capacitor code] }`,Object.defineProperty(A,"name",{value:w,writable:!1,configurable:!1}),A},S=_("addListener"),k=_("removeListener"),P=(w,T)=>{const A=S({eventName:w},T),E=async()=>{const D=await A;k({eventName:w,callbackId:D},T)},R=new Promise(D=>A.then(()=>D({remove:E})));return R.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await E()},R},M=new Proxy({},{get(w,T){switch(T){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return v?P:S;case"removeListener":return k;default:return _(T)}}});return s[u]=M,c.set(u,{name:u,proxy:M,platforms:new Set([...Object.keys(g),...v?[y]:[]])}),M};return n.convertFileSrc||(n.convertFileSrc=u=>u),n.getPlatform=i,n.handleError=o,n.isNativePlatform=a,n.isPluginAvailable=d,n.registerPlugin=p,n.Exception=Ri,n.DEBUG=!!n.DEBUG,n.isLoggingEnabled=!!n.isLoggingEnabled,n},Y2=e=>e.Capacitor=q2(e),Xd=Y2(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Ra=Xd.registerPlugin;class uc{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,n){let s=!1;this.listeners[t]||(this.listeners[t]=[],s=!0),this.listeners[t].push(n);const a=this.windowListeners[t];a&&!a.registered&&this.addWindowListener(a),s&&this.sendRetainedArgumentsForEvent(t);const d=async()=>this.removeListener(t,n);return Promise.resolve({remove:d})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,n,s){const i=this.listeners[t];if(!i){if(s){let a=this.retainedEventArguments[t];a||(a=[]),a.push(n),this.retainedEventArguments[t]=a}return}i.forEach(a=>a(n))}hasListeners(t){var n;return!!(!((n=this.listeners[t])===null||n===void 0)&&n.length)}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:s=>{this.notifyListeners(n,s)}}}unimplemented(t="not implemented"){return new Xd.Exception(t,vo.Unimplemented)}unavailable(t="not available"){return new Xd.Exception(t,vo.Unavailable)}async removeListener(t,n){const s=this.listeners[t];if(!s)return;const i=s.indexOf(n);this.listeners[t].splice(i,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const n=this.retainedEventArguments[t];n&&(delete this.retainedEventArguments[t],n.forEach(s=>{this.notifyListeners(t,s)}))}}const Yf=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Gf=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class G2 extends uc{async getCookies(){const t=document.cookie,n={};return t.split(";").forEach(s=>{if(s.length<=0)return;let[i,a]=s.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");i=Gf(i).trim(),a=Gf(a).trim(),n[i]=a}),n}async setCookie(t){try{const n=Yf(t.key),s=Yf(t.value),i=t.expires?`; expires=${t.expires.replace("expires=","")}`:"",a=(t.path||"/").replace("path=",""),d=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${s||""}${i}; path=${a}; ${d};`}catch(n){return Promise.reject(n)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const n of t)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}Ra("CapacitorCookies",{web:()=>new G2});const X2=async e=>new Promise((t,n)=>{const s=new FileReader;s.onload=()=>{const i=s.result;t(i.indexOf(",")>=0?i.split(",")[1]:i)},s.onerror=i=>n(i),s.readAsDataURL(e)}),J2=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(i=>i.toLocaleLowerCase()).reduce((i,a,d)=>(i[a]=e[t[d]],i),{})},Q2=(e,t=!0)=>e?Object.entries(e).reduce((s,i)=>{const[a,d]=i;let r,o;return Array.isArray(d)?(o="",d.forEach(c=>{r=t?encodeURIComponent(c):c,o+=`${a}=${r}&`}),o.slice(0,-1)):(r=t?encodeURIComponent(d):d,o=`${a}=${r}`),`${s}&${o}`},"").substr(1):null,Z2=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),i=J2(e.headers)["content-type"]||"";if(typeof e.data=="string")n.body=e.data;else if(i.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[d,r]of Object.entries(e.data||{}))a.set(d,r);n.body=a.toString()}else if(i.includes("multipart/form-data")||e.data instanceof FormData){const a=new FormData;if(e.data instanceof FormData)e.data.forEach((r,o)=>{a.append(o,r)});else for(const r of Object.keys(e.data))a.append(r,e.data[r]);n.body=a;const d=new Headers(n.headers);d.delete("content-type"),n.headers=d}else(i.includes("application/json")||typeof e.data=="object")&&(n.body=JSON.stringify(e.data));return n};class eR extends uc{async request(t){const n=Z2(t,t.webFetchExtra),s=Q2(t.params,t.shouldEncodeUrlParams),i=s?`${t.url}?${s}`:t.url,a=await fetch(i,n),d=a.headers.get("content-type")||"";let{responseType:r="text"}=a.ok?t:{};d.includes("application/json")&&(r="json");let o,c;switch(r){case"arraybuffer":case"blob":c=await a.blob(),o=await X2(c);break;case"json":o=await a.json();break;case"document":case"text":default:o=await a.text()}const p={};return a.headers.forEach((u,g)=>{p[g]=u}),{data:o,headers:p,status:a.status,url:a.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}Ra("CapacitorHttp",{web:()=>new eR});var Xf;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(Xf||(Xf={}));var Jf;(function(e){e.StatusBar="StatusBar",e.NavigationBar="NavigationBar"})(Jf||(Jf={}));class tR extends uc{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}Ra("SystemBars",{web:()=>new tR});var Tr;(function(e){e.Prompt="PROMPT",e.Camera="CAMERA",e.Photos="PHOTOS"})(Tr||(Tr={}));var eo;(function(e){e.Rear="REAR",e.Front="FRONT"})(eo||(eo={}));var Jd;(function(e){e.Uri="uri",e.Base64="base64",e.DataUrl="dataUrl"})(Jd||(Jd={}));var Al;(function(e){e[e.Photo=0]="Photo",e[e.Video=1]="Video"})(Al||(Al={}));var la;(function(e){e[e.Photo=0]="Photo",e[e.Video=1]="Video",e[e.All=2]="All"})(la||(la={}));var Qf;(function(e){e[e.JPEG=0]="JPEG",e[e.PNG=1]="PNG"})(Qf||(Qf={}));var Zf;(function(e){e.CameraPermissionDenied="OS-PLUG-CAMR-0003",e.GalleryPermissionDenied="OS-PLUG-CAMR-0005",e.NoCameraAvailable="OS-PLUG-CAMR-0007",e.TakePhotoCancelled="OS-PLUG-CAMR-0006",e.TakePhotoFailed="OS-PLUG-CAMR-0010",e.TakePhotoInvalidArguments="OS-PLUG-CAMR-0014",e.InvalidImageData="OS-PLUG-CAMR-0008",e.EditPhotoFailed="OS-PLUG-CAMR-0009",e.EditPhotoCancelled="OS-PLUG-CAMR-0013",e.EditPhotoEmptyUri="OS-PLUG-CAMR-0024",e.ImageNotFound="OS-PLUG-CAMR-0011",e.ProcessImageFailed="OS-PLUG-CAMR-0012",e.ChooseMediaFailed="OS-PLUG-CAMR-0018",e.ChooseMediaCancelled="OS-PLUG-CAMR-0020",e.MediaPathError="OS-PLUG-CAMR-0021",e.FetchImageFromUriFailed="OS-PLUG-CAMR-0028",e.RecordVideoFailed="OS-PLUG-CAMR-0016",e.RecordVideoCancelled="OS-PLUG-CAMR-0017",e.VideoNotFound="OS-PLUG-CAMR-0025",e.PlayVideoFailed="OS-PLUG-CAMR-0023",e.EncodeResultFailed="OS-PLUG-CAMR-0019",e.FileNotFound="OS-PLUG-CAMR-0027",e.InvalidArgument="OS-PLUG-CAMR-0031",e.GeneralError="OS-PLUG-CAMR-0026"})(Zf||(Zf={}));class nR extends uc{async takePhoto(t){return new Promise(async(n,s)=>{t.webUseInput?this.takePhotoCameraInputExperience(t,n,s):this.takePhotoCameraExperience(t,n,s)})}async recordVideo(t){throw this.unimplemented("recordVideo is not implemented on Web.")}async playVideo(t){throw this.unimplemented("playVideo is not implemented on Web.")}async chooseFromGallery(t){return new Promise(async(n,s)=>{this.galleryInputExperience(t,n,s)})}async editPhoto(t){throw this.unimplemented("editPhoto is not implemented on Web.")}async editURIPhoto(t){throw this.unimplemented("editURIPhoto is not implemented on Web.")}async getPhoto(t){return new Promise(async(n,s)=>{if(t.webUseInput||t.source===Tr.Photos)this.fileInputExperience(t,n,s);else if(t.source===Tr.Prompt){let i=document.querySelector("pwa-action-sheet");i||(i=document.createElement("pwa-action-sheet"),document.body.appendChild(i)),i.header=t.promptLabelHeader||"Photo",i.cancelable=!1,i.options=[{title:t.promptLabelPhoto||"From Photos"},{title:t.promptLabelPicture||"Take Picture"}],i.addEventListener("onSelection",async a=>{a.detail===0?this.fileInputExperience(t,n,s):this.cameraExperience(t,n,s)})}else this.cameraExperience(t,n,s)})}async pickImages(t){return new Promise(async(n,s)=>{this.multipleFileInputExperience(n,s)})}async cameraExperience(t,n,s){await this._setupPWACameraModal(t.direction,i=>this._getCameraPhoto(i,t),()=>this.fileInputExperience(t,n,s),n,s)}fileInputExperience(t,n,s){let i=document.querySelector("#_capacitor-camera-input");const a=()=>{var d;(d=i.parentNode)===null||d===void 0||d.removeChild(i)};i||(i=document.createElement("input"),i.id="_capacitor-camera-input",i.type="file",i.hidden=!0,document.body.appendChild(i),i.addEventListener("change",d=>{const r=i.files[0];let o="jpeg";if(r.type==="image/png"?o="png":r.type==="image/gif"&&(o="gif"),t.resultType==="dataUrl"||t.resultType==="base64"){const c=new FileReader;c.addEventListener("load",()=>{if(t.resultType==="dataUrl")n({dataUrl:c.result,format:o});else if(t.resultType==="base64"){const p=c.result.split(",")[1];n({base64String:p,format:o})}a()}),c.readAsDataURL(r)}else n({webPath:URL.createObjectURL(r),format:o}),a()}),i.addEventListener("cancel",d=>{s(new Ri("User cancelled photos app")),a()})),i.accept="image/*",i.capture=!0,t.source===Tr.Photos||t.source===Tr.Prompt?i.removeAttribute("capture"):t.direction===eo.Front?i.capture="user":t.direction===eo.Rear&&(i.capture="environment"),i.click()}multipleFileInputExperience(t,n){let s=document.querySelector("#_capacitor-camera-input-multiple");const i=()=>{var a;(a=s.parentNode)===null||a===void 0||a.removeChild(s)};s||(s=document.createElement("input"),s.id="_capacitor-camera-input-multiple",s.type="file",s.hidden=!0,s.multiple=!0,document.body.appendChild(s),s.addEventListener("change",a=>{const d=[];for(let r=0;r{n(new Ri("User cancelled photos app")),i()})),s.accept="image/*",s.click()}_getCameraPhoto(t,n){return new Promise((s,i)=>{const a=new FileReader,d=this._getFileFormat(t);n.resultType==="uri"?s({webPath:URL.createObjectURL(t),format:d,saved:!1}):(a.readAsDataURL(t),a.onloadend=()=>{const r=a.result;n.resultType==="dataUrl"?s({dataUrl:r,format:d,saved:!1}):s({base64String:r.split(",")[1],format:d,saved:!1})},a.onerror=r=>{i(r)})})}async takePhotoCameraExperience(t,n,s){await this._setupPWACameraModal(t.cameraDirection,i=>{var a;return this._buildPhotoMediaResult(i,(a=t.includeMetadata)!==null&&a!==void 0?a:!1)},()=>this.takePhotoCameraInputExperience(t,n,s),n,s)}takePhotoCameraInputExperience(t,n,s){const i=this._createFileInput("_capacitor-camera-input-takephoto"),a=()=>{var d;(d=i.parentNode)===null||d===void 0||d.removeChild(i)};i.onchange=async d=>{var r;if(!this._validateFileInput(i,s,a))return;const o=i.files[0];n(await this._buildPhotoMediaResult(o,(r=t.includeMetadata)!==null&&r!==void 0?r:!1)),a()},i.oncancel=()=>{s(new Ri("User cancelled photos app")),a()},i.accept="image/*",t.cameraDirection===eo.Front?i.capture="user":i.capture="environment",i.click()}galleryInputExperience(t,n,s){var i,a;const d=this._createFileInput("_capacitor-camera-input-gallery");d.multiple=(i=t.allowMultipleSelection)!==null&&i!==void 0?i:!1;const r=()=>{var c;(c=d.parentNode)===null||c===void 0||c.removeChild(d)};d.onchange=async c=>{var p;if(!this._validateFileInput(d,s,r))return;const u=[];for(let g=0;g{s(new Ri("User cancelled photos app")),r()};const o=(a=t.mediaType)!==null&&a!==void 0?a:la.Photo;o===la.Photo?d.accept="image/*":o===la.Video?d.accept="video/*":d.accept="image/*,video/*",d.click()}_getFileFormat(t){return t.type==="image/png"?"png":t.type==="image/gif"?"gif":t.type.startsWith("video/")?t.type.split("/")[1]:t.type.startsWith("image/")?"jpeg":t.type.split("/")[1]||"jpeg"}async _buildPhotoMediaResult(t,n){const s=this._getFileFormat(t),i=await this._getBase64FromFile(t),a={type:Al.Photo,thumbnail:i,webPath:URL.createObjectURL(t),saved:!1};if(n){const d=await this._getImageResolution(t);a.metadata={format:s,resolution:d,size:t.size,creationDate:"lastModified"in t?new Date(t.lastModified).toISOString():new Date().toISOString()}}return a}_validateFileInput(t,n,s){if(!t.files||t.files.length===0){const i=t.multiple?"No files selected":"No file selected";return n(new Ri(i)),s(),!1}return!0}async _setupPWACameraModal(t,n,s,i,a){if(customElements.get("pwa-camera-modal")){const d=document.createElement("pwa-camera-modal");d.facingMode=t===eo.Front?"user":"environment",document.body.appendChild(d);try{await d.componentOnReady(),d.addEventListener("onPhoto",async r=>{const o=r.detail;o===null?a(new Ri("User cancelled photos app")):o instanceof Error?a(o):i(await n(o)),d.dismiss(),document.body.removeChild(d)}),d.present()}catch{s()}}else console.error("Unable to load PWA Element 'pwa-camera-modal'. See the docs: https://capacitorjs.com/docs/web/pwa-elements."),s()}_createFileInput(t){let n=document.querySelector(`#${t}`);return n||(n=document.createElement("input"),n.id=t,n.type="file",n.hidden=!0,document.body.appendChild(n)),n}async _getImageResolution(t){try{const n=await createImageBitmap(t),s=`${n.width}x${n.height}`;return n.close(),s}catch(n){console.warn("Failed to get image resolution:",n);return}}_getBase64FromFile(t){return new Promise((n,s)=>{const i=new FileReader;i.onloadend=()=>{const d=i.result.split(",")[1];n(d)},i.onerror=a=>{s(a)},i.readAsDataURL(t)})}_getVideoMetadata(t){return new Promise(n=>{const s=document.createElement("video");s.preload="metadata",s.muted=!0,s.onloadedmetadata=()=>{const i=Math.min(1,s.duration*.1);s.currentTime=i},s.onseeked=()=>{const i={resolution:`${s.videoWidth}x${s.videoHeight}`,duration:s.duration};try{const a=document.createElement("canvas");a.width=s.videoWidth,a.height=s.videoHeight;const d=a.getContext("2d");d&&(d.drawImage(s,0,0,a.width,a.height),i.thumbnail=a.toDataURL("image/jpeg",.8).split(",")[1])}catch(a){console.warn("Failed to generate video thumbnail:",a)}URL.revokeObjectURL(s.src),n(i)},s.onerror=()=>{URL.revokeObjectURL(s.src),n({})},s.src=URL.createObjectURL(t)})}async checkPermissions(){if(typeof navigator>"u"||!navigator.permissions)throw this.unavailable("Permissions API not available in this browser");try{return{camera:(await window.navigator.permissions.query({name:"camera"})).state,photos:"granted"}}catch{throw this.unavailable("Camera permissions are not available in this browser")}}async requestPermissions(){throw this.unimplemented("Not implemented on web.")}async pickLimitedLibraryPhotos(){throw this.unavailable("Not implemented on web.")}async getLimitedLibraryPhotos(){throw this.unavailable("Not implemented on web.")}}const sR=Ra("Camera",{web:()=>new nR});function Yc(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Xm(e){return e.total_bytes<=0?0:Math.max(0,Math.min(100,Math.round(e.bytes/e.total_bytes*100)))}function iR(e){return e.total_bytes<=0?on("terminal.loadingHistoryBytes",{bytes:Yc(e.bytes)}):on("terminal.loadingHistoryProgress",{pct:Xm(e),bytes:Yc(e.bytes),total:Yc(e.total_bytes)})}function rR(){let e="idle",t=0;return{onProgress(n,s){if(n==="start"){t+=1,e="replaying";return}if(n==="chunk"){e="replaying";return}const i=t;e="draining";const a=()=>{t===i&&(e="idle")};s?s(a):a()},shouldForward:(n=!1)=>n||e==="idle"}}function oR(){var e;return typeof navigator>"u"?"other":(e=navigator.platform)!=null&&e.toLowerCase().includes("mac")?"mac":"other"}function aR(e){return e.code==="KeyC"||e.key.toLowerCase()==="c"}function ma(e){if(typeof document>"u")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t),t.select();let n=!1;try{n=document.execCommand("copy")}finally{document.body.removeChild(t)}return n}function lR(e,t=oR()){return!aR(e)||e.altKey?!1:t==="mac"?e.metaKey&&!e.ctrlKey&&!e.shiftKey:e.ctrlKey&&e.shiftKey&&!e.metaKey}async function Gc(e,t=typeof navigator>"u"?void 0:navigator.clipboard,n=ma){return Qd(e.getSelection(),t,n)}async function Qd(e,t=typeof navigator>"u"?void 0:navigator.clipboard,n=ma){if(!e)return!1;if(t!=null&&t.writeText)try{return await t.writeText(e),!0}catch(s){try{if(n(e))return!0}catch{}throw s}return n(e)}const ep='Menlo, Monaco, Consolas, "Liberation Mono", "DejaVu Sans Mono", "PingFang SC", "Microsoft YaHei", "Noto Sans Mono CJK SC", monospace',cR=[{id:"",label:"System default"},{id:"SF Mono",label:"SF Mono"},{id:"JetBrains Mono",label:"JetBrains Mono"},{id:"Fira Code",label:"Fira Code"},{id:"Cascadia Code",label:"Cascadia Code"},{id:"Source Code Pro",label:"Source Code Pro"},{id:"IBM Plex Mono",label:"IBM Plex Mono"}];function tp(e){const t=e.trim();return t?`${t.startsWith('"')?t:`"${t}"`}, ${ep}`:ep}const dR=3e3;function uR(e,t,n,s=dR){return!(n||e-t=n}function gR(e){const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),s=t%60;return`${n}m${s}s`}function Jm(e){let t="";const n=[];for(let s=0;s=128&&i<=159?n.push(i):t+=e[s]}return{cleaned:t,dropped:n}}function kr(e){switch(e){case"view":case"control":case"full":return e;default:return"full"}}function Il(e,t){return e==="attached"&&kr(t)!=="view"}function mR(e){return!e.hasSelection||!e.isDriver?!1:Il(e.status,e.permission)}function _R(e,t,n,s,i=window.innerWidth,a=window.innerHeight){return{left:Math.min(Math.max(e,8),Math.max(8,i-n-8)),top:Math.min(Math.max(t,8),Math.max(8,a-s-8))}}function sp(e){const{cleaned:t}=Jm(e);if(!t)return null;const n=t.replace(/\r\n?|\n/g,"\r").replace(/\r+$/,"");return n?n+"\r":null}const Xc=new Set,ca={emit(e,t){const n={id:crypto.randomUUID(),file:e,name:t||"clipboard-image"};for(const s of Xc)try{s(n)}catch(i){Lt("paste","image bus handler threw",{error:Rt(i)})}},on(e){return Xc.add(e),()=>{Xc.delete(e)}}};function yR(){var t;if(typeof navigator>"u")return"other";const e=((t=navigator.platform)==null?void 0:t.toLowerCase())??"";return e.includes("mac")?"mac":e.includes("linux")?"linux":"other"}function bR(e,t=yR()){return t!=="mac"&&t!=="linux"||!e.ctrlKey||e.metaKey||e.shiftKey||e.altKey?!1:e.code==="KeyV"||e.key.toLowerCase()==="v"}const wR={"clipboard has no text or image":"terminal.clipboardEmpty","clipboard image too large":"terminal.clipboardImageTooLarge","install xclip, wl-paste, or xsel to paste images":"terminal.clipboardImageToolsMissing"};function SR(e,t){const n=atob(e),s=Uint8Array.from(n,i=>i.charCodeAt(0));return new Blob([s],{type:t})}async function ip(e){if(!Il(e.status,e.remotePermission))return{ok:!1,reasonKey:"terminal.pasteSessionNotWritable"};const t=await(e.getPayload?e.getPayload():KS());if(t.kind==="text"&&t.text)return e.term.paste(t.text),{ok:!0,kind:"text"};if(t.kind==="image"&&t.content_type&&t.data_base64){if(kr(e.remotePermission)==="control")return{ok:!1,reasonKey:"terminal.imagePasteRequiresFull"};const n=SR(t.data_base64,t.content_type),s=t.filename||"clipboard-image";return ca.emit(n,s),await e.conn.sendPasteImage(n,s),{ok:!0,kind:"image"}}if(t.reason){const n=wR[t.reason];return n?{ok:!1,reasonKey:n}:{ok:!1,reason:t.reason}}return{ok:!1,reasonKey:"terminal.clipboardEmpty"}}const Jc=new Set,Zd={emit(e,t){const n={id:crypto.randomUUID(),name:e||"file",size:t};for(const s of Jc)try{s(n)}catch(i){Lt("paste","file bus handler threw",{error:Rt(i)})}},on(e){return Jc.add(e),()=>{Jc.delete(e)}}},CR=/^[A-Za-z0-9_@%+=:,./-]+$/;function kR(e){return e===""?"''":CR.test(e)?e:"'"+e.replace(/'/g,"'\\''")+"'"}const xR=10*1024*1024;async function RR(e){const t=e.maxBytes??xR,n=e.items.find(d=>d.kind==="file"&&d.type.startsWith("image/")),s=n??e.items.find(d=>d.kind==="file");if(!s)return"skipped";const i=s.getAsFile();if(!i)return"skipped";if(i.size>t)return Lt("paste","pasted file too large",{name:i.name,bytes:i.size}),"skipped";if(e.isLocalSession){const d=await e.getLocalPaths();if(d.length>0)return e.paste(d.map(kR).join(" ")),"path-injected"}if(n&&s===n)return await e.conn.sendPasteImage(i,i.name||"clipboard-image"),"image-sent";const a=i.name||"file";return e.onFileToast(a,i.size),await e.conn.sendPasteFile(i,a),"file-sent"}function TR(){return window.go.main.App.GetPasteboardFileURLs()}function PR(){return window.go.main.App.ReceivedFilesClearAll()}function ER(e){return window.go.main.App.ReceivedFilesClearSession(e)}function LR(e,t){return window.go.main.App.ReceivedFilesDelete(e,t)}function DR(){return window.go.main.App.ReceivedFilesList()}function MR(){return window.go.main.App.ReceivedFilesOpenDir()}function AR(e){return window.go.main.App.TranslateOpenAIChat(e)}function $l(){var e;return typeof navigator>"u"?!1:((e=navigator.platform)==null?void 0:e.toLowerCase().includes("mac"))??!1}function Xu(){return $l()?"Meta":"Control"}const IR="\x1B[I",$R="\x1B[O";function OR(e){return{handle(t){t===$R||t===IR||e.send(t)},dispose(){}}}function FR(e){return e.type!=="keydown"?!1:e.key==="Control"||e.key==="Meta"||e.key==="Alt"||e.key==="Shift"}function BR(e){e.attachCustomKeyEventHandler(t=>!FR(t))}const rp=/\b(https?|file):\/\/[^\s\x00-\x1f]+/g,op=/(^|[\s(){}\[\]<>"'`])(~\/|\/)([^\s\x00-\x1f]*)/g,HR=new Set([".",",",";",":","!","?",'"',"'"]);function ap(e){let t=e.length;for(;t>0;){const n=e[t-1];if(HR.has(n)){t--;continue}if(n===")"||n==="]"){const s=n===")"?"(":"[",i=lp(e.slice(0,t-1),s),a=lp(e.slice(0,t-1),n);if(i<=a){t--;continue}}break}return e.slice(0,t)}function lp(e,t){let n=0;for(let s=0;sdo.start)||t.push({start:d,end:r,text:a,kind:"path"})}return t.sort((s,i)=>s.start-i.start),t}function cp(e,t){let n="";const s=[];let i=0;for(let a=0;aNR)return!1}return!0}function zR(e,t){const n=e.text;return e.kind==="http"||e.kind==="file"?n:n.startsWith("~/")||n==="~/"?t?`file://${t.replace(/\/+$/,"")}${n.slice(1)}`:null:`file://${n}`}function UR(e,t,n,s){let i="";const a=[],d=[];let r=0;for(let o=0;o0&&!c.isWrapped)break;r=o+1;for(let p=0;p[p.startCell,p.endCell]);let d=t;for(let p=0;pyl)||c.push({match:p,row:t,startCell:y,endCell:v})}u=m}}return[...i,...c].sort((p,u)=>p.startCell-u.startCell)}function VR(e,t,n,s){const i=[],a=Math.max(0,t-s+1);for(let d=a;d<=t;d++){const r=e.getLine(d);if(!r||r.isWrapped)continue;const o=cp(r,n),c=/\((https?|file):\/\//g;let p;for(;(p=c.exec(o.text))!==null;){const u=p.index+1,g=dp(o.text,u),m=o.text.slice(u,g);if(!up(m))for(const y of KR(o.text,p.index)){const v=[{row:d,mapped:o,start:u,end:g}];let l=m,h=!1;for(let k=d+1;k0&&!/\s/.test(M.text[y-1]))break;const w=dp(M.text,y),T=M.text.slice(y,w);if(v.push({row:k,mapped:M,start:y,end:w}),l+=T,up(l)){h=!0;break}}if(!h)continue;const f=Ju(l).find(k=>k.start===0);if(!f||f.kind==="path"||f.end>=l.length)continue;const _=l.length-f.end,S=v[v.length-1];S.end-=_;for(const k of v)k.row!==t||k.end<=k.start||i.push({match:{...f,start:0,end:f.text.length},row:k.row,startCell:k.mapped.cellStart[k.start],endCell:k.mapped.cellStart[k.end]});break}}}return i}function dp(e,t){let n=t;for(;nn.start===0);return!!t&&t.end=0;a--)if(/\s/.test(e[a])){if(s++,s>=2){n=a+2;break}}else s=0,n=a;const i=[t];for(let a=t-1;a>=n;a--)!/\s/.test(e[a])&&(a===n||/\s/.test(e[a-1]))&&i.push(a);return i}const WR=50;function jR(e){const{term:t,isMac:n,openLink:s,onError:i}=e;let a=null;const d=p=>{a={x:p.clientX,y:p.clientY}},r=t.element;r==null||r.addEventListener("mousedown",d);const o={provideLinks(p,u){const g=t.buffer.active,m=Zm(g,p-1,t.cols,WR);if(m.length===0){u(void 0);return}u(m.map(y=>qR(y.match,y.row+1,y.startCell+1,y.endCell,t,n,()=>a,s,i)))}};let c={dispose(){}};try{c=t.registerLinkProvider(o)}catch(p){Lt("term-link","registerLinkProvider failed",{error:Rt(p)})}return{dispose(){r==null||r.removeEventListener("mousedown",d),c.dispose()}}}function qR(e,t,n,s,i,a,d,r,o){return{range:{start:{x:n,y:t},end:{x:s,y:t}},text:e.text,decorations:{underline:!0,pointerCursor:!0},activate:async c=>{if(Qm(c,d())){c.preventDefault(),c.stopPropagation(),c.stopImmediatePropagation(),i.clearSelection();try{await r(e)}catch(p){Lt("term-link","openLink failed",{error:Rt(p)}),o("terminal.link.openFailed")}}}}}const hp=new WeakSet;function e_(e){var i,a,d,r;const t=(r=(d=(a=(i=e._core)==null?void 0:i._renderService)==null?void 0:a.dimensions)==null?void 0:d.css)==null?void 0:r.cell;if(t&&typeof t.width=="number"&&typeof t.height=="number"&&t.width>0&&t.height>0)return{width:t.width,height:t.height};hp.has(e)||(hp.add(e),Lt("term","terminalCellCoords: xterm renderer dimensions unavailable, using fontSize estimate. xterm internal API may have changed."));const n=e.options.fontSize??15,s=e.options.lineHeight??1;return{width:n*.6,height:n*s}}function Qc(e,t,n,s,i=e_){const a=s.getBoundingClientRect();if(e=a.right||t=a.bottom)return null;const{width:d,height:r}=i(n);if(d<=0||r<=0)return null;const o=e-a.left,c=t-a.top+(s.scrollTop??0),p=Math.floor(o/d),u=Math.floor(c/r);return{col:p,row:u}}function YR(e,t){if(t<0)return{start:0,len:0};if(t>=e.length)return{start:e.length,len:0};const n=e[t];if(Qu(n))return{start:t,len:0};const s=GR(n);let i=t;for(;i>0&&fp(e[i-1])===(s?"alnum":"punct");)i--;let a=t+1;for(;a?@[\\]^`{|}~".split(""));function GR(e){return!(Qu(e)||t_.has(e))}function fp(e){return Qu(e)?"ws":t_.has(e)?"punct":"alnum"}async function XR(e,t,n){const s=[];for(const i of e)try{const a=i.getMenuItems(t,n);s.push(...a)}catch(a){Ks("plugin","context-menu getMenuItems threw",{error:Rt(a)})}return s}const JR={id:"file-explorer",slot:"right-panel",titleKey:"plugins.fileExplorer.title",descriptionKey:"plugins.fileExplorer.description",load:()=>co(()=>import("./FileExplorer-BumK3wPT.js").then(e=>e.d),__vite__mapDeps([0,1,2])),defaultEnabled:!1};function QR(e){return/[一-鿿]/.test(e)}function ZR(e,t){return QR(e)&&t==="zh-CN"?"en":t}class Bs extends Error{constructor(t,n,s,i){super(n),this.code=t,this.httpStatus=s,this.providerBody=i,this.name="TranslateError"}}const eT=5,Zu=Fu("translatePanel",()=>{const e=H(!1),t=H(""),n=H("zh-CN"),s=H(!1),i=H(null),a=H(null),d=H([]),r=ig(null);let o=null;function c(l){r.value=l}function p(){e.value=!1}async function u(l){if(!r.value){e.value=!0,i.value={code:"unknown",message:on("plugins.translate.notConfigured")};return}e.value=!0,t.value=l,n.value=ZR(l,r.value.defaultTargetLang),y()}async function g(l){n.value=l,await y()}async function m(){await y()}async function y(){if(!r.value)return;i.value=null,a.value=null,s.value=!0,o==null||o.abort();const l=new AbortController;o=l;try{const h=await r.value.provider.translate(t.value,n.value,{signal:l.signal});if(l.signal.aborted)return;a.value=h,d.value=[{source:t.value,target:n.value,translated:h.translated,detectedSrcLang:h.detectedSrcLang,at:Date.now()},...d.value].slice(0,eT)}catch(h){if(h instanceof Bs&&h.code==="aborted")return;const f=h instanceof Bs?h.code:"unknown",_=h instanceof Error?h.message:String(h);i.value={code:f,message:_}}finally{o===l&&(s.value=!1)}}function v(l){t.value=l.source,n.value=l.target,a.value={translated:l.translated,detectedSrcLang:l.detectedSrcLang},i.value=null,e.value=!0}return{visible:e,source:t,targetLang:n,loading:s,error:i,result:a,history:d,configure:c,openWithSource:u,changeTarget:g,close:p,retry:m,restoreFromHistory:v}}),tT={getMenuItems(e,t){return!t||!t.trim()?[]:[{id:"translate-selection",label:on("plugins.translate.selection"),onClick:()=>{Zu().openWithSource(t)}}]}},nT={id:"translate",slot:"context-menu",titleKey:"plugins.translate.title",descriptionKey:"plugins.translate.description",load:async()=>({default:tT}),defaultEnabled:!1},sT={getMenuItems:()=>[]},iT={id:"desk-widget",slot:"companion-window",titleKey:"plugins.deskWidget.title",descriptionKey:"plugins.deskWidget.description",load:async()=>({default:sT}),defaultEnabled:!1,desktopOnly:!0},n_=[JR,nT,iT];function s_(e){return n_.filter(t=>t.slot===e)}let pp=null;const Fr=Fu("pluginConfig",()=>{const e=H(null);async function t(){const a=hn();if(!a.pluginHost)throw new Error("plugin host unavailable");e.value=await a.pluginHost.getPluginConfig(),pp||(pp=a.events.on("plugin-config-changed",d=>{e.value=d}))}async function n(a){const d=hn();if(!d.pluginHost)throw new Error("plugin host unavailable");await d.pluginHost.setPluginConfig(a),e.value=a}function s(a){var d;return e.value?a==="file-explorer"?e.value.fileExplorer.enabled:a==="translate"?e.value.translate.enabled:a==="desk-widget"?((d=e.value.widget)==null?void 0:d.enabled)??!1:!1:!1}async function i(a,d){if(!e.value)return;const r=JSON.parse(JSON.stringify(e.value));a==="file-explorer"&&(r.fileExplorer.enabled=d),a==="translate"&&(r.translate.enabled=d),a==="desk-widget"&&r.widget&&(r.widget.enabled=d),await n(r)}return{cfg:e,load:t,save:n,isPluginEnabled:s,setEnabled:i}}),rT=[{id:"aux-up",label:"↑",seq:"\x1B[A"},{id:"aux-down",label:"↓",seq:"\x1B[B"},{id:"aux-left",label:"←",seq:"\x1B[D"},{id:"aux-right",label:"→",seq:"\x1B[C"},{id:"aux-enter",label:"enter",seq:"\r"},{id:"aux-esc",label:"esc",seq:"\x1B"},{id:"aux-tab",label:"tab",seq:" "},{id:"aux-ctrl-c",label:"⌃C",seq:""},{id:"aux-ctrl-d",label:"⌃D",seq:""}];async function oT(e){const t=await e.load();return t.length>0?t:rT}const aT=300,vl=[];let eh=!1;function lT(){try{const e=window.localStorage.getItem("atterm.debugTouch");return e==="1"||e==="true"}catch{return!1}}function cT(e){eh=e}function Ja(){return eh}function _n(e,t={}){if(!eh)return;const n={t:Date.now(),tag:e,data:t};vl.push(n),vl.length>aT&&vl.shift();try{Js("touch-scroll",e,{data:JSON.stringify(t)})}catch{}}function dT(){try{window.__attermTouchDebug=()=>vl.slice()}catch{}}const uT=Object.freeze([{id:"default-yes",label:"yes",text:"yes"},{id:"default-ok",label:"ok",text:"ok"},{id:"default-continue",label:"continue",text:"continue"},{id:"default-commit",label:"commit",text:"commit"},{id:"default-push",label:"push",text:"push"},{id:"default-release",label:"release",text:"release"},{id:"default-1",label:"1",text:"1"},{id:"default-2",label:"2",text:"2"},{id:"default-3",label:"3",text:"3"}]);async function i_(e){const t=await e.load();return t.length>0?t:uT}function hT(e){if(!e)return null;const t=e.split("+").map(d=>d.trim()).filter(Boolean);if(t.length<2)return null;let n=!1,s=!1,i=!1,a="";for(const d of t){const r=d.toLowerCase();r==="mod"||r==="cmd"||r==="meta"||r==="ctrl"||r==="control"?n=!0:r==="alt"||r==="option"?s=!0:r==="shift"?i=!0:a=d.toLowerCase()}return a?{mod:n,alt:s,shift:i,key:a}:null}function fT(e,t){const n=$l()?e.metaKey:e.ctrlKey;return t.mod!==n||t.alt!==e.altKey||t.shift!==e.shiftKey?!1:e.key.toLowerCase()===t.key}function pT(e){const{send:t,confirmRequired:n,focused:s,templatesBridge:i}=e,a=H([]),d=H(!1),r=H(null),o=q(()=>r.value!==null);function c(l){t(l.text),window.setTimeout(()=>t("\r"),16)}function p(l){if(!n.value){c(l);return}r.value=l}function u(){r.value=null}function g(){const l=r.value;r.value=null,l&&c(l)}function m(l){if(s())for(const h of a.value){const f=hT(h.hotkey||"");if(f&&fT(l,f)){l.preventDefault(),l.stopPropagation(),c(h);return}}}function y(l){const h=l.currentTarget;if(!h)return;const f=l.deltaY!==0?l.deltaY:l.deltaX;f!==0&&(h.scrollLeft+=f)}async function v(){const[l,h]=await Promise.all([i_(i),i.loadHidden()]);a.value=l,d.value=h}return{templates:a,templatesHidden:d,pendingTemplateConfirm:r,templateConfirmOpen:o,sendTemplate:c,requestTemplateSend:p,cancelTemplateSend:u,confirmTemplateSend:g,onTemplateHotkey:m,onTemplateBarWheel:y,reload:v}}const gl=H(new Set);function vT(){return gl}function vp(e,t){if(!e)return;const n=gl.value.has(e);if(t===n)return;const s=new Set(gl.value);t?s.add(e):s.delete(e),gl.value=s}const r_=Fu("fileReveal",()=>{const e=H(null);function t(s){e.value=s}function n(){const s=e.value;return e.value=null,s}return{pending:e,request:t,consume:n}}),gT=["aria-label","aria-expanded","aria-activedescendant","disabled"],mT={class:"trigger-label"},_T={key:0,class:"menu","data-testid":"select-menu",role:"listbox"},yT=["id","aria-selected","onClick","onMouseenter"],bT={class:"option-label"},wT={key:0,class:"option-description"},ST=Ae({__name:"SelectDropdown",props:{modelValue:{},options:{},disabled:{type:Boolean},ariaLabel:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=`select-dropdown-${Math.random().toString(36).slice(2,10)}`;function s(_){return`${n}-opt-${_}`}const i=e,a=t,d=H(!1),r=H(null),o=H(-1),c=q(()=>{const _=i.options.find(S=>S.value===i.modelValue);return _?_.label:""});function p(){return i.options.findIndex(_=>_.value===i.modelValue)}function u(){if(i.disabled)return;d.value=!0;const _=p();o.value=_>=0?_:0}function g(){d.value=!1,o.value=-1}function m(_){g(),_.value!==i.modelValue&&a("update:modelValue",_.value)}function y(_){if(i.options.length===0)return;const S=i.options.length,k=o.value<0?p():o.value,P=k<0?0:k;o.value=(P+_+S)%S}function v(){if(o.value<0)return;const _=i.options[o.value];_&&m(_)}function l(){i.disabled||(d.value?g():u())}function h(_){if(!i.disabled){if(_.key==="Escape"){d.value&&(_.preventDefault(),g());return}if(_.key==="ArrowDown"){_.preventDefault(),d.value?y(1):u();return}if(_.key==="ArrowUp"){_.preventDefault(),d.value?y(-1):u();return}if(_.key==="Home"&&d.value){_.preventDefault(),o.value=0;return}if(_.key==="End"&&d.value){_.preventDefault(),o.value=i.options.length-1;return}if(_.key==="Enter"&&d.value){_.preventDefault(),v();return}}}function f(_){if(!d.value)return;const S=_.target;r.value&&S&&r.value.contains(S)||g()}return _t(d,_=>{_?document.addEventListener("mousedown",f):document.removeEventListener("mousedown",f)}),Vt(()=>{document.removeEventListener("mousedown",f)}),(_,S)=>($(),F("div",{ref_key:"rootRef",ref:r,class:"select-dropdown"},[b("button",{type:"button",class:lt(["trigger",{"trigger-open":d.value}]),"data-testid":"select-trigger","aria-label":_.ariaLabel,"aria-haspopup":"listbox","aria-expanded":d.value?"true":"false","aria-activedescendant":d.value&&o.value>=0?s(o.value):void 0,disabled:_.disabled,onClick:l,onKeydown:h},[b("span",mT,L(c.value),1)],42,gT),d.value?($(),F("ul",_T,[($(!0),F(Ie,null,at(_.options,(k,P)=>($(),F("li",{id:s(P),key:k.value,class:lt(["option",{"option-highlight":P===o.value,"option-selected":k.value===_.modelValue}]),"data-testid":"select-option",role:"option","aria-selected":k.value===_.modelValue?"true":"false",onClick:M=>m(k),onMouseenter:M=>o.value=P},[b("span",bT,L(k.label),1),k.description?($(),F("span",wT,L(k.description),1)):Z("",!0)],42,yT))),128))])):Z("",!0)],512))}}),ns=Ct(ST,[["__scopeId","data-v-65a81c06"]]),CT={class:"sp-seg"},kT=["title"],xT={key:0,class:"sp-actions"},RT=["title","aria-label"],TT=["title","aria-label"],PT=["title","aria-label"],ET={key:1,class:"sp-menu",role:"menu"},LT=["onClick"],DT={class:"sp-lbl"},MT=["title","onClick"],AT=["title","onClick"],IT=["title","onClick"],$T=Ae({__name:"ServicePreviewSwitcher",props:{previews:{},activeId:{}},emits:["show-terminal","select","close","add","open-browser","copy"],setup(e,{emit:t}){const n=e,s=t,{t:i}=$t(),a=H(!1),d=H(null),r=q(()=>n.previews.find(y=>y.id===n.activeId)??null),o=q(()=>n.activeId!==null&&r.value!==null);function c(){a.value=!a.value}function p(){a.value=!1}function u(y){s("select",y),p()}function g(){p(),s("add")}function m(y){var v,l;a.value&&!((l=(v=y.target)==null?void 0:v.closest)!=null&&l.call(v,".sp-switcher"))&&p()}return Dt(()=>document.addEventListener("click",m,!0)),Vt(()=>document.removeEventListener("click",m,!0)),(y,v)=>{var l,h,f,_,S;return $(),F("div",{ref_key:"rootRef",ref:d,class:"sp-switcher"},[b("div",CT,[b("button",{type:"button",class:lt({active:!o.value}),onClick:v[0]||(v[0]=k=>s("show-terminal"))},L(C(i)("terminal.preview.terminal")),3),b("button",{type:"button",class:lt(["sp-current",{active:o.value,reconnecting:(l=r.value)==null?void 0:l.reconnecting}]),title:(h=r.value)!=null&&h.reconnecting?C(i)("terminal.preview.reconnecting"):C(i)("terminal.preview.switch"),onClick:c},[b("span",{class:lt(["sp-dot",{reconnecting:(f=r.value)==null?void 0:f.reconnecting}])},null,2),ot(" "+L(C(i)("terminal.preview.previewPort",{port:((_=r.value)==null?void 0:_.port)??((S=y.previews[0])==null?void 0:S.port)??""}))+" ",1),v[4]||(v[4]=b("span",{class:"sp-caret"},"▾",-1))],10,kT)]),o.value?($(),F("div",xT,[b("button",{type:"button",title:C(i)("terminal.preview.openInBrowser"),"aria-label":C(i)("terminal.preview.openInBrowser"),onClick:v[1]||(v[1]=k=>s("open-browser"))},v[5]||(v[5]=[b("span",{class:"sp-ico"},[b("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[b("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),b("path",{d:"M8 12h8M12 8l4 4-4 4"})])],-1)]),8,RT),b("button",{type:"button",title:C(i)("terminal.preview.copyURL"),"aria-label":C(i)("terminal.preview.copyURL"),onClick:v[2]||(v[2]=k=>s("copy"))},v[6]||(v[6]=[b("span",{class:"sp-ico"},[b("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[b("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),b("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})])],-1)]),8,TT),b("button",{type:"button",class:"close",title:C(i)("terminal.preview.closeThis"),"aria-label":C(i)("terminal.preview.closeThis"),onClick:v[3]||(v[3]=k=>r.value&&s("close",r.value.id))},"✕",8,PT)])):Z("",!0),a.value?($(),F("div",ET,[($(!0),F(Ie,null,at(y.previews,k=>($(),F("button",{key:k.id,type:"button",class:lt(["sp-item",{active:k.id===y.activeId}]),onClick:P=>u(k.id)},[b("span",{class:lt(["sp-dot",{reconnecting:k.reconnecting}])},null,2),b("span",DT,L(C(i)("terminal.preview.previewPort",{port:k.port})),1),b("span",{class:"sp-mini",title:C(i)("terminal.preview.openInBrowser"),onClick:dt(P=>{u(k.id),s("open-browser")},["stop"])},v[7]||(v[7]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[b("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),b("path",{d:"M8 12h8M12 8l4 4-4 4"})],-1)]),8,MT),b("span",{class:"sp-mini",title:C(i)("terminal.preview.copyURL"),onClick:dt(P=>{u(k.id),s("copy")},["stop"])},v[8]||(v[8]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[b("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),b("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})],-1)]),8,AT),b("span",{class:"sp-x",title:C(i)("terminal.preview.closeThis"),onClick:dt(P=>s("close",k.id),["stop"])},"✕",8,IT)],10,LT))),128)),v[9]||(v[9]=b("div",{class:"sp-sep"},null,-1)),b("button",{type:"button",class:"sp-item sp-add",onClick:g},"+ "+L(C(i)("terminal.preview.newPreview")),1)])):Z("",!0)],512)}}}),OT=Ct($T,[["__scopeId","data-v-c9d59669"]]),FT=["aria-label"],BT=["disabled"],HT=["disabled"],NT=["aria-label"],zT=Ae({__name:"TerminalSelectionPopover",props:{visible:{type:Boolean},x:{},y:{},arrowDir:{},copying:{type:Boolean},sending:{type:Boolean}},emits:["copy","send","cancel"],setup(e){const t=e,{t:n}=$t(),s=q(()=>{const i=`left: ${t.x}px;`;return t.arrowDir==="down"?`${i} bottom: ${t.y}px;`:`${i} top: ${t.y}px;`});return(i,a)=>i.visible?($(),F("div",{key:0,class:lt(["popover",[`arrow-${i.arrowDir}`]]),style:tn(s.value),"data-testid":"selection-popover",role:"group","aria-label":C(n)("mobile.selection.copy")+" / "+C(n)("mobile.selection.send"),onPointerdown:a[3]||(a[3]=dt(()=>{},["stop"])),onPointerup:a[4]||(a[4]=dt(()=>{},["stop"])),onClick:a[5]||(a[5]=dt(()=>{},["stop"]))},[b("button",{type:"button",class:"btn",disabled:i.copying,"data-testid":"selection-popover-copy",onClick:a[0]||(a[0]=d=>i.$emit("copy"))},L(C(n)("mobile.selection.copy")),9,BT),b("button",{type:"button",class:"btn send",disabled:i.sending,"data-testid":"selection-popover-send",onClick:a[1]||(a[1]=d=>i.$emit("send"))},L(C(n)("mobile.selection.send")),9,HT),b("button",{type:"button",class:"btn cancel","aria-label":C(n)("mobile.selection.cancel"),"data-testid":"selection-popover-cancel",onClick:a[2]||(a[2]=d=>i.$emit("cancel"))},"x",8,NT)],46,FT)):Z("",!0)}}),UT=Ct(zT,[["__scopeId","data-v-063a4cb7"]]),VT={key:0,class:"term-search","data-test":"terminal-search"},KT=["placeholder"],WT={class:"term-search-count","data-test":"terminal-search-count"},jT=["title","aria-label","disabled"],qT=["title","aria-label","disabled"],YT=["title","aria-label"],GT=Ae({__name:"TerminalSearchBar",props:{open:{type:Boolean},focusSeq:{},resultIndex:{},resultCount:{}},emits:["find","close"],setup(e,{emit:t}){const n=e,s=t,{t:i}=$t(),a=H(""),d=H(null);function r(){un(()=>{var g,m;(g=d.value)==null||g.focus(),(m=d.value)==null||m.select()})}function o(){a.value&&s("find",a.value,"next",!0)}_t(()=>n.open,g=>{g&&(r(),o())}),_t(()=>n.focusSeq,()=>{n.open&&(r(),o())});function c(){s("find",a.value,"next",!0)}function p(g){s("find",a.value,g,!1)}function u(g){if(g.key==="Escape"){g.preventDefault(),s("close");return}g.key==="Enter"&&(g.preventDefault(),p(g.shiftKey?"prev":"next"))}return(g,m)=>g.open?($(),F("div",VT,[rt(b("input",{ref_key:"inputEl",ref:d,"onUpdate:modelValue":m[0]||(m[0]=y=>a.value=y),class:"term-search-input","data-test":"terminal-search-input",type:"text",spellcheck:"false",autocomplete:"off",placeholder:C(i)("terminal.search.placeholder"),onInput:c,onKeydown:u},null,40,KT),[[Tt,a.value]]),b("span",WT,L(g.resultCount>0?g.resultIndex>=0?`${g.resultIndex+1}/${g.resultCount}`:`${g.resultCount}+`:a.value?C(i)("terminal.search.noResults"):""),1),b("button",{class:"term-search-btn","data-test":"terminal-search-prev",title:C(i)("terminal.search.prev"),"aria-label":C(i)("terminal.search.prev"),disabled:g.resultCount===0,onClick:m[1]||(m[1]=y=>p("prev"))},"↑",8,jT),b("button",{class:"term-search-btn","data-test":"terminal-search-next",title:C(i)("terminal.search.next"),"aria-label":C(i)("terminal.search.next"),disabled:g.resultCount===0,onClick:m[2]||(m[2]=y=>p("next"))},"↓",8,qT),b("button",{class:"term-search-btn","data-test":"terminal-search-close",title:C(i)("terminal.search.close"),"aria-label":C(i)("terminal.search.close"),onClick:m[3]||(m[3]=y=>s("close"))},"×",8,YT)])):Z("",!0)}}),XT=Ct(GT,[["__scopeId","data-v-302a13f7"]]),JT=["src","title"],QT={key:0,class:"service-preview-reconnecting",role:"status"},ZT={class:"service-preview-controls"},e5={class:"service-preview-mapping-row root-mapping"},t5=["aria-label","onKeydown"],n5=["onUpdate:modelValue","aria-label"],s5=["onUpdate:modelValue","aria-label"],i5=["title","aria-label","onClick"],r5={class:"service-preview-form-actions"},o5=["disabled"],a5=["disabled"],l5={class:"progress-track","aria-hidden":"true"},c5={key:1},d5={key:2,class:"warn"},u5={key:3,class:"dim"},h5={key:4,class:"bad"},f5={key:3,class:"viewer-overlay","aria-live":"polite"},p5={class:"viewer-overlay-card"},v5={class:"viewer-overlay-title"},g5={key:0,class:"viewer-overlay-host"},m5={class:"viewer-overlay-hint"},_5=["disabled"],y5=["disabled"],b5=["disabled"],w5=["disabled"],S5=["disabled","onClick"],C5=["data-testid","title","onTouchend","onClick"],k5=["title"],x5=["data-testid","disabled","onTouchend","onPointerup"],R5=["disabled"],T5=["disabled"],P5=["disabled"],E5={class:"template-confirm-copy"},L5={class:"template-confirm-label"},D5={class:"template-confirm-text"},M5=["placeholder"],A5=["disabled"],I5=500,gp=8,mp=4,_p=24,$5=3,O5=60,F5=800,B5=500,yp=800,H5=350,N5=900,Ui=10,z5=150,U5=150,V5=Ae({__name:"TerminalView",props:{endpoint:{},sessionId:{},active:{type:Boolean,default:!0},focused:{type:Boolean,default:!1},avoidTopRightBadge:{type:Boolean,default:!1},sessionLabel:{},expectedCols:{},expectedRows:{},remotePermission:{},theme:{},commandNotifyThresholdSec:{default:10},isLocalSession:{type:Boolean,default:!0},canDetach:{type:Boolean},resizeSuspended:{type:Boolean,default:!1},searchRequestSeq:{default:0},appearance:{default:()=>({fontHead:"",fontSize:13,lineHeight:1,cursorStyle:"block",cursorBlink:!0,scrollback:5e3})}},emits:["toast","detach"],setup(e,{emit:t}){const n=e,s=t,{t:i}=$t(),a=H(null),d=H("connecting"),r=H(null),o=H(!1),c=H(0),p=H(0),u=H(!1),g=H(!1),m=H(null),y=H(null),v=H(null),l=H(!1),h=H(""),f=H(n.isLocalSession??!0),_=H(null),S=H(null),k=H(null),P=H(null),M=H(""),w=H(""),T=H([]),A=H(!1),E=H(!1),R=H(!1),D=q(()=>E.value||R.value),I=q(()=>!D.value),O=H("idle"),U=H({visible:!1,x:0,y:0,arrowDir:"down",copying:!1,sending:!1}),W=hn(),N=W.system.setClipboardText?{writeText:X=>W.system.setClipboardText(X)}:void 0,z=r_(),V=H(!1),j=H([]),G=H(null),te=q(()=>G.value!==null),oe=q(()=>j.value.find(X=>X.id===G.value)??null);let re=null;_t(()=>j.value.length>0,X=>vp(n.sessionId,X));const ye=H(!1),K=H("3000"),J=H([]),Q=H("127.0.0.1"),de=[{value:"127.0.0.1",label:"127.0.0.1 (IPv4)"},{value:"localhost",label:"localhost"},{value:"::1",label:"::1 (IPv6)"}],De=H(null),Pe=q(()=>`#service-preview-controls-${n.sessionId}`),Ye=q(()=>`atterm.service-preview.${n.sessionId}`);function st(){var X;try{const ne=localStorage.getItem(Ye.value);if(!ne)return;const Ne=JSON.parse(ne);typeof Ne.port=="string"&&(K.value=Ne.port),(Ne.host==="localhost"||Ne.host==="127.0.0.1"||Ne.host==="::1")&&(Q.value=Ne.host),((X=W.servicePreview)==null?void 0:X.supportsMappings)!==!1&&Array.isArray(Ne.mappings)&&(J.value=Ne.mappings.filter(vt=>typeof vt.port=="string"&&typeof vt.pathPrefix=="string").slice(0,7).map(vt=>({port:vt.port,pathPrefix:vt.pathPrefix})))}catch{}}function yt(){try{localStorage.setItem(Ye.value,JSON.stringify({port:K.value,host:Q.value,mappings:J.value}))}catch{}}let ce=null,ae=null,be=null,he=null;const Le=H(!1),et=H(0),je=H(-1),_e=H(0);let ie=null,we=null,Ee=!0,x=null;const Re=rR(),Xe=Ut("atterm:pluginInputSenders",null),Ue=Ut("atterm:pluginSessionConnections",null),xt=Ut("atterm:pluginContext",null),Ze=H([]),wt=H(null);let tt=null,gt=null,se="",ge=null,Oe=null,Ke=null,Be=null,me=null,Fe=null,fe=null,nt=null,At=0,St=0,xe=0,qe=-1/0,ht=0,Et=0,jt=[],Kt=[],Yt=null,nn=!1;function rn(){var X,ne;return{selMode:O.value,imeFocused:E.value,softKeyboardOpen:D.value,softKeyboardOpening:R.value,keyboardWanted:A.value,userScrolledDuringKeyboardCycle:nn,scrollTop:(Be==null?void 0:Be.scrollTop)??null,scrollHeight:(Be==null?void 0:Be.scrollHeight)??null,clientHeight:(Be==null?void 0:Be.clientHeight)??null,activeEl:((X=document.activeElement)==null?void 0:X.className)||((ne=document.activeElement)==null?void 0:ne.tagName)||null}}const Mn=[80,180,360,700],xn=[60,180,360];let Xt=null,Gt=null;function Qt(){return Ee&&ce!==null&&a.value!==null}const an=q(()=>Il(d.value,n.remotePermission)),Ot=q(()=>mR({hasSelection:u.value,status:d.value,permission:n.remotePermission,isDriver:f.value})),jn=q(()=>d.value==="attached"&&f.value&&!n.resizeSuspended&&kr(n.remotePermission)!=="view"),is=q(()=>!W.caps.wailsBindings&&!W.caps.localPty&&T.value.length>0),An=q(()=>f.value&&Il(d.value,n.remotePermission)),Pn=q(()=>An.value&&kr(n.remotePermission)==="full"),Rn=q(()=>!!(W.servicePreview&&!n.isLocalSession&&f.value&&d.value==="attached"&&kr(n.remotePermission)==="full")),In=q(()=>{var X;return((X=W.servicePreview)==null?void 0:X.supportsMappings)!==!1}),ke=q(()=>te.value?0:(Dh.value?0:1)+(is.value?1:0)),Qe=q(()=>`${ke.value*30}px`),ft=q(()=>is.value?"30px":"0");function It(){f.value&&(ce==null||ce.focus())}function ln(X){X.reconnectTimer!==null&&(window.clearTimeout(X.reconnectTimer),X.reconnectTimer=null),X.reconnecting=!1}async function Nt(X,ne){var We;const Ne=(We=W.servicePreview)==null?void 0:We.rebind;if(!Ne)return;const vt=[500,1e3,2e3,4e3,8e3],Pt=j.value.find(pt=>pt.id===X);if(Pt){Pt.reconnecting=!0;for(let pt=0;;pt++){const it=j.value.find(Wt=>Wt.id===X);if(!Ee||!it||ne<0||ne>=it.ports.length){it&&ln(it);return}if(!ie||!Rn.value){await En(X);return}try{const Wt=await ie.openService(it.ports[ne],it.host);if(!Ee||!j.value.includes(it)){ie.closeService(Wt.serviceId),ln(it);return}await Ne({gatewayId:X,mappingIndex:ne,serviceId:Wt.serviceId,clientTicket:Wt.clientTicket,clientToHostKey:Wt.clientToHostKey,hostToClientKey:Wt.hostToClientKey}),it.serviceIds[ne]=Wt.serviceId,ln(it);return}catch(Wt){const rs=Rt(Wt);if(rs.includes("preview_gone")||rs.includes("relay is not connected")){await En(X);return}const qs=vt[Math.min(pt,vt.length-1)];await new Promise(Ur=>{it.reconnectTimer=window.setTimeout(Ur,qs)})}}}}async function En(X){var vt,Pt;const ne=j.value.findIndex(We=>We.id===X);if(ne<0)return;const[Ne]=j.value.splice(ne,1);ln(Ne),G.value===X&&(G.value=((vt=j.value[0])==null?void 0:vt.id)??null);for(const We of Ne.serviceIds)ie==null||ie.closeService(We);try{await((Pt=W.servicePreview)==null?void 0:Pt.stop(Ne.id))}catch(We){Js("service-preview","stop failed",{error:Rt(We)})}await un(),te.value||ii()}async function qn(){const X=j.value.slice();for(const ne of X)await En(ne.id)}function Ln(){if(!V.value){if(!W.servicePreview){s("toast",i("terminal.preview.desktopOnly"));return}if(d.value!=="attached"){s("toast",i("terminal.preview.requiresConnection"));return}if(!f.value){s("toast",i("terminal.preview.requiresDriver"));return}if(kr(n.remotePermission)!=="full"){s("toast",i("terminal.preview.requiresFullPermission"));return}n.isLocalSession||(ye.value=!0,un(()=>{var X,ne;(X=De.value)==null||X.focus(),(ne=De.value)==null||ne.select()}))}}function Ts(X,ne){const Ne=X.trim();if(ne)return Ne===""||Ne==="/"?"":null;if(!Ne.startsWith("/")||Ne.includes("?")||Ne.includes("#"))return null;const vt=Ne.replace(/\/+$/,""),Pt=vt.split("/");return vt===""||Pt.slice(1).some(We=>We===""||We==="."||We==="..")?null:vt}function Ws(){ye.value=!1,It()}function ei(X){(X==="localhost"||X==="127.0.0.1"||X==="::1")&&(Q.value=X)}async function ti(){if(!Rn.value||!ie||!W.servicePreview||V.value)return;const X=[{port:K.value.trim(),pathPrefix:""},...J.value.map(pt=>({port:pt.port.trim(),pathPrefix:pt.pathPrefix.trim()}))],ne=X.map(pt=>Number(pt.port));if(ne.some(pt=>!Number.isInteger(pt)||pt<1||pt>65535)){s("toast",i("terminal.preview.invalidPort")),un(()=>{var pt;return(pt=De.value)==null?void 0:pt.select()});return}const Ne=X.map((pt,it)=>Ts(pt.pathPrefix,it===0));if(Ne.some(pt=>pt===null)||new Set(Ne).size!==Ne.length){s("toast",i("terminal.preview.invalidPathPrefix"));return}const vt=Ne;J.value.forEach((pt,it)=>{pt.pathPrefix=vt[it+1]});const Pt=j.value.find(pt=>pt.port===ne[0]&&pt.host===Q.value);if(Pt){G.value=Pt.id,ye.value=!1;return}V.value=!0;const We=[];try{for(const it of ne){const Wt=await ie.openService(it,Q.value);if(We.push(Wt),!Ee||!Rn.value)throw ie.closeService(Wt.serviceId),new Error(i("terminal.preview.noLongerAllowed"))}const pt=await W.servicePreview.start({mappings:We.map((it,Wt)=>({serviceId:it.serviceId,clientTicket:it.clientTicket,clientToHostKey:it.clientToHostKey,hostToClientKey:it.hostToClientKey,port:ne[Wt],pathPrefix:vt[Wt]||void 0}))});if(yt(),!Ee||!Rn.value){for(const it of We)ie.closeService(it.serviceId);throw await W.servicePreview.stop(pt.id),new Error(i("terminal.preview.noLongerAllowed"))}j.value.push({id:pt.id,url:pt.url,port:ne[0],serviceIds:We.map(it=>it.serviceId),ports:ne,prefixes:vt,host:Q.value,reconnecting:!1,reconnectTimer:null}),G.value=pt.id,ye.value=!1}catch(pt){for(const it of We)ie==null||ie.closeService(it.serviceId);s("toast",i("terminal.preview.openFailed",{error:Rt(pt)}))}finally{V.value=!1}}function Ps(X){j.value.some(ne=>ne.id===X)&&(G.value=X)}function gi(){G.value=null,un(()=>ii())}async function mi(){var ne;const X=(ne=oe.value)==null?void 0:ne.url;if(X)try{await W.system.openExternalURL(X)}catch(Ne){Lt("service-preview","open external browser failed",{error:Rt(Ne)}),s("toast",i("terminal.preview.browserOpenFailed"))}}async function Ii(){var ne;const X=(ne=oe.value)==null?void 0:ne.url;if(X)try{if(!await Qd(X,N))throw new Error("clipboard unavailable");s("toast",i("terminal.preview.urlCopied"))}catch(Ne){Lt("service-preview","copy preview URL failed",{error:Rt(Ne)}),s("toast",i("terminal.preview.copyFailed"))}}function $i(){(W.caps.wailsBindings||W.caps.localPty||A.value)&&It()}function Oi(){ce&&(ce.options.disableStdin=!f.value),Ke&&(Ke.readOnly=!f.value,Ke.tabIndex=f.value?0:-1,f.value||(us(),R.value=!1,A.value=!1,document.activeElement===Ke&&(Ke.blur(),ce==null||ce.blur())))}function _i(){const X=ce==null?void 0:ce.buffer.active;return X?{viewportY:X.viewportY,atBottom:X.viewportY>=X.baseY}:null}function Br(X){if(_n("applyScrollPosition:entry",{scrollPosition:X,...rn()}),!!X&&!(!ce||!Ee)){if(nn){_n("applyScrollPosition:bailUserScrolled");return}X.atBottom?(_n("applyScrollPosition:scrollToBottom"),ce.scrollToBottom()):(_n("applyScrollPosition:scrollToLine",{line:X.viewportY}),ce.scrollToLine(X.viewportY))}}function dr(){_n("onViewportUserScrollIntent",{...rn()}),nn=!0,yi(),Yt=null}function ur(X){var ne;_n("onTermTouchMoveForRestoreCancel",{touches:X.touches.length,y:(ne=X.touches[0])==null?void 0:ne.pageY,...rn()}),dr()}function yi(){for(const X of Kt)window.clearTimeout(X);Kt=[]}function us(){for(const X of jt)window.clearTimeout(X);jt=[]}function hr(){Br(Yt)}function Hr(X){if(!X)return;yi(),Yt=X;const ne=Mn[Mn.length-1];requestAnimationFrame(()=>{requestAnimationFrame(()=>{hr()})});for(const Ne of Mn)Kt.push(window.setTimeout(()=>{hr(),Ne===ne&&(Yt=null,Kt=[])},Ne))}function hs(){var ne,Ne;const X=_i();us(),R.value=!1,A.value=!1,Ke==null||Ke.blur(),ce==null||ce.blur(),(Ne=(ne=W.system).hideSoftKeyboard)==null||Ne.call(ne),nn=!1,Hr(X)}function bi(){if(_n("scrollToBottomForKeyboardOpen:entry",{...rn()}),!!ce){if(nn){_n("scrollToBottomForKeyboardOpen:bailUserScrolled");return}ce.scrollToBottom(),Hr({viewportY:ce.buffer.active.baseY,atBottom:!0})}}function ni(){f.value&&(nn=!1,A.value=!0,si(),bi(),It())}function si(){us(),R.value=!0;for(const X of xn)jt.push(window.setTimeout(()=>{A.value&&(E.value||It(),bi())},X));jt.push(window.setTimeout(()=>{R.value=!1,E.value||(A.value=!1),jt=[]},N5))}function bn(){xe=Date.now()}function _s(X){if(!Gt)return 0;const ne=X.clientX-Gt.startX,Ne=X.clientY-Gt.startY;return ne*ne+Ne*Ne}function ys(X){bn();const ne=X.touches[0];Gt=ne?{startX:ne.clientX,startY:ne.clientY,cancelled:!1,scrollTarget:null,startScrollLeft:0}:null}function Es(X){if(ys(X),!Gt)return;const ne=X.currentTarget instanceof Element?X.currentTarget.closest(".aux-key-scroll"):null;ne instanceof HTMLElement&&(Gt.scrollTarget=ne,Gt.startScrollLeft=ne.scrollLeft)}function Hn(X){if(!Gt)return;const ne=X.touches[0];if(!ne)return;const Ne=Gt.scrollTarget;Ne&&(Ne.scrollLeft=Gt.startScrollLeft+Gt.startX-ne.clientX),_s(ne)>Ui*Ui&&(Gt.cancelled=!0)}function Yn(){Gt=null}function Do(X){const ne=X.changedTouches[0],Ne=Gt!==null&&!Gt.cancelled&&(!ne||_s(ne)<=Ui*Ui);return Gt=null,Ne}function fs(X,ne){bn(),Do(X)&&(X.preventDefault(),ht=Date.now()+yp,ne())}function bs(X){Date.now()Ui*Ui&&(Xt.cancelled=!0)}function Fi(X){X&&X.stopPropagation(),Xt=null}function le(X){!Xt||Xt.pointerId!==X.pointerId||Fi(X)}function pe(X){if(!Xt||Xt.pointerId!==X.pointerId)return!1;if(X.preventDefault(),X.stopPropagation(),Date.now()-Etpt.kind==="file"))return;X.preventDefault(),X.stopPropagation();const vt=ce,Pt=ie;if(!(!vt||!Pt))try{await RR({items:ne,isLocalSession:n.isLocalSession??!0,conn:{sendPasteImage:(pt,it)=>(ca.emit(pt,it),Pt.sendPasteImage(pt,it)),sendPasteFile:(pt,it)=>Pt.sendPasteFile(pt,it)},paste:pt=>vt.paste(pt),getLocalPaths:async()=>{try{return await TR()??[]}catch(pt){return Lt("term","GetPasteboardFileURLs failed",{error:Rt(pt)}),[]}},onFileToast:(pt,it)=>Zd.emit(pt,it)})}catch(pt){Lt("term","paste dispatch failed",{error:Rt(pt)})}}function Nn(X){if(W.caps.wailsBindings||W.caps.localPty||X.inputType!=="insertText"||X.isComposing)return;const ne=X.data;if(!ne||!An.value)return;X.stopImmediatePropagation(),ie==null||ie.sendInput(ne);const Ne=X.target;Ne&&"value"in Ne&&(Ne.value="")}function Io(X){if(_n("onImeFocus",{keyboardWanted:A.value,isDriver:f.value}),E.value=!0,f.value){A.value&&bi();return}const ne=X.target;ne==null||ne.blur(),ce==null||ce.blur()}function $o(){if(_n("onImeBlur",{keyboardWanted:A.value}),E.value=!1,A.value&&Mo()){si();return}A.value&&R.value||(A.value=!1)}function zr(X){return!(W.caps.wailsBindings||W.caps.localPty||X.pointerType==="mouse")}function Cc(X){return W.caps.wailsBindings||W.caps.localPty?!1:X.touches.length>0}function Ma(X){return!(W.caps.wailsBindings||W.caps.localPty||!D.value||X.pointerType==="mouse")}function kc(X){var vt,Pt;_n("onTermPointerDown:entry",{pointerType:X.pointerType,y:X.clientY,target:((vt=X.target)==null?void 0:vt.className)||((Pt=X.target)==null?void 0:Pt.tagName)||null,...rn()});const ne=Ma(X),Ne=zr(X);if(_n("onTermPointerDown:decision",{shouldHideKeyboard:ne,shouldBlockFocus:Ne}),(ne||Ne)&&(St=Date.now()),E.value&&Ke&&document.activeElement===Ke){ne&&(X.preventDefault(),X.stopPropagation(),hs(),Fo(X));return}if(ne){X.preventDefault(),X.stopPropagation(),hs(),Fo(X);return}Ne&&(X.preventDefault(),X.stopPropagation()),Fo(X)}function Aa(X){var ne,Ne,vt;if(_n("onTermTouchStart:entry",{touches:X.touches.length,y:(ne=X.touches[0])==null?void 0:ne.pageY,target:((Ne=X.target)==null?void 0:Ne.className)||((vt=X.target)==null?void 0:vt.tagName)||null,...rn()}),!Cc(X)){_n("onTermTouchStart:earlyReturn:!shouldBlockTerminalTouchFocus");return}if(St=Date.now(),!D.value){_n("onTermTouchStart:earlyReturn:!softKeyboardOpen");return}_n("onTermTouchStart:hideKeyboardBranch",{...rn()}),X.preventDefault(),hs()}function xc(X){X.button===0&&(ge={x:X.clientX,y:X.clientY}),!(W.caps.wailsBindings||W.caps.localPty)&&(Date.now()-St>F5||(X.preventDefault(),X.stopPropagation()))}function Oo(X){X.stopPropagation()}function Ls(){me&&(clearTimeout(me),me=null)}function Rc(X){var vt,Pt;if(Be&&document.contains(Be))return Be;const ne=X==null?void 0:X.target;return Be=((vt=ne==null?void 0:ne.closest)==null?void 0:vt.call(ne,".xterm-viewport"))??((Pt=a.value)==null?void 0:Pt.querySelector(".xterm-viewport"))??null,Be}function ws(){if(ce){try{ce.clearSelection()}catch{}Oi()}Be&&(Be.style.touchAction="pan-y"),U.value.visible=!1,O.value="idle",Ls(),Fe=null,fe=null,gr()}function Tc(X){if(!ce||!Be)return null;const{width:ne,height:Ne}=e_(ce);if(!ne||!Ne)return null;const vt=Be.getBoundingClientRect(),Pt=Be.scrollTop??0,We=vt.left+X.start.x*ne,pt=vt.top+X.start.y*Ne-Pt,it=X.start.y===X.end.y?(X.end.x-X.start.x)*ne:vt.width,Wt=(X.end.y-X.start.y+1)*Ne;return{x:We,y:pt,width:it,height:Wt}}function Ia(){var Pt;if(!ce)return;const X=(Pt=ce.getSelectionPosition)==null?void 0:Pt.call(ce);if(!X){U.value.visible=!1;return}const ne=Tc(X);if(!ne){U.value.visible=!1;return}const vt=ne.y-6-28>=8;U.value.arrowDir=vt?"down":"up",U.value.x=ne.x+ne.width/2,U.value.y=vt?window.innerHeight-ne.y+6:ne.y+ne.height+6,U.value.visible=!0}function Fo(X){if(_n("onSelectionPointerDown:entry",{pointerType:X.pointerType,isPrimary:X.isPrimary,y:X.clientY,...rn()}),!An.value||!ce){_n("onSelectionPointerDown:earlyReturn");return}(O.value==="selecting"||O.value==="dragging")&&ws();const ne=Rc(X);ne&&(Fe={x:X.clientX,y:X.clientY},O.value="pressing",Ls(),me=setTimeout(()=>{var We;if(me=null,O.value!=="pressing"||!Fe||!ce)return;const Ne=Qc(Fe.x,Fe.y,ce,ne);if(!Ne){O.value="idle";return}let vt="";try{vt=((We=ce.buffer.active.getLine(Ne.row))==null?void 0:We.translateToString(!0))??""}catch{vt=""}const Pt=YR(vt,Ne.col);if(Pt.len===0){O.value="idle";return}try{ce.select(Pt.start,Ne.row,Pt.len)}catch{O.value="idle";return}ce.options.disableStdin=!0,ne.style.touchAction="none",O.value="selecting",fe={start:Pt.start,end:Pt.start+Pt.len-1,row:Ne.row},Ia()},I5))}function Bi(X){if(Ja()&&O.value!=="idle"&&_n("onSelectionPointerMove",{selMode:O.value,y:X.clientY}),O.value==="pressing"&&Fe){const pt=X.clientX-Fe.x,it=X.clientY-Fe.y;pt*pt+it*it>gp*gp&&(Ls(),O.value="idle",Fe=null);return}if(O.value!=="selecting"&&O.value!=="dragging"||!ce||!Be||!fe||!Fe)return;if(O.value==="selecting"){const pt=X.clientX-Fe.x,it=X.clientY-Fe.y;if(pt*pt+it*it{try{ce==null||ce.scrollLines(X*$5)}catch{}},O5))}function gr(){nt&&(clearInterval(nt),nt=null),At=0}function Ba(X){var vt,Pt;if(Na(X)&&hs(),Ah.value){const We=X.target;(vt=We==null?void 0:We.closest)!=null&&vt.call(We,".template-confirm-panel, .template-bar")||Ac()}if(O.value==="idle")return;const ne=X.target,Ne=Be??((Pt=a.value)==null?void 0:Pt.querySelector(".xterm-viewport"));ne&&(Ne!=null&&Ne.contains(ne))||ne&&typeof ne.closest=="function"&&ne.closest('[data-testid="selection-popover"]')||ws()}function Ha(X){return X instanceof Element?!!X.closest(".template-bar, .aux-key-bar, .template-confirm-panel, .paste-confirm-panel"):!1}function Na(X){return W.caps.wailsBindings||W.caps.localPty||!D.value||X.pointerType==="mouse"?!1:!Ha(X.target)}async function Ec(){if(!ce||U.value.copying){ws();return}U.value.copying=!0;let X=!1;try{X=await Gc(ce,N)}catch(ne){Lt("term","selection copy failed",{error:Rt(ne)})}finally{U.value.copying=!1}s("toast",i(X?"mobile.selection.copied":"mobile.selection.copyFailed")),ws()}function Lc(){if(!ce||!ie||U.value.sending){ws();return}U.value.sending=!0;try{const X=sp(ce.getSelection());X&&ie.sendInput(X)}finally{U.value.sending=!1,ws()}}function Qn(){o.value=!1,Ze.value=[],wt.value=null}async function Bo(X){if(!ce)return;const ne=_R(X.clientX,X.clientY,z5,U5,window.innerWidth,window.innerHeight),Ne=ce.getSelection();if(u.value=!!Ne,c.value=ne.left,p.value=ne.top,Ze.value=[],wt.value=No(X),o.value=!0,xt){const vt=Fr(),Pt=[];for(const We of s_("context-menu"))if(vt.isPluginEnabled(We.id))try{const pt=await We.load();Pt.push(pt.default)}catch(pt){Ks("term","failed to load context-menu plugin",{plugin:We.id,error:Rt(pt)})}Ze.value=await XR(Pt,xt,Ne)}}function mr(X){var Ne;if(!o.value)return;const ne=X.target;ne instanceof Node&&((Ne=m.value)!=null&&Ne.contains(ne))||Qn()}function Ho(X){X.key==="Escape"&&Qn()}function Dc(){const X=ce==null?void 0:ce.element;return(X==null?void 0:X.querySelector(".xterm-rows"))??(X==null?void 0:X.querySelector(".xterm-screen"))??a.value}function No(X){var We;if(!ce)return null;const ne=Dc();if(!ne)return null;const Ne=Qc(X.clientX,X.clientY,ce,ne);if(!Ne)return null;const vt=ce.buffer.active.viewportY+Ne.row;return((We=Zm(ce.buffer.active,vt,ce.cols,50).find(pt=>Ne.col>=pt.startCell&&Ne.col0&&ne>0&&(ce.cols!==X||ce.rows!==ne)&&ce.resize(X,ne)}function _r(){if(!ce||!a.value)return;const X=a.value.getBoundingClientRect();if(!(X.width<2||X.height<2)){js();try{ce.refresh(0,ce.rows-1)}catch{}}}function za(){if(Qn(),!ce||!ie)return;const X=sp(ce.getSelection());X!==null&&ie.sendInput(X)}function Ua(){Qn(),ce&&ce.clear()}function Va(){Qn(),!(!ce||!ie||!jn.value)&&(ie.sendResize(ce.cols,ce.rows),P.value={cols:ce.cols,rows:ce.rows},S.value=ce.cols,k.value=ce.rows)}function ii(){if(!f.value||!ae||!a.value)return;const X=a.value.getBoundingClientRect();if(!(X.width<2||X.height<2)){try{ae.fit()}catch{}if(ce&&a.value){const ne=a.value.getBoundingClientRect();ce.rows{ce===ne&&ne.scrollToBottom(),X==null||X()})}async function nb(){var We,pt;if(ce)return;ce=new Wm.Terminal({fontFamily:tp(n.appearance.fontHead),fontSize:n.appearance.fontSize,lineHeight:n.appearance.lineHeight,cursorStyle:n.appearance.cursorStyle,cursorBlink:n.appearance.cursorBlink,scrollback:n.appearance.scrollback,theme:n.theme,convertEol:!1,disableStdin:!f.value,allowProposedApi:!0}),he={fontHead:n.appearance.fontHead,fontSize:n.appearance.fontSize,lineHeight:n.appearance.lineHeight},ae=new qm.FitAddon,ce.loadAddon(ae),be=new W2.SearchAddon,ce.loadAddon(be),be.onDidChangeResults(({resultIndex:it,resultCount:Wt})=>{je.value=it,_e.value=Wt}),ce.open(a.value),BR(ce);let X=!0;try{X=await Cm()}catch{X=!1}if(!Qt())return;if(X)try{const it=new K2.WebglAddon;it.onContextLoss(()=>it.dispose()),ce.loadAddon(it)}catch(it){Lt("term","WebGL renderer unavailable, falling back to DOM",{error:Rt(it)})}const ne=a.value;Oe=ne,ne.addEventListener("keydown",zt,{capture:!0}),ne.addEventListener("keydown",On,{capture:!0}),document.addEventListener("keydown",ve,{capture:!0}),ne.addEventListener("paste",Jn,{capture:!0}),ne.addEventListener("pointermove",Bi),ne.addEventListener("pointerup",$a),ne.addEventListener("pointercancel",Oa),Be=((We=ce.element)==null?void 0:We.querySelector(".xterm-viewport"))??null;try{const it=ce._core,Wt=it==null?void 0:it._viewport;Wt&&(Wt.handleTouchStart=()=>{},Wt.handleTouchMove=()=>!0)}catch(it){Lt("term","disable xterm touch scroll failed",{error:Rt(it)})}if(cT(lT()),dT(),_n("ensureTerm:done",{debugEnabled:Ja(),hasViewport:!!Be,hasXterm:!!ce.element,xtermChildren:ce.element?Array.from(ce.element.children).map(it=>it.className):[],...rn()}),Ja()&&ce.element){const it=ce.element;it.addEventListener("touchstart",Wt=>{var qs;const rs=Wt;_n("observer:xterm.touchstart",{touches:rs.touches.length,y:(qs=rs.touches[0])==null?void 0:qs.pageY,defaultPrevented:rs.defaultPrevented})},{passive:!0,capture:!1}),it.addEventListener("touchmove",Wt=>{var Ur;const rs=Wt,qs=(Be==null?void 0:Be.scrollTop)??null;_n("observer:xterm.touchmove:before",{touches:rs.touches.length,y:(Ur=rs.touches[0])==null?void 0:Ur.pageY,scrollTopBefore:qs,defaultPrevented:rs.defaultPrevented}),queueMicrotask(()=>{const Uh=(Be==null?void 0:Be.scrollTop)??null;_n("observer:xterm.touchmove:after",{scrollTopAfter:Uh,diff:(Uh??0)-(qs??0)})})},{passive:!0,capture:!1}),it.addEventListener("touchend",()=>_n("observer:xterm.touchend"),{passive:!0}),it.addEventListener("touchcancel",()=>_n("observer:xterm.touchcancel"),{passive:!0})}Be==null||Be.addEventListener("touchmove",Oo,{passive:!0}),Be==null||Be.addEventListener("scroll",Fa),Ja()&&Be&&Be.addEventListener("scroll",()=>{_n("viewport.scroll",{scrollTop:Be==null?void 0:Be.scrollTop,selMode:O.value})},{passive:!0}),Be==null||Be.addEventListener("wheel",dr,{passive:!0}),ne.addEventListener("touchmove",ur,{passive:!0}),Ke=((pt=ce.element)==null?void 0:pt.querySelector("textarea"))??null,Oi(),Ke==null||Ke.addEventListener("input",Nn,{capture:!0}),Ke==null||Ke.addEventListener("focus",Io),Ke==null||Ke.addEventListener("blur",$o),ii(),x=OR({send:it=>ie==null?void 0:ie.sendInput(it)});let Ne=!1;ce.attachCustomKeyEventHandler(it=>(it.type==="keydown"&&(Ne=!0),!0)),ce.onData(it=>{const Wt=Ne;if(Ne=!1,!Re.shouldForward(Wt))return;const{cleaned:rs,dropped:qs}=Jm(it);qs.length>0&&Lt("term","dropped C1 control chars from terminal input",{droppedCodepoints:qs.map(Ur=>"U+"+Ur.toString(16).toUpperCase().padStart(4,"0")).join(","),originalLength:it.length,cleanedLength:rs.length}),rs&&(x==null||x.handle(rs))}),ce.onResize(({cols:it,rows:Wt})=>{f.value&&(n.resizeSuspended||(ie==null||ie.sendResize(it,Wt),P.value={cols:it,rows:Wt},S.value=it,k.value=Wt))});let vt=0;ce.onBell(()=>{const it=typeof document<"u"&&document.hasFocus();uR(Date.now(),vt,it)&&(vt=Date.now(),Af("AT Term",i("terminal.bellNotification",{session:n.sessionLabel||"session"}),{session_id:n.sessionId,kind:"bell"}))});const Pt=new fR;try{ce.parser.registerOscHandler(133,it=>{const Wt=Pt.onOsc133(it,Date.now());if(!Wt)return!1;const rs=typeof document<"u"&&document.hasFocus();return vR(Wt,{focused:rs,thresholdSec:n.commandNotifyThresholdSec??10,isLocal:n.isLocalSession??!0})&&(Af("AT Term",i("terminal.commandFinishedNotification",{exitCode:Wt.exitCode,elapsed:gR(Wt.elapsedMs),session:n.sessionLabel||"session"}),{session_id:n.sessionId,kind:"command_finished"}),TS(n.sessionId,Wt.exitCode,Wt.elapsedMs,n.sessionLabel||"session")),!1})}catch(it){Lt("term","OSC 133 handler registration failed",{error:Rt(it)})}try{se=await zu()}catch{se=""}Qt()&&(gt=jR({term:ce,isMac:$l(),openLink:it=>ue(it),onError:it=>s("toast",i(it))}),tt=new ResizeObserver(()=>{ii(),hr()}),tt.observe(a.value))}const sb={matchBackground:"#3a3f4b",matchBorder:"#5a6272",matchOverviewRuler:"#5a6272",activeMatchBackground:"#d19a66",activeMatchBorder:"#d19a66",activeMatchColorOverviewRuler:"#d19a66"};function ib(X,ne,Ne){if(!be)return;if(!X){be.clearDecorations(),je.value=-1,_e.value=0;return}const vt={incremental:Ne,decorations:sb};ne==="next"?be.findNext(X,vt):be.findPrevious(X,vt)}function rb(){Le.value=!1,be==null||be.clearDecorations(),je.value=-1,_e.value=0,It()}_t(()=>n.searchRequestSeq,()=>{n.focused&&(Le.value=!0,et.value++)});function Lh(){if(ce){if(ie){ie.attach();return}ie=Lu(new Qg(n.endpoint,n.sessionId,{onOutput:X=>ce==null?void 0:ce.write(X),onClose:X=>{ce==null||ce.write(`\r -\x1B[33m${i("terminal.sessionEndedBanner",{exitCode:X.exit_code})}\x1B[0m\r -`)},onStatus:X=>{d.value=X,X!=="attached"&&j.value.length&&qn()},onReplayProgress:X=>{r.value=X.phase==="end"?null:X,X.phase==="start"||X.phase==="chunk"?Re.onProgress(X.phase):Re.onProgress("end",ne=>Uo(ne))},onMeta:X=>{typeof(X==null?void 0:X.cols)=="number"&&(S.value=X.cols),typeof(X==null?void 0:X.rows)=="number"&&(k.value=X.rows),js()},onDriverChange:(X,ne,Ne)=>{const vt=f.value;f.value=ne,M.value=ne?"":Ne,Oi(),js(),ne&&(n.active||n.focused)&&un($i),!ne&&(n.active||n.focused)&&un(()=>{var Pt;return(Pt=_.value)==null?void 0:Pt.focus()}),!ne&&j.value.length&&qn(),vt!==ne&&s("toast",i(ne?"terminal.driverNow":"terminal.viewerNow"))}},{clientName:w.value,remote:!n.isLocalSession})),ie.attach(),Ue==null||Ue.set(n.sessionId,ie),we=X=>ie==null?void 0:ie.sendInput(X),Xe==null||Xe.set(n.sessionId,we),ce&&(n.expectedCols!==ce.cols||n.expectedRows!==ce.rows)&&(ie.sendResize(ce.cols,ce.rows),P.value={cols:ce.cols,rows:ce.rows})}}const{templates:ob,templatesHidden:Dh,pendingTemplateConfirm:Mh,templateConfirmOpen:Ah,requestTemplateSend:Ih,cancelTemplateSend:Ac,confirmTemplateSend:$h,onTemplateHotkey:Oh,onTemplateBarWheel:Ka,reload:ab}=pT({send:X=>ie==null?void 0:ie.sendInput(X),confirmRequired:q(()=>!(W.caps.wailsBindings||W.caps.localPty)),focused:()=>n.focused,templatesBridge:W.templates});function lb(X,ne){pe(ne)&&An.value&&(ie==null||ie.sendInput(X),A.value&&It())}function cb(X,ne){fs(ne,()=>{An.value&&(Et=Date.now(),ie==null||ie.sendInput(X),A.value&&It())})}async function Fh(){var X,ne;if(An.value){h.value="",l.value=!0;try{h.value=await(((ne=(X=navigator.clipboard)==null?void 0:X.readText)==null?void 0:ne.call(X))??Promise.resolve(""))}catch{h.value=""}}}function Ic(){l.value=!1,h.value=""}function Bh(){!An.value||!h.value||(ie==null||ie.sendInput(h.value),Ic())}function Hh(){var X;Pn.value&&(y.value&&(y.value.value=""),(X=y.value)==null||X.click())}async function db(X){var Pt;if(!Pn.value)return;const ne=X.currentTarget,Ne=(Pt=ne==null?void 0:ne.files)==null?void 0:Pt[0];if(!Ne)return;const vt=Ne.name||"file";try{await(ie==null?void 0:ie.sendPasteFile(Ne,vt)),Zd.emit(vt,Ne.size)}catch(We){Lt("term","failed to send picked file",{error:Rt(We)}),s("toast",(We==null?void 0:We.message)??i("terminal.pasteFailed"))}finally{ne&&(ne.value="")}}function Nh(){var X;if(Pn.value){if(W.caps.capacitor){hb();return}v.value&&(v.value.value=""),(X=v.value)==null||X.click()}}function ub(X,ne,Ne){const vt=atob(X),Pt=new Uint8Array(vt.length);for(let We=0;We{var X;if(st(),window.addEventListener("atterm:open-service-preview",zh),await nb(),!!Ee){try{const ne=await hm();ne!=null&&ne.host&&(w.value=ne.host)}catch{}Ee&&(n.active&&Lh(),Wa(),Vo=W.events.on("quickTemplates:changed",Wa),Ko=W.events.on("mobile:shortcutsChanged",Wa),Wo=W.events.on("prefs:changed",Wa),(X=W.servicePreview)!=null&&X.rebind&&(re=W.events.on("service-preview:pipe-dead",ne=>{const Ne=ne;!Ne||!Ne.gateway_id||!j.value.some(vt=>vt.id===Ne.gateway_id)||Nt(Ne.gateway_id,typeof Ne.mapping_index=="number"?Ne.mapping_index:0)})),document.addEventListener("mousedown",mr),document.addEventListener("pointerdown",Ba,{capture:!0}),document.addEventListener("keydown",Ho),document.addEventListener("keydown",Oh,!0),requestAnimationFrame(()=>{Ee&&(ii(),requestAnimationFrame(()=>{Ee&&_r()}))}))}}),Vt(()=>{Ee=!1,qn(),tt==null||tt.disconnect(),tt=null,us(),R.value=!1,yi(),Yt=null,Vo==null||Vo(),Vo=null,Ko==null||Ko(),Ko=null,Wo==null||Wo(),Wo=null,re==null||re(),re=null,vp(n.sessionId,!1),document.removeEventListener("mousedown",mr),document.removeEventListener("pointerdown",Ba,{capture:!0}),document.removeEventListener("keydown",Ho),document.removeEventListener("keydown",Oh,!0),window.removeEventListener("atterm:open-service-preview",zh),Oe==null||Oe.removeEventListener("keydown",zt,{capture:!0}),Oe==null||Oe.removeEventListener("keydown",On,{capture:!0}),document.removeEventListener("keydown",ve,{capture:!0}),Oe==null||Oe.removeEventListener("paste",Jn,{capture:!0}),Oe==null||Oe.removeEventListener("pointermove",Bi),Oe==null||Oe.removeEventListener("pointerup",$a),Oe==null||Oe.removeEventListener("pointercancel",Oa),Oe==null||Oe.removeEventListener("touchmove",ur),Oe=null,Be==null||Be.removeEventListener("touchmove",Oo),Be==null||Be.removeEventListener("scroll",Fa),Be==null||Be.removeEventListener("wheel",dr),Be=null,Ke==null||Ke.removeEventListener("input",Nn,{capture:!0}),Ke==null||Ke.removeEventListener("focus",Io),Ke==null||Ke.removeEventListener("blur",$o),Ke=null,(Xe==null?void 0:Xe.get(n.sessionId))===we&&(Xe==null||Xe.delete(n.sessionId)),we=null,(Ue==null?void 0:Ue.get(n.sessionId))===ie&&(Ue==null||Ue.delete(n.sessionId)),x==null||x.dispose(),x=null,ws(),gt==null||gt.dispose(),gt=null,ie==null||ie.detach(),ie=null;try{ce==null||ce.dispose()}catch(X){Js("term","xterm dispose race (safe to ignore)",{error:Rt(X)})}ce=null,ae=null}),_t(()=>n.active,X=>{X?(ie?ie.attach():Lh(),un(()=>{$i(),requestAnimationFrame(()=>{!Ee||!n.active||_r()})})):(ie==null||ie.suspend(),Qn())}),_t(()=>n.remotePermission,()=>{kr(n.remotePermission)!=="full"&&j.value.length&&qn()}),_t(()=>n.focused,X=>{X&&un(()=>{$i()})}),_t(()=>n.theme,X=>{ce&&(ce.options.theme=X)}),_t(()=>n.appearance,X=>zo(X)),_t(d,X=>{X!=="attached"&&Qn()}),_t(()=>n.resizeSuspended,(X,ne)=>{ne&&!X&&un(()=>{ce&&ie&&(ie.sendResize(ce.cols,ce.rows),P.value={cols:ce.cols,rows:ce.rows})})}),(X,ne)=>{var Ne,vt,Pt;return $(),F("div",{class:lt(["term-view",{focused:X.focused}])},[rt(b("div",{ref_key:"termContainer",ref:a,class:"term",style:tn({bottom:Qe.value}),onContextmenu:dt(Bo,["prevent"]),onMouseupCapture:$e,onTouchstartCapture:Aa,onPointerdownCapture:kc,onMousedownCapture:xc},null,36),[[Ss,!te.value]]),($(!0),F(Ie,null,at(j.value,We=>rt(($(),F("iframe",{key:We.id,class:"service-preview-frame",src:We.url,title:C(i)("terminal.preview.frameTitle",{port:We.port}),sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-downloads",allow:"clipboard-read; clipboard-write"},null,8,JT)),[[Ss,G.value===We.id]])),128)),(Ne=oe.value)!=null&&Ne.reconnecting?($(),F("div",QT,[ne[26]||(ne[26]=b("span",{class:"service-preview-reconnecting-spinner","aria-hidden":"true"},null,-1)),b("span",null,L(C(i)("terminal.preview.reconnecting")),1)])):Z("",!0),j.value.length||ye.value?($(),bt(wl,{key:1,to:Pe.value},[b("div",ZT,[j.value.length?($(),bt(OT,{key:0,previews:j.value,"active-id":G.value,onShowTerminal:gi,onSelect:Ps,onClose:En,onAdd:Ln,onOpenBrowser:mi,onCopy:Ii},null,8,["previews","active-id"])):Z("",!0),ye.value&&Rn.value?($(),F("form",{key:1,class:lt(["service-preview-port-form",{"as-popover":j.value.length>0}]),onSubmit:dt(ti,["prevent"])},[Te(ns,{class:"service-preview-host","model-value":Q.value,options:de,"aria-label":C(i)("terminal.preview.targetHost"),"onUpdate:modelValue":ei},null,8,["model-value","aria-label"]),b("div",e5,[rt(b("input",{ref_key:"previewPortInput",ref:De,"onUpdate:modelValue":ne[0]||(ne[0]=We=>K.value=We),"data-testid":"service-preview-port",type:"text",inputmode:"numeric",pattern:"[0-9]*","aria-label":C(i)("terminal.preview.portPrompt"),onKeydown:Xn(dt(Ws,["prevent","stop"]),["esc"])},null,40,t5),[[Tt,K.value]]),ne[27]||(ne[27]=b("span",{class:"service-preview-path"},"/",-1))]),($(!0),F(Ie,null,at(J.value,(We,pt)=>($(),F("div",{key:pt,class:"service-preview-mapping-row"},[rt(b("input",{"onUpdate:modelValue":it=>We.port=it,type:"text",inputmode:"numeric",pattern:"[0-9]*","aria-label":C(i)("terminal.preview.additionalPort")},null,8,n5),[[Tt,We.port]]),rt(b("input",{"onUpdate:modelValue":it=>We.pathPrefix=it,type:"text",placeholder:"/api","aria-label":C(i)("terminal.preview.pathPrefix")},null,8,s5),[[Tt,We.pathPrefix]]),b("button",{type:"button",class:"preview-action",title:C(i)("terminal.preview.removeMapping"),"aria-label":C(i)("terminal.preview.removeMapping"),onClick:it=>J.value.splice(pt,1)},"×",8,i5)]))),128)),b("div",r5,[In.value&&J.value.length<7?($(),F("button",{key:0,type:"button",class:"preview-add-mapping",onClick:ne[1]||(ne[1]=We=>J.value.push({port:"",pathPrefix:"/api"}))},"+ "+L(C(i)("terminal.preview.addMapping")),1)):Z("",!0),ne[28]||(ne[28]=b("span",{class:"service-preview-form-spacer"},null,-1)),b("button",{type:"submit",disabled:V.value},L(V.value?C(i)("terminal.preview.opening"):C(i)("terminal.preview.open")),9,o5),b("button",{type:"button",disabled:V.value,onClick:Ws},L(C(i)("common.cancel")),9,a5)])],34)):Z("",!0)])],8,["to"])):Z("",!0),Te(UT,{visible:U.value.visible,x:U.value.x,y:U.value.y,"arrow-dir":U.value.arrowDir,copying:U.value.copying,sending:U.value.sending,onCopy:Ec,onSend:Lc,onCancel:ws},null,8,["visible","x","y","arrow-dir","copying","sending"]),X.active&&(d.value!=="attached"||r.value)?($(),F("div",{key:2,class:lt(["overlay",{"avoid-top-right-badge":X.avoidTopRightBadge}])},[r.value?($(),F(Ie,{key:0},[b("span",null,L(C(iR)(r.value)),1),b("div",l5,[b("div",{class:"progress-fill",style:tn({width:`${C(Xm)(r.value)}%`})},null,4)])],64)):d.value==="connecting"?($(),F("span",c5,L(C(i)("terminal.connecting")),1)):d.value==="reconnecting"?($(),F("span",d5,L(C(i)("terminal.reconnecting")),1)):d.value==="ended"?($(),F("span",u5,L(C(i)("terminal.ended")),1)):d.value==="error"?($(),F("span",h5,L(C(i)("terminal.connectionError")),1)):Z("",!0)],2)):Z("",!0),Te(XT,{open:Le.value,"focus-seq":et.value,"result-index":je.value,"result-count":_e.value,onFind:ib,onClose:rb},null,8,["open","focus-seq","result-index","result-count"]),f.value?Z("",!0):($(),F("div",f5,[b("div",p5,[b("div",v5,L(C(i)("terminal.remoteHasTakenControl")),1),M.value?($(),F("div",g5,L(C(i)("terminal.byHost",{host:M.value})),1)):Z("",!0),b("div",m5,L(C(i)("terminal.pressSpaceToTakeBack")),1),b("button",{ref_key:"takeControlBtnRef",ref:_,class:"viewer-overlay-btn","data-testid":"take-control",onClick:Me},L(C(i)("terminal.takeControl")),513)])])),($(),bt(wl,{to:"body"},[o.value?($(),F("div",{key:0,ref_key:"menuRef",ref:m,class:"term-context-menu",style:tn({left:`${c.value}px`,top:`${p.value}px`}),onMousedown:ne[3]||(ne[3]=dt(()=>{},["stop"])),onClick:ne[4]||(ne[4]=dt(()=>{},["stop"]))},[wt.value?($(),F("button",{key:0,class:"term-context-item",onClick:Mc},L(C(i)("terminal.contextMenu.openLink")),1)):Z("",!0),wt.value?($(),F("button",{key:1,class:"term-context-item",onClick:Se},L(C(i)("terminal.contextMenu.copyLink")),1)):Z("",!0),b("button",{class:"term-context-item",disabled:!u.value,onClick:mt},L(C(i)("common.copy")),9,_5),b("button",{class:"term-context-item",disabled:!an.value||g.value,onClick:Bt},L(C(i)("common.paste")),9,y5),b("button",{class:"term-context-item",disabled:!Ot.value,onClick:za},L(C(i)("terminal.sendSelection")),9,b5),b("button",{class:"term-context-item",onClick:Ua},L(C(i)("terminal.clearBuffer")),1),b("button",{class:"term-context-item",disabled:!jn.value,onClick:Va},L(C(i)("terminal.resize")),9,w5),X.canDetach?($(),F("button",{key:2,class:"term-context-item","data-test":"term-detach",onClick:ne[2]||(ne[2]=We=>{s("detach"),Qn()})},L(C(i)("terminal.detachToTab")),1)):Z("",!0),($(!0),F(Ie,null,at(Ze.value,We=>($(),F("button",{key:We.id,class:"term-context-item",disabled:We.disabled,onClick:pt=>{We.onClick(),Qn()}},L(We.label),9,S5))),128))],36)):Z("",!0)])),!C(Dh)&&!te.value?($(),F("div",{key:4,class:"template-bar","data-testid":"template-bar",style:tn({bottom:ft.value}),onPointerdownCapture:bn,onWheelPassive:ne[5]||(ne[5]=(...We)=>C(Ka)&&C(Ka)(...We))},[($(!0),F(Ie,null,at(C(ob),We=>($(),F("button",{key:We.id,class:"template-btn","data-testid":`template-btn-${We.id}`,title:We.hotkey||"",tabindex:"-1",onTouchstart:ys,onTouchmove:Hn,onTouchcancel:Yn,onTouchend:pt=>fs(pt,()=>C(Ih)(We)),onPointerdown:bn,onClick:pt=>bs(()=>C(Ih)(We))},L(We.label),41,C5))),128))],36)):Z("",!0),is.value&&!te.value?($(),F("div",{key:5,class:"aux-key-bar","data-testid":"terminal-aux-key-bar",onPointerdownCapture:bn},[b("input",{ref_key:"filePicker",ref:y,class:"file-picker-input","data-testid":"terminal-file-input",type:"file",onChange:db},null,544),b("input",{ref_key:"imagePicker",ref:v,class:"file-picker-input","data-testid":"terminal-image-input",type:"file",accept:"image/*",onChange:fb},null,544),b("button",{type:"button",class:"aux-key-btn keyboard-toggle-btn","data-testid":"terminal-hide-keyboard",tabindex:"-1",title:I.value?"Show keyboard":"Hide keyboard",onTouchstart:dt(Es,["prevent","stop"]),onTouchmove:Hn,onTouchcancel:Yn,onTouchend:ne[6]||(ne[6]=dt(We=>fs(We,Nr),["stop"])),onPointerdown:dt(bn,["stop"]),onClick:ne[7]||(ne[7]=dt(We=>bs(Nr),["prevent","stop"]))},L(I.value?"打开键盘 ⌃":"折叠键盘 ⌄"),41,k5),b("div",{class:"aux-key-scroll","data-testid":"terminal-aux-key-scroll",onWheelPassive:ne[14]||(ne[14]=(...We)=>C(Ka)&&C(Ka)(...We))},[($(!0),F(Ie,null,at(T.value,We=>($(),F("button",{key:We.id,type:"button",class:"aux-key-btn","data-testid":`terminal-aux-key-${We.id}`,disabled:!An.value,tabindex:"-1",onTouchstart:dt(Es,["prevent"]),onTouchmove:Hn,onTouchcancel:Yn,onTouchend:pt=>cb(We.seq,pt),onPointerdown:Ao,onPointermove:vr,onPointercancel:le,onPointerup:pt=>lb(We.seq,pt)},L(We.label),41,x5))),128)),b("button",{type:"button",class:"aux-key-btn","data-testid":"terminal-pick-image",disabled:!Pn.value,onTouchstart:dt(Es,["prevent"]),onTouchmove:Hn,onTouchcancel:Yn,onTouchend:ne[8]||(ne[8]=We=>fs(We,Nh)),onPointerdown:bn,onClick:ne[9]||(ne[9]=We=>bs(Nh))},L(C(i)("terminal.pickImage")),41,R5),b("button",{type:"button",class:"aux-key-btn","data-testid":"terminal-paste-confirm-open",disabled:!An.value,onTouchstart:dt(Es,["prevent"]),onTouchmove:Hn,onTouchcancel:Yn,onTouchend:ne[10]||(ne[10]=We=>fs(We,Fh)),onPointerdown:bn,onClick:ne[11]||(ne[11]=We=>bs(Fh))},L(C(i)("mobile.pasteClipboard")),41,T5),b("button",{type:"button",class:"aux-key-btn","data-testid":"terminal-pick-file",disabled:!Pn.value,onTouchstart:dt(Es,["prevent"]),onTouchmove:Hn,onTouchcancel:Yn,onTouchend:ne[12]||(ne[12]=We=>fs(We,Hh)),onPointerdown:bn,onClick:ne[13]||(ne[13]=We=>bs(Hh))},L(C(i)("terminal.pickFile")),41,P5)],32)],32)):Z("",!0),C(Ah)?($(),F("div",{key:6,class:"template-confirm-panel","data-testid":"template-confirm-panel",onPointerdownCapture:bn,onClick:ne[19]||(ne[19]=dt(()=>{},["stop"]))},[b("div",E5,[b("div",L5,L((vt=C(Mh))==null?void 0:vt.label),1),b("div",D5,L((Pt=C(Mh))==null?void 0:Pt.text),1)]),b("button",{type:"button",class:"template-confirm-btn","data-testid":"template-confirm-cancel",tabindex:"-1",onTouchstart:ys,onTouchmove:Hn,onTouchcancel:Yn,onTouchend:ne[15]||(ne[15]=We=>fs(We,C(Ac))),onPointerdown:bn,onClick:ne[16]||(ne[16]=We=>bs(C(Ac)))},L(C(i)("common.cancel")),33),b("button",{type:"button",class:"template-confirm-btn primary","data-testid":"template-confirm-send",tabindex:"-1",onTouchstart:ys,onTouchmove:Hn,onTouchcancel:Yn,onTouchend:ne[17]||(ne[17]=We=>fs(We,C($h))),onPointerdown:bn,onClick:ne[18]||(ne[18]=We=>bs(C($h)))},"发送",32)],32)):Z("",!0),l.value?($(),F("div",{key:7,class:"paste-confirm-panel","data-testid":"terminal-paste-confirm-panel",onPointerdownCapture:bn,onClick:ne[25]||(ne[25]=dt(()=>{},["stop"]))},[rt(b("textarea",{"onUpdate:modelValue":ne[20]||(ne[20]=We=>h.value=We),class:"paste-confirm-input",placeholder:C(i)("mobile.pastePreview"),rows:"2"},null,8,M5),[[Tt,h.value]]),b("button",{type:"button",class:"paste-confirm-btn","data-testid":"terminal-paste-cancel",tabindex:"-1",onTouchstart:ys,onTouchmove:Hn,onTouchcancel:Yn,onTouchend:ne[21]||(ne[21]=We=>fs(We,Ic)),onPointerdown:bn,onClick:ne[22]||(ne[22]=We=>bs(Ic))},L(C(i)("common.cancel")),33),b("button",{type:"button",class:"paste-confirm-btn primary","data-testid":"terminal-paste-confirm",disabled:!An.value||!h.value,tabindex:"-1",onTouchstart:ys,onTouchmove:Hn,onTouchcancel:Yn,onTouchend:ne[23]||(ne[23]=We=>fs(We,Bh)),onPointerdown:bn,onClick:ne[24]||(ne[24]=We=>bs(Bh))},L(C(i)("mobile.pasteConfirm")),41,A5)],32)):Z("",!0)],2)}}}),K5=Ct(V5,[["__scopeId","data-v-c76cd1d6"]]),th={single:1,vertical:2,horizontal:2,grid2x2:4},W5=Object.freeze({sessionId:null,remote:!1}),bp=.1,wp=.9,Ds=.5;function Ol(e){return Number.isFinite(e)?ewp?wp:e:Ds}const xr=()=>({...W5});function Sp(e,t,n,s,i,a){if(e==="single")return{layout:s==="vertical"?"vertical":"horizontal",panes:[{...t[0]},xr()],activePaneIdx:1,newPaneIdx:1,colRatio:i,rowRatio:a};if(e==="vertical"){const r=n===0?2:3;return{layout:"grid2x2",panes:[{...t[0]},{...t[1]},xr(),xr()],activePaneIdx:r,newPaneIdx:r,colRatio:i,rowRatio:a}}if(e==="horizontal"){const r=n===0?1:3;return{layout:"grid2x2",panes:[{...t[0]},xr(),{...t[1]},xr()],activePaneIdx:r,newPaneIdx:r,colRatio:i,rowRatio:a}}const d=t.findIndex(r=>r.sessionId===null);return d===-1?{layout:"grid2x2",panes:t.map(r=>({...r})),activePaneIdx:n,newPaneIdx:-1,noop:!0,colRatio:i,rowRatio:a}:{layout:"grid2x2",panes:t.map(r=>({...r})),activePaneIdx:d,newPaneIdx:d,colRatio:i,rowRatio:a}}function j5(e,t,n,s,i){if(e==="single")return{layout:"single",panes:t.map(o=>({...o})),activePaneIdx:0,closeTab:!0,colRatio:s,rowRatio:i};if(e==="vertical"||e==="horizontal")return{layout:"single",panes:[{...t[n===0?1:0]}],activePaneIdx:0,colRatio:s,rowRatio:i};const a=t.map((o,c)=>c===n?xr():{...o}),d=a.map((o,c)=>o.sessionId!==null?c:-1).filter(o=>o>=0),r=d.length;return r>=3?{layout:"grid2x2",panes:a,activePaneIdx:d[0],colRatio:s,rowRatio:i}:r===2?q5(a,d,s,i):r===1?{layout:"single",panes:[{...a[d[0]]}],activePaneIdx:0,colRatio:s,rowRatio:i}:{layout:"single",panes:[xr()],activePaneIdx:0,closeTab:!0,colRatio:s,rowRatio:i}}function q5(e,t,n,s){const[i,a]=t;return{layout:i===0&&a===2||i===1&&a===3?"horizontal":"vertical",panes:[{...e[i]},{...e[a]}],activePaneIdx:0,colRatio:n,rowRatio:s}}const Y5={single:{0:{}},vertical:{0:{right:1},1:{left:0}},horizontal:{0:{down:1},1:{up:0}},grid2x2:{0:{right:1,down:2},1:{left:0,down:3},2:{up:0,right:3},3:{up:1,left:2}}};function G5(e,t,n){var i,a;const s=(a=(i=Y5[e])==null?void 0:i[t])==null?void 0:a[n];return typeof s=="number"?s:null}function wr(e,t){for(const n of e){const s=n.panes.findIndex(i=>i.sessionId===t);if(s>=0)return{tabId:n.id,paneIdx:s}}return null}const X5=["aria-orientation"],J5=Ae({__name:"PaneSplitter",props:{orientation:{},ratio:{},containerRect:{type:Function}},emits:["update:ratio","commit","reset"],setup(e,{emit:t}){const n=e,s=t,i=H(null);let a=null,d=0,r=0,o="";function c(y){if(y.button!==0)return;const v=i.value;if(v){a=y.pointerId,r=n.ratio,d=n.orientation==="col"?y.clientX:y.clientY;try{v.setPointerCapture(y.pointerId)}catch{}typeof document<"u"&&(o=document.body.style.cursor,document.body.style.cursor=n.orientation==="col"?"col-resize":"row-resize"),y.preventDefault()}}function p(y){if(a!==y.pointerId)return;const v=n.containerRect();if(!v)return;const l=n.orientation==="col"?v.width:v.height;if(l<=0)return;const f=((n.orientation==="col"?y.clientX:y.clientY)-d)/l;s("update:ratio",Ol(r+f))}function u(y){if(a!==y.pointerId)return;const v=i.value;try{v==null||v.releasePointerCapture(y.pointerId)}catch{}a=null,typeof document<"u"&&(document.body.style.cursor=o,o=""),s("commit")}function g(){s("reset")}Vt(()=>{if(a!==null&&i.value){try{i.value.releasePointerCapture(a)}catch{}typeof document<"u"&&(document.body.style.cursor=o)}});const m=q(()=>{const y=Ol(n.ratio)*100;return n.orientation==="col"?{left:`calc(${y}% - 3px)`}:{top:`calc(${y}% - 3px)`}});return(y,v)=>($(),F("div",{ref_key:"rootEl",ref:i,class:lt(["pane-splitter",y.orientation]),style:tn(m.value),role:"separator","aria-orientation":y.orientation==="col"?"vertical":"horizontal",onPointerdown:c,onPointermove:p,onPointerup:u,onPointercancel:u,onDblclick:g},null,46,X5))}}),Cp=Ct(J5,[["__scopeId","data-v-442ddd17"]]),Q5=["onMousedown","onDragover","onDragleave","onDrop"],Z5={class:"term-host"},eP={key:1,class:"empty"},tP={class:"cell-controls"},nP=["title"],sP=["id"],iP=["title"],rP=["title","aria-label","onClick"],oP={key:1,class:"who"},aP={key:2,class:"who dim"},lP={class:"sid"},cP=["title","onDragstart"],dP=["title","onClick"],uP=Ae({__name:"PaneGrid",props:{tab:{},endpointFor:{type:Function},sessionInfoFor:{type:Function},viewerCountFor:{type:Function},active:{type:Boolean},terminalTheme:{},commandNotifyThresholdSec:{},searchRequestSeq:{},appearance:{},servicePreviewAvailable:{type:Boolean}},emits:["set-active-pane","close-pane","drop-session","detach-session","toast","update:col-ratio","update:row-ratio"],setup(e,{emit:t}){const n=e,s=t,{t:i}=$t(),a=vT();_t(a,async()=>{var I;await un(),(I=o.value)==null||I.querySelectorAll(".cell-controls").forEach(O=>{const U=O.style.display;O.style.display="none",O.offsetHeight,O.style.display=U})});const d={single:["a"],vertical:["a","b"],horizontal:["a","b"],grid2x2:["a","b","c","d"]},r=q(()=>d[n.tab.layout]),o=H(null),c=H(!1),p=H(null);function u(I,O){var U;El((U=I.dataTransfer)==null?void 0:U.types)&&(I.preventDefault(),I.dataTransfer&&(I.dataTransfer.dropEffect="move"),p.value=O)}function g(I,O){const U=I.relatedTarget;U&&I.currentTarget instanceof Node&&I.currentTarget.contains(U)||p.value===O&&(p.value=null)}function m(I,O){var W,N;if(p.value=null,!El((W=I.dataTransfer)==null?void 0:W.types))return;I.preventDefault();const U=Om()||(((N=I.dataTransfer)==null?void 0:N.getData(ga))??"");U&&s("drop-session",{paneIdx:O,sessionId:U})}function y(I,O){O.sessionId&&($m(O.sessionId),I.dataTransfer&&(I.dataTransfer.setData(ga,O.sessionId),I.dataTransfer.effectAllowed="move"))}function v(){Zr()}function l(){var I;return((I=o.value)==null?void 0:I.getBoundingClientRect())??null}const h=q(()=>{const I=Ol(n.tab.colRatio),O=Ol(n.tab.rowRatio),U=I.toFixed(4),W=(1-I).toFixed(4),N=O.toFixed(4),z=(1-O).toFixed(4);switch(n.tab.layout){case"single":return{};case"vertical":return{gridTemplate:`"a b" / ${U}fr ${W}fr`};case"horizontal":return{gridTemplate:`"a" ${N}fr "b" ${z}fr / 1fr`};case"grid2x2":return{gridTemplate:`"a b" ${N}fr "c d" ${z}fr / ${U}fr ${W}fr`}}return{}}),f=q(()=>n.tab.layout==="vertical"||n.tab.layout==="grid2x2"),_=q(()=>n.tab.layout==="horizontal"||n.tab.layout==="grid2x2");function S(I){s("update:col-ratio",I)}function k(I){s("update:row-ratio",I)}function P(){s("update:col-ratio",Ds)}function M(){s("update:row-ratio",Ds)}function w(){c.value=!0}function T(){c.value=!1}function A(I){I!==n.tab.activePaneIdx&&s("set-active-pane",I)}function E(I,O){return I.sessionId??`empty-${O}`}function R(I){if(!I)return"";const O=I.user||"",U=I.host||"";return O&&U?`${O}@${U}`:U||O||""}function D(I){I.sessionId&&window.dispatchEvent(new CustomEvent("atterm:open-service-preview",{detail:{sessionId:I.sessionId}}))}return(I,O)=>($(),F("div",{ref_key:"gridRoot",ref:o,class:lt(["pane-grid",I.tab.layout]),style:tn(h.value)},[($(!0),F(Ie,null,at(I.tab.panes,(U,W)=>{var N,z,V,j,G,te;return $(),F("div",{key:E(U,W),class:lt(["cell",{"drop-target":p.value===W}]),style:tn({gridArea:r.value[W]}),"data-test":"pane-cell",onMousedown:oe=>A(W),onDragover:oe=>u(oe,W),onDragleave:oe=>g(oe,W),onDrop:oe=>m(oe,W)},[b("div",Z5,[U.sessionId&&I.endpointFor(U)?($(),bt(K5,{key:0,endpoint:I.endpointFor(U),"session-id":U.sessionId,active:I.active,focused:I.active&&W===I.tab.activePaneIdx,"expected-cols":(N=I.sessionInfoFor(U))==null?void 0:N.cols,"expected-rows":(z=I.sessionInfoFor(U))==null?void 0:z.rows,"remote-permission":(V=I.sessionInfoFor(U))==null?void 0:V.remote_permission,"session-label":C(hR)(I.sessionInfoFor(U)),"avoid-top-right-badge":U.remote||(((j=I.viewerCountFor)==null?void 0:j.call(I,U.sessionId))??0)>0,theme:I.terminalTheme,"is-local-session":!U.remote,"command-notify-threshold-sec":I.commandNotifyThresholdSec,"resize-suspended":c.value,"search-request-seq":I.searchRequestSeq,"can-detach":I.tab.layout!=="single",appearance:I.appearance,onToast:O[0]||(O[0]=oe=>s("toast",oe)),onDetach:oe=>U.sessionId&&s("detach-session",U.sessionId)},null,8,["endpoint","session-id","active","focused","expected-cols","expected-rows","remote-permission","session-label","avoid-top-right-badge","theme","is-local-session","command-notify-threshold-sec","resize-suspended","search-request-seq","can-detach","appearance","onDetach"])):($(),F("div",eP,L(C(i)("terminal.emptyPaneHint")),1))]),b("div",tP,[U.sessionId&&!U.remote&&(((G=I.viewerCountFor)==null?void 0:G.call(I,U.sessionId))??0)>0?($(),F("div",{key:0,class:"viewers-badge",title:C(i)("terminal.remoteViewerWatching",{count:I.viewerCountFor(U.sessionId)})},[O[4]||(O[4]=b("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[b("path",{d:"M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z"}),b("circle",{cx:"12",cy:"12",r:"3"})],-1)),b("span",null,L(I.viewerCountFor(U.sessionId)),1)],8,nP)):Z("",!0),U.sessionId&&U.remote&&I.servicePreviewAvailable?($(),F("span",{key:1,class:"service-preview-controls-slot",id:`service-preview-controls-${U.sessionId}`,"aria-live":"polite"},null,8,sP)):Z("",!0),U.sessionId&&U.remote?($(),F("div",{key:2,class:"remote-badge",title:((te=I.sessionInfoFor(U))!=null&&te.host_id?C(i)("sessions.hostIdTitle",{hostId:I.sessionInfoFor(U).host_id??""})+` -`:"")+C(i)("sessions.sessionTitle",{sessionId:U.sessionId})},[I.servicePreviewAvailable?($(),F("button",{key:0,type:"button",class:"remote-preview-trigger","data-testid":"remote-preview-trigger",title:C(i)("terminal.preview.open"),"aria-label":C(i)("terminal.preview.open"),onMousedown:O[1]||(O[1]=dt(()=>{},["stop"])),onClick:dt(oe=>D(U),["stop"])},O[5]||(O[5]=[bb('',1)]),40,rP)):Z("",!0),R(I.sessionInfoFor(U))?($(),F("span",oP,L(R(I.sessionInfoFor(U))),1)):($(),F("span",aP,L(C(i)("terminal.remote")),1)),b("span",lP,L(U.sessionId.slice(0,8)),1)],8,iP)):Z("",!0),U.sessionId&&I.tab.layout!=="single"?($(),F("span",{key:3,class:"pane-grip","data-test":"pane-grip",draggable:"true",title:C(i)("terminal.dragPaneOut"),onMousedown:O[2]||(O[2]=dt(()=>{},["stop"])),onDragstart:oe=>y(oe,U),onDragend:v},"⠿",40,cP)):Z("",!0),I.tab.layout!=="single"?($(),F("button",{key:4,type:"button",class:"close-pane",title:C(i)("terminal.closePaneTitle"),onMousedown:O[3]||(O[3]=dt(()=>{},["stop"])),onClick:dt(oe=>s("close-pane",W),["stop"])},"×",40,dP)):Z("",!0)])],46,Q5)}),128)),f.value?($(),bt(Cp,{key:0,orientation:"col",ratio:I.tab.colRatio,"container-rect":l,onPointerdown:w,"onUpdate:ratio":S,onCommit:T,onReset:P},null,8,["ratio"])):Z("",!0),_.value?($(),bt(Cp,{key:1,orientation:"row",ratio:I.tab.rowRatio,"container-rect":l,onPointerdown:w,"onUpdate:ratio":k,onCommit:T,onReset:M},null,8,["ratio"])):Z("",!0)],6))}}),hP=Ct(uP,[["__scopeId","data-v-76c1e407"]]);let Fl=[];const o_=new WeakMap;function fP(){Fl.forEach(e=>e(...o_.get(e))),Fl=[]}function Bl(e,...t){o_.set(e,t),!Fl.includes(e)&&Fl.push(e)===1&&requestAnimationFrame(fP)}function Rs(e,t){let{target:n}=e;for(;n;){if(n.dataset&&n.dataset[t]!==void 0)return!0;n=n.parentElement}return!1}function pP(e){const t=H(!!e.value);if(t.value)return Ad(t);const n=_t(e,s=>{s&&(t.value=!0,n())});return Ad(t)}function vP(){return rg()!==null}const gP=typeof window<"u";let lo,da;const mP=()=>{var e,t;lo=gP?(t=(e=document)===null||e===void 0?void 0:e.fonts)===null||t===void 0?void 0:t.ready:void 0,da=!1,lo!==void 0?lo.then(()=>{da=!0}):da=!0};mP();function _P(e){if(da)return;let t=!1;Dt(()=>{da||lo==null||lo.then(()=>{t||e()})}),Vt(()=>{t=!0})}function nh(e,t){return q(()=>{for(const n of t)if(e[n]!==void 0)return e[n];return e[t[t.length-1]]})}function sh(e={},t){const n=ia({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:s,keyup:i}=e,a=o=>{switch(o.key){case"Control":n.ctrl=!0;break;case"Meta":n.command=!0,n.win=!0;break;case"Shift":n.shift=!0;break;case"Tab":n.tab=!0;break}s!==void 0&&Object.keys(s).forEach(c=>{if(c!==o.key)return;const p=s[c];if(typeof p=="function")p(o);else{const{stop:u=!1,prevent:g=!1}=p;u&&o.stopPropagation(),g&&o.preventDefault(),p.handler(o)}})},d=o=>{switch(o.key){case"Control":n.ctrl=!1;break;case"Meta":n.command=!1,n.win=!1;break;case"Shift":n.shift=!1;break;case"Tab":n.tab=!1;break}i!==void 0&&Object.keys(i).forEach(c=>{if(c!==o.key)return;const p=i[c];if(typeof p=="function")p(o);else{const{stop:u=!1,prevent:g=!1}=p;u&&o.stopPropagation(),g&&o.preventDefault(),p.handler(o)}})},r=()=>{(t===void 0||t.value)&&(Wn("keydown",document,a),Wn("keyup",document,d)),t!==void 0&&_t(t,o=>{o?(Wn("keydown",document,a),Wn("keyup",document,d)):(zn("keydown",document,a),zn("keyup",document,d))})};return vP()?(wb(r),Vt(()=>{(t===void 0||t.value)&&(zn("keydown",document,a),zn("keyup",document,d))})):r(),Ad(n)}const ih=ds("n-internal-select-menu"),a_=ds("n-internal-select-menu-body"),rh=ds("n-drawer-body"),oh=ds("n-modal-body"),hc=ds("n-popover-body"),l_="__disabled__";function cs(e){const t=Ut(oh,null),n=Ut(rh,null),s=Ut(hc,null),i=Ut(a_,null),a=H();if(typeof document<"u"){a.value=document.fullscreenElement;const d=()=>{a.value=document.fullscreenElement};Dt(()=>{Wn("fullscreenchange",document,d)}),Vt(()=>{zn("fullscreenchange",document,d)})}return Zt(()=>{var d;const{to:r}=e;return r!==void 0?r===!1?l_:r===!0?a.value||"body":r:t!=null&&t.value?(d=t.value.$el)!==null&&d!==void 0?d:t.value:n!=null&&n.value?n.value:s!=null&&s.value?s.value:i!=null&&i.value?i.value:r??(a.value||"body")})}cs.tdkey=l_;cs.propTo={type:[String,Object,Boolean],default:void 0};function yP(e,t,n){const s=H(e.value);let i=null;return _t(e,a=>{i!==null&&window.clearTimeout(i),a===!0?n&&!n.value?s.value=!0:i=window.setTimeout(()=>{s.value=!0},t):s.value=!1}),s}function eu(e,t,n="default"){const s=t[n];if(s===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);return s()}function tu(e,t=!0,n=[]){return e.forEach(s=>{if(s!==null){if(typeof s!="object"){(typeof s=="string"||typeof s=="number")&&n.push(ot(String(s)));return}if(Array.isArray(s)){tu(s,t,n);return}if(s.type===Ie){if(s.children===null)return;Array.isArray(s.children)&&tu(s.children,t,n)}else s.type!==Sb&&n.push(s)}}),n}function kp(e,t,n="default"){const s=t[n];if(s===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);const i=tu(s());if(i.length===1)return i[0];throw new Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`)}let Vi=null;function c_(){if(Vi===null&&(Vi=document.getElementById("v-binder-view-measurer"),Vi===null)){Vi=document.createElement("div"),Vi.id="v-binder-view-measurer";const{style:e}=Vi;e.position="fixed",e.left="0",e.right="0",e.top="0",e.bottom="0",e.pointerEvents="none",e.visibility="hidden",document.body.appendChild(Vi)}return Vi.getBoundingClientRect()}function bP(e,t){const n=c_();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function Zc(e){const t=e.getBoundingClientRect(),n=c_();return{left:t.left-n.left,top:t.top-n.top,bottom:n.height+n.top-t.bottom,right:n.width+n.left-t.right,width:t.width,height:t.height}}function wP(e){return e.nodeType===9?null:e.parentNode}function d_(e){if(e===null)return null;const t=wP(e);if(t===null)return null;if(t.nodeType===9)return document;if(t.nodeType===1){const{overflow:n,overflowX:s,overflowY:i}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(n+i+s))return t}return d_(t)}const Ro=Ae({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){var t;kn("VBinder",(t=rg())===null||t===void 0?void 0:t.proxy);const n=Ut("VBinder",null),s=H(null),i=h=>{s.value=h,n&&e.syncTargetWithParent&&n.setTargetRef(h)};let a=[];const d=()=>{let h=s.value;for(;h=d_(h),h!==null;)a.push(h);for(const f of a)Wn("scroll",f,u,!0)},r=()=>{for(const h of a)zn("scroll",h,u,!0);a=[]},o=new Set,c=h=>{o.size===0&&d(),o.has(h)||o.add(h)},p=h=>{o.has(h)&&o.delete(h),o.size===0&&r()},u=()=>{Bl(g)},g=()=>{o.forEach(h=>h())},m=new Set,y=h=>{m.size===0&&Wn("resize",window,l),m.has(h)||m.add(h)},v=h=>{m.has(h)&&m.delete(h),m.size===0&&zn("resize",window,l)},l=()=>{m.forEach(h=>h())};return Vt(()=>{zn("resize",window,l),r()}),{targetRef:s,setTargetRef:i,addScrollListener:c,removeScrollListener:p,addResizeListener:y,removeResizeListener:v}},render(){return eu("binder",this.$slots)}}),To=Ae({name:"Target",setup(){const{setTargetRef:e,syncTarget:t}=Ut("VBinder");return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){const{syncTarget:e,setTargetDirective:t}=this;return e?rt(kp("follower",this.$slots),[[t]]):kp("follower",this.$slots)}}),Kr="@@mmoContext",SP={mounted(e,{value:t}){e[Kr]={handler:void 0},typeof t=="function"&&(e[Kr].handler=t,Wn("mousemoveoutside",e,t))},updated(e,{value:t}){const n=e[Kr];typeof t=="function"?n.handler?n.handler!==t&&(zn("mousemoveoutside",e,n.handler),n.handler=t,Wn("mousemoveoutside",e,t)):(e[Kr].handler=t,Wn("mousemoveoutside",e,t)):n.handler&&(zn("mousemoveoutside",e,n.handler),n.handler=void 0)},unmounted(e){const{handler:t}=e[Kr];t&&zn("mousemoveoutside",e,t),e[Kr].handler=void 0}},Wr="@@coContext",Ar={mounted(e,{value:t,modifiers:n}){e[Wr]={handler:void 0},typeof t=="function"&&(e[Wr].handler=t,Wn("clickoutside",e,t,{capture:n.capture}))},updated(e,{value:t,modifiers:n}){const s=e[Wr];typeof t=="function"?s.handler?s.handler!==t&&(zn("clickoutside",e,s.handler,{capture:n.capture}),s.handler=t,Wn("clickoutside",e,t,{capture:n.capture})):(e[Wr].handler=t,Wn("clickoutside",e,t,{capture:n.capture})):s.handler&&(zn("clickoutside",e,s.handler,{capture:n.capture}),s.handler=void 0)},unmounted(e,{modifiers:t}){const{handler:n}=e[Wr];n&&zn("clickoutside",e,n,{capture:t.capture}),e[Wr].handler=void 0}};function CP(e,t){console.error(`[vdirs/${e}]: ${t}`)}class kP{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(t,n){const{elementZIndex:s}=this;if(n!==void 0){t.style.zIndex=`${n}`,s.delete(t);return}const{nextZIndex:i}=this;s.has(t)&&s.get(t)+1===this.nextZIndex||(t.style.zIndex=`${i}`,s.set(t,i),this.nextZIndex=i+1,this.squashState())}unregister(t,n){const{elementZIndex:s}=this;s.has(t)?s.delete(t):n===void 0&&CP("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:t}=this;t||(this.nextZIndex=2e3),this.nextZIndex-t>2500&&this.rearrange()}rearrange(){const t=Array.from(this.elementZIndex.entries());t.sort((n,s)=>n[1]-s[1]),this.nextZIndex=2e3,t.forEach(n=>{const s=n[0],i=this.nextZIndex++;`${i}`!==s.style.zIndex&&(s.style.zIndex=`${i}`)})}}const ed=new kP,jr="@@ziContext",u_={mounted(e,t){const{value:n={}}=t,{zIndex:s,enabled:i}=n;e[jr]={enabled:!!i,initialized:!1},i&&(ed.ensureZIndex(e,s),e[jr].initialized=!0)},updated(e,t){const{value:n={}}=t,{zIndex:s,enabled:i}=n,a=e[jr].enabled;i&&!a&&(ed.ensureZIndex(e,s),e[jr].initialized=!0),e[jr].enabled=!!i},unmounted(e,t){if(!e[jr].initialized)return;const{value:n={}}=t,{zIndex:s}=n;ed.unregister(e,s)}},{c:Qi}=Cb(),ah="vueuc-style";function xp(e){return e&-e}class h_{constructor(t,n){this.l=t,this.min=n;const s=new Array(t+1);for(let i=0;ii)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let a=t*s;for(;t>0;)a+=n[t],t-=xp(t);return a}getBound(t){let n=0,s=this.l;for(;s>n;){const i=Math.floor((n+s)/2),a=this.sum(i);if(a>t){s=i;continue}else if(a{const{to:t}=e;return t??"body"})}},render(){return this.showTeleport?this.disabled?eu("lazy-teleport",this.$slots):B(wl,{disabled:this.disabled,to:this.mergedTo},eu("lazy-teleport",this.$slots)):null}}),Qa={top:"bottom",bottom:"top",left:"right",right:"left"},Tp={start:"end",center:"center",end:"start"},td={top:"height",bottom:"height",left:"width",right:"width"},RP={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},TP={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},PP={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},Pp={top:!0,bottom:!1,left:!0,right:!1},Ep={top:"end",bottom:"start",left:"end",right:"start"};function EP(e,t,n,s,i,a){if(!i||a)return{placement:e,top:0,left:0};const[d,r]=e.split("-");let o=r??"center",c={top:0,left:0};const p=(m,y,v)=>{let l=0,h=0;const f=n[m]-t[y]-t[m];return f>0&&s&&(v?h=Pp[y]?f:-f:l=Pp[y]?f:-f),{left:l,top:h}},u=d==="left"||d==="right";if(o!=="center"){const m=PP[e],y=Qa[m],v=td[m];if(n[v]>t[v]){if(t[m]+t[v]t[y]&&(o=Tp[r])}else{const m=d==="bottom"||d==="top"?"left":"top",y=Qa[m],v=td[m],l=(n[v]-t[v])/2;(t[m]t[y]?(o=Ep[m],c=p(v,m,u)):(o=Ep[y],c=p(v,y,u)))}let g=d;return t[d] *",{pointerEvents:"all"})])]),Po=Ae({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(e){const t=Ut("VBinder"),n=Zt(()=>e.enabled!==void 0?e.enabled:e.show),s=H(null),i=H(null),a=()=>{const{syncTrigger:g}=e;g.includes("scroll")&&t.addScrollListener(o),g.includes("resize")&&t.addResizeListener(o)},d=()=>{t.removeScrollListener(o),t.removeResizeListener(o)};Dt(()=>{n.value&&(o(),a())});const r=Du();MP.mount({id:"vueuc/binder",head:!0,anchorMetaName:ah,ssr:r}),Vt(()=>{d()}),_P(()=>{n.value&&o()});const o=()=>{if(!n.value)return;const g=s.value;if(g===null)return;const m=t.targetRef,{x:y,y:v,overlap:l}=e,h=y!==void 0&&v!==void 0?bP(y,v):Zc(m);g.style.setProperty("--v-target-width",`${Math.round(h.width)}px`),g.style.setProperty("--v-target-height",`${Math.round(h.height)}px`);const{width:f,minWidth:_,placement:S,internalShift:k,flip:P}=e;g.setAttribute("v-placement",S),l?g.setAttribute("v-overlap",""):g.removeAttribute("v-overlap");const{style:M}=g;f==="target"?M.width=`${h.width}px`:f!==void 0?M.width=f:M.width="",_==="target"?M.minWidth=`${h.width}px`:_!==void 0?M.minWidth=_:M.minWidth="";const w=Zc(g),T=Zc(i.value),{left:A,top:E,placement:R}=EP(S,h,w,k,P,l),D=LP(R,l),{left:I,top:O,transform:U}=DP(R,T,h,E,A,l);g.setAttribute("v-placement",R),g.style.setProperty("--v-offset-left",`${Math.round(A)}px`),g.style.setProperty("--v-offset-top",`${Math.round(E)}px`),g.style.transform=`translateX(${I}) translateY(${O}) ${U}`,g.style.setProperty("--v-transform-origin",D),g.style.transformOrigin=D};_t(n,g=>{g?(a(),c()):d()});const c=()=>{un().then(o).catch(g=>console.error(g))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(g=>{_t(ct(e,g),o)}),["teleportDisabled"].forEach(g=>{_t(ct(e,g),c)}),_t(ct(e,"syncTrigger"),g=>{g.includes("resize")?t.addResizeListener(o):t.removeResizeListener(o),g.includes("scroll")?t.addScrollListener(o):t.removeScrollListener(o)});const p=Sa(),u=Zt(()=>{const{to:g}=e;if(g!==void 0)return g;p.value});return{VBinder:t,mergedEnabled:n,offsetContainerRef:i,followerRef:s,mergedTo:u,syncPosition:o}},render(){return B(xP,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var e,t;const n=B("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[B("div",{class:"v-binder-follower-content",ref:"followerRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))]);return this.zindexable?rt(n,[[u_,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});let Za;function AP(){return typeof document>"u"?!1:(Za===void 0&&("matchMedia"in window?Za=window.matchMedia("(pointer:coarse)").matches:Za=!1),Za)}let nd;function Lp(){return typeof document>"u"?1:(nd===void 0&&(nd="chrome"in window?window.devicePixelRatio:1),nd)}const f_="VVirtualListXScroll";function IP({columnsRef:e,renderColRef:t,renderItemWithColsRef:n}){const s=H(0),i=H(0),a=q(()=>{const c=e.value;if(c.length===0)return null;const p=new h_(c.length,0);return c.forEach((u,g)=>{p.add(g,u.width)}),p}),d=Zt(()=>{const c=a.value;return c!==null?Math.max(c.getBound(i.value)-1,0):0}),r=c=>{const p=a.value;return p!==null?p.sum(c):0},o=Zt(()=>{const c=a.value;return c!==null?Math.min(c.getBound(i.value+s.value)+1,e.value.length-1):0});return kn(f_,{startIndexRef:d,endIndexRef:o,columnsRef:e,renderColRef:t,renderItemWithColsRef:n,getLeft:r}),{listWidthRef:s,scrollLeftRef:i}}const Dp=Ae({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:e,endIndexRef:t,columnsRef:n,getLeft:s,renderColRef:i,renderItemWithColsRef:a}=Ut(f_);return{startIndex:e,endIndex:t,columns:n,renderCol:i,renderItemWithCols:a,getLeft:s}},render(){const{startIndex:e,endIndex:t,columns:n,renderCol:s,renderItemWithCols:i,getLeft:a,item:d}=this;if(i!=null)return i({itemIndex:this.index,startColIndex:e,endColIndex:t,allColumns:n,item:d,getLeft:a});if(s!=null){const r=[];for(let o=e;o<=t;++o){const c=n[o];r.push(s({column:c,left:a(o),item:d}))}return r}return null}}),$P=Qi(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Qi("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Qi("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),go=Ae({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(e){const t=Du();$P.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:ah,ssr:t}),Dt(()=>{const{defaultScrollIndex:D,defaultScrollKey:I}=e;D!=null?l({index:D}):I!=null&&l({key:I})});let n=!1,s=!1;kb(()=>{if(n=!1,!s){s=!0;return}l({top:m.value,left:d.value})}),og(()=>{n=!0,s||(s=!0)});const i=Zt(()=>{if(e.renderCol==null&&e.renderItemWithCols==null||e.columns.length===0)return;let D=0;return e.columns.forEach(I=>{D+=I.width}),D}),a=q(()=>{const D=new Map,{keyField:I}=e;return e.items.forEach((O,U)=>{D.set(O[I],U)}),D}),{scrollLeftRef:d,listWidthRef:r}=IP({columnsRef:ct(e,"columns"),renderColRef:ct(e,"renderCol"),renderItemWithColsRef:ct(e,"renderItemWithCols")}),o=H(null),c=H(void 0),p=new Map,u=q(()=>{const{items:D,itemSize:I,keyField:O}=e,U=new h_(D.length,I);return D.forEach((W,N)=>{const z=W[O],V=p.get(z);V!==void 0&&U.add(N,V)}),U}),g=H(0),m=H(0),y=Zt(()=>Math.max(u.value.getBound(m.value-so(e.paddingTop))-1,0)),v=q(()=>{const{value:D}=c;if(D===void 0)return[];const{items:I,itemSize:O}=e,U=y.value,W=Math.min(U+Math.ceil(D/O+1),I.length-1),N=[];for(let z=U;z<=W;++z)N.push(I[z]);return N}),l=(D,I)=>{if(typeof D=="number"){S(D,I,"auto");return}const{left:O,top:U,index:W,key:N,position:z,behavior:V,debounce:j=!0}=D;if(O!==void 0||U!==void 0)S(O,U,V);else if(W!==void 0)_(W,V,j);else if(N!==void 0){const G=a.value.get(N);G!==void 0&&_(G,V,j)}else z==="bottom"?S(0,Number.MAX_SAFE_INTEGER,V):z==="top"&&S(0,0,V)};let h,f=null;function _(D,I,O){const{value:U}=u,W=U.sum(D)+so(e.paddingTop);if(!O)o.value.scrollTo({left:0,top:W,behavior:I});else{h=D,f!==null&&window.clearTimeout(f),f=window.setTimeout(()=>{h=void 0,f=null},16);const{scrollTop:N,offsetHeight:z}=o.value;if(W>N){const V=U.get(D);W+V<=N+z||o.value.scrollTo({left:0,top:W+V-z,behavior:I})}else o.value.scrollTo({left:0,top:W,behavior:I})}}function S(D,I,O){o.value.scrollTo({left:D,top:I,behavior:O})}function k(D,I){var O,U,W;if(n||e.ignoreItemResize||R(I.target))return;const{value:N}=u,z=a.value.get(D),V=N.get(z),j=(W=(U=(O=I.borderBoxSize)===null||O===void 0?void 0:O[0])===null||U===void 0?void 0:U.blockSize)!==null&&W!==void 0?W:I.contentRect.height;if(j===V)return;j-e.itemSize===0?p.delete(D):p.set(D,j-e.itemSize);const te=j-V;if(te===0)return;N.add(z,te);const oe=o.value;if(oe!=null){if(h===void 0){const re=N.sum(z);oe.scrollTop>re&&oe.scrollBy(0,te)}else if(zoe.scrollTop+oe.offsetHeight&&oe.scrollBy(0,te)}E()}g.value++}const P=!AP();let M=!1;function w(D){var I;(I=e.onScroll)===null||I===void 0||I.call(e,D),(!P||!M)&&E()}function T(D){var I;if((I=e.onWheel)===null||I===void 0||I.call(e,D),P){const O=o.value;if(O!=null){if(D.deltaX===0&&(O.scrollTop===0&&D.deltaY<=0||O.scrollTop+O.offsetHeight>=O.scrollHeight&&D.deltaY>=0))return;D.preventDefault(),O.scrollTop+=D.deltaY/Lp(),O.scrollLeft+=D.deltaX/Lp(),E(),M=!0,Bl(()=>{M=!1})}}}function A(D){if(n||R(D.target))return;if(e.renderCol==null&&e.renderItemWithCols==null){if(D.contentRect.height===c.value)return}else if(D.contentRect.height===c.value&&D.contentRect.width===r.value)return;c.value=D.contentRect.height,r.value=D.contentRect.width;const{onResize:I}=e;I!==void 0&&I(D)}function E(){const{value:D}=o;D!=null&&(m.value=D.scrollTop,d.value=D.scrollLeft)}function R(D){let I=D;for(;I!==null;){if(I.style.display==="none")return!0;I=I.parentElement}return!1}return{listHeight:c,listStyle:{overflow:"auto"},keyToIndex:a,itemsStyle:q(()=>{const{itemResizable:D}=e,I=Gn(u.value.sum());return g.value,[e.itemsStyle,{boxSizing:"content-box",width:Gn(i.value),height:D?"":I,minHeight:D?I:"",paddingTop:Gn(e.paddingTop),paddingBottom:Gn(e.paddingBottom)}]}),visibleItemsStyle:q(()=>(g.value,{transform:`translateY(${Gn(u.value.sum(y.value))})`})),viewportItems:v,listElRef:o,itemsElRef:H(null),scrollTo:l,handleListResize:A,handleListScroll:w,handleListWheel:T,handleItemResize:k}},render(){const{itemResizable:e,keyField:t,keyToIndex:n,visibleItemsTag:s}=this;return B(Id,{onResize:this.handleListResize},{default:()=>{var i,a;return B("div",nr(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?B("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[B(s,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:d,renderItemWithCols:r}=this;return this.viewportItems.map(o=>{const c=o[t],p=n.get(c),u=d!=null?B(Dp,{index:p,item:o}):void 0,g=r!=null?B(Dp,{index:p,item:o}):void 0,m=this.$slots.default({item:o,renderedCols:u,renderedItemWithCols:g,index:p})[0];return e?B(Id,{key:c,onResize:y=>this.handleItemResize(c,y)},{default:()=>m}):(m.key=c,m)})}})]):(a=(i=this.$slots).empty)===null||a===void 0?void 0:a.call(i)])}})}}),wi="v-hidden",OP=Qi("[v-hidden]",{display:"none!important"}),Mp=Ae({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:t}){const n=H(null),s=H(null);function i(d){const{value:r}=n,{getCounter:o,getTail:c}=e;let p;if(o!==void 0?p=o():p=s.value,!r||!p)return;p.hasAttribute(wi)&&p.removeAttribute(wi);const{children:u}=r;if(d.showAllItemsBeforeCalculate)for(const _ of u)_.hasAttribute(wi)&&_.removeAttribute(wi);const g=r.offsetWidth,m=[],y=t.tail?c==null?void 0:c():null;let v=y?y.offsetWidth:0,l=!1;const h=r.children.length-(t.tail?1:0);for(let _=0;_g){const{updateCounter:P}=e;for(let M=_;M>=0;--M){const w=h-1-M;P!==void 0?P(w):p.textContent=`${w}`;const T=p.offsetWidth;if(v-=m[M],v+T<=g||M===0){l=!0,_=M-1,y&&(_===-1?(y.style.maxWidth=`${g-T}px`,y.style.boxSizing="border-box"):y.style.maxWidth="");const{onUpdateCount:A}=e;A&&A(w);break}}}}const{onUpdateOverflow:f}=e;l?f!==void 0&&f(!0):(f!==void 0&&f(!1),p.setAttribute(wi,""))}const a=Du();return OP.mount({id:"vueuc/overflow",head:!0,anchorMetaName:ah,ssr:a}),Dt(()=>i({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:s,sync:i}},render(){const{$slots:e}=this;return un(()=>this.sync({showAllItemsBeforeCalculate:!1})),B("div",{class:"v-overflow",ref:"selfRef"},[ag(e,"default"),e.counter?e.counter():B("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}});function p_(e){return e instanceof HTMLElement}function v_(e){for(let t=0;t=0;t--){const n=e.childNodes[t];if(p_(n)&&(m_(n)||g_(n)))return!0}return!1}function m_(e){if(!FP(e))return!1;try{e.focus({preventScroll:!0})}catch{}return document.activeElement===e}function FP(e){if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute("tabIndex")!==null)return!0;if(e.getAttribute("disabled"))return!1;switch(e.nodeName){case"A":return!!e.href&&e.rel!=="ignore";case"INPUT":return e.type!=="hidden"&&e.type!=="file";case"SELECT":case"TEXTAREA":return!0;default:return!1}}let Qo=[];const BP=Ae({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(e){const t=Mu(),n=H(null),s=H(null);let i=!1,a=!1;const d=typeof document>"u"?null:document.activeElement;function r(){return Qo[Qo.length-1]===t}function o(l){var h;l.code==="Escape"&&r()&&((h=e.onEsc)===null||h===void 0||h.call(e,l))}Dt(()=>{_t(()=>e.active,l=>{l?(u(),Wn("keydown",document,o)):(zn("keydown",document,o),i&&g())},{immediate:!0})}),Vt(()=>{zn("keydown",document,o),i&&g()});function c(l){if(!a&&r()){const h=p();if(h===null||h.contains(Dr(l)))return;m("first")}}function p(){const l=n.value;if(l===null)return null;let h=l;for(;h=h.nextSibling,!(h===null||h instanceof Element&&h.tagName==="DIV"););return h}function u(){var l;if(!e.disabled){if(Qo.push(t),e.autoFocus){const{initialFocusTo:h}=e;h===void 0?m("first"):(l=Rp(h))===null||l===void 0||l.focus({preventScroll:!0})}i=!0,document.addEventListener("focus",c,!0)}}function g(){var l;if(e.disabled||(document.removeEventListener("focus",c,!0),Qo=Qo.filter(f=>f!==t),r()))return;const{finalFocusTo:h}=e;h!==void 0?(l=Rp(h))===null||l===void 0||l.focus({preventScroll:!0}):e.returnFocusOnDeactivated&&d instanceof HTMLElement&&(a=!0,d.focus({preventScroll:!0}),a=!1)}function m(l){if(r()&&e.active){const h=n.value,f=s.value;if(h!==null&&f!==null){const _=p();if(_==null||_===f){a=!0,h.focus({preventScroll:!0}),a=!1;return}a=!0;const S=l==="first"?v_(_):g_(_);a=!1,S||(a=!0,h.focus({preventScroll:!0}),a=!1)}}}function y(l){if(a)return;const h=p();h!==null&&(l.relatedTarget!==null&&h.contains(l.relatedTarget)?m("last"):m("first"))}function v(l){a||(l.relatedTarget!==null&&l.relatedTarget===n.value?m("last"):m("first"))}return{focusableStartRef:n,focusableEndRef:s,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:y,handleEndFocus:v}},render(){const{default:e}=this.$slots;if(e===void 0)return null;if(this.disabled)return e();const{active:t,focusableStyle:n}=this;return B(Ie,null,[B("div",{"aria-hidden":"true",tabindex:t?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),e(),B("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:t?"0":"-1",onFocus:this.handleEndFocus})])}});function __(e,t){t&&(Dt(()=>{const{value:n}=e;n&&$c.registerHandler(n,t)}),_t(e,(n,s)=>{s&&$c.unregisterHandler(s)},{deep:!1}),Vt(()=>{const{value:n}=e;n&&$c.unregisterHandler(n)}))}function HP(e,t){if(!e)return;const n=document.createElement("a");n.href=e,t!==void 0&&(n.download=t),document.body.appendChild(n),n.click(),document.body.removeChild(n)}let sd;function NP(){return sd===void 0&&(sd=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),sd}const zP=new WeakSet;function _a(e){zP.add(e)}function Ap(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}function Ip(e){switch(e){case"tiny":return"mini";case"small":return"tiny";case"medium":return"small";case"large":return"medium";case"huge":return"large"}throw new Error(`${e} has no smaller size.`)}function y_(e){return t=>{t?e.value=t.$el:e.value=null}}function $p(e,t="default",n=void 0){const s=e[t];if(!s)return Mr("getFirstSlotVNode",`slot[${t}] is empty`),null;const i=Rg(s(n));return i.length===1?i[0]:(Mr("getFirstSlotVNode",`slot[${t}] should have exactly one child`),null)}function fc(e,t=[],n){const s={};return t.forEach(i=>{s[i]=e[i]}),Object.assign(s,n)}function ua(e){const t=e.filter(n=>n!==void 0);if(t.length!==0)return t.length===1?t[0]:n=>{e.forEach(s=>{s&&s(n)})}}var nu=Zl(ec,"WeakMap"),UP=xb(Object.keys,Object),VP=Object.prototype,KP=VP.hasOwnProperty;function WP(e){if(!Rb(e))return UP(e);var t=[];for(var n in Object(e))KP.call(e,n)&&n!="constructor"&&t.push(n);return t}function lh(e){return Au(e)?Tb(e):WP(e)}function jP(e,t){for(var n=-1,s=t.length,i=e.length;++nr))return!1;var c=a.get(e),p=a.get(t);if(c&&p)return c==t&&p==e;var u=-1,g=!0,m=n&uE?new Hl:void 0;for(a.set(e,t),a.set(t,e);++uB("svg",{width:"28px",height:"28px",viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},B("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},B("g",{"fill-rule":"nonzero"},B("path",{d:"M21.75,3 C23.5449254,3 25,4.45507456 25,6.25 L25,21.75 C25,23.5449254 23.5449254,25 21.75,25 L6.25,25 C4.45507456,25 3,23.5449254 3,21.75 L3,6.25 C3,4.45507456 4.45507456,3 6.25,3 L21.75,3 Z M23.5,9.503 L4.5,9.503 L4.5,21.75 C4.5,22.7164983 5.28350169,23.5 6.25,23.5 L21.75,23.5 C22.7164983,23.5 23.5,22.7164983 23.5,21.75 L23.5,9.503 Z M21.75,4.5 L6.25,4.5 C5.28350169,4.5 4.5,5.28350169 4.5,6.25 L4.5,8.003 L23.5,8.003 L23.5,6.25 C23.5,5.28350169 22.7164983,4.5 21.75,4.5 Z"}))))),iL=Ae({name:"Empty",render(){return B("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),B("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}}),ir=Ae({name:"FastBackward",render(){return B("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},B("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},B("g",{fill:"currentColor","fill-rule":"nonzero"},B("path",{d:"M8.73171,16.7949 C9.03264,17.0795 9.50733,17.0663 9.79196,16.7654 C10.0766,16.4644 10.0634,15.9897 9.76243,15.7051 L4.52339,10.75 L17.2471,10.75 C17.6613,10.75 17.9971,10.4142 17.9971,10 C17.9971,9.58579 17.6613,9.25 17.2471,9.25 L4.52112,9.25 L9.76243,4.29275 C10.0634,4.00812 10.0766,3.53343 9.79196,3.2325 C9.50733,2.93156 9.03264,2.91834 8.73171,3.20297 L2.31449,9.27241 C2.14819,9.4297 2.04819,9.62981 2.01448,9.8386 C2.00308,9.89058 1.99707,9.94459 1.99707,10 C1.99707,10.0576 2.00356,10.1137 2.01585,10.1675 C2.05084,10.3733 2.15039,10.5702 2.31449,10.7254 L8.73171,16.7949 Z"}))))}}),rr=Ae({name:"FastForward",render(){return B("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},B("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},B("g",{fill:"currentColor","fill-rule":"nonzero"},B("path",{d:"M11.2654,3.20511 C10.9644,2.92049 10.4897,2.93371 10.2051,3.23464 C9.92049,3.53558 9.93371,4.01027 10.2346,4.29489 L15.4737,9.25 L2.75,9.25 C2.33579,9.25 2,9.58579 2,10.0000012 C2,10.4142 2.33579,10.75 2.75,10.75 L15.476,10.75 L10.2346,15.7073 C9.93371,15.9919 9.92049,16.4666 10.2051,16.7675 C10.4897,17.0684 10.9644,17.0817 11.2654,16.797 L17.6826,10.7276 C17.8489,10.5703 17.9489,10.3702 17.9826,10.1614 C17.994,10.1094 18,10.0554 18,10.0000012 C18,9.94241 17.9935,9.88633 17.9812,9.83246 C17.9462,9.62667 17.8467,9.42976 17.6826,9.27455 L11.2654,3.20511 Z"}))))}}),rL=Ae({name:"Filter",render(){return B("svg",{viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},B("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},B("g",{"fill-rule":"nonzero"},B("path",{d:"M17,19 C17.5522847,19 18,19.4477153 18,20 C18,20.5522847 17.5522847,21 17,21 L11,21 C10.4477153,21 10,20.5522847 10,20 C10,19.4477153 10.4477153,19 11,19 L17,19 Z M21,13 C21.5522847,13 22,13.4477153 22,14 C22,14.5522847 21.5522847,15 21,15 L7,15 C6.44771525,15 6,14.5522847 6,14 C6,13.4477153 6.44771525,13 7,13 L21,13 Z M24,7 C24.5522847,7 25,7.44771525 25,8 C25,8.55228475 24.5522847,9 24,9 L4,9 C3.44771525,9 3,8.55228475 3,8 C3,7.44771525 3.44771525,7 4,7 L24,7 Z"}))))}}),or=Ae({name:"Forward",render(){return B("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B("path",{d:"M7.73271 4.20694C8.03263 3.92125 8.50737 3.93279 8.79306 4.23271L13.7944 9.48318C14.0703 9.77285 14.0703 10.2281 13.7944 10.5178L8.79306 15.7682C8.50737 16.0681 8.03263 16.0797 7.73271 15.794C7.43279 15.5083 7.42125 15.0336 7.70694 14.7336L12.2155 10.0005L7.70694 5.26729C7.42125 4.96737 7.43279 4.49264 7.73271 4.20694Z",fill:"currentColor"}))}}),Yp=Ae({name:"More",render(){return B("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},B("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},B("g",{fill:"currentColor","fill-rule":"nonzero"},B("path",{d:"M4,7 C4.55228,7 5,7.44772 5,8 C5,8.55229 4.55228,9 4,9 C3.44772,9 3,8.55229 3,8 C3,7.44772 3.44772,7 4,7 Z M8,7 C8.55229,7 9,7.44772 9,8 C9,8.55229 8.55229,9 8,9 C7.44772,9 7,8.55229 7,8 C7,7.44772 7.44772,7 8,7 Z M12,7 C12.5523,7 13,7.44772 13,8 C13,8.55229 12.5523,9 12,9 C11.4477,9 11,8.55229 11,8 C11,7.44772 11.4477,7 12,7 Z"}))))}}),oL=Ae({name:"Remove",render(){return B("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},B("line",{x1:"400",y1:"256",x2:"112",y2:"256",style:` - fill: none; - stroke: currentColor; - stroke-linecap: round; - stroke-linejoin: round; - stroke-width: 32px; - `}))}}),aL=$u("time",()=>B("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},B("path",{d:"M256,64C150,64,64,150,64,256s86,192,192,192,192-86,192-192S362,64,256,64Z",style:` - fill: none; - stroke: currentColor; - stroke-miterlimit: 10; - stroke-width: 32px; - `}),B("polyline",{points:"256 128 256 272 352 272",style:` - fill: none; - stroke: currentColor; - stroke-linecap: round; - stroke-linejoin: round; - stroke-width: 32px; - `}))),lL=$u("to",()=>B("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},B("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},B("g",{fill:"currentColor","fill-rule":"nonzero"},B("path",{d:"M11.2654,3.20511 C10.9644,2.92049 10.4897,2.93371 10.2051,3.23464 C9.92049,3.53558 9.93371,4.01027 10.2346,4.29489 L15.4737,9.25 L2.75,9.25 C2.33579,9.25 2,9.58579 2,10.0000012 C2,10.4142 2.33579,10.75 2.75,10.75 L15.476,10.75 L10.2346,15.7073 C9.93371,15.9919 9.92049,16.4666 10.2051,16.7675 C10.4897,17.0684 10.9644,17.0817 11.2654,16.797 L17.6826,10.7276 C17.8489,10.5703 17.9489,10.3702 17.9826,10.1614 C17.994,10.1094 18,10.0554 18,10.0000012 C18,9.94241 17.9935,9.88633 17.9812,9.83246 C17.9462,9.62667 17.8467,9.42976 17.6826,9.27455 L11.2654,3.20511 Z"}))))),lr=Ae({props:{onFocus:Function,onBlur:Function},setup(e){return()=>B("div",{style:"width: 0; height: 0",tabindex:0,onFocus:e.onFocus,onBlur:e.onBlur})}});function Gp(e){return Array.isArray(e)?e:[e]}const ou={STOP:"STOP"};function k_(e,t){const n=t(e);e.children!==void 0&&n!==ou.STOP&&e.children.forEach(s=>k_(s,t))}function cL(e,t={}){const{preserveGroup:n=!1}=t,s=[],i=n?d=>{d.isLeaf||(s.push(d.key),a(d.children))}:d=>{d.isLeaf||(d.isGroup||s.push(d.key),a(d.children))};function a(d){d.forEach(i)}return a(e),s}function dL(e,t){const{isLeaf:n}=e;return n!==void 0?n:!t(e)}function uL(e){return e.children}function hL(e){return e.key}function fL(){return!1}function pL(e,t){const{isLeaf:n}=e;return!(n===!1&&!Array.isArray(t(e)))}function vL(e){return e.disabled===!0}function gL(e,t){return e.isLeaf===!1&&!Array.isArray(t(e))}function rd(e){var t;return e==null?[]:Array.isArray(e)?e:(t=e.checkedKeys)!==null&&t!==void 0?t:[]}function od(e){var t;return e==null||Array.isArray(e)?[]:(t=e.indeterminateKeys)!==null&&t!==void 0?t:[]}function mL(e,t){const n=new Set(e);return t.forEach(s=>{n.has(s)||n.add(s)}),Array.from(n)}function _L(e,t){const n=new Set(e);return t.forEach(s=>{n.has(s)&&n.delete(s)}),Array.from(n)}function yL(e){return(e==null?void 0:e.type)==="group"}function bL(e){const t=new Map;return e.forEach((n,s)=>{t.set(n.key,s)}),n=>{var s;return(s=t.get(n))!==null&&s!==void 0?s:null}}class wL extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function SL(e,t,n,s){return Nl(t.concat(e),n,s,!1)}function CL(e,t){const n=new Set;return e.forEach(s=>{const i=t.treeNodeMap.get(s);if(i!==void 0){let a=i.parent;for(;a!==null&&!(a.disabled||n.has(a.key));)n.add(a.key),a=a.parent}}),n}function kL(e,t,n,s){const i=Nl(t,n,s,!1),a=Nl(e,n,s,!0),d=CL(e,n),r=[];return i.forEach(o=>{(a.has(o)||d.has(o))&&r.push(o)}),r.forEach(o=>i.delete(o)),i}function ad(e,t){const{checkedKeys:n,keysToCheck:s,keysToUncheck:i,indeterminateKeys:a,cascade:d,leafOnly:r,checkStrategy:o,allowNotLoaded:c}=e;if(!d)return s!==void 0?{checkedKeys:mL(n,s),indeterminateKeys:Array.from(a)}:i!==void 0?{checkedKeys:_L(n,i),indeterminateKeys:Array.from(a)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(a)};const{levelTreeNodeMap:p}=t;let u;i!==void 0?u=kL(i,n,t,c):s!==void 0?u=SL(s,n,t,c):u=Nl(n,t,c,!1);const g=o==="parent",m=o==="child"||r,y=u,v=new Set,l=Math.max.apply(null,Array.from(p.keys()));for(let h=l;h>=0;h-=1){const f=h===0,_=p.get(h);for(const S of _){if(S.isLeaf)continue;const{key:k,shallowLoaded:P}=S;if(m&&P&&S.children.forEach(A=>{!A.disabled&&!A.isLeaf&&A.shallowLoaded&&y.has(A.key)&&y.delete(A.key)}),S.disabled||!P)continue;let M=!0,w=!1,T=!0;for(const A of S.children){const E=A.key;if(!A.disabled){if(T&&(T=!1),y.has(E))w=!0;else if(v.has(E)){w=!0,M=!1;break}else if(M=!1,w)break}}M&&!T?(g&&S.children.forEach(A=>{!A.disabled&&y.has(A.key)&&y.delete(A.key)}),y.add(k)):w&&v.add(k),f&&m&&y.has(k)&&y.delete(k)}}return{checkedKeys:Array.from(y),indeterminateKeys:Array.from(v)}}function Nl(e,t,n,s){const{treeNodeMap:i,getChildren:a}=t,d=new Set,r=new Set(e);return e.forEach(o=>{const c=i.get(o);c!==void 0&&k_(c,p=>{if(p.disabled)return ou.STOP;const{key:u}=p;if(!d.has(u)&&(d.add(u),r.add(u),gL(p.rawNode,a))){if(s)return ou.STOP;if(!n)throw new wL}})}),r}function xL(e,{includeGroup:t=!1,includeSelf:n=!0},s){var i;const a=s.treeNodeMap;let d=e==null?null:(i=a.get(e))!==null&&i!==void 0?i:null;const r={keyPath:[],treeNodePath:[],treeNode:d};if(d!=null&&d.ignored)return r.treeNode=null,r;for(;d;)!d.ignored&&(t||!d.isGroup)&&r.treeNodePath.push(d),d=d.parent;return r.treeNodePath.reverse(),n||r.treeNodePath.pop(),r.keyPath=r.treeNodePath.map(o=>o.key),r}function RL(e){if(e.length===0)return null;const t=e[0];return t.isGroup||t.ignored||t.disabled?t.getNext():t}function TL(e,t){const n=e.siblings,s=n.length,{index:i}=e;return t?n[(i+1)%s]:i===n.length-1?null:n[i+1]}function Xp(e,t,{loop:n=!1,includeDisabled:s=!1}={}){const i=t==="prev"?PL:TL,a={reverse:t==="prev"};let d=!1,r=null;function o(c){if(c!==null){if(c===e){if(!d)d=!0;else if(!e.disabled&&!e.isGroup){r=e;return}}else if((!c.disabled||s)&&!c.ignored&&!c.isGroup){r=c;return}if(c.isGroup){const p=dh(c,a);p!==null?r=p:o(i(c,n))}else{const p=i(c,!1);if(p!==null)o(p);else{const u=EL(c);u!=null&&u.isGroup?o(i(u,n)):n&&o(i(c,!0))}}}}return o(e),r}function PL(e,t){const n=e.siblings,s=n.length,{index:i}=e;return t?n[(i-1+s)%s]:i===0?null:n[i-1]}function EL(e){return e.parent}function dh(e,t={}){const{reverse:n=!1}=t,{children:s}=e;if(s){const{length:i}=s,a=n?i-1:0,d=n?-1:i,r=n?-1:1;for(let o=a;o!==d;o+=r){const c=s[o];if(!c.disabled&&!c.ignored)if(c.isGroup){const p=dh(c,t);if(p!==null)return p}else return c}}return null}const LL={getChild(){return this.ignored?null:dh(this)},getParent(){const{parent:e}=this;return e!=null&&e.isGroup?e.getParent():e},getNext(e={}){return Xp(this,"next",e)},getPrev(e={}){return Xp(this,"prev",e)}};function DL(e,t){const n=t?new Set(t):void 0,s=[];function i(a){a.forEach(d=>{s.push(d),!(d.isLeaf||!d.children||d.ignored)&&(d.isGroup||n===void 0||n.has(d.key))&&i(d.children)})}return i(e),s}function ML(e,t){const n=e.key;for(;t;){if(t.key===n)return!0;t=t.parent}return!1}function x_(e,t,n,s,i,a=null,d=0){const r=[];return e.forEach((o,c)=>{var p;const u=Object.create(s);if(u.rawNode=o,u.siblings=r,u.level=d,u.index=c,u.isFirstChild=c===0,u.isLastChild=c+1===e.length,u.parent=a,!u.ignored){const g=i(o);Array.isArray(g)&&(u.children=x_(g,t,n,s,i,u,d+1))}r.push(u),t.set(u.key,u),n.has(d)||n.set(d,[]),(p=n.get(d))===null||p===void 0||p.push(u)}),r}function pc(e,t={}){var n;const s=new Map,i=new Map,{getDisabled:a=vL,getIgnored:d=fL,getIsGroup:r=yL,getKey:o=hL}=t,c=(n=t.getChildren)!==null&&n!==void 0?n:uL,p=t.ignoreEmptyChildren?S=>{const k=c(S);return Array.isArray(k)?k.length?k:null:k}:c,u=Object.assign({get key(){return o(this.rawNode)},get disabled(){return a(this.rawNode)},get isGroup(){return r(this.rawNode)},get isLeaf(){return dL(this.rawNode,p)},get shallowLoaded(){return pL(this.rawNode,p)},get ignored(){return d(this.rawNode)},contains(S){return ML(this,S)}},LL),g=x_(e,s,i,u,p);function m(S){if(S==null)return null;const k=s.get(S);return k&&!k.isGroup&&!k.ignored?k:null}function y(S){if(S==null)return null;const k=s.get(S);return k&&!k.ignored?k:null}function v(S,k){const P=y(S);return P?P.getPrev(k):null}function l(S,k){const P=y(S);return P?P.getNext(k):null}function h(S){const k=y(S);return k?k.getParent():null}function f(S){const k=y(S);return k?k.getChild():null}const _={treeNodes:g,treeNodeMap:s,levelTreeNodeMap:i,maxLevel:Math.max(...i.keys()),getChildren:p,getFlattenedNodes(S){return DL(g,S)},getNode:m,getPrev:v,getNext:l,getParent:h,getChild:f,getFirstAvailableNode(){return RL(g)},getPath(S,k={}){return xL(S,k,_)},getCheckedKeys(S,k={}){const{cascade:P=!0,leafOnly:M=!1,checkStrategy:w="all",allowNotLoaded:T=!1}=k;return ad({checkedKeys:rd(S),indeterminateKeys:od(S),cascade:P,leafOnly:M,checkStrategy:w,allowNotLoaded:T},_)},check(S,k,P={}){const{cascade:M=!0,leafOnly:w=!1,checkStrategy:T="all",allowNotLoaded:A=!1}=P;return ad({checkedKeys:rd(k),indeterminateKeys:od(k),keysToCheck:S==null?[]:Gp(S),cascade:M,leafOnly:w,checkStrategy:T,allowNotLoaded:A},_)},uncheck(S,k,P={}){const{cascade:M=!0,leafOnly:w=!1,checkStrategy:T="all",allowNotLoaded:A=!1}=P;return ad({checkedKeys:rd(k),indeterminateKeys:od(k),keysToUncheck:S==null?[]:Gp(S),cascade:M,leafOnly:w,checkStrategy:T,allowNotLoaded:A},_)},getNonLeafKeys(S={}){return cL(g,S)}};return _}const AL=Ce("empty",` - display: flex; - flex-direction: column; - align-items: center; - font-size: var(--n-font-size); -`,[Ge("icon",` - width: var(--n-icon-size); - height: var(--n-icon-size); - font-size: var(--n-icon-size); - line-height: var(--n-icon-size); - color: var(--n-icon-color); - transition: - color .3s var(--n-bezier); - `,[ze("+",[Ge("description",` - margin-top: 8px; - `)])]),Ge("description",` - transition: color .3s var(--n-bezier); - color: var(--n-text-color); - `),Ge("extra",` - text-align: center; - transition: color .3s var(--n-bezier); - margin-top: 12px; - color: var(--n-extra-text-color); - `)]),IL=Object.assign(Object.assign({},Ht.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),R_=Ae({name:"Empty",props:IL,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedComponentPropsRef:s}=mn(e),i=Ht("Empty","-empty",AL,Nb,e,t),{localeRef:a}=Qs("Empty"),d=q(()=>{var p,u,g;return(p=e.description)!==null&&p!==void 0?p:(g=(u=s==null?void 0:s.value)===null||u===void 0?void 0:u.Empty)===null||g===void 0?void 0:g.description}),r=q(()=>{var p,u;return((u=(p=s==null?void 0:s.value)===null||p===void 0?void 0:p.Empty)===null||u===void 0?void 0:u.renderIcon)||(()=>B(iL,null))}),o=q(()=>{const{size:p}=e,{common:{cubicBezierEaseInOut:u},self:{[Mt("iconSize",p)]:g,[Mt("fontSize",p)]:m,textColor:y,iconColor:v,extraTextColor:l}}=i.value;return{"--n-icon-size":g,"--n-font-size":m,"--n-bezier":u,"--n-text-color":y,"--n-icon-color":v,"--n-extra-text-color":l}}),c=n?Un("empty",q(()=>{let p="";const{size:u}=e;return p+=u[0],p}),o,e):void 0;return{mergedClsPrefix:t,mergedRenderIcon:r,localizedDescription:q(()=>d.value||a.value.description),cssVars:n?void 0:o,themeClass:c==null?void 0:c.themeClass,onRender:c==null?void 0:c.onRender}},render(){const{$slots:e,mergedClsPrefix:t,onRender:n}=this;return n==null||n(),B("div",{class:[`${t}-empty`,this.themeClass],style:this.cssVars},this.showIcon?B("div",{class:`${t}-empty__icon`},e.icon?e.icon():B(Kn,{clsPrefix:t},{default:this.mergedRenderIcon})):null,this.showDescription?B("div",{class:`${t}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?B("div",{class:`${t}-empty__extra`},e.extra()):null)}}),Jp=Ae({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:e,renderOptionRef:t,labelFieldRef:n,nodePropsRef:s}=Ut(ih);return{labelField:n,nodeProps:s,renderLabel:e,renderOption:t}},render(){const{clsPrefix:e,renderLabel:t,renderOption:n,nodeProps:s,tmNode:{rawNode:i}}=this,a=s==null?void 0:s(i),d=t?t(i,!1):ui(i[this.labelField],i,!1),r=B("div",Object.assign({},a,{class:[`${e}-base-select-group-header`,a==null?void 0:a.class]}),d);return i.render?i.render({node:r,option:i}):n?n({node:r,option:i,selected:!1}):r}});function $L(e,t){return B(ks,{name:"fade-in-scale-up-transition"},{default:()=>e?B(Kn,{clsPrefix:t,class:`${t}-base-select-option__check`},{default:()=>B(sL)}):null})}const Qp=Ae({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(e){const{valueRef:t,pendingTmNodeRef:n,multipleRef:s,valueSetRef:i,renderLabelRef:a,renderOptionRef:d,labelFieldRef:r,valueFieldRef:o,showCheckmarkRef:c,nodePropsRef:p,handleOptionClick:u,handleOptionMouseEnter:g}=Ut(ih),m=Zt(()=>{const{value:h}=n;return h?e.tmNode.key===h.key:!1});function y(h){const{tmNode:f}=e;f.disabled||u(h,f)}function v(h){const{tmNode:f}=e;f.disabled||g(h,f)}function l(h){const{tmNode:f}=e,{value:_}=m;f.disabled||_||g(h,f)}return{multiple:s,isGrouped:Zt(()=>{const{tmNode:h}=e,{parent:f}=h;return f&&f.rawNode.type==="group"}),showCheckmark:c,nodeProps:p,isPending:m,isSelected:Zt(()=>{const{value:h}=t,{value:f}=s;if(h===null)return!1;const _=e.tmNode.rawNode[o.value];if(f){const{value:S}=i;return S.has(_)}else return h===_}),labelField:r,renderLabel:a,renderOption:d,handleMouseMove:l,handleMouseEnter:v,handleClick:y}},render(){const{clsPrefix:e,tmNode:{rawNode:t},isSelected:n,isPending:s,isGrouped:i,showCheckmark:a,nodeProps:d,renderOption:r,renderLabel:o,handleClick:c,handleMouseEnter:p,handleMouseMove:u}=this,g=$L(n,e),m=o?[o(t,n),a&&g]:[ui(t[this.labelField],t,n),a&&g],y=d==null?void 0:d(t),v=B("div",Object.assign({},y,{class:[`${e}-base-select-option`,t.class,y==null?void 0:y.class,{[`${e}-base-select-option--disabled`]:t.disabled,[`${e}-base-select-option--selected`]:n,[`${e}-base-select-option--grouped`]:i,[`${e}-base-select-option--pending`]:s,[`${e}-base-select-option--show-checkmark`]:a}],style:[(y==null?void 0:y.style)||"",t.style||""],onClick:ua([c,y==null?void 0:y.onClick]),onMouseenter:ua([p,y==null?void 0:y.onMouseenter]),onMousemove:ua([u,y==null?void 0:y.onMousemove])}),B("div",{class:`${e}-base-select-option__content`},m));return t.render?t.render({node:v,option:t,selected:n}):r?r({node:v,option:t,selected:n}):v}}),{cubicBezierEaseIn:Zp,cubicBezierEaseOut:ev}=zb;function Eo({transformOrigin:e="inherit",duration:t=".2s",enterScale:n=".9",originalTransform:s="",originalTransition:i=""}={}){return[ze("&.fade-in-scale-up-transition-leave-active",{transformOrigin:e,transition:`opacity ${t} ${Zp}, transform ${t} ${Zp} ${i&&`,${i}`}`}),ze("&.fade-in-scale-up-transition-enter-active",{transformOrigin:e,transition:`opacity ${t} ${ev}, transform ${t} ${ev} ${i&&`,${i}`}`}),ze("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${s} scale(${n})`}),ze("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${s} scale(1)`})]}const OL=Ce("base-select-menu",` - line-height: 1.5; - outline: none; - z-index: 0; - position: relative; - border-radius: var(--n-border-radius); - transition: - background-color .3s var(--n-bezier), - box-shadow .3s var(--n-bezier); - background-color: var(--n-color); -`,[Ce("scrollbar",` - max-height: var(--n-height); - `),Ce("virtual-list",` - max-height: var(--n-height); - `),Ce("base-select-option",` - min-height: var(--n-option-height); - font-size: var(--n-option-font-size); - display: flex; - align-items: center; - `,[Ge("content",` - z-index: 1; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - `)]),Ce("base-select-group-header",` - min-height: var(--n-option-height); - font-size: .93em; - display: flex; - align-items: center; - `),Ce("base-select-menu-option-wrapper",` - position: relative; - width: 100%; - `),Ge("loading, empty",` - display: flex; - padding: 12px 32px; - flex: 1; - justify-content: center; - `),Ge("loading",` - color: var(--n-loading-color); - font-size: var(--n-loading-size); - `),Ge("header",` - padding: 8px var(--n-option-padding-left); - font-size: var(--n-option-font-size); - transition: - color .3s var(--n-bezier), - border-color .3s var(--n-bezier); - border-bottom: 1px solid var(--n-action-divider-color); - color: var(--n-action-text-color); - `),Ge("action",` - padding: 8px var(--n-option-padding-left); - font-size: var(--n-option-font-size); - transition: - color .3s var(--n-bezier), - border-color .3s var(--n-bezier); - border-top: 1px solid var(--n-action-divider-color); - color: var(--n-action-text-color); - `),Ce("base-select-group-header",` - position: relative; - cursor: default; - padding: var(--n-option-padding); - color: var(--n-group-header-text-color); - `),Ce("base-select-option",` - cursor: pointer; - position: relative; - padding: var(--n-option-padding); - transition: - color .3s var(--n-bezier), - opacity .3s var(--n-bezier); - box-sizing: border-box; - color: var(--n-option-text-color); - opacity: 1; - `,[Ve("show-checkmark",` - padding-right: calc(var(--n-option-padding-right) + 20px); - `),ze("&::before",` - content: ""; - position: absolute; - left: 4px; - right: 4px; - top: 0; - bottom: 0; - border-radius: var(--n-border-radius); - transition: background-color .3s var(--n-bezier); - `),ze("&:active",` - color: var(--n-option-text-color-pressed); - `),Ve("grouped",` - padding-left: calc(var(--n-option-padding-left) * 1.5); - `),Ve("pending",[ze("&::before",` - background-color: var(--n-option-color-pending); - `)]),Ve("selected",` - color: var(--n-option-text-color-active); - `,[ze("&::before",` - background-color: var(--n-option-color-active); - `),Ve("pending",[ze("&::before",` - background-color: var(--n-option-color-active-pending); - `)])]),Ve("disabled",` - cursor: not-allowed; - `,[Cn("selected",` - color: var(--n-option-text-color-disabled); - `),Ve("selected",` - opacity: var(--n-option-opacity-disabled); - `)]),Ge("check",` - font-size: 16px; - position: absolute; - right: calc(var(--n-option-padding-right) - 4px); - top: calc(50% - 7px); - color: var(--n-option-check-color); - transition: color .3s var(--n-bezier); - `,[Eo({enterScale:"0.5"})])])]),T_=Ae({name:"InternalSelectMenu",props:Object.assign(Object.assign({},Ht.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=mn(e),s=pi("InternalSelectMenu",n,t),i=Ht("InternalSelectMenu","-internal-select-menu",OL,Ub,e,ct(e,"clsPrefix")),a=H(null),d=H(null),r=H(null),o=q(()=>e.treeMate.getFlattenedNodes()),c=q(()=>bL(o.value)),p=H(null);function u(){const{treeMate:G}=e;let te=null;const{value:oe}=e;oe===null?te=G.getFirstAvailableNode():(e.multiple?te=G.getNode((oe||[])[(oe||[]).length-1]):te=G.getNode(oe),(!te||te.disabled)&&(te=G.getFirstAvailableNode())),I(te||null)}function g(){const{value:G}=p;G&&!e.treeMate.getNode(G.key)&&(p.value=null)}let m;_t(()=>e.show,G=>{G?m=_t(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?u():g(),un(O)):g()},{immediate:!0}):m==null||m()},{immediate:!0}),Vt(()=>{m==null||m()});const y=q(()=>so(i.value.self[Mt("optionHeight",e.size)])),v=q(()=>io(i.value.self[Mt("padding",e.size)])),l=q(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),h=q(()=>{const G=o.value;return G&&G.length===0});function f(G){const{onToggle:te}=e;te&&te(G)}function _(G){const{onScroll:te}=e;te&&te(G)}function S(G){var te;(te=r.value)===null||te===void 0||te.sync(),_(G)}function k(){var G;(G=r.value)===null||G===void 0||G.sync()}function P(){const{value:G}=p;return G||null}function M(G,te){te.disabled||I(te,!1)}function w(G,te){te.disabled||f(te)}function T(G){var te;Rs(G,"action")||(te=e.onKeyup)===null||te===void 0||te.call(e,G)}function A(G){var te;Rs(G,"action")||(te=e.onKeydown)===null||te===void 0||te.call(e,G)}function E(G){var te;(te=e.onMousedown)===null||te===void 0||te.call(e,G),!e.focusable&&G.preventDefault()}function R(){const{value:G}=p;G&&I(G.getNext({loop:!0}),!0)}function D(){const{value:G}=p;G&&I(G.getPrev({loop:!0}),!0)}function I(G,te=!1){p.value=G,te&&O()}function O(){var G,te;const oe=p.value;if(!oe)return;const re=c.value(oe.key);re!==null&&(e.virtualScroll?(G=d.value)===null||G===void 0||G.scrollTo({index:re}):(te=r.value)===null||te===void 0||te.scrollTo({index:re,elSize:y.value}))}function U(G){var te,oe;!((te=a.value)===null||te===void 0)&&te.contains(G.target)&&((oe=e.onFocus)===null||oe===void 0||oe.call(e,G))}function W(G){var te,oe;!((te=a.value)===null||te===void 0)&&te.contains(G.relatedTarget)||(oe=e.onBlur)===null||oe===void 0||oe.call(e,G)}kn(ih,{handleOptionMouseEnter:M,handleOptionClick:w,valueSetRef:l,pendingTmNodeRef:p,nodePropsRef:ct(e,"nodeProps"),showCheckmarkRef:ct(e,"showCheckmark"),multipleRef:ct(e,"multiple"),valueRef:ct(e,"value"),renderLabelRef:ct(e,"renderLabel"),renderOptionRef:ct(e,"renderOption"),labelFieldRef:ct(e,"labelField"),valueFieldRef:ct(e,"valueField")}),kn(a_,a),Dt(()=>{const{value:G}=r;G&&G.sync()});const N=q(()=>{const{size:G}=e,{common:{cubicBezierEaseInOut:te},self:{height:oe,borderRadius:re,color:ye,groupHeaderTextColor:K,actionDividerColor:J,optionTextColorPressed:Q,optionTextColor:de,optionTextColorDisabled:De,optionTextColorActive:Pe,optionOpacityDisabled:Ye,optionCheckColor:st,actionTextColor:yt,optionColorPending:ce,optionColorActive:ae,loadingColor:be,loadingSize:he,optionColorActivePending:Le,[Mt("optionFontSize",G)]:et,[Mt("optionHeight",G)]:je,[Mt("optionPadding",G)]:_e}}=i.value;return{"--n-height":oe,"--n-action-divider-color":J,"--n-action-text-color":yt,"--n-bezier":te,"--n-border-radius":re,"--n-color":ye,"--n-option-font-size":et,"--n-group-header-text-color":K,"--n-option-check-color":st,"--n-option-color-pending":ce,"--n-option-color-active":ae,"--n-option-color-active-pending":Le,"--n-option-height":je,"--n-option-opacity-disabled":Ye,"--n-option-text-color":de,"--n-option-text-color-active":Pe,"--n-option-text-color-disabled":De,"--n-option-text-color-pressed":Q,"--n-option-padding":_e,"--n-option-padding-left":io(_e,"left"),"--n-option-padding-right":io(_e,"right"),"--n-loading-color":be,"--n-loading-size":he}}),{inlineThemeDisabled:z}=e,V=z?Un("internal-select-menu",q(()=>e.size[0]),N,e):void 0,j={selfRef:a,next:R,prev:D,getPendingTmNode:P};return __(a,e.onResize),Object.assign({mergedTheme:i,mergedClsPrefix:t,rtlEnabled:s,virtualListRef:d,scrollbarRef:r,itemSize:y,padding:v,flattenedNodes:o,empty:h,virtualListContainer(){const{value:G}=d;return G==null?void 0:G.listElRef},virtualListContent(){const{value:G}=d;return G==null?void 0:G.itemsElRef},doScroll:_,handleFocusin:U,handleFocusout:W,handleKeyUp:T,handleKeyDown:A,handleMouseDown:E,handleVirtualListResize:k,handleVirtualListScroll:S,cssVars:z?void 0:N,themeClass:V==null?void 0:V.themeClass,onRender:V==null?void 0:V.onRender},j)},render(){const{$slots:e,virtualScroll:t,clsPrefix:n,mergedTheme:s,themeClass:i,onRender:a}=this;return a==null||a(),B("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${n}-base-select-menu`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,i,this.multiple&&`${n}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},Us(e.header,d=>d&&B("div",{class:`${n}-base-select-menu__header`,"data-header":!0,key:"header"},d)),this.loading?B("div",{class:`${n}-base-select-menu__loading`},B(tc,{clsPrefix:n,strokeWidth:20})):this.empty?B("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},Jt(e.empty,()=>[B(R_,{theme:s.peers.Empty,themeOverrides:s.peerOverrides.Empty,size:this.size})])):B(As,{ref:"scrollbarRef",theme:s.peers.Scrollbar,themeOverrides:s.peerOverrides.Scrollbar,scrollable:this.scrollable,container:t?this.virtualListContainer:void 0,content:t?this.virtualListContent:void 0,onScroll:t?void 0:this.doScroll},{default:()=>t?B(go,{ref:"virtualListRef",class:`${n}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:d})=>d.isGroup?B(Jp,{key:d.key,clsPrefix:n,tmNode:d}):d.ignored?null:B(Qp,{clsPrefix:n,key:d.key,tmNode:d})}):B("div",{class:`${n}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(d=>d.isGroup?B(Jp,{key:d.key,clsPrefix:n,tmNode:d}):B(Qp,{clsPrefix:n,key:d.key,tmNode:d})))}),Us(e.action,d=>d&&[B("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},d),B(lr,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),ld={top:"bottom",bottom:"top",left:"right",right:"left"},Vn="var(--n-arrow-height) * 1.414",FL=ze([Ce("popover",` - transition: - box-shadow .3s var(--n-bezier), - background-color .3s var(--n-bezier), - color .3s var(--n-bezier); - position: relative; - font-size: var(--n-font-size); - color: var(--n-text-color); - box-shadow: var(--n-box-shadow); - word-break: break-word; - `,[ze(">",[Ce("scrollbar",` - height: inherit; - max-height: inherit; - `)]),Cn("raw",` - background-color: var(--n-color); - border-radius: var(--n-border-radius); - `,[Cn("scrollable",[Cn("show-header-or-footer","padding: var(--n-padding);")])]),Ge("header",` - padding: var(--n-padding); - border-bottom: 1px solid var(--n-divider-color); - transition: border-color .3s var(--n-bezier); - `),Ge("footer",` - padding: var(--n-padding); - border-top: 1px solid var(--n-divider-color); - transition: border-color .3s var(--n-bezier); - `),Ve("scrollable, show-header-or-footer",[Ge("content",` - padding: var(--n-padding); - `)])]),Ce("popover-shared",` - transform-origin: inherit; - `,[Ce("popover-arrow-wrapper",` - position: absolute; - overflow: hidden; - pointer-events: none; - `,[Ce("popover-arrow",` - transition: background-color .3s var(--n-bezier); - position: absolute; - display: block; - width: calc(${Vn}); - height: calc(${Vn}); - box-shadow: 0 0 8px 0 rgba(0, 0, 0, .12); - transform: rotate(45deg); - background-color: var(--n-color); - pointer-events: all; - `)]),ze("&.popover-transition-enter-from, &.popover-transition-leave-to",` - opacity: 0; - transform: scale(.85); - `),ze("&.popover-transition-enter-to, &.popover-transition-leave-from",` - transform: scale(1); - opacity: 1; - `),ze("&.popover-transition-enter-active",` - transition: - box-shadow .3s var(--n-bezier), - background-color .3s var(--n-bezier), - color .3s var(--n-bezier), - opacity .15s var(--n-bezier-ease-out), - transform .15s var(--n-bezier-ease-out); - `),ze("&.popover-transition-leave-active",` - transition: - box-shadow .3s var(--n-bezier), - background-color .3s var(--n-bezier), - color .3s var(--n-bezier), - opacity .15s var(--n-bezier-ease-in), - transform .15s var(--n-bezier-ease-in); - `)]),Os("top-start",` - top: calc(${Vn} / -2); - left: calc(${Si("top-start")} - var(--v-offset-left)); - `),Os("top",` - top: calc(${Vn} / -2); - transform: translateX(calc(${Vn} / -2)) rotate(45deg); - left: 50%; - `),Os("top-end",` - top: calc(${Vn} / -2); - right: calc(${Si("top-end")} + var(--v-offset-left)); - `),Os("bottom-start",` - bottom: calc(${Vn} / -2); - left: calc(${Si("bottom-start")} - var(--v-offset-left)); - `),Os("bottom",` - bottom: calc(${Vn} / -2); - transform: translateX(calc(${Vn} / -2)) rotate(45deg); - left: 50%; - `),Os("bottom-end",` - bottom: calc(${Vn} / -2); - right: calc(${Si("bottom-end")} + var(--v-offset-left)); - `),Os("left-start",` - left: calc(${Vn} / -2); - top: calc(${Si("left-start")} - var(--v-offset-top)); - `),Os("left",` - left: calc(${Vn} / -2); - transform: translateY(calc(${Vn} / -2)) rotate(45deg); - top: 50%; - `),Os("left-end",` - left: calc(${Vn} / -2); - bottom: calc(${Si("left-end")} + var(--v-offset-top)); - `),Os("right-start",` - right: calc(${Vn} / -2); - top: calc(${Si("right-start")} - var(--v-offset-top)); - `),Os("right",` - right: calc(${Vn} / -2); - transform: translateY(calc(${Vn} / -2)) rotate(45deg); - top: 50%; - `),Os("right-end",` - right: calc(${Vn} / -2); - bottom: calc(${Si("right-end")} + var(--v-offset-top)); - `),...eL({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(e,t)=>{const n=["right","left"].includes(t),s=n?"width":"height";return e.map(i=>{const a=i.split("-")[1]==="end",r=`calc((${`var(--v-target-${s}, 0px)`} - ${Vn}) / 2)`,o=Si(i);return ze(`[v-placement="${i}"] >`,[Ce("popover-shared",[Ve("center-arrow",[Ce("popover-arrow",`${t}: calc(max(${r}, ${o}) ${a?"+":"-"} var(--v-offset-${n?"left":"top"}));`)])])])})})]);function Si(e){return["top","bottom"].includes(e.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function Os(e,t){const n=e.split("-")[0],s=["top","bottom"].includes(n)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return ze(`[v-placement="${e}"] >`,[Ce("popover-shared",` - margin-${ld[n]}: var(--n-space); - `,[Ve("show-arrow",` - margin-${ld[n]}: var(--n-space-arrow); - `),Ve("overlap",` - margin: 0; - `),Vb("popover-arrow-wrapper",` - right: 0; - left: 0; - top: 0; - bottom: 0; - ${n}: 100%; - ${ld[n]}: auto; - ${s} - `,[Ce("popover-arrow",t)])])])}const P_=Object.assign(Object.assign({},Ht.props),{to:cs.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number});function E_({arrowClass:e,arrowStyle:t,arrowWrapperClass:n,arrowWrapperStyle:s,clsPrefix:i}){return B("div",{key:"__popover-arrow__",style:s,class:[`${i}-popover-arrow-wrapper`,n]},B("div",{class:[`${i}-popover-arrow`,e],style:t}))}const BL=Ae({name:"PopoverBody",inheritAttrs:!1,props:P_,setup(e,{slots:t,attrs:n}){const{namespaceRef:s,mergedClsPrefixRef:i,inlineThemeDisabled:a}=mn(e),d=Ht("Popover","-popover",FL,Kb,e,i),r=H(null),o=Ut("NPopover"),c=H(null),p=H(e.show),u=H(!1);Vs(()=>{const{show:M}=e;M&&!NP()&&!e.internalDeactivateImmediately&&(u.value=!0)});const g=q(()=>{const{trigger:M,onClickoutside:w}=e,T=[],{positionManuallyRef:{value:A}}=o;return A||(M==="click"&&!w&&T.push([Ar,S,void 0,{capture:!0}]),M==="hover"&&T.push([SP,_])),w&&T.push([Ar,S,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&u.value)&&T.push([Ss,e.show]),T}),m=q(()=>{const{common:{cubicBezierEaseInOut:M,cubicBezierEaseIn:w,cubicBezierEaseOut:T},self:{space:A,spaceArrow:E,padding:R,fontSize:D,textColor:I,dividerColor:O,color:U,boxShadow:W,borderRadius:N,arrowHeight:z,arrowOffset:V,arrowOffsetVertical:j}}=d.value;return{"--n-box-shadow":W,"--n-bezier":M,"--n-bezier-ease-in":w,"--n-bezier-ease-out":T,"--n-font-size":D,"--n-text-color":I,"--n-color":U,"--n-divider-color":O,"--n-border-radius":N,"--n-arrow-height":z,"--n-arrow-offset":V,"--n-arrow-offset-vertical":j,"--n-padding":R,"--n-space":A,"--n-space-arrow":E}}),y=q(()=>{const M=e.width==="trigger"?void 0:ls(e.width),w=[];M&&w.push({width:M});const{maxWidth:T,minWidth:A}=e;return T&&w.push({maxWidth:ls(T)}),A&&w.push({maxWidth:ls(A)}),a||w.push(m.value),w}),v=a?Un("popover",void 0,m,e):void 0;o.setBodyInstance({syncPosition:l}),Vt(()=>{o.setBodyInstance(null)}),_t(ct(e,"show"),M=>{e.animated||(M?p.value=!0:p.value=!1)});function l(){var M;(M=r.value)===null||M===void 0||M.syncPosition()}function h(M){e.trigger==="hover"&&e.keepAliveOnHover&&e.show&&o.handleMouseEnter(M)}function f(M){e.trigger==="hover"&&e.keepAliveOnHover&&o.handleMouseLeave(M)}function _(M){e.trigger==="hover"&&!k().contains(Dr(M))&&o.handleMouseMoveOutside(M)}function S(M){(e.trigger==="click"&&!k().contains(Dr(M))||e.onClickoutside)&&o.handleClickOutside(M)}function k(){return o.getTriggerElement()}kn(hc,c),kn(rh,null),kn(oh,null);function P(){if(v==null||v.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&u.value))return null;let w;const T=o.internalRenderBodyRef.value,{value:A}=i;if(T)w=T([`${A}-popover-shared`,v==null?void 0:v.themeClass.value,e.overlap&&`${A}-popover-shared--overlap`,e.showArrow&&`${A}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${A}-popover-shared--center-arrow`],c,y.value,h,f);else{const{value:E}=o.extraClassRef,{internalTrapFocus:R}=e,D=!qh(t.header)||!qh(t.footer),I=()=>{var O,U;const W=D?B(Ie,null,Us(t.header,V=>V?B("div",{class:[`${A}-popover__header`,e.headerClass],style:e.headerStyle},V):null),Us(t.default,V=>V?B("div",{class:[`${A}-popover__content`,e.contentClass],style:e.contentStyle},t):null),Us(t.footer,V=>V?B("div",{class:[`${A}-popover__footer`,e.footerClass],style:e.footerStyle},V):null)):e.scrollable?(O=t.default)===null||O===void 0?void 0:O.call(t):B("div",{class:[`${A}-popover__content`,e.contentClass],style:e.contentStyle},t),N=e.scrollable?B(dg,{contentClass:D?void 0:`${A}-popover__content ${(U=e.contentClass)!==null&&U!==void 0?U:""}`,contentStyle:D?void 0:e.contentStyle},{default:()=>W}):W,z=e.showArrow?E_({arrowClass:e.arrowClass,arrowStyle:e.arrowStyle,arrowWrapperClass:e.arrowWrapperClass,arrowWrapperStyle:e.arrowWrapperStyle,clsPrefix:A}):null;return[N,z]};w=B("div",nr({class:[`${A}-popover`,`${A}-popover-shared`,v==null?void 0:v.themeClass.value,E.map(O=>`${A}-${O}`),{[`${A}-popover--scrollable`]:e.scrollable,[`${A}-popover--show-header-or-footer`]:D,[`${A}-popover--raw`]:e.raw,[`${A}-popover-shared--overlap`]:e.overlap,[`${A}-popover-shared--show-arrow`]:e.showArrow,[`${A}-popover-shared--center-arrow`]:e.arrowPointToCenter}],ref:c,style:y.value,onKeydown:o.handleKeydown,onMouseenter:h,onMouseleave:f},n),R?B(BP,{active:e.show,autoFocus:!0},{default:I}):I())}return rt(w,g.value)}return{displayed:u,namespace:s,isMounted:o.isMountedRef,zIndex:o.zIndexRef,followerRef:r,adjustedTo:cs(e),followerEnabled:p,renderContentNode:P}},render(){return B(Po,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===cs.tdkey},{default:()=>this.animated?B(ks,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var e;(e=this.internalOnAfterLeave)===null||e===void 0||e.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}}),HL=Object.keys(P_),NL={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function zL(e,t,n){NL[t].forEach(s=>{e.props?e.props=Object.assign({},e.props):e.props={};const i=e.props[s],a=n[s];i?e.props[s]=(...d)=>{i(...d),a(...d)}:e.props[s]=a})}const Ir={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:cs.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},UL=Object.assign(Object.assign(Object.assign({},Ht.props),Ir),{internalOnAfterLeave:Function,internalRenderBody:Function}),Lo=Ae({name:"Popover",inheritAttrs:!1,props:UL,__popover__:!0,setup(e){const t=Sa(),n=H(null),s=q(()=>e.show),i=H(e.defaultShow),a=ss(s,i),d=Zt(()=>e.disabled?!1:a.value),r=()=>{if(e.disabled)return!0;const{getDisabled:O}=e;return!!(O!=null&&O())},o=()=>r()?!1:a.value,c=nh(e,["arrow","showArrow"]),p=q(()=>e.overlap?!1:c.value);let u=null;const g=H(null),m=H(null),y=Zt(()=>e.x!==void 0&&e.y!==void 0);function v(O){const{"onUpdate:show":U,onUpdateShow:W,onShow:N,onHide:z}=e;i.value=O,U&&Je(U,O),W&&Je(W,O),O&&N&&Je(N,!0),O&&z&&Je(z,!1)}function l(){u&&u.syncPosition()}function h(){const{value:O}=g;O&&(window.clearTimeout(O),g.value=null)}function f(){const{value:O}=m;O&&(window.clearTimeout(O),m.value=null)}function _(){const O=r();if(e.trigger==="focus"&&!O){if(o())return;v(!0)}}function S(){const O=r();if(e.trigger==="focus"&&!O){if(!o())return;v(!1)}}function k(){const O=r();if(e.trigger==="hover"&&!O){if(f(),g.value!==null||o())return;const U=()=>{v(!0),g.value=null},{delay:W}=e;W===0?U():g.value=window.setTimeout(U,W)}}function P(){const O=r();if(e.trigger==="hover"&&!O){if(h(),m.value!==null||!o())return;const U=()=>{v(!1),m.value=null},{duration:W}=e;W===0?U():m.value=window.setTimeout(U,W)}}function M(){P()}function w(O){var U;o()&&(e.trigger==="click"&&(h(),f(),v(!1)),(U=e.onClickoutside)===null||U===void 0||U.call(e,O))}function T(){if(e.trigger==="click"&&!r()){h(),f();const O=!o();v(O)}}function A(O){e.internalTrapFocus&&O.key==="Escape"&&(h(),f(),v(!1))}function E(O){i.value=O}function R(){var O;return(O=n.value)===null||O===void 0?void 0:O.targetRef}function D(O){u=O}return kn("NPopover",{getTriggerElement:R,handleKeydown:A,handleMouseEnter:k,handleMouseLeave:P,handleClickOutside:w,handleMouseMoveOutside:M,setBodyInstance:D,positionManuallyRef:y,isMountedRef:t,zIndexRef:ct(e,"zIndex"),extraClassRef:ct(e,"internalExtraClass"),internalRenderBodyRef:ct(e,"internalRenderBody")}),Vs(()=>{a.value&&r()&&v(!1)}),{binderInstRef:n,positionManually:y,mergedShowConsideringDisabledProp:d,uncontrolledShow:i,mergedShowArrow:p,getMergedShow:o,setShow:E,handleClick:T,handleMouseEnter:k,handleMouseLeave:P,handleFocus:_,handleBlur:S,syncPosition:l}},render(){var e;const{positionManually:t,$slots:n}=this;let s,i=!1;if(!t&&(n.activator?s=$p(n,"activator"):s=$p(n,"trigger"),s)){s=Wb(s),s=s.type===jb?B("span",[s]):s;const a={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((e=s.type)===null||e===void 0)&&e.__popover__)i=!0,s.props||(s.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),s.props.internalSyncTargetWithParent=!0,s.props.internalInheritedEventHandlers?s.props.internalInheritedEventHandlers=[a,...s.props.internalInheritedEventHandlers]:s.props.internalInheritedEventHandlers=[a];else{const{internalInheritedEventHandlers:d}=this,r=[a,...d],o={onBlur:c=>{r.forEach(p=>{p.onBlur(c)})},onFocus:c=>{r.forEach(p=>{p.onFocus(c)})},onClick:c=>{r.forEach(p=>{p.onClick(c)})},onMouseenter:c=>{r.forEach(p=>{p.onMouseenter(c)})},onMouseleave:c=>{r.forEach(p=>{p.onMouseleave(c)})}};zL(s,d?"nested":t?"manual":this.trigger,o)}}return B(Ro,{ref:"binderInstRef",syncTarget:!i,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const a=this.getMergedShow();return[this.internalTrapFocus&&a?rt(B("div",{style:{position:"fixed",top:0,right:0,bottom:0,left:0}}),[[u_,{enabled:a,zIndex:this.zIndex}]]):null,t?null:B(To,null,{default:()=>s}),B(BL,fc(this.$props,HL,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:a})),{default:()=>{var d,r;return(r=(d=this.$slots).default)===null||r===void 0?void 0:r.call(d)},header:()=>{var d,r;return(r=(d=this.$slots).header)===null||r===void 0?void 0:r.call(d)},footer:()=>{var d,r;return(r=(d=this.$slots).footer)===null||r===void 0?void 0:r.call(d)}})]}})}});function VL(e){const{textColor2:t,primaryColorHover:n,primaryColorPressed:s,primaryColor:i,infoColor:a,successColor:d,warningColor:r,errorColor:o,baseColor:c,borderColor:p,opacityDisabled:u,tagColor:g,closeIconColor:m,closeIconColorHover:y,closeIconColorPressed:v,borderRadiusSmall:l,fontSizeMini:h,fontSizeTiny:f,fontSizeSmall:_,fontSizeMedium:S,heightMini:k,heightTiny:P,heightSmall:M,heightMedium:w,closeColorHover:T,closeColorPressed:A,buttonColor2Hover:E,buttonColor2Pressed:R,fontWeightStrong:D}=e;return Object.assign(Object.assign({},qb),{closeBorderRadius:l,heightTiny:k,heightSmall:P,heightMedium:M,heightLarge:w,borderRadius:l,opacityDisabled:u,fontSizeTiny:h,fontSizeSmall:f,fontSizeMedium:_,fontSizeLarge:S,fontWeightStrong:D,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:c,colorCheckable:"#0000",colorHoverCheckable:E,colorPressedCheckable:R,colorChecked:i,colorCheckedHover:n,colorCheckedPressed:s,border:`1px solid ${p}`,textColor:t,color:g,colorBordered:"rgb(250, 250, 252)",closeIconColor:m,closeIconColorHover:y,closeIconColorPressed:v,closeColorHover:T,closeColorPressed:A,borderPrimary:`1px solid ${wn(i,{alpha:.3})}`,textColorPrimary:i,colorPrimary:wn(i,{alpha:.12}),colorBorderedPrimary:wn(i,{alpha:.1}),closeIconColorPrimary:i,closeIconColorHoverPrimary:i,closeIconColorPressedPrimary:i,closeColorHoverPrimary:wn(i,{alpha:.12}),closeColorPressedPrimary:wn(i,{alpha:.18}),borderInfo:`1px solid ${wn(a,{alpha:.3})}`,textColorInfo:a,colorInfo:wn(a,{alpha:.12}),colorBorderedInfo:wn(a,{alpha:.1}),closeIconColorInfo:a,closeIconColorHoverInfo:a,closeIconColorPressedInfo:a,closeColorHoverInfo:wn(a,{alpha:.12}),closeColorPressedInfo:wn(a,{alpha:.18}),borderSuccess:`1px solid ${wn(d,{alpha:.3})}`,textColorSuccess:d,colorSuccess:wn(d,{alpha:.12}),colorBorderedSuccess:wn(d,{alpha:.1}),closeIconColorSuccess:d,closeIconColorHoverSuccess:d,closeIconColorPressedSuccess:d,closeColorHoverSuccess:wn(d,{alpha:.12}),closeColorPressedSuccess:wn(d,{alpha:.18}),borderWarning:`1px solid ${wn(r,{alpha:.35})}`,textColorWarning:r,colorWarning:wn(r,{alpha:.15}),colorBorderedWarning:wn(r,{alpha:.12}),closeIconColorWarning:r,closeIconColorHoverWarning:r,closeIconColorPressedWarning:r,closeColorHoverWarning:wn(r,{alpha:.12}),closeColorPressedWarning:wn(r,{alpha:.18}),borderError:`1px solid ${wn(o,{alpha:.23})}`,textColorError:o,colorError:wn(o,{alpha:.1}),colorBorderedError:wn(o,{alpha:.08}),closeIconColorError:o,closeIconColorHoverError:o,closeIconColorPressedError:o,closeColorHoverError:wn(o,{alpha:.12}),closeColorPressedError:wn(o,{alpha:.18})})}const KL={common:ug,self:VL},WL={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},jL=Ce("tag",` - --n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left); - white-space: nowrap; - position: relative; - box-sizing: border-box; - cursor: default; - display: inline-flex; - align-items: center; - flex-wrap: nowrap; - padding: var(--n-padding); - border-radius: var(--n-border-radius); - color: var(--n-text-color); - background-color: var(--n-color); - transition: - border-color .3s var(--n-bezier), - background-color .3s var(--n-bezier), - color .3s var(--n-bezier), - box-shadow .3s var(--n-bezier), - opacity .3s var(--n-bezier); - line-height: 1; - height: var(--n-height); - font-size: var(--n-font-size); -`,[Ve("strong",` - font-weight: var(--n-font-weight-strong); - `),Ge("border",` - pointer-events: none; - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - border-radius: inherit; - border: var(--n-border); - transition: border-color .3s var(--n-bezier); - `),Ge("icon",` - display: flex; - margin: 0 4px 0 0; - color: var(--n-text-color); - transition: color .3s var(--n-bezier); - font-size: var(--n-avatar-size-override); - `),Ge("avatar",` - display: flex; - margin: 0 6px 0 0; - `),Ge("close",` - margin: var(--n-close-margin); - transition: - background-color .3s var(--n-bezier), - color .3s var(--n-bezier); - `),Ve("round",` - padding: 0 calc(var(--n-height) / 3); - border-radius: calc(var(--n-height) / 2); - `,[Ge("icon",` - margin: 0 4px 0 calc((var(--n-height) - 8px) / -2); - `),Ge("avatar",` - margin: 0 6px 0 calc((var(--n-height) - 8px) / -2); - `),Ve("closable",` - padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3); - `)]),Ve("icon, avatar",[Ve("round",` - padding: 0 calc(var(--n-height) / 3) 0 calc(var(--n-height) / 2); - `)]),Ve("disabled",` - cursor: not-allowed !important; - opacity: var(--n-opacity-disabled); - `),Ve("checkable",` - cursor: pointer; - box-shadow: none; - color: var(--n-text-color-checkable); - background-color: var(--n-color-checkable); - `,[Cn("disabled",[ze("&:hover","background-color: var(--n-color-hover-checkable);",[Cn("checked","color: var(--n-text-color-hover-checkable);")]),ze("&:active","background-color: var(--n-color-pressed-checkable);",[Cn("checked","color: var(--n-text-color-pressed-checkable);")])]),Ve("checked",` - color: var(--n-text-color-checked); - background-color: var(--n-color-checked); - `,[Cn("disabled",[ze("&:hover","background-color: var(--n-color-checked-hover);"),ze("&:active","background-color: var(--n-color-checked-pressed);")])])])]),qL=Object.assign(Object.assign(Object.assign({},Ht.props),WL),{bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function}),YL=ds("n-tag"),Lr=Ae({name:"Tag",props:qL,setup(e){const t=H(null),{mergedBorderedRef:n,mergedClsPrefixRef:s,inlineThemeDisabled:i,mergedRtlRef:a}=mn(e),d=Ht("Tag","-tag",jL,KL,e,s);kn(YL,{roundRef:ct(e,"round")});function r(){if(!e.disabled&&e.checkable){const{checked:m,onCheckedChange:y,onUpdateChecked:v,"onUpdate:checked":l}=e;v&&v(!m),l&&l(!m),y&&y(!m)}}function o(m){if(e.triggerClickOnClose||m.stopPropagation(),!e.disabled){const{onClose:y}=e;y&&Je(y,m)}}const c={setTextContent(m){const{value:y}=t;y&&(y.textContent=m)}},p=pi("Tag",a,s),u=q(()=>{const{type:m,size:y,color:{color:v,textColor:l}={}}=e,{common:{cubicBezierEaseInOut:h},self:{padding:f,closeMargin:_,borderRadius:S,opacityDisabled:k,textColorCheckable:P,textColorHoverCheckable:M,textColorPressedCheckable:w,textColorChecked:T,colorCheckable:A,colorHoverCheckable:E,colorPressedCheckable:R,colorChecked:D,colorCheckedHover:I,colorCheckedPressed:O,closeBorderRadius:U,fontWeightStrong:W,[Mt("colorBordered",m)]:N,[Mt("closeSize",y)]:z,[Mt("closeIconSize",y)]:V,[Mt("fontSize",y)]:j,[Mt("height",y)]:G,[Mt("color",m)]:te,[Mt("textColor",m)]:oe,[Mt("border",m)]:re,[Mt("closeIconColor",m)]:ye,[Mt("closeIconColorHover",m)]:K,[Mt("closeIconColorPressed",m)]:J,[Mt("closeColorHover",m)]:Q,[Mt("closeColorPressed",m)]:de}}=d.value,De=io(_);return{"--n-font-weight-strong":W,"--n-avatar-size-override":`calc(${G} - 8px)`,"--n-bezier":h,"--n-border-radius":S,"--n-border":re,"--n-close-icon-size":V,"--n-close-color-pressed":de,"--n-close-color-hover":Q,"--n-close-border-radius":U,"--n-close-icon-color":ye,"--n-close-icon-color-hover":K,"--n-close-icon-color-pressed":J,"--n-close-icon-color-disabled":ye,"--n-close-margin-top":De.top,"--n-close-margin-right":De.right,"--n-close-margin-bottom":De.bottom,"--n-close-margin-left":De.left,"--n-close-size":z,"--n-color":v||(n.value?N:te),"--n-color-checkable":A,"--n-color-checked":D,"--n-color-checked-hover":I,"--n-color-checked-pressed":O,"--n-color-hover-checkable":E,"--n-color-pressed-checkable":R,"--n-font-size":j,"--n-height":G,"--n-opacity-disabled":k,"--n-padding":f,"--n-text-color":l||oe,"--n-text-color-checkable":P,"--n-text-color-checked":T,"--n-text-color-hover-checkable":M,"--n-text-color-pressed-checkable":w}}),g=i?Un("tag",q(()=>{let m="";const{type:y,size:v,color:{color:l,textColor:h}={}}=e;return m+=y[0],m+=v[0],l&&(m+=`a${Yh(l)}`),h&&(m+=`b${Yh(h)}`),n.value&&(m+="c"),m}),u,e):void 0;return Object.assign(Object.assign({},c),{rtlEnabled:p,mergedClsPrefix:s,contentRef:t,mergedBordered:n,handleClick:r,handleCloseClick:o,cssVars:i?void 0:u,themeClass:g==null?void 0:g.themeClass,onRender:g==null?void 0:g.onRender})},render(){var e,t;const{mergedClsPrefix:n,rtlEnabled:s,closable:i,color:{borderColor:a}={},round:d,onRender:r,$slots:o}=this;r==null||r();const c=Us(o.avatar,u=>u&&B("div",{class:`${n}-tag__avatar`},u)),p=Us(o.icon,u=>u&&B("div",{class:`${n}-tag__icon`},u));return B("div",{class:[`${n}-tag`,this.themeClass,{[`${n}-tag--rtl`]:s,[`${n}-tag--strong`]:this.strong,[`${n}-tag--disabled`]:this.disabled,[`${n}-tag--checkable`]:this.checkable,[`${n}-tag--checked`]:this.checkable&&this.checked,[`${n}-tag--round`]:d,[`${n}-tag--avatar`]:c,[`${n}-tag--icon`]:p,[`${n}-tag--closable`]:i}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},p||c,B("span",{class:`${n}-tag__content`,ref:"contentRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)),!this.checkable&&i?B(Yb,{clsPrefix:n,class:`${n}-tag__close`,disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:d,isButtonTag:this.internalCloseIsButtonTag,absolute:!0}):null,!this.checkable&&this.mergedBordered?B("div",{class:`${n}-tag__border`,style:{borderColor:a}}):null)}}),GL=ze([Ce("base-selection",` - --n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left); - --n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left); - position: relative; - z-index: auto; - box-shadow: none; - width: 100%; - max-width: 100%; - display: inline-block; - vertical-align: bottom; - border-radius: var(--n-border-radius); - min-height: var(--n-height); - line-height: 1.5; - font-size: var(--n-font-size); - `,[Ce("base-loading",` - color: var(--n-loading-color); - `),Ce("base-selection-tags","min-height: var(--n-height);"),Ge("border, state-border",` - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - pointer-events: none; - border: var(--n-border); - border-radius: inherit; - transition: - box-shadow .3s var(--n-bezier), - border-color .3s var(--n-bezier); - `),Ge("state-border",` - z-index: 1; - border-color: #0000; - `),Ce("base-suffix",` - cursor: pointer; - position: absolute; - top: 50%; - transform: translateY(-50%); - right: 10px; - `,[Ge("arrow",` - font-size: var(--n-arrow-size); - color: var(--n-arrow-color); - transition: color .3s var(--n-bezier); - `)]),Ce("base-selection-overlay",` - display: flex; - align-items: center; - white-space: nowrap; - pointer-events: none; - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - padding: var(--n-padding-single); - transition: color .3s var(--n-bezier); - `,[Ge("wrapper",` - flex-basis: 0; - flex-grow: 1; - overflow: hidden; - text-overflow: ellipsis; - `)]),Ce("base-selection-placeholder",` - color: var(--n-placeholder-color); - `,[Ge("inner",` - max-width: 100%; - overflow: hidden; - `)]),Ce("base-selection-tags",` - cursor: pointer; - outline: none; - box-sizing: border-box; - position: relative; - z-index: auto; - display: flex; - padding: var(--n-padding-multiple); - flex-wrap: wrap; - align-items: center; - width: 100%; - vertical-align: bottom; - background-color: var(--n-color); - border-radius: inherit; - transition: - color .3s var(--n-bezier), - box-shadow .3s var(--n-bezier), - background-color .3s var(--n-bezier); - `),Ce("base-selection-label",` - height: var(--n-height); - display: inline-flex; - width: 100%; - vertical-align: bottom; - cursor: pointer; - outline: none; - z-index: auto; - box-sizing: border-box; - position: relative; - transition: - color .3s var(--n-bezier), - box-shadow .3s var(--n-bezier), - background-color .3s var(--n-bezier); - border-radius: inherit; - background-color: var(--n-color); - align-items: center; - `,[Ce("base-selection-input",` - font-size: inherit; - line-height: inherit; - outline: none; - cursor: pointer; - box-sizing: border-box; - border:none; - width: 100%; - padding: var(--n-padding-single); - background-color: #0000; - color: var(--n-text-color); - transition: color .3s var(--n-bezier); - caret-color: var(--n-caret-color); - `,[Ge("content",` - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; - `)]),Ge("render-label",` - color: var(--n-text-color); - `)]),Cn("disabled",[ze("&:hover",[Ge("state-border",` - box-shadow: var(--n-box-shadow-hover); - border: var(--n-border-hover); - `)]),Ve("focus",[Ge("state-border",` - box-shadow: var(--n-box-shadow-focus); - border: var(--n-border-focus); - `)]),Ve("active",[Ge("state-border",` - box-shadow: var(--n-box-shadow-active); - border: var(--n-border-active); - `),Ce("base-selection-label","background-color: var(--n-color-active);"),Ce("base-selection-tags","background-color: var(--n-color-active);")])]),Ve("disabled","cursor: not-allowed;",[Ge("arrow",` - color: var(--n-arrow-color-disabled); - `),Ce("base-selection-label",` - cursor: not-allowed; - background-color: var(--n-color-disabled); - `,[Ce("base-selection-input",` - cursor: not-allowed; - color: var(--n-text-color-disabled); - `),Ge("render-label",` - color: var(--n-text-color-disabled); - `)]),Ce("base-selection-tags",` - cursor: not-allowed; - background-color: var(--n-color-disabled); - `),Ce("base-selection-placeholder",` - cursor: not-allowed; - color: var(--n-placeholder-color-disabled); - `)]),Ce("base-selection-input-tag",` - height: calc(var(--n-height) - 6px); - line-height: calc(var(--n-height) - 6px); - outline: none; - display: none; - position: relative; - margin-bottom: 3px; - max-width: 100%; - vertical-align: bottom; - `,[Ge("input",` - font-size: inherit; - font-family: inherit; - min-width: 1px; - padding: 0; - background-color: #0000; - outline: none; - border: none; - max-width: 100%; - overflow: hidden; - width: 1em; - line-height: inherit; - cursor: pointer; - color: var(--n-text-color); - caret-color: var(--n-caret-color); - `),Ge("mirror",` - position: absolute; - left: 0; - top: 0; - white-space: pre; - visibility: hidden; - user-select: none; - -webkit-user-select: none; - opacity: 0; - `)]),["warning","error"].map(e=>Ve(`${e}-status`,[Ge("state-border",`border: var(--n-border-${e});`),Cn("disabled",[ze("&:hover",[Ge("state-border",` - box-shadow: var(--n-box-shadow-hover-${e}); - border: var(--n-border-hover-${e}); - `)]),Ve("active",[Ge("state-border",` - box-shadow: var(--n-box-shadow-active-${e}); - border: var(--n-border-active-${e}); - `),Ce("base-selection-label",`background-color: var(--n-color-active-${e});`),Ce("base-selection-tags",`background-color: var(--n-color-active-${e});`)]),Ve("focus",[Ge("state-border",` - box-shadow: var(--n-box-shadow-focus-${e}); - border: var(--n-border-focus-${e}); - `)])])]))]),Ce("base-selection-popover",` - margin-bottom: -3px; - display: flex; - flex-wrap: wrap; - margin-right: -8px; - `),Ce("base-selection-tag-wrapper",` - max-width: 100%; - display: inline-flex; - padding: 0 7px 3px 0; - `,[ze("&:last-child","padding-right: 0;"),Ce("tag",` - font-size: 14px; - max-width: 100%; - `,[Ge("content",` - line-height: 1.25; - text-overflow: ellipsis; - overflow: hidden; - `)])])]),XL=Ae({name:"InternalSelection",props:Object.assign(Object.assign({},Ht.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=mn(e),s=pi("InternalSelection",n,t),i=H(null),a=H(null),d=H(null),r=H(null),o=H(null),c=H(null),p=H(null),u=H(null),g=H(null),m=H(null),y=H(!1),v=H(!1),l=H(!1),h=Ht("InternalSelection","-internal-selection",GL,Jb,e,ct(e,"clsPrefix")),f=q(()=>e.clearable&&!e.disabled&&(l.value||e.active)),_=q(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):ui(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),S=q(()=>{const ie=e.selectedOption;if(ie)return ie[e.labelField]}),k=q(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function P(){var ie;const{value:we}=i;if(we){const{value:Ee}=a;Ee&&(Ee.style.width=`${we.offsetWidth}px`,e.maxTagCount!=="responsive"&&((ie=g.value)===null||ie===void 0||ie.sync({showAllItemsBeforeCalculate:!1})))}}function M(){const{value:ie}=m;ie&&(ie.style.display="none")}function w(){const{value:ie}=m;ie&&(ie.style.display="inline-block")}_t(ct(e,"active"),ie=>{ie||M()}),_t(ct(e,"pattern"),()=>{e.multiple&&un(P)});function T(ie){const{onFocus:we}=e;we&&we(ie)}function A(ie){const{onBlur:we}=e;we&&we(ie)}function E(ie){const{onDeleteOption:we}=e;we&&we(ie)}function R(ie){const{onClear:we}=e;we&&we(ie)}function D(ie){const{onPatternInput:we}=e;we&&we(ie)}function I(ie){var we;(!ie.relatedTarget||!(!((we=d.value)===null||we===void 0)&&we.contains(ie.relatedTarget)))&&T(ie)}function O(ie){var we;!((we=d.value)===null||we===void 0)&&we.contains(ie.relatedTarget)||A(ie)}function U(ie){R(ie)}function W(){l.value=!0}function N(){l.value=!1}function z(ie){!e.active||!e.filterable||ie.target!==a.value&&ie.preventDefault()}function V(ie){E(ie)}const j=H(!1);function G(ie){if(ie.key==="Backspace"&&!j.value&&!e.pattern.length){const{selectedOptions:we}=e;we!=null&&we.length&&V(we[we.length-1])}}let te=null;function oe(ie){const{value:we}=i;if(we){const Ee=ie.target.value;we.textContent=Ee,P()}e.ignoreComposition&&j.value?te=ie:D(ie)}function re(){j.value=!0}function ye(){j.value=!1,e.ignoreComposition&&D(te),te=null}function K(ie){var we;v.value=!0,(we=e.onPatternFocus)===null||we===void 0||we.call(e,ie)}function J(ie){var we;v.value=!1,(we=e.onPatternBlur)===null||we===void 0||we.call(e,ie)}function Q(){var ie,we;if(e.filterable)v.value=!1,(ie=c.value)===null||ie===void 0||ie.blur(),(we=a.value)===null||we===void 0||we.blur();else if(e.multiple){const{value:Ee}=r;Ee==null||Ee.blur()}else{const{value:Ee}=o;Ee==null||Ee.blur()}}function de(){var ie,we,Ee;e.filterable?(v.value=!1,(ie=c.value)===null||ie===void 0||ie.focus()):e.multiple?(we=r.value)===null||we===void 0||we.focus():(Ee=o.value)===null||Ee===void 0||Ee.focus()}function De(){const{value:ie}=a;ie&&(w(),ie.focus())}function Pe(){const{value:ie}=a;ie&&ie.blur()}function Ye(ie){const{value:we}=p;we&&we.setTextContent(`+${ie}`)}function st(){const{value:ie}=u;return ie}function yt(){return a.value}let ce=null;function ae(){ce!==null&&window.clearTimeout(ce)}function be(){e.active||(ae(),ce=window.setTimeout(()=>{k.value&&(y.value=!0)},100))}function he(){ae()}function Le(ie){ie||(ae(),y.value=!1)}_t(k,ie=>{ie||(y.value=!1)}),Dt(()=>{Vs(()=>{const ie=c.value;ie&&(e.disabled?ie.removeAttribute("tabindex"):ie.tabIndex=v.value?-1:0)})}),__(d,e.onResize);const{inlineThemeDisabled:et}=e,je=q(()=>{const{size:ie}=e,{common:{cubicBezierEaseInOut:we},self:{fontWeight:Ee,borderRadius:x,color:Re,placeholderColor:Xe,textColor:Ue,paddingSingle:xt,paddingMultiple:Ze,caretColor:wt,colorDisabled:tt,textColorDisabled:gt,placeholderColorDisabled:se,colorActive:ge,boxShadowFocus:Oe,boxShadowActive:Ke,boxShadowHover:Be,border:me,borderFocus:Fe,borderHover:fe,borderActive:nt,arrowColor:At,arrowColorDisabled:St,loadingColor:xe,colorActiveWarning:qe,boxShadowFocusWarning:ht,boxShadowActiveWarning:Et,boxShadowHoverWarning:jt,borderWarning:Kt,borderFocusWarning:Yt,borderHoverWarning:nn,borderActiveWarning:rn,colorActiveError:Mn,boxShadowFocusError:xn,boxShadowActiveError:Xt,boxShadowHoverError:Gt,borderError:Qt,borderFocusError:an,borderHoverError:Ot,borderActiveError:jn,clearColor:is,clearColorHover:An,clearColorPressed:Pn,clearSize:Rn,arrowSize:In,[Mt("height",ie)]:ke,[Mt("fontSize",ie)]:Qe}}=h.value,ft=io(xt),It=io(Ze);return{"--n-bezier":we,"--n-border":me,"--n-border-active":nt,"--n-border-focus":Fe,"--n-border-hover":fe,"--n-border-radius":x,"--n-box-shadow-active":Ke,"--n-box-shadow-focus":Oe,"--n-box-shadow-hover":Be,"--n-caret-color":wt,"--n-color":Re,"--n-color-active":ge,"--n-color-disabled":tt,"--n-font-size":Qe,"--n-height":ke,"--n-padding-single-top":ft.top,"--n-padding-multiple-top":It.top,"--n-padding-single-right":ft.right,"--n-padding-multiple-right":It.right,"--n-padding-single-left":ft.left,"--n-padding-multiple-left":It.left,"--n-padding-single-bottom":ft.bottom,"--n-padding-multiple-bottom":It.bottom,"--n-placeholder-color":Xe,"--n-placeholder-color-disabled":se,"--n-text-color":Ue,"--n-text-color-disabled":gt,"--n-arrow-color":At,"--n-arrow-color-disabled":St,"--n-loading-color":xe,"--n-color-active-warning":qe,"--n-box-shadow-focus-warning":ht,"--n-box-shadow-active-warning":Et,"--n-box-shadow-hover-warning":jt,"--n-border-warning":Kt,"--n-border-focus-warning":Yt,"--n-border-hover-warning":nn,"--n-border-active-warning":rn,"--n-color-active-error":Mn,"--n-box-shadow-focus-error":xn,"--n-box-shadow-active-error":Xt,"--n-box-shadow-hover-error":Gt,"--n-border-error":Qt,"--n-border-focus-error":an,"--n-border-hover-error":Ot,"--n-border-active-error":jn,"--n-clear-size":Rn,"--n-clear-color":is,"--n-clear-color-hover":An,"--n-clear-color-pressed":Pn,"--n-arrow-size":In,"--n-font-weight":Ee}}),_e=et?Un("internal-selection",q(()=>e.size[0]),je,e):void 0;return{mergedTheme:h,mergedClearable:f,mergedClsPrefix:t,rtlEnabled:s,patternInputFocused:v,filterablePlaceholder:_,label:S,selected:k,showTagsPanel:y,isComposing:j,counterRef:p,counterWrapperRef:u,patternInputMirrorRef:i,patternInputRef:a,selfRef:d,multipleElRef:r,singleElRef:o,patternInputWrapperRef:c,overflowRef:g,inputTagElRef:m,handleMouseDown:z,handleFocusin:I,handleClear:U,handleMouseEnter:W,handleMouseLeave:N,handleDeleteOption:V,handlePatternKeyDown:G,handlePatternInputInput:oe,handlePatternInputBlur:J,handlePatternInputFocus:K,handleMouseEnterCounter:be,handleMouseLeaveCounter:he,handleFocusout:O,handleCompositionEnd:ye,handleCompositionStart:re,onPopoverUpdateShow:Le,focus:de,focusInput:De,blur:Q,blurInput:Pe,updateCounter:Ye,getCounter:st,getTail:yt,renderLabel:e.renderLabel,cssVars:et?void 0:je,themeClass:_e==null?void 0:_e.themeClass,onRender:_e==null?void 0:_e.onRender}},render(){const{status:e,multiple:t,size:n,disabled:s,filterable:i,maxTagCount:a,bordered:d,clsPrefix:r,ellipsisTagPopoverProps:o,onRender:c,renderTag:p,renderLabel:u}=this;c==null||c();const g=a==="responsive",m=typeof a=="number",y=g||m,v=B(Gb,null,{default:()=>B(Xb,{clsPrefix:r,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var h,f;return(f=(h=this.$slots).arrow)===null||f===void 0?void 0:f.call(h)}})});let l;if(t){const{labelField:h}=this,f=D=>B("div",{class:`${r}-base-selection-tag-wrapper`,key:D.value},p?p({option:D,handleClose:()=>{this.handleDeleteOption(D)}}):B(Lr,{size:n,closable:!D.disabled,disabled:s,onClose:()=>{this.handleDeleteOption(D)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>u?u(D,!0):ui(D[h],D,!0)})),_=()=>(m?this.selectedOptions.slice(0,a):this.selectedOptions).map(f),S=i?B("div",{class:`${r}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},B("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:s,value:this.pattern,autofocus:this.autofocus,class:`${r}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),B("span",{ref:"patternInputMirrorRef",class:`${r}-base-selection-input-tag__mirror`},this.pattern)):null,k=g?()=>B("div",{class:`${r}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},B(Lr,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:s})):void 0;let P;if(m){const D=this.selectedOptions.length-a;D>0&&(P=B("div",{class:`${r}-base-selection-tag-wrapper`,key:"__counter__"},B(Lr,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:s},{default:()=>`+${D}`})))}const M=g?i?B(Mp,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:_,counter:k,tail:()=>S}):B(Mp,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:_,counter:k}):m&&P?_().concat(P):_(),w=y?()=>B("div",{class:`${r}-base-selection-popover`},g?_():this.selectedOptions.map(f)):void 0,T=y?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},o):null,E=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?B("div",{class:`${r}-base-selection-placeholder ${r}-base-selection-overlay`},B("div",{class:`${r}-base-selection-placeholder__inner`},this.placeholder)):null,R=i?B("div",{ref:"patternInputWrapperRef",class:`${r}-base-selection-tags`},M,g?null:S,v):B("div",{ref:"multipleElRef",class:`${r}-base-selection-tags`,tabindex:s?void 0:0},M,v);l=B(Ie,null,y?B(Lo,Object.assign({},T,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>R,default:w}):R,E)}else if(i){const h=this.pattern||this.isComposing,f=this.active?!h:!this.selected,_=this.active?!1:this.selected;l=B("div",{ref:"patternInputWrapperRef",class:`${r}-base-selection-label`,title:this.patternInputFocused?void 0:Ap(this.label)},B("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${r}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:s,disabled:s,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),_?B("div",{class:`${r}-base-selection-label__render-label ${r}-base-selection-overlay`,key:"input"},B("div",{class:`${r}-base-selection-overlay__wrapper`},p?p({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):ui(this.label,this.selectedOption,!0))):null,f?B("div",{class:`${r}-base-selection-placeholder ${r}-base-selection-overlay`,key:"placeholder"},B("div",{class:`${r}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,v)}else l=B("div",{ref:"singleElRef",class:`${r}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?B("div",{class:`${r}-base-selection-input`,title:Ap(this.label),key:"input"},B("div",{class:`${r}-base-selection-input__content`},p?p({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):ui(this.label,this.selectedOption,!0))):B("div",{class:`${r}-base-selection-placeholder ${r}-base-selection-overlay`,key:"placeholder"},B("div",{class:`${r}-base-selection-placeholder__inner`},this.placeholder)),v);return B("div",{ref:"selfRef",class:[`${r}-base-selection`,this.rtlEnabled&&`${r}-base-selection--rtl`,this.themeClass,e&&`${r}-base-selection--${e}-status`,{[`${r}-base-selection--active`]:this.active,[`${r}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${r}-base-selection--disabled`]:this.disabled,[`${r}-base-selection--multiple`]:this.multiple,[`${r}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},l,d?B("div",{class:`${r}-base-selection__border`}):null,d?B("div",{class:`${r}-base-selection__state-border`}):null)}});function zl(e){return e.type==="group"}function L_(e){return e.type==="ignored"}function cd(e,t){try{return!!(1+t.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function D_(e,t){return{getIsGroup:zl,getIgnored:L_,getKey(s){return zl(s)?s.name||s.key||"key-required":s[e]},getChildren(s){return s[t]}}}function JL(e,t,n,s){if(!t)return e;function i(a){if(!Array.isArray(a))return[];const d=[];for(const r of a)if(zl(r)){const o=i(r[s]);o.length&&d.push(Object.assign({},r,{[s]:o}))}else{if(L_(r))continue;t(n,r)&&d.push(r)}return d}return i(e)}function QL(e,t,n){const s=new Map;return e.forEach(i=>{zl(i)?i[n].forEach(a=>{s.set(a[t],a)}):s.set(i[t],i)}),s}function fn(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function to(e,t){const n=Ft(e);return isNaN(t)?fn(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function es(e,t){const n=Ft(e);if(isNaN(t))return fn(e,NaN);if(!t)return n;const s=n.getDate(),i=fn(e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const a=i.getDate();return s>=a?i:(n.setFullYear(i.getFullYear(),i.getMonth(),s),n)}const M_=6048e5,ZL=864e5,eD=6e4,tD=36e5,nD=1e3;function mo(e){return Ai(e,{weekStartsOn:1})}function A_(e){const t=Ft(e),n=t.getFullYear(),s=fn(e,0);s.setFullYear(n+1,0,4),s.setHours(0,0,0,0);const i=mo(s),a=fn(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const d=mo(a);return t.getTime()>=i.getTime()?n+1:t.getTime()>=d.getTime()?n:n-1}function _o(e){const t=Ft(e);return t.setHours(0,0,0,0),t}function Ul(e){const t=Ft(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function sD(e,t){const n=_o(e),s=_o(t),i=+n-Ul(n),a=+s-Ul(s);return Math.round((i-a)/ZL)}function iD(e){const t=A_(e),n=fn(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),mo(n)}function rD(e,t){const n=t*3;return es(e,n)}function au(e,t){return es(e,t*12)}function oD(e,t){const n=_o(e),s=_o(t);return+n==+s}function aD(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function zs(e){if(!aD(e)&&typeof e!="number")return!1;const t=Ft(e);return!isNaN(Number(t))}function lD(e){const t=Ft(e);return Math.trunc(t.getMonth()/3)+1}function cD(e){const t=Ft(e);return t.setSeconds(0,0),t}function ya(e){const t=Ft(e),n=t.getMonth(),s=n-n%3;return t.setMonth(s,1),t.setHours(0,0,0,0),t}function ki(e){const t=Ft(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Ta(e){const t=Ft(e),n=fn(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function dD(e){const t=Ft(e);return sD(t,Ta(t))+1}function I_(e){const t=Ft(e),n=+mo(t)-+iD(t);return Math.round(n/M_)+1}function uh(e,t){var p,u,g,m;const n=Ft(e),s=n.getFullYear(),i=Ca(),a=(t==null?void 0:t.firstWeekContainsDate)??((u=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:u.firstWeekContainsDate)??i.firstWeekContainsDate??((m=(g=i.locale)==null?void 0:g.options)==null?void 0:m.firstWeekContainsDate)??1,d=fn(e,0);d.setFullYear(s+1,0,a),d.setHours(0,0,0,0);const r=Ai(d,t),o=fn(e,0);o.setFullYear(s,0,a),o.setHours(0,0,0,0);const c=Ai(o,t);return n.getTime()>=r.getTime()?s+1:n.getTime()>=c.getTime()?s:s-1}function uD(e,t){var r,o,c,p;const n=Ca(),s=(t==null?void 0:t.firstWeekContainsDate)??((o=(r=t==null?void 0:t.locale)==null?void 0:r.options)==null?void 0:o.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(c=n.locale)==null?void 0:c.options)==null?void 0:p.firstWeekContainsDate)??1,i=uh(e,t),a=fn(e,0);return a.setFullYear(i,0,s),a.setHours(0,0,0,0),Ai(a,t)}function $_(e,t){const n=Ft(e),s=+Ai(n,t)-+uD(n,t);return Math.round(s/M_)+1}function cn(e,t){const n=e<0?"-":"",s=Math.abs(e).toString().padStart(t,"0");return n+s}const Ki={y(e,t){const n=e.getFullYear(),s=n>0?n:1-n;return cn(t==="yy"?s%100:s,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):cn(n+1,2)},d(e,t){return cn(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return cn(e.getHours()%12||12,t.length)},H(e,t){return cn(e.getHours(),t.length)},m(e,t){return cn(e.getMinutes(),t.length)},s(e,t){return cn(e.getSeconds(),t.length)},S(e,t){const n=t.length,s=e.getMilliseconds(),i=Math.trunc(s*Math.pow(10,n-3));return cn(i,t.length)}},qr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},tv={G:function(e,t,n){const s=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});case"GGGG":default:return n.era(s,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const s=e.getFullYear(),i=s>0?s:1-s;return n.ordinalNumber(i,{unit:"year"})}return Ki.y(e,t)},Y:function(e,t,n,s){const i=uh(e,s),a=i>0?i:1-i;if(t==="YY"){const d=a%100;return cn(d,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):cn(a,t.length)},R:function(e,t){const n=A_(e);return cn(n,t.length)},u:function(e,t){const n=e.getFullYear();return cn(n,t.length)},Q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(s);case"QQ":return cn(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(s);case"qq":return cn(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(e,t,n){const s=e.getMonth();switch(t){case"M":case"MM":return Ki.M(e,t);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(e,t,n){const s=e.getMonth();switch(t){case"L":return String(s+1);case"LL":return cn(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(e,t,n,s){const i=$_(e,s);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):cn(i,t.length)},I:function(e,t,n){const s=I_(e);return t==="Io"?n.ordinalNumber(s,{unit:"week"}):cn(s,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ki.d(e,t)},D:function(e,t,n){const s=dD(e);return t==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):cn(s,t.length)},E:function(e,t,n){const s=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(s,{width:"short",context:"formatting"});case"EEEE":default:return n.day(s,{width:"wide",context:"formatting"})}},e:function(e,t,n,s){const i=e.getDay(),a=(i-s.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return cn(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,s){const i=e.getDay(),a=(i-s.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return cn(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const s=e.getDay(),i=s===0?7:s;switch(t){case"i":return String(i);case"ii":return cn(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});case"iiii":default:return n.day(s,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const s=e.getHours();let i;switch(s===12?i=qr.noon:s===0?i=qr.midnight:i=s/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const s=e.getHours();let i;switch(s>=17?i=qr.evening:s>=12?i=qr.afternoon:s>=4?i=qr.morning:i=qr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let s=e.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return Ki.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ki.H(e,t)},K:function(e,t,n){const s=e.getHours()%12;return t==="Ko"?n.ordinalNumber(s,{unit:"hour"}):cn(s,t.length)},k:function(e,t,n){let s=e.getHours();return s===0&&(s=24),t==="ko"?n.ordinalNumber(s,{unit:"hour"}):cn(s,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ki.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ki.s(e,t)},S:function(e,t){return Ki.S(e,t)},X:function(e,t,n){const s=e.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return sv(s);case"XXXX":case"XX":return Cr(s);case"XXXXX":case"XXX":default:return Cr(s,":")}},x:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"x":return sv(s);case"xxxx":case"xx":return Cr(s);case"xxxxx":case"xxx":default:return Cr(s,":")}},O:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+nv(s,":");case"OOOO":default:return"GMT"+Cr(s,":")}},z:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+nv(s,":");case"zzzz":default:return"GMT"+Cr(s,":")}},t:function(e,t,n){const s=Math.trunc(e.getTime()/1e3);return cn(s,t.length)},T:function(e,t,n){const s=e.getTime();return cn(s,t.length)}};function nv(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),i=Math.trunc(s/60),a=s%60;return a===0?n+String(i):n+String(i)+t+cn(a,2)}function sv(e,t){return e%60===0?(e>0?"-":"+")+cn(Math.abs(e)/60,2):Cr(e,t)}function Cr(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),i=cn(Math.trunc(s/60),2),a=cn(s%60,2);return n+i+t+a}const iv=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},O_=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},hD=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],s=n[1],i=n[2];if(!i)return iv(e,t);let a;switch(s){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",iv(s,t)).replace("{{time}}",O_(i,t))},lu={p:O_,P:hD},fD=/^D+$/,pD=/^Y+$/,vD=["D","DD","YY","YYYY"];function F_(e){return fD.test(e)}function B_(e){return pD.test(e)}function cu(e,t,n){const s=gD(e,t,n);if(console.warn(s),vD.includes(e))throw new RangeError(s)}function gD(e,t,n){const s=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const mD=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_D=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,yD=/^'([^]*?)'?$/,bD=/''/g,wD=/[a-zA-Z]/;function dn(e,t,n){var p,u,g,m,y,v,l,h;const s=Ca(),i=(n==null?void 0:n.locale)??s.locale??hg,a=(n==null?void 0:n.firstWeekContainsDate)??((u=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:u.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(g=s.locale)==null?void 0:g.options)==null?void 0:m.firstWeekContainsDate)??1,d=(n==null?void 0:n.weekStartsOn)??((v=(y=n==null?void 0:n.locale)==null?void 0:y.options)==null?void 0:v.weekStartsOn)??s.weekStartsOn??((h=(l=s.locale)==null?void 0:l.options)==null?void 0:h.weekStartsOn)??0,r=Ft(e);if(!zs(r))throw new RangeError("Invalid time value");let o=t.match(_D).map(f=>{const _=f[0];if(_==="p"||_==="P"){const S=lu[_];return S(f,i.formatLong)}return f}).join("").match(mD).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const _=f[0];if(_==="'")return{isToken:!1,value:SD(f)};if(tv[_])return{isToken:!0,value:f};if(_.match(wD))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:f}});i.localize.preprocessor&&(o=i.localize.preprocessor(r,o));const c={firstWeekContainsDate:a,weekStartsOn:d,locale:i};return o.map(f=>{if(!f.isToken)return f.value;const _=f.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&B_(_)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&F_(_))&&cu(_,t,String(e));const S=tv[_[0]];return S(r,_,i.localize,c)}).join("")}function SD(e){const t=e.match(yD);return t?t[1].replace(bD,"'"):e}function Hs(e){return Ft(e).getDate()}function CD(e){return Ft(e).getDay()}function kD(e){const t=Ft(e),n=t.getFullYear(),s=t.getMonth(),i=fn(e,0);return i.setFullYear(n,s+1,0),i.setHours(0,0,0,0),i.getDate()}function H_(){return Object.assign({},Ca())}function Gi(e){return Ft(e).getHours()}function xD(e){let n=Ft(e).getDay();return n===0&&(n=7),n}function RD(e){return Ft(e).getMilliseconds()}function Vl(e){return Ft(e).getMinutes()}function yn(e){return Ft(e).getMonth()}function Kl(e){return Ft(e).getSeconds()}function ut(e){return Ft(e).getTime()}function Tn(e){return Ft(e).getFullYear()}function TD(e,t){const n=t instanceof Date?fn(t,0):new t(0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}const PD=10;class N_{constructor(){Y(this,"subPriority",0)}validate(t,n){return!0}}class ED extends N_{constructor(t,n,s,i,a){super(),this.value=t,this.validateValue=n,this.setValue=s,this.priority=i,a&&(this.subPriority=a)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,s){return this.setValue(t,n,this.value,s)}}class LD extends N_{constructor(){super(...arguments);Y(this,"priority",PD);Y(this,"subPriority",-1)}set(n,s){return s.timestampIsSet?n:fn(n,TD(n,Date))}}class sn{run(t,n,s,i){const a=this.parse(t,n,s,i);return a?{setter:new ED(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(t,n,s){return!0}}class DD extends sn{constructor(){super(...arguments);Y(this,"priority",140);Y(this,"incompatibleTokens",["R","u","t","T"])}parse(n,s,i){switch(s){case"G":case"GG":case"GGG":return i.era(n,{width:"abbreviated"})||i.era(n,{width:"narrow"});case"GGGGG":return i.era(n,{width:"narrow"});case"GGGG":default:return i.era(n,{width:"wide"})||i.era(n,{width:"abbreviated"})||i.era(n,{width:"narrow"})}}set(n,s,i){return s.era=i,n.setFullYear(i,0,1),n.setHours(0,0,0,0),n}}const Fn={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},ci={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Bn(e,t){return e&&{value:t(e.value),rest:e.rest}}function Dn(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function di(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const s=n[1]==="+"?1:-1,i=n[2]?parseInt(n[2],10):0,a=n[3]?parseInt(n[3],10):0,d=n[5]?parseInt(n[5],10):0;return{value:s*(i*tD+a*eD+d*nD),rest:t.slice(n[0].length)}}function z_(e){return Dn(Fn.anyDigitsSigned,e)}function $n(e,t){switch(e){case 1:return Dn(Fn.singleDigit,t);case 2:return Dn(Fn.twoDigits,t);case 3:return Dn(Fn.threeDigits,t);case 4:return Dn(Fn.fourDigits,t);default:return Dn(new RegExp("^\\d{1,"+e+"}"),t)}}function Wl(e,t){switch(e){case 1:return Dn(Fn.singleDigitSigned,t);case 2:return Dn(Fn.twoDigitsSigned,t);case 3:return Dn(Fn.threeDigitsSigned,t);case 4:return Dn(Fn.fourDigitsSigned,t);default:return Dn(new RegExp("^-?\\d{1,"+e+"}"),t)}}function hh(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function U_(e,t){const n=t>0,s=n?t:1-t;let i;if(s<=50)i=e||100;else{const a=s+50,d=Math.trunc(a/100)*100,r=e>=a%100;i=e+d-(r?100:0)}return n?i:1-i}function V_(e){return e%400===0||e%4===0&&e%100!==0}class MD extends sn{constructor(){super(...arguments);Y(this,"priority",130);Y(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(n,s,i){const a=d=>({year:d,isTwoDigitYear:s==="yy"});switch(s){case"y":return Bn($n(4,n),a);case"yo":return Bn(i.ordinalNumber(n,{unit:"year"}),a);default:return Bn($n(s.length,n),a)}}validate(n,s){return s.isTwoDigitYear||s.year>0}set(n,s,i){const a=n.getFullYear();if(i.isTwoDigitYear){const r=U_(i.year,a);return n.setFullYear(r,0,1),n.setHours(0,0,0,0),n}const d=!("era"in s)||s.era===1?i.year:1-i.year;return n.setFullYear(d,0,1),n.setHours(0,0,0,0),n}}class AD extends sn{constructor(){super(...arguments);Y(this,"priority",130);Y(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(n,s,i){const a=d=>({year:d,isTwoDigitYear:s==="YY"});switch(s){case"Y":return Bn($n(4,n),a);case"Yo":return Bn(i.ordinalNumber(n,{unit:"year"}),a);default:return Bn($n(s.length,n),a)}}validate(n,s){return s.isTwoDigitYear||s.year>0}set(n,s,i,a){const d=uh(n,a);if(i.isTwoDigitYear){const o=U_(i.year,d);return n.setFullYear(o,0,a.firstWeekContainsDate),n.setHours(0,0,0,0),Ai(n,a)}const r=!("era"in s)||s.era===1?i.year:1-i.year;return n.setFullYear(r,0,a.firstWeekContainsDate),n.setHours(0,0,0,0),Ai(n,a)}}class ID extends sn{constructor(){super(...arguments);Y(this,"priority",130);Y(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,s){return Wl(s==="R"?4:s.length,n)}set(n,s,i){const a=fn(n,0);return a.setFullYear(i,0,4),a.setHours(0,0,0,0),mo(a)}}class $D extends sn{constructor(){super(...arguments);Y(this,"priority",130);Y(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,s){return Wl(s==="u"?4:s.length,n)}set(n,s,i){return n.setFullYear(i,0,1),n.setHours(0,0,0,0),n}}class OD extends sn{constructor(){super(...arguments);Y(this,"priority",120);Y(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,s,i){switch(s){case"Q":case"QQ":return $n(s.length,n);case"Qo":return i.ordinalNumber(n,{unit:"quarter"});case"QQQ":return i.quarter(n,{width:"abbreviated",context:"formatting"})||i.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(n,{width:"wide",context:"formatting"})||i.quarter(n,{width:"abbreviated",context:"formatting"})||i.quarter(n,{width:"narrow",context:"formatting"})}}validate(n,s){return s>=1&&s<=4}set(n,s,i){return n.setMonth((i-1)*3,1),n.setHours(0,0,0,0),n}}class FD extends sn{constructor(){super(...arguments);Y(this,"priority",120);Y(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,s,i){switch(s){case"q":case"qq":return $n(s.length,n);case"qo":return i.ordinalNumber(n,{unit:"quarter"});case"qqq":return i.quarter(n,{width:"abbreviated",context:"standalone"})||i.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(n,{width:"wide",context:"standalone"})||i.quarter(n,{width:"abbreviated",context:"standalone"})||i.quarter(n,{width:"narrow",context:"standalone"})}}validate(n,s){return s>=1&&s<=4}set(n,s,i){return n.setMonth((i-1)*3,1),n.setHours(0,0,0,0),n}}class BD extends sn{constructor(){super(...arguments);Y(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);Y(this,"priority",110)}parse(n,s,i){const a=d=>d-1;switch(s){case"M":return Bn(Dn(Fn.month,n),a);case"MM":return Bn($n(2,n),a);case"Mo":return Bn(i.ordinalNumber(n,{unit:"month"}),a);case"MMM":return i.month(n,{width:"abbreviated",context:"formatting"})||i.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(n,{width:"wide",context:"formatting"})||i.month(n,{width:"abbreviated",context:"formatting"})||i.month(n,{width:"narrow",context:"formatting"})}}validate(n,s){return s>=0&&s<=11}set(n,s,i){return n.setMonth(i,1),n.setHours(0,0,0,0),n}}class HD extends sn{constructor(){super(...arguments);Y(this,"priority",110);Y(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(n,s,i){const a=d=>d-1;switch(s){case"L":return Bn(Dn(Fn.month,n),a);case"LL":return Bn($n(2,n),a);case"Lo":return Bn(i.ordinalNumber(n,{unit:"month"}),a);case"LLL":return i.month(n,{width:"abbreviated",context:"standalone"})||i.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(n,{width:"wide",context:"standalone"})||i.month(n,{width:"abbreviated",context:"standalone"})||i.month(n,{width:"narrow",context:"standalone"})}}validate(n,s){return s>=0&&s<=11}set(n,s,i){return n.setMonth(i,1),n.setHours(0,0,0,0),n}}function ND(e,t,n){const s=Ft(e),i=$_(s,n)-t;return s.setDate(s.getDate()-i*7),s}class zD extends sn{constructor(){super(...arguments);Y(this,"priority",100);Y(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,s,i){switch(s){case"w":return Dn(Fn.week,n);case"wo":return i.ordinalNumber(n,{unit:"week"});default:return $n(s.length,n)}}validate(n,s){return s>=1&&s<=53}set(n,s,i,a){return Ai(ND(n,i,a),a)}}function UD(e,t){const n=Ft(e),s=I_(n)-t;return n.setDate(n.getDate()-s*7),n}class VD extends sn{constructor(){super(...arguments);Y(this,"priority",100);Y(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(n,s,i){switch(s){case"I":return Dn(Fn.week,n);case"Io":return i.ordinalNumber(n,{unit:"week"});default:return $n(s.length,n)}}validate(n,s){return s>=1&&s<=53}set(n,s,i){return mo(UD(n,i))}}const KD=[31,28,31,30,31,30,31,31,30,31,30,31],WD=[31,29,31,30,31,30,31,31,30,31,30,31];class jD extends sn{constructor(){super(...arguments);Y(this,"priority",90);Y(this,"subPriority",1);Y(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,s,i){switch(s){case"d":return Dn(Fn.date,n);case"do":return i.ordinalNumber(n,{unit:"date"});default:return $n(s.length,n)}}validate(n,s){const i=n.getFullYear(),a=V_(i),d=n.getMonth();return a?s>=1&&s<=WD[d]:s>=1&&s<=KD[d]}set(n,s,i){return n.setDate(i),n.setHours(0,0,0,0),n}}class qD extends sn{constructor(){super(...arguments);Y(this,"priority",90);Y(this,"subpriority",1);Y(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(n,s,i){switch(s){case"D":case"DD":return Dn(Fn.dayOfYear,n);case"Do":return i.ordinalNumber(n,{unit:"date"});default:return $n(s.length,n)}}validate(n,s){const i=n.getFullYear();return V_(i)?s>=1&&s<=366:s>=1&&s<=365}set(n,s,i){return n.setMonth(0,i),n.setHours(0,0,0,0),n}}function fh(e,t,n){var u,g,m,y;const s=Ca(),i=(n==null?void 0:n.weekStartsOn)??((g=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:g.weekStartsOn)??s.weekStartsOn??((y=(m=s.locale)==null?void 0:m.options)==null?void 0:y.weekStartsOn)??0,a=Ft(e),d=a.getDay(),o=(t%7+7)%7,c=7-i,p=t<0||t>6?t-(d+c)%7:(o+c)%7-(d+c)%7;return to(a,p)}class YD extends sn{constructor(){super(...arguments);Y(this,"priority",90);Y(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(n,s,i){switch(s){case"E":case"EE":case"EEE":return i.day(n,{width:"abbreviated",context:"formatting"})||i.day(n,{width:"short",context:"formatting"})||i.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(n,{width:"short",context:"formatting"})||i.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return i.day(n,{width:"wide",context:"formatting"})||i.day(n,{width:"abbreviated",context:"formatting"})||i.day(n,{width:"short",context:"formatting"})||i.day(n,{width:"narrow",context:"formatting"})}}validate(n,s){return s>=0&&s<=6}set(n,s,i,a){return n=fh(n,i,a),n.setHours(0,0,0,0),n}}class GD extends sn{constructor(){super(...arguments);Y(this,"priority",90);Y(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,s,i,a){const d=r=>{const o=Math.floor((r-1)/7)*7;return(r+a.weekStartsOn+6)%7+o};switch(s){case"e":case"ee":return Bn($n(s.length,n),d);case"eo":return Bn(i.ordinalNumber(n,{unit:"day"}),d);case"eee":return i.day(n,{width:"abbreviated",context:"formatting"})||i.day(n,{width:"short",context:"formatting"})||i.day(n,{width:"narrow",context:"formatting"});case"eeeee":return i.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(n,{width:"short",context:"formatting"})||i.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return i.day(n,{width:"wide",context:"formatting"})||i.day(n,{width:"abbreviated",context:"formatting"})||i.day(n,{width:"short",context:"formatting"})||i.day(n,{width:"narrow",context:"formatting"})}}validate(n,s){return s>=0&&s<=6}set(n,s,i,a){return n=fh(n,i,a),n.setHours(0,0,0,0),n}}class XD extends sn{constructor(){super(...arguments);Y(this,"priority",90);Y(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,s,i,a){const d=r=>{const o=Math.floor((r-1)/7)*7;return(r+a.weekStartsOn+6)%7+o};switch(s){case"c":case"cc":return Bn($n(s.length,n),d);case"co":return Bn(i.ordinalNumber(n,{unit:"day"}),d);case"ccc":return i.day(n,{width:"abbreviated",context:"standalone"})||i.day(n,{width:"short",context:"standalone"})||i.day(n,{width:"narrow",context:"standalone"});case"ccccc":return i.day(n,{width:"narrow",context:"standalone"});case"cccccc":return i.day(n,{width:"short",context:"standalone"})||i.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return i.day(n,{width:"wide",context:"standalone"})||i.day(n,{width:"abbreviated",context:"standalone"})||i.day(n,{width:"short",context:"standalone"})||i.day(n,{width:"narrow",context:"standalone"})}}validate(n,s){return s>=0&&s<=6}set(n,s,i,a){return n=fh(n,i,a),n.setHours(0,0,0,0),n}}function JD(e,t){const n=Ft(e),s=xD(n),i=t-s;return to(n,i)}class QD extends sn{constructor(){super(...arguments);Y(this,"priority",90);Y(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(n,s,i){const a=d=>d===0?7:d;switch(s){case"i":case"ii":return $n(s.length,n);case"io":return i.ordinalNumber(n,{unit:"day"});case"iii":return Bn(i.day(n,{width:"abbreviated",context:"formatting"})||i.day(n,{width:"short",context:"formatting"})||i.day(n,{width:"narrow",context:"formatting"}),a);case"iiiii":return Bn(i.day(n,{width:"narrow",context:"formatting"}),a);case"iiiiii":return Bn(i.day(n,{width:"short",context:"formatting"})||i.day(n,{width:"narrow",context:"formatting"}),a);case"iiii":default:return Bn(i.day(n,{width:"wide",context:"formatting"})||i.day(n,{width:"abbreviated",context:"formatting"})||i.day(n,{width:"short",context:"formatting"})||i.day(n,{width:"narrow",context:"formatting"}),a)}}validate(n,s){return s>=1&&s<=7}set(n,s,i){return n=JD(n,i),n.setHours(0,0,0,0),n}}class ZD extends sn{constructor(){super(...arguments);Y(this,"priority",80);Y(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(n,s,i){switch(s){case"a":case"aa":case"aaa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"})||i.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})||i.dayPeriod(n,{width:"abbreviated",context:"formatting"})||i.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,s,i){return n.setHours(hh(i),0,0,0),n}}class eM extends sn{constructor(){super(...arguments);Y(this,"priority",80);Y(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(n,s,i){switch(s){case"b":case"bb":case"bbb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"})||i.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})||i.dayPeriod(n,{width:"abbreviated",context:"formatting"})||i.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,s,i){return n.setHours(hh(i),0,0,0),n}}class tM extends sn{constructor(){super(...arguments);Y(this,"priority",80);Y(this,"incompatibleTokens",["a","b","t","T"])}parse(n,s,i){switch(s){case"B":case"BB":case"BBB":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"})||i.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})||i.dayPeriod(n,{width:"abbreviated",context:"formatting"})||i.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,s,i){return n.setHours(hh(i),0,0,0),n}}class nM extends sn{constructor(){super(...arguments);Y(this,"priority",70);Y(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,s,i){switch(s){case"h":return Dn(Fn.hour12h,n);case"ho":return i.ordinalNumber(n,{unit:"hour"});default:return $n(s.length,n)}}validate(n,s){return s>=1&&s<=12}set(n,s,i){const a=n.getHours()>=12;return a&&i<12?n.setHours(i+12,0,0,0):!a&&i===12?n.setHours(0,0,0,0):n.setHours(i,0,0,0),n}}class sM extends sn{constructor(){super(...arguments);Y(this,"priority",70);Y(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,s,i){switch(s){case"H":return Dn(Fn.hour23h,n);case"Ho":return i.ordinalNumber(n,{unit:"hour"});default:return $n(s.length,n)}}validate(n,s){return s>=0&&s<=23}set(n,s,i){return n.setHours(i,0,0,0),n}}class iM extends sn{constructor(){super(...arguments);Y(this,"priority",70);Y(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,s,i){switch(s){case"K":return Dn(Fn.hour11h,n);case"Ko":return i.ordinalNumber(n,{unit:"hour"});default:return $n(s.length,n)}}validate(n,s){return s>=0&&s<=11}set(n,s,i){return n.getHours()>=12&&i<12?n.setHours(i+12,0,0,0):n.setHours(i,0,0,0),n}}class rM extends sn{constructor(){super(...arguments);Y(this,"priority",70);Y(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,s,i){switch(s){case"k":return Dn(Fn.hour24h,n);case"ko":return i.ordinalNumber(n,{unit:"hour"});default:return $n(s.length,n)}}validate(n,s){return s>=1&&s<=24}set(n,s,i){const a=i<=24?i%24:i;return n.setHours(a,0,0,0),n}}class oM extends sn{constructor(){super(...arguments);Y(this,"priority",60);Y(this,"incompatibleTokens",["t","T"])}parse(n,s,i){switch(s){case"m":return Dn(Fn.minute,n);case"mo":return i.ordinalNumber(n,{unit:"minute"});default:return $n(s.length,n)}}validate(n,s){return s>=0&&s<=59}set(n,s,i){return n.setMinutes(i,0,0),n}}class aM extends sn{constructor(){super(...arguments);Y(this,"priority",50);Y(this,"incompatibleTokens",["t","T"])}parse(n,s,i){switch(s){case"s":return Dn(Fn.second,n);case"so":return i.ordinalNumber(n,{unit:"second"});default:return $n(s.length,n)}}validate(n,s){return s>=0&&s<=59}set(n,s,i){return n.setSeconds(i,0),n}}class lM extends sn{constructor(){super(...arguments);Y(this,"priority",30);Y(this,"incompatibleTokens",["t","T"])}parse(n,s){const i=a=>Math.trunc(a*Math.pow(10,-s.length+3));return Bn($n(s.length,n),i)}set(n,s,i){return n.setMilliseconds(i),n}}class cM extends sn{constructor(){super(...arguments);Y(this,"priority",10);Y(this,"incompatibleTokens",["t","T","x"])}parse(n,s){switch(s){case"X":return di(ci.basicOptionalMinutes,n);case"XX":return di(ci.basic,n);case"XXXX":return di(ci.basicOptionalSeconds,n);case"XXXXX":return di(ci.extendedOptionalSeconds,n);case"XXX":default:return di(ci.extended,n)}}set(n,s,i){return s.timestampIsSet?n:fn(n,n.getTime()-Ul(n)-i)}}class dM extends sn{constructor(){super(...arguments);Y(this,"priority",10);Y(this,"incompatibleTokens",["t","T","X"])}parse(n,s){switch(s){case"x":return di(ci.basicOptionalMinutes,n);case"xx":return di(ci.basic,n);case"xxxx":return di(ci.basicOptionalSeconds,n);case"xxxxx":return di(ci.extendedOptionalSeconds,n);case"xxx":default:return di(ci.extended,n)}}set(n,s,i){return s.timestampIsSet?n:fn(n,n.getTime()-Ul(n)-i)}}class uM extends sn{constructor(){super(...arguments);Y(this,"priority",40);Y(this,"incompatibleTokens","*")}parse(n){return z_(n)}set(n,s,i){return[fn(n,i*1e3),{timestampIsSet:!0}]}}class hM extends sn{constructor(){super(...arguments);Y(this,"priority",20);Y(this,"incompatibleTokens","*")}parse(n){return z_(n)}set(n,s,i){return[fn(n,i),{timestampIsSet:!0}]}}const fM={G:new DD,y:new MD,Y:new AD,R:new ID,u:new $D,Q:new OD,q:new FD,M:new BD,L:new HD,w:new zD,I:new VD,d:new jD,D:new qD,E:new YD,e:new GD,c:new XD,i:new QD,a:new ZD,b:new eM,B:new tM,h:new nM,H:new sM,K:new iM,k:new rM,m:new oM,s:new aM,S:new lM,X:new cM,x:new dM,t:new uM,T:new hM},pM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,vM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,gM=/^'([^]*?)'?$/,mM=/''/g,_M=/\S/,yM=/[a-zA-Z]/;function bM(e,t,n,s){var v,l,h,f,_,S,k,P;const i=H_(),a=(s==null?void 0:s.locale)??i.locale??hg,d=(s==null?void 0:s.firstWeekContainsDate)??((l=(v=s==null?void 0:s.locale)==null?void 0:v.options)==null?void 0:l.firstWeekContainsDate)??i.firstWeekContainsDate??((f=(h=i.locale)==null?void 0:h.options)==null?void 0:f.firstWeekContainsDate)??1,r=(s==null?void 0:s.weekStartsOn)??((S=(_=s==null?void 0:s.locale)==null?void 0:_.options)==null?void 0:S.weekStartsOn)??i.weekStartsOn??((P=(k=i.locale)==null?void 0:k.options)==null?void 0:P.weekStartsOn)??0;if(t==="")return e===""?Ft(n):fn(n,NaN);const o={firstWeekContainsDate:d,weekStartsOn:r,locale:a},c=[new LD],p=t.match(vM).map(M=>{const w=M[0];if(w in lu){const T=lu[w];return T(M,a.formatLong)}return M}).join("").match(pM),u=[];for(let M of p){!(s!=null&&s.useAdditionalWeekYearTokens)&&B_(M)&&cu(M,t,e),!(s!=null&&s.useAdditionalDayOfYearTokens)&&F_(M)&&cu(M,t,e);const w=M[0],T=fM[w];if(T){const{incompatibleTokens:A}=T;if(Array.isArray(A)){const R=u.find(D=>A.includes(D.token)||D.token===w);if(R)throw new RangeError(`The format string mustn't contain \`${R.fullToken}\` and \`${M}\` at the same time`)}else if(T.incompatibleTokens==="*"&&u.length>0)throw new RangeError(`The format string mustn't contain \`${M}\` and any other token at the same time`);u.push({token:w,fullToken:M});const E=T.run(e,M,a.match,o);if(!E)return fn(n,NaN);c.push(E.setter),e=E.rest}else{if(w.match(yM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");if(M==="''"?M="'":w==="'"&&(M=wM(M)),e.indexOf(M)===0)e=e.slice(M.length);else return fn(n,NaN)}}if(e.length>0&&_M.test(e))return fn(n,NaN);const g=c.map(M=>M.priority).sort((M,w)=>w-M).filter((M,w,T)=>T.indexOf(M)===w).map(M=>c.filter(w=>w.priority===M).sort((w,T)=>T.subPriority-w.subPriority)).map(M=>M[0]);let m=Ft(n);if(isNaN(m.getTime()))return fn(n,NaN);const y={};for(const M of g){if(!M.validate(m,o))return fn(n,NaN);const w=M.set(m,y,o);Array.isArray(w)?(m=w[0],Object.assign(y,w[1])):m=w}return fn(n,m)}function wM(e){return e.match(gM)[1].replace(mM,"'")}function SM(e){const t=Ft(e);return t.setMinutes(0,0,0),t}function Pa(e,t){const n=Ft(e),s=Ft(t);return n.getFullYear()===s.getFullYear()&&n.getMonth()===s.getMonth()}function K_(e,t){const n=ya(e),s=ya(t);return+n==+s}function ph(e){const t=Ft(e);return t.setMilliseconds(0),t}function W_(e,t){const n=Ft(e),s=Ft(t);return n.getFullYear()===s.getFullYear()}function vh(e,t){const n=Ft(e),s=n.getFullYear(),i=n.getDate(),a=fn(e,0);a.setFullYear(s,t,15),a.setHours(0,0,0,0);const d=kD(a);return n.setMonth(t,Math.min(i,d)),n}function ts(e,t){let n=Ft(e);return isNaN(+n)?fn(e,NaN):(t.year!=null&&n.setFullYear(t.year),t.month!=null&&(n=vh(n,t.month)),t.date!=null&&n.setDate(t.date),t.hours!=null&&n.setHours(t.hours),t.minutes!=null&&n.setMinutes(t.minutes),t.seconds!=null&&n.setSeconds(t.seconds),t.milliseconds!=null&&n.setMilliseconds(t.milliseconds),n)}function Sr(e,t){const n=Ft(e);return n.setHours(t),n}function dd(e,t){const n=Ft(e);return n.setMinutes(t),n}function CM(e,t){const n=Ft(e),s=Math.trunc(n.getMonth()/3)+1,i=t-s;return vh(n,n.getMonth()+i*3)}function ud(e,t){const n=Ft(e);return n.setSeconds(t),n}function du(e,t){const n=Ft(e);return isNaN(+n)?fn(e,NaN):(n.setFullYear(t),n)}const kM={date:oD,month:Pa,year:W_,quarter:K_};function xM(e){return(t,n)=>{const s=(e+1)%7;return Qb(t,n,{weekStartsOn:s})}}function vs(e,t,n,s=0){return(n==="week"?xM(s):kM[n])(e,t)}function hd(e,t,n,s,i,a){return i==="date"?RM(e,t,n,s):TM(e,t,n,s,a)}function RM(e,t,n,s){let i=!1,a=!1,d=!1;Array.isArray(n)&&(n[0]e.value),r=ss(d,a),o=q(()=>{var u;return((u=r.value)===null||u===void 0?void 0:u.length)||0}),c=q(()=>Array.isArray(r.value)?new Set(r.value):new Set);function p(u,g){const{nTriggerFormInput:m,nTriggerFormChange:y}=n,{onChange:v,"onUpdate:value":l,onUpdateValue:h}=e;if(Array.isArray(r.value)){const f=Array.from(r.value),_=f.findIndex(S=>S===g);u?~_||(f.push(g),h&&Je(h,f,{actionType:"check",value:g}),l&&Je(l,f,{actionType:"check",value:g}),m(),y(),a.value=f,v&&Je(v,f)):~_&&(f.splice(_,1),h&&Je(h,f,{actionType:"uncheck",value:g}),l&&Je(l,f,{actionType:"uncheck",value:g}),v&&Je(v,f),a.value=f,m(),y())}else u?(h&&Je(h,[g],{actionType:"check",value:g}),l&&Je(l,[g],{actionType:"check",value:g}),v&&Je(v,[g]),a.value=[g],m(),y()):(h&&Je(h,[],{actionType:"uncheck",value:g}),l&&Je(l,[],{actionType:"uncheck",value:g}),v&&Je(v,[]),a.value=[],m(),y())}return kn(G_,{checkedCountRef:o,maxRef:ct(e,"max"),minRef:ct(e,"min"),valueSetRef:c,disabledRef:i,mergedSizeRef:s,toggleCheckbox:p}),{mergedClsPrefix:t}},render(){return B("div",{class:`${this.mergedClsPrefix}-checkbox-group`,role:"group"},this.$slots)}}),AM=()=>B("svg",{viewBox:"0 0 64 64",class:"check-icon"},B("path",{d:"M50.42,16.76L22.34,39.45l-8.1-11.46c-1.12-1.58-3.3-1.96-4.88-0.84c-1.58,1.12-1.95,3.3-0.84,4.88l10.26,14.51 c0.56,0.79,1.42,1.31,2.38,1.45c0.16,0.02,0.32,0.03,0.48,0.03c0.8,0,1.57-0.27,2.2-0.78l30.99-25.03c1.5-1.21,1.74-3.42,0.52-4.92 C54.13,15.78,51.93,15.55,50.42,16.76z"})),IM=()=>B("svg",{viewBox:"0 0 100 100",class:"line-icon"},B("path",{d:"M80.2,55.5H21.4c-2.8,0-5.1-2.5-5.1-5.5l0,0c0-3,2.3-5.5,5.1-5.5h58.7c2.8,0,5.1,2.5,5.1,5.5l0,0C85.2,53.1,82.9,55.5,80.2,55.5z"})),$M=ze([Ce("checkbox",` - font-size: var(--n-font-size); - outline: none; - cursor: pointer; - display: inline-flex; - flex-wrap: nowrap; - align-items: flex-start; - word-break: break-word; - line-height: var(--n-size); - --n-merged-color-table: var(--n-color-table); - `,[Ve("show-label","line-height: var(--n-label-line-height);"),ze("&:hover",[Ce("checkbox-box",[Ge("border","border: var(--n-border-checked);")])]),ze("&:focus:not(:active)",[Ce("checkbox-box",[Ge("border",` - border: var(--n-border-focus); - box-shadow: var(--n-box-shadow-focus); - `)])]),Ve("inside-table",[Ce("checkbox-box",` - background-color: var(--n-merged-color-table); - `)]),Ve("checked",[Ce("checkbox-box",` - background-color: var(--n-color-checked); - `,[Ce("checkbox-icon",[ze(".check-icon",` - opacity: 1; - transform: scale(1); - `)])])]),Ve("indeterminate",[Ce("checkbox-box",[Ce("checkbox-icon",[ze(".check-icon",` - opacity: 0; - transform: scale(.5); - `),ze(".line-icon",` - opacity: 1; - transform: scale(1); - `)])])]),Ve("checked, indeterminate",[ze("&:focus:not(:active)",[Ce("checkbox-box",[Ge("border",` - border: var(--n-border-checked); - box-shadow: var(--n-box-shadow-focus); - `)])]),Ce("checkbox-box",` - background-color: var(--n-color-checked); - border-left: 0; - border-top: 0; - `,[Ge("border",{border:"var(--n-border-checked)"})])]),Ve("disabled",{cursor:"not-allowed"},[Ve("checked",[Ce("checkbox-box",` - background-color: var(--n-color-disabled-checked); - `,[Ge("border",{border:"var(--n-border-disabled-checked)"}),Ce("checkbox-icon",[ze(".check-icon, .line-icon",{fill:"var(--n-check-mark-color-disabled-checked)"})])])]),Ce("checkbox-box",` - background-color: var(--n-color-disabled); - `,[Ge("border",` - border: var(--n-border-disabled); - `),Ce("checkbox-icon",[ze(".check-icon, .line-icon",` - fill: var(--n-check-mark-color-disabled); - `)])]),Ge("label",` - color: var(--n-text-color-disabled); - `)]),Ce("checkbox-box-wrapper",` - position: relative; - width: var(--n-size); - flex-shrink: 0; - flex-grow: 0; - user-select: none; - -webkit-user-select: none; - `),Ce("checkbox-box",` - position: absolute; - left: 0; - top: 50%; - transform: translateY(-50%); - height: var(--n-size); - width: var(--n-size); - display: inline-block; - box-sizing: border-box; - border-radius: var(--n-border-radius); - background-color: var(--n-color); - transition: background-color 0.3s var(--n-bezier); - `,[Ge("border",` - transition: - border-color .3s var(--n-bezier), - box-shadow .3s var(--n-bezier); - border-radius: inherit; - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - border: var(--n-border); - `),Ce("checkbox-icon",` - display: flex; - align-items: center; - justify-content: center; - position: absolute; - left: 1px; - right: 1px; - top: 1px; - bottom: 1px; - `,[ze(".check-icon, .line-icon",` - width: 100%; - fill: var(--n-check-mark-color); - opacity: 0; - transform: scale(0.5); - transform-origin: center; - transition: - fill 0.3s var(--n-bezier), - transform 0.3s var(--n-bezier), - opacity 0.3s var(--n-bezier), - border-color 0.3s var(--n-bezier); - `),Gr({left:"1px",top:"1px"})])]),Ge("label",` - color: var(--n-text-color); - transition: color .3s var(--n-bezier); - user-select: none; - -webkit-user-select: none; - padding: var(--n-label-padding); - font-weight: var(--n-label-font-weight); - `,[ze("&:empty",{display:"none"})])]),fg(Ce("checkbox",` - --n-merged-color-table: var(--n-color-table-modal); - `)),pg(Ce("checkbox",` - --n-merged-color-table: var(--n-color-table-popover); - `))]),OM=Object.assign(Object.assign({},Ht.props),{size:String,checked:{type:[Boolean,String,Number],default:void 0},defaultChecked:{type:[Boolean,String,Number],default:!1},value:[String,Number],disabled:{type:Boolean,default:void 0},indeterminate:Boolean,label:String,focusable:{type:Boolean,default:!0},checkedValue:{type:[Boolean,String,Number],default:!0},uncheckedValue:{type:[Boolean,String,Number],default:!1},"onUpdate:checked":[Function,Array],onUpdateChecked:[Function,Array],privateInsideTable:Boolean,onChange:[Function,Array]}),gh=Ae({name:"Checkbox",props:OM,setup(e){const t=Ut(G_,null),n=H(null),{mergedClsPrefixRef:s,inlineThemeDisabled:i,mergedRtlRef:a}=mn(e),d=H(e.defaultChecked),r=ct(e,"checked"),o=ss(r,d),c=Zt(()=>{if(t){const P=t.valueSetRef.value;return P&&e.value!==void 0?P.has(e.value):!1}else return o.value===e.checkedValue}),p=ar(e,{mergedSize(P){const{size:M}=e;if(M!==void 0)return M;if(t){const{value:w}=t.mergedSizeRef;if(w!==void 0)return w}if(P){const{mergedSize:w}=P;if(w!==void 0)return w.value}return"medium"},mergedDisabled(P){const{disabled:M}=e;if(M!==void 0)return M;if(t){if(t.disabledRef.value)return!0;const{maxRef:{value:w},checkedCountRef:T}=t;if(w!==void 0&&T.value>=w&&!c.value)return!0;const{minRef:{value:A}}=t;if(A!==void 0&&T.value<=A&&c.value)return!0}return P?P.disabled.value:!1}}),{mergedDisabledRef:u,mergedSizeRef:g}=p,m=Ht("Checkbox","-checkbox",$M,Zb,e,s);function y(P){if(t&&e.value!==void 0)t.toggleCheckbox(!c.value,e.value);else{const{onChange:M,"onUpdate:checked":w,onUpdateChecked:T}=e,{nTriggerFormInput:A,nTriggerFormChange:E}=p,R=c.value?e.uncheckedValue:e.checkedValue;w&&Je(w,R,P),T&&Je(T,R,P),M&&Je(M,R,P),A(),E(),d.value=R}}function v(P){u.value||y(P)}function l(P){if(!u.value)switch(P.key){case" ":case"Enter":y(P)}}function h(P){switch(P.key){case" ":P.preventDefault()}}const f={focus:()=>{var P;(P=n.value)===null||P===void 0||P.focus()},blur:()=>{var P;(P=n.value)===null||P===void 0||P.blur()}},_=pi("Checkbox",a,s),S=q(()=>{const{value:P}=g,{common:{cubicBezierEaseInOut:M},self:{borderRadius:w,color:T,colorChecked:A,colorDisabled:E,colorTableHeader:R,colorTableHeaderModal:D,colorTableHeaderPopover:I,checkMarkColor:O,checkMarkColorDisabled:U,border:W,borderFocus:N,borderDisabled:z,borderChecked:V,boxShadowFocus:j,textColor:G,textColorDisabled:te,checkMarkColorDisabledChecked:oe,colorDisabledChecked:re,borderDisabledChecked:ye,labelPadding:K,labelLineHeight:J,labelFontWeight:Q,[Mt("fontSize",P)]:de,[Mt("size",P)]:De}}=m.value;return{"--n-label-line-height":J,"--n-label-font-weight":Q,"--n-size":De,"--n-bezier":M,"--n-border-radius":w,"--n-border":W,"--n-border-checked":V,"--n-border-focus":N,"--n-border-disabled":z,"--n-border-disabled-checked":ye,"--n-box-shadow-focus":j,"--n-color":T,"--n-color-checked":A,"--n-color-table":R,"--n-color-table-modal":D,"--n-color-table-popover":I,"--n-color-disabled":E,"--n-color-disabled-checked":re,"--n-text-color":G,"--n-text-color-disabled":te,"--n-check-mark-color":O,"--n-check-mark-color-disabled":U,"--n-check-mark-color-disabled-checked":oe,"--n-font-size":de,"--n-label-padding":K}}),k=i?Un("checkbox",q(()=>g.value[0]),S,e):void 0;return Object.assign(p,f,{rtlEnabled:_,selfRef:n,mergedClsPrefix:s,mergedDisabled:u,renderedChecked:c,mergedTheme:m,labelId:Mu(),handleClick:v,handleKeyUp:l,handleKeyDown:h,cssVars:i?void 0:S,themeClass:k==null?void 0:k.themeClass,onRender:k==null?void 0:k.onRender})},render(){var e;const{$slots:t,renderedChecked:n,mergedDisabled:s,indeterminate:i,privateInsideTable:a,cssVars:d,labelId:r,label:o,mergedClsPrefix:c,focusable:p,handleKeyUp:u,handleKeyDown:g,handleClick:m}=this;(e=this.onRender)===null||e===void 0||e.call(this);const y=Us(t.default,v=>o||v?B("span",{class:`${c}-checkbox__label`,id:r},o||v):null);return B("div",{ref:"selfRef",class:[`${c}-checkbox`,this.themeClass,this.rtlEnabled&&`${c}-checkbox--rtl`,n&&`${c}-checkbox--checked`,s&&`${c}-checkbox--disabled`,i&&`${c}-checkbox--indeterminate`,a&&`${c}-checkbox--inside-table`,y&&`${c}-checkbox--show-label`],tabindex:s||!p?void 0:0,role:"checkbox","aria-checked":i?"mixed":n,"aria-labelledby":r,style:d,onKeyup:u,onKeydown:g,onClick:m,onMousedown:()=>{Wn("selectstart",window,v=>{v.preventDefault()},{once:!0})}},B("div",{class:`${c}-checkbox-box-wrapper`}," ",B("div",{class:`${c}-checkbox-box`},B(vg,null,{default:()=>this.indeterminate?B("div",{key:"indeterminate",class:`${c}-checkbox-icon`},IM()):B("div",{key:"check",class:`${c}-checkbox-icon`},AM())}),B("div",{class:`${c}-checkbox-box__border`}))),y)}}),X_=ds("n-popselect"),FM=Ce("popselect-menu",` - box-shadow: var(--n-menu-box-shadow); -`),mh={multiple:Boolean,value:{type:[String,Number,Array],default:null},cancelable:Boolean,options:{type:Array,default:()=>[]},size:{type:String,default:"medium"},scrollable:Boolean,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onMouseenter:Function,onMouseleave:Function,renderLabel:Function,showCheckmark:{type:Boolean,default:void 0},nodeProps:Function,virtualScroll:Boolean,onChange:[Function,Array]},rv=mg(mh),BM=Ae({name:"PopselectPanel",props:mh,setup(e){const t=Ut(X_),{mergedClsPrefixRef:n,inlineThemeDisabled:s}=mn(e),i=Ht("Popselect","-pop-select",FM,gg,t.props,n),a=q(()=>pc(e.options,D_("value","children")));function d(g,m){const{onUpdateValue:y,"onUpdate:value":v,onChange:l}=e;y&&Je(y,g,m),v&&Je(v,g,m),l&&Je(l,g,m)}function r(g){c(g.key)}function o(g){!Rs(g,"action")&&!Rs(g,"empty")&&!Rs(g,"header")&&g.preventDefault()}function c(g){const{value:{getNode:m}}=a;if(e.multiple)if(Array.isArray(e.value)){const y=[],v=[];let l=!0;e.value.forEach(h=>{if(h===g){l=!1;return}const f=m(h);f&&(y.push(f.key),v.push(f.rawNode))}),l&&(y.push(g),v.push(m(g).rawNode)),d(y,v)}else{const y=m(g);y&&d([g],[y.rawNode])}else if(e.value===g&&e.cancelable)d(null,null);else{const y=m(g);y&&d(g,y.rawNode);const{"onUpdate:show":v,onUpdateShow:l}=t.props;v&&Je(v,!1),l&&Je(l,!1),t.setShow(!1)}un(()=>{t.syncPosition()})}_t(ct(e,"options"),()=>{un(()=>{t.syncPosition()})});const p=q(()=>{const{self:{menuBoxShadow:g}}=i.value;return{"--n-menu-box-shadow":g}}),u=s?Un("select",void 0,p,t.props):void 0;return{mergedTheme:t.mergedThemeRef,mergedClsPrefix:n,treeMate:a,handleToggle:r,handleMenuMousedown:o,cssVars:s?void 0:p,themeClass:u==null?void 0:u.themeClass,onRender:u==null?void 0:u.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),B(T_,{clsPrefix:this.mergedClsPrefix,focusable:!0,nodeProps:this.nodeProps,class:[`${this.mergedClsPrefix}-popselect-menu`,this.themeClass],style:this.cssVars,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,multiple:this.multiple,treeMate:this.treeMate,size:this.size,value:this.value,virtualScroll:this.virtualScroll,scrollable:this.scrollable,renderLabel:this.renderLabel,onToggle:this.handleToggle,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseenter,onMousedown:this.handleMenuMousedown,showCheckmark:this.showCheckmark},{header:()=>{var t,n;return((n=(t=this.$slots).header)===null||n===void 0?void 0:n.call(t))||[]},action:()=>{var t,n;return((n=(t=this.$slots).action)===null||n===void 0?void 0:n.call(t))||[]},empty:()=>{var t,n;return((n=(t=this.$slots).empty)===null||n===void 0?void 0:n.call(t))||[]}})}}),HM=Object.assign(Object.assign(Object.assign(Object.assign({},Ht.props),Ou(Ir,["showArrow","arrow"])),{placement:Object.assign(Object.assign({},Ir.placement),{default:"bottom"}),trigger:{type:String,default:"hover"}}),mh),NM=Ae({name:"Popselect",props:HM,inheritAttrs:!1,__popover__:!0,setup(e){const{mergedClsPrefixRef:t}=mn(e),n=Ht("Popselect","-popselect",void 0,gg,e,t),s=H(null);function i(){var r;(r=s.value)===null||r===void 0||r.syncPosition()}function a(r){var o;(o=s.value)===null||o===void 0||o.setShow(r)}return kn(X_,{props:e,mergedThemeRef:n,syncPosition:i,setShow:a}),Object.assign(Object.assign({},{syncPosition:i,setShow:a}),{popoverInstRef:s,mergedTheme:n})},render(){const{mergedTheme:e}=this,t={theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:{padding:"0"},ref:"popoverInstRef",internalRenderBody:(n,s,i,a,d)=>{const{$attrs:r}=this;return B(BM,Object.assign({},r,{class:[r.class,n],style:[r.style,...i]},fc(this.$props,rv),{ref:y_(s),onMouseenter:ua([a,r.onMouseenter]),onMouseleave:ua([d,r.onMouseleave])}),{header:()=>{var o,c;return(c=(o=this.$slots).header)===null||c===void 0?void 0:c.call(o)},action:()=>{var o,c;return(c=(o=this.$slots).action)===null||c===void 0?void 0:c.call(o)},empty:()=>{var o,c;return(c=(o=this.$slots).empty)===null||c===void 0?void 0:c.call(o)}})}};return B(Lo,Object.assign({},Ou(this.$props,rv),t,{internalDeactivateImmediately:!0}),{trigger:()=>{var n,s;return(s=(n=this.$slots).default)===null||s===void 0?void 0:s.call(n)}})}}),zM=ze([Ce("select",` - z-index: auto; - outline: none; - width: 100%; - position: relative; - font-weight: var(--n-font-weight); - `),Ce("select-menu",` - margin: 4px 0; - box-shadow: var(--n-menu-box-shadow); - `,[Eo({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),UM=Object.assign(Object.assign({},Ht.props),{to:cs.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),J_=Ae({name:"Select",props:UM,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:n,namespaceRef:s,inlineThemeDisabled:i}=mn(e),a=Ht("Select","-select",zM,e0,e,t),d=H(e.defaultValue),r=ct(e,"value"),o=ss(r,d),c=H(!1),p=H(""),u=nh(e,["items","options"]),g=H([]),m=H([]),y=q(()=>m.value.concat(g.value).concat(u.value)),v=q(()=>{const{filter:se}=e;if(se)return se;const{labelField:ge,valueField:Oe}=e;return(Ke,Be)=>{if(!Be)return!1;const me=Be[ge];if(typeof me=="string")return cd(Ke,me);const Fe=Be[Oe];return typeof Fe=="string"?cd(Ke,Fe):typeof Fe=="number"?cd(Ke,String(Fe)):!1}}),l=q(()=>{if(e.remote)return u.value;{const{value:se}=y,{value:ge}=p;return!ge.length||!e.filterable?se:JL(se,v.value,ge,e.childrenField)}}),h=q(()=>{const{valueField:se,childrenField:ge}=e,Oe=D_(se,ge);return pc(l.value,Oe)}),f=q(()=>QL(y.value,e.valueField,e.childrenField)),_=H(!1),S=ss(ct(e,"show"),_),k=H(null),P=H(null),M=H(null),{localeRef:w}=Qs("Select"),T=q(()=>{var se;return(se=e.placeholder)!==null&&se!==void 0?se:w.value.placeholder}),A=[],E=H(new Map),R=q(()=>{const{fallbackOption:se}=e;if(se===void 0){const{labelField:ge,valueField:Oe}=e;return Ke=>({[ge]:String(Ke),[Oe]:Ke})}return se===!1?!1:ge=>Object.assign(se(ge),{value:ge})});function D(se){const ge=e.remote,{value:Oe}=E,{value:Ke}=f,{value:Be}=R,me=[];return se.forEach(Fe=>{if(Ke.has(Fe))me.push(Ke.get(Fe));else if(ge&&Oe.has(Fe))me.push(Oe.get(Fe));else if(Be){const fe=Be(Fe);fe&&me.push(fe)}}),me}const I=q(()=>{if(e.multiple){const{value:se}=o;return Array.isArray(se)?D(se):[]}return null}),O=q(()=>{const{value:se}=o;return!e.multiple&&!Array.isArray(se)?se===null?null:D([se])[0]||null:null}),U=ar(e),{mergedSizeRef:W,mergedDisabledRef:N,mergedStatusRef:z}=U;function V(se,ge){const{onChange:Oe,"onUpdate:value":Ke,onUpdateValue:Be}=e,{nTriggerFormChange:me,nTriggerFormInput:Fe}=U;Oe&&Je(Oe,se,ge),Be&&Je(Be,se,ge),Ke&&Je(Ke,se,ge),d.value=se,me(),Fe()}function j(se){const{onBlur:ge}=e,{nTriggerFormBlur:Oe}=U;ge&&Je(ge,se),Oe()}function G(){const{onClear:se}=e;se&&Je(se)}function te(se){const{onFocus:ge,showOnFocus:Oe}=e,{nTriggerFormFocus:Ke}=U;ge&&Je(ge,se),Ke(),Oe&&J()}function oe(se){const{onSearch:ge}=e;ge&&Je(ge,se)}function re(se){const{onScroll:ge}=e;ge&&Je(ge,se)}function ye(){var se;const{remote:ge,multiple:Oe}=e;if(ge){const{value:Ke}=E;if(Oe){const{valueField:Be}=e;(se=I.value)===null||se===void 0||se.forEach(me=>{Ke.set(me[Be],me)})}else{const Be=O.value;Be&&Ke.set(Be[e.valueField],Be)}}}function K(se){const{onUpdateShow:ge,"onUpdate:show":Oe}=e;ge&&Je(ge,se),Oe&&Je(Oe,se),_.value=se}function J(){N.value||(K(!0),_.value=!0,e.filterable&&xt())}function Q(){K(!1)}function de(){p.value="",m.value=A}const De=H(!1);function Pe(){e.filterable&&(De.value=!0)}function Ye(){e.filterable&&(De.value=!1,S.value||de())}function st(){N.value||(S.value?e.filterable?xt():Q():J())}function yt(se){var ge,Oe;!((Oe=(ge=M.value)===null||ge===void 0?void 0:ge.selfRef)===null||Oe===void 0)&&Oe.contains(se.relatedTarget)||(c.value=!1,j(se),Q())}function ce(se){te(se),c.value=!0}function ae(){c.value=!0}function be(se){var ge;!((ge=k.value)===null||ge===void 0)&&ge.$el.contains(se.relatedTarget)||(c.value=!1,j(se),Q())}function he(){var se;(se=k.value)===null||se===void 0||se.focus(),Q()}function Le(se){var ge;S.value&&(!((ge=k.value)===null||ge===void 0)&&ge.$el.contains(Dr(se))||Q())}function et(se){if(!Array.isArray(se))return[];if(R.value)return Array.from(se);{const{remote:ge}=e,{value:Oe}=f;if(ge){const{value:Ke}=E;return se.filter(Be=>Oe.has(Be)||Ke.has(Be))}else return se.filter(Ke=>Oe.has(Ke))}}function je(se){_e(se.rawNode)}function _e(se){if(N.value)return;const{tag:ge,remote:Oe,clearFilterAfterSelect:Ke,valueField:Be}=e;if(ge&&!Oe){const{value:me}=m,Fe=me[0]||null;if(Fe){const fe=g.value;fe.length?fe.push(Fe):g.value=[Fe],m.value=A}}if(Oe&&E.value.set(se[Be],se),e.multiple){const me=et(o.value),Fe=me.findIndex(fe=>fe===se[Be]);if(~Fe){if(me.splice(Fe,1),ge&&!Oe){const fe=ie(se[Be]);~fe&&(g.value.splice(fe,1),Ke&&(p.value=""))}}else me.push(se[Be]),Ke&&(p.value="");V(me,D(me))}else{if(ge&&!Oe){const me=ie(se[Be]);~me?g.value=[g.value[me]]:g.value=A}Ue(),Q(),V(se[Be],se)}}function ie(se){return g.value.findIndex(Oe=>Oe[e.valueField]===se)}function we(se){S.value||J();const{value:ge}=se.target;p.value=ge;const{tag:Oe,remote:Ke}=e;if(oe(ge),Oe&&!Ke){if(!ge){m.value=A;return}const{onCreate:Be}=e,me=Be?Be(ge):{[e.labelField]:ge,[e.valueField]:ge},{valueField:Fe,labelField:fe}=e;u.value.some(nt=>nt[Fe]===me[Fe]||nt[fe]===me[fe])||g.value.some(nt=>nt[Fe]===me[Fe]||nt[fe]===me[fe])?m.value=A:m.value=[me]}}function Ee(se){se.stopPropagation();const{multiple:ge}=e;!ge&&e.filterable&&Q(),G(),ge?V([],[]):V(null,null)}function x(se){!Rs(se,"action")&&!Rs(se,"empty")&&!Rs(se,"header")&&se.preventDefault()}function Re(se){re(se)}function Xe(se){var ge,Oe,Ke,Be,me;if(!e.keyboard){se.preventDefault();return}switch(se.key){case" ":if(e.filterable)break;se.preventDefault();case"Enter":if(!(!((ge=k.value)===null||ge===void 0)&&ge.isComposing)){if(S.value){const Fe=(Oe=M.value)===null||Oe===void 0?void 0:Oe.getPendingTmNode();Fe?je(Fe):e.filterable||(Q(),Ue())}else if(J(),e.tag&&De.value){const Fe=m.value[0];if(Fe){const fe=Fe[e.valueField],{value:nt}=o;e.multiple&&Array.isArray(nt)&&nt.includes(fe)||_e(Fe)}}}se.preventDefault();break;case"ArrowUp":if(se.preventDefault(),e.loading)return;S.value&&((Ke=M.value)===null||Ke===void 0||Ke.prev());break;case"ArrowDown":if(se.preventDefault(),e.loading)return;S.value?(Be=M.value)===null||Be===void 0||Be.next():J();break;case"Escape":S.value&&(_a(se),Q()),(me=k.value)===null||me===void 0||me.focus();break}}function Ue(){var se;(se=k.value)===null||se===void 0||se.focus()}function xt(){var se;(se=k.value)===null||se===void 0||se.focusInput()}function Ze(){var se;S.value&&((se=P.value)===null||se===void 0||se.syncPosition())}ye(),_t(ct(e,"options"),ye);const wt={focus:()=>{var se;(se=k.value)===null||se===void 0||se.focus()},focusInput:()=>{var se;(se=k.value)===null||se===void 0||se.focusInput()},blur:()=>{var se;(se=k.value)===null||se===void 0||se.blur()},blurInput:()=>{var se;(se=k.value)===null||se===void 0||se.blurInput()}},tt=q(()=>{const{self:{menuBoxShadow:se}}=a.value;return{"--n-menu-box-shadow":se}}),gt=i?Un("select",void 0,tt,e):void 0;return Object.assign(Object.assign({},wt),{mergedStatus:z,mergedClsPrefix:t,mergedBordered:n,namespace:s,treeMate:h,isMounted:Sa(),triggerRef:k,menuRef:M,pattern:p,uncontrolledShow:_,mergedShow:S,adjustedTo:cs(e),uncontrolledValue:d,mergedValue:o,followerRef:P,localizedPlaceholder:T,selectedOption:O,selectedOptions:I,mergedSize:W,mergedDisabled:N,focused:c,activeWithoutMenuOpen:De,inlineThemeDisabled:i,onTriggerInputFocus:Pe,onTriggerInputBlur:Ye,handleTriggerOrMenuResize:Ze,handleMenuFocus:ae,handleMenuBlur:be,handleMenuTabOut:he,handleTriggerClick:st,handleToggle:je,handleDeleteOption:_e,handlePatternInput:we,handleClear:Ee,handleTriggerBlur:yt,handleTriggerFocus:ce,handleKeydown:Xe,handleMenuAfterLeave:de,handleMenuClickOutside:Le,handleMenuScroll:Re,handleMenuKeydown:Xe,handleMenuMousedown:x,mergedTheme:a,cssVars:i?void 0:tt,themeClass:gt==null?void 0:gt.themeClass,onRender:gt==null?void 0:gt.onRender})},render(){return B("div",{class:`${this.mergedClsPrefix}-select`},B(Ro,null,{default:()=>[B(To,null,{default:()=>B(XL,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var e,t;return[(t=(e=this.$slots).arrow)===null||t===void 0?void 0:t.call(e)]}})}),B(Po,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===cs.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>B(ks,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var e,t,n;return this.mergedShow||this.displayDirective==="show"?((e=this.onRender)===null||e===void 0||e.call(this),rt(B(T_,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(t=this.menuProps)===null||t===void 0?void 0:t.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var s,i;return[(i=(s=this.$slots).empty)===null||i===void 0?void 0:i.call(s)]},header:()=>{var s,i;return[(i=(s=this.$slots).header)===null||i===void 0?void 0:i.call(s)]},action:()=>{var s,i;return[(i=(s=this.$slots).action)===null||i===void 0?void 0:i.call(s)]}}),this.displayDirective==="show"?[[Ss,this.mergedShow],[Ar,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[Ar,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),ov=` - background: var(--n-item-color-hover); - color: var(--n-item-text-color-hover); - border: var(--n-item-border-hover); -`,av=[Ve("button",` - background: var(--n-button-color-hover); - border: var(--n-button-border-hover); - color: var(--n-button-icon-color-hover); - `)],VM=Ce("pagination",` - display: flex; - vertical-align: middle; - font-size: var(--n-item-font-size); - flex-wrap: nowrap; -`,[Ce("pagination-prefix",` - display: flex; - align-items: center; - margin: var(--n-prefix-margin); - `),Ce("pagination-suffix",` - display: flex; - align-items: center; - margin: var(--n-suffix-margin); - `),ze("> *:not(:first-child)",` - margin: var(--n-item-margin); - `),Ce("select",` - width: var(--n-select-width); - `),ze("&.transition-disabled",[Ce("pagination-item","transition: none!important;")]),Ce("pagination-quick-jumper",` - white-space: nowrap; - display: flex; - color: var(--n-jumper-text-color); - transition: color .3s var(--n-bezier); - align-items: center; - font-size: var(--n-jumper-font-size); - `,[Ce("input",` - margin: var(--n-input-margin); - width: var(--n-input-width); - `)]),Ce("pagination-item",` - position: relative; - cursor: pointer; - user-select: none; - -webkit-user-select: none; - display: flex; - align-items: center; - justify-content: center; - box-sizing: border-box; - min-width: var(--n-item-size); - height: var(--n-item-size); - padding: var(--n-item-padding); - background-color: var(--n-item-color); - color: var(--n-item-text-color); - border-radius: var(--n-item-border-radius); - border: var(--n-item-border); - fill: var(--n-button-icon-color); - transition: - color .3s var(--n-bezier), - border-color .3s var(--n-bezier), - background-color .3s var(--n-bezier), - fill .3s var(--n-bezier); - `,[Ve("button",` - background: var(--n-button-color); - color: var(--n-button-icon-color); - border: var(--n-button-border); - padding: 0; - `,[Ce("base-icon",` - font-size: var(--n-button-icon-size); - `)]),Cn("disabled",[Ve("hover",ov,av),ze("&:hover",ov,av),ze("&:active",` - background: var(--n-item-color-pressed); - color: var(--n-item-text-color-pressed); - border: var(--n-item-border-pressed); - `,[Ve("button",` - background: var(--n-button-color-pressed); - border: var(--n-button-border-pressed); - color: var(--n-button-icon-color-pressed); - `)]),Ve("active",` - background: var(--n-item-color-active); - color: var(--n-item-text-color-active); - border: var(--n-item-border-active); - `,[ze("&:hover",` - background: var(--n-item-color-active-hover); - `)])]),Ve("disabled",` - cursor: not-allowed; - color: var(--n-item-text-color-disabled); - `,[Ve("active, button",` - background-color: var(--n-item-color-disabled); - border: var(--n-item-border-disabled); - `)])]),Ve("disabled",` - cursor: not-allowed; - `,[Ce("pagination-quick-jumper",` - color: var(--n-jumper-text-color-disabled); - `)]),Ve("simple",` - display: flex; - align-items: center; - flex-wrap: nowrap; - `,[Ce("pagination-quick-jumper",[Ce("input",` - margin: 0; - `)])])]);function Q_(e){var t;if(!e)return 10;const{defaultPageSize:n}=e;if(n!==void 0)return n;const s=(t=e.pageSizes)===null||t===void 0?void 0:t[0];return typeof s=="number"?s:(s==null?void 0:s.value)||10}function KM(e,t,n,s){let i=!1,a=!1,d=1,r=t;if(t===1)return{hasFastBackward:!1,hasFastForward:!1,fastForwardTo:r,fastBackwardTo:d,items:[{type:"page",label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1}]};if(t===2)return{hasFastBackward:!1,hasFastForward:!1,fastForwardTo:r,fastBackwardTo:d,items:[{type:"page",label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1},{type:"page",label:2,active:e===2,mayBeFastBackward:!0,mayBeFastForward:!1}]};const o=1,c=t;let p=e,u=e;const g=(n-5)/2;u+=Math.ceil(g),u=Math.min(Math.max(u,o+n-3),c-2),p-=Math.floor(g),p=Math.max(Math.min(p,c-n+3),o+2);let m=!1,y=!1;p>o+2&&(m=!0),u=o+1&&v.push({type:"page",label:o+1,mayBeFastBackward:!0,mayBeFastForward:!1,active:e===o+1});for(let l=p;l<=u;++l)v.push({type:"page",label:l,mayBeFastBackward:!1,mayBeFastForward:!1,active:e===l});return y?(a=!0,r=u+1,v.push({type:"fast-forward",active:!1,label:void 0,options:s?lv(u+1,c-1):null})):u===c-2&&v[v.length-1].label!==c-1&&v.push({type:"page",mayBeFastForward:!0,mayBeFastBackward:!1,label:c-1,active:e===c-1}),v[v.length-1].label!==c&&v.push({type:"page",mayBeFastForward:!1,mayBeFastBackward:!1,label:c,active:e===c}),{hasFastBackward:i,hasFastForward:a,fastBackwardTo:d,fastForwardTo:r,items:v}}function lv(e,t){const n=[];for(let s=e;s<=t;++s)n.push({label:`${s}`,value:s});return n}const WM=Object.assign(Object.assign({},Ht.props),{simple:Boolean,page:Number,defaultPage:{type:Number,default:1},itemCount:Number,pageCount:Number,defaultPageCount:{type:Number,default:1},showSizePicker:Boolean,pageSize:Number,defaultPageSize:Number,pageSizes:{type:Array,default(){return[10]}},showQuickJumper:Boolean,size:{type:String,default:"medium"},disabled:Boolean,pageSlot:{type:Number,default:9},selectProps:Object,prev:Function,next:Function,goto:Function,prefix:Function,suffix:Function,label:Function,displayOrder:{type:Array,default:["pages","size-picker","quick-jumper"]},to:cs.propTo,showQuickJumpDropdown:{type:Boolean,default:!0},"onUpdate:page":[Function,Array],onUpdatePage:[Function,Array],"onUpdate:pageSize":[Function,Array],onUpdatePageSize:[Function,Array],onPageSizeChange:[Function,Array],onChange:[Function,Array]}),jM=Ae({name:"Pagination",props:WM,setup(e){const{mergedComponentPropsRef:t,mergedClsPrefixRef:n,inlineThemeDisabled:s,mergedRtlRef:i}=mn(e),a=Ht("Pagination","-pagination",VM,t0,e,n),{localeRef:d}=Qs("Pagination"),r=H(null),o=H(e.defaultPage),c=H(Q_(e)),p=ss(ct(e,"page"),o),u=ss(ct(e,"pageSize"),c),g=q(()=>{const{itemCount:Q}=e;if(Q!==void 0)return Math.max(1,Math.ceil(Q/u.value));const{pageCount:de}=e;return de!==void 0?Math.max(de,1):1}),m=H("");Vs(()=>{e.simple,m.value=String(p.value)});const y=H(!1),v=H(!1),l=H(!1),h=H(!1),f=()=>{e.disabled||(y.value=!0,O())},_=()=>{e.disabled||(y.value=!1,O())},S=()=>{v.value=!0,O()},k=()=>{v.value=!1,O()},P=Q=>{U(Q)},M=q(()=>KM(p.value,g.value,e.pageSlot,e.showQuickJumpDropdown));Vs(()=>{M.value.hasFastBackward?M.value.hasFastForward||(y.value=!1,l.value=!1):(v.value=!1,h.value=!1)});const w=q(()=>{const Q=d.value.selectionSuffix;return e.pageSizes.map(de=>typeof de=="number"?{label:`${de} / ${Q}`,value:de}:de)}),T=q(()=>{var Q,de;return((de=(Q=t==null?void 0:t.value)===null||Q===void 0?void 0:Q.Pagination)===null||de===void 0?void 0:de.inputSize)||Ip(e.size)}),A=q(()=>{var Q,de;return((de=(Q=t==null?void 0:t.value)===null||Q===void 0?void 0:Q.Pagination)===null||de===void 0?void 0:de.selectSize)||Ip(e.size)}),E=q(()=>(p.value-1)*u.value),R=q(()=>{const Q=p.value*u.value-1,{itemCount:de}=e;return de!==void 0&&Q>de-1?de-1:Q}),D=q(()=>{const{itemCount:Q}=e;return Q!==void 0?Q:(e.pageCount||1)*u.value}),I=pi("Pagination",i,n);function O(){un(()=>{var Q;const{value:de}=r;de&&(de.classList.add("transition-disabled"),(Q=r.value)===null||Q===void 0||Q.offsetWidth,de.classList.remove("transition-disabled"))})}function U(Q){if(Q===p.value)return;const{"onUpdate:page":de,onUpdatePage:De,onChange:Pe,simple:Ye}=e;de&&Je(de,Q),De&&Je(De,Q),Pe&&Je(Pe,Q),o.value=Q,Ye&&(m.value=String(Q))}function W(Q){if(Q===u.value)return;const{"onUpdate:pageSize":de,onUpdatePageSize:De,onPageSizeChange:Pe}=e;de&&Je(de,Q),De&&Je(De,Q),Pe&&Je(Pe,Q),c.value=Q,g.value{p.value,u.value,O()});const K=q(()=>{const{size:Q}=e,{self:{buttonBorder:de,buttonBorderHover:De,buttonBorderPressed:Pe,buttonIconColor:Ye,buttonIconColorHover:st,buttonIconColorPressed:yt,itemTextColor:ce,itemTextColorHover:ae,itemTextColorPressed:be,itemTextColorActive:he,itemTextColorDisabled:Le,itemColor:et,itemColorHover:je,itemColorPressed:_e,itemColorActive:ie,itemColorActiveHover:we,itemColorDisabled:Ee,itemBorder:x,itemBorderHover:Re,itemBorderPressed:Xe,itemBorderActive:Ue,itemBorderDisabled:xt,itemBorderRadius:Ze,jumperTextColor:wt,jumperTextColorDisabled:tt,buttonColor:gt,buttonColorHover:se,buttonColorPressed:ge,[Mt("itemPadding",Q)]:Oe,[Mt("itemMargin",Q)]:Ke,[Mt("inputWidth",Q)]:Be,[Mt("selectWidth",Q)]:me,[Mt("inputMargin",Q)]:Fe,[Mt("selectMargin",Q)]:fe,[Mt("jumperFontSize",Q)]:nt,[Mt("prefixMargin",Q)]:At,[Mt("suffixMargin",Q)]:St,[Mt("itemSize",Q)]:xe,[Mt("buttonIconSize",Q)]:qe,[Mt("itemFontSize",Q)]:ht,[`${Mt("itemMargin",Q)}Rtl`]:Et,[`${Mt("inputMargin",Q)}Rtl`]:jt},common:{cubicBezierEaseInOut:Kt}}=a.value;return{"--n-prefix-margin":At,"--n-suffix-margin":St,"--n-item-font-size":ht,"--n-select-width":me,"--n-select-margin":fe,"--n-input-width":Be,"--n-input-margin":Fe,"--n-input-margin-rtl":jt,"--n-item-size":xe,"--n-item-text-color":ce,"--n-item-text-color-disabled":Le,"--n-item-text-color-hover":ae,"--n-item-text-color-active":he,"--n-item-text-color-pressed":be,"--n-item-color":et,"--n-item-color-hover":je,"--n-item-color-disabled":Ee,"--n-item-color-active":ie,"--n-item-color-active-hover":we,"--n-item-color-pressed":_e,"--n-item-border":x,"--n-item-border-hover":Re,"--n-item-border-disabled":xt,"--n-item-border-active":Ue,"--n-item-border-pressed":Xe,"--n-item-padding":Oe,"--n-item-border-radius":Ze,"--n-bezier":Kt,"--n-jumper-font-size":nt,"--n-jumper-text-color":wt,"--n-jumper-text-color-disabled":tt,"--n-item-margin":Ke,"--n-item-margin-rtl":Et,"--n-button-icon-size":qe,"--n-button-icon-color":Ye,"--n-button-icon-color-hover":st,"--n-button-icon-color-pressed":yt,"--n-button-color-hover":se,"--n-button-color":gt,"--n-button-color-pressed":ge,"--n-button-border":de,"--n-button-border-hover":De,"--n-button-border-pressed":Pe}}),J=s?Un("pagination",q(()=>{let Q="";const{size:de}=e;return Q+=de[0],Q}),K,e):void 0;return{rtlEnabled:I,mergedClsPrefix:n,locale:d,selfRef:r,mergedPage:p,pageItems:q(()=>M.value.items),mergedItemCount:D,jumperValue:m,pageSizeOptions:w,mergedPageSize:u,inputSize:T,selectSize:A,mergedTheme:a,mergedPageCount:g,startIndex:E,endIndex:R,showFastForwardMenu:l,showFastBackwardMenu:h,fastForwardActive:y,fastBackwardActive:v,handleMenuSelect:P,handleFastForwardMouseenter:f,handleFastForwardMouseleave:_,handleFastBackwardMouseenter:S,handleFastBackwardMouseleave:k,handleJumperInput:ye,handleBackwardClick:z,handleForwardClick:N,handlePageItemClick:re,handleSizePickerChange:G,handleQuickJumperChange:oe,cssVars:s?void 0:K,themeClass:J==null?void 0:J.themeClass,onRender:J==null?void 0:J.onRender}},render(){const{$slots:e,mergedClsPrefix:t,disabled:n,cssVars:s,mergedPage:i,mergedPageCount:a,pageItems:d,showSizePicker:r,showQuickJumper:o,mergedTheme:c,locale:p,inputSize:u,selectSize:g,mergedPageSize:m,pageSizeOptions:y,jumperValue:v,simple:l,prev:h,next:f,prefix:_,suffix:S,label:k,goto:P,handleJumperInput:M,handleSizePickerChange:w,handleBackwardClick:T,handlePageItemClick:A,handleForwardClick:E,handleQuickJumperChange:R,onRender:D}=this;D==null||D();const I=e.prefix||_,O=e.suffix||S,U=h||e.prev,W=f||e.next,N=k||e.label;return B("div",{ref:"selfRef",class:[`${t}-pagination`,this.themeClass,this.rtlEnabled&&`${t}-pagination--rtl`,n&&`${t}-pagination--disabled`,l&&`${t}-pagination--simple`],style:s},I?B("div",{class:`${t}-pagination-prefix`},I({page:i,pageSize:m,pageCount:a,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount})):null,this.displayOrder.map(z=>{switch(z){case"pages":return B(Ie,null,B("div",{class:[`${t}-pagination-item`,!U&&`${t}-pagination-item--button`,(i<=1||i>a||n)&&`${t}-pagination-item--disabled`],onClick:T},U?U({page:i,pageSize:m,pageCount:a,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount}):B(Kn,{clsPrefix:t},{default:()=>this.rtlEnabled?B(or,null):B(sr,null)})),l?B(Ie,null,B("div",{class:`${t}-pagination-quick-jumper`},B(Is,{value:v,onUpdateValue:M,size:u,placeholder:"",disabled:n,theme:c.peers.Input,themeOverrides:c.peerOverrides.Input,onChange:R}))," /"," ",a):d.map((V,j)=>{let G,te,oe;const{type:re}=V;switch(re){case"page":const K=V.label;N?G=N({type:"page",node:K,active:V.active}):G=K;break;case"fast-forward":const J=this.fastForwardActive?B(Kn,{clsPrefix:t},{default:()=>this.rtlEnabled?B(ir,null):B(rr,null)}):B(Kn,{clsPrefix:t},{default:()=>B(Yp,null)});N?G=N({type:"fast-forward",node:J,active:this.fastForwardActive||this.showFastForwardMenu}):G=J,te=this.handleFastForwardMouseenter,oe=this.handleFastForwardMouseleave;break;case"fast-backward":const Q=this.fastBackwardActive?B(Kn,{clsPrefix:t},{default:()=>this.rtlEnabled?B(rr,null):B(ir,null)}):B(Kn,{clsPrefix:t},{default:()=>B(Yp,null)});N?G=N({type:"fast-backward",node:Q,active:this.fastBackwardActive||this.showFastBackwardMenu}):G=Q,te=this.handleFastBackwardMouseenter,oe=this.handleFastBackwardMouseleave;break}const ye=B("div",{key:j,class:[`${t}-pagination-item`,V.active&&`${t}-pagination-item--active`,re!=="page"&&(re==="fast-backward"&&this.showFastBackwardMenu||re==="fast-forward"&&this.showFastForwardMenu)&&`${t}-pagination-item--hover`,n&&`${t}-pagination-item--disabled`,re==="page"&&`${t}-pagination-item--clickable`],onClick:()=>{A(V)},onMouseenter:te,onMouseleave:oe},G);if(re==="page"&&!V.mayBeFastBackward&&!V.mayBeFastForward)return ye;{const K=V.type==="page"?V.mayBeFastBackward?"fast-backward":"fast-forward":V.type;return V.type!=="page"&&!V.options?ye:B(NM,{to:this.to,key:K,disabled:n,trigger:"hover",virtualScroll:!0,style:{width:"60px"},theme:c.peers.Popselect,themeOverrides:c.peerOverrides.Popselect,builtinThemeOverrides:{peers:{InternalSelectMenu:{height:"calc(var(--n-option-height) * 4.6)"}}},nodeProps:()=>({style:{justifyContent:"center"}}),show:re==="page"?!1:re==="fast-backward"?this.showFastBackwardMenu:this.showFastForwardMenu,onUpdateShow:J=>{re!=="page"&&(J?re==="fast-backward"?this.showFastBackwardMenu=J:this.showFastForwardMenu=J:(this.showFastBackwardMenu=!1,this.showFastForwardMenu=!1))},options:V.type!=="page"&&V.options?V.options:[],onUpdateValue:this.handleMenuSelect,scrollable:!0,showCheckmark:!1},{default:()=>ye})}}),B("div",{class:[`${t}-pagination-item`,!W&&`${t}-pagination-item--button`,{[`${t}-pagination-item--disabled`]:i<1||i>=a||n}],onClick:E},W?W({page:i,pageSize:m,pageCount:a,itemCount:this.mergedItemCount,startIndex:this.startIndex,endIndex:this.endIndex}):B(Kn,{clsPrefix:t},{default:()=>this.rtlEnabled?B(sr,null):B(or,null)})));case"size-picker":return!l&&r?B(J_,Object.assign({consistentMenuWidth:!1,placeholder:"",showCheckmark:!1,to:this.to},this.selectProps,{size:g,options:y,value:m,disabled:n,theme:c.peers.Select,themeOverrides:c.peerOverrides.Select,onUpdateValue:w})):null;case"quick-jumper":return!l&&o?B("div",{class:`${t}-pagination-quick-jumper`},P?P():Jt(this.$slots.goto,()=>[p.goto]),B(Is,{value:v,onUpdateValue:M,size:u,placeholder:"",disabled:n,theme:c.peers.Input,themeOverrides:c.peerOverrides.Input,onChange:R})):null;default:return null}}),O?B("div",{class:`${t}-pagination-suffix`},O({page:i,pageSize:m,pageCount:a,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount})):null)}}),qM=Object.assign(Object.assign({},Ht.props),{onUnstableColumnResize:Function,pagination:{type:[Object,Boolean],default:!1},paginateSinglePage:{type:Boolean,default:!0},minHeight:[Number,String],maxHeight:[Number,String],columns:{type:Array,default:()=>[]},rowClassName:[String,Function],rowProps:Function,rowKey:Function,summary:[Function],data:{type:Array,default:()=>[]},loading:Boolean,bordered:{type:Boolean,default:void 0},bottomBordered:{type:Boolean,default:void 0},striped:Boolean,scrollX:[Number,String],defaultCheckedRowKeys:{type:Array,default:()=>[]},checkedRowKeys:Array,singleLine:{type:Boolean,default:!0},singleColumn:Boolean,size:{type:String,default:"medium"},remote:Boolean,defaultExpandedRowKeys:{type:Array,default:[]},defaultExpandAll:Boolean,expandedRowKeys:Array,stickyExpandedRows:Boolean,virtualScroll:Boolean,virtualScrollX:Boolean,virtualScrollHeader:Boolean,headerHeight:{type:Number,default:28},heightForRow:Function,minRowHeight:{type:Number,default:28},tableLayout:{type:String,default:"auto"},allowCheckingNotLoaded:Boolean,cascade:{type:Boolean,default:!0},childrenKey:{type:String,default:"children"},indent:{type:Number,default:16},flexHeight:Boolean,summaryPlacement:{type:String,default:"bottom"},paginationBehaviorOnFilter:{type:String,default:"current"},filterIconPopoverProps:Object,scrollbarProps:Object,renderCell:Function,renderExpandIcon:Function,spinProps:{type:Object,default:{}},getCsvCell:Function,getCsvHeader:Function,onLoad:Function,"onUpdate:page":[Function,Array],onUpdatePage:[Function,Array],"onUpdate:pageSize":[Function,Array],onUpdatePageSize:[Function,Array],"onUpdate:sorter":[Function,Array],onUpdateSorter:[Function,Array],"onUpdate:filters":[Function,Array],onUpdateFilters:[Function,Array],"onUpdate:checkedRowKeys":[Function,Array],onUpdateCheckedRowKeys:[Function,Array],"onUpdate:expandedRowKeys":[Function,Array],onUpdateExpandedRowKeys:[Function,Array],onScroll:Function,onPageChange:[Function,Array],onPageSizeChange:[Function,Array],onSorterChange:[Function,Array],onFiltersChange:[Function,Array],onCheckedRowKeysChange:[Function,Array]}),Zs=ds("n-data-table"),Z_=40,ey=40;function cv(e){if(e.type==="selection")return e.width===void 0?Z_:so(e.width);if(e.type==="expand")return e.width===void 0?ey:so(e.width);if(!("children"in e))return typeof e.width=="string"?so(e.width):e.width}function YM(e){var t,n;if(e.type==="selection")return ls((t=e.width)!==null&&t!==void 0?t:Z_);if(e.type==="expand")return ls((n=e.width)!==null&&n!==void 0?n:ey);if(!("children"in e))return ls(e.width)}function Gs(e){return e.type==="selection"?"__n_selection__":e.type==="expand"?"__n_expand__":e.key}function dv(e){return e&&(typeof e=="object"?Object.assign({},e):e)}function GM(e){return e==="ascend"?1:e==="descend"?-1:0}function XM(e,t,n){return n!==void 0&&(e=Math.min(e,typeof n=="number"?n:Number.parseFloat(n))),t!==void 0&&(e=Math.max(e,typeof t=="number"?t:Number.parseFloat(t))),e}function JM(e,t){if(t!==void 0)return{width:t,minWidth:t,maxWidth:t};const n=YM(e),{minWidth:s,maxWidth:i}=e;return{width:n,minWidth:ls(s)||n,maxWidth:ls(i)}}function QM(e,t,n){return typeof n=="function"?n(e,t):n||""}function fd(e){return e.filterOptionValues!==void 0||e.filterOptionValue===void 0&&e.defaultFilterOptionValues!==void 0}function pd(e){return"children"in e?!1:!!e.sorter}function ty(e){return"children"in e&&e.children.length?!1:!!e.resizable}function uv(e){return"children"in e?!1:!!e.filter&&(!!e.filterOptions||!!e.renderFilterMenu)}function hv(e){if(e){if(e==="descend")return"ascend"}else return"descend";return!1}function ZM(e,t){return e.sorter===void 0?null:t===null||t.columnKey!==e.key?{columnKey:e.key,sorter:e.sorter,order:hv(!1)}:Object.assign(Object.assign({},t),{order:hv(t.order)})}function ny(e,t){return t.find(n=>n.columnKey===e.key&&n.order)!==void 0}function e3(e){return typeof e=="string"?e.replace(/,/g,"\\,"):e==null?"":`${e}`.replace(/,/g,"\\,")}function t3(e,t,n,s){const i=e.filter(r=>r.type!=="expand"&&r.type!=="selection"&&r.allowExport!==!1),a=i.map(r=>s?s(r):r.title).join(","),d=t.map(r=>i.map(o=>n?n(r[o.key],r,o):e3(r[o.key])).join(","));return[a,...d].join(` -`)}const n3=Ae({name:"DataTableBodyCheckbox",props:{rowKey:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!0},onUpdateChecked:{type:Function,required:!0}},setup(e){const{mergedCheckedRowKeySetRef:t,mergedInderminateRowKeySetRef:n}=Ut(Zs);return()=>{const{rowKey:s}=e;return B(gh,{privateInsideTable:!0,disabled:e.disabled,indeterminate:n.value.has(s),checked:t.value.has(s),onUpdateChecked:e.onUpdateChecked})}}}),s3=Ce("radio",` - line-height: var(--n-label-line-height); - outline: none; - position: relative; - user-select: none; - -webkit-user-select: none; - display: inline-flex; - align-items: flex-start; - flex-wrap: nowrap; - font-size: var(--n-font-size); - word-break: break-word; -`,[Ve("checked",[Ge("dot",` - background-color: var(--n-color-active); - `)]),Ge("dot-wrapper",` - position: relative; - flex-shrink: 0; - flex-grow: 0; - width: var(--n-radio-size); - `),Ce("radio-input",` - position: absolute; - border: 0; - border-radius: inherit; - left: 0; - right: 0; - top: 0; - bottom: 0; - opacity: 0; - z-index: 1; - cursor: pointer; - `),Ge("dot",` - position: absolute; - top: 50%; - left: 0; - transform: translateY(-50%); - height: var(--n-radio-size); - width: var(--n-radio-size); - background: var(--n-color); - box-shadow: var(--n-box-shadow); - border-radius: 50%; - transition: - background-color .3s var(--n-bezier), - box-shadow .3s var(--n-bezier); - `,[ze("&::before",` - content: ""; - opacity: 0; - position: absolute; - left: 4px; - top: 4px; - height: calc(100% - 8px); - width: calc(100% - 8px); - border-radius: 50%; - transform: scale(.8); - background: var(--n-dot-color-active); - transition: - opacity .3s var(--n-bezier), - background-color .3s var(--n-bezier), - transform .3s var(--n-bezier); - `),Ve("checked",{boxShadow:"var(--n-box-shadow-active)"},[ze("&::before",` - opacity: 1; - transform: scale(1); - `)])]),Ge("label",` - color: var(--n-text-color); - padding: var(--n-label-padding); - font-weight: var(--n-label-font-weight); - display: inline-block; - transition: color .3s var(--n-bezier); - `),Cn("disabled",` - cursor: pointer; - `,[ze("&:hover",[Ge("dot",{boxShadow:"var(--n-box-shadow-hover)"})]),Ve("focus",[ze("&:not(:active)",[Ge("dot",{boxShadow:"var(--n-box-shadow-focus)"})])])]),Ve("disabled",` - cursor: not-allowed; - `,[Ge("dot",{boxShadow:"var(--n-box-shadow-disabled)",backgroundColor:"var(--n-color-disabled)"},[ze("&::before",{backgroundColor:"var(--n-dot-color-disabled)"}),Ve("checked",` - opacity: 1; - `)]),Ge("label",{color:"var(--n-text-color-disabled)"}),Ce("radio-input",` - cursor: not-allowed; - `)])]),i3={name:String,value:{type:[String,Number,Boolean],default:"on"},checked:{type:Boolean,default:void 0},defaultChecked:Boolean,disabled:{type:Boolean,default:void 0},label:String,size:String,onUpdateChecked:[Function,Array],"onUpdate:checked":[Function,Array],checkedValue:{type:Boolean,default:void 0}},sy=ds("n-radio-group");function r3(e){const t=Ut(sy,null),n=ar(e,{mergedSize(f){const{size:_}=e;if(_!==void 0)return _;if(t){const{mergedSizeRef:{value:S}}=t;if(S!==void 0)return S}return f?f.mergedSize.value:"medium"},mergedDisabled(f){return!!(e.disabled||t!=null&&t.disabledRef.value||f!=null&&f.disabled.value)}}),{mergedSizeRef:s,mergedDisabledRef:i}=n,a=H(null),d=H(null),r=H(e.defaultChecked),o=ct(e,"checked"),c=ss(o,r),p=Zt(()=>t?t.valueRef.value===e.value:c.value),u=Zt(()=>{const{name:f}=e;if(f!==void 0)return f;if(t)return t.nameRef.value}),g=H(!1);function m(){if(t){const{doUpdateValue:f}=t,{value:_}=e;Je(f,_)}else{const{onUpdateChecked:f,"onUpdate:checked":_}=e,{nTriggerFormInput:S,nTriggerFormChange:k}=n;f&&Je(f,!0),_&&Je(_,!0),S(),k(),r.value=!0}}function y(){i.value||p.value||m()}function v(){y(),a.value&&(a.value.checked=p.value)}function l(){g.value=!1}function h(){g.value=!0}return{mergedClsPrefix:t?t.mergedClsPrefixRef:mn(e).mergedClsPrefixRef,inputRef:a,labelRef:d,mergedName:u,mergedDisabled:i,renderSafeChecked:p,focus:g,mergedSize:s,handleRadioInputChange:v,handleRadioInputBlur:l,handleRadioInputFocus:h}}const o3=Object.assign(Object.assign({},Ht.props),i3),iy=Ae({name:"Radio",props:o3,setup(e){const t=r3(e),n=Ht("Radio","-radio",s3,_g,e,t.mergedClsPrefix),s=q(()=>{const{mergedSize:{value:c}}=t,{common:{cubicBezierEaseInOut:p},self:{boxShadow:u,boxShadowActive:g,boxShadowDisabled:m,boxShadowFocus:y,boxShadowHover:v,color:l,colorDisabled:h,colorActive:f,textColor:_,textColorDisabled:S,dotColorActive:k,dotColorDisabled:P,labelPadding:M,labelLineHeight:w,labelFontWeight:T,[Mt("fontSize",c)]:A,[Mt("radioSize",c)]:E}}=n.value;return{"--n-bezier":p,"--n-label-line-height":w,"--n-label-font-weight":T,"--n-box-shadow":u,"--n-box-shadow-active":g,"--n-box-shadow-disabled":m,"--n-box-shadow-focus":y,"--n-box-shadow-hover":v,"--n-color":l,"--n-color-active":f,"--n-color-disabled":h,"--n-dot-color-active":k,"--n-dot-color-disabled":P,"--n-font-size":A,"--n-radio-size":E,"--n-text-color":_,"--n-text-color-disabled":S,"--n-label-padding":M}}),{inlineThemeDisabled:i,mergedClsPrefixRef:a,mergedRtlRef:d}=mn(e),r=pi("Radio",d,a),o=i?Un("radio",q(()=>t.mergedSize.value[0]),s,e):void 0;return Object.assign(t,{rtlEnabled:r,cssVars:i?void 0:s,themeClass:o==null?void 0:o.themeClass,onRender:o==null?void 0:o.onRender})},render(){const{$slots:e,mergedClsPrefix:t,onRender:n,label:s}=this;return n==null||n(),B("label",{class:[`${t}-radio`,this.themeClass,this.rtlEnabled&&`${t}-radio--rtl`,this.mergedDisabled&&`${t}-radio--disabled`,this.renderSafeChecked&&`${t}-radio--checked`,this.focus&&`${t}-radio--focus`],style:this.cssVars},B("input",{ref:"inputRef",type:"radio",class:`${t}-radio-input`,value:this.value,name:this.mergedName,checked:this.renderSafeChecked,disabled:this.mergedDisabled,onChange:this.handleRadioInputChange,onFocus:this.handleRadioInputFocus,onBlur:this.handleRadioInputBlur}),B("div",{class:`${t}-radio__dot-wrapper`}," ",B("div",{class:[`${t}-radio__dot`,this.renderSafeChecked&&`${t}-radio__dot--checked`]})),Us(e.default,i=>!i&&!s?null:B("div",{ref:"labelRef",class:`${t}-radio__label`},i||s)))}}),a3=Ce("radio-group",` - display: inline-block; - font-size: var(--n-font-size); -`,[Ge("splitor",` - display: inline-block; - vertical-align: bottom; - width: 1px; - transition: - background-color .3s var(--n-bezier), - opacity .3s var(--n-bezier); - background: var(--n-button-border-color); - `,[Ve("checked",{backgroundColor:"var(--n-button-border-color-active)"}),Ve("disabled",{opacity:"var(--n-opacity-disabled)"})]),Ve("button-group",` - white-space: nowrap; - height: var(--n-height); - line-height: var(--n-height); - `,[Ce("radio-button",{height:"var(--n-height)",lineHeight:"var(--n-height)"}),Ge("splitor",{height:"var(--n-height)"})]),Ce("radio-button",` - vertical-align: bottom; - outline: none; - position: relative; - user-select: none; - -webkit-user-select: none; - display: inline-block; - box-sizing: border-box; - padding-left: 14px; - padding-right: 14px; - white-space: nowrap; - transition: - background-color .3s var(--n-bezier), - opacity .3s var(--n-bezier), - border-color .3s var(--n-bezier), - color .3s var(--n-bezier); - background: var(--n-button-color); - color: var(--n-button-text-color); - border-top: 1px solid var(--n-button-border-color); - border-bottom: 1px solid var(--n-button-border-color); - `,[Ce("radio-input",` - pointer-events: none; - position: absolute; - border: 0; - border-radius: inherit; - left: 0; - right: 0; - top: 0; - bottom: 0; - opacity: 0; - z-index: 1; - `),Ge("state-border",` - z-index: 1; - pointer-events: none; - position: absolute; - box-shadow: var(--n-button-box-shadow); - transition: box-shadow .3s var(--n-bezier); - left: -1px; - bottom: -1px; - right: -1px; - top: -1px; - `),ze("&:first-child",` - border-top-left-radius: var(--n-button-border-radius); - border-bottom-left-radius: var(--n-button-border-radius); - border-left: 1px solid var(--n-button-border-color); - `,[Ge("state-border",` - border-top-left-radius: var(--n-button-border-radius); - border-bottom-left-radius: var(--n-button-border-radius); - `)]),ze("&:last-child",` - border-top-right-radius: var(--n-button-border-radius); - border-bottom-right-radius: var(--n-button-border-radius); - border-right: 1px solid var(--n-button-border-color); - `,[Ge("state-border",` - border-top-right-radius: var(--n-button-border-radius); - border-bottom-right-radius: var(--n-button-border-radius); - `)]),Cn("disabled",` - cursor: pointer; - `,[ze("&:hover",[Ge("state-border",` - transition: box-shadow .3s var(--n-bezier); - box-shadow: var(--n-button-box-shadow-hover); - `),Cn("checked",{color:"var(--n-button-text-color-hover)"})]),Ve("focus",[ze("&:not(:active)",[Ge("state-border",{boxShadow:"var(--n-button-box-shadow-focus)"})])])]),Ve("checked",` - background: var(--n-button-color-active); - color: var(--n-button-text-color-active); - border-color: var(--n-button-border-color-active); - `),Ve("disabled",` - cursor: not-allowed; - opacity: var(--n-opacity-disabled); - `)])]);function l3(e,t,n){var s;const i=[];let a=!1;for(let d=0;d{const{value:k}=n,{common:{cubicBezierEaseInOut:P},self:{buttonBorderColor:M,buttonBorderColorActive:w,buttonBorderRadius:T,buttonBoxShadow:A,buttonBoxShadowFocus:E,buttonBoxShadowHover:R,buttonColor:D,buttonColorActive:I,buttonTextColor:O,buttonTextColorActive:U,buttonTextColorHover:W,opacityDisabled:N,[Mt("buttonHeight",k)]:z,[Mt("fontSize",k)]:V}}=u.value;return{"--n-font-size":V,"--n-bezier":P,"--n-button-border-color":M,"--n-button-border-color-active":w,"--n-button-border-radius":T,"--n-button-box-shadow":A,"--n-button-box-shadow-focus":E,"--n-button-box-shadow-hover":R,"--n-button-color":D,"--n-button-color-active":I,"--n-button-text-color":O,"--n-button-text-color-hover":W,"--n-button-text-color-active":U,"--n-height":z,"--n-opacity-disabled":N}}),S=c?Un("radio-group",q(()=>n.value[0]),_,e):void 0;return{selfElRef:t,rtlEnabled:f,mergedClsPrefix:o,mergedValue:y,handleFocusout:h,handleFocusin:l,cssVars:c?void 0:_,themeClass:S==null?void 0:S.themeClass,onRender:S==null?void 0:S.onRender}},render(){var e;const{mergedValue:t,mergedClsPrefix:n,handleFocusin:s,handleFocusout:i}=this,{children:a,isButtonGroup:d}=l3(Rg(O0(this)),t,n);return(e=this.onRender)===null||e===void 0||e.call(this),B("div",{onFocusin:s,onFocusout:i,ref:"selfElRef",class:[`${n}-radio-group`,this.rtlEnabled&&`${n}-radio-group--rtl`,this.themeClass,d&&`${n}-radio-group--button-group`],style:this.cssVars},a)}}),u3=Ae({name:"DataTableBodyRadio",props:{rowKey:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!0},onUpdateChecked:{type:Function,required:!0}},setup(e){const{mergedCheckedRowKeySetRef:t,componentId:n}=Ut(Zs);return()=>{const{rowKey:s}=e;return B(iy,{name:n,disabled:e.disabled,checked:t.value.has(s),onUpdateChecked:e.onUpdateChecked})}}}),h3=Object.assign(Object.assign({},Ir),Ht.props),f3=Ae({name:"Tooltip",props:h3,__popover__:!0,setup(e){const{mergedClsPrefixRef:t}=mn(e),n=Ht("Tooltip","-tooltip",void 0,n0,e,t),s=H(null);return Object.assign(Object.assign({},{syncPosition(){s.value.syncPosition()},setShow(a){s.value.setShow(a)}}),{popoverRef:s,mergedTheme:n,popoverThemeOverrides:q(()=>n.value.self)})},render(){const{mergedTheme:e,internalExtraClass:t}=this;return B(Lo,Object.assign(Object.assign({},this.$props),{theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:this.popoverThemeOverrides,internalExtraClass:t.concat("tooltip"),ref:"popoverRef"}),this.$slots)}}),ry=Ce("ellipsis",{overflow:"hidden"},[Cn("line-clamp",` - white-space: nowrap; - display: inline-block; - vertical-align: bottom; - max-width: 100%; - `),Ve("line-clamp",` - display: -webkit-inline-box; - -webkit-box-orient: vertical; - `),Ve("cursor-pointer",` - cursor: pointer; - `)]);function vu(e){return`${e}-ellipsis--line-clamp`}function gu(e,t){return`${e}-ellipsis--cursor-${t}`}const oy=Object.assign(Object.assign({},Ht.props),{expandTrigger:String,lineClamp:[Number,String],tooltip:{type:[Boolean,Object],default:!0}}),_h=Ae({name:"Ellipsis",inheritAttrs:!1,props:oy,setup(e,{slots:t,attrs:n}){const s=yg(),i=Ht("Ellipsis","-ellipsis",ry,s0,e,s),a=H(null),d=H(null),r=H(null),o=H(!1),c=q(()=>{const{lineClamp:l}=e,{value:h}=o;return l!==void 0?{textOverflow:"","-webkit-line-clamp":h?"":l}:{textOverflow:h?"":"ellipsis","-webkit-line-clamp":""}});function p(){let l=!1;const{value:h}=o;if(h)return!0;const{value:f}=a;if(f){const{lineClamp:_}=e;if(m(f),_!==void 0)l=f.scrollHeight<=f.offsetHeight;else{const{value:S}=d;S&&(l=S.getBoundingClientRect().width<=f.getBoundingClientRect().width)}y(f,l)}return l}const u=q(()=>e.expandTrigger==="click"?()=>{var l;const{value:h}=o;h&&((l=r.value)===null||l===void 0||l.setShow(!1)),o.value=!h}:void 0);og(()=>{var l;e.tooltip&&((l=r.value)===null||l===void 0||l.setShow(!1))});const g=()=>B("span",Object.assign({},nr(n,{class:[`${s.value}-ellipsis`,e.lineClamp!==void 0?vu(s.value):void 0,e.expandTrigger==="click"?gu(s.value,"pointer"):void 0],style:c.value}),{ref:"triggerRef",onClick:u.value,onMouseenter:e.expandTrigger==="click"?p:void 0}),e.lineClamp?t:B("span",{ref:"triggerInnerRef"},t));function m(l){if(!l)return;const h=c.value,f=vu(s.value);e.lineClamp!==void 0?v(l,f,"add"):v(l,f,"remove");for(const _ in h)l.style[_]!==h[_]&&(l.style[_]=h[_])}function y(l,h){const f=gu(s.value,"pointer");e.expandTrigger==="click"&&!h?v(l,f,"add"):v(l,f,"remove")}function v(l,h,f){f==="add"?l.classList.contains(h)||l.classList.add(h):l.classList.contains(h)&&l.classList.remove(h)}return{mergedTheme:i,triggerRef:a,triggerInnerRef:d,tooltipRef:r,handleClick:u,renderTrigger:g,getTooltipDisabled:p}},render(){var e;const{tooltip:t,renderTrigger:n,$slots:s}=this;if(t){const{mergedTheme:i}=this;return B(f3,Object.assign({ref:"tooltipRef",placement:"top"},t,{getDisabled:this.getTooltipDisabled,theme:i.peers.Tooltip,themeOverrides:i.peerOverrides.Tooltip}),{trigger:n,default:(e=s.tooltip)!==null&&e!==void 0?e:s.default})}else return n()}}),p3=Ae({name:"PerformantEllipsis",props:oy,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){const s=H(!1),i=yg();return i0("-ellipsis",ry,i),{mouseEntered:s,renderTrigger:()=>{const{lineClamp:d}=e,r=i.value;return B("span",Object.assign({},nr(t,{class:[`${r}-ellipsis`,d!==void 0?vu(r):void 0,e.expandTrigger==="click"?gu(r,"pointer"):void 0],style:d===void 0?{textOverflow:"ellipsis"}:{"-webkit-line-clamp":d}}),{onMouseenter:()=>{s.value=!0}}),d?n:B("span",null,n))}}},render(){return this.mouseEntered?B(_h,nr({},this.$attrs,this.$props),this.$slots):this.renderTrigger()}}),v3=Ae({name:"DataTableCell",props:{clsPrefix:{type:String,required:!0},row:{type:Object,required:!0},index:{type:Number,required:!0},column:{type:Object,required:!0},isSummary:Boolean,mergedTheme:{type:Object,required:!0},renderCell:Function},render(){var e;const{isSummary:t,column:n,row:s,renderCell:i}=this;let a;const{render:d,key:r,ellipsis:o}=n;if(d&&!t?a=d(s,this.index):t?a=(e=s[r])===null||e===void 0?void 0:e.value:a=i?i(Od(s,r),s,n):Od(s,r),o)if(typeof o=="object"){const{mergedTheme:c}=this;return n.ellipsisComponent==="performant-ellipsis"?B(p3,Object.assign({},o,{theme:c.peers.Ellipsis,themeOverrides:c.peerOverrides.Ellipsis}),{default:()=>a}):B(_h,Object.assign({},o,{theme:c.peers.Ellipsis,themeOverrides:c.peerOverrides.Ellipsis}),{default:()=>a})}else return B("span",{class:`${this.clsPrefix}-data-table-td__ellipsis`},a);return a}}),fv=Ae({name:"DataTableExpandTrigger",props:{clsPrefix:{type:String,required:!0},expanded:Boolean,loading:Boolean,onClick:{type:Function,required:!0},renderExpandIcon:{type:Function},rowData:{type:Object,required:!0}},render(){const{clsPrefix:e}=this;return B("div",{class:[`${e}-data-table-expand-trigger`,this.expanded&&`${e}-data-table-expand-trigger--expanded`],onClick:this.onClick,onMousedown:t=>{t.preventDefault()}},B(vg,null,{default:()=>this.loading?B(tc,{key:"loading",clsPrefix:this.clsPrefix,radius:85,strokeWidth:15,scale:.88}):this.renderExpandIcon?this.renderExpandIcon({expanded:this.expanded,rowData:this.rowData}):B(Kn,{clsPrefix:e,key:"base-icon"},{default:()=>B(C_,null)})}))}}),g3=Ae({name:"DataTableFilterMenu",props:{column:{type:Object,required:!0},radioGroupName:{type:String,required:!0},multiple:{type:Boolean,required:!0},value:{type:[Array,String,Number],default:null},options:{type:Array,required:!0},onConfirm:{type:Function,required:!0},onClear:{type:Function,required:!0},onChange:{type:Function,required:!0}},setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=mn(e),s=pi("DataTable",n,t),{mergedClsPrefixRef:i,mergedThemeRef:a,localeRef:d}=Ut(Zs),r=H(e.value),o=q(()=>{const{value:y}=r;return Array.isArray(y)?y:null}),c=q(()=>{const{value:y}=r;return fd(e.column)?Array.isArray(y)&&y.length&&y[0]||null:Array.isArray(y)?null:y});function p(y){e.onChange(y)}function u(y){e.multiple&&Array.isArray(y)?r.value=y:fd(e.column)&&!Array.isArray(y)?r.value=[y]:r.value=y}function g(){p(r.value),e.onConfirm()}function m(){e.multiple||fd(e.column)?p([]):p(null),e.onClear()}return{mergedClsPrefix:i,rtlEnabled:s,mergedTheme:a,locale:d,checkboxGroupValue:o,radioGroupValue:c,handleChange:u,handleConfirmClick:g,handleClearClick:m}},render(){const{mergedTheme:e,locale:t,mergedClsPrefix:n}=this;return B("div",{class:[`${n}-data-table-filter-menu`,this.rtlEnabled&&`${n}-data-table-filter-menu--rtl`]},B(As,null,{default:()=>{const{checkboxGroupValue:s,handleChange:i}=this;return this.multiple?B(MM,{value:s,class:`${n}-data-table-filter-menu__group`,onUpdateValue:i},{default:()=>this.options.map(a=>B(gh,{key:a.value,theme:e.peers.Checkbox,themeOverrides:e.peerOverrides.Checkbox,value:a.value},{default:()=>a.label}))}):B(d3,{name:this.radioGroupName,class:`${n}-data-table-filter-menu__group`,value:this.radioGroupValue,onUpdateValue:this.handleChange},{default:()=>this.options.map(a=>B(iy,{key:a.value,value:a.value,theme:e.peers.Radio,themeOverrides:e.peerOverrides.Radio},{default:()=>a.label}))})}}),B("div",{class:`${n}-data-table-filter-menu__action`},B(gn,{size:"tiny",theme:e.peers.Button,themeOverrides:e.peerOverrides.Button,onClick:this.handleClearClick},{default:()=>t.clear}),B(gn,{theme:e.peers.Button,themeOverrides:e.peerOverrides.Button,type:"primary",size:"tiny",onClick:this.handleConfirmClick},{default:()=>t.confirm})))}}),m3=Ae({name:"DataTableRenderFilter",props:{render:{type:Function,required:!0},active:{type:Boolean,default:!1},show:{type:Boolean,default:!1}},render(){const{render:e,active:t,show:n}=this;return e({active:t,show:n})}});function _3(e,t,n){const s=Object.assign({},e);return s[t]=n,s}const y3=Ae({name:"DataTableFilterButton",props:{column:{type:Object,required:!0},options:{type:Array,default:()=>[]}},setup(e){const{mergedComponentPropsRef:t}=mn(),{mergedThemeRef:n,mergedClsPrefixRef:s,mergedFilterStateRef:i,filterMenuCssVarsRef:a,paginationBehaviorOnFilterRef:d,doUpdatePage:r,doUpdateFilters:o,filterIconPopoverPropsRef:c}=Ut(Zs),p=H(!1),u=i,g=q(()=>e.column.filterMultiple!==!1),m=q(()=>{const _=u.value[e.column.key];if(_===void 0){const{value:S}=g;return S?[]:null}return _}),y=q(()=>{const{value:_}=m;return Array.isArray(_)?_.length>0:_!==null}),v=q(()=>{var _,S;return((S=(_=t==null?void 0:t.value)===null||_===void 0?void 0:_.DataTable)===null||S===void 0?void 0:S.renderFilter)||e.column.renderFilter});function l(_){const S=_3(u.value,e.column.key,_);o(S,e.column),d.value==="first"&&r(1)}function h(){p.value=!1}function f(){p.value=!1}return{mergedTheme:n,mergedClsPrefix:s,active:y,showPopover:p,mergedRenderFilter:v,filterIconPopoverProps:c,filterMultiple:g,mergedFilterValue:m,filterMenuCssVars:a,handleFilterChange:l,handleFilterMenuConfirm:f,handleFilterMenuCancel:h}},render(){const{mergedTheme:e,mergedClsPrefix:t,handleFilterMenuCancel:n,filterIconPopoverProps:s}=this;return B(Lo,Object.assign({show:this.showPopover,onUpdateShow:i=>this.showPopover=i,trigger:"click",theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,placement:"bottom"},s,{style:{padding:0}}),{trigger:()=>{const{mergedRenderFilter:i}=this;if(i)return B(m3,{"data-data-table-filter":!0,render:i,active:this.active,show:this.showPopover});const{renderFilterIcon:a}=this.column;return B("div",{"data-data-table-filter":!0,class:[`${t}-data-table-filter`,{[`${t}-data-table-filter--active`]:this.active,[`${t}-data-table-filter--show`]:this.showPopover}]},a?a({active:this.active,show:this.showPopover}):B(Kn,{clsPrefix:t},{default:()=>B(rL,null)}))},default:()=>{const{renderFilterMenu:i}=this.column;return i?i({hide:n}):B(g3,{style:this.filterMenuCssVars,radioGroupName:String(this.column.key),multiple:this.filterMultiple,value:this.mergedFilterValue,options:this.options,column:this.column,onChange:this.handleFilterChange,onClear:this.handleFilterMenuCancel,onConfirm:this.handleFilterMenuConfirm})}})}}),b3=Ae({name:"ColumnResizeButton",props:{onResizeStart:Function,onResize:Function,onResizeEnd:Function},setup(e){const{mergedClsPrefixRef:t}=Ut(Zs),n=H(!1);let s=0;function i(o){return o.clientX}function a(o){var c;o.preventDefault();const p=n.value;s=i(o),n.value=!0,p||(Wn("mousemove",window,d),Wn("mouseup",window,r),(c=e.onResizeStart)===null||c===void 0||c.call(e))}function d(o){var c;(c=e.onResize)===null||c===void 0||c.call(e,i(o)-s)}function r(){var o;n.value=!1,(o=e.onResizeEnd)===null||o===void 0||o.call(e),zn("mousemove",window,d),zn("mouseup",window,r)}return Vt(()=>{zn("mousemove",window,d),zn("mouseup",window,r)}),{mergedClsPrefix:t,active:n,handleMousedown:a}},render(){const{mergedClsPrefix:e}=this;return B("span",{"data-data-table-resizable":!0,class:[`${e}-data-table-resize-button`,this.active&&`${e}-data-table-resize-button--active`],onMousedown:this.handleMousedown})}}),w3=Ae({name:"DataTableRenderSorter",props:{render:{type:Function,required:!0},order:{type:[String,Boolean],default:!1}},render(){const{render:e,order:t}=this;return e({order:t})}}),S3=Ae({name:"SortIcon",props:{column:{type:Object,required:!0}},setup(e){const{mergedComponentPropsRef:t}=mn(),{mergedSortStateRef:n,mergedClsPrefixRef:s}=Ut(Zs),i=q(()=>n.value.find(o=>o.columnKey===e.column.key)),a=q(()=>i.value!==void 0),d=q(()=>{const{value:o}=i;return o&&a.value?o.order:!1}),r=q(()=>{var o,c;return((c=(o=t==null?void 0:t.value)===null||o===void 0?void 0:o.DataTable)===null||c===void 0?void 0:c.renderSorter)||e.column.renderSorter});return{mergedClsPrefix:s,active:a,mergedSortOrder:d,mergedRenderSorter:r}},render(){const{mergedRenderSorter:e,mergedSortOrder:t,mergedClsPrefix:n}=this,{renderSorterIcon:s}=this.column;return e?B(w3,{render:e,order:t}):B("span",{class:[`${n}-data-table-sorter`,t==="ascend"&&`${n}-data-table-sorter--asc`,t==="descend"&&`${n}-data-table-sorter--desc`]},s?s({order:t}):B(Kn,{clsPrefix:n},{default:()=>B(nL,null)}))}}),yh=ds("n-dropdown-menu"),vc=ds("n-dropdown"),pv=ds("n-dropdown-option"),ay=Ae({name:"DropdownDivider",props:{clsPrefix:{type:String,required:!0}},render(){return B("div",{class:`${this.clsPrefix}-dropdown-divider`})}}),C3=Ae({name:"DropdownGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{showIconRef:e,hasSubmenuRef:t}=Ut(yh),{renderLabelRef:n,labelFieldRef:s,nodePropsRef:i,renderOptionRef:a}=Ut(vc);return{labelField:s,showIcon:e,hasSubmenu:t,renderLabel:n,nodeProps:i,renderOption:a}},render(){var e;const{clsPrefix:t,hasSubmenu:n,showIcon:s,nodeProps:i,renderLabel:a,renderOption:d}=this,{rawNode:r}=this.tmNode,o=B("div",Object.assign({class:`${t}-dropdown-option`},i==null?void 0:i(r)),B("div",{class:`${t}-dropdown-option-body ${t}-dropdown-option-body--group`},B("div",{"data-dropdown-option":!0,class:[`${t}-dropdown-option-body__prefix`,s&&`${t}-dropdown-option-body__prefix--show-icon`]},ui(r.icon)),B("div",{class:`${t}-dropdown-option-body__label`,"data-dropdown-option":!0},a?a(r):ui((e=r.title)!==null&&e!==void 0?e:r[this.labelField])),B("div",{class:[`${t}-dropdown-option-body__suffix`,n&&`${t}-dropdown-option-body__suffix--has-submenu`],"data-dropdown-option":!0})));return d?d({node:o,option:r}):o}}),k3=Ce("icon",` - height: 1em; - width: 1em; - line-height: 1em; - text-align: center; - display: inline-block; - position: relative; - fill: currentColor; - transform: translateZ(0); -`,[Ve("color-transition",{transition:"color .3s var(--n-bezier)"}),Ve("depth",{color:"var(--n-color)"},[ze("svg",{opacity:"var(--n-opacity)",transition:"opacity .3s var(--n-bezier)"})]),ze("svg",{height:"1em",width:"1em"})]),x3=Object.assign(Object.assign({},Ht.props),{depth:[String,Number],size:[Number,String],color:String,component:[Object,Function]}),R3=Ae({_n_icon__:!0,name:"Icon",inheritAttrs:!1,props:x3,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n}=mn(e),s=Ht("Icon","-icon",k3,r0,e,t),i=q(()=>{const{depth:d}=e,{common:{cubicBezierEaseInOut:r},self:o}=s.value;if(d!==void 0){const{color:c,[`opacity${d}Depth`]:p}=o;return{"--n-bezier":r,"--n-color":c,"--n-opacity":p}}return{"--n-bezier":r,"--n-color":"","--n-opacity":""}}),a=n?Un("icon",q(()=>`${e.depth||"d"}`),i,e):void 0;return{mergedClsPrefix:t,mergedStyle:q(()=>{const{size:d,color:r}=e;return{fontSize:ls(d),color:r}}),cssVars:n?void 0:i,themeClass:a==null?void 0:a.themeClass,onRender:a==null?void 0:a.onRender}},render(){var e;const{$parent:t,depth:n,mergedClsPrefix:s,component:i,onRender:a,themeClass:d}=this;return!((e=t==null?void 0:t.$options)===null||e===void 0)&&e._n_icon__&&Mr("icon","don't wrap `n-icon` inside `n-icon`"),a==null||a(),B("i",nr(this.$attrs,{role:"img",class:[`${s}-icon`,d,{[`${s}-icon--depth`]:n,[`${s}-icon--color-transition`]:n!==void 0}],style:[this.cssVars,this.mergedStyle]}),i?B(i):this.$slots)}});function mu(e,t){return e.type==="submenu"||e.type===void 0&&e[t]!==void 0}function T3(e){return e.type==="group"}function ly(e){return e.type==="divider"}function P3(e){return e.type==="render"}const cy=Ae({name:"DropdownOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null},placement:{type:String,default:"right-start"},props:Object,scrollable:Boolean},setup(e){const t=Ut(vc),{hoverKeyRef:n,keyboardKeyRef:s,lastToggledSubmenuKeyRef:i,pendingKeyPathRef:a,activeKeyPathRef:d,animatedRef:r,mergedShowRef:o,renderLabelRef:c,renderIconRef:p,labelFieldRef:u,childrenFieldRef:g,renderOptionRef:m,nodePropsRef:y,menuPropsRef:v}=t,l=Ut(pv,null),h=Ut(yh),f=Ut(hc),_=q(()=>e.tmNode.rawNode),S=q(()=>{const{value:W}=g;return mu(e.tmNode.rawNode,W)}),k=q(()=>{const{disabled:W}=e.tmNode;return W}),P=q(()=>{if(!S.value)return!1;const{key:W,disabled:N}=e.tmNode;if(N)return!1;const{value:z}=n,{value:V}=s,{value:j}=i,{value:G}=a;return z!==null?G.includes(W):V!==null?G.includes(W)&&G[G.length-1]!==W:j!==null?G.includes(W):!1}),M=q(()=>s.value===null&&!r.value),w=yP(P,300,M),T=q(()=>!!(l!=null&&l.enteringSubmenuRef.value)),A=H(!1);kn(pv,{enteringSubmenuRef:A});function E(){A.value=!0}function R(){A.value=!1}function D(){const{parentKey:W,tmNode:N}=e;N.disabled||o.value&&(i.value=W,s.value=null,n.value=N.key)}function I(){const{tmNode:W}=e;W.disabled||o.value&&n.value!==W.key&&D()}function O(W){if(e.tmNode.disabled||!o.value)return;const{relatedTarget:N}=W;N&&!Rs({target:N},"dropdownOption")&&!Rs({target:N},"scrollbarRail")&&(n.value=null)}function U(){const{value:W}=S,{tmNode:N}=e;o.value&&!W&&!N.disabled&&(t.doSelect(N.key,N.rawNode),t.doUpdateShow(!1))}return{labelField:u,renderLabel:c,renderIcon:p,siblingHasIcon:h.showIconRef,siblingHasSubmenu:h.hasSubmenuRef,menuProps:v,popoverBody:f,animated:r,mergedShowSubmenu:q(()=>w.value&&!T.value),rawNode:_,hasSubmenu:S,pending:Zt(()=>{const{value:W}=a,{key:N}=e.tmNode;return W.includes(N)}),childActive:Zt(()=>{const{value:W}=d,{key:N}=e.tmNode,z=W.findIndex(V=>N===V);return z===-1?!1:z{const{value:W}=d,{key:N}=e.tmNode,z=W.findIndex(V=>N===V);return z===-1?!1:z===W.length-1}),mergedDisabled:k,renderOption:m,nodeProps:y,handleClick:U,handleMouseMove:I,handleMouseEnter:D,handleMouseLeave:O,handleSubmenuBeforeEnter:E,handleSubmenuAfterEnter:R}},render(){var e,t;const{animated:n,rawNode:s,mergedShowSubmenu:i,clsPrefix:a,siblingHasIcon:d,siblingHasSubmenu:r,renderLabel:o,renderIcon:c,renderOption:p,nodeProps:u,props:g,scrollable:m}=this;let y=null;if(i){const f=(e=this.menuProps)===null||e===void 0?void 0:e.call(this,s,s.children);y=B(dy,Object.assign({},f,{clsPrefix:a,scrollable:this.scrollable,tmNodes:this.tmNode.children,parentKey:this.tmNode.key}))}const v={class:[`${a}-dropdown-option-body`,this.pending&&`${a}-dropdown-option-body--pending`,this.active&&`${a}-dropdown-option-body--active`,this.childActive&&`${a}-dropdown-option-body--child-active`,this.mergedDisabled&&`${a}-dropdown-option-body--disabled`],onMousemove:this.handleMouseMove,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onClick:this.handleClick},l=u==null?void 0:u(s),h=B("div",Object.assign({class:[`${a}-dropdown-option`,l==null?void 0:l.class],"data-dropdown-option":!0},l),B("div",nr(v,g),[B("div",{class:[`${a}-dropdown-option-body__prefix`,d&&`${a}-dropdown-option-body__prefix--show-icon`]},[c?c(s):ui(s.icon)]),B("div",{"data-dropdown-option":!0,class:`${a}-dropdown-option-body__label`},o?o(s):ui((t=s[this.labelField])!==null&&t!==void 0?t:s.title)),B("div",{"data-dropdown-option":!0,class:[`${a}-dropdown-option-body__suffix`,r&&`${a}-dropdown-option-body__suffix--has-submenu`]},this.hasSubmenu?B(R3,null,{default:()=>B(C_,null)}):null)]),this.hasSubmenu?B(Ro,null,{default:()=>[B(To,null,{default:()=>B("div",{class:`${a}-dropdown-offset-container`},B(Po,{show:this.mergedShowSubmenu,placement:this.placement,to:m&&this.popoverBody||void 0,teleportDisabled:!m},{default:()=>B("div",{class:`${a}-dropdown-menu-wrapper`},n?B(ks,{onBeforeEnter:this.handleSubmenuBeforeEnter,onAfterEnter:this.handleSubmenuAfterEnter,name:"fade-in-scale-up-transition",appear:!0},{default:()=>y}):y)}))})]}):null);return p?p({node:h,option:s}):h}}),E3=Ae({name:"NDropdownGroup",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null}},render(){const{tmNode:e,parentKey:t,clsPrefix:n}=this,{children:s}=e;return B(Ie,null,B(C3,{clsPrefix:n,tmNode:e,key:e.key}),s==null?void 0:s.map(i=>{const{rawNode:a}=i;return a.show===!1?null:ly(a)?B(ay,{clsPrefix:n,key:i.key}):i.isGroup?(Mr("dropdown","`group` node is not allowed to be put in `group` node."),null):B(cy,{clsPrefix:n,tmNode:i,parentKey:t,key:i.key})}))}}),L3=Ae({name:"DropdownRenderOption",props:{tmNode:{type:Object,required:!0}},render(){const{rawNode:{render:e,props:t}}=this.tmNode;return B("div",t,[e==null?void 0:e()])}}),dy=Ae({name:"DropdownMenu",props:{scrollable:Boolean,showArrow:Boolean,arrowStyle:[String,Object],clsPrefix:{type:String,required:!0},tmNodes:{type:Array,default:()=>[]},parentKey:{type:[String,Number],default:null}},setup(e){const{renderIconRef:t,childrenFieldRef:n}=Ut(vc);kn(yh,{showIconRef:q(()=>{const i=t.value;return e.tmNodes.some(a=>{var d;if(a.isGroup)return(d=a.children)===null||d===void 0?void 0:d.some(({rawNode:o})=>i?i(o):o.icon);const{rawNode:r}=a;return i?i(r):r.icon})}),hasSubmenuRef:q(()=>{const{value:i}=n;return e.tmNodes.some(a=>{var d;if(a.isGroup)return(d=a.children)===null||d===void 0?void 0:d.some(({rawNode:o})=>mu(o,i));const{rawNode:r}=a;return mu(r,i)})})});const s=H(null);return kn(oh,null),kn(rh,null),kn(hc,s),{bodyRef:s}},render(){const{parentKey:e,clsPrefix:t,scrollable:n}=this,s=this.tmNodes.map(i=>{const{rawNode:a}=i;return a.show===!1?null:P3(a)?B(L3,{tmNode:i,key:i.key}):ly(a)?B(ay,{clsPrefix:t,key:i.key}):T3(a)?B(E3,{clsPrefix:t,tmNode:i,parentKey:e,key:i.key}):B(cy,{clsPrefix:t,tmNode:i,parentKey:e,key:i.key,props:a.props,scrollable:n})});return B("div",{class:[`${t}-dropdown-menu`,n&&`${t}-dropdown-menu--scrollable`],ref:"bodyRef"},n?B(dg,{contentClass:`${t}-dropdown-menu__content`},{default:()=>s}):s,this.showArrow?E_({clsPrefix:t,arrowStyle:this.arrowStyle,arrowClass:void 0,arrowWrapperClass:void 0,arrowWrapperStyle:void 0}):null)}}),D3=Ce("dropdown-menu",` - transform-origin: var(--v-transform-origin); - background-color: var(--n-color); - border-radius: var(--n-border-radius); - box-shadow: var(--n-box-shadow); - position: relative; - transition: - background-color .3s var(--n-bezier), - box-shadow .3s var(--n-bezier); -`,[Eo(),Ce("dropdown-option",` - position: relative; - `,[ze("a",` - text-decoration: none; - color: inherit; - outline: none; - `,[ze("&::before",` - content: ""; - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - `)]),Ce("dropdown-option-body",` - display: flex; - cursor: pointer; - position: relative; - height: var(--n-option-height); - line-height: var(--n-option-height); - font-size: var(--n-font-size); - color: var(--n-option-text-color); - transition: color .3s var(--n-bezier); - `,[ze("&::before",` - content: ""; - position: absolute; - top: 0; - bottom: 0; - left: 4px; - right: 4px; - transition: background-color .3s var(--n-bezier); - border-radius: var(--n-border-radius); - `),Cn("disabled",[Ve("pending",` - color: var(--n-option-text-color-hover); - `,[Ge("prefix, suffix",` - color: var(--n-option-text-color-hover); - `),ze("&::before","background-color: var(--n-option-color-hover);")]),Ve("active",` - color: var(--n-option-text-color-active); - `,[Ge("prefix, suffix",` - color: var(--n-option-text-color-active); - `),ze("&::before","background-color: var(--n-option-color-active);")]),Ve("child-active",` - color: var(--n-option-text-color-child-active); - `,[Ge("prefix, suffix",` - color: var(--n-option-text-color-child-active); - `)])]),Ve("disabled",` - cursor: not-allowed; - opacity: var(--n-option-opacity-disabled); - `),Ve("group",` - font-size: calc(var(--n-font-size) - 1px); - color: var(--n-group-header-text-color); - `,[Ge("prefix",` - width: calc(var(--n-option-prefix-width) / 2); - `,[Ve("show-icon",` - width: calc(var(--n-option-icon-prefix-width) / 2); - `)])]),Ge("prefix",` - width: var(--n-option-prefix-width); - display: flex; - justify-content: center; - align-items: center; - color: var(--n-prefix-color); - transition: color .3s var(--n-bezier); - z-index: 1; - `,[Ve("show-icon",` - width: var(--n-option-icon-prefix-width); - `),Ce("icon",` - font-size: var(--n-option-icon-size); - `)]),Ge("label",` - white-space: nowrap; - flex: 1; - z-index: 1; - `),Ge("suffix",` - box-sizing: border-box; - flex-grow: 0; - flex-shrink: 0; - display: flex; - justify-content: flex-end; - align-items: center; - min-width: var(--n-option-suffix-width); - padding: 0 8px; - transition: color .3s var(--n-bezier); - color: var(--n-suffix-color); - z-index: 1; - `,[Ve("has-submenu",` - width: var(--n-option-icon-suffix-width); - `),Ce("icon",` - font-size: var(--n-option-icon-size); - `)]),Ce("dropdown-menu","pointer-events: all;")]),Ce("dropdown-offset-container",` - pointer-events: none; - position: absolute; - left: 0; - right: 0; - top: -4px; - bottom: -4px; - `)]),Ce("dropdown-divider",` - transition: background-color .3s var(--n-bezier); - background-color: var(--n-divider-color); - height: 1px; - margin: 4px 0; - `),Ce("dropdown-menu-wrapper",` - transform-origin: var(--v-transform-origin); - width: fit-content; - `),ze(">",[Ce("scrollbar",` - height: inherit; - max-height: inherit; - `)]),Cn("scrollable",` - padding: var(--n-padding); - `),Ve("scrollable",[Ge("content",` - padding: var(--n-padding); - `)])]),M3={animated:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},size:{type:String,default:"medium"},inverted:Boolean,placement:{type:String,default:"bottom"},onSelect:[Function,Array],options:{type:Array,default:()=>[]},menuProps:Function,showArrow:Boolean,renderLabel:Function,renderIcon:Function,renderOption:Function,nodeProps:Function,labelField:{type:String,default:"label"},keyField:{type:String,default:"key"},childrenField:{type:String,default:"children"},value:[String,Number]},A3=Object.keys(Ir),I3=Object.assign(Object.assign(Object.assign({},Ir),M3),Ht.props),$3=Ae({name:"Dropdown",inheritAttrs:!1,props:I3,setup(e){const t=H(!1),n=ss(ct(e,"show"),t),s=q(()=>{const{keyField:R,childrenField:D}=e;return pc(e.options,{getKey(I){return I[R]},getDisabled(I){return I.disabled===!0},getIgnored(I){return I.type==="divider"||I.type==="render"},getChildren(I){return I[D]}})}),i=q(()=>s.value.treeNodes),a=H(null),d=H(null),r=H(null),o=q(()=>{var R,D,I;return(I=(D=(R=a.value)!==null&&R!==void 0?R:d.value)!==null&&D!==void 0?D:r.value)!==null&&I!==void 0?I:null}),c=q(()=>s.value.getPath(o.value).keyPath),p=q(()=>s.value.getPath(e.value).keyPath),u=Zt(()=>e.keyboard&&n.value);sh({keydown:{ArrowUp:{prevent:!0,handler:k},ArrowRight:{prevent:!0,handler:S},ArrowDown:{prevent:!0,handler:P},ArrowLeft:{prevent:!0,handler:_},Enter:{prevent:!0,handler:M},Escape:f}},u);const{mergedClsPrefixRef:g,inlineThemeDisabled:m}=mn(e),y=Ht("Dropdown","-dropdown",D3,o0,e,g);kn(vc,{labelFieldRef:ct(e,"labelField"),childrenFieldRef:ct(e,"childrenField"),renderLabelRef:ct(e,"renderLabel"),renderIconRef:ct(e,"renderIcon"),hoverKeyRef:a,keyboardKeyRef:d,lastToggledSubmenuKeyRef:r,pendingKeyPathRef:c,activeKeyPathRef:p,animatedRef:ct(e,"animated"),mergedShowRef:n,nodePropsRef:ct(e,"nodeProps"),renderOptionRef:ct(e,"renderOption"),menuPropsRef:ct(e,"menuProps"),doSelect:v,doUpdateShow:l}),_t(n,R=>{!e.animated&&!R&&h()});function v(R,D){const{onSelect:I}=e;I&&Je(I,R,D)}function l(R){const{"onUpdate:show":D,onUpdateShow:I}=e;D&&Je(D,R),I&&Je(I,R),t.value=R}function h(){a.value=null,d.value=null,r.value=null}function f(){l(!1)}function _(){T("left")}function S(){T("right")}function k(){T("up")}function P(){T("down")}function M(){const R=w();R!=null&&R.isLeaf&&n.value&&(v(R.key,R.rawNode),l(!1))}function w(){var R;const{value:D}=s,{value:I}=o;return!D||I===null?null:(R=D.getNode(I))!==null&&R!==void 0?R:null}function T(R){const{value:D}=o,{value:{getFirstAvailableNode:I}}=s;let O=null;if(D===null){const U=I();U!==null&&(O=U.key)}else{const U=w();if(U){let W;switch(R){case"down":W=U.getNext();break;case"up":W=U.getPrev();break;case"right":W=U.getChild();break;case"left":W=U.getParent();break}W&&(O=W.key)}}O!==null&&(a.value=null,d.value=O)}const A=q(()=>{const{size:R,inverted:D}=e,{common:{cubicBezierEaseInOut:I},self:O}=y.value,{padding:U,dividerColor:W,borderRadius:N,optionOpacityDisabled:z,[Mt("optionIconSuffixWidth",R)]:V,[Mt("optionSuffixWidth",R)]:j,[Mt("optionIconPrefixWidth",R)]:G,[Mt("optionPrefixWidth",R)]:te,[Mt("fontSize",R)]:oe,[Mt("optionHeight",R)]:re,[Mt("optionIconSize",R)]:ye}=O,K={"--n-bezier":I,"--n-font-size":oe,"--n-padding":U,"--n-border-radius":N,"--n-option-height":re,"--n-option-prefix-width":te,"--n-option-icon-prefix-width":G,"--n-option-suffix-width":j,"--n-option-icon-suffix-width":V,"--n-option-icon-size":ye,"--n-divider-color":W,"--n-option-opacity-disabled":z};return D?(K["--n-color"]=O.colorInverted,K["--n-option-color-hover"]=O.optionColorHoverInverted,K["--n-option-color-active"]=O.optionColorActiveInverted,K["--n-option-text-color"]=O.optionTextColorInverted,K["--n-option-text-color-hover"]=O.optionTextColorHoverInverted,K["--n-option-text-color-active"]=O.optionTextColorActiveInverted,K["--n-option-text-color-child-active"]=O.optionTextColorChildActiveInverted,K["--n-prefix-color"]=O.prefixColorInverted,K["--n-suffix-color"]=O.suffixColorInverted,K["--n-group-header-text-color"]=O.groupHeaderTextColorInverted):(K["--n-color"]=O.color,K["--n-option-color-hover"]=O.optionColorHover,K["--n-option-color-active"]=O.optionColorActive,K["--n-option-text-color"]=O.optionTextColor,K["--n-option-text-color-hover"]=O.optionTextColorHover,K["--n-option-text-color-active"]=O.optionTextColorActive,K["--n-option-text-color-child-active"]=O.optionTextColorChildActive,K["--n-prefix-color"]=O.prefixColor,K["--n-suffix-color"]=O.suffixColor,K["--n-group-header-text-color"]=O.groupHeaderTextColor),K}),E=m?Un("dropdown",q(()=>`${e.size[0]}${e.inverted?"i":""}`),A,e):void 0;return{mergedClsPrefix:g,mergedTheme:y,tmNodes:i,mergedShow:n,handleAfterLeave:()=>{e.animated&&h()},doUpdateShow:l,cssVars:m?void 0:A,themeClass:E==null?void 0:E.themeClass,onRender:E==null?void 0:E.onRender}},render(){const e=(s,i,a,d,r)=>{var o;const{mergedClsPrefix:c,menuProps:p}=this;(o=this.onRender)===null||o===void 0||o.call(this);const u=(p==null?void 0:p(void 0,this.tmNodes.map(m=>m.rawNode)))||{},g={ref:y_(i),class:[s,`${c}-dropdown`,this.themeClass],clsPrefix:c,tmNodes:this.tmNodes,style:[...a,this.cssVars],showArrow:this.showArrow,arrowStyle:this.arrowStyle,scrollable:this.scrollable,onMouseenter:d,onMouseleave:r};return B(dy,nr(this.$attrs,g,u))},{mergedTheme:t}=this,n={show:this.mergedShow,theme:t.peers.Popover,themeOverrides:t.peerOverrides.Popover,internalOnAfterLeave:this.handleAfterLeave,internalRenderBody:e,onUpdateShow:this.doUpdateShow,"onUpdate:show":void 0};return B(Lo,Object.assign({},fc(this.$props,A3),n),{trigger:()=>{var s,i;return(i=(s=this.$slots).default)===null||i===void 0?void 0:i.call(s)}})}}),uy="_n_all__",hy="_n_none__";function O3(e,t,n,s){return e?i=>{for(const a of e)switch(i){case uy:n(!0);return;case hy:s(!0);return;default:if(typeof a=="object"&&a.key===i){a.onSelect(t.value);return}}}:()=>{}}function F3(e,t){return e?e.map(n=>{switch(n){case"all":return{label:t.checkTableAll,key:uy};case"none":return{label:t.uncheckTableAll,key:hy};default:return n}}):[]}const B3=Ae({name:"DataTableSelectionMenu",props:{clsPrefix:{type:String,required:!0}},setup(e){const{props:t,localeRef:n,checkOptionsRef:s,rawPaginatedDataRef:i,doCheckAll:a,doUncheckAll:d}=Ut(Zs),r=q(()=>O3(s.value,i,a,d)),o=q(()=>F3(s.value,n.value));return()=>{var c,p,u,g;const{clsPrefix:m}=e;return B($3,{theme:(p=(c=t.theme)===null||c===void 0?void 0:c.peers)===null||p===void 0?void 0:p.Dropdown,themeOverrides:(g=(u=t.themeOverrides)===null||u===void 0?void 0:u.peers)===null||g===void 0?void 0:g.Dropdown,options:o.value,onSelect:r.value},{default:()=>B(Kn,{clsPrefix:m,class:`${m}-data-table-check-extra`},{default:()=>B(a0,null)})})}}});function vd(e){return typeof e.title=="function"?e.title(e):e.title}const H3=Ae({props:{clsPrefix:{type:String,required:!0},id:{type:String,required:!0},cols:{type:Array,required:!0},width:String},render(){const{clsPrefix:e,id:t,cols:n,width:s}=this;return B("table",{style:{tableLayout:"fixed",width:s},class:`${e}-data-table-table`},B("colgroup",null,n.map(i=>B("col",{key:i.key,style:i.style}))),B("thead",{"data-n-id":t,class:`${e}-data-table-thead`},this.$slots))}}),fy=Ae({name:"DataTableHeader",props:{discrete:{type:Boolean,default:!0}},setup(){const{mergedClsPrefixRef:e,scrollXRef:t,fixedColumnLeftMapRef:n,fixedColumnRightMapRef:s,mergedCurrentPageRef:i,allRowsCheckedRef:a,someRowsCheckedRef:d,rowsRef:r,colsRef:o,mergedThemeRef:c,checkOptionsRef:p,mergedSortStateRef:u,componentId:g,mergedTableLayoutRef:m,headerCheckboxDisabledRef:y,virtualScrollHeaderRef:v,headerHeightRef:l,onUnstableColumnResize:h,doUpdateResizableWidth:f,handleTableHeaderScroll:_,deriveNextSorter:S,doUncheckAll:k,doCheckAll:P}=Ut(Zs),M=H(),w=H({});function T(O){const U=w.value[O];return U==null?void 0:U.getBoundingClientRect().width}function A(){a.value?k():P()}function E(O,U){if(Rs(O,"dataTableFilter")||Rs(O,"dataTableResizable")||!pd(U))return;const W=u.value.find(z=>z.columnKey===U.key)||null,N=ZM(U,W);S(N)}const R=new Map;function D(O){R.set(O.key,T(O.key))}function I(O,U){const W=R.get(O.key);if(W===void 0)return;const N=W+U,z=XM(N,O.minWidth,O.maxWidth);h(N,z,O,T),f(O,z)}return{cellElsRef:w,componentId:g,mergedSortState:u,mergedClsPrefix:e,scrollX:t,fixedColumnLeftMap:n,fixedColumnRightMap:s,currentPage:i,allRowsChecked:a,someRowsChecked:d,rows:r,cols:o,mergedTheme:c,checkOptions:p,mergedTableLayout:m,headerCheckboxDisabled:y,headerHeight:l,virtualScrollHeader:v,virtualListRef:M,handleCheckboxUpdateChecked:A,handleColHeaderClick:E,handleTableHeaderScroll:_,handleColumnResizeStart:D,handleColumnResize:I}},render(){const{cellElsRef:e,mergedClsPrefix:t,fixedColumnLeftMap:n,fixedColumnRightMap:s,currentPage:i,allRowsChecked:a,someRowsChecked:d,rows:r,cols:o,mergedTheme:c,checkOptions:p,componentId:u,discrete:g,mergedTableLayout:m,headerCheckboxDisabled:y,mergedSortState:v,virtualScrollHeader:l,handleColHeaderClick:h,handleCheckboxUpdateChecked:f,handleColumnResizeStart:_,handleColumnResize:S}=this,k=(T,A,E)=>T.map(({column:R,colIndex:D,colSpan:I,rowSpan:O,isLast:U})=>{var W,N;const z=Gs(R),{ellipsis:V}=R,j=()=>R.type==="selection"?R.multiple!==!1?B(Ie,null,B(gh,{key:i,privateInsideTable:!0,checked:a,indeterminate:d,disabled:y,onUpdateChecked:f}),p?B(B3,{clsPrefix:t}):null):null:B(Ie,null,B("div",{class:`${t}-data-table-th__title-wrapper`},B("div",{class:`${t}-data-table-th__title`},V===!0||V&&!V.tooltip?B("div",{class:`${t}-data-table-th__ellipsis`},vd(R)):V&&typeof V=="object"?B(_h,Object.assign({},V,{theme:c.peers.Ellipsis,themeOverrides:c.peerOverrides.Ellipsis}),{default:()=>vd(R)}):vd(R)),pd(R)?B(S3,{column:R}):null),uv(R)?B(y3,{column:R,options:R.filterOptions}):null,ty(R)?B(b3,{onResizeStart:()=>{_(R)},onResize:re=>{S(R,re)}}):null),G=z in n,te=z in s,oe=A&&!R.fixed?"div":"th";return B(oe,{ref:re=>e[z]=re,key:z,style:[A&&!R.fixed?{position:"absolute",left:Gn(A(D)),top:0,bottom:0}:{left:Gn((W=n[z])===null||W===void 0?void 0:W.start),right:Gn((N=s[z])===null||N===void 0?void 0:N.start)},{width:Gn(R.width),textAlign:R.titleAlign||R.align,height:E}],colspan:I,rowspan:O,"data-col-key":z,class:[`${t}-data-table-th`,(G||te)&&`${t}-data-table-th--fixed-${G?"left":"right"}`,{[`${t}-data-table-th--sorting`]:ny(R,v),[`${t}-data-table-th--filterable`]:uv(R),[`${t}-data-table-th--sortable`]:pd(R),[`${t}-data-table-th--selection`]:R.type==="selection",[`${t}-data-table-th--last`]:U},R.className],onClick:R.type!=="selection"&&R.type!=="expand"&&!("children"in R)?re=>{h(re,R)}:void 0},j())});if(l){const{headerHeight:T}=this;let A=0,E=0;return o.forEach(R=>{R.column.fixed==="left"?A++:R.column.fixed==="right"&&E++}),B(go,{ref:"virtualListRef",class:`${t}-data-table-base-table-header`,style:{height:Gn(T)},onScroll:this.handleTableHeaderScroll,columns:o,itemSize:T,showScrollbar:!1,items:[{}],itemResizable:!1,visibleItemsTag:H3,visibleItemsProps:{clsPrefix:t,id:u,cols:o,width:ls(this.scrollX)},renderItemWithCols:({startColIndex:R,endColIndex:D,getLeft:I})=>{const O=o.map((W,N)=>({column:W.column,isLast:N===o.length-1,colIndex:W.index,colSpan:1,rowSpan:1})).filter(({column:W},N)=>!!(R<=N&&N<=D||W.fixed)),U=k(O,I,Gn(T));return U.splice(A,0,B("th",{colspan:o.length-A-E,style:{pointerEvents:"none",visibility:"hidden",height:0}})),B("tr",{style:{position:"relative"}},U)}},{default:({renderedItemWithCols:R})=>R})}const P=B("thead",{class:`${t}-data-table-thead`,"data-n-id":u},r.map(T=>B("tr",{class:`${t}-data-table-tr`},k(T,null,void 0))));if(!g)return P;const{handleTableHeaderScroll:M,scrollX:w}=this;return B("div",{class:`${t}-data-table-base-table-header`,onScroll:M},B("table",{class:`${t}-data-table-table`,style:{minWidth:ls(w),tableLayout:m}},B("colgroup",null,o.map(T=>B("col",{key:T.key,style:T.style}))),P))}});function N3(e,t){const n=[];function s(i,a){i.forEach(d=>{d.children&&t.has(d.key)?(n.push({tmNode:d,striped:!1,key:d.key,index:a}),s(d.children,a)):n.push({key:d.key,tmNode:d,striped:!1,index:a})})}return e.forEach(i=>{n.push(i);const{children:a}=i.tmNode;a&&t.has(i.key)&&s(a,i.index)}),n}const z3=Ae({props:{clsPrefix:{type:String,required:!0},id:{type:String,required:!0},cols:{type:Array,required:!0},onMouseenter:Function,onMouseleave:Function},render(){const{clsPrefix:e,id:t,cols:n,onMouseenter:s,onMouseleave:i}=this;return B("table",{style:{tableLayout:"fixed"},class:`${e}-data-table-table`,onMouseenter:s,onMouseleave:i},B("colgroup",null,n.map(a=>B("col",{key:a.key,style:a.style}))),B("tbody",{"data-n-id":t,class:`${e}-data-table-tbody`},this.$slots))}}),U3=Ae({name:"DataTableBody",props:{onResize:Function,showHeader:Boolean,flexHeight:Boolean,bodyStyle:Object},setup(e){const{slots:t,bodyWidthRef:n,mergedExpandedRowKeysRef:s,mergedClsPrefixRef:i,mergedThemeRef:a,scrollXRef:d,colsRef:r,paginatedDataRef:o,rawPaginatedDataRef:c,fixedColumnLeftMapRef:p,fixedColumnRightMapRef:u,mergedCurrentPageRef:g,rowClassNameRef:m,leftActiveFixedColKeyRef:y,leftActiveFixedChildrenColKeysRef:v,rightActiveFixedColKeyRef:l,rightActiveFixedChildrenColKeysRef:h,renderExpandRef:f,hoverKeyRef:_,summaryRef:S,mergedSortStateRef:k,virtualScrollRef:P,virtualScrollXRef:M,heightForRowRef:w,minRowHeightRef:T,componentId:A,mergedTableLayoutRef:E,childTriggerColIndexRef:R,indentRef:D,rowPropsRef:I,maxHeightRef:O,stripedRef:U,loadingRef:W,onLoadRef:N,loadingKeySetRef:z,expandableRef:V,stickyExpandedRowsRef:j,renderExpandIconRef:G,summaryPlacementRef:te,treeMateRef:oe,scrollbarPropsRef:re,setHeaderScrollLeft:ye,doUpdateExpandedRowKeys:K,handleTableBodyScroll:J,doCheck:Q,doUncheck:de,renderCell:De}=Ut(Zs),Pe=Ut(l0),Ye=H(null),st=H(null),yt=H(null),ce=Zt(()=>o.value.length===0),ae=Zt(()=>e.showHeader||!ce.value),be=Zt(()=>e.showHeader||ce.value);let he="";const Le=q(()=>new Set(s.value));function et(tt){var gt;return(gt=oe.value.getNode(tt))===null||gt===void 0?void 0:gt.rawNode}function je(tt,gt,se){const ge=et(tt.key);if(!ge){Mr("data-table",`fail to get row data with key ${tt.key}`);return}if(se){const Oe=o.value.findIndex(Ke=>Ke.key===he);if(Oe!==-1){const Ke=o.value.findIndex(fe=>fe.key===tt.key),Be=Math.min(Oe,Ke),me=Math.max(Oe,Ke),Fe=[];o.value.slice(Be,me+1).forEach(fe=>{fe.disabled||Fe.push(fe.key)}),gt?Q(Fe,!1,ge):de(Fe,ge),he=tt.key;return}}gt?Q(tt.key,!1,ge):de(tt.key,ge),he=tt.key}function _e(tt){const gt=et(tt.key);if(!gt){Mr("data-table",`fail to get row data with key ${tt.key}`);return}Q(tt.key,!0,gt)}function ie(){if(!ae.value){const{value:gt}=yt;return gt||null}if(P.value)return x();const{value:tt}=Ye;return tt?tt.containerRef:null}function we(tt,gt){var se;if(z.value.has(tt))return;const{value:ge}=s,Oe=ge.indexOf(tt),Ke=Array.from(ge);~Oe?(Ke.splice(Oe,1),K(Ke)):gt&&!gt.isLeaf&&!gt.shallowLoaded?(z.value.add(tt),(se=N.value)===null||se===void 0||se.call(N,gt.rawNode).then(()=>{const{value:Be}=s,me=Array.from(Be);~me.indexOf(tt)||me.push(tt),K(me)}).finally(()=>{z.value.delete(tt)})):(Ke.push(tt),K(Ke))}function Ee(){_.value=null}function x(){const{value:tt}=st;return(tt==null?void 0:tt.listElRef)||null}function Re(){const{value:tt}=st;return(tt==null?void 0:tt.itemsElRef)||null}function Xe(tt){var gt;J(tt),(gt=Ye.value)===null||gt===void 0||gt.sync()}function Ue(tt){var gt;const{onResize:se}=e;se&&se(tt),(gt=Ye.value)===null||gt===void 0||gt.sync()}const xt={getScrollContainer:ie,scrollTo(tt,gt){var se,ge;P.value?(se=st.value)===null||se===void 0||se.scrollTo(tt,gt):(ge=Ye.value)===null||ge===void 0||ge.scrollTo(tt,gt)}},Ze=ze([({props:tt})=>{const gt=ge=>ge===null?null:ze(`[data-n-id="${tt.componentId}"] [data-col-key="${ge}"]::after`,{boxShadow:"var(--n-box-shadow-after)"}),se=ge=>ge===null?null:ze(`[data-n-id="${tt.componentId}"] [data-col-key="${ge}"]::before`,{boxShadow:"var(--n-box-shadow-before)"});return ze([gt(tt.leftActiveFixedColKey),se(tt.rightActiveFixedColKey),tt.leftActiveFixedChildrenColKeys.map(ge=>gt(ge)),tt.rightActiveFixedChildrenColKeys.map(ge=>se(ge))])}]);let wt=!1;return Vs(()=>{const{value:tt}=y,{value:gt}=v,{value:se}=l,{value:ge}=h;if(!wt&&tt===null&&se===null)return;const Oe={leftActiveFixedColKey:tt,leftActiveFixedChildrenColKeys:gt,rightActiveFixedColKey:se,rightActiveFixedChildrenColKeys:ge,componentId:A};Ze.mount({id:`n-${A}`,force:!0,props:Oe,anchorMetaName:c0,parent:Pe==null?void 0:Pe.styleMountTarget}),wt=!0}),nc(()=>{Ze.unmount({id:`n-${A}`,parent:Pe==null?void 0:Pe.styleMountTarget})}),Object.assign({bodyWidth:n,summaryPlacement:te,dataTableSlots:t,componentId:A,scrollbarInstRef:Ye,virtualListRef:st,emptyElRef:yt,summary:S,mergedClsPrefix:i,mergedTheme:a,scrollX:d,cols:r,loading:W,bodyShowHeaderOnly:be,shouldDisplaySomeTablePart:ae,empty:ce,paginatedDataAndInfo:q(()=>{const{value:tt}=U;let gt=!1;return{data:o.value.map(tt?(ge,Oe)=>(ge.isLeaf||(gt=!0),{tmNode:ge,key:ge.key,striped:Oe%2===1,index:Oe}):(ge,Oe)=>(ge.isLeaf||(gt=!0),{tmNode:ge,key:ge.key,striped:!1,index:Oe})),hasChildren:gt}}),rawPaginatedData:c,fixedColumnLeftMap:p,fixedColumnRightMap:u,currentPage:g,rowClassName:m,renderExpand:f,mergedExpandedRowKeySet:Le,hoverKey:_,mergedSortState:k,virtualScroll:P,virtualScrollX:M,heightForRow:w,minRowHeight:T,mergedTableLayout:E,childTriggerColIndex:R,indent:D,rowProps:I,maxHeight:O,loadingKeySet:z,expandable:V,stickyExpandedRows:j,renderExpandIcon:G,scrollbarProps:re,setHeaderScrollLeft:ye,handleVirtualListScroll:Xe,handleVirtualListResize:Ue,handleMouseleaveTable:Ee,virtualListContainer:x,virtualListContent:Re,handleTableBodyScroll:J,handleCheckboxUpdateChecked:je,handleRadioUpdateChecked:_e,handleUpdateExpanded:we,renderCell:De},xt)},render(){const{mergedTheme:e,scrollX:t,mergedClsPrefix:n,virtualScroll:s,maxHeight:i,mergedTableLayout:a,flexHeight:d,loadingKeySet:r,onResize:o,setHeaderScrollLeft:c}=this,p=t!==void 0||i!==void 0||d,u=!p&&a==="auto",g=t!==void 0||u,m={minWidth:ls(t)||"100%"};t&&(m.width="100%");const y=B(As,Object.assign({},this.scrollbarProps,{ref:"scrollbarInstRef",scrollable:p||u,class:`${n}-data-table-base-table-body`,style:this.empty?void 0:this.bodyStyle,theme:e.peers.Scrollbar,themeOverrides:e.peerOverrides.Scrollbar,contentStyle:m,container:s?this.virtualListContainer:void 0,content:s?this.virtualListContent:void 0,horizontalRailStyle:{zIndex:3},verticalRailStyle:{zIndex:3},xScrollable:g,onScroll:s?void 0:this.handleTableBodyScroll,internalOnUpdateScrollLeft:c,onResize:o}),{default:()=>{const v={},l={},{cols:h,paginatedDataAndInfo:f,mergedTheme:_,fixedColumnLeftMap:S,fixedColumnRightMap:k,currentPage:P,rowClassName:M,mergedSortState:w,mergedExpandedRowKeySet:T,stickyExpandedRows:A,componentId:E,childTriggerColIndex:R,expandable:D,rowProps:I,handleMouseleaveTable:O,renderExpand:U,summary:W,handleCheckboxUpdateChecked:N,handleRadioUpdateChecked:z,handleUpdateExpanded:V,heightForRow:j,minRowHeight:G,virtualScrollX:te}=this,{length:oe}=h;let re;const{data:ye,hasChildren:K}=f,J=K?N3(ye,T):ye;if(W){const he=W(this.rawPaginatedData);if(Array.isArray(he)){const Le=he.map((et,je)=>({isSummaryRow:!0,key:`__n_summary__${je}`,tmNode:{rawNode:et,disabled:!0},index:-1}));re=this.summaryPlacement==="top"?[...Le,...J]:[...J,...Le]}else{const Le={isSummaryRow:!0,key:"__n_summary__",tmNode:{rawNode:he,disabled:!0},index:-1};re=this.summaryPlacement==="top"?[Le,...J]:[...J,Le]}}else re=J;const Q=K?{width:Gn(this.indent)}:void 0,de=[];re.forEach(he=>{U&&T.has(he.key)&&(!D||D(he.tmNode.rawNode))?de.push(he,{isExpandedRow:!0,key:`${he.key}-expand`,tmNode:he.tmNode,index:he.index}):de.push(he)});const{length:De}=de,Pe={};ye.forEach(({tmNode:he},Le)=>{Pe[Le]=he.key});const Ye=A?this.bodyWidth:null,st=Ye===null?void 0:`${Ye}px`,yt=this.virtualScrollX?"div":"td";let ce=0,ae=0;te&&h.forEach(he=>{he.column.fixed==="left"?ce++:he.column.fixed==="right"&&ae++});const be=({rowInfo:he,displayedRowIndex:Le,isVirtual:et,isVirtualX:je,startColIndex:_e,endColIndex:ie,getLeft:we})=>{const{index:Ee}=he;if("isExpandedRow"in he){const{tmNode:{key:Ke,rawNode:Be}}=he;return B("tr",{class:`${n}-data-table-tr ${n}-data-table-tr--expanded`,key:`${Ke}__expand`},B("td",{class:[`${n}-data-table-td`,`${n}-data-table-td--last-col`,Le+1===De&&`${n}-data-table-td--last-row`],colspan:oe},A?B("div",{class:`${n}-data-table-expand`,style:{width:st}},U(Be,Ee)):U(Be,Ee)))}const x="isSummaryRow"in he,Re=!x&&he.striped,{tmNode:Xe,key:Ue}=he,{rawNode:xt}=Xe,Ze=T.has(Ue),wt=I?I(xt,Ee):void 0,tt=typeof M=="string"?M:QM(xt,Ee,M),gt=je?h.filter((Ke,Be)=>!!(_e<=Be&&Be<=ie||Ke.column.fixed)):h,se=je?Gn((j==null?void 0:j(xt,Ee))||G):void 0,ge=gt.map(Ke=>{var Be,me,Fe,fe,nt;const At=Ke.index;if(Le in v){const Qt=v[Le],an=Qt.indexOf(At);if(~an)return Qt.splice(an,1),null}const{column:St}=Ke,xe=Gs(Ke),{rowSpan:qe,colSpan:ht}=St,Et=x?((Be=he.tmNode.rawNode[xe])===null||Be===void 0?void 0:Be.colSpan)||1:ht?ht(xt,Ee):1,jt=x?((me=he.tmNode.rawNode[xe])===null||me===void 0?void 0:me.rowSpan)||1:qe?qe(xt,Ee):1,Kt=At+Et===oe,Yt=Le+jt===De,nn=jt>1;if(nn&&(l[Le]={[At]:[]}),Et>1||nn)for(let Qt=Le;Qt{V(Ue,he.tmNode)}})]:null,St.type==="selection"?x?null:St.multiple===!1?B(u3,{key:P,rowKey:Ue,disabled:he.tmNode.disabled,onUpdateChecked:()=>{z(he.tmNode)}}):B(n3,{key:P,rowKey:Ue,disabled:he.tmNode.disabled,onUpdateChecked:(Qt,an)=>{N(he.tmNode,Qt,an.shiftKey)}}):St.type==="expand"?x?null:!St.expandable||!((nt=St.expandable)===null||nt===void 0)&&nt.call(St,xt)?B(fv,{clsPrefix:n,rowData:xt,expanded:Ze,renderExpandIcon:this.renderExpandIcon,onClick:()=>{V(Ue,null)}}):null:B(v3,{clsPrefix:n,index:Ee,row:xt,column:St,isSummary:x,mergedTheme:_,renderCell:this.renderCell}))});return je&&ce&&ae&&ge.splice(ce,0,B("td",{colspan:h.length-ce-ae,style:{pointerEvents:"none",visibility:"hidden",height:0}})),B("tr",Object.assign({},wt,{onMouseenter:Ke=>{var Be;this.hoverKey=Ue,(Be=wt==null?void 0:wt.onMouseenter)===null||Be===void 0||Be.call(wt,Ke)},key:Ue,class:[`${n}-data-table-tr`,x&&`${n}-data-table-tr--summary`,Re&&`${n}-data-table-tr--striped`,Ze&&`${n}-data-table-tr--expanded`,tt,wt==null?void 0:wt.class],style:[wt==null?void 0:wt.style,je&&{height:se}]}),ge)};return s?B(go,{ref:"virtualListRef",items:de,itemSize:this.minRowHeight,visibleItemsTag:z3,visibleItemsProps:{clsPrefix:n,id:E,cols:h,onMouseleave:O},showScrollbar:!1,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemsStyle:m,itemResizable:!te,columns:h,renderItemWithCols:te?({itemIndex:he,item:Le,startColIndex:et,endColIndex:je,getLeft:_e})=>be({displayedRowIndex:he,isVirtual:!0,isVirtualX:!0,rowInfo:Le,startColIndex:et,endColIndex:je,getLeft:_e}):void 0},{default:({item:he,index:Le,renderedItemWithCols:et})=>et||be({rowInfo:he,displayedRowIndex:Le,isVirtual:!0,isVirtualX:!1,startColIndex:0,endColIndex:0,getLeft(je){return 0}})}):B("table",{class:`${n}-data-table-table`,onMouseleave:O,style:{tableLayout:this.mergedTableLayout}},B("colgroup",null,h.map(he=>B("col",{key:he.key,style:he.style}))),this.showHeader?B(fy,{discrete:!1}):null,this.empty?null:B("tbody",{"data-n-id":E,class:`${n}-data-table-tbody`},de.map((he,Le)=>be({rowInfo:he,displayedRowIndex:Le,isVirtual:!1,isVirtualX:!1,startColIndex:-1,endColIndex:-1,getLeft(et){return-1}}))))}});if(this.empty){const v=()=>B("div",{class:[`${n}-data-table-empty`,this.loading&&`${n}-data-table-empty--hide`],style:this.bodyStyle,ref:"emptyElRef"},Jt(this.dataTableSlots.empty,()=>[B(R_,{theme:this.mergedTheme.peers.Empty,themeOverrides:this.mergedTheme.peerOverrides.Empty})]));return this.shouldDisplaySomeTablePart?B(Ie,null,y,v()):B(Id,{onResize:this.onResize},{default:v})}return y}}),V3=Ae({name:"MainTable",setup(){const{mergedClsPrefixRef:e,rightFixedColumnsRef:t,leftFixedColumnsRef:n,bodyWidthRef:s,maxHeightRef:i,minHeightRef:a,flexHeightRef:d,virtualScrollHeaderRef:r,syncScrollState:o}=Ut(Zs),c=H(null),p=H(null),u=H(null),g=H(!(n.value.length||t.value.length)),m=q(()=>({maxHeight:ls(i.value),minHeight:ls(a.value)}));function y(f){s.value=f.contentRect.width,o(),g.value||(g.value=!0)}function v(){var f;const{value:_}=c;return _?r.value?((f=_.virtualListRef)===null||f===void 0?void 0:f.listElRef)||null:_.$el:null}function l(){const{value:f}=p;return f?f.getScrollContainer():null}const h={getBodyElement:l,getHeaderElement:v,scrollTo(f,_){var S;(S=p.value)===null||S===void 0||S.scrollTo(f,_)}};return Vs(()=>{const{value:f}=u;if(!f)return;const _=`${e.value}-data-table-base-table--transition-disabled`;g.value?setTimeout(()=>{f.classList.remove(_)},0):f.classList.add(_)}),Object.assign({maxHeight:i,mergedClsPrefix:e,selfElRef:u,headerInstRef:c,bodyInstRef:p,bodyStyle:m,flexHeight:d,handleBodyResize:y},h)},render(){const{mergedClsPrefix:e,maxHeight:t,flexHeight:n}=this,s=t===void 0&&!n;return B("div",{class:`${e}-data-table-base-table`,ref:"selfElRef"},s?null:B(fy,{ref:"headerInstRef"}),B(U3,{ref:"bodyInstRef",bodyStyle:this.bodyStyle,showHeader:s,flexHeight:n,onResize:this.handleBodyResize}))}}),vv=W3(),K3=ze([Ce("data-table",` - width: 100%; - font-size: var(--n-font-size); - display: flex; - flex-direction: column; - position: relative; - --n-merged-th-color: var(--n-th-color); - --n-merged-td-color: var(--n-td-color); - --n-merged-border-color: var(--n-border-color); - --n-merged-th-color-sorting: var(--n-th-color-sorting); - --n-merged-td-color-hover: var(--n-td-color-hover); - --n-merged-td-color-sorting: var(--n-td-color-sorting); - --n-merged-td-color-striped: var(--n-td-color-striped); - `,[Ce("data-table-wrapper",` - flex-grow: 1; - display: flex; - flex-direction: column; - `),Ve("flex-height",[ze(">",[Ce("data-table-wrapper",[ze(">",[Ce("data-table-base-table",` - display: flex; - flex-direction: column; - flex-grow: 1; - `,[ze(">",[Ce("data-table-base-table-body","flex-basis: 0;",[ze("&:last-child","flex-grow: 1;")])])])])])])]),ze(">",[Ce("data-table-loading-wrapper",` - color: var(--n-loading-color); - font-size: var(--n-loading-size); - position: absolute; - left: 50%; - top: 50%; - transform: translateX(-50%) translateY(-50%); - transition: color .3s var(--n-bezier); - display: flex; - align-items: center; - justify-content: center; - `,[Eo({originalTransform:"translateX(-50%) translateY(-50%)"})])]),Ce("data-table-expand-placeholder",` - margin-right: 8px; - display: inline-block; - width: 16px; - height: 1px; - `),Ce("data-table-indent",` - display: inline-block; - height: 1px; - `),Ce("data-table-expand-trigger",` - display: inline-flex; - margin-right: 8px; - cursor: pointer; - font-size: 16px; - vertical-align: -0.2em; - position: relative; - width: 16px; - height: 16px; - color: var(--n-td-text-color); - transition: color .3s var(--n-bezier); - `,[Ve("expanded",[Ce("icon","transform: rotate(90deg);",[Gr({originalTransform:"rotate(90deg)"})]),Ce("base-icon","transform: rotate(90deg);",[Gr({originalTransform:"rotate(90deg)"})])]),Ce("base-loading",` - color: var(--n-loading-color); - transition: color .3s var(--n-bezier); - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - `,[Gr()]),Ce("icon",` - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - `,[Gr()]),Ce("base-icon",` - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - `,[Gr()])]),Ce("data-table-thead",` - transition: background-color .3s var(--n-bezier); - background-color: var(--n-merged-th-color); - `),Ce("data-table-tr",` - position: relative; - box-sizing: border-box; - background-clip: padding-box; - transition: background-color .3s var(--n-bezier); - `,[Ce("data-table-expand",` - position: sticky; - left: 0; - overflow: hidden; - margin: calc(var(--n-th-padding) * -1); - padding: var(--n-th-padding); - box-sizing: border-box; - `),Ve("striped","background-color: var(--n-merged-td-color-striped);",[Ce("data-table-td","background-color: var(--n-merged-td-color-striped);")]),Cn("summary",[ze("&:hover","background-color: var(--n-merged-td-color-hover);",[ze(">",[Ce("data-table-td","background-color: var(--n-merged-td-color-hover);")])])])]),Ce("data-table-th",` - padding: var(--n-th-padding); - position: relative; - text-align: start; - box-sizing: border-box; - background-color: var(--n-merged-th-color); - border-color: var(--n-merged-border-color); - border-bottom: 1px solid var(--n-merged-border-color); - color: var(--n-th-text-color); - transition: - border-color .3s var(--n-bezier), - color .3s var(--n-bezier), - background-color .3s var(--n-bezier); - font-weight: var(--n-th-font-weight); - `,[Ve("filterable",` - padding-right: 36px; - `,[Ve("sortable",` - padding-right: calc(var(--n-th-padding) + 36px); - `)]),vv,Ve("selection",` - padding: 0; - text-align: center; - line-height: 0; - z-index: 3; - `),Ge("title-wrapper",` - display: flex; - align-items: center; - flex-wrap: nowrap; - max-width: 100%; - `,[Ge("title",` - flex: 1; - min-width: 0; - `)]),Ge("ellipsis",` - display: inline-block; - vertical-align: bottom; - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; - max-width: 100%; - `),Ve("hover",` - background-color: var(--n-merged-th-color-hover); - `),Ve("sorting",` - background-color: var(--n-merged-th-color-sorting); - `),Ve("sortable",` - cursor: pointer; - `,[Ge("ellipsis",` - max-width: calc(100% - 18px); - `),ze("&:hover",` - background-color: var(--n-merged-th-color-hover); - `)]),Ce("data-table-sorter",` - height: var(--n-sorter-size); - width: var(--n-sorter-size); - margin-left: 4px; - position: relative; - display: inline-flex; - align-items: center; - justify-content: center; - vertical-align: -0.2em; - color: var(--n-th-icon-color); - transition: color .3s var(--n-bezier); - `,[Ce("base-icon","transition: transform .3s var(--n-bezier)"),Ve("desc",[Ce("base-icon",` - transform: rotate(0deg); - `)]),Ve("asc",[Ce("base-icon",` - transform: rotate(-180deg); - `)]),Ve("asc, desc",` - color: var(--n-th-icon-color-active); - `)]),Ce("data-table-resize-button",` - width: var(--n-resizable-container-size); - position: absolute; - top: 0; - right: calc(var(--n-resizable-container-size) / 2); - bottom: 0; - cursor: col-resize; - user-select: none; - `,[ze("&::after",` - width: var(--n-resizable-size); - height: 50%; - position: absolute; - top: 50%; - left: calc(var(--n-resizable-container-size) / 2); - bottom: 0; - background-color: var(--n-merged-border-color); - transform: translateY(-50%); - transition: background-color .3s var(--n-bezier); - z-index: 1; - content: ''; - `),Ve("active",[ze("&::after",` - background-color: var(--n-th-icon-color-active); - `)]),ze("&:hover::after",` - background-color: var(--n-th-icon-color-active); - `)]),Ce("data-table-filter",` - position: absolute; - z-index: auto; - right: 0; - width: 36px; - top: 0; - bottom: 0; - cursor: pointer; - display: flex; - justify-content: center; - align-items: center; - transition: - background-color .3s var(--n-bezier), - color .3s var(--n-bezier); - font-size: var(--n-filter-size); - color: var(--n-th-icon-color); - `,[ze("&:hover",` - background-color: var(--n-th-button-color-hover); - `),Ve("show",` - background-color: var(--n-th-button-color-hover); - `),Ve("active",` - background-color: var(--n-th-button-color-hover); - color: var(--n-th-icon-color-active); - `)])]),Ce("data-table-td",` - padding: var(--n-td-padding); - text-align: start; - box-sizing: border-box; - border: none; - background-color: var(--n-merged-td-color); - color: var(--n-td-text-color); - border-bottom: 1px solid var(--n-merged-border-color); - transition: - box-shadow .3s var(--n-bezier), - background-color .3s var(--n-bezier), - border-color .3s var(--n-bezier), - color .3s var(--n-bezier); - `,[Ve("expand",[Ce("data-table-expand-trigger",` - margin-right: 0; - `)]),Ve("last-row",` - border-bottom: 0 solid var(--n-merged-border-color); - `,[ze("&::after",` - bottom: 0 !important; - `),ze("&::before",` - bottom: 0 !important; - `)]),Ve("summary",` - background-color: var(--n-merged-th-color); - `),Ve("hover",` - background-color: var(--n-merged-td-color-hover); - `),Ve("sorting",` - background-color: var(--n-merged-td-color-sorting); - `),Ge("ellipsis",` - display: inline-block; - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; - max-width: 100%; - vertical-align: bottom; - max-width: calc(100% - var(--indent-offset, -1.5) * 16px - 24px); - `),Ve("selection, expand",` - text-align: center; - padding: 0; - line-height: 0; - `),vv]),Ce("data-table-empty",` - box-sizing: border-box; - padding: var(--n-empty-padding); - flex-grow: 1; - flex-shrink: 0; - opacity: 1; - display: flex; - align-items: center; - justify-content: center; - transition: opacity .3s var(--n-bezier); - `,[Ve("hide",` - opacity: 0; - `)]),Ge("pagination",` - margin: var(--n-pagination-margin); - display: flex; - justify-content: flex-end; - `),Ce("data-table-wrapper",` - position: relative; - opacity: 1; - transition: opacity .3s var(--n-bezier), border-color .3s var(--n-bezier); - border-top-left-radius: var(--n-border-radius); - border-top-right-radius: var(--n-border-radius); - line-height: var(--n-line-height); - `),Ve("loading",[Ce("data-table-wrapper",` - opacity: var(--n-opacity-loading); - pointer-events: none; - `)]),Ve("single-column",[Ce("data-table-td",` - border-bottom: 0 solid var(--n-merged-border-color); - `,[ze("&::after, &::before",` - bottom: 0 !important; - `)])]),Cn("single-line",[Ce("data-table-th",` - border-right: 1px solid var(--n-merged-border-color); - `,[Ve("last",` - border-right: 0 solid var(--n-merged-border-color); - `)]),Ce("data-table-td",` - border-right: 1px solid var(--n-merged-border-color); - `,[Ve("last-col",` - border-right: 0 solid var(--n-merged-border-color); - `)])]),Ve("bordered",[Ce("data-table-wrapper",` - border: 1px solid var(--n-merged-border-color); - border-bottom-left-radius: var(--n-border-radius); - border-bottom-right-radius: var(--n-border-radius); - overflow: hidden; - `)]),Ce("data-table-base-table",[Ve("transition-disabled",[Ce("data-table-th",[ze("&::after, &::before","transition: none;")]),Ce("data-table-td",[ze("&::after, &::before","transition: none;")])])]),Ve("bottom-bordered",[Ce("data-table-td",[Ve("last-row",` - border-bottom: 1px solid var(--n-merged-border-color); - `)])]),Ce("data-table-table",` - font-variant-numeric: tabular-nums; - width: 100%; - word-break: break-word; - transition: background-color .3s var(--n-bezier); - border-collapse: separate; - border-spacing: 0; - background-color: var(--n-merged-td-color); - `),Ce("data-table-base-table-header",` - border-top-left-radius: calc(var(--n-border-radius) - 1px); - border-top-right-radius: calc(var(--n-border-radius) - 1px); - z-index: 3; - overflow: scroll; - flex-shrink: 0; - transition: border-color .3s var(--n-bezier); - scrollbar-width: none; - `,[ze("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",` - display: none; - width: 0; - height: 0; - `)]),Ce("data-table-check-extra",` - transition: color .3s var(--n-bezier); - color: var(--n-th-icon-color); - position: absolute; - font-size: 14px; - right: -4px; - top: 50%; - transform: translateY(-50%); - z-index: 1; - `)]),Ce("data-table-filter-menu",[Ce("scrollbar",` - max-height: 240px; - `),Ge("group",` - display: flex; - flex-direction: column; - padding: 12px 12px 0 12px; - `,[Ce("checkbox",` - margin-bottom: 12px; - margin-right: 0; - `),Ce("radio",` - margin-bottom: 12px; - margin-right: 0; - `)]),Ge("action",` - padding: var(--n-action-padding); - display: flex; - flex-wrap: nowrap; - justify-content: space-evenly; - border-top: 1px solid var(--n-action-divider-color); - `,[Ce("button",[ze("&:not(:last-child)",` - margin: var(--n-action-button-margin); - `),ze("&:last-child",` - margin-right: 0; - `)])]),Ce("divider",` - margin: 0 !important; - `)]),fg(Ce("data-table",` - --n-merged-th-color: var(--n-th-color-modal); - --n-merged-td-color: var(--n-td-color-modal); - --n-merged-border-color: var(--n-border-color-modal); - --n-merged-th-color-hover: var(--n-th-color-hover-modal); - --n-merged-td-color-hover: var(--n-td-color-hover-modal); - --n-merged-th-color-sorting: var(--n-th-color-hover-modal); - --n-merged-td-color-sorting: var(--n-td-color-hover-modal); - --n-merged-td-color-striped: var(--n-td-color-striped-modal); - `)),pg(Ce("data-table",` - --n-merged-th-color: var(--n-th-color-popover); - --n-merged-td-color: var(--n-td-color-popover); - --n-merged-border-color: var(--n-border-color-popover); - --n-merged-th-color-hover: var(--n-th-color-hover-popover); - --n-merged-td-color-hover: var(--n-td-color-hover-popover); - --n-merged-th-color-sorting: var(--n-th-color-hover-popover); - --n-merged-td-color-sorting: var(--n-td-color-hover-popover); - --n-merged-td-color-striped: var(--n-td-color-striped-popover); - `))]);function W3(){return[Ve("fixed-left",` - left: 0; - position: sticky; - z-index: 2; - `,[ze("&::after",` - pointer-events: none; - content: ""; - width: 36px; - display: inline-block; - position: absolute; - top: 0; - bottom: -1px; - transition: box-shadow .2s var(--n-bezier); - right: -36px; - `)]),Ve("fixed-right",` - right: 0; - position: sticky; - z-index: 1; - `,[ze("&::before",` - pointer-events: none; - content: ""; - width: 36px; - display: inline-block; - position: absolute; - top: 0; - bottom: -1px; - transition: box-shadow .2s var(--n-bezier); - left: -36px; - `)])]}function j3(e,t){const{paginatedDataRef:n,treeMateRef:s,selectionColumnRef:i}=t,a=H(e.defaultCheckedRowKeys),d=q(()=>{var k;const{checkedRowKeys:P}=e,M=P===void 0?a.value:P;return((k=i.value)===null||k===void 0?void 0:k.multiple)===!1?{checkedKeys:M.slice(0,1),indeterminateKeys:[]}:s.value.getCheckedKeys(M,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded})}),r=q(()=>d.value.checkedKeys),o=q(()=>d.value.indeterminateKeys),c=q(()=>new Set(r.value)),p=q(()=>new Set(o.value)),u=q(()=>{const{value:k}=c;return n.value.reduce((P,M)=>{const{key:w,disabled:T}=M;return P+(!T&&k.has(w)?1:0)},0)}),g=q(()=>n.value.filter(k=>k.disabled).length),m=q(()=>{const{length:k}=n.value,{value:P}=p;return u.value>0&&u.valueP.has(M.key))}),y=q(()=>{const{length:k}=n.value;return u.value!==0&&u.value===k-g.value}),v=q(()=>n.value.length===0);function l(k,P,M){const{"onUpdate:checkedRowKeys":w,onUpdateCheckedRowKeys:T,onCheckedRowKeysChange:A}=e,E=[],{value:{getNode:R}}=s;k.forEach(D=>{var I;const O=(I=R(D))===null||I===void 0?void 0:I.rawNode;E.push(O)}),w&&Je(w,k,E,{row:P,action:M}),T&&Je(T,k,E,{row:P,action:M}),A&&Je(A,k,E,{row:P,action:M}),a.value=k}function h(k,P=!1,M){if(!e.loading){if(P){l(Array.isArray(k)?k.slice(0,1):[k],M,"check");return}l(s.value.check(k,r.value,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,M,"check")}}function f(k,P){e.loading||l(s.value.uncheck(k,r.value,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,P,"uncheck")}function _(k=!1){const{value:P}=i;if(!P||e.loading)return;const M=[];(k?s.value.treeNodes:n.value).forEach(w=>{w.disabled||M.push(w.key)}),l(s.value.check(M,r.value,{cascade:!0,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,void 0,"checkAll")}function S(k=!1){const{value:P}=i;if(!P||e.loading)return;const M=[];(k?s.value.treeNodes:n.value).forEach(w=>{w.disabled||M.push(w.key)}),l(s.value.uncheck(M,r.value,{cascade:!0,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,void 0,"uncheckAll")}return{mergedCheckedRowKeySetRef:c,mergedCheckedRowKeysRef:r,mergedInderminateRowKeySetRef:p,someRowsCheckedRef:m,allRowsCheckedRef:y,headerCheckboxDisabledRef:v,doUpdateCheckedRowKeys:l,doCheckAll:_,doUncheckAll:S,doCheck:h,doUncheck:f}}function q3(e,t){const n=Zt(()=>{for(const c of e.columns)if(c.type==="expand")return c.renderExpand}),s=Zt(()=>{let c;for(const p of e.columns)if(p.type==="expand"){c=p.expandable;break}return c}),i=H(e.defaultExpandAll?n!=null&&n.value?(()=>{const c=[];return t.value.treeNodes.forEach(p=>{var u;!((u=s.value)===null||u===void 0)&&u.call(s,p.rawNode)&&c.push(p.key)}),c})():t.value.getNonLeafKeys():e.defaultExpandedRowKeys),a=ct(e,"expandedRowKeys"),d=ct(e,"stickyExpandedRows"),r=ss(a,i);function o(c){const{onUpdateExpandedRowKeys:p,"onUpdate:expandedRowKeys":u}=e;p&&Je(p,c),u&&Je(u,c),i.value=c}return{stickyExpandedRowsRef:d,mergedExpandedRowKeysRef:r,renderExpandRef:n,expandableRef:s,doUpdateExpandedRowKeys:o}}function Y3(e,t){const n=[],s=[],i=[],a=new WeakMap;let d=-1,r=0,o=!1;function c(g,m){m>d&&(n[m]=[],d=m),g.forEach((y,v)=>{if("children"in y)c(y.children,m+1);else{const l="key"in y?y.key:void 0;s.push({key:Gs(y),style:JM(y,l!==void 0?ls(t(l)):void 0),column:y,index:v,width:y.width===void 0?128:Number(y.width)}),r+=1,o||(o=!!y.ellipsis),i.push(y)}})}c(e,0);let p=0;function u(g,m){let y=0;g.forEach(v=>{var l;if("children"in v){const h=p,f={column:v,colIndex:p,colSpan:0,rowSpan:1,isLast:!1};u(v.children,m+1),v.children.forEach(_=>{var S,k;f.colSpan+=(k=(S=a.get(_))===null||S===void 0?void 0:S.colSpan)!==null&&k!==void 0?k:0}),h+f.colSpan===r&&(f.isLast=!0),a.set(v,f),n[m].push(f)}else{if(p1&&(y=p+h);const f=p+h===r,_={column:v,colSpan:h,colIndex:p,rowSpan:d-m+1,isLast:f};a.set(v,_),n[m].push(_),p+=1}})}return u(e,0),{hasEllipsis:o,rows:n,cols:s,dataRelatedCols:i}}function G3(e,t){const n=q(()=>Y3(e.columns,t));return{rowsRef:q(()=>n.value.rows),colsRef:q(()=>n.value.cols),hasEllipsisRef:q(()=>n.value.hasEllipsis),dataRelatedColsRef:q(()=>n.value.dataRelatedCols)}}function X3(){const e=H({});function t(i){return e.value[i]}function n(i,a){ty(i)&&"key"in i&&(e.value[i.key]=a)}function s(){e.value={}}return{getResizableWidth:t,doUpdateResizableWidth:n,clearResizableWidth:s}}function J3(e,{mainTableInstRef:t,mergedCurrentPageRef:n,bodyWidthRef:s}){let i=0;const a=H(),d=H(null),r=H([]),o=H(null),c=H([]),p=q(()=>ls(e.scrollX)),u=q(()=>e.columns.filter(T=>T.fixed==="left")),g=q(()=>e.columns.filter(T=>T.fixed==="right")),m=q(()=>{const T={};let A=0;function E(R){R.forEach(D=>{const I={start:A,end:0};T[Gs(D)]=I,"children"in D?(E(D.children),I.end=A):(A+=cv(D)||0,I.end=A)})}return E(u.value),T}),y=q(()=>{const T={};let A=0;function E(R){for(let D=R.length-1;D>=0;--D){const I=R[D],O={start:A,end:0};T[Gs(I)]=O,"children"in I?(E(I.children),O.end=A):(A+=cv(I)||0,O.end=A)}}return E(g.value),T});function v(){var T,A;const{value:E}=u;let R=0;const{value:D}=m;let I=null;for(let O=0;O(((T=D[U])===null||T===void 0?void 0:T.start)||0)-R)I=U,R=((A=D[U])===null||A===void 0?void 0:A.end)||0;else break}d.value=I}function l(){r.value=[];let T=e.columns.find(A=>Gs(A)===d.value);for(;T&&"children"in T;){const A=T.children.length;if(A===0)break;const E=T.children[A-1];r.value.push(Gs(E)),T=E}}function h(){var T,A;const{value:E}=g,R=Number(e.scrollX),{value:D}=s;if(D===null)return;let I=0,O=null;const{value:U}=y;for(let W=E.length-1;W>=0;--W){const N=Gs(E[W]);if(Math.round(i+(((T=U[N])===null||T===void 0?void 0:T.start)||0)+D-I)Gs(A)===o.value);for(;T&&"children"in T&&T.children.length;){const A=T.children[0];c.value.push(Gs(A)),T=A}}function _(){const T=t.value?t.value.getHeaderElement():null,A=t.value?t.value.getBodyElement():null;return{header:T,body:A}}function S(){const{body:T}=_();T&&(T.scrollTop=0)}function k(){a.value!=="body"?Bl(M):a.value=void 0}function P(T){var A;(A=e.onScroll)===null||A===void 0||A.call(e,T),a.value!=="head"?Bl(M):a.value=void 0}function M(){const{header:T,body:A}=_();if(!A)return;const{value:E}=s;if(E!==null){if(e.maxHeight||e.flexHeight){if(!T)return;const R=i-T.scrollLeft;a.value=R!==0?"head":"body",a.value==="head"?(i=T.scrollLeft,A.scrollLeft=i):(i=A.scrollLeft,T.scrollLeft=i)}else i=A.scrollLeft;v(),l(),h(),f()}}function w(T){const{header:A}=_();A&&(A.scrollLeft=T,M())}return _t(n,()=>{S()}),{styleScrollXRef:p,fixedColumnLeftMapRef:m,fixedColumnRightMapRef:y,leftFixedColumnsRef:u,rightFixedColumnsRef:g,leftActiveFixedColKeyRef:d,leftActiveFixedChildrenColKeysRef:r,rightActiveFixedColKeyRef:o,rightActiveFixedChildrenColKeysRef:c,syncScrollState:M,handleTableBodyScroll:P,handleTableHeaderScroll:k,setHeaderScrollLeft:w}}function tl(e){return typeof e=="object"&&typeof e.multiple=="number"?e.multiple:!1}function Q3(e,t){return t&&(e===void 0||e==="default"||typeof e=="object"&&e.compare==="default")?Z3(t):typeof e=="function"?e:e&&typeof e=="object"&&e.compare&&e.compare!=="default"?e.compare:!1}function Z3(e){return(t,n)=>{const s=t[e],i=n[e];return s==null?i==null?0:-1:i==null?1:typeof s=="number"&&typeof i=="number"?s-i:typeof s=="string"&&typeof i=="string"?s.localeCompare(i):0}}function eA(e,{dataRelatedColsRef:t,filteredDataRef:n}){const s=[];t.value.forEach(m=>{var y;m.sorter!==void 0&&g(s,{columnKey:m.key,sorter:m.sorter,order:(y=m.defaultSortOrder)!==null&&y!==void 0?y:!1})});const i=H(s),a=q(()=>{const m=t.value.filter(l=>l.type!=="selection"&&l.sorter!==void 0&&(l.sortOrder==="ascend"||l.sortOrder==="descend"||l.sortOrder===!1)),y=m.filter(l=>l.sortOrder!==!1);if(y.length)return y.map(l=>({columnKey:l.key,order:l.sortOrder,sorter:l.sorter}));if(m.length)return[];const{value:v}=i;return Array.isArray(v)?v:v?[v]:[]}),d=q(()=>{const m=a.value.slice().sort((y,v)=>{const l=tl(y.sorter)||0;return(tl(v.sorter)||0)-l});return m.length?n.value.slice().sort((v,l)=>{let h=0;return m.some(f=>{const{columnKey:_,sorter:S,order:k}=f,P=Q3(S,_);return P&&k&&(h=P(v.rawNode,l.rawNode),h!==0)?(h=h*GM(k),!0):!1}),h}):n.value});function r(m){let y=a.value.slice();return m&&tl(m.sorter)!==!1?(y=y.filter(v=>tl(v.sorter)!==!1),g(y,m),y):m||null}function o(m){const y=r(m);c(y)}function c(m){const{"onUpdate:sorter":y,onUpdateSorter:v,onSorterChange:l}=e;y&&Je(y,m),v&&Je(v,m),l&&Je(l,m),i.value=m}function p(m,y="ascend"){if(!m)u();else{const v=t.value.find(h=>h.type!=="selection"&&h.type!=="expand"&&h.key===m);if(!(v!=null&&v.sorter))return;const l=v.sorter;o({columnKey:m,sorter:l,order:y})}}function u(){c(null)}function g(m,y){const v=m.findIndex(l=>(y==null?void 0:y.columnKey)&&l.columnKey===y.columnKey);v!==void 0&&v>=0?m[v]=y:m.push(y)}return{clearSorter:u,sort:p,sortedDataRef:d,mergedSortStateRef:a,deriveNextSorter:o}}function tA(e,{dataRelatedColsRef:t}){const n=q(()=>{const j=G=>{for(let te=0;te{const{childrenKey:j}=e;return pc(e.data,{ignoreEmptyChildren:!0,getKey:e.rowKey,getChildren:G=>G[j],getDisabled:G=>{var te,oe;return!!(!((oe=(te=n.value)===null||te===void 0?void 0:te.disabled)===null||oe===void 0)&&oe.call(te,G))}})}),i=Zt(()=>{const{columns:j}=e,{length:G}=j;let te=null;for(let oe=0;oe{const j=t.value.filter(oe=>oe.filterOptionValues!==void 0||oe.filterOptionValue!==void 0),G={};return j.forEach(oe=>{var re;oe.type==="selection"||oe.type==="expand"||(oe.filterOptionValues===void 0?G[oe.key]=(re=oe.filterOptionValue)!==null&&re!==void 0?re:null:G[oe.key]=oe.filterOptionValues)}),Object.assign(dv(a.value),G)}),p=q(()=>{const j=c.value,{columns:G}=e;function te(ye){return(K,J)=>!!~String(J[ye]).indexOf(String(K))}const{value:{treeNodes:oe}}=s,re=[];return G.forEach(ye=>{ye.type==="selection"||ye.type==="expand"||"children"in ye||re.push([ye.key,ye])}),oe?oe.filter(ye=>{const{rawNode:K}=ye;for(const[J,Q]of re){let de=j[J];if(de==null||(Array.isArray(de)||(de=[de]),!de.length))continue;const De=Q.filter==="default"?te(J):Q.filter;if(Q&&typeof De=="function")if(Q.filterMode==="and"){if(de.some(Pe=>!De(Pe,K)))return!1}else{if(de.some(Pe=>De(Pe,K)))continue;return!1}}return!0}):[]}),{sortedDataRef:u,deriveNextSorter:g,mergedSortStateRef:m,sort:y,clearSorter:v}=eA(e,{dataRelatedColsRef:t,filteredDataRef:p});t.value.forEach(j=>{var G;if(j.filter){const te=j.defaultFilterOptionValues;j.filterMultiple?a.value[j.key]=te||[]:te!==void 0?a.value[j.key]=te===null?[]:te:a.value[j.key]=(G=j.defaultFilterOptionValue)!==null&&G!==void 0?G:null}});const l=q(()=>{const{pagination:j}=e;if(j!==!1)return j.page}),h=q(()=>{const{pagination:j}=e;if(j!==!1)return j.pageSize}),f=ss(l,r),_=ss(h,o),S=Zt(()=>{const j=f.value;return e.remote?j:Math.max(1,Math.min(Math.ceil(p.value.length/_.value),j))}),k=q(()=>{const{pagination:j}=e;if(j){const{pageCount:G}=j;if(G!==void 0)return G}}),P=q(()=>{if(e.remote)return s.value.treeNodes;if(!e.pagination)return u.value;const j=_.value,G=(S.value-1)*j;return u.value.slice(G,G+j)}),M=q(()=>P.value.map(j=>j.rawNode));function w(j){const{pagination:G}=e;if(G){const{onChange:te,"onUpdate:page":oe,onUpdatePage:re}=G;te&&Je(te,j),re&&Je(re,j),oe&&Je(oe,j),R(j)}}function T(j){const{pagination:G}=e;if(G){const{onPageSizeChange:te,"onUpdate:pageSize":oe,onUpdatePageSize:re}=G;te&&Je(te,j),re&&Je(re,j),oe&&Je(oe,j),D(j)}}const A=q(()=>{if(e.remote){const{pagination:j}=e;if(j){const{itemCount:G}=j;if(G!==void 0)return G}return}return p.value.length}),E=q(()=>Object.assign(Object.assign({},e.pagination),{onChange:void 0,onUpdatePage:void 0,onUpdatePageSize:void 0,onPageSizeChange:void 0,"onUpdate:page":w,"onUpdate:pageSize":T,page:S.value,pageSize:_.value,pageCount:A.value===void 0?k.value:void 0,itemCount:A.value}));function R(j){const{"onUpdate:page":G,onPageChange:te,onUpdatePage:oe}=e;oe&&Je(oe,j),G&&Je(G,j),te&&Je(te,j),r.value=j}function D(j){const{"onUpdate:pageSize":G,onPageSizeChange:te,onUpdatePageSize:oe}=e;te&&Je(te,j),oe&&Je(oe,j),G&&Je(G,j),o.value=j}function I(j,G){const{onUpdateFilters:te,"onUpdate:filters":oe,onFiltersChange:re}=e;te&&Je(te,j,G),oe&&Je(oe,j,G),re&&Je(re,j,G),a.value=j}function O(j,G,te,oe){var re;(re=e.onUnstableColumnResize)===null||re===void 0||re.call(e,j,G,te,oe)}function U(j){R(j)}function W(){N()}function N(){z({})}function z(j){V(j)}function V(j){j?j&&(a.value=dv(j)):a.value={}}return{treeMateRef:s,mergedCurrentPageRef:S,mergedPaginationRef:E,paginatedDataRef:P,rawPaginatedDataRef:M,mergedFilterStateRef:c,mergedSortStateRef:m,hoverKeyRef:H(null),selectionColumnRef:n,childTriggerColIndexRef:i,doUpdateFilters:I,deriveNextSorter:g,doUpdatePageSize:D,doUpdatePage:R,onUnstableColumnResize:O,filter:V,filters:z,clearFilter:W,clearFilters:N,clearSorter:v,page:U,sort:y}}const py=Ae({name:"DataTable",alias:["AdvancedTable"],props:qM,setup(e,{slots:t}){const{mergedBorderedRef:n,mergedClsPrefixRef:s,inlineThemeDisabled:i,mergedRtlRef:a}=mn(e),d=pi("DataTable",a,s),r=q(()=>{const{bottomBordered:se}=e;return n.value?!1:se!==void 0?se:!0}),o=Ht("DataTable","-data-table",K3,u0,e,s),c=H(null),p=H(null),{getResizableWidth:u,clearResizableWidth:g,doUpdateResizableWidth:m}=X3(),{rowsRef:y,colsRef:v,dataRelatedColsRef:l,hasEllipsisRef:h}=G3(e,u),{treeMateRef:f,mergedCurrentPageRef:_,paginatedDataRef:S,rawPaginatedDataRef:k,selectionColumnRef:P,hoverKeyRef:M,mergedPaginationRef:w,mergedFilterStateRef:T,mergedSortStateRef:A,childTriggerColIndexRef:E,doUpdatePage:R,doUpdateFilters:D,onUnstableColumnResize:I,deriveNextSorter:O,filter:U,filters:W,clearFilter:N,clearFilters:z,clearSorter:V,page:j,sort:G}=tA(e,{dataRelatedColsRef:l}),te=se=>{const{fileName:ge="data.csv",keepOriginalData:Oe=!1}=se||{},Ke=Oe?e.data:k.value,Be=t3(e.columns,Ke,e.getCsvCell,e.getCsvHeader),me=new Blob([Be],{type:"text/csv;charset=utf-8"}),Fe=URL.createObjectURL(me);HP(Fe,ge.endsWith(".csv")?ge:`${ge}.csv`),URL.revokeObjectURL(Fe)},{doCheckAll:oe,doUncheckAll:re,doCheck:ye,doUncheck:K,headerCheckboxDisabledRef:J,someRowsCheckedRef:Q,allRowsCheckedRef:de,mergedCheckedRowKeySetRef:De,mergedInderminateRowKeySetRef:Pe}=j3(e,{selectionColumnRef:P,treeMateRef:f,paginatedDataRef:S}),{stickyExpandedRowsRef:Ye,mergedExpandedRowKeysRef:st,renderExpandRef:yt,expandableRef:ce,doUpdateExpandedRowKeys:ae}=q3(e,f),{handleTableBodyScroll:be,handleTableHeaderScroll:he,syncScrollState:Le,setHeaderScrollLeft:et,leftActiveFixedColKeyRef:je,leftActiveFixedChildrenColKeysRef:_e,rightActiveFixedColKeyRef:ie,rightActiveFixedChildrenColKeysRef:we,leftFixedColumnsRef:Ee,rightFixedColumnsRef:x,fixedColumnLeftMapRef:Re,fixedColumnRightMapRef:Xe}=J3(e,{bodyWidthRef:c,mainTableInstRef:p,mergedCurrentPageRef:_}),{localeRef:Ue}=Qs("DataTable"),xt=q(()=>e.virtualScroll||e.flexHeight||e.maxHeight!==void 0||h.value?"fixed":e.tableLayout);kn(Zs,{props:e,treeMateRef:f,renderExpandIconRef:ct(e,"renderExpandIcon"),loadingKeySetRef:H(new Set),slots:t,indentRef:ct(e,"indent"),childTriggerColIndexRef:E,bodyWidthRef:c,componentId:Mu(),hoverKeyRef:M,mergedClsPrefixRef:s,mergedThemeRef:o,scrollXRef:q(()=>e.scrollX),rowsRef:y,colsRef:v,paginatedDataRef:S,leftActiveFixedColKeyRef:je,leftActiveFixedChildrenColKeysRef:_e,rightActiveFixedColKeyRef:ie,rightActiveFixedChildrenColKeysRef:we,leftFixedColumnsRef:Ee,rightFixedColumnsRef:x,fixedColumnLeftMapRef:Re,fixedColumnRightMapRef:Xe,mergedCurrentPageRef:_,someRowsCheckedRef:Q,allRowsCheckedRef:de,mergedSortStateRef:A,mergedFilterStateRef:T,loadingRef:ct(e,"loading"),rowClassNameRef:ct(e,"rowClassName"),mergedCheckedRowKeySetRef:De,mergedExpandedRowKeysRef:st,mergedInderminateRowKeySetRef:Pe,localeRef:Ue,expandableRef:ce,stickyExpandedRowsRef:Ye,rowKeyRef:ct(e,"rowKey"),renderExpandRef:yt,summaryRef:ct(e,"summary"),virtualScrollRef:ct(e,"virtualScroll"),virtualScrollXRef:ct(e,"virtualScrollX"),heightForRowRef:ct(e,"heightForRow"),minRowHeightRef:ct(e,"minRowHeight"),virtualScrollHeaderRef:ct(e,"virtualScrollHeader"),headerHeightRef:ct(e,"headerHeight"),rowPropsRef:ct(e,"rowProps"),stripedRef:ct(e,"striped"),checkOptionsRef:q(()=>{const{value:se}=P;return se==null?void 0:se.options}),rawPaginatedDataRef:k,filterMenuCssVarsRef:q(()=>{const{self:{actionDividerColor:se,actionPadding:ge,actionButtonMargin:Oe}}=o.value;return{"--n-action-padding":ge,"--n-action-button-margin":Oe,"--n-action-divider-color":se}}),onLoadRef:ct(e,"onLoad"),mergedTableLayoutRef:xt,maxHeightRef:ct(e,"maxHeight"),minHeightRef:ct(e,"minHeight"),flexHeightRef:ct(e,"flexHeight"),headerCheckboxDisabledRef:J,paginationBehaviorOnFilterRef:ct(e,"paginationBehaviorOnFilter"),summaryPlacementRef:ct(e,"summaryPlacement"),filterIconPopoverPropsRef:ct(e,"filterIconPopoverProps"),scrollbarPropsRef:ct(e,"scrollbarProps"),syncScrollState:Le,doUpdatePage:R,doUpdateFilters:D,getResizableWidth:u,onUnstableColumnResize:I,clearResizableWidth:g,doUpdateResizableWidth:m,deriveNextSorter:O,doCheck:ye,doUncheck:K,doCheckAll:oe,doUncheckAll:re,doUpdateExpandedRowKeys:ae,handleTableHeaderScroll:he,handleTableBodyScroll:be,setHeaderScrollLeft:et,renderCell:ct(e,"renderCell")});const Ze={filter:U,filters:W,clearFilters:z,clearSorter:V,page:j,sort:G,clearFilter:N,downloadCsv:te,scrollTo:(se,ge)=>{var Oe;(Oe=p.value)===null||Oe===void 0||Oe.scrollTo(se,ge)}},wt=q(()=>{const{size:se}=e,{common:{cubicBezierEaseInOut:ge},self:{borderColor:Oe,tdColorHover:Ke,tdColorSorting:Be,tdColorSortingModal:me,tdColorSortingPopover:Fe,thColorSorting:fe,thColorSortingModal:nt,thColorSortingPopover:At,thColor:St,thColorHover:xe,tdColor:qe,tdTextColor:ht,thTextColor:Et,thFontWeight:jt,thButtonColorHover:Kt,thIconColor:Yt,thIconColorActive:nn,filterSize:rn,borderRadius:Mn,lineHeight:xn,tdColorModal:Xt,thColorModal:Gt,borderColorModal:Qt,thColorHoverModal:an,tdColorHoverModal:Ot,borderColorPopover:jn,thColorPopover:is,tdColorPopover:An,tdColorHoverPopover:Pn,thColorHoverPopover:Rn,paginationMargin:In,emptyPadding:ke,boxShadowAfter:Qe,boxShadowBefore:ft,sorterSize:It,resizableContainerSize:ln,resizableSize:Nt,loadingColor:En,loadingSize:qn,opacityLoading:Ln,tdColorStriped:Ts,tdColorStripedModal:Ws,tdColorStripedPopover:ei,[Mt("fontSize",se)]:ti,[Mt("thPadding",se)]:Ps,[Mt("tdPadding",se)]:gi}}=o.value;return{"--n-font-size":ti,"--n-th-padding":Ps,"--n-td-padding":gi,"--n-bezier":ge,"--n-border-radius":Mn,"--n-line-height":xn,"--n-border-color":Oe,"--n-border-color-modal":Qt,"--n-border-color-popover":jn,"--n-th-color":St,"--n-th-color-hover":xe,"--n-th-color-modal":Gt,"--n-th-color-hover-modal":an,"--n-th-color-popover":is,"--n-th-color-hover-popover":Rn,"--n-td-color":qe,"--n-td-color-hover":Ke,"--n-td-color-modal":Xt,"--n-td-color-hover-modal":Ot,"--n-td-color-popover":An,"--n-td-color-hover-popover":Pn,"--n-th-text-color":Et,"--n-td-text-color":ht,"--n-th-font-weight":jt,"--n-th-button-color-hover":Kt,"--n-th-icon-color":Yt,"--n-th-icon-color-active":nn,"--n-filter-size":rn,"--n-pagination-margin":In,"--n-empty-padding":ke,"--n-box-shadow-before":ft,"--n-box-shadow-after":Qe,"--n-sorter-size":It,"--n-resizable-container-size":ln,"--n-resizable-size":Nt,"--n-loading-size":qn,"--n-loading-color":En,"--n-opacity-loading":Ln,"--n-td-color-striped":Ts,"--n-td-color-striped-modal":Ws,"--n-td-color-striped-popover":ei,"n-td-color-sorting":Be,"n-td-color-sorting-modal":me,"n-td-color-sorting-popover":Fe,"n-th-color-sorting":fe,"n-th-color-sorting-modal":nt,"n-th-color-sorting-popover":At}}),tt=i?Un("data-table",q(()=>e.size[0]),wt,e):void 0,gt=q(()=>{if(!e.pagination)return!1;if(e.paginateSinglePage)return!0;const se=w.value,{pageCount:ge}=se;return ge!==void 0?ge>1:se.itemCount&&se.pageSize&&se.itemCount>se.pageSize});return Object.assign({mainTableInstRef:p,mergedClsPrefix:s,rtlEnabled:d,mergedTheme:o,paginatedData:S,mergedBordered:n,mergedBottomBordered:r,mergedPagination:w,mergedShowPagination:gt,cssVars:i?void 0:wt,themeClass:tt==null?void 0:tt.themeClass,onRender:tt==null?void 0:tt.onRender},Ze)},render(){const{mergedClsPrefix:e,themeClass:t,onRender:n,$slots:s,spinProps:i}=this;return n==null||n(),B("div",{class:[`${e}-data-table`,this.rtlEnabled&&`${e}-data-table--rtl`,t,{[`${e}-data-table--bordered`]:this.mergedBordered,[`${e}-data-table--bottom-bordered`]:this.mergedBottomBordered,[`${e}-data-table--single-line`]:this.singleLine,[`${e}-data-table--single-column`]:this.singleColumn,[`${e}-data-table--loading`]:this.loading,[`${e}-data-table--flex-height`]:this.flexHeight}],style:this.cssVars},B("div",{class:`${e}-data-table-wrapper`},B(V3,{ref:"mainTableInstRef"})),this.mergedShowPagination?B("div",{class:`${e}-data-table__pagination`},B(jM,Object.assign({theme:this.mergedTheme.peers.Pagination,themeOverrides:this.mergedTheme.peerOverrides.Pagination,disabled:this.loading},this.mergedPagination))):null,B(ks,{name:"fade-in-scale-up-transition"},{default:()=>this.loading?B("div",{class:`${e}-data-table-loading-wrapper`},Jt(s.loading,()=>[B(tc,Object.assign({clsPrefix:e,strokeWidth:20},i))])):null}))}}),gc=ds("n-date-picker"),$r=40,nA="HH:mm:ss",vy={active:Boolean,dateFormat:String,calendarDayFormat:String,calendarHeaderYearFormat:String,calendarHeaderMonthFormat:String,calendarHeaderMonthYearSeparator:{type:String,required:!0},calendarHeaderMonthBeforeYear:{type:Boolean,default:void 0},timerPickerFormat:{type:String,value:nA},value:{type:[Array,Number],default:null},shortcuts:Object,defaultTime:[Number,String,Array],inputReadonly:Boolean,onClear:Function,onConfirm:Function,onClose:Function,onTabOut:Function,onKeydown:Function,actions:Array,onUpdateValue:{type:Function,required:!0},themeClass:String,onRender:Function,panel:Boolean,onNextMonth:Function,onPrevMonth:Function,onNextYear:Function,onPrevYear:Function};function gy(e){const{dateLocaleRef:t,timePickerSizeRef:n,timePickerPropsRef:s,localeRef:i,mergedClsPrefixRef:a,mergedThemeRef:d}=Ut(gc),r=q(()=>({locale:t.value.locale})),o=H(null),c=sh();function p(){const{onClear:R}=e;R&&R()}function u(){const{onConfirm:R,value:D}=e;R&&R(D)}function g(R,D){const{onUpdateValue:I}=e;I(R,D)}function m(R=!1){const{onClose:D}=e;D&&D(R)}function y(){const{onTabOut:R}=e;R&&R()}function v(){g(null,!0),m(!0),p()}function l(){y()}function h(){(e.active||e.panel)&&un(()=>{const{value:R}=o;if(!R)return;const D=R.querySelectorAll("[data-n-date]");D.forEach(I=>{I.classList.add("transition-disabled")}),R.offsetWidth,D.forEach(I=>{I.classList.remove("transition-disabled")})})}function f(R){R.key==="Tab"&&R.target===o.value&&c.shift&&(R.preventDefault(),y())}function _(R){const{value:D}=o;c.tab&&R.target===D&&(D!=null&&D.contains(R.relatedTarget))&&y()}let S=null,k=!1;function P(){S=e.value,k=!0}function M(){k=!1}function w(){k&&(g(S,!1),k=!1)}function T(R){return typeof R=="function"?R():R}const A=H(!1);function E(){A.value=!A.value}return{mergedTheme:d,mergedClsPrefix:a,dateFnsOptions:r,timePickerSize:n,timePickerProps:s,selfRef:o,locale:i,doConfirm:u,doClose:m,doUpdateValue:g,doTabOut:y,handleClearClick:v,handleFocusDetectorFocus:l,disableTransitionOneTick:h,handlePanelKeyDown:f,handlePanelFocus:_,cachePendingValue:P,clearPendingValue:M,restorePendingValue:w,getShortcutValue:T,handleShortcutMouseleave:w,showMonthYearPanel:A,handleOpenQuickSelectMonthPanel:E}}const bh=Object.assign(Object.assign({},vy),{defaultCalendarStartTime:Number,actions:{type:Array,default:()=>["now","clear","confirm"]}});function wh(e,t){var n;const s=gy(e),{isValueInvalidRef:i,isDateDisabledRef:a,isDateInvalidRef:d,isTimeInvalidRef:r,isDateTimeInvalidRef:o,isHourDisabledRef:c,isMinuteDisabledRef:p,isSecondDisabledRef:u,localeRef:g,firstDayOfWeekRef:m,datePickerSlots:y,yearFormatRef:v,monthFormatRef:l,quarterFormatRef:h,yearRangeRef:f}=Ut(gc),_={isValueInvalid:i,isDateDisabled:a,isDateInvalid:d,isTimeInvalid:r,isDateTimeInvalid:o,isHourDisabled:c,isMinuteDisabled:p,isSecondDisabled:u},S=q(()=>e.dateFormat||g.value.dateFormat),k=q(()=>e.calendarDayFormat||g.value.dayFormat),P=H(e.value===null||Array.isArray(e.value)?"":dn(e.value,S.value)),M=H(e.value===null||Array.isArray(e.value)?(n=e.defaultCalendarStartTime)!==null&&n!==void 0?n:Date.now():e.value),w=H(null),T=H(null),A=H(null),E=H(Date.now()),R=q(()=>{var x;return uu(M.value,e.value,E.value,(x=m.value)!==null&&x!==void 0?x:g.value.firstDayOfWeek,!1,t==="week")}),D=q(()=>{const{value:x}=e;return hu(M.value,Array.isArray(x)?null:x,E.value,{monthFormat:l.value})}),I=q(()=>{const{value:x}=e;return pu(Array.isArray(x)?null:x,E.value,{yearFormat:v.value},f)}),O=q(()=>{const{value:x}=e;return fu(M.value,Array.isArray(x)?null:x,E.value,{quarterFormat:h.value})}),U=q(()=>R.value.slice(0,7).map(x=>{const{ts:Re}=x;return dn(Re,k.value,s.dateFnsOptions.value)})),W=q(()=>dn(M.value,e.calendarHeaderMonthFormat||g.value.monthFormat,s.dateFnsOptions.value)),N=q(()=>dn(M.value,e.calendarHeaderYearFormat||g.value.yearFormat,s.dateFnsOptions.value)),z=q(()=>{var x;return(x=e.calendarHeaderMonthBeforeYear)!==null&&x!==void 0?x:g.value.monthBeforeYear});_t(M,(x,Re)=>{(t==="date"||t==="datetime")&&(Pa(x,Re)||s.disableTransitionOneTick())}),_t(q(()=>e.value),x=>{x!==null&&!Array.isArray(x)?(P.value=dn(x,S.value,s.dateFnsOptions.value),M.value=x):P.value=""});function V(x){var Re;if(t==="datetime")return ut(ph(x));if(t==="month")return ut(ki(x));if(t==="year")return ut(Ta(x));if(t==="quarter")return ut(ya(x));if(t==="week"){const Xe=(((Re=m.value)!==null&&Re!==void 0?Re:g.value.firstDayOfWeek)+1)%7;return ut(Ai(x,{weekStartsOn:Xe}))}return ut(_o(x))}function j(x,Re){const{isDateDisabled:{value:Xe}}=_;return Xe?Xe(x,Re):!1}function G(x){const Re=Cs(x,S.value,new Date,s.dateFnsOptions.value);if(zs(Re)){if(e.value===null)s.doUpdateValue(ut(V(Date.now())),e.panel);else if(!Array.isArray(e.value)){const Xe=ts(e.value,{year:Tn(Re),month:yn(Re),date:Hs(Re)});s.doUpdateValue(ut(V(ut(Xe))),e.panel)}}else P.value=x}function te(){const x=Cs(P.value,S.value,new Date,s.dateFnsOptions.value);if(zs(x)){if(e.value===null)s.doUpdateValue(ut(V(Date.now())),!1);else if(!Array.isArray(e.value)){const Re=ts(e.value,{year:Tn(x),month:yn(x),date:Hs(x)});s.doUpdateValue(ut(V(ut(Re))),!1)}}else Pe()}function oe(){s.doUpdateValue(null,!0),P.value="",s.doClose(!0),s.handleClearClick()}function re(){s.doUpdateValue(ut(V(Date.now())),!0);const x=Date.now();M.value=x,s.doClose(!0),e.panel&&(t==="month"||t==="quarter"||t==="year")&&(s.disableTransitionOneTick(),we(x))}const ye=H(null);function K(x){x.type==="date"&&t==="week"&&(ye.value=V(ut(x.ts)))}function J(x){return x.type==="date"&&t==="week"?V(ut(x.ts))===ye.value:!1}function Q(x){if(j(x.ts,x.type==="date"?{type:"date",year:x.dateObject.year,month:x.dateObject.month,date:x.dateObject.date}:x.type==="month"?{type:"month",year:x.dateObject.year,month:x.dateObject.month}:x.type==="year"?{type:"year",year:x.dateObject.year}:{type:"quarter",year:x.dateObject.year,quarter:x.dateObject.quarter}))return;let Re;if(e.value!==null&&!Array.isArray(e.value)?Re=e.value:Re=Date.now(),t==="datetime"&&e.defaultTime!==null&&!Array.isArray(e.defaultTime)){const Xe=ml(e.defaultTime);Xe&&(Re=ut(ts(Re,Xe)))}switch(Re=ut(x.type==="quarter"&&x.dateObject.quarter?CM(du(Re,x.dateObject.year),x.dateObject.quarter):ts(Re,x.dateObject)),s.doUpdateValue(V(Re),e.panel||t==="date"||t==="week"||t==="year"),t){case"date":case"week":s.doClose();break;case"year":e.panel&&s.disableTransitionOneTick(),s.doClose();break;case"month":s.disableTransitionOneTick(),we(Re);break;case"quarter":s.disableTransitionOneTick(),we(Re);break}}function de(x,Re){let Xe;e.value!==null&&!Array.isArray(e.value)?Xe=e.value:Xe=Date.now(),Xe=ut(x.type==="month"?vh(Xe,x.dateObject.month):du(Xe,x.dateObject.year)),Re(Xe),we(Xe)}function De(x){M.value=x}function Pe(x){if(e.value===null||Array.isArray(e.value)){P.value="";return}x===void 0&&(x=e.value),P.value=dn(x,S.value,s.dateFnsOptions.value)}function Ye(){_.isDateInvalid.value||_.isTimeInvalid.value||(s.doConfirm(),st())}function st(){e.active&&s.doClose()}function yt(){var x;M.value=ut(au(M.value,1)),(x=e.onNextYear)===null||x===void 0||x.call(e)}function ce(){var x;M.value=ut(au(M.value,-1)),(x=e.onPrevYear)===null||x===void 0||x.call(e)}function ae(){var x;M.value=ut(es(M.value,1)),(x=e.onNextMonth)===null||x===void 0||x.call(e)}function be(){var x;M.value=ut(es(M.value,-1)),(x=e.onPrevMonth)===null||x===void 0||x.call(e)}function he(){const{value:x}=w;return(x==null?void 0:x.listElRef)||null}function Le(){const{value:x}=w;return(x==null?void 0:x.itemsElRef)||null}function et(){var x;(x=T.value)===null||x===void 0||x.sync()}function je(x){x!==null&&s.doUpdateValue(x,e.panel)}function _e(x){s.cachePendingValue();const Re=s.getShortcutValue(x);typeof Re=="number"&&s.doUpdateValue(Re,!1)}function ie(x){const Re=s.getShortcutValue(x);typeof Re=="number"&&(s.doUpdateValue(Re,e.panel),s.clearPendingValue(),Ye())}function we(x){const{value:Re}=e;if(A.value){const Xe=yn(x===void 0?Re===null?Date.now():Re:x);A.value.scrollTo({top:Xe*$r})}if(w.value){const Xe=Tn(x===void 0?Re===null?Date.now():Re:x)-f.value[0];w.value.scrollTo({top:Xe*$r})}}const Ee={monthScrollbarRef:A,yearScrollbarRef:T,yearVlRef:w};return Object.assign(Object.assign(Object.assign(Object.assign({dateArray:R,monthArray:D,yearArray:I,quarterArray:O,calendarYear:N,calendarMonth:W,weekdays:U,calendarMonthBeforeYear:z,mergedIsDateDisabled:j,nextYear:yt,prevYear:ce,nextMonth:ae,prevMonth:be,handleNowClick:re,handleConfirmClick:Ye,handleSingleShortcutMouseenter:_e,handleSingleShortcutClick:ie},_),s),Ee),{handleDateClick:Q,handleDateInputBlur:te,handleDateInput:G,handleDateMouseEnter:K,isWeekHovered:J,handleTimePickerChange:je,clearSelectedDateTime:oe,virtualListContainer:he,virtualListContent:Le,handleVirtualListScroll:et,timePickerSize:s.timePickerSize,dateInputValue:P,datePickerSlots:y,handleQuickMonthClick:de,justifyColumnsScrollState:we,calendarValue:M,onUpdateCalendarValue:De})}const my=Ae({name:"MonthPanel",props:Object.assign(Object.assign({},bh),{type:{type:String,required:!0},useAsQuickJump:Boolean}),setup(e){const t=wh(e,e.type),{dateLocaleRef:n}=Qs("DatePicker"),s=d=>{switch(d.type){case"year":return q_(d.dateObject.year,d.yearFormat,n.value.locale);case"month":return j_(d.dateObject.month,d.monthFormat,n.value.locale);case"quarter":return Y_(d.dateObject.quarter,d.quarterFormat,n.value.locale)}},{useAsQuickJump:i}=e,a=(d,r,o)=>{const{mergedIsDateDisabled:c,handleDateClick:p,handleQuickMonthClick:u}=t;return B("div",{"data-n-date":!0,key:r,class:[`${o}-date-panel-month-calendar__picker-col-item`,d.isCurrent&&`${o}-date-panel-month-calendar__picker-col-item--current`,d.selected&&`${o}-date-panel-month-calendar__picker-col-item--selected`,!i&&c(d.ts,d.type==="year"?{type:"year",year:d.dateObject.year}:d.type==="month"?{type:"month",year:d.dateObject.year,month:d.dateObject.month}:d.type==="quarter"?{type:"month",year:d.dateObject.year,month:d.dateObject.quarter}:null)&&`${o}-date-panel-month-calendar__picker-col-item--disabled`],onClick:()=>{i?u(d,g=>{e.onUpdateValue(g,!1)}):p(d)}},s(d))};return Dt(()=>{t.justifyColumnsScrollState()}),Object.assign(Object.assign({},t),{renderItem:a})},render(){const{mergedClsPrefix:e,mergedTheme:t,shortcuts:n,actions:s,renderItem:i,type:a,onRender:d}=this;return d==null||d(),B("div",{ref:"selfRef",tabindex:0,class:[`${e}-date-panel`,`${e}-date-panel--month`,!this.panel&&`${e}-date-panel--shadow`,this.themeClass],onFocus:this.handlePanelFocus,onKeydown:this.handlePanelKeyDown},B("div",{class:`${e}-date-panel-month-calendar`},B(As,{ref:"yearScrollbarRef",class:`${e}-date-panel-month-calendar__picker-col`,theme:t.peers.Scrollbar,themeOverrides:t.peerOverrides.Scrollbar,container:this.virtualListContainer,content:this.virtualListContent,horizontalRailStyle:{zIndex:1},verticalRailStyle:{zIndex:1}},{default:()=>B(go,{ref:"yearVlRef",items:this.yearArray,itemSize:$r,showScrollbar:!1,keyField:"ts",onScroll:this.handleVirtualListScroll,paddingBottom:4},{default:({item:r,index:o})=>i(r,o,e)})}),a==="month"||a==="quarter"?B("div",{class:`${e}-date-panel-month-calendar__picker-col`},B(As,{ref:"monthScrollbarRef",theme:t.peers.Scrollbar,themeOverrides:t.peerOverrides.Scrollbar},{default:()=>[(a==="month"?this.monthArray:this.quarterArray).map((r,o)=>i(r,o,e)),B("div",{class:`${e}-date-panel-${a}-calendar__padding`})]})):null),this.datePickerSlots.footer?B("div",{class:`${e}-date-panel-footer`},{default:this.datePickerSlots.footer}):null,s!=null&&s.length||n?B("div",{class:`${e}-date-panel-actions`},B("div",{class:`${e}-date-panel-actions__prefix`},n&&Object.keys(n).map(r=>{const o=n[r];return Array.isArray(o)?null:B(fi,{size:"tiny",onMouseenter:()=>{this.handleSingleShortcutMouseenter(o)},onClick:()=>{this.handleSingleShortcutClick(o)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>r})})),B("div",{class:`${e}-date-panel-actions__suffix`},s!=null&&s.includes("clear")?xs(this.$slots.now,{onClear:this.handleClearClick,text:this.locale.clear},()=>[B(gn,{theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,size:"tiny",onClick:this.handleClearClick},{default:()=>this.locale.clear})]):null,s!=null&&s.includes("now")?xs(this.$slots.now,{onNow:this.handleNowClick,text:this.locale.now},()=>[B(gn,{theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,size:"tiny",onClick:this.handleNowClick},{default:()=>this.locale.now})]):null,s!=null&&s.includes("confirm")?xs(this.$slots.confirm,{onConfirm:this.handleConfirmClick,disabled:this.isDateInvalid,text:this.locale.confirm},()=>[B(gn,{theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,size:"tiny",type:"primary",disabled:this.isDateInvalid,onClick:this.handleConfirmClick},{default:()=>this.locale.confirm})]):null)):null,B(lr,{onFocus:this.handleFocusDetectorFocus}))}}),yo=Ae({props:{mergedClsPrefix:{type:String,required:!0},value:Number,monthBeforeYear:{type:Boolean,required:!0},monthYearSeparator:{type:String,required:!0},calendarMonth:{type:String,required:!0},calendarYear:{type:String,required:!0},onUpdateValue:{type:Function,required:!0}},setup(){const e=H(null),t=H(null),n=H(!1);function s(a){var d;n.value&&!(!((d=e.value)===null||d===void 0)&&d.contains(Dr(a)))&&(n.value=!1)}function i(){n.value=!n.value}return{show:n,triggerRef:e,monthPanelRef:t,handleHeaderClick:i,handleClickOutside:s}},render(){const{handleClickOutside:e,mergedClsPrefix:t}=this;return B("div",{class:`${t}-date-panel-month__month-year`,ref:"triggerRef"},B(Ro,null,{default:()=>[B(To,null,{default:()=>B("div",{class:[`${t}-date-panel-month__text`,this.show&&`${t}-date-panel-month__text--active`],onClick:this.handleHeaderClick},this.monthBeforeYear?[this.calendarMonth,this.monthYearSeparator,this.calendarYear]:[this.calendarYear,this.monthYearSeparator,this.calendarMonth])}),B(Po,{show:this.show,teleportDisabled:!0},{default:()=>B(ks,{name:"fade-in-scale-up-transition",appear:!0},{default:()=>this.show?rt(B(my,{ref:"monthPanelRef",onUpdateValue:this.onUpdateValue,actions:[],calendarHeaderMonthYearSeparator:this.monthYearSeparator,type:"month",key:"month",useAsQuickJump:!0,value:this.value}),[[Ar,e,void 0,{capture:!0}]]):null})})]}))}}),sA=Ae({name:"DatePanel",props:Object.assign(Object.assign({},bh),{type:{type:String,required:!0}}),setup(e){return wh(e,e.type)},render(){var e,t,n;const{mergedClsPrefix:s,mergedTheme:i,shortcuts:a,onRender:d,$slots:r,type:o}=this;return d==null||d(),B("div",{ref:"selfRef",tabindex:0,class:[`${s}-date-panel`,`${s}-date-panel--${o}`,!this.panel&&`${s}-date-panel--shadow`,this.themeClass],onFocus:this.handlePanelFocus,onKeydown:this.handlePanelKeyDown},B("div",{class:`${s}-date-panel-calendar`},B("div",{class:`${s}-date-panel-month`},B("div",{class:`${s}-date-panel-month__fast-prev`,onClick:this.prevYear},Jt(r["prev-year"],()=>[B(ir,null)])),B("div",{class:`${s}-date-panel-month__prev`,onClick:this.prevMonth},Jt(r["prev-month"],()=>[B(sr,null)])),B(yo,{monthYearSeparator:this.calendarHeaderMonthYearSeparator,monthBeforeYear:this.calendarMonthBeforeYear,value:this.calendarValue,onUpdateValue:this.onUpdateCalendarValue,mergedClsPrefix:s,calendarMonth:this.calendarMonth,calendarYear:this.calendarYear}),B("div",{class:`${s}-date-panel-month__next`,onClick:this.nextMonth},Jt(r["next-month"],()=>[B(or,null)])),B("div",{class:`${s}-date-panel-month__fast-next`,onClick:this.nextYear},Jt(r["next-year"],()=>[B(rr,null)]))),B("div",{class:`${s}-date-panel-weekdays`},this.weekdays.map(c=>B("div",{key:c,class:`${s}-date-panel-weekdays__day`},c))),B("div",{class:`${s}-date-panel-dates`},this.dateArray.map((c,p)=>B("div",{"data-n-date":!0,key:p,class:[`${s}-date-panel-date`,{[`${s}-date-panel-date--current`]:c.isCurrentDate,[`${s}-date-panel-date--selected`]:c.selected,[`${s}-date-panel-date--excluded`]:!c.inCurrentMonth,[`${s}-date-panel-date--disabled`]:this.mergedIsDateDisabled(c.ts,{type:"date",year:c.dateObject.year,month:c.dateObject.month,date:c.dateObject.date}),[`${s}-date-panel-date--week-hovered`]:this.isWeekHovered(c),[`${s}-date-panel-date--week-selected`]:c.inSelectedWeek}],onClick:()=>{this.handleDateClick(c)},onMouseenter:()=>{this.handleDateMouseEnter(c)}},B("div",{class:`${s}-date-panel-date__trigger`}),c.dateObject.date,c.isCurrentDate?B("div",{class:`${s}-date-panel-date__sup`}):null)))),this.datePickerSlots.footer?B("div",{class:`${s}-date-panel-footer`},this.datePickerSlots.footer()):null,!((e=this.actions)===null||e===void 0)&&e.length||a?B("div",{class:`${s}-date-panel-actions`},B("div",{class:`${s}-date-panel-actions__prefix`},a&&Object.keys(a).map(c=>{const p=a[c];return Array.isArray(p)?null:B(fi,{size:"tiny",onMouseenter:()=>{this.handleSingleShortcutMouseenter(p)},onClick:()=>{this.handleSingleShortcutClick(p)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>c})})),B("div",{class:`${s}-date-panel-actions__suffix`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?xs(this.$slots.clear,{onClear:this.handleClearClick,text:this.locale.clear},()=>[B(gn,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",onClick:this.handleClearClick},{default:()=>this.locale.clear})]):null,!((n=this.actions)===null||n===void 0)&&n.includes("now")?xs(this.$slots.now,{onNow:this.handleNowClick,text:this.locale.now},()=>[B(gn,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",onClick:this.handleNowClick},{default:()=>this.locale.now})]):null)):null,B(lr,{onFocus:this.handleFocusDetectorFocus}))}}),Sh=Object.assign(Object.assign({},vy),{defaultCalendarStartTime:Number,defaultCalendarEndTime:Number,bindCalendarMonths:Boolean,actions:{type:Array,default:()=>["clear","confirm"]}});function Ch(e,t){var n,s;const{isDateDisabledRef:i,isStartHourDisabledRef:a,isEndHourDisabledRef:d,isStartMinuteDisabledRef:r,isEndMinuteDisabledRef:o,isStartSecondDisabledRef:c,isEndSecondDisabledRef:p,isStartDateInvalidRef:u,isEndDateInvalidRef:g,isStartTimeInvalidRef:m,isEndTimeInvalidRef:y,isStartValueInvalidRef:v,isEndValueInvalidRef:l,isRangeInvalidRef:h,localeRef:f,rangesRef:_,closeOnSelectRef:S,updateValueOnCloseRef:k,firstDayOfWeekRef:P,datePickerSlots:M,monthFormatRef:w,yearFormatRef:T,quarterFormatRef:A,yearRangeRef:E}=Ut(gc),R={isDateDisabled:i,isStartHourDisabled:a,isEndHourDisabled:d,isStartMinuteDisabled:r,isEndMinuteDisabled:o,isStartSecondDisabled:c,isEndSecondDisabled:p,isStartDateInvalid:u,isEndDateInvalid:g,isStartTimeInvalid:m,isEndTimeInvalid:y,isStartValueInvalid:v,isEndValueInvalid:l,isRangeInvalid:h},D=gy(e),I=H(null),O=H(null),U=H(null),W=H(null),N=H(null),z=H(null),V=H(null),j=H(null),{value:G}=e,te=(n=e.defaultCalendarStartTime)!==null&&n!==void 0?n:Array.isArray(G)&&typeof G[0]=="number"?G[0]:Date.now(),oe=H(te),re=H((s=e.defaultCalendarEndTime)!==null&&s!==void 0?s:Array.isArray(G)&&typeof G[1]=="number"?G[1]:ut(es(te,1)));Ze(!0);const ye=H(Date.now()),K=H(!1),J=H(0),Q=q(()=>e.dateFormat||f.value.dateFormat),de=q(()=>e.calendarDayFormat||f.value.dayFormat),De=H(Array.isArray(G)?dn(G[0],Q.value,D.dateFnsOptions.value):""),Pe=H(Array.isArray(G)?dn(G[1],Q.value,D.dateFnsOptions.value):""),Ye=q(()=>K.value?"end":"start"),st=q(()=>{var ke;return uu(oe.value,e.value,ye.value,(ke=P.value)!==null&&ke!==void 0?ke:f.value.firstDayOfWeek)}),yt=q(()=>{var ke;return uu(re.value,e.value,ye.value,(ke=P.value)!==null&&ke!==void 0?ke:f.value.firstDayOfWeek)}),ce=q(()=>st.value.slice(0,7).map(ke=>{const{ts:Qe}=ke;return dn(Qe,de.value,D.dateFnsOptions.value)})),ae=q(()=>dn(oe.value,e.calendarHeaderMonthFormat||f.value.monthFormat,D.dateFnsOptions.value)),be=q(()=>dn(re.value,e.calendarHeaderMonthFormat||f.value.monthFormat,D.dateFnsOptions.value)),he=q(()=>dn(oe.value,e.calendarHeaderYearFormat||f.value.yearFormat,D.dateFnsOptions.value)),Le=q(()=>dn(re.value,e.calendarHeaderYearFormat||f.value.yearFormat,D.dateFnsOptions.value)),et=q(()=>{const{value:ke}=e;return Array.isArray(ke)?ke[0]:null}),je=q(()=>{const{value:ke}=e;return Array.isArray(ke)?ke[1]:null}),_e=q(()=>{const{shortcuts:ke}=e;return ke||_.value}),ie=q(()=>pu(Yr(e.value,"start"),ye.value,{yearFormat:T.value},E)),we=q(()=>pu(Yr(e.value,"end"),ye.value,{yearFormat:T.value},E)),Ee=q(()=>{const ke=Yr(e.value,"start");return fu(ke??Date.now(),ke,ye.value,{quarterFormat:A.value})}),x=q(()=>{const ke=Yr(e.value,"end");return fu(ke??Date.now(),ke,ye.value,{quarterFormat:A.value})}),Re=q(()=>{const ke=Yr(e.value,"start");return hu(ke??Date.now(),ke,ye.value,{monthFormat:w.value})}),Xe=q(()=>{const ke=Yr(e.value,"end");return hu(ke??Date.now(),ke,ye.value,{monthFormat:w.value})}),Ue=q(()=>{var ke;return(ke=e.calendarHeaderMonthBeforeYear)!==null&&ke!==void 0?ke:f.value.monthBeforeYear});_t(q(()=>e.value),ke=>{if(ke!==null&&Array.isArray(ke)){const[Qe,ft]=ke;De.value=dn(Qe,Q.value,D.dateFnsOptions.value),Pe.value=dn(ft,Q.value,D.dateFnsOptions.value),K.value||nt(ke)}else De.value="",Pe.value=""});function xt(ke,Qe){(t==="daterange"||t==="datetimerange")&&(Tn(ke)!==Tn(Qe)||yn(ke)!==yn(Qe))&&D.disableTransitionOneTick()}_t(oe,xt),_t(re,xt);function Ze(ke){const Qe=ki(oe.value),ft=ki(re.value);(e.bindCalendarMonths||Qe>=ft)&&(ke?re.value=ut(es(Qe,1)):oe.value=ut(es(ft,-1)))}function wt(){oe.value=ut(es(oe.value,12)),Ze(!0)}function tt(){oe.value=ut(es(oe.value,-12)),Ze(!0)}function gt(){oe.value=ut(es(oe.value,1)),Ze(!0)}function se(){oe.value=ut(es(oe.value,-1)),Ze(!0)}function ge(){re.value=ut(es(re.value,12)),Ze(!1)}function Oe(){re.value=ut(es(re.value,-12)),Ze(!1)}function Ke(){re.value=ut(es(re.value,1)),Ze(!1)}function Be(){re.value=ut(es(re.value,-1)),Ze(!1)}function me(ke){oe.value=ke,Ze(!0)}function Fe(ke){re.value=ke,Ze(!1)}function fe(ke){const Qe=i.value;if(!Qe)return!1;if(!Array.isArray(e.value)||Ye.value==="start")return Qe(ke,"start",null);{const{value:ft}=J;return ke=J.value?jt(J.value,ke.ts,"wipPreview"):jt(ke.ts,J.value,"wipPreview")}}function xe(){h.value||(D.doConfirm(),qe())}function qe(){K.value=!1,e.active&&D.doClose()}function ht(ke){typeof ke!="number"&&(ke=ut(ke)),e.value===null?D.doUpdateValue([ke,ke],e.panel):Array.isArray(e.value)&&D.doUpdateValue([ke,Math.max(e.value[1],ke)],e.panel)}function Et(ke){typeof ke!="number"&&(ke=ut(ke)),e.value===null?D.doUpdateValue([ke,ke],e.panel):Array.isArray(e.value)&&D.doUpdateValue([Math.min(e.value[0],ke),ke],e.panel)}function jt(ke,Qe,ft){if(typeof ke!="number"&&(ke=ut(ke)),ft!=="shortcutPreview"){let It,ln;if(t==="datetimerange"){const{defaultTime:Nt}=e;Array.isArray(Nt)?(It=ml(Nt[0]),ln=ml(Nt[1])):(It=ml(Nt),ln=It)}It&&(ke=ut(ts(ke,It))),ln&&(Qe=ut(ts(Qe,ln)))}D.doUpdateValue([ke,Qe],e.panel&&ft==="done")}function Kt(ke){return ut(t==="datetimerange"?ph(ke):t==="monthrange"?ki(ke):_o(ke))}function Yt(ke){const Qe=Cs(ke,Q.value,new Date,D.dateFnsOptions.value);if(zs(Qe))if(e.value){if(Array.isArray(e.value)){const ft=ts(e.value[0],{year:Tn(Qe),month:yn(Qe),date:Hs(Qe)});ht(Kt(ut(ft)))}}else{const ft=ts(new Date,{year:Tn(Qe),month:yn(Qe),date:Hs(Qe)});ht(Kt(ut(ft)))}else De.value=ke}function nn(ke){const Qe=Cs(ke,Q.value,new Date,D.dateFnsOptions.value);if(zs(Qe)){if(e.value===null){const ft=ts(new Date,{year:Tn(Qe),month:yn(Qe),date:Hs(Qe)});Et(Kt(ut(ft)))}else if(Array.isArray(e.value)){const ft=ts(e.value[1],{year:Tn(Qe),month:yn(Qe),date:Hs(Qe)});Et(Kt(ut(ft)))}}else Pe.value=ke}function rn(){const ke=Cs(De.value,Q.value,new Date,D.dateFnsOptions.value),{value:Qe}=e;if(zs(ke)){if(Qe===null){const ft=ts(new Date,{year:Tn(ke),month:yn(ke),date:Hs(ke)});ht(Kt(ut(ft)))}else if(Array.isArray(Qe)){const ft=ts(Qe[0],{year:Tn(ke),month:yn(ke),date:Hs(ke)});ht(Kt(ut(ft)))}}else xn()}function Mn(){const ke=Cs(Pe.value,Q.value,new Date,D.dateFnsOptions.value),{value:Qe}=e;if(zs(ke)){if(Qe===null){const ft=ts(new Date,{year:Tn(ke),month:yn(ke),date:Hs(ke)});Et(Kt(ut(ft)))}else if(Array.isArray(Qe)){const ft=ts(Qe[1],{year:Tn(ke),month:yn(ke),date:Hs(ke)});Et(Kt(ut(ft)))}}else xn()}function xn(ke){const{value:Qe}=e;if(Qe===null||!Array.isArray(Qe)){De.value="",Pe.value="";return}ke===void 0&&(ke=Qe),De.value=dn(ke[0],Q.value,D.dateFnsOptions.value),Pe.value=dn(ke[1],Q.value,D.dateFnsOptions.value)}function Xt(ke){ke!==null&&ht(ke)}function Gt(ke){ke!==null&&Et(ke)}function Qt(ke){D.cachePendingValue();const Qe=D.getShortcutValue(ke);Array.isArray(Qe)&&jt(Qe[0],Qe[1],"shortcutPreview")}function an(ke){const Qe=D.getShortcutValue(ke);Array.isArray(Qe)&&(jt(Qe[0],Qe[1],"done"),D.clearPendingValue(),xe())}function Ot(ke,Qe){const ft=ke===void 0?e.value:ke;if(ke===void 0||Qe==="start"){if(V.value){const It=Array.isArray(ft)?yn(ft[0]):yn(Date.now());V.value.scrollTo({debounce:!1,index:It,elSize:$r})}if(N.value){const It=(Array.isArray(ft)?Tn(ft[0]):Tn(Date.now()))-E.value[0];N.value.scrollTo({index:It,debounce:!1})}}if(ke===void 0||Qe==="end"){if(j.value){const It=Array.isArray(ft)?yn(ft[1]):yn(Date.now());j.value.scrollTo({debounce:!1,index:It,elSize:$r})}if(z.value){const It=(Array.isArray(ft)?Tn(ft[1]):Tn(Date.now()))-E.value[0];z.value.scrollTo({index:It,debounce:!1})}}}function jn(ke,Qe){const{value:ft}=e,It=!Array.isArray(ft),ln=ke.type==="year"&&t!=="yearrange"?It?ts(ke.ts,{month:yn(t==="quarterrange"?ya(new Date):new Date)}).valueOf():ts(ke.ts,{month:yn(t==="quarterrange"?ya(ft[Qe==="start"?0:1]):ft[Qe==="start"?0:1])}).valueOf():ke.ts;if(It){const qn=Kt(ln),Ln=[qn,qn];D.doUpdateValue(Ln,e.panel),Ot(Ln,"start"),Ot(Ln,"end"),D.disableTransitionOneTick();return}const Nt=[ft[0],ft[1]];let En=!1;switch(Qe==="start"?(Nt[0]=Kt(ln),Nt[0]>Nt[1]&&(Nt[1]=Nt[0],En=!0)):(Nt[1]=Kt(ln),Nt[0]>Nt[1]&&(Nt[0]=Nt[1],En=!0)),D.doUpdateValue(Nt,e.panel),t){case"monthrange":case"quarterrange":D.disableTransitionOneTick(),En?(Ot(Nt,"start"),Ot(Nt,"end")):Ot(Nt,Qe);break;case"yearrange":D.disableTransitionOneTick(),Ot(Nt,"start"),Ot(Nt,"end")}}function is(){var ke;(ke=U.value)===null||ke===void 0||ke.sync()}function An(){var ke;(ke=W.value)===null||ke===void 0||ke.sync()}function Pn(ke){var Qe,ft;return ke==="start"?((Qe=N.value)===null||Qe===void 0?void 0:Qe.listElRef)||null:((ft=z.value)===null||ft===void 0?void 0:ft.listElRef)||null}function Rn(ke){var Qe,ft;return ke==="start"?((Qe=N.value)===null||Qe===void 0?void 0:Qe.itemsElRef)||null:((ft=z.value)===null||ft===void 0?void 0:ft.itemsElRef)||null}const In={startYearVlRef:N,endYearVlRef:z,startMonthScrollbarRef:V,endMonthScrollbarRef:j,startYearScrollbarRef:U,endYearScrollbarRef:W};return Object.assign(Object.assign(Object.assign(Object.assign({startDatesElRef:I,endDatesElRef:O,handleDateClick:At,handleColItemClick:jn,handleDateMouseEnter:St,handleConfirmClick:xe,startCalendarPrevYear:tt,startCalendarPrevMonth:se,startCalendarNextYear:wt,startCalendarNextMonth:gt,endCalendarPrevYear:Oe,endCalendarPrevMonth:Be,endCalendarNextMonth:Ke,endCalendarNextYear:ge,mergedIsDateDisabled:fe,changeStartEndTime:jt,ranges:_,calendarMonthBeforeYear:Ue,startCalendarMonth:ae,startCalendarYear:he,endCalendarMonth:be,endCalendarYear:Le,weekdays:ce,startDateArray:st,endDateArray:yt,startYearArray:ie,startMonthArray:Re,startQuarterArray:Ee,endYearArray:we,endMonthArray:Xe,endQuarterArray:x,isSelecting:K,handleRangeShortcutMouseenter:Qt,handleRangeShortcutClick:an},D),R),In),{startDateDisplayString:De,endDateInput:Pe,timePickerSize:D.timePickerSize,startTimeValue:et,endTimeValue:je,datePickerSlots:M,shortcuts:_e,startCalendarDateTime:oe,endCalendarDateTime:re,justifyColumnsScrollState:Ot,handleFocusDetectorFocus:D.handleFocusDetectorFocus,handleStartTimePickerChange:Xt,handleEndTimePickerChange:Gt,handleStartDateInput:Yt,handleStartDateInputBlur:rn,handleEndDateInput:nn,handleEndDateInputBlur:Mn,handleStartYearVlScroll:is,handleEndYearVlScroll:An,virtualListContainer:Pn,virtualListContent:Rn,onUpdateStartCalendarValue:me,onUpdateEndCalendarValue:Fe})}const iA=Ae({name:"DateRangePanel",props:Sh,setup(e){return Ch(e,"daterange")},render(){var e,t,n;const{mergedClsPrefix:s,mergedTheme:i,shortcuts:a,onRender:d,$slots:r}=this;return d==null||d(),B("div",{ref:"selfRef",tabindex:0,class:[`${s}-date-panel`,`${s}-date-panel--daterange`,!this.panel&&`${s}-date-panel--shadow`,this.themeClass],onKeydown:this.handlePanelKeyDown,onFocus:this.handlePanelFocus},B("div",{ref:"startDatesElRef",class:`${s}-date-panel-calendar ${s}-date-panel-calendar--start`},B("div",{class:`${s}-date-panel-month`},B("div",{class:`${s}-date-panel-month__fast-prev`,onClick:this.startCalendarPrevYear},Jt(r["prev-year"],()=>[B(ir,null)])),B("div",{class:`${s}-date-panel-month__prev`,onClick:this.startCalendarPrevMonth},Jt(r["prev-month"],()=>[B(sr,null)])),B(yo,{monthYearSeparator:this.calendarHeaderMonthYearSeparator,monthBeforeYear:this.calendarMonthBeforeYear,value:this.startCalendarDateTime,onUpdateValue:this.onUpdateStartCalendarValue,mergedClsPrefix:s,calendarMonth:this.startCalendarMonth,calendarYear:this.startCalendarYear}),B("div",{class:`${s}-date-panel-month__next`,onClick:this.startCalendarNextMonth},Jt(r["next-month"],()=>[B(or,null)])),B("div",{class:`${s}-date-panel-month__fast-next`,onClick:this.startCalendarNextYear},Jt(r["next-year"],()=>[B(rr,null)]))),B("div",{class:`${s}-date-panel-weekdays`},this.weekdays.map(o=>B("div",{key:o,class:`${s}-date-panel-weekdays__day`},o))),B("div",{class:`${s}-date-panel__divider`}),B("div",{class:`${s}-date-panel-dates`},this.startDateArray.map((o,c)=>B("div",{"data-n-date":!0,key:c,class:[`${s}-date-panel-date`,{[`${s}-date-panel-date--excluded`]:!o.inCurrentMonth,[`${s}-date-panel-date--current`]:o.isCurrentDate,[`${s}-date-panel-date--selected`]:o.selected,[`${s}-date-panel-date--covered`]:o.inSpan,[`${s}-date-panel-date--start`]:o.startOfSpan,[`${s}-date-panel-date--end`]:o.endOfSpan,[`${s}-date-panel-date--disabled`]:this.mergedIsDateDisabled(o.ts)}],onClick:()=>{this.handleDateClick(o)},onMouseenter:()=>{this.handleDateMouseEnter(o)}},B("div",{class:`${s}-date-panel-date__trigger`}),o.dateObject.date,o.isCurrentDate?B("div",{class:`${s}-date-panel-date__sup`}):null)))),B("div",{class:`${s}-date-panel__vertical-divider`}),B("div",{ref:"endDatesElRef",class:`${s}-date-panel-calendar ${s}-date-panel-calendar--end`},B("div",{class:`${s}-date-panel-month`},B("div",{class:`${s}-date-panel-month__fast-prev`,onClick:this.endCalendarPrevYear},Jt(r["prev-year"],()=>[B(ir,null)])),B("div",{class:`${s}-date-panel-month__prev`,onClick:this.endCalendarPrevMonth},Jt(r["prev-month"],()=>[B(sr,null)])),B(yo,{monthYearSeparator:this.calendarHeaderMonthYearSeparator,monthBeforeYear:this.calendarMonthBeforeYear,value:this.endCalendarDateTime,onUpdateValue:this.onUpdateEndCalendarValue,mergedClsPrefix:s,calendarMonth:this.endCalendarMonth,calendarYear:this.endCalendarYear}),B("div",{class:`${s}-date-panel-month__next`,onClick:this.endCalendarNextMonth},Jt(r["next-month"],()=>[B(or,null)])),B("div",{class:`${s}-date-panel-month__fast-next`,onClick:this.endCalendarNextYear},Jt(r["next-year"],()=>[B(rr,null)]))),B("div",{class:`${s}-date-panel-weekdays`},this.weekdays.map(o=>B("div",{key:o,class:`${s}-date-panel-weekdays__day`},o))),B("div",{class:`${s}-date-panel__divider`}),B("div",{class:`${s}-date-panel-dates`},this.endDateArray.map((o,c)=>B("div",{"data-n-date":!0,key:c,class:[`${s}-date-panel-date`,{[`${s}-date-panel-date--excluded`]:!o.inCurrentMonth,[`${s}-date-panel-date--current`]:o.isCurrentDate,[`${s}-date-panel-date--selected`]:o.selected,[`${s}-date-panel-date--covered`]:o.inSpan,[`${s}-date-panel-date--start`]:o.startOfSpan,[`${s}-date-panel-date--end`]:o.endOfSpan,[`${s}-date-panel-date--disabled`]:this.mergedIsDateDisabled(o.ts)}],onClick:()=>{this.handleDateClick(o)},onMouseenter:()=>{this.handleDateMouseEnter(o)}},B("div",{class:`${s}-date-panel-date__trigger`}),o.dateObject.date,o.isCurrentDate?B("div",{class:`${s}-date-panel-date__sup`}):null)))),this.datePickerSlots.footer?B("div",{class:`${s}-date-panel-footer`},this.datePickerSlots.footer()):null,!((e=this.actions)===null||e===void 0)&&e.length||a?B("div",{class:`${s}-date-panel-actions`},B("div",{class:`${s}-date-panel-actions__prefix`},a&&Object.keys(a).map(o=>{const c=a[o];return Array.isArray(c)||typeof c=="function"?B(fi,{size:"tiny",onMouseenter:()=>{this.handleRangeShortcutMouseenter(c)},onClick:()=>{this.handleRangeShortcutClick(c)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>o}):null})),B("div",{class:`${s}-date-panel-actions__suffix`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?xs(r.clear,{onClear:this.handleClearClick,text:this.locale.clear},()=>[B(gn,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",onClick:this.handleClearClick},{default:()=>this.locale.clear})]):null,!((n=this.actions)===null||n===void 0)&&n.includes("confirm")?xs(r.confirm,{onConfirm:this.handleConfirmClick,disabled:this.isRangeInvalid||this.isSelecting,text:this.locale.confirm},()=>[B(gn,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",type:"primary",disabled:this.isRangeInvalid||this.isSelecting,onClick:this.handleConfirmClick},{default:()=>this.locale.confirm})]):null)):null,B(lr,{onFocus:this.handleFocusDetectorFocus}))}});function gv(e,t,n){const s=H_(),i=aA(e,n.timeZone,n.locale??s.locale);return"formatToParts"in i?rA(i,t):oA(i,t)}function rA(e,t){const n=e.formatToParts(t);for(let s=n.length-1;s>=0;--s)if(n[s].type==="timeZoneName")return n[s].value}function oA(e,t){const n=e.format(t).replace(/\u200E/g,""),s=/ [\w-+ ]+$/.exec(n);return s?s[0].substr(1):""}function aA(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function lA(e,t){const n=fA(t);return"formatToParts"in n?dA(n,e):uA(n,e)}const cA={year:0,month:1,day:2,hour:3,minute:4,second:5};function dA(e,t){try{const n=e.formatToParts(t),s=[];for(let i=0;i=0?a:1e3+a,s-i}function gA(e,t,n){let i=e.getTime()-t;const a=_u(new Date(i),n);if(t===a)return t;i-=a-t;const d=_u(new Date(i),n);return a===d?a:Math.max(a,d)}function yv(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const bv={};function mA(e){if(bv[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),bv[e]=!0,!0}catch{return!1}}const _A=60*1e3,yA={X:function(e,t,n){const s=_d(n.timeZone,e);if(s===0)return"Z";switch(t){case"X":return wv(s);case"XXXX":case"XX":return Jr(s);case"XXXXX":case"XXX":default:return Jr(s,":")}},x:function(e,t,n){const s=_d(n.timeZone,e);switch(t){case"x":return wv(s);case"xxxx":case"xx":return Jr(s);case"xxxxx":case"xxx":default:return Jr(s,":")}},O:function(e,t,n){const s=_d(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+bA(s,":");case"OOOO":default:return"GMT"+Jr(s,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return gv("short",e,n);case"zzzz":default:return gv("long",e,n)}}};function _d(e,t){const n=e?kh(e,t,!0)/_A:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function jl(e,t){const n=e<0?"-":"";let s=Math.abs(e).toString();for(;s.length0?"-":"+",s=Math.abs(e),i=jl(Math.floor(s/60),2),a=jl(Math.floor(s%60),2);return n+i+t+a}function wv(e,t){return e%60===0?(e>0?"-":"+")+jl(Math.abs(e)/60,2):Jr(e,t)}function bA(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),i=Math.floor(s/60),a=s%60;return a===0?n+String(i):n+String(i)+t+jl(a,2)}function Sv(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const wA=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,yd=36e5,Cv=6e4,SA=2,gs={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:wA};function yy(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?SA:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const s=CA(e),{year:i,restDateString:a}=kA(s.date,n),d=xA(a,i);if(d===null||isNaN(d.getTime()))return new Date(NaN);if(d){const r=d.getTime();let o=0,c;if(s.time&&(o=RA(s.time),o===null||isNaN(o)))return new Date(NaN);if(s.timeZone||t.timeZone){if(c=kh(s.timeZone||t.timeZone,new Date(r+o)),isNaN(c))return new Date(NaN)}else c=Sv(new Date(r+o)),c=Sv(new Date(r+o+c));return new Date(r+o+c)}else return new Date(NaN)}function CA(e){const t={};let n=gs.dateTimePattern.exec(e),s;if(n?(t.date=n[1],s=n[3]):(n=gs.datePattern.exec(e),n?(t.date=n[1],s=n[2]):(t.date=null,s=e)),s){const i=gs.timeZone.exec(s);i?(t.time=s.replace(i[1],""),t.timeZone=i[1].trim()):t.time=s}return t}function kA(e,t){if(e){const n=gs.YYY[t],s=gs.YYYYY[t];let i=gs.YYYY.exec(e)||s.exec(e);if(i){const a=i[1];return{year:parseInt(a,10),restDateString:e.slice(a.length)}}if(i=gs.YY.exec(e)||n.exec(e),i){const a=i[1];return{year:parseInt(a,10)*100,restDateString:e.slice(a.length)}}}return{year:null}}function xA(e,t){if(t===null)return null;let n,s,i;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let a=gs.MM.exec(e);if(a)return n=new Date(0),s=parseInt(a[1],10)-1,xv(t,s)?(n.setUTCFullYear(t,s),n):new Date(NaN);if(a=gs.DDD.exec(e),a){n=new Date(0);const d=parseInt(a[1],10);return EA(t,d)?(n.setUTCFullYear(t,0,d),n):new Date(NaN)}if(a=gs.MMDD.exec(e),a){n=new Date(0),s=parseInt(a[1],10)-1;const d=parseInt(a[2],10);return xv(t,s,d)?(n.setUTCFullYear(t,s,d),n):new Date(NaN)}if(a=gs.Www.exec(e),a)return i=parseInt(a[1],10)-1,Rv(i)?kv(t,i):new Date(NaN);if(a=gs.WwwD.exec(e),a){i=parseInt(a[1],10)-1;const d=parseInt(a[2],10)-1;return Rv(i,d)?kv(t,i,d):new Date(NaN)}return null}function RA(e){let t,n,s=gs.HH.exec(e);if(s)return t=parseFloat(s[1].replace(",",".")),bd(t)?t%24*yd:NaN;if(s=gs.HHMM.exec(e),s)return t=parseInt(s[1],10),n=parseFloat(s[2].replace(",",".")),bd(t,n)?t%24*yd+n*Cv:NaN;if(s=gs.HHMMSS.exec(e),s){t=parseInt(s[1],10),n=parseInt(s[2],10);const i=parseFloat(s[3].replace(",","."));return bd(t,n,i)?t%24*yd+n*Cv+i*1e3:NaN}return null}function kv(e,t,n){t=t||0,n=n||0;const s=new Date(0);s.setUTCFullYear(e,0,4);const i=s.getUTCDay()||7,a=t*7+n+1-i;return s.setUTCDate(s.getUTCDate()+a),s}const TA=[31,28,31,30,31,30,31,31,30,31,30,31],PA=[31,29,31,30,31,30,31,31,30,31,30,31];function by(e){return e%400===0||e%4===0&&e%100!==0}function xv(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const s=by(e);if(s&&n>PA[t]||!s&&n>TA[t])return!1}return!0}function EA(e,t){if(t<1)return!1;const n=by(e);return!(n&&t>366||!n&&t>365)}function Rv(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function bd(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const LA=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function DA(e,t,n={}){t=String(t);const s=t.match(LA);if(s){const i=yy(n.originalDate||e,n);t=s.reduce(function(a,d){if(d[0]==="'")return a;const r=a.indexOf(d),o=a[r-1]==="'",c=a.replace(d,"'"+yA[d[0]](i,d,n)+"'");return o?c.substring(0,r-1)+c.substring(r+1):c},t)}return dn(e,t,n)}function MA(e,t,n){e=yy(e,n);const s=kh(t,e,!0),i=new Date(e.getTime()-s),a=new Date(0);return a.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),a.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),a}function AA(e,t,n,s){return s={...s,timeZone:t,originalDate:e},DA(MA(e,t,{timeZone:s.timeZone}),n,s)}const wy=ds("n-time-picker"),nl=Ae({name:"TimePickerPanelCol",props:{clsPrefix:{type:String,required:!0},data:{type:Array,required:!0},activeValue:{type:[Number,String],default:null},onItemClick:Function},render(){const{activeValue:e,onItemClick:t,clsPrefix:n}=this;return this.data.map(s=>{const{label:i,disabled:a,value:d}=s,r=e===d;return B("div",{key:i,"data-active":r?"":null,class:[`${n}-time-picker-col__item`,r&&`${n}-time-picker-col__item--active`,a&&`${n}-time-picker-col__item--disabled`],onClick:t&&!a?()=>{t(d)}:void 0},i)})}}),ta={amHours:["00","01","02","03","04","05","06","07","08","09","10","11"],pmHours:["12","01","02","03","04","05","06","07","08","09","10","11"],hours:["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"],minutes:["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"],seconds:["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"],period:["AM","PM"]};function wd(e){return`00${e}`.slice(-2)}function na(e,t,n){return Array.isArray(t)?(n==="am"?t.filter(s=>s<12):n==="pm"?t.filter(s=>s>=12).map(s=>s===12?12:s-12):t).map(s=>wd(s)):typeof t=="number"?n==="am"?e.filter(s=>{const i=Number(s);return i<12&&i%t===0}):n==="pm"?e.filter(s=>{const i=Number(s);return i>=12&&i%t===0}).map(s=>{const i=Number(s);return wd(i===12?12:i-12)}):e.filter(s=>Number(s)%t===0):n==="am"?e.filter(s=>Number(s)<12):n==="pm"?e.map(s=>Number(s)).filter(s=>Number(s)>=12).map(s=>wd(s===12?12:s-12)):e}function sl(e,t,n){return n?typeof n=="number"?e%n===0:n.includes(e):!0}function IA(e,t,n){const s=na(ta[t],n).map(Number);let i,a;for(let d=0;de){a=r;break}i=r}return i===void 0?(a||bg("time-picker","Please set 'hours' or 'minutes' or 'seconds' props"),a):a===void 0||a-e>e-i?i:a}function $A(e){return Gi(e)<12?"am":"pm"}const OA={actions:{type:Array,default:()=>["now","confirm"]},showHour:{type:Boolean,default:!0},showMinute:{type:Boolean,default:!0},showSecond:{type:Boolean,default:!0},showPeriod:{type:Boolean,default:!0},isHourInvalid:Boolean,isMinuteInvalid:Boolean,isSecondInvalid:Boolean,isAmPmInvalid:Boolean,isValueInvalid:Boolean,hourValue:{type:Number,default:null},minuteValue:{type:Number,default:null},secondValue:{type:Number,default:null},amPmValue:{type:String,default:null},isHourDisabled:Function,isMinuteDisabled:Function,isSecondDisabled:Function,onHourClick:{type:Function,required:!0},onMinuteClick:{type:Function,required:!0},onSecondClick:{type:Function,required:!0},onAmPmClick:{type:Function,required:!0},onNowClick:Function,clearText:String,nowText:String,confirmText:String,transitionDisabled:Boolean,onClearClick:Function,onConfirmClick:Function,onFocusin:Function,onFocusout:Function,onFocusDetectorFocus:Function,onKeydown:Function,hours:[Number,Array],minutes:[Number,Array],seconds:[Number,Array],use12Hours:Boolean},FA=Ae({name:"TimePickerPanel",props:OA,setup(e){const{mergedThemeRef:t,mergedClsPrefixRef:n}=Ut(wy),s=q(()=>{const{isHourDisabled:r,hours:o,use12Hours:c,amPmValue:p}=e;if(c){const u=p??$A(Date.now());return na(ta.hours,o,u).map(g=>{const m=Number(g),y=u==="pm"&&m!==12?m+12:m;return{label:g,value:y,disabled:r?r(y):!1}})}else return na(ta.hours,o).map(u=>({label:u,value:Number(u),disabled:r?r(Number(u)):!1}))}),i=q(()=>{const{isMinuteDisabled:r,minutes:o}=e;return na(ta.minutes,o).map(c=>({label:c,value:Number(c),disabled:r?r(Number(c),e.hourValue):!1}))}),a=q(()=>{const{isSecondDisabled:r,seconds:o}=e;return na(ta.seconds,o).map(c=>({label:c,value:Number(c),disabled:r?r(Number(c),e.minuteValue,e.hourValue):!1}))}),d=q(()=>{const{isHourDisabled:r}=e;let o=!0,c=!0;for(let p=0;p<12;++p)if(!(r!=null&&r(p))){o=!1;break}for(let p=12;p<24;++p)if(!(r!=null&&r(p))){c=!1;break}return[{label:"AM",value:"am",disabled:o},{label:"PM",value:"pm",disabled:c}]});return{mergedTheme:t,mergedClsPrefix:n,hours:s,minutes:i,seconds:a,amPm:d,hourScrollRef:H(null),minuteScrollRef:H(null),secondScrollRef:H(null),amPmScrollRef:H(null)}},render(){var e,t,n,s;const{mergedClsPrefix:i,mergedTheme:a}=this;return B("div",{tabindex:0,class:`${i}-time-picker-panel`,onFocusin:this.onFocusin,onFocusout:this.onFocusout,onKeydown:this.onKeydown},B("div",{class:`${i}-time-picker-cols`},this.showHour?B("div",{class:[`${i}-time-picker-col`,this.isHourInvalid&&`${i}-time-picker-col--invalid`,this.transitionDisabled&&`${i}-time-picker-col--transition-disabled`]},B(As,{ref:"hourScrollRef",theme:a.peers.Scrollbar,themeOverrides:a.peerOverrides.Scrollbar},{default:()=>[B(nl,{clsPrefix:i,data:this.hours,activeValue:this.hourValue,onItemClick:this.onHourClick}),B("div",{class:`${i}-time-picker-col__padding`})]})):null,this.showMinute?B("div",{class:[`${i}-time-picker-col`,this.transitionDisabled&&`${i}-time-picker-col--transition-disabled`,this.isMinuteInvalid&&`${i}-time-picker-col--invalid`]},B(As,{ref:"minuteScrollRef",theme:a.peers.Scrollbar,themeOverrides:a.peerOverrides.Scrollbar},{default:()=>[B(nl,{clsPrefix:i,data:this.minutes,activeValue:this.minuteValue,onItemClick:this.onMinuteClick}),B("div",{class:`${i}-time-picker-col__padding`})]})):null,this.showSecond?B("div",{class:[`${i}-time-picker-col`,this.isSecondInvalid&&`${i}-time-picker-col--invalid`,this.transitionDisabled&&`${i}-time-picker-col--transition-disabled`]},B(As,{ref:"secondScrollRef",theme:a.peers.Scrollbar,themeOverrides:a.peerOverrides.Scrollbar},{default:()=>[B(nl,{clsPrefix:i,data:this.seconds,activeValue:this.secondValue,onItemClick:this.onSecondClick}),B("div",{class:`${i}-time-picker-col__padding`})]})):null,this.use12Hours?B("div",{class:[`${i}-time-picker-col`,this.isAmPmInvalid&&`${i}-time-picker-col--invalid`,this.transitionDisabled&&`${i}-time-picker-col--transition-disabled`]},B(As,{ref:"amPmScrollRef",theme:a.peers.Scrollbar,themeOverrides:a.peerOverrides.Scrollbar},{default:()=>[B(nl,{clsPrefix:i,data:this.amPm,activeValue:this.amPmValue,onItemClick:this.onAmPmClick}),B("div",{class:`${i}-time-picker-col__padding`})]})):null),!((e=this.actions)===null||e===void 0)&&e.length?B("div",{class:`${i}-time-picker-actions`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?B(gn,{theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,size:"tiny",onClick:this.onClearClick},{default:()=>this.clearText}):null,!((n=this.actions)===null||n===void 0)&&n.includes("now")?B(gn,{size:"tiny",theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,onClick:this.onNowClick},{default:()=>this.nowText}):null,!((s=this.actions)===null||s===void 0)&&s.includes("confirm")?B(gn,{size:"tiny",type:"primary",class:`${i}-time-picker-actions__confirm`,theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,disabled:this.isValueInvalid,onClick:this.onConfirmClick},{default:()=>this.confirmText}):null):null,B(lr,{onFocus:this.onFocusDetectorFocus}))}}),BA=ze([Ce("time-picker",` - z-index: auto; - position: relative; - `,[Ce("time-picker-icon",` - color: var(--n-icon-color-override); - transition: color .3s var(--n-bezier); - `),Ve("disabled",[Ce("time-picker-icon",` - color: var(--n-icon-color-disabled-override); - `)])]),Ce("time-picker-panel",` - transition: - box-shadow .3s var(--n-bezier), - background-color .3s var(--n-bezier); - outline: none; - font-size: var(--n-item-font-size); - border-radius: var(--n-border-radius); - margin: 4px 0; - min-width: 104px; - overflow: hidden; - background-color: var(--n-panel-color); - box-shadow: var(--n-panel-box-shadow); - `,[Eo(),Ce("time-picker-actions",` - padding: var(--n-panel-action-padding); - align-items: center; - display: flex; - justify-content: space-evenly; - `),Ce("time-picker-cols",` - height: calc(var(--n-item-height) * 6); - display: flex; - position: relative; - transition: border-color .3s var(--n-bezier); - border-bottom: 1px solid var(--n-panel-divider-color); - `),Ce("time-picker-col",` - flex-grow: 1; - min-width: var(--n-item-width); - height: calc(var(--n-item-height) * 6); - flex-direction: column; - transition: box-shadow .3s var(--n-bezier); - `,[Ve("transition-disabled",[Ge("item","transition: none;",[ze("&::before","transition: none;")])]),Ge("padding",` - height: calc(var(--n-item-height) * 5); - `),ze("&:first-child","min-width: calc(var(--n-item-width) + 4px);",[Ge("item",[ze("&::before","left: 4px;")])]),Ge("item",` - cursor: pointer; - height: var(--n-item-height); - display: flex; - align-items: center; - justify-content: center; - transition: - color .3s var(--n-bezier), - background-color .3s var(--n-bezier), - opacity .3s var(--n-bezier), - text-decoration-color .3s var(--n-bezier); - background: #0000; - text-decoration-color: #0000; - color: var(--n-item-text-color); - z-index: 0; - box-sizing: border-box; - padding-top: 4px; - position: relative; - `,[ze("&::before",` - content: ""; - transition: background-color .3s var(--n-bezier); - z-index: -1; - position: absolute; - left: 0; - right: 4px; - top: 4px; - bottom: 0; - border-radius: var(--n-item-border-radius); - `),Cn("disabled",[ze("&:hover::before",` - background-color: var(--n-item-color-hover); - `)]),Ve("active",` - color: var(--n-item-text-color-active); - `,[ze("&::before",` - background-color: var(--n-item-color-hover); - `)]),Ve("disabled",` - opacity: var(--n-item-opacity-disabled); - cursor: not-allowed; - `)]),Ve("invalid",[Ge("item",[Ve("active",` - text-decoration: line-through; - text-decoration-color: var(--n-item-text-color-active); - `)])])])])]);function Sd(e,t){return e===void 0?!0:Array.isArray(e)?e.every(n=>n>=0&&n<=t):e>=0&&e<=t}const HA=Object.assign(Object.assign({},Ht.props),{to:cs.propTo,bordered:{type:Boolean,default:void 0},actions:Array,defaultValue:{type:Number,default:null},defaultFormattedValue:String,placeholder:String,placement:{type:String,default:"bottom-start"},value:Number,format:{type:String,default:"HH:mm:ss"},valueFormat:String,formattedValue:String,isHourDisabled:Function,size:String,isMinuteDisabled:Function,isSecondDisabled:Function,inputReadonly:Boolean,clearable:Boolean,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onUpdateFormattedValue:[Function,Array],"onUpdate:formattedValue":[Function,Array],onBlur:[Function,Array],onConfirm:[Function,Array],onClear:Function,onFocus:[Function,Array],timeZone:String,showIcon:{type:Boolean,default:!0},disabled:{type:Boolean,default:void 0},show:{type:Boolean,default:void 0},hours:{type:[Number,Array],validator:e=>Sd(e,23)},minutes:{type:[Number,Array],validator:e=>Sd(e,59)},seconds:{type:[Number,Array],validator:e=>Sd(e,59)},use12Hours:Boolean,stateful:{type:Boolean,default:!0},onChange:[Function,Array]}),yu=Ae({name:"TimePicker",props:HA,setup(e){const{mergedBorderedRef:t,mergedClsPrefixRef:n,namespaceRef:s,inlineThemeDisabled:i}=mn(e),{localeRef:a,dateLocaleRef:d}=Qs("TimePicker"),r=ar(e),{mergedSizeRef:o,mergedDisabledRef:c,mergedStatusRef:p}=r,u=Ht("TimePicker","-time-picker",BA,h0,e,n),g=sh(),m=H(null),y=H(null),v=q(()=>({locale:d.value.locale}));function l(xe){return xe===null?null:Cs(xe,e.valueFormat||e.format,new Date,v.value).getTime()}const{defaultValue:h,defaultFormattedValue:f}=e,_=H(f!==void 0?l(f):h),S=q(()=>{const{formattedValue:xe}=e;if(xe!==void 0)return l(xe);const{value:qe}=e;return qe!==void 0?qe:_.value}),k=q(()=>{const{timeZone:xe}=e;return xe?(qe,ht,Et)=>AA(qe,xe,ht,Et):(qe,ht,Et)=>dn(qe,ht,Et)}),P=H("");_t(()=>e.timeZone,()=>{const xe=S.value;P.value=xe===null?"":k.value(xe,e.format,v.value)},{immediate:!0});const M=H(!1),w=ct(e,"show"),T=ss(w,M),A=H(S.value),E=H(!1),R=q(()=>a.value.clear),D=q(()=>a.value.now),I=q(()=>e.placeholder!==void 0?e.placeholder:a.value.placeholder),O=q(()=>a.value.negativeText),U=q(()=>a.value.positiveText),W=q(()=>/H|h|K|k/.test(e.format)),N=q(()=>e.format.includes("m")),z=q(()=>e.format.includes("s")),V=q(()=>{const{value:xe}=S;return xe===null?null:Number(k.value(xe,"HH",v.value))}),j=q(()=>{const{value:xe}=S;return xe===null?null:Number(k.value(xe,"mm",v.value))}),G=q(()=>{const{value:xe}=S;return xe===null?null:Number(k.value(xe,"ss",v.value))}),te=q(()=>{const{isHourDisabled:xe}=e;return V.value===null?!1:sl(V.value,"hours",e.hours)?xe?xe(V.value):!1:!0}),oe=q(()=>{const{value:xe}=j,{value:qe}=V;if(xe===null||qe===null)return!1;if(!sl(xe,"minutes",e.minutes))return!0;const{isMinuteDisabled:ht}=e;return ht?ht(xe,qe):!1}),re=q(()=>{const{value:xe}=j,{value:qe}=V,{value:ht}=G;if(ht===null||xe===null||qe===null)return!1;if(!sl(ht,"seconds",e.seconds))return!0;const{isSecondDisabled:Et}=e;return Et?Et(ht,xe,qe):!1}),ye=q(()=>te.value||oe.value||re.value),K=q(()=>e.format.length+4),J=q(()=>{const{value:xe}=S;return xe===null?null:Gi(xe)<12?"am":"pm"});function Q(xe,qe){const{onUpdateFormattedValue:ht,"onUpdate:formattedValue":Et}=e;ht&&Je(ht,xe,qe),Et&&Je(Et,xe,qe)}function de(xe){return xe===null?null:k.value(xe,e.valueFormat||e.format)}function De(xe){const{onUpdateValue:qe,"onUpdate:value":ht,onChange:Et}=e,{nTriggerFormChange:jt,nTriggerFormInput:Kt}=r,Yt=de(xe);qe&&Je(qe,xe,Yt),ht&&Je(ht,xe,Yt),Et&&Je(Et,xe,Yt),Q(Yt,xe),_.value=xe,jt(),Kt()}function Pe(xe){const{onFocus:qe}=e,{nTriggerFormFocus:ht}=r;qe&&Je(qe,xe),ht()}function Ye(xe){const{onBlur:qe}=e,{nTriggerFormBlur:ht}=r;qe&&Je(qe,xe),ht()}function st(){const{onConfirm:xe}=e;xe&&Je(xe,S.value,de(S.value))}function yt(xe){var qe;xe.stopPropagation(),De(null),Ee(null),(qe=e.onClear)===null||qe===void 0||qe.call(e)}function ce(){se({returnFocus:!0})}function ae(){De(null),Ee(null),se({returnFocus:!0})}function be(xe){xe.key==="Escape"&&T.value&&_a(xe)}function he(xe){var qe;switch(xe.key){case"Escape":T.value&&(_a(xe),se({returnFocus:!0}));break;case"Tab":g.shift&&xe.target===((qe=y.value)===null||qe===void 0?void 0:qe.$el)&&(xe.preventDefault(),se({returnFocus:!0}));break}}function Le(){E.value=!0,un(()=>{E.value=!1})}function et(xe){c.value||Rs(xe,"clear")||T.value||tt()}function je(xe){typeof xe!="string"&&(S.value===null?De(ut(Sr(SM(new Date),xe))):De(ut(Sr(S.value,xe))))}function _e(xe){typeof xe!="string"&&(S.value===null?De(ut(dd(cD(new Date),xe))):De(ut(dd(S.value,xe))))}function ie(xe){typeof xe!="string"&&(S.value===null?De(ut(ud(ph(new Date),xe))):De(ut(ud(S.value,xe))))}function we(xe){const{value:qe}=S;if(qe===null){const ht=new Date,Et=Gi(ht);xe==="pm"&&Et<12?De(ut(Sr(ht,Et+12))):xe==="am"&&Et>=12&&De(ut(Sr(ht,Et-12))),De(ut(ht))}else{const ht=Gi(qe);xe==="pm"&&ht<12?De(ut(Sr(qe,ht+12))):xe==="am"&&ht>=12&&De(ut(Sr(qe,ht-12)))}}function Ee(xe){xe===void 0&&(xe=S.value),xe===null?P.value="":P.value=k.value(xe,e.format,v.value)}function x(xe){wt(xe)||Pe(xe)}function Re(xe){var qe;if(!wt(xe))if(T.value){const ht=(qe=y.value)===null||qe===void 0?void 0:qe.$el;ht!=null&&ht.contains(xe.relatedTarget)||(Ee(),Ye(xe),se({returnFocus:!1}))}else Ee(),Ye(xe)}function Xe(){c.value||T.value||tt()}function Ue(){c.value||(Ee(),se({returnFocus:!1}))}function xt(){if(!y.value)return;const{hourScrollRef:xe,minuteScrollRef:qe,secondScrollRef:ht,amPmScrollRef:Et}=y.value;[xe,qe,ht,Et].forEach(jt=>{var Kt;if(!jt)return;const Yt=(Kt=jt.contentRef)===null||Kt===void 0?void 0:Kt.querySelector("[data-active]");Yt&&jt.scrollTo({top:Yt.offsetTop})})}function Ze(xe){M.value=xe;const{onUpdateShow:qe,"onUpdate:show":ht}=e;qe&&Je(qe,xe),ht&&Je(ht,xe)}function wt(xe){var qe,ht,Et;return!!(!((ht=(qe=m.value)===null||qe===void 0?void 0:qe.wrapperElRef)===null||ht===void 0)&&ht.contains(xe.relatedTarget)||!((Et=y.value)===null||Et===void 0)&&Et.$el.contains(xe.relatedTarget))}function tt(){A.value=S.value,Ze(!0),un(xt)}function gt(xe){var qe,ht;T.value&&!(!((ht=(qe=m.value)===null||qe===void 0?void 0:qe.wrapperElRef)===null||ht===void 0)&&ht.contains(Dr(xe)))&&se({returnFocus:!1})}function se({returnFocus:xe}){var qe;T.value&&(Ze(!1),xe&&((qe=m.value)===null||qe===void 0||qe.focus()))}function ge(xe){if(xe===""){De(null);return}const qe=Cs(xe,e.format,new Date,v.value);if(P.value=xe,zs(qe)){const{value:ht}=S;if(ht!==null){const Et=ts(ht,{hours:Gi(qe),minutes:Vl(qe),seconds:Kl(qe),milliseconds:RD(qe)});De(ut(Et))}else De(ut(qe))}}function Oe(){De(A.value),Ze(!1)}function Ke(){const xe=new Date,qe={hours:Gi,minutes:Vl,seconds:Kl},[ht,Et,jt]=["hours","minutes","seconds"].map(Yt=>!e[Yt]||sl(qe[Yt](xe),Yt,e[Yt])?qe[Yt](xe):IA(qe[Yt](xe),Yt,e[Yt])),Kt=ud(dd(Sr(S.value?S.value:ut(xe),ht),Et),jt);De(ut(Kt))}function Be(){Ee(),st(),se({returnFocus:!0})}function me(xe){wt(xe)||(Ee(),Ye(xe),se({returnFocus:!1}))}_t(S,xe=>{Ee(xe),Le(),un(xt)}),_t(T,()=>{ye.value&&De(A.value)}),kn(wy,{mergedThemeRef:u,mergedClsPrefixRef:n});const Fe={focus:()=>{var xe;(xe=m.value)===null||xe===void 0||xe.focus()},blur:()=>{var xe;(xe=m.value)===null||xe===void 0||xe.blur()}},fe=q(()=>{const{common:{cubicBezierEaseInOut:xe},self:{iconColor:qe,iconColorDisabled:ht}}=u.value;return{"--n-icon-color-override":qe,"--n-icon-color-disabled-override":ht,"--n-bezier":xe}}),nt=i?Un("time-picker-trigger",void 0,fe,e):void 0,At=q(()=>{const{self:{panelColor:xe,itemTextColor:qe,itemTextColorActive:ht,itemColorHover:Et,panelDividerColor:jt,panelBoxShadow:Kt,itemOpacityDisabled:Yt,borderRadius:nn,itemFontSize:rn,itemWidth:Mn,itemHeight:xn,panelActionPadding:Xt,itemBorderRadius:Gt},common:{cubicBezierEaseInOut:Qt}}=u.value;return{"--n-bezier":Qt,"--n-border-radius":nn,"--n-item-color-hover":Et,"--n-item-font-size":rn,"--n-item-height":xn,"--n-item-opacity-disabled":Yt,"--n-item-text-color":qe,"--n-item-text-color-active":ht,"--n-item-width":Mn,"--n-panel-action-padding":Xt,"--n-panel-box-shadow":Kt,"--n-panel-color":xe,"--n-panel-divider-color":jt,"--n-item-border-radius":Gt}}),St=i?Un("time-picker",void 0,At,e):void 0;return{focus:Fe.focus,blur:Fe.blur,mergedStatus:p,mergedBordered:t,mergedClsPrefix:n,namespace:s,uncontrolledValue:_,mergedValue:S,isMounted:Sa(),inputInstRef:m,panelInstRef:y,adjustedTo:cs(e),mergedShow:T,localizedClear:R,localizedNow:D,localizedPlaceholder:I,localizedNegativeText:O,localizedPositiveText:U,hourInFormat:W,minuteInFormat:N,secondInFormat:z,mergedAttrSize:K,displayTimeString:P,mergedSize:o,mergedDisabled:c,isValueInvalid:ye,isHourInvalid:te,isMinuteInvalid:oe,isSecondInvalid:re,transitionDisabled:E,hourValue:V,minuteValue:j,secondValue:G,amPmValue:J,handleInputKeydown:be,handleTimeInputFocus:x,handleTimeInputBlur:Re,handleNowClick:Ke,handleConfirmClick:Be,handleTimeInputUpdateValue:ge,handleMenuFocusOut:me,handleCancelClick:Oe,handleClickOutside:gt,handleTimeInputActivate:Xe,handleTimeInputDeactivate:Ue,handleHourClick:je,handleMinuteClick:_e,handleSecondClick:ie,handleAmPmClick:we,handleTimeInputClear:yt,handleFocusDetectorFocus:ce,handleMenuKeydown:he,handleTriggerClick:et,mergedTheme:u,triggerCssVars:i?void 0:fe,triggerThemeClass:nt==null?void 0:nt.themeClass,triggerOnRender:nt==null?void 0:nt.onRender,cssVars:i?void 0:At,themeClass:St==null?void 0:St.themeClass,onRender:St==null?void 0:St.onRender,clearSelectedValue:ae}},render(){const{mergedClsPrefix:e,$slots:t,triggerOnRender:n}=this;return n==null||n(),B("div",{class:[`${e}-time-picker`,this.triggerThemeClass],style:this.triggerCssVars},B(Ro,null,{default:()=>[B(To,null,{default:()=>B(Is,{ref:"inputInstRef",status:this.mergedStatus,value:this.displayTimeString,bordered:this.mergedBordered,passivelyActivated:!0,attrSize:this.mergedAttrSize,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,stateful:this.stateful,size:this.mergedSize,placeholder:this.localizedPlaceholder,clearable:this.clearable,disabled:this.mergedDisabled,textDecoration:this.isValueInvalid?"line-through":void 0,onFocus:this.handleTimeInputFocus,onBlur:this.handleTimeInputBlur,onActivate:this.handleTimeInputActivate,onDeactivate:this.handleTimeInputDeactivate,onUpdateValue:this.handleTimeInputUpdateValue,onClear:this.handleTimeInputClear,internalDeactivateOnEnter:!0,internalForceFocus:this.mergedShow,readonly:this.inputReadonly||this.mergedDisabled,onClick:this.handleTriggerClick,onKeydown:this.handleInputKeydown},this.showIcon?{[this.clearable?"clear-icon-placeholder":"suffix"]:()=>B(Kn,{clsPrefix:e,class:`${e}-time-picker-icon`},{default:()=>t.icon?t.icon():B(aL,null)})}:null)}),B(Po,{teleportDisabled:this.adjustedTo===cs.tdkey,show:this.mergedShow,to:this.adjustedTo,containerClass:this.namespace,placement:this.placement},{default:()=>B(ks,{name:"fade-in-scale-up-transition",appear:this.isMounted},{default:()=>{var s;return this.mergedShow?((s=this.onRender)===null||s===void 0||s.call(this),rt(B(FA,{ref:"panelInstRef",actions:this.actions,class:this.themeClass,style:this.cssVars,seconds:this.seconds,minutes:this.minutes,hours:this.hours,transitionDisabled:this.transitionDisabled,hourValue:this.hourValue,showHour:this.hourInFormat,isHourInvalid:this.isHourInvalid,isHourDisabled:this.isHourDisabled,minuteValue:this.minuteValue,showMinute:this.minuteInFormat,isMinuteInvalid:this.isMinuteInvalid,isMinuteDisabled:this.isMinuteDisabled,secondValue:this.secondValue,amPmValue:this.amPmValue,showSecond:this.secondInFormat,isSecondInvalid:this.isSecondInvalid,isSecondDisabled:this.isSecondDisabled,isValueInvalid:this.isValueInvalid,clearText:this.localizedClear,nowText:this.localizedNow,confirmText:this.localizedPositiveText,use12Hours:this.use12Hours,onFocusout:this.handleMenuFocusOut,onKeydown:this.handleMenuKeydown,onHourClick:this.handleHourClick,onMinuteClick:this.handleMinuteClick,onSecondClick:this.handleSecondClick,onAmPmClick:this.handleAmPmClick,onNowClick:this.handleNowClick,onConfirmClick:this.handleConfirmClick,onClearClick:this.clearSelectedValue,onFocusDetectorFocus:this.handleFocusDetectorFocus}),[[Ar,this.handleClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),NA=Ae({name:"DateTimePanel",props:bh,setup(e){return wh(e,"datetime")},render(){var e,t,n,s;const{mergedClsPrefix:i,mergedTheme:a,shortcuts:d,timePickerProps:r,onRender:o,$slots:c}=this;return o==null||o(),B("div",{ref:"selfRef",tabindex:0,class:[`${i}-date-panel`,`${i}-date-panel--datetime`,!this.panel&&`${i}-date-panel--shadow`,this.themeClass],onKeydown:this.handlePanelKeyDown,onFocus:this.handlePanelFocus},B("div",{class:`${i}-date-panel-header`},B(Is,{value:this.dateInputValue,theme:a.peers.Input,themeOverrides:a.peerOverrides.Input,stateful:!1,size:this.timePickerSize,readonly:this.inputReadonly,class:`${i}-date-panel-date-input`,textDecoration:this.isDateInvalid?"line-through":"",placeholder:this.locale.selectDate,onBlur:this.handleDateInputBlur,onUpdateValue:this.handleDateInput}),B(yu,Object.assign({size:this.timePickerSize,placeholder:this.locale.selectTime,format:this.timerPickerFormat},Array.isArray(r)?void 0:r,{showIcon:!1,to:!1,theme:a.peers.TimePicker,themeOverrides:a.peerOverrides.TimePicker,value:Array.isArray(this.value)?null:this.value,isHourDisabled:this.isHourDisabled,isMinuteDisabled:this.isMinuteDisabled,isSecondDisabled:this.isSecondDisabled,onUpdateValue:this.handleTimePickerChange,stateful:!1}))),B("div",{class:`${i}-date-panel-calendar`},B("div",{class:`${i}-date-panel-month`},B("div",{class:`${i}-date-panel-month__fast-prev`,onClick:this.prevYear},Jt(c["prev-year"],()=>[B(ir,null)])),B("div",{class:`${i}-date-panel-month__prev`,onClick:this.prevMonth},Jt(c["prev-month"],()=>[B(sr,null)])),B(yo,{monthYearSeparator:this.calendarHeaderMonthYearSeparator,monthBeforeYear:this.calendarMonthBeforeYear,value:this.calendarValue,onUpdateValue:this.onUpdateCalendarValue,mergedClsPrefix:i,calendarMonth:this.calendarMonth,calendarYear:this.calendarYear}),B("div",{class:`${i}-date-panel-month__next`,onClick:this.nextMonth},Jt(c["next-month"],()=>[B(or,null)])),B("div",{class:`${i}-date-panel-month__fast-next`,onClick:this.nextYear},Jt(c["next-year"],()=>[B(rr,null)]))),B("div",{class:`${i}-date-panel-weekdays`},this.weekdays.map(p=>B("div",{key:p,class:`${i}-date-panel-weekdays__day`},p))),B("div",{class:`${i}-date-panel-dates`},this.dateArray.map((p,u)=>B("div",{"data-n-date":!0,key:u,class:[`${i}-date-panel-date`,{[`${i}-date-panel-date--current`]:p.isCurrentDate,[`${i}-date-panel-date--selected`]:p.selected,[`${i}-date-panel-date--excluded`]:!p.inCurrentMonth,[`${i}-date-panel-date--disabled`]:this.mergedIsDateDisabled(p.ts,{type:"date",year:p.dateObject.year,month:p.dateObject.month,date:p.dateObject.date})}],onClick:()=>{this.handleDateClick(p)}},B("div",{class:`${i}-date-panel-date__trigger`}),p.dateObject.date,p.isCurrentDate?B("div",{class:`${i}-date-panel-date__sup`}):null)))),this.datePickerSlots.footer?B("div",{class:`${i}-date-panel-footer`},this.datePickerSlots.footer()):null,!((e=this.actions)===null||e===void 0)&&e.length||d?B("div",{class:`${i}-date-panel-actions`},B("div",{class:`${i}-date-panel-actions__prefix`},d&&Object.keys(d).map(p=>{const u=d[p];return Array.isArray(u)?null:B(fi,{size:"tiny",onMouseenter:()=>{this.handleSingleShortcutMouseenter(u)},onClick:()=>{this.handleSingleShortcutClick(u)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>p})})),B("div",{class:`${i}-date-panel-actions__suffix`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?xs(this.$slots.clear,{onClear:this.clearSelectedDateTime,text:this.locale.clear},()=>[B(gn,{theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,size:"tiny",onClick:this.clearSelectedDateTime},{default:()=>this.locale.clear})]):null,!((n=this.actions)===null||n===void 0)&&n.includes("now")?xs(c.now,{onNow:this.handleNowClick,text:this.locale.now},()=>[B(gn,{theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,size:"tiny",onClick:this.handleNowClick},{default:()=>this.locale.now})]):null,!((s=this.actions)===null||s===void 0)&&s.includes("confirm")?xs(c.confirm,{onConfirm:this.handleConfirmClick,disabled:this.isDateInvalid,text:this.locale.confirm},()=>[B(gn,{theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,size:"tiny",type:"primary",disabled:this.isDateInvalid,onClick:this.handleConfirmClick},{default:()=>this.locale.confirm})]):null)):null,B(lr,{onFocus:this.handleFocusDetectorFocus}))}}),zA=Ae({name:"DateTimeRangePanel",props:Sh,setup(e){return Ch(e,"datetimerange")},render(){var e,t,n;const{mergedClsPrefix:s,mergedTheme:i,shortcuts:a,timePickerProps:d,onRender:r,$slots:o}=this;return r==null||r(),B("div",{ref:"selfRef",tabindex:0,class:[`${s}-date-panel`,`${s}-date-panel--datetimerange`,!this.panel&&`${s}-date-panel--shadow`,this.themeClass],onKeydown:this.handlePanelKeyDown,onFocus:this.handlePanelFocus},B("div",{class:`${s}-date-panel-header`},B(Is,{value:this.startDateDisplayString,theme:i.peers.Input,themeOverrides:i.peerOverrides.Input,size:this.timePickerSize,stateful:!1,readonly:this.inputReadonly,class:`${s}-date-panel-date-input`,textDecoration:this.isStartValueInvalid?"line-through":"",placeholder:this.locale.selectDate,onBlur:this.handleStartDateInputBlur,onUpdateValue:this.handleStartDateInput}),B(yu,Object.assign({placeholder:this.locale.selectTime,format:this.timerPickerFormat,size:this.timePickerSize},Array.isArray(d)?d[0]:d,{value:this.startTimeValue,to:!1,showIcon:!1,disabled:this.isSelecting,theme:i.peers.TimePicker,themeOverrides:i.peerOverrides.TimePicker,stateful:!1,isHourDisabled:this.isStartHourDisabled,isMinuteDisabled:this.isStartMinuteDisabled,isSecondDisabled:this.isStartSecondDisabled,onUpdateValue:this.handleStartTimePickerChange})),B(Is,{value:this.endDateInput,theme:i.peers.Input,themeOverrides:i.peerOverrides.Input,stateful:!1,size:this.timePickerSize,readonly:this.inputReadonly,class:`${s}-date-panel-date-input`,textDecoration:this.isEndValueInvalid?"line-through":"",placeholder:this.locale.selectDate,onBlur:this.handleEndDateInputBlur,onUpdateValue:this.handleEndDateInput}),B(yu,Object.assign({placeholder:this.locale.selectTime,format:this.timerPickerFormat,size:this.timePickerSize},Array.isArray(d)?d[1]:d,{disabled:this.isSelecting,showIcon:!1,theme:i.peers.TimePicker,themeOverrides:i.peerOverrides.TimePicker,to:!1,stateful:!1,value:this.endTimeValue,isHourDisabled:this.isEndHourDisabled,isMinuteDisabled:this.isEndMinuteDisabled,isSecondDisabled:this.isEndSecondDisabled,onUpdateValue:this.handleEndTimePickerChange}))),B("div",{ref:"startDatesElRef",class:`${s}-date-panel-calendar ${s}-date-panel-calendar--start`},B("div",{class:`${s}-date-panel-month`},B("div",{class:`${s}-date-panel-month__fast-prev`,onClick:this.startCalendarPrevYear},Jt(o["prev-year"],()=>[B(ir,null)])),B("div",{class:`${s}-date-panel-month__prev`,onClick:this.startCalendarPrevMonth},Jt(o["prev-month"],()=>[B(sr,null)])),B(yo,{monthYearSeparator:this.calendarHeaderMonthYearSeparator,monthBeforeYear:this.calendarMonthBeforeYear,value:this.startCalendarDateTime,onUpdateValue:this.onUpdateStartCalendarValue,mergedClsPrefix:s,calendarMonth:this.startCalendarMonth,calendarYear:this.startCalendarYear}),B("div",{class:`${s}-date-panel-month__next`,onClick:this.startCalendarNextMonth},Jt(o["next-month"],()=>[B(or,null)])),B("div",{class:`${s}-date-panel-month__fast-next`,onClick:this.startCalendarNextYear},Jt(o["next-year"],()=>[B(rr,null)]))),B("div",{class:`${s}-date-panel-weekdays`},this.weekdays.map(c=>B("div",{key:c,class:`${s}-date-panel-weekdays__day`},c))),B("div",{class:`${s}-date-panel__divider`}),B("div",{class:`${s}-date-panel-dates`},this.startDateArray.map((c,p)=>{const u=this.mergedIsDateDisabled(c.ts);return B("div",{"data-n-date":!0,key:p,class:[`${s}-date-panel-date`,{[`${s}-date-panel-date--excluded`]:!c.inCurrentMonth,[`${s}-date-panel-date--current`]:c.isCurrentDate,[`${s}-date-panel-date--selected`]:c.selected,[`${s}-date-panel-date--covered`]:c.inSpan,[`${s}-date-panel-date--start`]:c.startOfSpan,[`${s}-date-panel-date--end`]:c.endOfSpan,[`${s}-date-panel-date--disabled`]:u}],onClick:u?void 0:()=>{this.handleDateClick(c)},onMouseenter:u?void 0:()=>{this.handleDateMouseEnter(c)}},B("div",{class:`${s}-date-panel-date__trigger`}),c.dateObject.date,c.isCurrentDate?B("div",{class:`${s}-date-panel-date__sup`}):null)}))),B("div",{class:`${s}-date-panel__vertical-divider`}),B("div",{ref:"endDatesElRef",class:`${s}-date-panel-calendar ${s}-date-panel-calendar--end`},B("div",{class:`${s}-date-panel-month`},B("div",{class:`${s}-date-panel-month__fast-prev`,onClick:this.endCalendarPrevYear},Jt(o["prev-year"],()=>[B(ir,null)])),B("div",{class:`${s}-date-panel-month__prev`,onClick:this.endCalendarPrevMonth},Jt(o["prev-month"],()=>[B(sr,null)])),B(yo,{monthBeforeYear:this.calendarMonthBeforeYear,value:this.endCalendarDateTime,onUpdateValue:this.onUpdateEndCalendarValue,mergedClsPrefix:s,monthYearSeparator:this.calendarHeaderMonthYearSeparator,calendarMonth:this.endCalendarMonth,calendarYear:this.endCalendarYear}),B("div",{class:`${s}-date-panel-month__next`,onClick:this.endCalendarNextMonth},Jt(o["next-month"],()=>[B(or,null)])),B("div",{class:`${s}-date-panel-month__fast-next`,onClick:this.endCalendarNextYear},Jt(o["next-year"],()=>[B(rr,null)]))),B("div",{class:`${s}-date-panel-weekdays`},this.weekdays.map(c=>B("div",{key:c,class:`${s}-date-panel-weekdays__day`},c))),B("div",{class:`${s}-date-panel__divider`}),B("div",{class:`${s}-date-panel-dates`},this.endDateArray.map((c,p)=>{const u=this.mergedIsDateDisabled(c.ts);return B("div",{"data-n-date":!0,key:p,class:[`${s}-date-panel-date`,{[`${s}-date-panel-date--excluded`]:!c.inCurrentMonth,[`${s}-date-panel-date--current`]:c.isCurrentDate,[`${s}-date-panel-date--selected`]:c.selected,[`${s}-date-panel-date--covered`]:c.inSpan,[`${s}-date-panel-date--start`]:c.startOfSpan,[`${s}-date-panel-date--end`]:c.endOfSpan,[`${s}-date-panel-date--disabled`]:u}],onClick:u?void 0:()=>{this.handleDateClick(c)},onMouseenter:u?void 0:()=>{this.handleDateMouseEnter(c)}},B("div",{class:`${s}-date-panel-date__trigger`}),c.dateObject.date,c.isCurrentDate?B("div",{class:`${s}-date-panel-date__sup`}):null)}))),this.datePickerSlots.footer?B("div",{class:`${s}-date-panel-footer`},this.datePickerSlots.footer()):null,!((e=this.actions)===null||e===void 0)&&e.length||a?B("div",{class:`${s}-date-panel-actions`},B("div",{class:`${s}-date-panel-actions__prefix`},a&&Object.keys(a).map(c=>{const p=a[c];return Array.isArray(p)||typeof p=="function"?B(fi,{size:"tiny",onMouseenter:()=>{this.handleRangeShortcutMouseenter(p)},onClick:()=>{this.handleRangeShortcutClick(p)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>c}):null})),B("div",{class:`${s}-date-panel-actions__suffix`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?xs(o.clear,{onClear:this.handleClearClick,text:this.locale.clear},()=>[B(gn,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",onClick:this.handleClearClick},{default:()=>this.locale.clear})]):null,!((n=this.actions)===null||n===void 0)&&n.includes("confirm")?xs(o.confirm,{onConfirm:this.handleConfirmClick,disabled:this.isRangeInvalid||this.isSelecting,text:this.locale.confirm},()=>[B(gn,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",type:"primary",disabled:this.isRangeInvalid||this.isSelecting,onClick:this.handleConfirmClick},{default:()=>this.locale.confirm})]):null)):null,B(lr,{onFocus:this.handleFocusDetectorFocus}))}}),UA=Ae({name:"MonthRangePanel",props:Object.assign(Object.assign({},Sh),{type:{type:String,required:!0}}),setup(e){const t=Ch(e,e.type),{dateLocaleRef:n}=Qs("DatePicker"),s=(i,a,d,r)=>{const{handleColItemClick:o}=t;return B("div",{"data-n-date":!0,key:a,class:[`${d}-date-panel-month-calendar__picker-col-item`,i.isCurrent&&`${d}-date-panel-month-calendar__picker-col-item--current`,i.selected&&`${d}-date-panel-month-calendar__picker-col-item--selected`,!1],onClick:()=>{o(i,r)}},i.type==="month"?j_(i.dateObject.month,i.monthFormat,n.value.locale):i.type==="quarter"?Y_(i.dateObject.quarter,i.quarterFormat,n.value.locale):q_(i.dateObject.year,i.yearFormat,n.value.locale))};return Dt(()=>{t.justifyColumnsScrollState()}),Object.assign(Object.assign({},t),{renderItem:s})},render(){var e,t,n;const{mergedClsPrefix:s,mergedTheme:i,shortcuts:a,type:d,renderItem:r,onRender:o}=this;return o==null||o(),B("div",{ref:"selfRef",tabindex:0,class:[`${s}-date-panel`,`${s}-date-panel--daterange`,!this.panel&&`${s}-date-panel--shadow`,this.themeClass],onKeydown:this.handlePanelKeyDown,onFocus:this.handlePanelFocus},B("div",{ref:"startDatesElRef",class:`${s}-date-panel-calendar ${s}-date-panel-calendar--start`},B("div",{class:`${s}-date-panel-month-calendar`},B(As,{ref:"startYearScrollbarRef",class:`${s}-date-panel-month-calendar__picker-col`,theme:i.peers.Scrollbar,themeOverrides:i.peerOverrides.Scrollbar,container:()=>this.virtualListContainer("start"),content:()=>this.virtualListContent("start"),horizontalRailStyle:{zIndex:1},verticalRailStyle:{zIndex:1}},{default:()=>B(go,{ref:"startYearVlRef",items:this.startYearArray,itemSize:$r,showScrollbar:!1,keyField:"ts",onScroll:this.handleStartYearVlScroll,paddingBottom:4},{default:({item:c,index:p})=>r(c,p,s,"start")})}),d==="monthrange"||d==="quarterrange"?B("div",{class:`${s}-date-panel-month-calendar__picker-col`},B(As,{ref:"startMonthScrollbarRef",theme:i.peers.Scrollbar,themeOverrides:i.peerOverrides.Scrollbar},{default:()=>[(d==="monthrange"?this.startMonthArray:this.startQuarterArray).map((c,p)=>r(c,p,s,"start")),d==="monthrange"&&B("div",{class:`${s}-date-panel-month-calendar__padding`})]})):null)),B("div",{class:`${s}-date-panel__vertical-divider`}),B("div",{ref:"endDatesElRef",class:`${s}-date-panel-calendar ${s}-date-panel-calendar--end`},B("div",{class:`${s}-date-panel-month-calendar`},B(As,{ref:"endYearScrollbarRef",class:`${s}-date-panel-month-calendar__picker-col`,theme:i.peers.Scrollbar,themeOverrides:i.peerOverrides.Scrollbar,container:()=>this.virtualListContainer("end"),content:()=>this.virtualListContent("end"),horizontalRailStyle:{zIndex:1},verticalRailStyle:{zIndex:1}},{default:()=>B(go,{ref:"endYearVlRef",items:this.endYearArray,itemSize:$r,showScrollbar:!1,keyField:"ts",onScroll:this.handleEndYearVlScroll,paddingBottom:4},{default:({item:c,index:p})=>r(c,p,s,"end")})}),d==="monthrange"||d==="quarterrange"?B("div",{class:`${s}-date-panel-month-calendar__picker-col`},B(As,{ref:"endMonthScrollbarRef",theme:i.peers.Scrollbar,themeOverrides:i.peerOverrides.Scrollbar},{default:()=>[(d==="monthrange"?this.endMonthArray:this.endQuarterArray).map((c,p)=>r(c,p,s,"end")),d==="monthrange"&&B("div",{class:`${s}-date-panel-month-calendar__padding`})]})):null)),this.datePickerSlots.footer?B("div",{class:`${s}-date-panel-footer`},ag(this.datePickerSlots,"footer")):null,!((e=this.actions)===null||e===void 0)&&e.length||a?B("div",{class:`${s}-date-panel-actions`},B("div",{class:`${s}-date-panel-actions__prefix`},a&&Object.keys(a).map(c=>{const p=a[c];return Array.isArray(p)||typeof p=="function"?B(fi,{size:"tiny",onMouseenter:()=>{this.handleRangeShortcutMouseenter(p)},onClick:()=>{this.handleRangeShortcutClick(p)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>c}):null})),B("div",{class:`${s}-date-panel-actions__suffix`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?xs(this.$slots.clear,{onClear:this.handleClearClick,text:this.locale.clear},()=>[B(fi,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",onClick:this.handleClearClick},{default:()=>this.locale.clear})]):null,!((n=this.actions)===null||n===void 0)&&n.includes("confirm")?xs(this.$slots.confirm,{disabled:this.isRangeInvalid,onConfirm:this.handleConfirmClick,text:this.locale.confirm},()=>[B(fi,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",type:"primary",disabled:this.isRangeInvalid,onClick:this.handleConfirmClick},{default:()=>this.locale.confirm})]):null)):null,B(lr,{onFocus:this.handleFocusDetectorFocus}))}}),VA=Object.assign(Object.assign({},Ht.props),{to:cs.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,updateValueOnClose:Boolean,calendarDayFormat:String,calendarHeaderYearFormat:String,calendarHeaderMonthFormat:String,calendarHeaderMonthYearSeparator:{type:String,default:" "},calendarHeaderMonthBeforeYear:{type:Boolean,default:void 0},defaultValue:[Number,Array],defaultFormattedValue:[String,Array],defaultTime:[Number,String,Array],disabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom-start"},value:[Number,Array],formattedValue:[String,Array],size:String,type:{type:String,default:"date"},valueFormat:String,separator:String,placeholder:String,startPlaceholder:String,endPlaceholder:String,format:String,dateFormat:String,timerPickerFormat:String,actions:Array,shortcuts:Object,isDateDisabled:Function,isTimeDisabled:Function,show:{type:Boolean,default:void 0},panel:Boolean,ranges:Object,firstDayOfWeek:Number,inputReadonly:Boolean,closeOnSelect:Boolean,status:String,timePickerProps:[Object,Array],onClear:Function,onConfirm:Function,defaultCalendarStartTime:Number,defaultCalendarEndTime:Number,bindCalendarMonths:Boolean,monthFormat:{type:String,default:"M"},yearFormat:{type:String,default:"y"},quarterFormat:{type:String,default:"'Q'Q"},yearRange:{type:Array,default:()=>[1901,2100]},"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],"onUpdate:formattedValue":[Function,Array],onUpdateFormattedValue:[Function,Array],"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onNextMonth:Function,onPrevMonth:Function,onNextYear:Function,onPrevYear:Function,onChange:[Function,Array]}),KA=ze([Ce("date-picker",` - position: relative; - z-index: auto; - `,[Ce("date-picker-icon",` - color: var(--n-icon-color-override); - transition: color .3s var(--n-bezier); - `),Ce("icon",` - color: var(--n-icon-color-override); - transition: color .3s var(--n-bezier); - `),Ve("disabled",[Ce("date-picker-icon",` - color: var(--n-icon-color-disabled-override); - `),Ce("icon",` - color: var(--n-icon-color-disabled-override); - `)])]),Ce("date-panel",` - width: fit-content; - outline: none; - margin: 4px 0; - display: grid; - grid-template-columns: 0fr; - border-radius: var(--n-panel-border-radius); - background-color: var(--n-panel-color); - color: var(--n-panel-text-color); - user-select: none; - `,[Eo(),Ve("shadow",` - box-shadow: var(--n-panel-box-shadow); - `),Ce("date-panel-calendar",{padding:"var(--n-calendar-left-padding)",display:"grid",gridTemplateColumns:"1fr",gridArea:"left-calendar"},[Ve("end",{padding:"var(--n-calendar-right-padding)",gridArea:"right-calendar"})]),Ce("date-panel-month-calendar",{display:"flex",gridArea:"left-calendar"},[Ge("picker-col",` - min-width: var(--n-scroll-item-width); - height: calc(var(--n-scroll-item-height) * 6); - user-select: none; - -webkit-user-select: none; - `,[ze("&:first-child",` - min-width: calc(var(--n-scroll-item-width) + 4px); - `,[Ge("picker-col-item",[ze("&::before","left: 4px;")])]),Ge("padding",` - height: calc(var(--n-scroll-item-height) * 5) - `)]),Ge("picker-col-item",` - z-index: 0; - cursor: pointer; - height: var(--n-scroll-item-height); - box-sizing: border-box; - padding-top: 4px; - display: flex; - align-items: center; - justify-content: center; - position: relative; - transition: - color .3s var(--n-bezier), - background-color .3s var(--n-bezier); - background: #0000; - color: var(--n-item-text-color); - `,[ze("&::before",` - z-index: -1; - content: ""; - position: absolute; - left: 0; - right: 4px; - top: 4px; - bottom: 0; - border-radius: var(--n-scroll-item-border-radius); - transition: - background-color .3s var(--n-bezier); - `),Cn("disabled",[ze("&:hover::before",` - background-color: var(--n-item-color-hover); - `),Ve("selected",` - color: var(--n-item-color-active); - `,[ze("&::before","background-color: var(--n-item-color-hover);")])]),Ve("disabled",` - color: var(--n-item-text-color-disabled); - cursor: not-allowed; - `,[Ve("selected",[ze("&::before",` - background-color: var(--n-item-color-disabled); - `)])])])]),Ve("date",{gridTemplateAreas:` - "left-calendar" - "footer" - "action" - `}),Ve("week",{gridTemplateAreas:` - "left-calendar" - "footer" - "action" - `}),Ve("daterange",{gridTemplateAreas:` - "left-calendar divider right-calendar" - "footer footer footer" - "action action action" - `}),Ve("datetime",{gridTemplateAreas:` - "header" - "left-calendar" - "footer" - "action" - `}),Ve("datetimerange",{gridTemplateAreas:` - "header header header" - "left-calendar divider right-calendar" - "footer footer footer" - "action action action" - `}),Ve("month",{gridTemplateAreas:` - "left-calendar" - "footer" - "action" - `}),Ce("date-panel-footer",{gridArea:"footer"}),Ce("date-panel-actions",{gridArea:"action"}),Ce("date-panel-header",{gridArea:"header"}),Ce("date-panel-header",` - box-sizing: border-box; - width: 100%; - align-items: center; - padding: var(--n-panel-header-padding); - display: flex; - justify-content: space-between; - border-bottom: 1px solid var(--n-panel-header-divider-color); - `,[ze(">",[ze("*:not(:last-child)",{marginRight:"10px"}),ze("*",{flex:1,width:0}),Ce("time-picker",{zIndex:1})])]),Ce("date-panel-month",` - box-sizing: border-box; - display: grid; - grid-template-columns: var(--n-calendar-title-grid-template-columns); - align-items: center; - justify-items: center; - padding: var(--n-calendar-title-padding); - height: var(--n-calendar-title-height); - `,[Ge("prev, next, fast-prev, fast-next",` - line-height: 0; - cursor: pointer; - width: var(--n-arrow-size); - height: var(--n-arrow-size); - color: var(--n-arrow-color); - `),Ge("month-year",` - user-select: none; - -webkit-user-select: none; - flex-grow: 1; - position: relative; - `,[Ge("text",` - font-size: var(--n-calendar-title-font-size); - line-height: var(--n-calendar-title-font-size); - font-weight: var(--n-calendar-title-font-weight); - padding: 6px 8px; - text-align: center; - color: var(--n-calendar-title-text-color); - cursor: pointer; - transition: background-color .3s var(--n-bezier); - border-radius: var(--n-panel-border-radius); - `,[Ve("active",` - background-color: var(--n-calendar-title-color-hover); - `),ze("&:hover",` - background-color: var(--n-calendar-title-color-hover); - `)])])]),Ce("date-panel-weekdays",` - display: grid; - margin: auto; - grid-template-columns: repeat(7, var(--n-item-cell-width)); - grid-template-rows: repeat(1, var(--n-item-cell-height)); - align-items: center; - justify-items: center; - margin-bottom: 4px; - border-bottom: 1px solid var(--n-calendar-days-divider-color); - `,[Ge("day",` - white-space: nowrap; - user-select: none; - -webkit-user-select: none; - line-height: 15px; - width: var(--n-item-size); - text-align: center; - font-size: var(--n-calendar-days-font-size); - color: var(--n-item-text-color); - display: flex; - align-items: center; - justify-content: center; - `)]),Ce("date-panel-dates",` - margin: auto; - display: grid; - grid-template-columns: repeat(7, var(--n-item-cell-width)); - grid-template-rows: repeat(6, var(--n-item-cell-height)); - align-items: center; - justify-items: center; - flex-wrap: wrap; - `,[Ce("date-panel-date",` - user-select: none; - -webkit-user-select: none; - position: relative; - width: var(--n-item-size); - height: var(--n-item-size); - line-height: var(--n-item-size); - text-align: center; - font-size: var(--n-item-font-size); - border-radius: var(--n-item-border-radius); - z-index: 0; - cursor: pointer; - transition: - background-color .2s var(--n-bezier), - color .2s var(--n-bezier); - `,[Ge("trigger",` - position: absolute; - left: calc(var(--n-item-size) / 2 - var(--n-item-cell-width) / 2); - top: calc(var(--n-item-size) / 2 - var(--n-item-cell-height) / 2); - width: var(--n-item-cell-width); - height: var(--n-item-cell-height); - `),Ve("current",[Ge("sup",` - position: absolute; - top: 2px; - right: 2px; - content: ""; - height: 4px; - width: 4px; - border-radius: 2px; - background-color: var(--n-item-color-active); - transition: - background-color .2s var(--n-bezier); - `)]),ze("&::after",` - content: ""; - z-index: -1; - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - border-radius: inherit; - transition: background-color .3s var(--n-bezier); - `),Ve("covered, start, end",[Cn("excluded",[ze("&::before",` - content: ""; - z-index: -2; - position: absolute; - left: calc((var(--n-item-size) - var(--n-item-cell-width)) / 2); - right: calc((var(--n-item-size) - var(--n-item-cell-width)) / 2); - top: 0; - bottom: 0; - background-color: var(--n-item-color-included); - `),ze("&:nth-child(7n + 1)::before",{borderTopLeftRadius:"var(--n-item-border-radius)",borderBottomLeftRadius:"var(--n-item-border-radius)"}),ze("&:nth-child(7n + 7)::before",{borderTopRightRadius:"var(--n-item-border-radius)",borderBottomRightRadius:"var(--n-item-border-radius)"})])]),Ve("selected",{color:"var(--n-item-text-color-active)"},[ze("&::after",{backgroundColor:"var(--n-item-color-active)"}),Ve("start",[ze("&::before",{left:"50%"})]),Ve("end",[ze("&::before",{right:"50%"})]),Ge("sup",{backgroundColor:"var(--n-panel-color)"})]),Ve("excluded",{color:"var(--n-item-text-color-disabled)"},[Ve("selected",[ze("&::after",{backgroundColor:"var(--n-item-color-disabled)"})])]),Ve("disabled",{cursor:"not-allowed",color:"var(--n-item-text-color-disabled)"},[Ve("covered",[ze("&::before",{backgroundColor:"var(--n-item-color-disabled)"})]),Ve("selected",[ze("&::before",{backgroundColor:"var(--n-item-color-disabled)"}),ze("&::after",{backgroundColor:"var(--n-item-color-disabled)"})])]),Ve("week-hovered",[ze("&::before",` - background-color: var(--n-item-color-included); - `),ze("&:nth-child(7n + 1)::before",` - border-top-left-radius: var(--n-item-border-radius); - border-bottom-left-radius: var(--n-item-border-radius); - `),ze("&:nth-child(7n + 7)::before",` - border-top-right-radius: var(--n-item-border-radius); - border-bottom-right-radius: var(--n-item-border-radius); - `)]),Ve("week-selected",` - color: var(--n-item-text-color-active) - `,[ze("&::before",` - background-color: var(--n-item-color-active); - `),ze("&:nth-child(7n + 1)::before",` - border-top-left-radius: var(--n-item-border-radius); - border-bottom-left-radius: var(--n-item-border-radius); - `),ze("&:nth-child(7n + 7)::before",` - border-top-right-radius: var(--n-item-border-radius); - border-bottom-right-radius: var(--n-item-border-radius); - `)])])]),Cn("week",[Ce("date-panel-dates",[Ce("date-panel-date",[Cn("disabled",[Cn("selected",[ze("&:hover",` - background-color: var(--n-item-color-hover); - `)])])])])]),Ve("week",[Ce("date-panel-dates",[Ce("date-panel-date",[ze("&::before",` - content: ""; - z-index: -2; - position: absolute; - left: calc((var(--n-item-size) - var(--n-item-cell-width)) / 2); - right: calc((var(--n-item-size) - var(--n-item-cell-width)) / 2); - top: 0; - bottom: 0; - transition: background-color .3s var(--n-bezier); - `)])])]),Ge("vertical-divider",` - grid-area: divider; - height: 100%; - width: 1px; - background-color: var(--n-calendar-divider-color); - `),Ce("date-panel-footer",` - border-top: 1px solid var(--n-panel-action-divider-color); - padding: var(--n-panel-extra-footer-padding); - `),Ce("date-panel-actions",` - flex: 1; - padding: var(--n-panel-action-padding); - display: flex; - align-items: center; - justify-content: space-between; - border-top: 1px solid var(--n-panel-action-divider-color); - `,[Ge("prefix, suffix",` - display: flex; - margin-bottom: -8px; - `),Ge("suffix",` - align-self: flex-end; - `),Ge("prefix",` - flex-wrap: wrap; - `),Ce("button",` - margin-bottom: 8px; - `,[ze("&:not(:last-child)",` - margin-right: 8px; - `)])])]),ze("[data-n-date].transition-disabled",{transition:"none !important"},[ze("&::before, &::after",{transition:"none !important"})])]);function WA(e,t){const n=q(()=>{const{isTimeDisabled:p}=e,{value:u}=t;if(!(u===null||Array.isArray(u)))return p==null?void 0:p(u)}),s=q(()=>{var p;return(p=n.value)===null||p===void 0?void 0:p.isHourDisabled}),i=q(()=>{var p;return(p=n.value)===null||p===void 0?void 0:p.isMinuteDisabled}),a=q(()=>{var p;return(p=n.value)===null||p===void 0?void 0:p.isSecondDisabled}),d=q(()=>{const{type:p,isDateDisabled:u}=e,{value:g}=t;return g===null||Array.isArray(g)||!["date","datetime"].includes(p)||!u?!1:u(g,{type:"input"})}),r=q(()=>{const{type:p}=e,{value:u}=t;if(u===null||p==="datetime"||Array.isArray(u))return!1;const g=new Date(u),m=g.getHours(),y=g.getMinutes(),v=g.getMinutes();return(s.value?s.value(m):!1)||(i.value?i.value(y,m):!1)||(a.value?a.value(v,y,m):!1)}),o=q(()=>d.value||r.value);return{isValueInvalidRef:q(()=>{const{type:p}=e;return p==="date"?d.value:p==="datetime"?o.value:!1}),isDateInvalidRef:d,isTimeInvalidRef:r,isDateTimeInvalidRef:o,isHourDisabledRef:s,isMinuteDisabledRef:i,isSecondDisabledRef:a}}function jA(e,t){const n=q(()=>{const{isTimeDisabled:u}=e,{value:g}=t;return!Array.isArray(g)||!u?[void 0,void 0]:[u==null?void 0:u(g[0],"start",g),u==null?void 0:u(g[1],"end",g)]}),s={isStartHourDisabledRef:q(()=>{var u;return(u=n.value[0])===null||u===void 0?void 0:u.isHourDisabled}),isEndHourDisabledRef:q(()=>{var u;return(u=n.value[1])===null||u===void 0?void 0:u.isHourDisabled}),isStartMinuteDisabledRef:q(()=>{var u;return(u=n.value[0])===null||u===void 0?void 0:u.isMinuteDisabled}),isEndMinuteDisabledRef:q(()=>{var u;return(u=n.value[1])===null||u===void 0?void 0:u.isMinuteDisabled}),isStartSecondDisabledRef:q(()=>{var u;return(u=n.value[0])===null||u===void 0?void 0:u.isSecondDisabled}),isEndSecondDisabledRef:q(()=>{var u;return(u=n.value[1])===null||u===void 0?void 0:u.isSecondDisabled})},i=q(()=>{const{type:u,isDateDisabled:g}=e,{value:m}=t;return m===null||!Array.isArray(m)||!["daterange","datetimerange"].includes(u)||!g?!1:g(m[0],"start",m)}),a=q(()=>{const{type:u,isDateDisabled:g}=e,{value:m}=t;return m===null||!Array.isArray(m)||!["daterange","datetimerange"].includes(u)||!g?!1:g(m[1],"end",m)}),d=q(()=>{const{type:u}=e,{value:g}=t;if(g===null||!Array.isArray(g)||u!=="datetimerange")return!1;const m=Gi(g[0]),y=Vl(g[0]),v=Kl(g[0]),{isStartHourDisabledRef:l,isStartMinuteDisabledRef:h,isStartSecondDisabledRef:f}=s;return(l.value?l.value(m):!1)||(h.value?h.value(y,m):!1)||(f.value?f.value(v,y,m):!1)}),r=q(()=>{const{type:u}=e,{value:g}=t;if(g===null||!Array.isArray(g)||u!=="datetimerange")return!1;const m=Gi(g[1]),y=Vl(g[1]),v=Kl(g[1]),{isEndHourDisabledRef:l,isEndMinuteDisabledRef:h,isEndSecondDisabledRef:f}=s;return(l.value?l.value(m):!1)||(h.value?h.value(y,m):!1)||(f.value?f.value(v,y,m):!1)}),o=q(()=>i.value||d.value),c=q(()=>a.value||r.value),p=q(()=>o.value||c.value);return Object.assign(Object.assign({},s),{isStartDateInvalidRef:i,isEndDateInvalidRef:a,isStartTimeInvalidRef:d,isEndTimeInvalidRef:r,isStartValueInvalidRef:o,isEndValueInvalidRef:c,isRangeInvalidRef:p})}const qA=Ae({name:"DatePicker",props:VA,setup(e,{slots:t}){var n;const{localeRef:s,dateLocaleRef:i}=Qs("DatePicker"),a=ar(e),{mergedSizeRef:d,mergedDisabledRef:r,mergedStatusRef:o}=a,{mergedComponentPropsRef:c,mergedClsPrefixRef:p,mergedBorderedRef:u,namespaceRef:g,inlineThemeDisabled:m}=mn(e),y=H(null),v=H(null),l=H(null),h=H(!1),f=ct(e,"show"),_=ss(f,h),S=q(()=>({locale:i.value.locale,useAdditionalWeekYearTokens:!0})),k=q(()=>{const{format:me}=e;if(me)return me;switch(e.type){case"date":case"daterange":return s.value.dateFormat;case"datetime":case"datetimerange":return s.value.dateTimeFormat;case"year":case"yearrange":return s.value.yearTypeFormat;case"month":case"monthrange":return s.value.monthTypeFormat;case"quarter":case"quarterrange":return s.value.quarterFormat;case"week":return s.value.weekFormat}}),P=q(()=>{var me;return(me=e.valueFormat)!==null&&me!==void 0?me:k.value});function M(me){if(me===null)return null;const{value:Fe}=P,{value:fe}=S;return Array.isArray(me)?[Cs(me[0],Fe,new Date,fe).getTime(),Cs(me[1],Fe,new Date,fe).getTime()]:Cs(me,Fe,new Date,fe).getTime()}const{defaultFormattedValue:w,defaultValue:T}=e,A=H((n=w!==void 0?M(w):T)!==null&&n!==void 0?n:null),E=q(()=>{const{formattedValue:me}=e;return me!==void 0?M(me):e.value}),R=ss(E,A),D=H(null);Vs(()=>{D.value=R.value});const I=H(""),O=H(""),U=H(""),W=Ht("DatePicker","-date-picker",KA,f0,e,p),N=q(()=>{var me,Fe;return((Fe=(me=c==null?void 0:c.value)===null||me===void 0?void 0:me.DatePicker)===null||Fe===void 0?void 0:Fe.timePickerSize)||"small"}),z=q(()=>["daterange","datetimerange","monthrange","quarterrange","yearrange"].includes(e.type)),V=q(()=>{const{placeholder:me}=e;if(me===void 0){const{type:Fe}=e;switch(Fe){case"date":return s.value.datePlaceholder;case"datetime":return s.value.datetimePlaceholder;case"month":return s.value.monthPlaceholder;case"year":return s.value.yearPlaceholder;case"quarter":return s.value.quarterPlaceholder;case"week":return s.value.weekPlaceholder;default:return""}}else return me}),j=q(()=>e.startPlaceholder===void 0?e.type==="daterange"?s.value.startDatePlaceholder:e.type==="datetimerange"?s.value.startDatetimePlaceholder:e.type==="monthrange"?s.value.startMonthPlaceholder:"":e.startPlaceholder),G=q(()=>e.endPlaceholder===void 0?e.type==="daterange"?s.value.endDatePlaceholder:e.type==="datetimerange"?s.value.endDatetimePlaceholder:e.type==="monthrange"?s.value.endMonthPlaceholder:"":e.endPlaceholder),te=q(()=>{const{actions:me,type:Fe,clearable:fe}=e;if(me===null)return[];if(me!==void 0)return me;const nt=fe?["clear"]:[];switch(Fe){case"date":case"week":return nt.push("now"),nt;case"datetime":return nt.push("now","confirm"),nt;case"daterange":return nt.push("confirm"),nt;case"datetimerange":return nt.push("confirm"),nt;case"month":return nt.push("now","confirm"),nt;case"year":return nt.push("now"),nt;case"quarter":return nt.push("now","confirm"),nt;case"monthrange":case"yearrange":case"quarterrange":return nt.push("confirm"),nt;default:{Mr("date-picker","The type is wrong, n-date-picker's type only supports `date`, `datetime`, `daterange` and `datetimerange`.");break}}});function oe(me){if(me===null)return null;if(Array.isArray(me)){const{value:Fe}=P,{value:fe}=S;return[dn(me[0],Fe,fe),dn(me[1],Fe,S.value)]}else return dn(me,P.value,S.value)}function re(me){D.value=me}function ye(me,Fe){const{"onUpdate:formattedValue":fe,onUpdateFormattedValue:nt}=e;fe&&Je(fe,me,Fe),nt&&Je(nt,me,Fe)}function K(me,Fe){const{"onUpdate:value":fe,onUpdateValue:nt,onChange:At}=e,{nTriggerFormChange:St,nTriggerFormInput:xe}=a,qe=oe(me);Fe.doConfirm&&Q(me,qe),nt&&Je(nt,me,qe),fe&&Je(fe,me,qe),At&&Je(At,me,qe),A.value=me,ye(qe,me),St(),xe()}function J(){const{onClear:me}=e;me==null||me()}function Q(me,Fe){const{onConfirm:fe}=e;fe&&fe(me,Fe)}function de(me){const{onFocus:Fe}=e,{nTriggerFormFocus:fe}=a;Fe&&Je(Fe,me),fe()}function De(me){const{onBlur:Fe}=e,{nTriggerFormBlur:fe}=a;Fe&&Je(Fe,me),fe()}function Pe(me){const{"onUpdate:show":Fe,onUpdateShow:fe}=e;Fe&&Je(Fe,me),fe&&Je(fe,me),h.value=me}function Ye(me){me.key==="Escape"&&_.value&&(_a(me),wt({returnFocus:!0}))}function st(me){me.key==="Escape"&&_.value&&_a(me)}function yt(){var me;Pe(!1),(me=l.value)===null||me===void 0||me.deactivate(),J()}function ce(){var me;(me=l.value)===null||me===void 0||me.deactivate(),J()}function ae(){wt({returnFocus:!0})}function be(me){var Fe;_.value&&!(!((Fe=v.value)===null||Fe===void 0)&&Fe.contains(Dr(me)))&&wt({returnFocus:!1})}function he(me){wt({returnFocus:!0,disableUpdateOnClose:me})}function Le(me,Fe){Fe?K(me,{doConfirm:!1}):re(me)}function et(){const me=D.value;K(Array.isArray(me)?[me[0],me[1]]:me,{doConfirm:!0})}function je(){const{value:me}=D;z.value?(Array.isArray(me)||me===null)&&ie(me):Array.isArray(me)||_e(me)}function _e(me){me===null?I.value="":I.value=dn(me,k.value,S.value)}function ie(me){if(me===null)O.value="",U.value="";else{const Fe=S.value;O.value=dn(me[0],k.value,Fe),U.value=dn(me[1],k.value,Fe)}}function we(){_.value||Ze()}function Ee(me){var Fe;!((Fe=y.value)===null||Fe===void 0)&&Fe.$el.contains(me.relatedTarget)||(De(me),je(),wt({returnFocus:!1}))}function x(){r.value||(je(),wt({returnFocus:!1}))}function Re(me){if(me===""){K(null,{doConfirm:!1}),D.value=null,I.value="";return}const Fe=Cs(me,k.value,new Date,S.value);zs(Fe)?(K(ut(Fe),{doConfirm:!1}),je()):I.value=me}function Xe(me,{source:Fe}){if(me[0]===""&&me[1]===""){K(null,{doConfirm:!1}),D.value=null,O.value="",U.value="";return}const[fe,nt]=me,At=Cs(fe,k.value,new Date,S.value),St=Cs(nt,k.value,new Date,S.value);if(zs(At)&&zs(St)){let xe=ut(At),qe=ut(St);St{je()}),je(),_t(_,me=>{me||(D.value=R.value)});const tt=WA(e,D),gt=jA(e,D);kn(gc,Object.assign(Object.assign(Object.assign({mergedClsPrefixRef:p,mergedThemeRef:W,timePickerSizeRef:N,localeRef:s,dateLocaleRef:i,firstDayOfWeekRef:ct(e,"firstDayOfWeek"),isDateDisabledRef:ct(e,"isDateDisabled"),rangesRef:ct(e,"ranges"),timePickerPropsRef:ct(e,"timePickerProps"),closeOnSelectRef:ct(e,"closeOnSelect"),updateValueOnCloseRef:ct(e,"updateValueOnClose"),monthFormatRef:ct(e,"monthFormat"),yearFormatRef:ct(e,"yearFormat"),quarterFormatRef:ct(e,"quarterFormat"),yearRangeRef:ct(e,"yearRange")},tt),gt),{datePickerSlots:t}));const se={focus:()=>{var me;(me=l.value)===null||me===void 0||me.focus()},blur:()=>{var me;(me=l.value)===null||me===void 0||me.blur()}},ge=q(()=>{const{common:{cubicBezierEaseInOut:me},self:{iconColor:Fe,iconColorDisabled:fe}}=W.value;return{"--n-bezier":me,"--n-icon-color-override":Fe,"--n-icon-color-disabled-override":fe}}),Oe=m?Un("date-picker-trigger",void 0,ge,e):void 0,Ke=q(()=>{const{type:me}=e,{common:{cubicBezierEaseInOut:Fe},self:{calendarTitleFontSize:fe,calendarDaysFontSize:nt,itemFontSize:At,itemTextColor:St,itemColorDisabled:xe,itemColorIncluded:qe,itemColorHover:ht,itemColorActive:Et,itemBorderRadius:jt,itemTextColorDisabled:Kt,itemTextColorActive:Yt,panelColor:nn,panelTextColor:rn,arrowColor:Mn,calendarTitleTextColor:xn,panelActionDividerColor:Xt,panelHeaderDividerColor:Gt,calendarDaysDividerColor:Qt,panelBoxShadow:an,panelBorderRadius:Ot,calendarTitleFontWeight:jn,panelExtraFooterPadding:is,panelActionPadding:An,itemSize:Pn,itemCellWidth:Rn,itemCellHeight:In,scrollItemWidth:ke,scrollItemHeight:Qe,calendarTitlePadding:ft,calendarTitleHeight:It,calendarDaysHeight:ln,calendarDaysTextColor:Nt,arrowSize:En,panelHeaderPadding:qn,calendarDividerColor:Ln,calendarTitleGridTempateColumns:Ts,iconColor:Ws,iconColorDisabled:ei,scrollItemBorderRadius:ti,calendarTitleColorHover:Ps,[Mt("calendarLeftPadding",me)]:gi,[Mt("calendarRightPadding",me)]:mi}}=W.value;return{"--n-bezier":Fe,"--n-panel-border-radius":Ot,"--n-panel-color":nn,"--n-panel-box-shadow":an,"--n-panel-text-color":rn,"--n-panel-header-padding":qn,"--n-panel-header-divider-color":Gt,"--n-calendar-left-padding":gi,"--n-calendar-right-padding":mi,"--n-calendar-title-color-hover":Ps,"--n-calendar-title-height":It,"--n-calendar-title-padding":ft,"--n-calendar-title-font-size":fe,"--n-calendar-title-font-weight":jn,"--n-calendar-title-text-color":xn,"--n-calendar-title-grid-template-columns":Ts,"--n-calendar-days-height":ln,"--n-calendar-days-divider-color":Qt,"--n-calendar-days-font-size":nt,"--n-calendar-days-text-color":Nt,"--n-calendar-divider-color":Ln,"--n-panel-action-padding":An,"--n-panel-extra-footer-padding":is,"--n-panel-action-divider-color":Xt,"--n-item-font-size":At,"--n-item-border-radius":jt,"--n-item-size":Pn,"--n-item-cell-width":Rn,"--n-item-cell-height":In,"--n-item-text-color":St,"--n-item-color-included":qe,"--n-item-color-disabled":xe,"--n-item-color-hover":ht,"--n-item-color-active":Et,"--n-item-text-color-disabled":Kt,"--n-item-text-color-active":Yt,"--n-scroll-item-width":ke,"--n-scroll-item-height":Qe,"--n-scroll-item-border-radius":ti,"--n-arrow-size":En,"--n-arrow-color":Mn,"--n-icon-color":Ws,"--n-icon-color-disabled":ei}}),Be=m?Un("date-picker",q(()=>e.type),Ke,e):void 0;return Object.assign(Object.assign({},se),{mergedStatus:o,mergedClsPrefix:p,mergedBordered:u,namespace:g,uncontrolledValue:A,pendingValue:D,panelInstRef:y,triggerElRef:v,inputInstRef:l,isMounted:Sa(),displayTime:I,displayStartTime:O,displayEndTime:U,mergedShow:_,adjustedTo:cs(e),isRange:z,localizedStartPlaceholder:j,localizedEndPlaceholder:G,mergedSize:d,mergedDisabled:r,localizedPlacehoder:V,isValueInvalid:tt.isValueInvalidRef,isStartValueInvalid:gt.isStartValueInvalidRef,isEndValueInvalid:gt.isEndValueInvalidRef,handleInputKeydown:st,handleClickOutside:be,handleKeydown:Ye,handleClear:yt,handlePanelClear:ce,handleTriggerClick:Ue,handleInputActivate:we,handleInputDeactivate:x,handleInputFocus:xt,handleInputBlur:Ee,handlePanelTabOut:ae,handlePanelClose:he,handleRangeUpdateValue:Xe,handleSingleUpdateValue:Re,handlePanelUpdateValue:Le,handlePanelConfirm:et,mergedTheme:W,actions:te,triggerCssVars:m?void 0:ge,triggerThemeClass:Oe==null?void 0:Oe.themeClass,triggerOnRender:Oe==null?void 0:Oe.onRender,cssVars:m?void 0:Ke,themeClass:Be==null?void 0:Be.themeClass,onRender:Be==null?void 0:Be.onRender,onNextMonth:e.onNextMonth,onPrevMonth:e.onPrevMonth,onNextYear:e.onNextYear,onPrevYear:e.onPrevYear})},render(){const{clearable:e,triggerOnRender:t,mergedClsPrefix:n,$slots:s}=this,i={onUpdateValue:this.handlePanelUpdateValue,onTabOut:this.handlePanelTabOut,onClose:this.handlePanelClose,onClear:this.handlePanelClear,onKeydown:this.handleKeydown,onConfirm:this.handlePanelConfirm,ref:"panelInstRef",value:this.pendingValue,active:this.mergedShow,actions:this.actions,shortcuts:this.shortcuts,style:this.cssVars,defaultTime:this.defaultTime,themeClass:this.themeClass,panel:this.panel,inputReadonly:this.inputReadonly||this.mergedDisabled,onRender:this.onRender,onNextMonth:this.onNextMonth,onPrevMonth:this.onPrevMonth,onNextYear:this.onNextYear,onPrevYear:this.onPrevYear,timerPickerFormat:this.timerPickerFormat,dateFormat:this.dateFormat,calendarDayFormat:this.calendarDayFormat,calendarHeaderYearFormat:this.calendarHeaderYearFormat,calendarHeaderMonthFormat:this.calendarHeaderMonthFormat,calendarHeaderMonthYearSeparator:this.calendarHeaderMonthYearSeparator,calendarHeaderMonthBeforeYear:this.calendarHeaderMonthBeforeYear},a=()=>{const{type:r}=this;return r==="datetime"?B(NA,Object.assign({},i,{defaultCalendarStartTime:this.defaultCalendarStartTime}),s):r==="daterange"?B(iA,Object.assign({},i,{defaultCalendarStartTime:this.defaultCalendarStartTime,defaultCalendarEndTime:this.defaultCalendarEndTime,bindCalendarMonths:this.bindCalendarMonths}),s):r==="datetimerange"?B(zA,Object.assign({},i,{defaultCalendarStartTime:this.defaultCalendarStartTime,defaultCalendarEndTime:this.defaultCalendarEndTime,bindCalendarMonths:this.bindCalendarMonths}),s):r==="month"||r==="year"||r==="quarter"?B(my,Object.assign({},i,{type:r,key:r})):r==="monthrange"||r==="yearrange"||r==="quarterrange"?B(UA,Object.assign({},i,{type:r})):B(sA,Object.assign({},i,{type:r,defaultCalendarStartTime:this.defaultCalendarStartTime}),s)};if(this.panel)return a();t==null||t();const d={bordered:this.mergedBordered,size:this.mergedSize,passivelyActivated:!0,disabled:this.mergedDisabled,readonly:this.inputReadonly||this.mergedDisabled,clearable:e,onClear:this.handleClear,onClick:this.handleTriggerClick,onKeydown:this.handleInputKeydown,onActivate:this.handleInputActivate,onDeactivate:this.handleInputDeactivate,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur};return B("div",{ref:"triggerElRef",class:[`${n}-date-picker`,this.mergedDisabled&&`${n}-date-picker--disabled`,this.isRange&&`${n}-date-picker--range`,this.triggerThemeClass],style:this.triggerCssVars,onKeydown:this.handleKeydown},B(Ro,null,{default:()=>[B(To,null,{default:()=>this.isRange?B(Is,Object.assign({ref:"inputInstRef",status:this.mergedStatus,value:[this.displayStartTime,this.displayEndTime],placeholder:[this.localizedStartPlaceholder,this.localizedEndPlaceholder],textDecoration:[this.isStartValueInvalid?"line-through":"",this.isEndValueInvalid?"line-through":""],pair:!0,onUpdateValue:this.handleRangeUpdateValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,internalForceFocus:this.mergedShow,internalDeactivateOnEnter:!0},d),{separator:()=>this.separator===void 0?Jt(s.separator,()=>[B(Kn,{clsPrefix:n,class:`${n}-date-picker-icon`},{default:()=>B(lL,null)})]):this.separator,[e?"clear-icon-placeholder":"suffix"]:()=>Jt(s["date-icon"],()=>[B(Kn,{clsPrefix:n,class:`${n}-date-picker-icon`},{default:()=>B(qp,null)})])}):B(Is,Object.assign({ref:"inputInstRef",status:this.mergedStatus,value:this.displayTime,placeholder:this.localizedPlacehoder,textDecoration:this.isValueInvalid&&!this.isRange?"line-through":"",onUpdateValue:this.handleSingleUpdateValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,internalForceFocus:this.mergedShow,internalDeactivateOnEnter:!0},d),{[e?"clear-icon-placeholder":"suffix"]:()=>B(Kn,{clsPrefix:n,class:`${n}-date-picker-icon`},{default:()=>Jt(s["date-icon"],()=>[B(qp,null)])})})}),B(Po,{show:this.mergedShow,containerClass:this.namespace,to:this.adjustedTo,teleportDisabled:this.adjustedTo===cs.tdkey,placement:this.placement},{default:()=>B(ks,{name:"fade-in-scale-up-transition",appear:this.isMounted},{default:()=>this.mergedShow?rt(a(),[[Ar,this.handleClickOutside,void 0,{capture:!0}]]):null})})]}))}});function Ea(){const e=Ut(p0,null);return e===null&&bg("use-message","No outer founded. See prerequisite in https://www.naiveui.com/en-US/os-theme/components/message for more details. If you want to use `useMessage` outside setup, please check https://www.naiveui.com/zh-CN/os-theme/components/message#Q-&-A."),e}function YA(e){const{textColorDisabled:t}=e;return{iconColorDisabled:t}}const GA=v0({name:"InputNumber",common:ug,peers:{Button:m0,Input:g0},self:YA}),XA=ze([Ce("input-number-suffix",` - display: inline-block; - margin-right: 10px; - `),Ce("input-number-prefix",` - display: inline-block; - margin-left: 10px; - `)]);function JA(e){return e==null||typeof e=="string"&&e.trim()===""?null:Number(e)}function QA(e){return e.includes(".")&&(/^(-)?\d+.*(\.|0)$/.test(e)||/^-?\d*$/.test(e))||e==="-"||e==="-0"}function Cd(e){return e==null?!0:!Number.isNaN(e)}function Tv(e,t){return typeof e!="number"?"":t===void 0?String(e):e.toFixed(t)}function kd(e){if(e===null)return null;if(typeof e=="number")return e;{const t=Number(e);return Number.isNaN(t)?null:t}}const Pv=800,Ev=100,ZA=Object.assign(Object.assign({},Ht.props),{autofocus:Boolean,loading:{type:Boolean,default:void 0},placeholder:String,defaultValue:{type:Number,default:null},value:Number,step:{type:[Number,String],default:1},min:[Number,String],max:[Number,String],size:String,disabled:{type:Boolean,default:void 0},validator:Function,bordered:{type:Boolean,default:void 0},showButton:{type:Boolean,default:!0},buttonPlacement:{type:String,default:"right"},inputProps:Object,readonly:Boolean,clearable:Boolean,keyboard:{type:Object,default:{}},updateValueOnInput:{type:Boolean,default:!0},round:{type:Boolean,default:void 0},parse:Function,format:Function,precision:Number,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onChange:[Function,Array]}),bu=Ae({name:"InputNumber",props:ZA,setup(e){const{mergedBorderedRef:t,mergedClsPrefixRef:n,mergedRtlRef:s}=mn(e),i=Ht("InputNumber","-input-number",XA,GA,e,n),{localeRef:a}=Qs("InputNumber"),d=ar(e),{mergedSizeRef:r,mergedDisabledRef:o,mergedStatusRef:c}=d,p=H(null),u=H(null),g=H(null),m=H(e.defaultValue),y=ct(e,"value"),v=ss(y,m),l=H(""),h=ae=>{const be=String(ae).split(".")[1];return be?be.length:0},f=ae=>{const be=[e.min,e.max,e.step,ae].map(he=>he===void 0?0:h(he));return Math.max(...be)},_=Zt(()=>{const{placeholder:ae}=e;return ae!==void 0?ae:a.value.placeholder}),S=Zt(()=>{const ae=kd(e.step);return ae!==null?ae===0?1:Math.abs(ae):1}),k=Zt(()=>{const ae=kd(e.min);return ae!==null?ae:null}),P=Zt(()=>{const ae=kd(e.max);return ae!==null?ae:null}),M=()=>{const{value:ae}=v;if(Cd(ae)){const{format:be,precision:he}=e;be?l.value=be(ae):ae===null||he===void 0||h(ae)>he?l.value=Tv(ae,void 0):l.value=Tv(ae,he)}else l.value=String(ae)};M();const w=ae=>{const{value:be}=v;if(ae===be){M();return}const{"onUpdate:value":he,onUpdateValue:Le,onChange:et}=e,{nTriggerFormInput:je,nTriggerFormChange:_e}=d;et&&Je(et,ae),Le&&Je(Le,ae),he&&Je(he,ae),m.value=ae,je(),_e()},T=({offset:ae,doUpdateIfValid:be,fixPrecision:he,isInputing:Le})=>{const{value:et}=l;if(Le&&QA(et))return!1;const je=(e.parse||JA)(et);if(je===null)return be&&w(null),null;if(Cd(je)){const _e=h(je),{precision:ie}=e;if(ie!==void 0&&ie<_e&&!he)return!1;let we=Number.parseFloat((je+ae).toFixed(ie??f(je)));if(Cd(we)){const{value:Ee}=P,{value:x}=k;if(Ee!==null&&we>Ee){if(!be||Le)return!1;we=Ee}if(x!==null&&weT({offset:0,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})===!1),E=Zt(()=>{const{value:ae}=v;if(e.validator&&ae===null)return!1;const{value:be}=S;return T({offset:-be,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1}),R=Zt(()=>{const{value:ae}=v;if(e.validator&&ae===null)return!1;const{value:be}=S;return T({offset:+be,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1});function D(ae){const{onFocus:be}=e,{nTriggerFormFocus:he}=d;be&&Je(be,ae),he()}function I(ae){var be,he;if(ae.target===((be=p.value)===null||be===void 0?void 0:be.wrapperElRef))return;const Le=T({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0});if(Le!==!1){const _e=(he=p.value)===null||he===void 0?void 0:he.inputElRef;_e&&(_e.value=String(Le||"")),v.value===Le&&M()}else M();const{onBlur:et}=e,{nTriggerFormBlur:je}=d;et&&Je(et,ae),je(),un(()=>{M()})}function O(ae){const{onClear:be}=e;be&&Je(be,ae)}function U(){const{value:ae}=R;if(!ae){J();return}const{value:be}=v;if(be===null)e.validator||w(V());else{const{value:he}=S;T({offset:he,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}function W(){const{value:ae}=E;if(!ae){ye();return}const{value:be}=v;if(be===null)e.validator||w(V());else{const{value:he}=S;T({offset:-he,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}const N=D,z=I;function V(){if(e.validator)return null;const{value:ae}=k,{value:be}=P;return ae!==null?Math.max(0,ae):be!==null?Math.min(0,be):0}function j(ae){O(ae),w(null)}function G(ae){var be,he,Le;!((be=g.value)===null||be===void 0)&&be.$el.contains(ae.target)&&ae.preventDefault(),!((he=u.value)===null||he===void 0)&&he.$el.contains(ae.target)&&ae.preventDefault(),(Le=p.value)===null||Le===void 0||Le.activate()}let te=null,oe=null,re=null;function ye(){re&&(window.clearTimeout(re),re=null),te&&(window.clearInterval(te),te=null)}let K=null;function J(){K&&(window.clearTimeout(K),K=null),oe&&(window.clearInterval(oe),oe=null)}function Q(){ye(),re=window.setTimeout(()=>{te=window.setInterval(()=>{W()},Ev)},Pv),Wn("mouseup",document,ye,{once:!0})}function de(){J(),K=window.setTimeout(()=>{oe=window.setInterval(()=>{U()},Ev)},Pv),Wn("mouseup",document,J,{once:!0})}const De=()=>{oe||U()},Pe=()=>{te||W()};function Ye(ae){var be,he;if(ae.key==="Enter"){if(ae.target===((be=p.value)===null||be===void 0?void 0:be.wrapperElRef))return;T({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&((he=p.value)===null||he===void 0||he.deactivate())}else if(ae.key==="ArrowUp"){if(!R.value||e.keyboard.ArrowUp===!1)return;ae.preventDefault(),T({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&U()}else if(ae.key==="ArrowDown"){if(!E.value||e.keyboard.ArrowDown===!1)return;ae.preventDefault(),T({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&W()}}function st(ae){l.value=ae,e.updateValueOnInput&&!e.format&&!e.parse&&e.precision===void 0&&T({offset:0,doUpdateIfValid:!0,isInputing:!0,fixPrecision:!1})}_t(v,()=>{M()});const yt={focus:()=>{var ae;return(ae=p.value)===null||ae===void 0?void 0:ae.focus()},blur:()=>{var ae;return(ae=p.value)===null||ae===void 0?void 0:ae.blur()},select:()=>{var ae;return(ae=p.value)===null||ae===void 0?void 0:ae.select()}},ce=pi("InputNumber",s,n);return Object.assign(Object.assign({},yt),{rtlEnabled:ce,inputInstRef:p,minusButtonInstRef:u,addButtonInstRef:g,mergedClsPrefix:n,mergedBordered:t,uncontrolledValue:m,mergedValue:v,mergedPlaceholder:_,displayedValueInvalid:A,mergedSize:r,mergedDisabled:o,displayedValue:l,addable:R,minusable:E,mergedStatus:c,handleFocus:N,handleBlur:z,handleClear:j,handleMouseDown:G,handleAddClick:De,handleMinusClick:Pe,handleAddMousedown:de,handleMinusMousedown:Q,handleKeyDown:Ye,handleUpdateDisplayedValue:st,mergedTheme:i,inputThemeOverrides:{paddingSmall:"0 8px 0 10px",paddingMedium:"0 8px 0 12px",paddingLarge:"0 8px 0 14px"},buttonThemeOverrides:q(()=>{const{self:{iconColorDisabled:ae}}=i.value,[be,he,Le,et]=_0(ae);return{textColorTextDisabled:`rgb(${be}, ${he}, ${Le})`,opacityDisabled:`${et}`}})})},render(){const{mergedClsPrefix:e,$slots:t}=this,n=()=>B(fi,{text:!0,disabled:!this.minusable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleMinusClick,onMousedown:this.handleMinusMousedown,ref:"minusButtonInstRef"},{icon:()=>Jt(t["minus-icon"],()=>[B(Kn,{clsPrefix:e},{default:()=>B(oL,null)})])}),s=()=>B(fi,{text:!0,disabled:!this.addable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleAddClick,onMousedown:this.handleAddMousedown,ref:"addButtonInstRef"},{icon:()=>Jt(t["add-icon"],()=>[B(Kn,{clsPrefix:e},{default:()=>B(tL,null)})])});return B("div",{class:[`${e}-input-number`,this.rtlEnabled&&`${e}-input-number--rtl`]},B(Is,{ref:"inputInstRef",autofocus:this.autofocus,status:this.mergedStatus,bordered:this.mergedBordered,loading:this.loading,value:this.displayedValue,onUpdateValue:this.handleUpdateDisplayedValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,builtinThemeOverrides:this.inputThemeOverrides,size:this.mergedSize,placeholder:this.mergedPlaceholder,disabled:this.mergedDisabled,readonly:this.readonly,round:this.round,textDecoration:this.displayedValueInvalid?"line-through":void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onClear:this.handleClear,clearable:this.clearable,inputProps:this.inputProps,internalLoadingBeforeSuffix:!0},{prefix:()=>{var i;return this.showButton&&this.buttonPlacement==="both"?[n(),Us(t.prefix,a=>a?B("span",{class:`${e}-input-number-prefix`},a):null)]:(i=t.prefix)===null||i===void 0?void 0:i.call(t)},suffix:()=>{var i;return this.showButton?[Us(t.suffix,a=>a?B("span",{class:`${e}-input-number-suffix`},a):null),this.buttonPlacement==="right"?n():null,s()]:(i=t.suffix)===null||i===void 0?void 0:i.call(t)}}))}}),Sy=ds("n-popconfirm"),Cy={positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},onPositiveClick:{type:Function,required:!0},onNegativeClick:{type:Function,required:!0}},Lv=mg(Cy),eI=Ae({name:"NPopconfirmPanel",props:Cy,setup(e){const{localeRef:t}=Qs("Popconfirm"),{inlineThemeDisabled:n}=mn(),{mergedClsPrefixRef:s,mergedThemeRef:i,props:a}=Ut(Sy),d=q(()=>{const{common:{cubicBezierEaseInOut:o},self:{fontSize:c,iconSize:p,iconColor:u}}=i.value;return{"--n-bezier":o,"--n-font-size":c,"--n-icon-size":p,"--n-icon-color":u}}),r=n?Un("popconfirm-panel",void 0,d,a):void 0;return Object.assign(Object.assign({},Qs("Popconfirm")),{mergedClsPrefix:s,cssVars:n?void 0:d,localizedPositiveText:q(()=>e.positiveText||t.value.positiveText),localizedNegativeText:q(()=>e.negativeText||t.value.negativeText),positiveButtonProps:ct(a,"positiveButtonProps"),negativeButtonProps:ct(a,"negativeButtonProps"),handlePositiveClick(o){e.onPositiveClick(o)},handleNegativeClick(o){e.onNegativeClick(o)},themeClass:r==null?void 0:r.themeClass,onRender:r==null?void 0:r.onRender})},render(){var e;const{mergedClsPrefix:t,showIcon:n,$slots:s}=this,i=Jt(s.action,()=>this.negativeText===null&&this.positiveText===null?[]:[this.negativeText!==null&&B(gn,Object.assign({size:"small",onClick:this.handleNegativeClick},this.negativeButtonProps),{default:()=>this.localizedNegativeText}),this.positiveText!==null&&B(gn,Object.assign({size:"small",type:"primary",onClick:this.handlePositiveClick},this.positiveButtonProps),{default:()=>this.localizedPositiveText})]);return(e=this.onRender)===null||e===void 0||e.call(this),B("div",{class:[`${t}-popconfirm__panel`,this.themeClass],style:this.cssVars},Us(s.default,a=>n||a?B("div",{class:`${t}-popconfirm__body`},n?B("div",{class:`${t}-popconfirm__icon`},Jt(s.icon,()=>[B(Kn,{clsPrefix:t},{default:()=>B(y0,null)})])):null,a):null),i?B("div",{class:[`${t}-popconfirm__action`]},i):null)}}),tI=Ce("popconfirm",[Ge("body",` - font-size: var(--n-font-size); - display: flex; - align-items: center; - flex-wrap: nowrap; - position: relative; - `,[Ge("icon",` - display: flex; - font-size: var(--n-icon-size); - color: var(--n-icon-color); - transition: color .3s var(--n-bezier); - margin: 0 8px 0 0; - `)]),Ge("action",` - display: flex; - justify-content: flex-end; - `,[ze("&:not(:first-child)","margin-top: 8px"),Ce("button",[ze("&:not(:last-child)","margin-right: 8px;")])])]),nI=Object.assign(Object.assign(Object.assign({},Ht.props),Ir),{positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},trigger:{type:String,default:"click"},positiveButtonProps:Object,negativeButtonProps:Object,onPositiveClick:Function,onNegativeClick:Function}),il=Ae({name:"Popconfirm",props:nI,__popover__:!0,setup(e){const{mergedClsPrefixRef:t}=mn(),n=Ht("Popconfirm","-popconfirm",tI,b0,e,t),s=H(null);function i(r){var o;if(!(!((o=s.value)===null||o===void 0)&&o.getMergedShow()))return;const{onPositiveClick:c,"onUpdate:show":p}=e;Promise.resolve(c?c(r):!0).then(u=>{var g;u!==!1&&((g=s.value)===null||g===void 0||g.setShow(!1),p&&Je(p,!1))})}function a(r){var o;if(!(!((o=s.value)===null||o===void 0)&&o.getMergedShow()))return;const{onNegativeClick:c,"onUpdate:show":p}=e;Promise.resolve(c?c(r):!0).then(u=>{var g;u!==!1&&((g=s.value)===null||g===void 0||g.setShow(!1),p&&Je(p,!1))})}return kn(Sy,{mergedThemeRef:n,mergedClsPrefixRef:t,props:e}),{setShow(r){var o;(o=s.value)===null||o===void 0||o.setShow(r)},syncPosition(){var r;(r=s.value)===null||r===void 0||r.syncPosition()},mergedTheme:n,popoverInstRef:s,handlePositiveClick:i,handleNegativeClick:a}},render(){const{$slots:e,$props:t,mergedTheme:n}=this;return B(Lo,Ou(t,Lv,{theme:n.peers.Popover,themeOverrides:n.peerOverrides.Popover,internalExtraClass:["popconfirm"],ref:"popoverInstRef"}),{trigger:e.activator||e.trigger,default:()=>{const s=fc(t,Lv);return B(eI,Object.assign(Object.assign({},s),{onPositiveClick:this.handlePositiveClick,onNegativeClick:this.handleNegativeClick}),e)}})}}),sI=ze([ze("@keyframes spin-rotate",` - from { - transform: rotate(0); - } - to { - transform: rotate(360deg); - } - `),Ce("spin-container",` - position: relative; - `,[Ce("spin-body",` - position: absolute; - top: 50%; - left: 50%; - transform: translateX(-50%) translateY(-50%); - `,[w0()])]),Ce("spin-body",` - display: inline-flex; - align-items: center; - justify-content: center; - flex-direction: column; - `),Ce("spin",` - display: inline-flex; - height: var(--n-size); - width: var(--n-size); - font-size: var(--n-size); - color: var(--n-color); - `,[Ve("rotate",` - animation: spin-rotate 2s linear infinite; - `)]),Ce("spin-description",` - display: inline-block; - font-size: var(--n-font-size); - color: var(--n-text-color); - transition: color .3s var(--n-bezier); - margin-top: 8px; - `),Ce("spin-content",` - opacity: 1; - transition: opacity .3s var(--n-bezier); - pointer-events: all; - `,[Ve("spinning",` - user-select: none; - -webkit-user-select: none; - pointer-events: none; - opacity: var(--n-opacity-spinning); - `)])]),iI={small:20,medium:18,large:16},rI=Object.assign(Object.assign({},Ht.props),{contentClass:String,contentStyle:[Object,String],description:String,stroke:String,size:{type:[String,Number],default:"medium"},show:{type:Boolean,default:!0},strokeWidth:Number,rotate:{type:Boolean,default:!0},spinning:{type:Boolean,validator:()=>!0,default:void 0},delay:Number}),oI=Ae({name:"Spin",props:rI,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n}=mn(e),s=Ht("Spin","-spin",sI,S0,e,t),i=q(()=>{const{size:o}=e,{common:{cubicBezierEaseInOut:c},self:p}=s.value,{opacitySpinning:u,color:g,textColor:m}=p,y=typeof o=="number"?Gn(o):p[Mt("size",o)];return{"--n-bezier":c,"--n-opacity-spinning":u,"--n-size":y,"--n-color":g,"--n-text-color":m}}),a=n?Un("spin",q(()=>{const{size:o}=e;return typeof o=="number"?String(o):o[0]}),i,e):void 0,d=nh(e,["spinning","show"]),r=H(!1);return Vs(o=>{let c;if(d.value){const{delay:p}=e;if(p){c=window.setTimeout(()=>{r.value=!0},p),o(()=>{clearTimeout(c)});return}}r.value=d.value}),{mergedClsPrefix:t,active:r,mergedStrokeWidth:q(()=>{const{strokeWidth:o}=e;if(o!==void 0)return o;const{size:c}=e;return iI[typeof c=="number"?"medium":c]}),cssVars:n?void 0:i,themeClass:a==null?void 0:a.themeClass,onRender:a==null?void 0:a.onRender}},render(){var e,t;const{$slots:n,mergedClsPrefix:s,description:i}=this,a=n.icon&&this.rotate,d=(i||n.description)&&B("div",{class:`${s}-spin-description`},i||((e=n.description)===null||e===void 0?void 0:e.call(n))),r=n.icon?B("div",{class:[`${s}-spin-body`,this.themeClass]},B("div",{class:[`${s}-spin`,a&&`${s}-spin--rotate`],style:n.default?"":this.cssVars},n.icon()),d):B("div",{class:[`${s}-spin-body`,this.themeClass]},B(tc,{clsPrefix:s,style:n.default?"":this.cssVars,stroke:this.stroke,"stroke-width":this.mergedStrokeWidth,class:`${s}-spin`}),d);return(t=this.onRender)===null||t===void 0||t.call(this),n.default?B("div",{class:[`${s}-spin-container`,this.themeClass],style:this.cssVars},B("div",{class:[`${s}-spin-content`,this.active&&`${s}-spin-content--spinning`,this.contentClass],style:this.contentStyle},n),B(ks,{name:"fade-in-transition"},{default:()=>this.active?r:null})):r}});async function aI(){const{data:e}=await vn("/admin/api/users");return e}async function lI(e){const{data:t}=await vn(`/admin/api/users/${encodeURIComponent(e)}/reset-password`,{method:"POST"});return t}async function cI(e){await vn(`/admin/api/users/${encodeURIComponent(e)}/disable`,{method:"POST"})}async function dI(e){await vn(`/admin/api/users/${encodeURIComponent(e)}/admin`,{method:"POST"})}async function uI(e){await vn(`/admin/api/users/${encodeURIComponent(e)}/admin`,{method:"DELETE"})}async function hI(){const{data:e}=await vn("/admin/api/invitations");return e}async function fI(e){const{data:t}=await vn("/admin/api/invitations",{method:"POST",body:JSON.stringify(e)});return t&&typeof t=="object"&&"invites"in t?t.invites:[t]}async function pI(){const{data:e}=await vn("/admin/api/config");return e}async function vI(e){const{data:t}=await vn("/admin/api/config",{method:"PUT",body:JSON.stringify(e)});return t}async function gI(){const{data:e}=await vn("/admin/api/feishu");return e}async function mI(e){const{data:t}=await vn("/admin/api/feishu",{method:"PUT",body:JSON.stringify(e)});return t}async function _I(){const{data:e}=await vn("/admin/api/feishu/generate-key",{method:"POST"});return e.encrypt_key}async function yI(e){const t=new URLSearchParams;e.view&&t.set("view",e.view),e.bucket&&t.set("bucket",e.bucket),e.from&&t.set("from",e.from),e.to&&t.set("to",e.to);const{data:n}=await vn(`/admin/api/traffic?${t.toString()}`);return n}async function bI(){const{data:e}=await vn("/admin/api/health");return e}const wI={class:"field"},SI={class:"field-label"},CI={class:"field"},kI={class:"field-label"},xI={class:"field"},RI={class:"field-label"},TI={class:"secret-msg"},PI={class:"secret-display"},EI={key:0,class:"empty"},LI=Ae({__name:"Invitations",setup(e){const t=H([]),n=H(!0),s=H(!1),i=H(""),a=H(1),d=H(null),r=H([]),o=Ea(),{t:c}=xo(),p={"data-testid":"invite-note",autocomplete:"off"},u={"data-testid":"invite-count"},g={"data-testid":"invite-expires"};function m(h){return wg(h)}const y=q(()=>[{title:c("admin.invitationsTab.prefix"),key:"code_prefix",render:h=>B("code",{},h.code_prefix)},{title:c("admin.invitationsTab.note"),key:"note"},{title:c("admin.created"),key:"created_at",render:h=>m(h.created_at)},{title:c("admin.invitationsTab.expires"),key:"expires_at",render:h=>m(h.expires_at)},{title:c("admin.invitationsTab.consumed"),key:"consumed_at",render:h=>h.consumed_at?B("span",{},`${m(h.consumed_at)}${h.consumed_by?" · "+h.consumed_by:""}`):B(Lr,{size:"small",type:"default"},{default:()=>c("admin.invitationsTab.unused")})}]);async function v(){n.value=!0;try{t.value=await hI()}catch(h){h instanceof Xs&&o.error(c("admin.invitationsTab.loadFailed"))}finally{n.value=!1}}async function l(h){if(h.preventDefault(),!s.value){s.value=!0;try{const f=Math.max(1,Math.min(50,Math.round(a.value||1))),_=i.value.trim(),S={count:f};_&&(S.note=_),d.value!=null&&(S.expires_at=new Date(d.value).toISOString());const k=await fI(S);r.value=k,i.value="",d.value=null,a.value=1,await v()}catch(f){f instanceof Xs&&o.error(c("admin.invitationsTab.createFailed",{code:f.code}))}finally{s.value=!1}}}return Dt(v),(h,f)=>($(),bt(C(sc),{title:C(c)("admin.invitations"),bordered:!1},{default:qt(()=>[b("form",{onSubmit:l,autocomplete:"off",class:"create-form"},[Te(C(Ns),{wrap:!1,align:"end"},{default:qt(()=>[b("div",wI,[b("label",SI,L(C(c)("admin.invitationsTab.note")),1),Te(C(Is),{value:i.value,"onUpdate:value":f[0]||(f[0]=_=>i.value=_),type:"text",placeholder:C(c)("common.optional"),"input-props":p},null,8,["value","placeholder"])]),b("div",CI,[b("label",kI,L(C(c)("admin.invitationsTab.count")),1),Te(C(bu),{value:a.value,"onUpdate:value":f[1]||(f[1]=_=>a.value=_),min:1,max:50,"input-props":u},null,8,["value"])]),b("div",xI,[b("label",RI,L(C(c)("admin.invitationsTab.expires")),1),Te(C(qA),{value:d.value,"onUpdate:value":f[2]||(f[2]=_=>d.value=_),type:"datetime",clearable:"",placeholder:C(c)("common.optional"),"input-props":g},null,8,["value","placeholder"])]),Te(C(gn),{type:"primary","attr-type":"submit",loading:s.value,disabled:s.value},{default:qt(()=>[ot(L(C(c)("common.create")),1)]),_:1},8,["loading","disabled"])]),_:1})],32),($(!0),F(Ie,null,at(r.value,(_,S)=>($(),bt(C(Tg),{key:S,type:"success","show-icon":!1,class:"secret-alert"},{default:qt(()=>[b("div",TI,L(C(c)("admin.invitationsTab.copyNow",{note:_.note?` (${_.note})`:""})),1),b("code",PI,L(_.plaintext),1)]),_:2},1024))),128)),Te(C(py),{columns:y.value,data:t.value,loading:n.value,size:"small",bordered:!1,pagination:!1},null,8,["columns","data","loading"]),!n.value&&t.value.length===0?($(),F("p",EI,L(C(c)("admin.invitationsTab.empty")),1)):Z("",!0)]),_:1},8,["title"]))}}),DI=Ct(LI,[["__scopeId","data-v-b7ce3097"]]),MI={class:"secret-msg"},AI={class:"secret-display"},II={key:0,class:"form-error",role:"alert"},$I=Ae({__name:"Users",setup(e){const t=H([]),n=H(!0),s=H(""),i=H([]);Ea();const{t:a}=xo();function d(l){return wg(l)}function r(l){if(l instanceof Xs){if(l.code==="last_admin")return a("admin.errors.lastAdmin");if(l.code==="cannot_demote_self")return a("admin.errors.cannotDemoteSelf")}return a("admin.errors.actionFailed")}async function o(){n.value=!0,s.value="";try{t.value=await aI()}catch(l){l instanceof Xs&&(s.value=a("admin.loadUsersFailed"))}finally{n.value=!1}}async function c(l){s.value="";try{await dI(l),await o()}catch(h){s.value=r(h)}}async function p(l){s.value="";try{await uI(l),await o()}catch(h){s.value=r(h)}}async function u(l,h){s.value="",i.value=[];try{const{plaintext:f}=await lI(l);i.value=[{label:a("admin.temporaryPasswordFor",{email:h}),plaintext:f}],await o()}catch(f){s.value=r(f)}}async function g(l){s.value="";try{await cI(l),await o()}catch(h){s.value=r(h)}}function m(l){return l.disabled_at?B(Lr,{size:"small",type:"error"},{default:()=>a("admin.disabled",{when:d(l.disabled_at)})}):l.is_admin?B(Lr,{size:"small",type:"success"},{default:()=>a("admin.userStatus.admin")}):B(Lr,{size:"small",type:"default"},{default:()=>a("admin.userStatus.active")})}function y(l){if(l.disabled_at)return null;const h=l.is_admin?B(il,{onPositiveClick:()=>p(l.id)},{trigger:()=>B(gn,{size:"small","data-testid":`demote-${l.id}`},{default:()=>a("admin.demote")}),default:()=>a("admin.demoteConfirm")}):B(il,{onPositiveClick:()=>c(l.id)},{trigger:()=>B(gn,{size:"small","data-testid":`promote-${l.id}`},{default:()=>a("admin.promote")}),default:()=>a("admin.promoteConfirm")}),f=B(il,{onPositiveClick:()=>u(l.id,l.email)},{trigger:()=>B(gn,{size:"small","data-testid":`reset-${l.id}`},{default:()=>a("admin.resetPassword")}),default:()=>a("admin.resetPasswordConfirm")}),_=B(il,{onPositiveClick:()=>g(l.id)},{trigger:()=>B(gn,{size:"small",type:"error","data-testid":`disable-${l.id}`},{default:()=>a("admin.disable")}),default:()=>a("admin.disableConfirm")});return B(Ns,{},{default:()=>[h,f,_]})}const v=q(()=>[{title:a("admin.email"),key:"email"},{title:a("admin.id"),key:"id",render:l=>B("code",{},l.id)},{title:a("admin.created"),key:"created_at",render:l=>d(l.created_at)},{title:a("admin.status"),key:"status",render:m},{title:a("admin.actions"),key:"actions",render:y}]);return Dt(o),(l,h)=>($(),bt(C(sc),{title:C(a)("admin.users"),bordered:!1},{default:qt(()=>[($(!0),F(Ie,null,at(i.value,(f,_)=>($(),bt(C(Tg),{key:_,type:"success","show-icon":!1,class:"secret-alert"},{default:qt(()=>[b("div",MI,L(C(a)("admin.secretCopyOnce",{label:f.label})),1),b("code",AI,L(f.plaintext),1)]),_:2},1024))),128)),Te(C(py),{columns:v.value,data:t.value,loading:n.value,size:"small",bordered:!1,pagination:!1},null,8,["columns","data","loading"]),s.value?($(),F("p",II,L(s.value),1)):Z("",!0)]),_:1},8,["title"]))}}),OI=Ct($I,[["__scopeId","data-v-b54d534a"]]),FI={class:"hint"},BI={class:"muted"},HI={class:"muted"},NI={class:"muted"},zI={class:"warn"},UI={class:"muted"},VI={class:"muted version"},KI={key:1,class:"form-error",role:"alert"},WI=Ae({__name:"Config",setup(e){const t=H(null),n=H(0),s=H(0),i=H(!1),a=H(!1),d=H(""),r=H(!0),o=H(!1),c=H(""),p=Ea(),{t:u}=xo();function g(S){return S.split(` -`).map(k=>k.trim()).filter(Boolean)}function m(S,k){return S<0?u("admin.config.effectiveDisabled"):S===0?u("admin.config.effective",{value:k}):u("admin.config.effective",{value:S})}const y=q(()=>t.value?m(n.value,t.value.default_rate_limit_per_minute):""),v=q(()=>t.value?m(s.value,t.value.default_max_connections_per_key):"");async function l(){r.value=!0,c.value="";try{const S=await pI();t.value=S,n.value=S.rate_limit_per_minute,s.value=S.max_connections_per_key,i.value=S.debug,a.value=S.debug_payload,d.value=(S.allowed_origins??[]).join(` -`)}catch(S){S instanceof Xs&&(c.value=u("admin.config.loadFailed"))}finally{r.value=!1}}async function h(){if(!(!t.value||o.value)){c.value="",o.value=!0;try{const S=await vI({rate_limit_per_minute:Math.round(n.value),max_connections_per_key:Math.round(s.value),debug:i.value,debug_payload:a.value,allowed_origins:g(d.value)});t.value=S,n.value=S.rate_limit_per_minute,s.value=S.max_connections_per_key,i.value=S.debug,a.value=S.debug_payload,d.value=(S.allowed_origins??[]).join(` -`),p.success(u("setup.saved"))}catch(S){S instanceof Xs&&(c.value=u("admin.config.saveFailed"))}finally{o.value=!1}}}const f={"data-testid":"cfg-rate"},_={"data-testid":"cfg-conn"};return Dt(l),(S,k)=>($(),bt(C(sc),{title:C(u)("admin.config.runtimeLimits"),bordered:!1},{default:qt(()=>[b("p",FI,L(C(u)("admin.config.hint")),1),t.value?($(),bt(C(Sg),{key:0,"label-placement":"top","require-mark-placement":"right-hanging"},{default:qt(()=>[Te(C(qi),{label:C(u)("admin.config.rateLimit"),"show-feedback":!1},{default:qt(()=>[Te(C(Ns),{wrap:!1,align:"center"},{default:qt(()=>[Te(C(bu),{value:n.value,"onUpdate:value":k[0]||(k[0]=P=>n.value=P),"show-button":!1,"input-props":f},null,8,["value"]),b("span",BI,L(y.value),1)]),_:1})]),_:1},8,["label"]),Te(C(qi),{label:C(u)("admin.config.maxConnections"),"show-feedback":!1},{default:qt(()=>[Te(C(Ns),{wrap:!1,align:"center"},{default:qt(()=>[Te(C(bu),{value:s.value,"onUpdate:value":k[1]||(k[1]=P=>s.value=P),"show-button":!1,"input-props":_},null,8,["value"]),b("span",HI,L(v.value),1)]),_:1})]),_:1},8,["label"]),Te(C(qi),{label:C(u)("admin.config.debug"),"show-feedback":!1},{default:qt(()=>[Te(C(Ns),{align:"center",size:8},{default:qt(()=>[Te(C(Sl),{value:i.value,"onUpdate:value":k[2]||(k[2]=P=>i.value=P),"data-testid":"cfg-debug"},null,8,["value"]),b("span",NI,L(C(u)("admin.config.debugHint")),1)]),_:1})]),_:1},8,["label"]),Te(C(qi),{label:C(u)("admin.config.debugPayload"),"show-feedback":!1},{default:qt(()=>[Te(C(Ns),{align:"center",size:8},{default:qt(()=>[Te(C(Sl),{value:a.value,"onUpdate:value":k[3]||(k[3]=P=>a.value=P),"data-testid":"cfg-debug-payload"},null,8,["value"]),b("span",zI,L(C(u)("admin.config.debugPayloadWarn")),1)]),_:1})]),_:1},8,["label"]),Te(C(qi),{label:C(u)("admin.config.allowedOrigins"),"show-feedback":!1},{default:qt(()=>[Te(C(Ns),{vertical:"",size:4,style:{width:"100%"}},{default:qt(()=>[Te(C(Is),{value:d.value,"onUpdate:value":k[4]||(k[4]=P=>d.value=P),type:"textarea",placeholder:C(u)("admin.config.allowedOriginsPlaceholder"),autosize:{minRows:3,maxRows:10},"input-props":{"data-testid":"cfg-origins"}},null,8,["value","placeholder"]),b("span",UI,L(C(u)("admin.config.allowedOriginsHint")),1)]),_:1})]),_:1},8,["label"]),Te(C(Ns),{class:"actions",align:"center"},{default:qt(()=>[Te(C(gn),{type:"primary",loading:o.value,disabled:o.value,"data-testid":"cfg-save",onClick:h},{default:qt(()=>[ot(L(C(u)("common.save")),1)]),_:1},8,["loading","disabled"]),b("span",VI,[ot(L(C(u)("common.version"))+": ",1),b("code",null,L(t.value.version),1)])]),_:1})]),_:1})):Z("",!0),c.value?($(),F("p",KI,L(c.value),1)):Z("",!0)]),_:1},8,["title"]))}}),jI=Ct(WI,[["__scopeId","data-v-be878b2d"]]),qI={class:"hint"},YI={key:0,class:"warn"},GI={class:"muted"},XI={class:"muted"},JI={key:1,class:"form-error",role:"alert"},QI=Ae({__name:"FeishuConfig",setup(e){const t=H(null),n=H(!1),s=H(""),i=H(""),a=H(!1),d=H(!0),r=H(!1),o=H(""),c=Ea(),{t:p}=xo();async function u(){d.value=!0,o.value="";try{const v=await gI();g(v)}catch(v){v instanceof Xs&&(o.value=p("admin.feishuConfig.loadFailed"))}finally{d.value=!1}}function g(v){t.value=v,n.value=v.enabled,s.value=v.base_url,i.value="",a.value=!1}async function m(){o.value="";try{i.value=await _I(),c.info(p("admin.feishuConfig.keyGenerated"))}catch(v){v instanceof Xs&&(o.value=p("admin.feishuConfig.saveFailed"))}}async function y(){if(!r.value){o.value="",r.value=!0;try{const v={enabled:n.value},l=i.value.trim();l&&(v.encrypt_key=l);const h=s.value.trim();h&&(v.base_url=h),a.value&&(v.force=!0);const f=await mI(v);g(f),c.success(p("setup.saved"))}catch(v){v instanceof Xs&&(o.value=v.status===409?p("admin.feishuConfig.rotateConflict"):p("admin.feishuConfig.saveFailed"))}finally{r.value=!1}}}return Dt(u),(v,l)=>($(),bt(C(sc),{title:C(p)("admin.feishuConfig.title"),bordered:!1},{default:qt(()=>[b("p",qI,L(C(p)("admin.feishuConfig.description")),1),t.value?($(),bt(C(Sg),{key:0,"label-placement":"top"},{default:qt(()=>[Te(C(qi),{label:C(p)("admin.feishuConfig.enabled"),"show-feedback":!1},{default:qt(()=>[Te(C(Sl),{value:n.value,"onUpdate:value":l[0]||(l[0]=h=>n.value=h),"data-testid":"feishu-enabled"},null,8,["value"])]),_:1},8,["label"]),Te(C(qi),{label:C(p)("admin.feishuConfig.encryptKey"),"show-feedback":!1},{default:qt(()=>[Te(C(Ns),{vertical:"",size:6,style:{width:"100%"}},{default:qt(()=>[Te(C(Ns),{wrap:!1,align:"center",style:{width:"100%"}},{default:qt(()=>[Te(C(Is),{value:i.value,"onUpdate:value":l[1]||(l[1]=h=>i.value=h),type:"password","show-password-on":"click",placeholder:t.value.key_set?C(p)("admin.feishuConfig.keyKeepPlaceholder",{last4:t.value.key_last4??""}):C(p)("admin.feishuConfig.keyEmptyPlaceholder"),"data-testid":"feishu-key"},null,8,["value","placeholder"]),Te(C(gn),{tertiary:"","data-testid":"feishu-generate",onClick:m},{default:qt(()=>[ot(L(C(p)("admin.feishuConfig.generate")),1)]),_:1})]),_:1}),i.value?($(),F("span",YI,L(C(p)("admin.feishuConfig.keyCopyOnce")),1)):Z("",!0),i.value&&t.value.key_set?($(),bt(C(Ns),{key:1,align:"center",size:8},{default:qt(()=>[Te(C(Sl),{value:a.value,"onUpdate:value":l[2]||(l[2]=h=>a.value=h),size:"small","data-testid":"feishu-force"},null,8,["value"]),b("span",GI,L(C(p)("admin.feishuConfig.forceRotate")),1)]),_:1})):Z("",!0)]),_:1})]),_:1},8,["label"]),Te(C(qi),{label:C(p)("admin.feishuConfig.baseUrl"),"show-feedback":!1},{default:qt(()=>[Te(C(Is),{value:s.value,"onUpdate:value":l[3]||(l[3]=h=>s.value=h),placeholder:"https://open.feishu.cn","data-testid":"feishu-base"},null,8,["value"])]),_:1},8,["label"]),Te(C(Ns),{class:"actions",align:"center"},{default:qt(()=>[Te(C(gn),{type:"primary",loading:r.value,disabled:r.value,"data-testid":"feishu-save",onClick:y},{default:qt(()=>[ot(L(C(p)("common.save")),1)]),_:1},8,["loading","disabled"]),b("span",XI,L(t.value.running?C(p)("admin.feishuConfig.statusRunning"):C(p)("admin.feishuConfig.statusStopped")),1)]),_:1})]),_:1})):Z("",!0),o.value?($(),F("p",JI,L(o.value),1)):Z("",!0)]),_:1},8,["title"]))}}),ZI=Ct(QI,[["__scopeId","data-v-b32379d1"]]),ql={terminal:"#58a6ff",state:"#39c5cf",filesystem:"#bc8cff",service:"#db6d28",control:"#d29922",other:"#8b949e"},Dv=["#58a6ff","#39c5cf","#bc8cff","#db6d28","#d29922","#3fb950","#f85149","#79c0ff"];function e$(e){return new Date(`${e}T00:00:00Z`)}function ky(e){return e.toISOString().slice(0,10)}function _l(e,t){const n=e$(e);return n.setUTCDate(n.getUTCDate()+t),ky(n)}function Mv(e,t){const n=[];for(let s=e;s<=t;s=_l(s,1))n.push(s);return n}function Av(e,t=new Date){const n=ky(t),s=_l(n,-(e-1)),i=_l(s,-e);return{from:i,currentFrom:s,to:n,days:Mv(s,n),previousDays:Mv(i,_l(s,-1))}}function wu(e){const t=new Map;for(const n of e)t.set(n.user_id,n.email||n.user_id);return[...t].map(([n,s])=>({id:n,email:s})).sort((n,s)=>n.email.localeCompare(s.email))}function Iv(e,t,n){return e.filter(s=>t.has(s.user_id)&&!!s.day&&n.has(s.day))}function mc(e,t){return t==="bytes"?e.bytes:e.frames}function Ms(e,t){return e.reduce((n,s)=>n+mc(s,t),0)}function sa(e,t){return t===0?e===0?0:null:(e-t)/t*100}function t$(e,t,n){const s=new Set(n.days),i=new Set(n.previousDays),d=wu(e).filter(o=>t.has(o.id)).map(o=>{const c=e.filter(y=>y.user_id===o.id),p=c.filter(y=>!!y.day&&s.has(y.day)),u=c.filter(y=>!!y.day&&i.has(y.day)),g=Ms(p,"bytes"),m=Ms(u,"bytes");return{id:o.id,email:o.email,bytes:g,frames:Ms(p,"frames"),outbound:Ms(p.filter(y=>y.direction===1),"bytes"),inbound:Ms(p.filter(y=>y.direction===0),"bytes"),previousBytes:m,trend:sa(g,m),share:0,activeDays:new Set(p.map(y=>y.day)).size}}),r=d.reduce((o,c)=>o+c.bytes,0);for(const o of d)o.share=r?o.bytes/r*100:0;return d.sort((o,c)=>c.bytes-o.bytes||o.email.localeCompare(c.email))}function n$(e){const t=new Map;for(const s of e){const i=s.category||"other",a=t.get(i)||{key:i,label:i,color:ql[i]||ql.other,bytes:0,frames:0,outbound:0,inbound:0};a.bytes+=s.bytes,a.frames+=s.frames,s.direction===1?a.outbound+=s.bytes:a.inbound+=s.bytes,t.set(i,a)}const n=[...t.values()].reduce((s,i)=>s+i.bytes,0);return[...t.values()].map(s=>({...s,share:n?s.bytes/n*100:0})).sort((s,i)=>i.bytes-s.bytes)}function s$(e,t){if(t==="group"){const s=e.category||"other";return{key:s,label:s,category:s}}const n=e.frame_type_name||String(e.frame_type??"?");return{key:String(e.frame_type??n),label:n,category:e.category||"other"}}function i$(e,t,n,s,i,a){const d=new Map(t.map((o,c)=>[o,c])),r=new Map;for(const o of e){const c=o.day?d.get(o.day):void 0;if(c===void 0||s==="out"&&o.direction!==1||s==="in"&&o.direction!==0)continue;const p=s$(o,n),u=a?`${o.user_id}:${p.key}`:p.key;let g=r.get(u);g||(g={key:u,label:p.label,userID:a?o.user_id:void 0,userLabel:a?o.email||o.user_id:void 0,category:p.category,color:n==="group"?ql[p.category]||ql.other:Dv[r.size%Dv.length],values:Array(t.length).fill(0),total:0},r.set(u,g));const m=mc(o,i);g.values[c]+=m,g.total+=m}return[...r.values()].sort((o,c)=>c.total-o.total)}function r$(e,t,n){const s=new Map(t.map((d,r)=>[d,r])),i=Array(t.length).fill(0),a=Array(t.length).fill(0);for(const d of e){const r=d.day?s.get(d.day):void 0;r!==void 0&&((d.direction===1?a:i)[r]+=mc(d,n))}return{inbound:i,outbound:a}}function $v(e,t,n){const s=Array(t.length).fill(0),i=new Map(t.map((a,d)=>[a,d]));for(const a of e){const d=a.day?i.get(a.day):void 0;d!==void 0&&(s[d]+=mc(a,n))}return s}const o$={class:"traffic-dashboard"},a$={class:"traffic-titlebar"},l$=["aria-label","title","disabled"],c$={class:"scope-section platform-section"},d$={class:"scope-heading"},u$={class:"platform-strip","data-test":"platform-status"},h$={class:"platform-cell platform-health"},f$={class:"platform-cell"},p$={class:"platform-cell"},v$={class:"platform-cell"},g$={class:"scope-section user-section"},m$={class:"user-heading"},_$={class:"filterbar"},y$=["aria-label"],b$=["data-test","onClick"],w$={key:0},S$={key:1},C$={key:2},k$=["aria-label"],x$={class:"selector-head"},R$={class:"search-box"},T$=["placeholder"],P$={class:"selector-options"},E$=["checked","onChange"],L$=["data-test","onClick"],D$={key:0},M$={class:"selector-foot"},A$={key:0,class:"selection-empty","data-test":"traffic-selection-empty"},I$={key:0,class:"selection-banner"},$$=["aria-label"],O$={class:"kpi-strip"},F$={class:"timeline-panel"},B$={class:"panel-head timeline-head"},H$={class:"timeline-controls"},N$={class:"segmented"},z$={key:0},U$={class:"segmented"},V$=["onClick"],K$={class:"segmented"},W$={class:"chart-meta"},j$={key:0,class:"chart-empty"},q$={key:1,class:"svg-chart","data-test":"direction-chart"},Y$=["aria-label"],G$={class:"grid-lines"},X$=["y1","y2"],J$=["points"],Q$=["points"],Z$=["x"],e4={class:"legend"},t4={key:2,class:"matrix-chart","data-test":"matrix-chart"},n4=["title"],s4={class:"matrix-cells"},i4=["title"],r4={key:3,class:"bar-chart","data-test":"stacked-chart"},o4={class:"bar-stack"},a4=["title"],l4={key:4,class:"series-legend"},c4={key:5,class:"timeline-table-wrap"},d4={class:"timeline-table"},u4={class:"lower-grid"},h4={class:"flat-panel category-panel"},f4={class:"panel-head"},p4={class:"category-list"},v4=["onClick"],g4={class:"category-name"},m4={class:"meter"},_4={class:"category-value"},y4={class:"flat-panel user-table-panel"},b4={class:"panel-head table-panel-head"},w4={class:"data-table-wrap"},S4={class:"data-table","data-test":"traffic-user-table"},C4={class:"share"},k4=["aria-label","data-test","onClick"],x4={class:"diagnostics"},R4={class:"panel-head"},T4={class:"diagnostic-grid"},P4={class:"diagnostic-block"},E4=["title"],L4=["title"],D4={class:"diagnostic-block"},M4={class:"density-list"},A4={class:"user-drawer"},I4={class:"drawer-head"},$4=["aria-label"],O4={class:"drawer-kpis"},F4={class:"drawer-bars"},B4=["title"],H4=Ae({__name:"Traffic",setup(e){const{t}=xo(),n=Ea(),s=H([]),i=H(null),a=H(!1),d=H(7),r=H("bytes"),o=H("group"),c=H("all"),p=H([]),u=H(!1),g=H(!1),m=H(""),y=H(null),v=H("all"),l=H(null),h=H(null),f=q(()=>Av(d.value)),_=q(()=>wu(s.value)),S=q(()=>new Set(p.value)),k=q(()=>Iv(s.value,S.value,new Set(f.value.days))),P=q(()=>Iv(s.value,S.value,new Set(f.value.previousDays))),M=q(()=>_.value.filter(se=>S.value.has(se.id))),w=q(()=>{const se=m.value.trim().toLowerCase();return _.value.filter(ge=>!se||ge.email.toLowerCase().includes(se)||ge.id.toLowerCase().includes(se))}),T=q(()=>_.value.length>0&&p.value.length===_.value.length),A=q(()=>Ms(k.value,"bytes")),E=q(()=>Ms(k.value,"frames")),R=q(()=>Ms(k.value.filter(se=>se.direction===1),"bytes")),D=q(()=>Ms(k.value.filter(se=>se.direction===0),"bytes")),I=q(()=>Ms(P.value,"bytes")),O=q(()=>Ms(P.value,"frames")),U=q(()=>Ms(P.value.filter(se=>se.direction===1),"bytes")),W=q(()=>Ms(P.value.filter(se=>se.direction===0),"bytes")),N=q(()=>[{key:"total",label:t("admin.traffic.kpiTotal"),value:x(A.value),trend:sa(A.value,I.value)},{key:"out",label:t("admin.traffic.kpiOutbound"),value:x(R.value),trend:sa(R.value,U.value)},{key:"in",label:t("admin.traffic.kpiInbound"),value:x(D.value),trend:sa(D.value,W.value)},{key:"frames",label:t("admin.traffic.kpiFrames"),value:Re(E.value),trend:sa(E.value,O.value)}]),z=q(()=>n$(k.value)),V=q(()=>o.value==="direction"?[]:i$(k.value,f.value.days,o.value,c.value,r.value,M.value.length>1)),j=q(()=>r$(k.value,f.value.days,r.value)),G=q(()=>Math.max(1,...V.value.flatMap(se=>se.values),...j.value.inbound,...j.value.outbound)),te=q(()=>Math.max(1,...f.value.days.map((se,ge)=>V.value.reduce((Oe,Ke)=>Oe+Ke.values[ge],0)))),oe=q(()=>V.value.slice(0,28)),re=q(()=>M.value.length>1&&o.value!=="direction"),ye=q(()=>{const se=v.value==="all"?s.value:s.value.filter(ge=>(ge.category||"other")===v.value);return t$(se,S.value,f.value)}),K=q(()=>ye.value.map(se=>({label:`${se.email} · ${se.id}`,value:se.id}))),J=q(()=>y.value?ye.value.filter(se=>se.id===y.value):ye.value),Q=q(()=>J.value.find(se=>se.id===l.value)||null),de=q(()=>k.value.filter(se=>se.user_id===l.value)),De=q(()=>$v(de.value,f.value.days,"bytes")),Pe=q(()=>Math.max(1,...De.value)),Ye=q(()=>{const se=new Map;for(const ge of de.value){const Oe=ge.frame_type_name||String(ge.frame_type??"?"),Ke=se.get(Oe)||{name:Oe,category:ge.category||"other",bytes:0,frames:0};Ke.bytes+=ge.bytes,Ke.frames+=ge.frames,se.set(Oe,Ke)}return[...se.values()].sort((ge,Oe)=>Oe.bytes-ge.bytes).slice(0,8)}),st=q(()=>J.value.slice(0,12).map(se=>{const ge=k.value.filter(Oe=>Oe.user_id===se.id);return{user:se,values:$v(ge,f.value.days,"bytes")}})),yt=q(()=>Math.max(1,...st.value.flatMap(se=>se.values))),ce=q(()=>z.value.map(se=>({...se,density:se.frames?se.bytes/se.frames:0})).sort((se,ge)=>ge.density-se.density)),ae=q(()=>Math.max(1,...ce.value.map(se=>se.density)));async function be(){a.value=!0;const se=Av(d.value);try{const[ge,Oe]=await Promise.allSettled([yI({view:"detail",bucket:"day",from:se.from,to:se.to}),bI()]);if(ge.status==="rejected")throw ge.reason;const Ke=ge.value,Be=Oe.status==="fulfilled"?Oe.value:null;s.value=Ke.rows,i.value=Be;const me=wu(Ke.rows).map(Fe=>Fe.id);if(!u.value)p.value=me,u.value=!0;else{const Fe=new Set(me);p.value=p.value.filter(fe=>Fe.has(fe))}}catch(ge){ge instanceof Xs&&n.error(t("admin.traffic.loadFailed")),s.value=[]}finally{a.value=!1}}function he(se){d.value!==se&&(d.value=se,v.value="all",be())}function Le(se){o.value=se}function et(se){p.value=S.value.has(se)?p.value.filter(ge=>ge!==se):[...p.value,se]}function je(se){p.value=[se]}function _e(){p.value=_.value.map(se=>se.id)}function ie(){p.value=[]}function we(se){var ge;g.value&&!((ge=h.value)!=null&&ge.contains(se.target))&&(g.value=!1)}function Ee(se){return se===null?t("admin.traffic.trendNew"):Math.abs(se)<.05?t("admin.traffic.trendFlat"):`${se>0?"+":""}${se.toFixed(1)}%`}function x(se){const ge=["B","KB","MB","GB","TB"];let Oe=se,Ke=0;for(;Oe>=1024&&Ke=100?0:Oe>=10?1:2)} ${ge[Ke]}`}function Re(se){return new Intl.NumberFormat(void 0,{notation:se>=1e4?"compact":"standard",maximumFractionDigits:1}).format(se)}function Xe(se){return r.value==="bytes"?x(se):Re(se)}function Ue(se){const ge=t(`admin.traffic.categories.${se}`);return ge===`admin.traffic.categories.${se}`?se:ge}function xt(se){return se.slice(5).replace("-","/")}function Ze(se){const ge=Math.max(1,se.length-1);return se.map((Oe,Ke)=>`${64+Ke/ge*904},${276-Oe/G.value*224}`).join(" ")}function wt(se){return`rgba(88, 166, 255, ${se===0?.06:.18+se/G.value*.72})`}function tt(se){return`rgba(57, 197, 207, ${se===0?.05:.18+se/yt.value*.72})`}async function gt(se){l.value=se,await un()}return Dt(()=>{document.addEventListener("pointerdown",we),be()}),Vt(()=>document.removeEventListener("pointerdown",we)),(se,ge)=>($(),F("div",o$,[b("div",a$,[b("div",null,[b("h1",null,L(C(t)("admin.traffic.title")),1),b("p",null,L(C(t)("admin.traffic.timezone")),1)]),b("button",{class:"icon-button",type:"button","aria-label":C(t)("admin.traffic.refresh"),title:C(t)("admin.traffic.refresh"),disabled:a.value,"data-test":"traffic-refresh",onClick:be},[Te(C(Ig),{class:lt({spinning:a.value})},null,8,["class"])],8,l$)]),Te(C(oI),{show:a.value},{default:qt(()=>{var Oe,Ke,Be,me,Fe;return[b("section",c$,[b("div",d$,[b("div",null,[b("span",null,L(C(t)("admin.traffic.platformScope")),1),b("h2",null,L(C(t)("admin.traffic.platformStatus")),1)]),b("small",null,[Te(C(_w)),ot(L(C(t)("admin.traffic.globalRealtime")),1)])]),b("div",u$,[b("div",h$,[b("span",null,[Te(C(tf)),ot(L(C(t)("admin.traffic.relayStatus")),1)]),b("strong",null,L(i.value?C(t)("admin.traffic.online"):C(t)("admin.traffic.unknown")),1),b("small",null,L(((Oe=i.value)==null?void 0:Oe.version)||"-"),1)]),b("div",f$,[b("span",null,[Te(C(Qr)),ot(L(C(t)("admin.traffic.activeSessions")),1)]),b("strong",null,L(((Ke=i.value)==null?void 0:Ke.active_sessions)??"-"),1),b("small",null,L(C(t)("admin.traffic.liveValue")),1)]),b("div",p$,[b("span",null,[Te(C(dl)),ot(L(C(t)("admin.traffic.relayInstances")),1)]),b("strong",null,L(((Be=i.value)==null?void 0:Be.relay_instances)??"-"),1),b("small",null,L(C(t)("admin.traffic.liveInstances")),1)]),b("div",v$,[b("span",null,[Te(C(vw)),ot(L(C(t)("admin.traffic.activeUplinks")),1)]),b("strong",null,L(((me=i.value)==null?void 0:me.active_uplinks)??"-"),1),b("small",null,L(C(t)("admin.traffic.flushEvery",{seconds:((Fe=i.value)==null?void 0:Fe.traffic_flush_interval_seconds)??60})),1)])])]),b("section",g$,[b("div",m$,[b("div",null,[b("span",null,L(C(t)("admin.traffic.userScope")),1),b("h2",null,L(C(t)("admin.traffic.userAnalysis")),1)]),b("div",_$,[b("div",{class:"segmented",role:"group","aria-label":C(t)("admin.traffic.range")},[($(),F(Ie,null,at([7,30,90],fe=>b("button",{key:fe,type:"button",class:lt({active:d.value===fe}),"data-test":`range-${fe}`,onClick:nt=>he(fe)},L(C(t)("admin.traffic.days",{days:fe})),11,b$)),64))],8,y$),b("div",{ref_key:"selectorRoot",ref:h,class:"user-selector"},[b("button",{class:lt(["selector-trigger",{active:g.value}]),type:"button","data-test":"user-filter-trigger",onClick:ge[0]||(ge[0]=fe=>g.value=!g.value)},[Te(C(Hc)),T.value?($(),F("span",w$,L(C(t)("admin.traffic.allUsers")),1)):M.value.length===1?($(),F("span",S$,L(M.value[0].email),1)):($(),F("span",C$,L(C(t)("admin.traffic.selectedUsers",{selected:M.value.length,total:_.value.length})),1)),Te(C(dw))],2),g.value?($(),F("div",{key:0,class:"selector-popover",role:"dialog","aria-label":C(t)("admin.traffic.filterUsers")},[b("div",x$,[b("div",null,[b("strong",null,L(C(t)("admin.traffic.filterUsers")),1),b("span",null,L(C(t)("admin.traffic.selectedCount",{selected:M.value.length,total:_.value.length})),1)]),b("button",{type:"button","data-test":"toggle-all-users",onClick:ge[1]||(ge[1]=fe=>T.value?ie():_e())},L(T.value?C(t)("admin.traffic.clearAll"):C(t)("admin.traffic.selectAll")),1)]),b("label",R$,[Te(C($g)),rt(b("input",{"onUpdate:modelValue":ge[2]||(ge[2]=fe=>m.value=fe),placeholder:C(t)("admin.traffic.searchUsers")},null,8,T$),[[Tt,m.value]])]),b("div",P$,[($(!0),F(Ie,null,at(w.value,fe=>($(),F("div",{key:fe.id,class:"selector-option"},[b("label",null,[b("input",{type:"checkbox",checked:S.value.has(fe.id),onChange:nt=>et(fe.id)},null,40,E$),b("span",null,[b("strong",null,L(fe.email),1),b("small",null,L(fe.id),1)])]),b("button",{type:"button","data-test":`only-${fe.id}`,onClick:nt=>je(fe.id)},L(C(t)("admin.traffic.only")),9,L$)]))),128)),w.value.length?Z("",!0):($(),F("p",D$,L(C(t)("admin.traffic.noUserMatch")),1))]),b("div",M$,[b("button",{type:"button","data-test":"restore-users",onClick:_e},L(C(t)("admin.traffic.restoreAll")),1),b("button",{class:"primary",type:"button",onClick:ge[3]||(ge[3]=fe=>g.value=!1)},L(C(t)("admin.traffic.done")),1)])],8,k$)):Z("",!0)],512)])]),M.value.length?($(),F(Ie,{key:1},[T.value?Z("",!0):($(),F("div",I$,[Te(C(Hc)),b("strong",null,L(C(t)("admin.traffic.selectedUserCount",{count:M.value.length})),1),b("span",null,L(M.value.slice(0,3).map(fe=>fe.email).join(", ")),1),b("button",{type:"button","aria-label":C(t)("admin.traffic.restoreAll"),onClick:_e},[Te(C(ai))],8,$$)])),b("div",O$,[($(!0),F(Ie,null,at(N.value,fe=>($(),F("div",{key:fe.key,class:"kpi-cell"},[b("span",null,L(fe.label),1),b("div",null,[b("strong",null,L(fe.value),1),b("small",{class:lt({up:fe.trend!==null&&fe.trend>0,down:fe.trend!==null&&fe.trend<0})},[fe.trend!==null&&fe.trend>0?($(),bt(C(cw),{key:0})):fe.trend!==null&&fe.trend<0?($(),bt(C(lw),{key:1})):($(),bt(C(gw),{key:2})),ot(L(Ee(fe.trend)),1)],2)])]))),128))]),b("section",F$,[b("div",B$,[b("div",null,[b("span",null,L(C(t)("admin.traffic.coreAnalysis")),1),b("h3",null,L(C(t)("admin.traffic.timelineTitle")),1),b("p",null,L(C(t)("admin.traffic.timelineScope",{count:M.value.length})),1)]),b("div",H$,[b("div",null,[b("small",null,L(C(t)("admin.traffic.view")),1),b("div",N$,[b("button",{type:"button",class:lt({active:o.value==="group"}),"data-test":"view-group",onClick:ge[4]||(ge[4]=fe=>Le("group"))},L(C(t)("admin.traffic.groupTimeline")),3),b("button",{type:"button",class:lt({active:o.value==="frame"}),"data-test":"view-frame",onClick:ge[5]||(ge[5]=fe=>Le("frame"))},L(C(t)("admin.traffic.frameTimeline")),3),b("button",{type:"button",class:lt({active:o.value==="direction"}),"data-test":"view-direction",onClick:ge[6]||(ge[6]=fe=>Le("direction"))},L(C(t)("admin.traffic.directionTrend")),3)])]),o.value!=="direction"?($(),F("div",z$,[b("small",null,L(C(t)("admin.traffic.colDirection")),1),b("div",U$,[($(),F(Ie,null,at(["all","out","in"],fe=>b("button",{key:fe,type:"button",class:lt({active:c.value===fe}),onClick:nt=>c.value=fe},L(C(t)(`admin.traffic.direction.${fe}`)),11,V$)),64))])])):Z("",!0),b("div",null,[b("small",null,L(C(t)("admin.traffic.metric")),1),b("div",K$,[b("button",{type:"button",class:lt({active:r.value==="bytes"}),"data-test":"metric-bytes",onClick:ge[7]||(ge[7]=fe=>r.value="bytes")},L(C(t)("admin.traffic.bytes")),3),b("button",{type:"button",class:lt({active:r.value==="frames"}),"data-test":"metric-frames",onClick:ge[8]||(ge[8]=fe=>r.value="frames")},L(C(t)("admin.traffic.frames")),3)])])])]),b("div",W$,[b("span",null,L(re.value?C(t)("admin.traffic.multiUserMatrix"):o.value==="direction"?C(t)("admin.traffic.directionTrend"):C(t)("admin.traffic.stackedTimeline")),1),b("small",null,L(C(t)("admin.traffic.bucketCount",{count:f.value.days.length})),1)]),k.value.length?o.value==="direction"?($(),F("div",q$,[($(),F("svg",{viewBox:"0 0 1000 320",preserveAspectRatio:"none",role:"img","aria-label":C(t)("admin.traffic.directionTrend")},[b("g",G$,[($(),F(Ie,null,at([52,108,164,220,276],fe=>b("line",{key:fe,x1:"64",y1:fe,x2:"968",y2:fe},null,8,X$)),64))]),b("polyline",{class:"line outbound",points:Ze(j.value.outbound)},null,8,J$),b("polyline",{class:"line inbound",points:Ze(j.value.inbound)},null,8,Q$),($(!0),F(Ie,null,at(f.value.days,(fe,nt)=>($(),F("g",{key:fe},[nt===0||nt===f.value.days.length-1||nt%Math.max(1,Math.floor(f.value.days.length/6))===0?($(),F("text",{key:0,x:64+nt/Math.max(1,f.value.days.length-1)*904,y:"305","text-anchor":"middle"},L(xt(fe)),9,Z$)):Z("",!0)]))),128))],8,Y$)),b("div",e4,[b("span",null,[ge[13]||(ge[13]=b("i",{class:"outbound"},null,-1)),ot(L(C(t)("admin.traffic.dirOut")),1)]),b("span",null,[ge[14]||(ge[14]=b("i",{class:"inbound"},null,-1)),ot(L(C(t)("admin.traffic.dirIn")),1)])])])):re.value?($(),F("div",t4,[b("div",{class:"matrix-grid",style:tn({"--columns":String(f.value.days.length)})},[($(!0),F(Ie,null,at(oe.value,fe=>($(),F(Ie,{key:fe.key},[b("div",{class:"matrix-label",title:`${fe.userLabel} · ${Ue(fe.label)}`},[b("strong",null,L(fe.userLabel),1),b("span",null,L(o.value==="group"?Ue(fe.label):fe.label),1)],8,n4),b("div",s4,[($(!0),F(Ie,null,at(fe.values,(nt,At)=>($(),F("i",{key:At,style:tn({background:wt(nt)}),title:`${fe.userLabel} · ${fe.label} · ${f.value.days[At]} · ${Xe(nt)}`},null,12,i4))),128))])],64))),128))],4),b("div",{class:"matrix-axis",style:tn({"--columns":String(f.value.days.length)})},[($(!0),F(Ie,null,at(f.value.days,fe=>($(),F("span",{key:fe},L(xt(fe)),1))),128))],4)])):($(),F("div",r4,[($(!0),F(Ie,null,at(f.value.days,(fe,nt)=>($(),F("div",{key:fe,class:"bar-column"},[b("div",o4,[($(!0),F(Ie,null,at(V.value.slice(0,8),At=>($(),F("i",{key:At.key,style:tn({height:`${At.values[nt]/te.value*100}%`,background:At.color}),title:`${At.label} · ${Xe(At.values[nt])}`},null,12,a4))),128))]),b("span",null,L(xt(fe)),1)]))),128))])):($(),F("div",j$,L(C(t)("admin.traffic.empty")),1)),o.value!=="direction"&&k.value.length?($(),F("div",l4,[($(!0),F(Ie,null,at(V.value.slice(0,8),fe=>($(),F("span",{key:fe.key},[b("i",{style:tn({background:fe.color})},null,4),ot(L(o.value==="group"?Ue(fe.label):fe.label),1)]))),128))])):Z("",!0),o.value!=="direction"&&V.value.length?($(),F("div",c4,[b("table",d4,[b("thead",null,[b("tr",null,[b("th",null,L(C(t)("admin.traffic.colUser")),1),b("th",null,L(o.value==="group"?C(t)("admin.traffic.colCategory"):C(t)("admin.traffic.colFrameType")),1),b("th",null,L(C(t)("admin.traffic.total")),1),($(!0),F(Ie,null,at(f.value.days,fe=>($(),F("th",{key:fe},L(xt(fe)),1))),128))])]),b("tbody",null,[($(!0),F(Ie,null,at(V.value.slice(0,16),fe=>($(),F("tr",{key:fe.key},[b("td",null,L(fe.userLabel||C(t)("admin.traffic.selectedAggregate")),1),b("td",null,L(o.value==="group"?Ue(fe.label):fe.label),1),b("td",null,L(Xe(fe.total)),1),($(!0),F(Ie,null,at(fe.values,(nt,At)=>($(),F("td",{key:At},L(Xe(nt)),1))),128))]))),128))])])])):Z("",!0)]),b("div",u4,[b("section",h4,[b("div",f4,[b("div",null,[b("h3",null,L(C(t)("admin.traffic.categorySummary")),1),b("p",null,L(C(t)("admin.traffic.totalComposition")),1)]),v.value!=="all"?($(),F("button",{key:0,type:"button",onClick:ge[9]||(ge[9]=fe=>v.value="all")},L(C(t)("admin.traffic.clear")),1)):Z("",!0)]),b("div",p4,[($(!0),F(Ie,null,at(z.value,fe=>($(),F("button",{key:fe.key,type:"button",class:lt({active:v.value===fe.key}),onClick:nt=>v.value=v.value===fe.key?"all":fe.key},[b("span",g4,[b("i",{style:tn({background:fe.color})},null,4),b("strong",null,L(Ue(fe.key)),1),b("em",null,L(fe.share.toFixed(1))+"%",1)]),b("span",m4,[b("i",{style:tn({width:`${fe.share}%`,background:fe.color})},null,4)]),b("span",_4,[b("strong",null,L(x(fe.bytes)),1),b("small",null,L(C(t)("admin.traffic.outIn",{out:x(fe.outbound),in:x(fe.inbound)})),1)])],10,v4))),128))])]),b("section",y4,[b("div",b4,[b("div",null,[b("h3",null,L(C(t)("admin.traffic.userDetail")),1),b("p",null,L(C(t)("admin.traffic.userCount",{count:J.value.length})),1)]),Te(C(J_),{value:y.value,"onUpdate:value":ge[10]||(ge[10]=fe=>y.value=fe),class:"user-detail-select","data-test":"user-detail-filter",size:"small",filterable:"",clearable:"",options:K.value,placeholder:C(t)("admin.traffic.selectOrSearchUser")},{empty:qt(()=>[ot(L(C(t)("admin.traffic.noUserMatch")),1)]),_:1},8,["value","options","placeholder"])]),b("div",w4,[b("table",S4,[b("thead",null,[b("tr",null,[b("th",null,L(C(t)("admin.traffic.colUser")),1),b("th",null,L(C(t)("admin.traffic.totalTraffic")),1),b("th",null,L(C(t)("admin.traffic.share")),1),b("th",null,L(C(t)("admin.traffic.periodTrend")),1),b("th",null,L(C(t)("admin.traffic.activeDays")),1),ge[15]||(ge[15]=b("th",null,null,-1))])]),b("tbody",null,[($(!0),F(Ie,null,at(J.value,fe=>($(),F("tr",{key:fe.id},[b("td",null,[b("strong",null,L(fe.email),1),b("small",null,L(fe.id),1)]),b("td",null,L(x(fe.bytes)),1),b("td",null,[b("span",C4,[b("i",{style:tn({width:`${fe.share}%`})},null,4)]),ot(L(fe.share.toFixed(1))+"%",1)]),b("td",{class:lt({positive:fe.trend!==null&&fe.trend>0,negative:fe.trend!==null&&fe.trend<0})},L(Ee(fe.trend)),3),b("td",null,L(fe.activeDays)+" / "+L(d.value),1),b("td",null,[b("button",{class:"icon-button small",type:"button","aria-label":C(t)("admin.traffic.viewUser",{user:fe.email}),"data-test":`open-user-${fe.id}`,onClick:nt=>gt(fe.id)},[Te(C(Ag))],8,k4)])]))),128))])])])])]),b("section",x4,[b("div",R4,[b("div",null,[b("h3",null,L(C(t)("admin.traffic.diagnostics")),1),b("p",null,L(C(t)("admin.traffic.diagnosticsRange",{days:d.value})),1)])]),b("div",T4,[b("div",P4,[b("h4",null,L(C(t)("admin.traffic.dailyActivity")),1),b("div",{class:"activity-grid",style:tn({"--columns":String(f.value.days.length)})},[($(!0),F(Ie,null,at(st.value,fe=>($(),F(Ie,{key:fe.user.id},[b("span",{title:fe.user.email},L(fe.user.email),9,E4),b("div",null,[($(!0),F(Ie,null,at(fe.values,(nt,At)=>($(),F("i",{key:At,style:tn({background:tt(nt)}),title:`${f.value.days[At]} · ${x(nt)}`},null,12,L4))),128))])],64))),128))],4)]),b("div",D4,[b("h4",null,L(C(t)("admin.traffic.frameDensity")),1),b("div",M4,[($(!0),F(Ie,null,at(ce.value,fe=>($(),F("div",{key:fe.key},[b("span",null,L(Ue(fe.key)),1),b("div",null,[b("i",{style:tn({width:`${fe.density/ae.value*100}%`,background:fe.color})},null,4)]),b("strong",null,L(x(fe.density))+"/"+L(C(t)("admin.traffic.frameUnit")),1)]))),128))])])])])],64)):($(),F("div",A$,[Te(C(Hc)),b("h3",null,L(C(t)("admin.traffic.noUsersSelected")),1),b("button",{type:"button","data-test":"restore-users-empty",onClick:_e},L(C(t)("admin.traffic.restoreAllUsers")),1)]))])]}),_:1},8,["show"]),Q.value?($(),F("div",{key:0,class:"drawer-backdrop","data-test":"traffic-user-drawer",onClick:ge[12]||(ge[12]=dt(Oe=>l.value=null,["self"]))},[b("aside",A4,[b("div",I4,[b("div",null,[b("span",null,L(C(t)("admin.traffic.userTraffic")),1),b("h3",null,L(Q.value.email),1),b("small",null,L(Q.value.id),1)]),b("button",{class:"icon-button",type:"button","aria-label":C(t)("common.close"),onClick:ge[11]||(ge[11]=Oe=>l.value=null)},[Te(C(ai))],8,$4)]),b("div",O4,[b("div",null,[b("span",null,L(C(t)("admin.traffic.totalTraffic")),1),b("strong",null,L(x(Q.value.bytes)),1)]),b("div",null,[b("span",null,L(C(t)("admin.traffic.periodTrend")),1),b("strong",null,L(Ee(Q.value.trend)),1)]),b("div",null,[b("span",null,L(C(t)("admin.traffic.kpiFrames")),1),b("strong",null,L(Re(Q.value.frames)),1)])]),b("section",null,[b("h4",null,[Te(C(uw)),ot(L(C(t)("admin.traffic.dailyTraffic")),1)]),b("div",F4,[($(!0),F(Ie,null,at(De.value,(Oe,Ke)=>($(),F("div",{key:f.value.days[Ke]},[b("i",{style:tn({height:`${Oe/Pe.value*100}%`}),title:`${f.value.days[Ke]} · ${x(Oe)}`},null,12,B4),b("span",null,L(xt(f.value.days[Ke])),1)]))),128))])]),b("section",null,[b("h4",null,[Te(C(tf)),ot(L(C(t)("admin.traffic.frameBreakdown")),1)]),b("table",null,[b("thead",null,[b("tr",null,[b("th",null,L(C(t)("admin.traffic.colFrameType")),1),b("th",null,L(C(t)("admin.traffic.colCategory")),1),b("th",null,L(C(t)("admin.traffic.colBytes")),1),b("th",null,L(C(t)("admin.traffic.colFrames")),1)])]),b("tbody",null,[($(!0),F(Ie,null,at(Ye.value,Oe=>($(),F("tr",{key:Oe.name},[b("td",null,L(Oe.name),1),b("td",null,L(Ue(Oe.category)),1),b("td",null,L(x(Oe.bytes)),1),b("td",null,L(Re(Oe.frames)),1)]))),128))])])])])])):Z("",!0)]))}}),N4=Ct(H4,[["__scopeId","data-v-252de6da"]]),z4={class:"admin-panel"},U4={class:"admin-tabs"},V4=["onClick","data-test"],K4={class:"admin-body"},W4=Ae({__name:"AdminPanel",setup(e){const{t}=xo(),n=q(()=>Gh.value.locale),s=q(()=>Gh.value.dateLocale),i=H("invitations"),a=q(()=>[{key:"invitations",label:t("admin.invitations")},{key:"users",label:t("admin.users")},{key:"config",label:t("admin.configTab")},{key:"feishu",label:t("admin.feishuTab")},{key:"traffic",label:t("admin.trafficTab")}]),d=C0();return(r,o)=>($(),F("div",z4,[Te(C(R0),{abstract:"",theme:C(x0),"theme-overrides":C(d),locale:n.value,"date-locale":s.value},{default:qt(()=>[Te(C(k0),null,{default:qt(()=>[b("div",U4,[($(!0),F(Ie,null,at(a.value,c=>($(),F("button",{key:c.key,type:"button",onClick:p=>i.value=c.key,class:lt({active:i.value===c.key}),"data-test":`admin-tab-${c.key}`},L(c.label),11,V4))),128))]),b("div",K4,[i.value==="invitations"?($(),bt(DI,{key:0})):Z("",!0),i.value==="users"?($(),bt(OI,{key:1})):Z("",!0),i.value==="config"?($(),bt(jI,{key:2})):Z("",!0),i.value==="feishu"?($(),bt(ZI,{key:3})):Z("",!0),i.value==="traffic"?($(),bt(N4,{key:4})):Z("",!0)])]),_:1})]),_:1},8,["theme","theme-overrides","locale","date-locale"])]))}}),j4=Ct(W4,[["__scopeId","data-v-6f7ef581"]]),q4="classic",Su=[{id:"classic",labelKey:"settings.general.themes.classicLabel",descriptionKey:"settings.general.themes.classicDescription",xtermTheme:{background:"#000000",foreground:"#c9d1d9",cursor:"#c9d1d9",cursorAccent:"#000000",selectionBackground:"#264f78",black:"#000000",red:"#f85149",green:"#3fb950",yellow:"#d29922",blue:"#58a6ff",magenta:"#bc8cff",cyan:"#39c5cf",white:"#b1bac4",brightBlack:"#6e7681",brightRed:"#ff7b72",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#79c0ff",brightMagenta:"#d2a8ff",brightCyan:"#56d4dd",brightWhite:"#f0f6fc"},appVars:{"--bg":"#0d1117","--panel":"#161b22","--border":"#30363d","--fg":"#c9d1d9","--fg-dim":"#8b949e","--accent":"#58a6ff","--good":"#3fb950","--bad":"#f85149","--warn":"#d29922","--neutral":"#6e7681","--terminal-bg":"#000000","--terminal-grid":"#11161d","--terminal-overlay":"rgba(13, 17, 23, 0.85)"}},{id:"nord",labelKey:"settings.general.themes.nordLabel",descriptionKey:"settings.general.themes.nordDescription",xtermTheme:{background:"#2e3440",foreground:"#d8dee9",cursor:"#d8dee9",cursorAccent:"#2e3440",selectionBackground:"#434c5e",black:"#3b4252",red:"#bf616a",green:"#a3be8c",yellow:"#ebcb8b",blue:"#81a1c1",magenta:"#b48ead",cyan:"#88c0d0",white:"#e5e9f0",brightBlack:"#4c566a",brightRed:"#bf616a",brightGreen:"#a3be8c",brightYellow:"#ebcb8b",brightBlue:"#81a1c1",brightMagenta:"#b48ead",brightCyan:"#8fbcbb",brightWhite:"#eceff4"},appVars:{"--bg":"#242933","--panel":"#2e3440","--border":"#4c566a","--fg":"#d8dee9","--fg-dim":"#9aa7bd","--accent":"#88c0d0","--good":"#a3be8c","--bad":"#bf616a","--warn":"#ebcb8b","--neutral":"#4c566a","--terminal-bg":"#2e3440","--terminal-grid":"#242933","--terminal-overlay":"rgba(36, 41, 51, 0.88)"}},{id:"solarized-dark",labelKey:"settings.general.themes.solarizedDarkLabel",descriptionKey:"settings.general.themes.solarizedDarkDescription",xtermTheme:{background:"#002b36",foreground:"#839496",cursor:"#93a1a1",cursorAccent:"#002b36",selectionBackground:"#073642",black:"#073642",red:"#dc322f",green:"#859900",yellow:"#b58900",blue:"#268bd2",magenta:"#d33682",cyan:"#2aa198",white:"#eee8d5",brightBlack:"#002b36",brightRed:"#cb4b16",brightGreen:"#586e75",brightYellow:"#657b83",brightBlue:"#839496",brightMagenta:"#6c71c4",brightCyan:"#93a1a1",brightWhite:"#fdf6e3"},appVars:{"--bg":"#00212b","--panel":"#073642","--border":"#28535f","--fg":"#93a1a1","--fg-dim":"#657b83","--accent":"#268bd2","--good":"#859900","--bad":"#dc322f","--warn":"#b58900","--neutral":"#586e75","--terminal-bg":"#002b36","--terminal-grid":"#001e26","--terminal-overlay":"rgba(0, 33, 43, 0.9)"}},{id:"daylight",labelKey:"settings.general.themes.daylightLabel",descriptionKey:"settings.general.themes.daylightDescription",xtermTheme:{background:"#faf4e8",foreground:"#403832",cursor:"#403832",cursorAccent:"#faf4e8",selectionBackground:"#d9c7a8",black:"#403832",red:"#c94f4f",green:"#4d8a3f",yellow:"#b9831d",blue:"#2f6db3",magenta:"#8b5fa8",cyan:"#2f8f8a",white:"#ede0cc",brightBlack:"#7a6d61",brightRed:"#d56565",brightGreen:"#5d9f4d",brightYellow:"#c9922c",brightBlue:"#3d7fcf",brightMagenta:"#9b6db8",brightCyan:"#3aa39d",brightWhite:"#fffaf0"},appVars:{"--bg":"#f4ead8","--panel":"#fff8ed","--border":"#d8c7ad","--fg":"#403832","--fg-dim":"#776b5f","--accent":"#2f6db3","--good":"#4d8a3f","--bad":"#c94f4f","--warn":"#b9831d","--neutral":"#7a6d61","--terminal-bg":"#faf4e8","--terminal-grid":"#e5d6bd","--terminal-overlay":"rgba(255, 248, 237, 0.92)"}}];function Li(e){return Su.find(t=>t.id===e)??Su[0]}function Y4(e){return e==="daylight"}const G4={key:0,class:"terminal-appearance"},X4={class:"settings-field"},J4={class:"field-label"},Q4={class:"hint"},Z4={class:"settings-field-grid settings-field-grid--compact","data-test":"terminal-compact-grid"},eO={class:"settings-field"},tO={class:"field-label",for:"terminal-font-size"},nO=["value"],sO={class:"settings-field"},iO={class:"field-label",for:"terminal-line-height"},rO=["value"],oO={class:"settings-field scrollback-field"},aO={class:"field-label",for:"terminal-scrollback"},lO=["value"],cO={class:"settings-field"},dO={class:"field-label"},uO={class:"checkbox cursor-blink"},hO=["checked"],fO={class:"hint","data-test":"terminal-scrollback-hint"},pO={key:0,class:"error"},vO=Ae({__name:"SettingsTerminalAppearance",emits:["appearance-changed"],setup(e,{emit:t}){const n=t,{t:s}=$t(),i=hn(),a=i.caps,d=H(""),r=H(""),o=H(""),c=H(13),p=H(1),u=H("block"),g=H("block"),m=H(!0),y=H(5e3),v=H(5e3),l=H(!0),h=q(()=>cR.map(I=>({value:I.id,label:I.label}))),f=q(()=>[{value:"block",label:s("settings.general.terminalCursorStyleBlock")},{value:"underline",label:s("settings.general.terminalCursorStyleUnderline")},{value:"bar",label:s("settings.general.terminalCursorStyleBar")}]),_=q(()=>Math.round(y.value*2.75/1e3));async function S(){if(a.wailsBindings)try{const[I,O,U,W,N,z]=await Promise.all([gm(),mm(),_m(),ym(),bm(),wm()]);r.value=I,o.value=I,c.value=O,p.value=U,u.value=W,g.value=u.value,m.value=N,y.value=z,v.value=z}catch(I){d.value=(I==null?void 0:I.message)??String(I)}finally{l.value=!1}}let k=null;Dt(()=>{S(),k=i.events.on("prefs:changed",()=>{S()})}),Vt(()=>{k==null||k(),k=null});function P(){n("appearance-changed",{fontHead:r.value,fontSize:c.value,lineHeight:p.value,cursorStyle:u.value,cursorBlink:m.value,scrollback:v.value})}async function M(){const I=r.value,O=o.value;d.value="";try{await XS(I),o.value=I,P()}catch(U){r.value=O,d.value=(U==null?void 0:U.message)??String(U)}}async function w(I){const O=I.target,U=Number(O.value),W=Number.isFinite(U)?Math.max(8,Math.min(32,Math.round(U))):c.value,N=c.value;c.value=W,O.value=String(W),d.value="";try{await JS(W),P()}catch(z){c.value=N,O.value=String(N),d.value=(z==null?void 0:z.message)??String(z)}}async function T(I){const O=I.target,U=Number(O.value),W=Number.isFinite(U)?Math.max(1,Math.min(2,Math.round(U*10)/10)):p.value,N=p.value;p.value=W,O.value=String(W),d.value="";try{await QS(W),P()}catch(z){p.value=N,O.value=String(N),d.value=(z==null?void 0:z.message)??String(z)}}async function A(){const I=u.value,O=g.value;d.value="";try{await ZS(I),g.value=I,P()}catch(U){u.value=O,d.value=(U==null?void 0:U.message)??String(U)}}async function E(I){const O=I.target,U=m.value;m.value=O.checked,d.value="";try{await eC(O.checked),P()}catch(W){m.value=U,O.checked=U,d.value=(W==null?void 0:W.message)??String(W)}}function R(I){const O=Number(I.target.value);Number.isFinite(O)&&(y.value=O)}async function D(I){const O=I.target,U=Number(O.value),W=Number.isFinite(U)?Math.max(500,Math.min(2e4,Math.round(U))):v.value,N=v.value;y.value=W,O.value=String(W),d.value="";try{await tC(W),v.value=W,P()}catch(z){y.value=N,O.value=String(N),d.value=(z==null?void 0:z.message)??String(z)}}return(I,O)=>C(a).wailsBindings&&!l.value?($(),F("div",G4,[b("div",X4,[b("label",J4,L(C(s)("settings.general.terminalFont")),1),Te(ns,{modelValue:r.value,"onUpdate:modelValue":[O[0]||(O[0]=U=>r.value=U),M],options:h.value,"data-test":"terminal-font","aria-label":C(s)("settings.general.terminalFont")},null,8,["modelValue","options","aria-label"]),b("p",Q4,L(C(s)("settings.general.terminalFontHint")),1)]),b("div",Z4,[b("div",eO,[b("label",tO,L(C(s)("settings.general.terminalFontSize")),1),b("input",{id:"terminal-font-size",class:"number-input",type:"number","data-test":"terminal-font-size",min:"8",max:"32",step:"1",value:c.value,onChange:w},null,40,nO)]),b("div",sO,[b("label",iO,L(C(s)("settings.general.terminalLineHeight")),1),b("input",{id:"terminal-line-height",class:"number-input",type:"number","data-test":"terminal-line-height",min:"1.0",max:"2.0",step:"0.1",value:p.value,onChange:T},null,40,rO)]),b("div",oO,[b("label",aO,L(C(s)("settings.general.terminalScrollback")),1),b("input",{id:"terminal-scrollback",class:"number-input",type:"number","data-test":"terminal-scrollback",min:"500",max:"20000",step:"500",value:y.value,onInput:R,onChange:D},null,40,lO)]),b("div",cO,[b("label",dO,L(C(s)("settings.general.terminalCursorStyle")),1),Te(ns,{modelValue:u.value,"onUpdate:modelValue":[O[1]||(O[1]=U=>u.value=U),A],options:f.value,"data-test":"terminal-cursor-style","aria-label":C(s)("settings.general.terminalCursorStyle")},null,8,["modelValue","options","aria-label"]),b("label",uO,[b("input",{type:"checkbox","data-test":"terminal-cursor-blink",checked:m.value,onChange:E},null,40,hO),ot(" "+L(C(s)("settings.general.terminalCursorBlink")),1)])])]),b("p",fO,L(C(s)("settings.general.terminalScrollbackHint",{mb:_.value})),1),d.value?($(),F("p",pO,L(d.value),1)):Z("",!0)])):Z("",!0)}}),gO=Ct(vO,[["__scopeId","data-v-e31f8f67"]]);async function mO(){const{data:e}=await vn("/api/push/key");return e.key}async function _O(e){await vn("/api/push/subscribe",{method:"POST",body:JSON.stringify(e)})}async function yO(e){await vn("/api/push/unsubscribe",{method:"POST",body:JSON.stringify({endpoint:e})})}async function bO(){const{data:e}=await vn("/api/push/test",{method:"POST"});return e.sent}function wO(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");for(;t.length%4===1;)t=t.slice(0,-1);const n="=".repeat((4-t.length%4)%4),s=atob(t+n),i=new Uint8Array(s.length);for(let a=0;ac.map(_e=>({value:_e.value,label:o(_e.labelKey)}))),f=q(()=>Su.map(_e=>({value:_e.id,label:o(_e.labelKey),description:o(_e.descriptionKey)}))),_=H(!0),S=H(!0),k=H(!0),P=H(!0),M=H(!0),w=H(!0),T=H(!0),A=H(!1),E=H("auto"),R=H("auto"),D=H(""),I=H(""),O=H([]),U=H(!0),W=H(!0),N=H(10),z=H(!0),V=q(()=>m.notifications&&typeof navigator<"u"&&"serviceWorker"in navigator),j=H(!1),G=H(!0),te=H(!1),oe=H(!1),re=H(""),ye={denied:"settings.general.pushNotifications.errors.denied",disabled:"settings.general.pushNotifications.errors.disabled","key-failed":"settings.general.pushNotifications.errors.keyFailed","subscribe-failed":"settings.general.pushNotifications.errors.subscribeFailed","subscribe-rejected":"settings.general.pushNotifications.errors.subscribeRejected"},K=q(()=>[{value:"auto",label:o("settings.general.auto")},...O.value.map(_e=>({value:_e,label:_e})),{value:"__custom__",label:o("settings.general.customPath")}]);async function J(){if(m.wailsBindings)try{const[_e,ie]=await Promise.all([sC(),Nu()]);O.value=ie,E.value==="__custom__"&&D.value!==I.value||(_e==="auto"?E.value="auto":ie.includes(_e)?(E.value=_e,D.value=_e,I.value=_e):(E.value="__custom__",D.value=_e,I.value=_e),R.value=E.value)}catch(_e){r.value=(_e==null?void 0:_e.message)??String(_e)}finally{T.value=!1}}let Q=null;Dt(()=>{Q=g.events.on("prefs:changed",()=>{J()})}),Vt(()=>{Q==null||Q(),Q=null}),Dt(async()=>{if(m.wailsBindings)try{const _e=await nC();y.value=_e,v.value=_e}catch(_e){r.value=(_e==null?void 0:_e.message)??String(_e)}if(m.wailsBindings){try{_.value=await Sm()}catch(_e){r.value=(_e==null?void 0:_e.message)??String(_e)}finally{S.value=!1}try{k.value=await lC()}catch(_e){r.value=(_e==null?void 0:_e.message)??String(_e)}finally{P.value=!1}try{M.value=await dm()}catch(_e){r.value=(_e==null?void 0:_e.message)??String(_e)}finally{w.value=!1}await J();try{U.value=await Cm()}catch(_e){r.value=(_e==null?void 0:_e.message)??String(_e)}finally{W.value=!1}try{N.value=await km()}catch(_e){r.value=(_e==null?void 0:_e.message)??String(_e)}finally{z.value=!1}}await de()});async function de(){if(!V.value){G.value=!1;return}try{if(!navigator.serviceWorker.controller){j.value=!1;return}const ie=await(await navigator.serviceWorker.ready).pushManager.getSubscription();j.value=ie!==null}catch{j.value=!1}finally{G.value=!1}}async function De(_e){const ie=_e.target,we=ie.checked;re.value="",te.value=!0;try{const Ee=await navigator.serviceWorker.ready;if(we){const x=await SO({notification:{permission:Notification.permission,requestPermission:()=>Notification.requestPermission()},registration:Ee});if(!x.ok){ie.checked=!1,j.value=!1,re.value=o(ye[x.reason]??"settings.general.pushNotifications.errors.generic");return}j.value=!0}else await CO({registration:Ee}),j.value=!1}catch(Ee){ie.checked=j.value,re.value=(Ee==null?void 0:Ee.message)??String(Ee)}finally{te.value=!1}}async function Pe(){re.value="",oe.value=!0;try{await bO()}catch(_e){re.value=(_e==null?void 0:_e.message)??String(_e)}finally{oe.value=!1}}async function Ye(_e){const ie=_e.target,we=_.value;_.value=ie.checked,r.value="";try{await iC(ie.checked)}catch(Ee){_.value=we,r.value=(Ee==null?void 0:Ee.message)??String(Ee)}}async function st(_e){const ie=_e.target,we=k.value;k.value=ie.checked,r.value="";try{await cC(ie.checked)}catch(Ee){k.value=we,r.value=(Ee==null?void 0:Ee.message)??String(Ee)}}async function yt(_e){const ie=_e.target,we=M.value;M.value=ie.checked,r.value="";try{await IS(ie.checked)}catch(Ee){M.value=we,r.value=(Ee==null?void 0:Ee.message)??String(Ee)}}async function ce(){if(E.value==="__custom__")return;const _e=R.value;A.value=!0,r.value="";try{await Df(E.value),R.value=E.value}catch(ie){E.value=_e,r.value=(ie==null?void 0:ie.message)??String(ie)}finally{A.value=!1}}async function ae(){const _e=D.value.trim();if(!_e){r.value=o("settings.general.customShellRequired");return}A.value=!0,r.value="";try{await Df(_e),E.value="__custom__",R.value="__custom__",D.value=_e,I.value=_e,O.value.includes(_e)||(O.value=[_e,...O.value])}catch(ie){r.value=(ie==null?void 0:ie.message)??String(ie)}finally{A.value=!1}}async function be(_e){const ie=_e.target,we=U.value;U.value=ie.checked,r.value="";try{await dC(ie.checked)}catch(Ee){U.value=we,r.value=(Ee==null?void 0:Ee.message)??String(Ee)}}async function he(_e){const ie=_e.target,we=Number(ie.value),Ee=Number.isFinite(we)?Math.max(1,Math.min(600,Math.round(we))):10,x=N.value;N.value=Ee,ie.value=String(Ee),r.value="";try{await uC(Ee),s("command-notify-threshold-changed",Ee)}catch(Re){N.value=x,ie.value=String(x),r.value=(Re==null?void 0:Re.message)??String(Re)}}function Le(_e){s("appearance-changed",_e)}async function et(){const _e=y.value,ie=v.value,we=p.value;l.value=!0,r.value="";try{await u(_e),v.value=_e}catch(Ee){y.value=ie,v.value=ie;try{await u(we)}catch{}r.value=(Ee==null?void 0:Ee.message)??String(Ee)}finally{l.value=!1}}async function je(){const _e=Li(i.value).id,ie=a.value;i.value=_e,d.value=!0,r.value="";try{m.wailsBindings&&await YS(_e),a.value=_e,s("terminal-theme-changed",_e)}catch(we){i.value=ie,s("terminal-theme-changed",ie),r.value=(we==null?void 0:we.message)??String(we)}finally{d.value=!1}}return(_e,ie)=>($(),F("div",kO,[b("div",xO,[b("div",RO,[b("label",TO,L(C(o)("settings.general.languageLabel")),1),Te(ns,{modelValue:y.value,"onUpdate:modelValue":[ie[0]||(ie[0]=we=>y.value=we),et],options:h.value,disabled:l.value,"aria-label":C(o)("settings.general.languageLabel")},null,8,["modelValue","options","disabled","aria-label"]),b("p",PO,L(C(o)("settings.general.languageHint")),1)]),b("div",EO,[b("label",LO,L(C(o)("settings.general.terminalTheme")),1),Te(ns,{modelValue:i.value,"onUpdate:modelValue":[ie[1]||(ie[1]=we=>i.value=we),je],options:f.value,disabled:d.value,"aria-label":C(o)("settings.general.terminalTheme")},null,8,["modelValue","options","disabled","aria-label"]),b("p",DO,L(C(o)("settings.general.terminalThemeHint")),1)])]),Te(gO,{onAppearanceChanged:Le}),C(m).wailsBindings&&!S.value?($(),F("label",MO,[b("input",{type:"checkbox",checked:_.value,onChange:Ye},null,40,AO),ot(" "+L(C(o)("settings.general.notificationsBell")),1)])):Z("",!0),C(m).wailsBindings&&!S.value?($(),F("p",IO,L(C(o)("settings.general.notificationsHint")),1)):Z("",!0),C(m).wailsBindings&&!P.value?($(),F("label",$O,[b("input",{type:"checkbox",checked:k.value,onChange:st},null,40,OO),ot(" "+L(C(o)("settings.general.shellIntegration")),1)])):Z("",!0),C(m).wailsBindings&&!P.value?($(),F("p",FO,L(C(o)("settings.general.shellIntegrationHint")),1)):Z("",!0),C(m).wailsBindings&&!w.value?($(),F("label",BO,[b("input",{type:"checkbox",checked:M.value,onChange:yt},null,40,HO),ot(" "+L(C(o)("settings.general.recoveryEnabled")),1)])):Z("",!0),C(m).wailsBindings&&!w.value?($(),F("p",NO,L(C(o)("settings.general.recoveryEnabledHint")),1)):Z("",!0),C(m).wailsBindings&&!T.value?($(),F("label",zO,L(C(o)("settings.general.defaultShell")),1)):Z("",!0),C(m).wailsBindings&&!T.value?($(),bt(ns,{key:7,modelValue:E.value,"onUpdate:modelValue":[ie[2]||(ie[2]=we=>E.value=we),ce],options:K.value,"aria-label":C(o)("settings.general.defaultShell"),disabled:A.value},null,8,["modelValue","options","aria-label","disabled"])):Z("",!0),C(m).wailsBindings&&!T.value?($(),F("p",UO,L(C(o)("settings.general.defaultShellHint")),1)):Z("",!0),C(m).wailsBindings&&!T.value&&E.value==="__custom__"?($(),F("div",VO,[rt(b("input",{class:"text-input","onUpdate:modelValue":ie[3]||(ie[3]=we=>D.value=we),placeholder:C(o)("settings.general.customShellPath"),"aria-label":C(o)("settings.general.customShellPath"),disabled:A.value},null,8,KO),[[Tt,D.value]]),b("button",{disabled:A.value,onClick:ae},L(C(o)("settings.general.saveCustom")),9,WO)])):Z("",!0),C(m).wailsBindings&&!W.value?($(),F("label",jO,[b("input",{type:"checkbox",checked:U.value,onChange:be},null,40,qO),ot(" "+L(C(o)("settings.general.webglRenderer")),1)])):Z("",!0),C(m).wailsBindings&&!W.value?($(),F("p",YO,L(C(o)("settings.general.webglHint")),1)):Z("",!0),C(m).wailsBindings&&!z.value?($(),F("label",GO,L(C(o)("settings.general.commandNotifyThreshold")),1)):Z("",!0),C(m).wailsBindings&&!z.value?($(),F("input",{key:13,class:"number-input",type:"number",min:"1",max:"600",value:N.value,onChange:he},null,40,XO)):Z("",!0),C(m).wailsBindings&&!z.value?($(),F("p",JO,L(C(o)("settings.general.commandNotifyHint")),1)):Z("",!0),r.value?($(),F("p",QO,L(r.value),1)):Z("",!0),V.value?($(),F("section",ZO,[b("h3",eF,L(C(o)("settings.general.pushNotifications.title")),1),G.value?Z("",!0):($(),F("label",tF,[b("input",{type:"checkbox","data-testid":"push-toggle",checked:j.value,disabled:te.value,onChange:De},null,40,nF),ot(" "+L(C(o)("settings.general.pushNotifications.enable")),1)])),j.value?($(),F("button",{key:1,type:"button",class:"push-test-button","data-testid":"push-test",disabled:oe.value,onClick:Pe},L(C(o)("settings.general.pushNotifications.test")),9,sF)):Z("",!0),re.value?($(),F("p",iF,L(re.value),1)):Z("",!0)])):Z("",!0)]))}}),oF=Ct(rF,[["__scopeId","data-v-e7440565"]]);async function Ov(e,t){const{data:n}=await vn(e,{method:"POST",body:JSON.stringify(t)});return n}async function aF(e,t){const{handle:n,ke1:s}=await F0(t),i=await Ov("/api/auth/stepup/init",{email:e,login_ke:s});let a;try{({ke3:a}=await B0(n,i.login_response,H0,e))}catch{throw new Error("invalid credentials")}return(await Ov("/api/auth/stepup/finalize",{email:e,session_id:i.session_id,login_ke3:a})).step_up_token}async function lF(e,t){await vn("/api/me/password",{method:"POST",body:JSON.stringify({current_password:e,new_password:t})})}async function cF(e,t){const n=await aF(e,t);await vn("/api/me",{method:"DELETE",headers:{"X-Step-Up-Token":n},body:JSON.stringify({email:e})})}function dF(e){const t=e.toLowerCase();return!!(t==="localhost"||t==="127.0.0.1"||t==="::1"||t.startsWith("127.")||t.startsWith("[")&&t.endsWith("]")&&t.slice(1,-1)==="::1")}function uF(e,t){const n=e.trim();if(!n)return on("mobile.relayUrlRequired");let s;try{s=new URL(n)}catch{return on("mobile.relayUrlMalformed")}return s.protocol!=="http:"&&s.protocol!=="https:"?on("mobile.relayUrlProtocol"):s.pathname!=="/"||s.search!==""||s.hash!==""?on("mobile.relayUrlNoPath"):s.protocol==="http:"&&!dF(s.hostname)&&!t?on("mobile.relayUrlInsecure"):null}const Fv=Ra("AttermQRScanner"),hF={class:"pair-consume"},fF={key:0,class:"pending"},pF={class:"step","data-testid":"pair-step"},vF={class:"elapsed","data-testid":"pair-elapsed"},gF={key:1,class:"pair-error","data-testid":"pair-error"},mF={class:"code"};function _F(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),s=atob(t+n),i=new Uint8Array(s.length);for(let a=0;a{const _=r.value;switch(_){case"pair_invalid_url":return a("mobile.pairing.errInvalidUrl");case"pair_invalid_scheme":return a("mobile.pairing.errInvalidScheme");case"platform_unsupported":return a("mobile.pairing.errPlatformUnsupported");case"cannot_reach_relay":return a("mobile.pairing.errCannotReachRelay");case"pair_timeout":return a("mobile.pairing.errTimeout");case"pair_invalid":return a("mobile.pairing.errPairInvalid");case"cancelled":return a("mobile.pairing.errCancelled");default:return a("mobile.pairing.errGeneric",{message:_})}}),y=q(()=>(o.value/1e3).toFixed(1)+"s"),v=q(()=>{switch(c.value){case"parsing":return a("mobile.pairing.stepParsing");case"requesting":return a("mobile.pairing.stepRequesting");case"saving":return a("mobile.pairing.stepSaving");default:return""}});function l(){g||d.value!=="pending"||(o.value=Date.now()-u,p=requestAnimationFrame(l))}function h(){g=!0,r.value="cancelled",d.value="error",p&&(cancelAnimationFrame(p),p=0)}async function f(){var S;const _=yF(n.scannedUrl,!!n.allowInsecure);if(typeof _=="string"){r.value=_,d.value="error";return}u=Date.now(),o.value=0,p=requestAnimationFrame(l);try{if(!i.relay.consumePairing)throw new Error("platform_unsupported");c.value="requesting";const k=await Promise.race([i.relay.consumePairing(_.origin,_.token,_.wrapKey),new Promise((P,M)=>setTimeout(()=>M(new Error("pair_timeout")),16e3))]);if(g||(c.value="saving",await i.relay.save({url:k.relay_url,token:k.session_token,session_expires_at:k.expires_at,allow_insecure_relay:!!n.allowInsecure,remote_permission:"full",last_email:((S=k.user)==null?void 0:S.email)??"",connected:!1,realmId:k.realm_id,homeInstanceURL:k.home_instance_url}),g))return;s("connected")}catch(k){if(g)return;r.value=k instanceof Error?k.message:String(k),d.value="error"}finally{p&&(cancelAnimationFrame(p),p=0)}}return Dt(f),Vt(()=>{g=!0,p&&(cancelAnimationFrame(p),p=0)}),(_,S)=>($(),F("div",hF,[d.value==="pending"?($(),F("div",fF,[b("p",null,L(C(a)("mobile.pairing.connecting")),1),b("p",pF,L(v.value),1),b("p",vF,L(y.value),1),b("button",{type:"button",class:"cancel","data-testid":"pair-cancel",onClick:h},L(C(a)("common.cancel")),1)])):($(),F("div",gF,[b("p",null,L(C(a)("mobile.pairing.failed")),1),b("p",mF,L(m.value),1),b("button",{type:"button",onClick:S[0]||(S[0]=k=>s("cancel"))},L(C(a)("mobile.pairing.back")),1)]))]))}}),wF=Ct(bF,[["__scopeId","data-v-285ce5b2"]]),SF={class:"tab-pane account-tab"},CF=["disabled"],kF={class:"field-label",for:"account-relay-url"},xF={class:"relay-url-row"},RF=["disabled"],TF=["disabled"],PF={key:2,class:"checkbox-row"},EF=["disabled"],LF={class:"settings-field-grid settings-field-grid--two","data-testid":"account-login-credentials-grid"},DF={class:"settings-field"},MF={class:"field-label",for:"account-login-email"},AF=["disabled"],IF={class:"settings-field"},$F={class:"field-label",for:"account-login-password"},OF=["disabled"],FF={key:3,class:"inline-error",role:"alert"},BF=["disabled"],HF={class:"account-section"},NF={class:"field-label"},zF={class:"email-value","data-testid":"account-email"},UF=["disabled"],VF={class:"account-section"},KF={class:"settings-field"},WF={class:"field-label",for:"account-old-password"},jF=["disabled"],qF={class:"settings-field-grid settings-field-grid--two","data-testid":"account-password-grid"},YF={class:"settings-field"},GF={class:"field-label",for:"account-new-password"},XF=["disabled"],JF={key:0,class:"hint"},QF={class:"settings-field"},ZF={class:"field-label",for:"account-confirm-password"},eB=["disabled"],tB={key:0,class:"hint"},nB=["disabled"],sB={key:0,class:"error"},iB={key:1,class:"success"},rB={class:"account-section danger-zone"},oB={class:"hint warning-text"},aB={class:"field-label",for:"danger-current-password"},lB=["disabled"],cB={class:"field-label",for:"danger-confirm-email"},dB=["disabled"],uB=["disabled"],hB={key:0,class:"error"},fB=Ae({__name:"SettingsAccount",setup(e){const{t}=$t(),n=hn(),s=H(""),i=H(!0),a=H(!1),d=H(!1),r=H("https://"),o=H(""),c=H(""),p=H(""),u=H(!1),g=H(!1),m=H(""),y=H(""),v=q(()=>!!n.relay.login),l=q(()=>!!n.relay.consumePairing),h=q(()=>r.value+o.value.trim());function f(K){const J=/^\s*(https?:\/\/)(.*)$/i.exec(K);J?(r.value=J[1].toLowerCase(),o.value=J[2].trim()):o.value=K.trim(),r.value==="https://"&&(u.value=!1)}function _(){f(o.value)}Dt(async()=>{var K,J;try{const Q=await n.relay.load();Q&&(f(Q.url||""),c.value=Q.last_email||"",u.value=!!Q.allow_insecure_relay)}catch{}try{p.value=await((J=(K=n.relay).loadSavedPassword)==null?void 0:J.call(K))??""}catch{}try{const Q=await n.relay.fetchMe();s.value=Q.email,c.value||(c.value=Q.email),d.value=!0}catch{d.value=!1}finally{i.value=!1}});async function S(){var K,J;if(!a.value){a.value=!0;try{await((J=(K=n.relay).logout)==null?void 0:J.call(K))}catch{}finally{if(v.value){d.value=!1,s.value="",a.value=!1,n.events.emit("relay:auth-restored",void 0);return}location.assign("/login.html")}}}async function k(){if(!n.relay.login||g.value)return;m.value="";const K=uF(h.value,u.value);if(K){m.value=K;return}if(!c.value.trim()){m.value=t("mobile.emailRequired");return}if(!p.value){m.value=t("mobile.passwordRequired");return}g.value=!0;try{await n.relay.login(h.value.replace(/\/$/,""),c.value.trim(),p.value,u.value);const J=await n.relay.fetchMe();s.value=J.email,c.value=J.email,d.value=!0,n.events.emit("relay:auth-restored",void 0)}catch(J){const Q=J instanceof Error?J.message:String(J);Q==="invalid_credentials"?m.value=t("mobile.invalidCredentials"):Q==="rate_limited"?m.value=t("mobile.rateLimited"):/403|origin/i.test(Q)?m.value=t("mobile.originRejected"):m.value=t("mobile.cannotReachRelay",{message:Q})}finally{g.value=!1}}async function P(){m.value="";try{const{camera:K}=await Fv.requestPermissions();if(K!=="granted"){m.value=t("mobile.pairing.cameraDenied");return}const J=await Fv.scan();if(J.cancelled)return;if(!J.rawValue){m.value=t("mobile.pairing.noQrDetected");return}y.value=J.rawValue}catch(K){const J=K instanceof Error?K.message:String(K);/PLUGIN_NOT_AVAILABLE|not implemented/i.test(J)?m.value=t("mobile.pairing.scanNotAvailable"):m.value=J}}async function M(){y.value="";try{const K=await n.relay.fetchMe();s.value=K.email,c.value=K.email,d.value=!0,n.events.emit("relay:auth-restored",void 0)}catch(K){m.value=K instanceof Error?K.message:String(K)}}function w(K){return K instanceof Error&&K.message==="invalid credentials"?t("settings.account.errors.wrongPassword"):K instanceof Xs?K.code==="step_up_required"||K.code==="step_up_invalid"?t("settings.account.errors.sessionExpired"):K.status===401?t("settings.account.errors.wrongPassword"):K.status===429?t("settings.account.errors.rateLimited"):K.status===0?t("settings.account.errors.network"):t("settings.account.errors.generic"):K instanceof Error?K.message:String(K)}const T=H(""),A=H(""),E=H(""),R=H(!1),D=H(""),I=H(""),O=q(()=>A.value.length>=8),U=q(()=>E.value!==""&&A.value===E.value),W=q(()=>T.value!==""&&O.value&&U.value&&!R.value);async function N(){if(W.value){D.value="",I.value="",R.value=!0;try{await lF(T.value,A.value),I.value=t("settings.account.changePassword.successToast"),T.value="",A.value="",E.value=""}catch(K){D.value=w(K)}finally{R.value=!1}}}const z=H(!1),V=H(""),j=H(""),G=H(!1),te=H(""),oe=q(()=>V.value!==""&&s.value!==""&&j.value===s.value&&!G.value);function re(){z.value=!z.value,z.value||(V.value="",j.value="",te.value="")}async function ye(){if(oe.value&&window.confirm(t("settings.account.dangerZone.confirmPrompt"))){te.value="",G.value=!0;try{await cF(s.value,V.value),location.assign("/login.html")}catch(K){te.value=w(K)}finally{G.value=!1}}}return(K,J)=>($(),F("div",SF,[!d.value&&v.value?($(),F("form",{key:0,class:"account-section inline-login","data-testid":"account-inline-login",onSubmit:dt(k,["prevent"])},[b("h3",null,L(C(t)("mobile.loginButton")),1),l.value?($(),F("button",{key:0,type:"button",class:"secondary primary-action","data-testid":"account-scan-qr",disabled:g.value||!!y.value,onClick:P},L(C(t)("mobile.pairing.scan")),9,CF)):Z("",!0),y.value?($(),bt(wF,{key:1,"scanned-url":y.value,"allow-insecure":u.value,onConnected:M,onCancel:J[0]||(J[0]=Q=>y.value="")},null,8,["scanned-url","allow-insecure"])):Z("",!0),b("label",kF,L(C(t)("mobile.relayUrl")),1),b("div",xF,[rt(b("select",{"onUpdate:modelValue":J[1]||(J[1]=Q=>r.value=Q),"data-testid":"account-login-scheme",disabled:g.value,onChange:J[2]||(J[2]=Q=>r.value==="https://"?u.value=!1:void 0)},J[12]||(J[12]=[b("option",{value:"https://"},"https://",-1),b("option",{value:"http://"},"http://",-1)]),40,RF),[[Cg,r.value]]),rt(b("input",{id:"account-relay-url","onUpdate:modelValue":J[3]||(J[3]=Q=>o.value=Q),"data-testid":"account-login-url",disabled:g.value,autocomplete:"off",autocapitalize:"off",spellcheck:"false",placeholder:"relay.example.com",onInput:_},null,40,TF),[[Tt,o.value]])]),r.value==="http://"?($(),F("label",PF,[b("span",null,L(C(t)("mobile.allowInsecure")),1),rt(b("input",{"onUpdate:modelValue":J[4]||(J[4]=Q=>u.value=Q),"data-testid":"account-login-allow-insecure",disabled:g.value,type:"checkbox"},null,8,EF),[[ho,u.value]])])):Z("",!0),b("div",LF,[b("div",DF,[b("label",MF,L(C(t)("mobile.email")),1),rt(b("input",{id:"account-login-email","onUpdate:modelValue":J[5]||(J[5]=Q=>c.value=Q),"data-testid":"account-login-email",disabled:g.value,type:"email",autocomplete:"username",autocapitalize:"off",spellcheck:"false"},null,8,AF),[[Tt,c.value]])]),b("div",IF,[b("label",$F,L(C(t)("mobile.password")),1),rt(b("input",{id:"account-login-password","onUpdate:modelValue":J[6]||(J[6]=Q=>p.value=Q),"data-testid":"account-login-password",disabled:g.value,type:"password",autocomplete:"current-password"},null,8,OF),[[Tt,p.value]])])]),m.value?($(),F("p",FF,L(m.value),1)):Z("",!0),b("button",{type:"submit",class:"secondary primary-action","data-testid":"account-login-submit",disabled:g.value},L(g.value?C(t)("common.loading"):C(t)("mobile.loginButton")),9,BF)],32)):($(),F(Ie,{key:1},[b("section",HF,[b("label",NF,L(C(t)("settings.account.email")),1),b("p",zF,L(i.value?C(t)("common.loading"):s.value),1),b("button",{type:"button",class:"secondary","data-testid":"account-logout-button",disabled:a.value,onClick:S},L(a.value?C(t)("settings.account.logout.submitting"):C(t)("settings.account.logout.button")),9,UF)]),b("section",VF,[b("h3",null,L(C(t)("settings.account.changePassword.title")),1),b("div",KF,[b("label",WF,L(C(t)("settings.account.changePassword.oldPassword")),1),rt(b("input",{id:"account-old-password","onUpdate:modelValue":J[7]||(J[7]=Q=>T.value=Q),"data-testid":"old-password-input",type:"password",autocomplete:"current-password",disabled:R.value},null,8,jF),[[Tt,T.value]])]),b("div",qF,[b("div",YF,[b("label",GF,L(C(t)("settings.account.changePassword.newPassword")),1),rt(b("input",{id:"account-new-password","onUpdate:modelValue":J[8]||(J[8]=Q=>A.value=Q),"data-testid":"new-password-input",type:"password",autocomplete:"new-password",disabled:R.value},null,8,XF),[[Tt,A.value]]),A.value&&!O.value?($(),F("p",JF,L(C(t)("settings.account.changePassword.hintLength")),1)):Z("",!0)]),b("div",QF,[b("label",ZF,L(C(t)("settings.account.changePassword.confirmPassword")),1),rt(b("input",{id:"account-confirm-password","onUpdate:modelValue":J[9]||(J[9]=Q=>E.value=Q),"data-testid":"confirm-password-input",type:"password",autocomplete:"new-password",disabled:R.value,onKeyup:Xn(N,["enter"])},null,40,eB),[[Tt,E.value]]),E.value&&!U.value?($(),F("p",tB,L(C(t)("settings.account.changePassword.hintMismatch")),1)):Z("",!0)])]),b("button",{type:"button",class:"secondary","data-testid":"change-password-submit",disabled:!W.value,onClick:N},L(R.value?C(t)("settings.account.changePassword.submitting"):C(t)("settings.account.changePassword.submit")),9,nB),D.value?($(),F("p",sB,L(D.value),1)):Z("",!0),I.value?($(),F("p",iB,L(I.value),1)):Z("",!0)]),b("section",rB,[b("h3",null,L(C(t)("settings.account.dangerZone.title")),1),b("p",oB,L(C(t)("settings.account.dangerZone.warning")),1),b("button",{type:"button",class:"secondary","data-testid":"danger-zone-toggle",onClick:re},L(C(t)("settings.account.dangerZone.toggle")),1),z.value?($(),F(Ie,{key:0},[b("label",aB,L(C(t)("settings.account.dangerZone.currentPassword")),1),rt(b("input",{id:"danger-current-password","onUpdate:modelValue":J[10]||(J[10]=Q=>V.value=Q),"data-testid":"danger-current-password",type:"password",autocomplete:"current-password",disabled:G.value},null,8,lB),[[Tt,V.value]]),b("label",cB,L(C(t)("settings.account.dangerZone.typeEmailToConfirm")),1),rt(b("input",{id:"danger-confirm-email","onUpdate:modelValue":J[11]||(J[11]=Q=>j.value=Q),"data-testid":"danger-confirm-email",type:"text",autocomplete:"off",spellcheck:"false",disabled:G.value},null,8,dB),[[Tt,j.value]]),b("button",{type:"button",class:"danger-btn","data-testid":"danger-delete-button",disabled:!oe.value,onClick:ye},L(G.value?C(t)("settings.account.dangerZone.deleting"):C(t)("settings.account.dangerZone.deleteButton")),9,uB),te.value?($(),F("p",hB,L(te.value),1)):Z("",!0)],64)):Z("",!0)])],64))]))}}),pB=Ct(fB,[["__scopeId","data-v-55932ce0"]]);var La={},vB=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},xy={},$s={};let xh;const gB=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];$s.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};$s.getSymbolTotalCodewords=function(t){return gB[t]};$s.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};$s.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');xh=t};$s.isKanjiModeEnabled=function(){return typeof xh<"u"};$s.toSJIS=function(t){return xh(t)};var _c={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+n)}}e.isValid=function(s){return s&&typeof s.bit<"u"&&s.bit>=0&&s.bit<4},e.from=function(s,i){if(e.isValid(s))return s;try{return t(s)}catch{return i}}})(_c);function Ry(){this.buffer=[],this.length=0}Ry.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let n=0;n>>t-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var mB=Ry;function Da(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}Da.prototype.set=function(e,t,n,s){const i=e*this.size+t;this.data[i]=n,s&&(this.reservedBit[i]=!0)};Da.prototype.get=function(e,t){return this.data[e*this.size+t]};Da.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n};Da.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var _B=Da,Ty={};(function(e){const t=$s.getSymbolSize;e.getRowColCoords=function(s){if(s===1)return[];const i=Math.floor(s/7)+2,a=t(s),d=a===145?26:Math.ceil((a-13)/(2*i-2))*2,r=[a-7];for(let o=1;o=0&&i<=7},e.from=function(i){return e.isValid(i)?parseInt(i,10):void 0},e.getPenaltyN1=function(i){const a=i.size;let d=0,r=0,o=0,c=null,p=null;for(let u=0;u=5&&(d+=t.N1+(r-5)),c=m,r=1),m=i.get(g,u),m===p?o++:(o>=5&&(d+=t.N1+(o-5)),p=m,o=1)}r>=5&&(d+=t.N1+(r-5)),o>=5&&(d+=t.N1+(o-5))}return d},e.getPenaltyN2=function(i){const a=i.size;let d=0;for(let r=0;r=10&&(r===1488||r===93)&&d++,o=o<<1&2047|i.get(p,c),p>=10&&(o===1488||o===93)&&d++}return d*t.N3},e.getPenaltyN4=function(i){let a=0;const d=i.data.length;for(let o=0;o=0;){const d=a[0];for(let o=0;o0){const a=new Uint8Array(this.degree);return a.set(s,i),a}return s};var bB=Rh,My={},cr={},Th={};Th.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var vi={};const Ay="[0-9]+",wB="[A-Z $%*+\\-./:]+";let ba="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ba=ba.replace(/u/g,"\\u");const SB="(?:(?![A-Z0-9 $%*+\\-./:]|"+ba+`)(?:.|[\r -]))+`;vi.KANJI=new RegExp(ba,"g");vi.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");vi.BYTE=new RegExp(SB,"g");vi.NUMERIC=new RegExp(Ay,"g");vi.ALPHANUMERIC=new RegExp(wB,"g");const CB=new RegExp("^"+ba+"$"),kB=new RegExp("^"+Ay+"$"),xB=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");vi.testKanji=function(t){return CB.test(t)};vi.testNumeric=function(t){return kB.test(t)};vi.testAlphanumeric=function(t){return xB.test(t)};(function(e){const t=Th,n=vi;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(a,d){if(!a.ccBits)throw new Error("Invalid mode: "+a);if(!t.isValid(d))throw new Error("Invalid version: "+d);return d>=1&&d<10?a.ccBits[0]:d<27?a.ccBits[1]:a.ccBits[2]},e.getBestModeForData=function(a){return n.testNumeric(a)?e.NUMERIC:n.testAlphanumeric(a)?e.ALPHANUMERIC:n.testKanji(a)?e.KANJI:e.BYTE},e.toString=function(a){if(a&&a.id)return a.id;throw new Error("Invalid mode")},e.isValid=function(a){return a&&a.bit&&a.ccBits};function s(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+i)}}e.from=function(a,d){if(e.isValid(a))return a;try{return s(a)}catch{return d}}})(cr);(function(e){const t=$s,n=yc,s=_c,i=cr,a=Th,d=7973,r=t.getBCHDigit(d);function o(g,m,y){for(let v=1;v<=40;v++)if(m<=e.getCapacity(v,y,g))return v}function c(g,m){return i.getCharCountIndicator(g,m)+4}function p(g,m){let y=0;return g.forEach(function(v){const l=c(v.mode,m);y+=l+v.getBitsLength()}),y}function u(g,m){for(let y=1;y<=40;y++)if(p(g,y)<=e.getCapacity(y,m,i.MIXED))return y}e.from=function(m,y){return a.isValid(m)?parseInt(m,10):y},e.getCapacity=function(m,y,v){if(!a.isValid(m))throw new Error("Invalid QR Code version");typeof v>"u"&&(v=i.BYTE);const l=t.getSymbolTotalCodewords(m),h=n.getTotalCodewordsCount(m,y),f=(l-h)*8;if(v===i.MIXED)return f;const _=f-c(v,m);switch(v){case i.NUMERIC:return Math.floor(_/10*3);case i.ALPHANUMERIC:return Math.floor(_/11*2);case i.KANJI:return Math.floor(_/13);case i.BYTE:default:return Math.floor(_/8)}},e.getBestVersionForData=function(m,y){let v;const l=s.from(y,s.M);if(Array.isArray(m)){if(m.length>1)return u(m,l);if(m.length===0)return 1;v=m[0]}else v=m;return o(v.mode,v.getLength(),l)},e.getEncodedBits=function(m){if(!a.isValid(m)||m<7)throw new Error("Invalid QR Code version");let y=m<<12;for(;t.getBCHDigit(y)-r>=0;)y^=d<=0;)i^=$y<0&&(s=this.data.substr(n),i=parseInt(s,10),t.put(i,a*3+1))};var PB=bo;const EB=cr,xd=["0","1","2","3","4","5","6","7","8","9","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"," ","$","%","*","+","-",".","/",":"];function wo(e){this.mode=EB.ALPHANUMERIC,this.data=e}wo.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};wo.prototype.getLength=function(){return this.data.length};wo.prototype.getBitsLength=function(){return wo.getBitsLength(this.data.length)};wo.prototype.write=function(t){let n;for(n=0;n+2<=this.data.length;n+=2){let s=xd.indexOf(this.data[n])*45;s+=xd.indexOf(this.data[n+1]),t.put(s,11)}this.data.length%2&&t.put(xd.indexOf(this.data[n]),6)};var LB=wo;const DB=cr;function So(e){this.mode=DB.BYTE,typeof e=="string"?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}So.getBitsLength=function(t){return t*8};So.prototype.getLength=function(){return this.data.length};So.prototype.getBitsLength=function(){return So.getBitsLength(this.data.length)};So.prototype.write=function(e){for(let t=0,n=this.data.length;t=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+` -Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}};var $B=Co,Fy={exports:{}};(function(e){var t={single_source_shortest_paths:function(n,s,i){var a={},d={};d[s]=0;var r=t.PriorityQueue.make();r.push(s,0);for(var o,c,p,u,g,m,y,v,l;!r.empty();){o=r.pop(),c=o.value,u=o.cost,g=n[c]||{};for(p in g)g.hasOwnProperty(p)&&(m=g[p],y=u+m,v=d[p],l=typeof d[p]>"u",(l||v>y)&&(d[p]=y,r.push(p,y),a[p]=c))}if(typeof i<"u"&&typeof d[i]>"u"){var h=["Could not find a path from ",s," to ",i,"."].join("");throw new Error(h)}return a},extract_shortest_path_from_predecessor_list:function(n,s){for(var i=[],a=s;a;)i.push(a),n[a],a=n[a];return i.reverse(),i},find_path:function(n,s,i){var a=t.single_source_shortest_paths(n,s,i);return t.extract_shortest_path_from_predecessor_list(a,i)},PriorityQueue:{make:function(n){var s=t.PriorityQueue,i={},a;n=n||{};for(a in s)s.hasOwnProperty(a)&&(i[a]=s[a]);return i.queue=[],i.sorter=n.sorter||s.default_sorter,i},default_sorter:function(n,s){return n.cost-s.cost},push:function(n,s){var i={value:n,cost:s};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Fy);var OB=Fy.exports;(function(e){const t=cr,n=PB,s=LB,i=MB,a=$B,d=vi,r=$s,o=OB;function c(h){return unescape(encodeURIComponent(h)).length}function p(h,f,_){const S=[];let k;for(;(k=h.exec(_))!==null;)S.push({data:k[0],index:k.index,mode:f,length:k[0].length});return S}function u(h){const f=p(d.NUMERIC,t.NUMERIC,h),_=p(d.ALPHANUMERIC,t.ALPHANUMERIC,h);let S,k;return r.isKanjiModeEnabled()?(S=p(d.BYTE,t.BYTE,h),k=p(d.KANJI,t.KANJI,h)):(S=p(d.BYTE_KANJI,t.BYTE,h),k=[]),f.concat(_,S,k).sort(function(M,w){return M.index-w.index}).map(function(M){return{data:M.data,mode:M.mode,length:M.length}})}function g(h,f){switch(f){case t.NUMERIC:return n.getBitsLength(h);case t.ALPHANUMERIC:return s.getBitsLength(h);case t.KANJI:return a.getBitsLength(h);case t.BYTE:return i.getBitsLength(h)}}function m(h){return h.reduce(function(f,_){const S=f.length-1>=0?f[f.length-1]:null;return S&&S.mode===_.mode?(f[f.length-1].data+=_.data,f):(f.push(_),f)},[])}function y(h){const f=[];for(let _=0;_=0&&r<=6&&(o===0||o===6)||o>=0&&o<=6&&(r===0||r===6)||r>=2&&r<=4&&o>=2&&o<=4?e.set(a+r,d+o,!0,!0):e.set(a+r,d+o,!1,!0))}}function WB(e){const t=e.size;for(let n=8;n>r&1)===1,e.set(i,a,d,!0),e.set(a,i,d,!0)}function Pd(e,t,n){const s=e.size,i=UB.getEncodedBits(t,n);let a,d;for(a=0;a<15;a++)d=(i>>a&1)===1,a<6?e.set(a,8,d,!0):a<8?e.set(a+1,8,d,!0):e.set(s-15+a,8,d,!0),a<8?e.set(8,s-a-1,d,!0):a<9?e.set(8,15-a-1+1,d,!0):e.set(8,15-a-1,d,!0);e.set(s-8,8,1,!0)}function YB(e,t){const n=e.size;let s=-1,i=n-1,a=7,d=0;for(let r=n-1;r>0;r-=2)for(r===6&&r--;;){for(let o=0;o<2;o++)if(!e.isReserved(i,r-o)){let c=!1;d>>a&1)===1),e.set(i,r-o,c),a--,a===-1&&(d++,a=7)}if(i+=s,i<0||n<=i){i-=s,s=-s;break}}}function GB(e,t,n){const s=new FB;n.forEach(function(o){s.put(o.mode.bit,4),s.put(o.getLength(),VB.getCharCountIndicator(o.mode,e)),o.write(s)});const i=wc.getSymbolTotalCodewords(e),a=xu.getTotalCodewordsCount(e,t),d=(i-a)*8;for(s.getLengthInBits()+4<=d&&s.put(0,4);s.getLengthInBits()%8!==0;)s.putBit(0);const r=(d-s.getLengthInBits())/8;for(let o=0;o=7&&qB(o,t),YB(o,d),isNaN(s)&&(s=ku.getBestMask(o,Pd.bind(null,o,n))),ku.applyMask(s,o),Pd(o,n,s),{modules:o,version:t,errorCorrectionLevel:n,maskPattern:s,segments:i}}xy.create=function(t,n){if(typeof t>"u"||t==="")throw new Error("No input text");let s=Rd.M,i,a;return typeof n<"u"&&(s=Rd.from(n.errorCorrectionLevel,Rd.M),i=Gl.from(n.version),a=ku.from(n.maskPattern),n.toSJISFunc&&wc.setToSJISFunction(n.toSJISFunc)),JB(t,i,s,a)};var By={},Ph={};(function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let s=n.slice().replace("#","").split("");if(s.length<3||s.length===5||s.length>8)throw new Error("Invalid hex color: "+n);(s.length===3||s.length===4)&&(s=Array.prototype.concat.apply([],s.map(function(a){return[a,a]}))),s.length===6&&s.push("F","F");const i=parseInt(s.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+s.slice(0,6).join("")}}e.getOptions=function(s){s||(s={}),s.color||(s.color={});const i=typeof s.margin>"u"||s.margin===null||s.margin<0?4:s.margin,a=s.width&&s.width>=21?s.width:void 0,d=s.scale||4;return{width:a,scale:a?4:d,margin:i,color:{dark:t(s.color.dark||"#000000ff"),light:t(s.color.light||"#ffffffff")},type:s.type,rendererOpts:s.rendererOpts||{}}},e.getScale=function(s,i){return i.width&&i.width>=s+i.margin*2?i.width/(s+i.margin*2):i.scale},e.getImageWidth=function(s,i){const a=e.getScale(s,i);return Math.floor((s+i.margin*2)*a)},e.qrToImageData=function(s,i,a){const d=i.modules.size,r=i.modules.data,o=e.getScale(d,a),c=Math.floor((d+a.margin*2)*o),p=a.margin*o,u=[a.color.light,a.color.dark];for(let g=0;g=p&&m>=p&&g"u"&&(!d||!d.getContext)&&(o=d,d=void 0),d||(c=s()),o=t.getOptions(o);const p=t.getImageWidth(a.modules.size,o),u=c.getContext("2d"),g=u.createImageData(p,p);return t.qrToImageData(g.data,a,o),n(u,c,p),u.putImageData(g,0,0),c},e.renderToDataURL=function(a,d,r){let o=r;typeof o>"u"&&(!d||!d.getContext)&&(o=d,d=void 0),o||(o={});const c=e.render(a,d,o),p=o.type||"image/png",u=o.rendererOpts||{};return c.toDataURL(p,u.quality)}})(By);var Hy={};const QB=Ph;function Nv(e,t){const n=e.a/255,s=t+'="'+e.hex+'"';return n<1?s+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':s}function Ed(e,t,n){let s=e+t;return typeof n<"u"&&(s+=" "+n),s}function ZB(e,t,n){let s="",i=0,a=!1,d=0;for(let r=0;r0&&o>0&&e[r-1]||(s+=a?Ed("M",o+n,.5+c+n):Ed("m",i,0),i=0,a=!1),o+1':"",c="',p='viewBox="0 0 '+r+" "+r+'"',g=''+o+c+` -`;return typeof s=="function"&&s(null,g),g};const e6=vB,Ru=xy,Ny=By,t6=Hy;function Eh(e,t,n,s,i){const a=[].slice.call(arguments,1),d=a.length,r=typeof a[d-1]=="function";if(!r&&!e6())throw new Error("Callback required as last argument");if(r){if(d<2)throw new Error("Too few arguments provided");d===2?(i=n,n=t,t=s=void 0):d===3&&(t.getContext&&typeof i>"u"?(i=s,s=void 0):(i=s,s=n,n=t,t=void 0))}else{if(d<1)throw new Error("Too few arguments provided");return d===1?(n=t,t=s=void 0):d===2&&!t.getContext&&(s=n,n=t,t=void 0),new Promise(function(o,c){try{const p=Ru.create(n,s);o(e(p,t,s))}catch(p){c(p)}})}try{const o=Ru.create(n,s);i(null,e(o,t,s))}catch(o){i(o)}}La.create=Ru.create;La.toCanvas=Eh.bind(null,Ny.render);La.toDataURL=Eh.bind(null,Ny.renderToDataURL);La.toString=Eh.bind(null,function(e,t,n){return t6.render(e,n)});const n6={class:"pairing-panel","data-testid":"pairing-panel"},s6={class:"title"},i6={class:"hint"},r6=["disabled"],o6={key:1,class:"qr-wrap"},a6=["src"],l6={key:0,class:"wrap-badge","data-testid":"pair-wrap-badge"},c6={key:1,class:"wrap-warning","data-testid":"pair-wrap-warning"},d6={key:2,class:"countdown"},u6={class:"time"},h6={key:3,class:"countdown expired","data-testid":"pair-expired"},f6={class:"prefix"},p6={key:2,class:"error"},v6=Ae({__name:"PairingPanel",setup(e){const{t}=$t(),n=H(!1),s=H(""),i=H(null),a=H(""),d=H(Math.floor(Date.now()/1e3));let r=null;const o=q(()=>i.value?Math.max(0,i.value.expires_at-d.value):0),c=q(()=>{const g=o.value,m=Math.floor(g/60),y=g%60;return`${m}:${y.toString().padStart(2,"0")}`}),p=q(()=>i.value!==null&&o.value===0);async function u(){n.value=!0,s.value="";try{const g=await Z1();a.value=await La.toDataURL(g.qr_url,{width:240,margin:1}),i.value=g,d.value=Math.floor(Date.now()/1e3),r&&clearInterval(r),r=setInterval(()=>{d.value=Math.floor(Date.now()/1e3)},1e3)}catch(g){s.value=g instanceof Error?g.message:String(g)}finally{n.value=!1}}return Vt(()=>{r&&clearInterval(r)}),(g,m)=>($(),F("section",n6,[b("div",s6,L(C(t)("settings.relay.pairing.title")),1),b("p",i6,L(C(t)("settings.relay.pairing.hint")),1),i.value?($(),F("div",o6,[b("img",{src:a.value,alt:"",class:lt(["qr",{dimmed:p.value}]),"data-testid":"pair-qr"},null,10,a6),i.value.wrapped?($(),F("div",l6,L(C(t)("settings.relay.pairing.wrappedBadge")),1)):($(),F("p",c6,L(C(t)("settings.relay.pairing.unwrappedWarning")),1)),p.value?($(),F("div",h6,L(C(t)("settings.relay.pairing.expired")),1)):($(),F("div",d6,[b("span",null,L(C(t)("settings.relay.pairing.expiresIn")),1),b("span",u6,L(c.value),1)])),b("code",f6,L(i.value.token.slice(0,12))+"…",1),b("button",{type:"button","data-testid":"pair-regenerate",onClick:u},L(C(t)("settings.relay.pairing.regenerate")),1)])):($(),F("button",{key:0,type:"button","data-testid":"pair-generate",disabled:n.value,onClick:u},L(n.value?C(t)("settings.relay.pairing.generating"):C(t)("settings.relay.pairing.generate")),9,r6)),s.value?($(),F("p",p6,L(s.value),1)):Z("",!0)]))}}),g6=Ct(v6,[["__scopeId","data-v-45575575"]]),m6={class:"tab-pane"},_6={key:0,class:"dim"},y6={class:"uplink-toggle-row"},b6={class:"field-label"},w6=["disabled"],S6={class:"toggle-label"},C6={class:"hint"},k6={class:"url-label-row"},x6={class:"field-label",for:"relay-host"},R6={class:"insecure-inline"},T6=["disabled"],P6={class:"url-scheme","aria-hidden":"true"},E6=["disabled"],L6={key:0,class:"warning"},D6={class:"settings-field-grid settings-field-grid--two","data-test":"relay-credentials-grid"},M6={class:"settings-field"},A6={class:"field-label",for:"relay-email"},I6=["autocomplete","disabled"],$6={class:"settings-field"},O6={class:"field-label",for:"relay-password"},F6={class:"password-field"},B6=["type","disabled"],H6=["aria-label","aria-pressed","disabled"],N6={key:0,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},z6={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},U6={class:"field-label",for:"relay-claim-token"},V6=["placeholder","disabled"],K6={class:"hint"},W6=["disabled"],j6={class:"auth-switch-action"},q6={class:"checkbox"},Y6=["checked","disabled"],G6={key:2,class:"warning"},X6={key:3,class:"error"},J6={class:"danger-zone"},Q6={class:"danger-zone-text"},Z6={class:"field-label"},e8={class:"hint"},t8=["disabled"],n8=Ae({__name:"SettingsRelay",emits:["relay-config-changed","dirty"],setup(e,{expose:t,emit:n}){const s=hn(),i=n,a=H(""),d=H(""),r=H(!1),o=H(!1),c=H(!1),p=H(!0),u=H(!1),g=H(!1),m=H(!1),y=H(""),{t:v}=$t(),l=H(""),h=H(""),f=H(!1),_=H("login"),S=H(""),k=H(""),P=H(""),M=H(""),w=H(""),T=H(!1);function A(ye){return ye.trim().replace(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//,"")}const E=q(()=>"https://");_t(a,ye=>{/:\/\//.test(ye)&&(a.value=A(ye))});const R=q(()=>{const ye=A(a.value);return ye?E.value+ye:""}),D=q(()=>A(a.value)!==M.value||d.value!==w.value||r.value!==T.value);_t(D,ye=>i("dirty",ye));function I(){_.value=_.value==="login"?"register":"login",_.value==="login"&&(S.value="")}function O(ye){try{const K=new URL(ye.trim());return K.host?["http:","https:","ws:","wss:"].includes(K.protocol):!1}catch{return!1}}const U=q(()=>P.value?{text:v("settings.relay.connectedAs",{identity:P.value}),cls:"on"}:k.value?{text:v("settings.relay.connectedAs",{identity:k.value.slice(0,8)}),cls:"on"}:R.value?c.value?{text:v("settings.relay.paused"),cls:"off"}:O(R.value)?{text:v("settings.relay.connecting"),cls:"warn"}:{text:v("settings.relay.relayInvalid"),cls:"error"}:{text:v("settings.relay.notConfigured"),cls:"off"});async function W(){p.value=!0;try{const ye=await Tl();if(r.value=ye.allow_insecure_relay,a.value=A(ye.url),d.value=ye.token,o.value=ye.disable_e2ee??!1,c.value=ye.paused??!1,z(),l.value=ye.last_email??"",l.value)try{h.value=await X1()}catch{}else h.value="";if(k.value="",P.value="",ye.token)try{const K=await bf();P.value=K.email||"",k.value=K.user_id||""}catch{}}catch(ye){y.value=(ye==null?void 0:ye.message)??String(ye)}finally{p.value=!1}}Dt(async()=>{await W(),s.events.on("relay:auth-info",async ye=>{const{user_id:K}=ye;if(k.value=K||"",!K){P.value="";return}try{const J=await bf();P.value=J.email||""}catch{}}),s.events.on("e2ee-mode-changed",ye=>{const K=ye==null?void 0:ye.disabled;typeof K=="boolean"&&(o.value=K)})}),Vt(()=>{});async function N(ye){const K=ye.target,J=!!(K!=null&&K.checked);o.value=J;try{await j1(J)}catch(Q){o.value=!J,y.value=(Q==null?void 0:Q.message)??String(Q)}}function z(){M.value=A(a.value),w.value=d.value,T.value=r.value}async function V(){try{await yf({url:R.value,token:d.value,session_expires_at:0,allow_insecure_relay:r.value,disable_e2ee:o.value,remote_permission:"full",last_email:l.value.trim()})}catch{}if(h.value)try{await J1(h.value)}catch(ye){Lt("relay","remember relay password failed",{error:Rt(ye)})}z()}async function j(){if(u.value=!0,y.value="",!O(R.value)){y.value=v("settings.relay.relayInvalid"),u.value=!1;return}try{await Q1(R.value,r.value)}catch(J){await V(),y.value=v("settings.relay.versionProbeFailed",{reason:(J==null?void 0:J.message)??String(J)}),u.value=!1;return}const ye=!!(l.value.trim()&&h.value),K=!!d.value;if(ye){try{_.value==="register"?await G1(R.value,l.value.trim(),h.value,S.value.trim(),r.value):await Y1(R.value,l.value.trim(),h.value,r.value)}catch(J){await V(),y.value=v("settings.relay.loginFailedInline",{reason:(J==null?void 0:J.message)??String(J)}),u.value=!1;return}S.value=""}else if(K)try{await yf({url:R.value,token:d.value,session_expires_at:0,allow_insecure_relay:r.value,disable_e2ee:o.value,remote_permission:"full"})}catch(J){y.value=(J==null?void 0:J.message)??String(J),u.value=!1;return}else{await V(),y.value=v("settings.relay.credentialsRequired"),u.value=!1;return}try{const J=await Tl();r.value=J.allow_insecure_relay,a.value=A(J.url),d.value=J.token,o.value=J.disable_e2ee??!1,c.value=J.paused??!1,l.value=J.last_email??"",z()}catch(J){y.value=(J==null?void 0:J.message)??String(J),u.value=!1;return}u.value=!1,i("relay-config-changed")}async function G(){m.value=!0,y.value="";try{await q1(c.value),i("relay-config-changed")}catch(ye){y.value=(ye==null?void 0:ye.message)??String(ye),c.value=!c.value}finally{m.value=!1}}async function te(){if(window.confirm(v("settings.relay.clearConfirm"))){g.value=!0,y.value="";try{await W1(),await W(),z(),i("relay-config-changed")}catch(ye){y.value=v("settings.relay.clearFailed",{reason:(ye==null?void 0:ye.message)??String(ye)})}finally{g.value=!1}}}const oe=q(()=>!u.value&&!!A(a.value)),re=q(()=>u.value?v("settings.relay.saving"):v("settings.relay.saveConnect"));return t({save:j,canSave:oe,saveLabel:re,paused:c,saving:u,dirty:D}),(ye,K)=>($(),F("div",m6,[p.value?($(),F("div",_6,L(C(v)("common.loading")),1)):($(),F(Ie,{key:1},[b("div",y6,[b("span",b6,L(C(v)("settings.relay.uplink")),1),b("label",{class:lt(["toggle-switch",{disabled:m.value}])},[rt(b("input",{"onUpdate:modelValue":K[0]||(K[0]=J=>c.value=J),type:"checkbox","true-value":!1,"false-value":!0,disabled:m.value||!a.value,onChange:G},null,40,w6),[[ho,c.value]]),K[7]||(K[7]=b("span",{class:"toggle-track"},[b("span",{class:"toggle-thumb"})],-1)),b("span",S6,L(c.value?C(v)("settings.relay.off"):C(v)("settings.relay.on")),1)],2)]),b("div",{class:lt(["status-pill",U.value.cls])},[K[8]||(K[8]=b("span",{class:"dot"},"●",-1)),ot(" "+L(U.value.text),1)],2),b("p",C6,L(C(v)("settings.relay.hint")),1),b("div",k6,[b("label",x6,L(C(v)("settings.relay.relayUrl")),1),b("label",R6,[rt(b("input",{"onUpdate:modelValue":K[1]||(K[1]=J=>r.value=J),type:"checkbox",disabled:u.value},null,8,T6),[[ho,r.value]]),ot(" "+L(C(v)("settings.relay.insecureMode")),1)])]),b("div",{class:lt(["url-input",{insecure:r.value}])},[b("span",P6,L(E.value),1),rt(b("input",{id:"relay-host","onUpdate:modelValue":K[2]||(K[2]=J=>a.value=J),type:"text",placeholder:"relay.example.com",autocomplete:"off",spellcheck:"false",disabled:u.value,onKeyup:Xn(j,["enter"])},null,40,E6),[[Tt,a.value]])],2),r.value?($(),F("p",L6,L(C(v)("settings.relay.insecureWarning")),1)):Z("",!0),b("div",D6,[b("div",M6,[b("label",A6,L(C(v)("settings.relay.email")),1),rt(b("input",{id:"relay-email","onUpdate:modelValue":K[3]||(K[3]=J=>l.value=J),type:"email",autocomplete:_.value==="register"?"email":"username",disabled:u.value,onKeyup:Xn(j,["enter"])},null,40,I6),[[Tt,l.value]])]),b("div",$6,[b("label",O6,L(C(v)("settings.relay.password")),1),b("div",F6,[rt(b("input",{id:"relay-password","onUpdate:modelValue":K[4]||(K[4]=J=>h.value=J),type:f.value?"text":"password",autocomplete:"current-password",disabled:u.value,onKeyup:Xn(j,["enter"])},null,40,B6),[[T0,h.value]]),b("button",{type:"button",class:"password-toggle","aria-label":f.value?C(v)("settings.relay.passwordHide"):C(v)("settings.relay.passwordShow"),"aria-pressed":f.value,disabled:u.value,onClick:K[5]||(K[5]=J=>f.value=!f.value)},[f.value?($(),F("svg",z6,K[10]||(K[10]=[b("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"},null,-1),b("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)]))):($(),F("svg",N6,K[9]||(K[9]=[b("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),b("circle",{cx:"12",cy:"12",r:"3"},null,-1)])))],8,H6)])])]),_.value==="register"?($(),F(Ie,{key:1},[b("label",U6,L(C(v)("settings.relay.claimToken")),1),rt(b("input",{id:"relay-claim-token","onUpdate:modelValue":K[6]||(K[6]=J=>S.value=J),type:"text",autocomplete:"off",spellcheck:"false",placeholder:C(v)("settings.relay.claimTokenPlaceholder"),disabled:u.value,onKeyup:Xn(j,["enter"])},null,40,V6),[[Tt,S.value]]),b("p",K6,L(C(v)("settings.relay.claimTokenHint")),1)],64)):Z("",!0),b("button",{type:"button",class:"auth-switch",disabled:u.value,onClick:I},[ot(L(_.value==="login"?C(v)("settings.relay.noAccountPrompt"):C(v)("settings.relay.haveAccountPrompt"))+" ",1),b("span",j6,L(_.value==="login"?C(v)("settings.relay.modeRegister"):C(v)("settings.relay.modeLogin")),1)],8,W6),b("label",q6,[b("input",{checked:o.value,type:"checkbox",disabled:u.value,onChange:N},null,40,Y6),ot(" "+L(C(v)("settings.relay.disableE2EE")),1)]),o.value?($(),F("p",G6,L(C(v)("settings.relay.disableE2EEWarning")),1)):Z("",!0),y.value?($(),F("p",X6,L(y.value),1)):Z("",!0),Te(g6),b("div",J6,[b("div",Q6,[b("div",Z6,L(C(v)("settings.relay.clearTitle")),1),b("p",e8,L(C(v)("settings.relay.clearHint")),1)]),b("button",{type:"button",class:"danger-btn",disabled:u.value||g.value||p.value,onClick:te},L(g.value?C(v)("settings.relay.clearing"):C(v)("settings.relay.clearAction")),9,t8)])],64))]))}}),s8=Ct(n8,[["__scopeId","data-v-100947b5"]]),Tu={DEBUG:0,INFO:1,WARN:2,ERROR:3},i8=/^(\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}\.\d{3}) (DEBUG|INFO|WARN|ERROR)\s+\[([^\]]+)\] (.*)$/;function zy(e){const t=i8.exec(e);return t?{kind:"structured",ts:t[1],level:t[2],tag:t[3],msg:t[4]}:{kind:"raw",text:e}}function r8(e,t){return Tu[e]>=Tu[t]}const Uy=[{value:"DEBUG",label:"DEBUG+"},{value:"INFO",label:"INFO+"},{value:"WARN",label:"WARN+"},{value:"ERROR",label:"ERROR"}],o8=[{value:"DEBUG",label:"DEBUG"},{value:"INFO",label:"INFO"},{value:"WARN",label:"WARN"},{value:"ERROR",label:"ERROR"}];function a8(e){return e in Tu}const Sc="",Xl="*";function l8(e,t){if(!t)return!0;if(t.endsWith(Xl)){const n=t.slice(0,-Xl.length);return e===n||e.startsWith(n+"-")}return e===t}function Vy(e,t){const n=new Map;for(const r of e.split(` -`)){const o=zy(r);o.kind==="structured"&&n.set(o.tag,(n.get(o.tag)??0)+1)}const s=Array.from(n.values()).reduce((r,o)=>r+o,0),i=new Map;for(const r of n.keys()){const o=r.split("-")[0];i.set(o,[...i.get(o)??[],r])}const a=Array.from(i.entries()).filter(([,r])=>r.length>1).map(([r,o])=>({value:r+Xl,label:`${r}${Xl} (${o.reduce((c,p)=>c+(n.get(p)??0),0)})`})).sort((r,o)=>r.value.localeCompare(o.value)),d=Array.from(n.entries()).map(([r,o])=>({value:r,label:`${r} (${o})`})).sort((r,o)=>r.value.localeCompare(o.value));return[{value:Sc,label:`${t} (${s})`},...a,...d]}const c8={class:"log-lines"},d8={class:"ts"},u8={class:"lvl"},h8={class:"tag"},f8={class:"msg"},p8={key:1,class:"raw"},v8=Ae({__name:"LogLines",props:{content:{},minLevel:{default:"DEBUG"},tag:{default:Sc}},setup(e){const t=e,n=q(()=>t.content.split(` -`).map(zy).filter(i=>i.kind==="raw"?!0:r8(i.level,t.minLevel)&&l8(i.tag,t.tag)));return(s,i)=>($(),F("div",c8,[($(!0),F(Ie,null,at(n.value,(a,d)=>($(),F("div",{key:d,class:lt(["log-line",a.kind==="structured"?"lvl-"+a.level:"lvl-raw"])},[a.kind==="structured"?($(),F(Ie,{key:0},[b("span",d8,L(a.ts),1),b("span",u8,L(a.level),1),b("span",h8,"["+L(a.tag)+"]",1),b("span",f8,L(a.msg),1)],64)):($(),F("span",p8,L(a.text),1))],2))),128))]))}}),Ky=Ct(v8,[["__scopeId","data-v-c9e8e2b4"]]),g8={class:"tab-pane"},m8={key:0,class:"dim"},_8={class:"checkbox"},y8=["checked"],b8={class:"level-row"},w8={class:"level-label"},S8={class:"level-select"},C8=["aria-label","title"],k8={class:"checkbox-row"},x8={class:"checkbox"},R8=["checked"],T8=["aria-label","title"],P8={class:"kv"},E8={class:"k"},L8=["title"],D8={class:"actions"},M8={key:0,class:"error"},A8={key:1,class:"tail-wrap"},I8={class:"tail-header"},$8={class:"tail-label"},O8=["title"],F8={class:"tail-level"},B8={class:"tail-tag"},H8=["disabled"],N8={key:0,class:"tail-error"},z8={key:1,class:"tail-empty"},U8=Ae({__name:"SettingsLogging",emits:["open-log-viewer"],setup(e){const t=H(!0),n=H(""),s=H(""),i=H(!0),a=H(""),d=H(!1),r=H("INFO"),{t:o}=$t(),c=H(null),p=H(""),u=H(!1);let g=null;const m=H(null),y=H("DEBUG"),v=H(Sc),l=q(()=>{var R;return Vy(((R=c.value)==null?void 0:R.content)??"",o("settings.logging.tagFilterAll"))}),h=H(!0);function f(){var R;return(R=m.value)==null?void 0:R.$el}function _(R){return R.scrollHeight-R.scrollTop-R.clientHeight<24}async function S(R){if(!t.value)return;const D=f();if(!(R!=null&&R.force)&&D&&!_(D)){h.value=!1;return}h.value=!0,u.value=!0,p.value="";try{c.value=await fm()}catch(O){p.value=(O==null?void 0:O.message)??String(O)}finally{u.value=!1}await un();const I=f();I&&(I.scrollTop=I.scrollHeight)}function k(){const R=f();if(!R)return;const D=_(R);D&&!h.value?S():h.value=D}_t(m,(R,D,I)=>{const O=R==null?void 0:R.$el;O&&(O.addEventListener("scroll",k,{passive:!0}),I(()=>O.removeEventListener("scroll",k)))});function P(R){t.value=R.enabled,n.value=R.path,s.value=R.effective_path,a8(R.level)&&(r.value=R.level)}Dt(async()=>{try{P(await Xo())}catch(R){a.value=(R==null?void 0:R.message)??String(R)}finally{i.value=!1}try{d.value=await oC()}catch{}await S(),g=window.setInterval(S,3e3)}),Vt(()=>{g!==null&&(window.clearInterval(g),g=null)});async function M(R){const D=R.target,I=t.value;t.value=D.checked,a.value="";try{await Ya({enabled:D.checked,path:n.value}),P(await Xo())}catch(O){t.value=I,a.value=(O==null?void 0:O.message)??String(O)}}async function w(R){const D=r.value;r.value=R,a.value="";try{await Ya({enabled:t.value,path:n.value,level:R}),P(await Xo()),await S({force:!0})}catch(I){r.value=D,a.value=(I==null?void 0:I.message)??String(I)}}async function T(R){const D=R.target,I=d.value;d.value=D.checked;try{await aC(D.checked)}catch(O){d.value=I,a.value=(O==null?void 0:O.message)??String(O)}}async function A(){a.value="";try{const R=await qS();if(!R)return;await Ya({enabled:t.value,path:R}),P(await Xo())}catch(R){a.value=(R==null?void 0:R.message)??String(R)}}async function E(){a.value="";try{await Ya({enabled:t.value,path:""}),P(await Xo())}catch(R){a.value=(R==null?void 0:R.message)??String(R)}}return(R,D)=>($(),F("div",g8,[i.value?($(),F("div",m8,L(C(o)("common.loading")),1)):($(),F(Ie,{key:1},[b("label",_8,[b("input",{type:"checkbox",checked:t.value,onChange:M},null,40,y8),ot(" "+L(C(o)("settings.logging.writeLogs")),1)]),b("div",b8,[b("span",w8,L(C(o)("settings.logging.writeLevel")),1),b("div",S8,[Te(ns,{modelValue:r.value,options:C(o8),ariaLabel:C(o)("settings.logging.writeLevel"),"onUpdate:modelValue":D[0]||(D[0]=I=>w(I))},null,8,["modelValue","options","ariaLabel"])]),b("span",{class:"info-icon",role:"img","aria-label":C(o)("settings.logging.writeLevelHint"),title:C(o)("settings.logging.writeLevelHint")},"i",8,C8)]),b("div",k8,[b("label",x8,[b("input",{type:"checkbox",checked:d.value,onChange:T},null,40,R8),ot(" "+L(C(o)("settings.logging.ptyInputDebug")),1)]),b("span",{class:"info-icon",role:"img","aria-label":C(o)("settings.logging.ptyInputDebugHint"),title:C(o)("settings.logging.ptyInputDebugHint")},"i",8,T8)]),b("div",P8,[b("span",E8,L(C(o)("settings.logging.currentFile")),1),b("span",{class:"v path",title:s.value},L(s.value),9,L8)]),b("div",D8,[b("button",{onClick:A},L(C(o)("settings.logging.changeLocation")),1),b("button",{onClick:E},L(C(o)("settings.logging.resetDefault")),1),b("button",{onClick:D[1]||(D[1]=I=>R.$emit("open-log-viewer"))},L(C(o)("settings.logging.viewLogs")),1)]),a.value?($(),F("p",M8,L(a.value),1)):Z("",!0),t.value?($(),F("section",A8,[b("header",I8,[b("span",$8,L(C(o)("settings.logging.liveTail")),1),h.value?Z("",!0):($(),F("button",{key:0,class:"tail-paused",title:C(o)("settings.logging.tailPausedHint"),onClick:D[2]||(D[2]=I=>S({force:!0}))},L(C(o)("settings.logging.tailPaused")),9,O8)),b("div",F8,[Te(ns,{modelValue:y.value,options:C(Uy),ariaLabel:C(o)("settings.logging.levelFilter"),"onUpdate:modelValue":D[3]||(D[3]=I=>y.value=I)},null,8,["modelValue","options","ariaLabel"])]),b("div",B8,[Te(ns,{modelValue:v.value,options:l.value,ariaLabel:C(o)("settings.logging.tagFilter"),"onUpdate:modelValue":D[4]||(D[4]=I=>v.value=I)},null,8,["modelValue","options","ariaLabel"])]),b("button",{class:"tail-refresh",disabled:u.value,onClick:D[5]||(D[5]=I=>S({force:!0}))},L(C(o)("common.refresh")),9,H8)]),p.value?($(),F("p",N8,L(p.value),1)):!c.value||!c.value.exists?($(),F("p",z8,L(C(o)("settings.logging.noContent")),1)):($(),bt(Ky,{key:2,ref_key:"tailEl",ref:m,class:"tail-content",content:c.value.content,minLevel:y.value,tag:v.value},null,8,["content","minLevel","tag"]))])):Z("",!0)],64))]))}}),V8=Ct(U8,[["__scopeId","data-v-cd8d05fa"]]);function Wy(e,t=Date.now()){const n=Math.floor(t/1e3)-e;return n<60?on("settings.updates.justNow"):n<3600?on("settings.updates.minutesAgo",{count:Math.floor(n/60)}):n<86400?on("settings.updates.hoursAgo",{count:Math.floor(n/3600)}):on("settings.updates.daysAgo",{count:Math.floor(n/86400)})}const K8={class:"tab-pane"},W8={key:0,class:"dim"},j8={class:"grid"},q8={class:"kv"},Y8={class:"k"},G8={class:"v"},X8={class:"kv"},J8={class:"k"},Q8={class:"v"},Z8={key:0,class:"kv"},eH={class:"k"},tH=["title"],nH={key:0,class:"checkbox"},sH=["checked"],iH={key:1,class:"proxy-box"},rH={class:"field-label",for:"update-gh-proxy"},oH={class:"proxy-row"},aH=["disabled"],lH={class:"hint"},cH={key:2,class:"notes"},dH={key:3,class:"version-lines"},uH=["value"],hH={key:4,class:"actions"},fH=["disabled"],pH=["disabled"],vH=["disabled"],gH={key:5,class:"error"},mH=Ae({__name:"SettingsUpdates",emits:["request-install"],setup(e){const t=H(null),n=H(!0),s=H(""),i=H(!1),a=H(!1),d=H(!0),r=H(""),o=H(""),c=H(!1),p=H(!1),u=H(!1);let g=null;const{t:m}=$t();function y(A){const E=A.replace(/^v/,"").split(".");return E.length<2?"":`v${E[0]}.${E[1]}`}_t(()=>{var A;return(A=t.value)==null?void 0:A.lines},A=>{var D;if(!A||A.length===0||o.value&&A.some(I=>I.minor===o.value))return;const E=y(((D=t.value)==null?void 0:D.current)??""),R=A.find(I=>I.minor===E);o.value=R?R.minor:A[0].minor},{immediate:!0});const v=q(()=>{var R;const E=(((R=t.value)==null?void 0:R.lines)??[]).find(D=>D.minor===o.value);return(E==null?void 0:E.latest)??""});Dt(async()=>{try{const[A,E,R]=await Promise.all([fo(),cm(),Ef()]);t.value=A,n.value=E,s.value=R}catch(A){r.value=(A==null?void 0:A.message)??String(A)}finally{d.value=!1}g=window.setInterval(async()=>{try{t.value=await fo()}catch{}},2e3)}),Vt(()=>{g!==null&&window.clearInterval(g)});async function l(){i.value=!0;try{await rm()}catch{}finally{i.value=!1}}async function h(){c.value=!0;try{await om()}catch{}}async function f(){if(v.value){c.value=!0;try{await PS(v.value)}catch{}}}_t(()=>{var A;return(A=t.value)==null?void 0:A.downloaded_exists},async(A,E)=>{var D;if(!A||E||!c.value||p.value)return;const R=((D=t.value)==null?void 0:D.latest)??"";c.value=!1,p.value=!0;try{if(window.confirm(m("settings.updates.redownloadPrompt",{version:R})))try{await Pf(R)}catch{}}finally{p.value=!1}});async function _(){u.value=!0;try{await am()}catch{}finally{u.value=!1}}async function S(){var E;const A=((E=t.value)==null?void 0:E.latest)??"";if(A)try{await Pf(A)}catch{}}async function k(A){const E=A.target;n.value=E.checked,await ES(E.checked)}async function P(){a.value=!0,r.value="";try{await LS(s.value),s.value=await Ef()}catch(A){r.value=(A==null?void 0:A.message)??String(A)}finally{a.value=!1}}const M=q(()=>{var A,E;return((A=t.value)==null?void 0:A.current)==="dev"||((E=t.value)==null?void 0:E.current)===""}),w=q(()=>{var A,E;return(((E=(A=t.value)==null?void 0:A.lines)==null?void 0:E.length)??0)>=2}),T=q(()=>{const A=t.value;return A?A.current==="dev"||A.current===""?m("settings.updates.devDisabled"):A.error?A.error:A.checking||i.value?m("settings.updates.checking"):A.ready?m("settings.updates.readyToInstall",{version:A.latest}):A.downloading?m("settings.updates.downloadingStatus",{version:A.latest,pct:A.download_pct}):A.available?m("settings.updates.available",{version:A.latest}):A.last_check_at>0?m("settings.updates.upToDate",{ago:Wy(A.last_check_at)}):m("settings.updates.notChecked"):""});return(A,E)=>($(),F("div",K8,[d.value?($(),F("div",W8,L(C(m)("common.loading")),1)):t.value?($(),F(Ie,{key:1},[b("div",j8,[b("div",q8,[b("span",Y8,L(C(m)("settings.updates.currentVersion")),1),b("span",G8,L(t.value.current||C(m)("common.unknown")),1)]),b("div",X8,[b("span",J8,L(C(m)("settings.updates.status")),1),b("span",Q8,L(T.value),1)]),t.value.download_path&&(t.value.ready||t.value.downloading)?($(),F("div",Z8,[b("span",eH,L(C(m)("settings.updates.downloadPath")),1),b("span",{class:"v path",title:t.value.download_path},L(t.value.download_path),9,tH)])):Z("",!0)]),M.value?Z("",!0):($(),F("label",nH,[b("input",{type:"checkbox",checked:n.value,onChange:k},null,40,sH),ot(" "+L(C(m)("settings.updates.autoCheck")),1)])),M.value?Z("",!0):($(),F("div",iH,[b("label",rH,L(C(m)("settings.updates.ghProxy")),1),b("div",oH,[rt(b("input",{id:"update-gh-proxy","onUpdate:modelValue":E[0]||(E[0]=R=>s.value=R),type:"url",placeholder:"https://gh-proxy.example.com/",spellcheck:"false"},null,512),[[Tt,s.value,void 0,{trim:!0}]]),b("button",{disabled:a.value,onClick:P},L(a.value?C(m)("settings.relay.saving"):C(m)("common.save")),9,aH)]),b("p",lH,L(C(m)("settings.updates.proxyHint")),1)])),!M.value&&t.value.notes?($(),F("details",cH,[b("summary",null,L(C(m)("settings.updates.releaseNotes")),1),b("pre",null,L(t.value.notes),1)])):Z("",!0),!M.value&&w.value&&t.value.lines&&!t.value.ready?($(),F("div",dH,[($(!0),F(Ie,null,at(t.value.lines,R=>($(),F("div",{key:R.minor,class:"version-line"},[b("label",null,[rt(b("input",{type:"radio",value:R.minor,"onUpdate:modelValue":E[1]||(E[1]=D=>o.value=D)},null,8,uH),[[Fd,o.value]]),ot(" "+L(C(m)("settings.updates.versionLine",{minor:R.minor}))+" → "+L(R.latest),1)])]))),128))])):Z("",!0),M.value?Z("",!0):($(),F("div",hH,[b("button",{onClick:l,disabled:i.value||t.value.checking},L(C(m)("settings.updates.checkNow")),9,fH),w.value&&!t.value.ready&&!t.value.downloading?($(),F("button",{key:0,class:"primary",disabled:t.value.downloading||!v.value,onClick:f},L(C(m)("settings.updates.downloadVersion",{version:v.value})),9,pH)):Z("",!0),!w.value&&t.value.available&&!t.value.ready&&!t.value.downloading?($(),F("button",{key:1,class:"primary",onClick:h},L(C(m)("settings.updates.downloadVersion",{version:t.value.latest})),1)):Z("",!0),t.value.downloading?($(),F("button",{key:2,class:"primary danger",disabled:u.value,onClick:_},L(u.value?C(m)("settings.updates.cancelling"):C(m)("settings.updates.cancelDownload",{pct:t.value.download_pct})),9,vH)):Z("",!0),t.value.ready?($(),F("button",{key:3,class:"primary danger",onClick:E[2]||(E[2]=R=>A.$emit("request-install",t.value.latest))},L(C(m)("settings.updates.forceInstallRestart")),1)):Z("",!0),t.value.ready?($(),F("button",{key:4,class:"secondary",onClick:S},L(C(m)("settings.updates.redownload")),1)):Z("",!0)])),r.value?($(),F("p",gH,L(r.value),1)):Z("",!0)],64)):Z("",!0)]))}}),_H=Ct(mH,[["__scopeId","data-v-c859d0af"]]),yH={key:0,class:"translate-settings"},bH=["value"],wH=["value"],SH=["value"],CH=["value"],kH={key:0,class:"extra-params-error"},xH={key:1,class:"hint"},RH={class:"muted"},TH=Ae({__name:"TranslateSettings",setup(e){var u;const t=Fr(),{t:n}=$t(),s=[{code:"zh-CN",labelKey:"plugins.translate.simplifiedChinese"},{code:"en",labelKey:"plugins.translate.targetEnglish"},{code:"ja",labelKey:"plugins.translate.targetJapanese"},{code:"ko",labelKey:"plugins.translate.targetKorean"},{code:"de",labelKey:"plugins.translate.targetGerman"},{code:"fr",labelKey:"plugins.translate.targetFrench"},{code:"es",labelKey:"plugins.translate.targetSpanish"}],i=q(()=>{var g;return(g=t.cfg)==null?void 0:g.translate}),a=q(()=>s.map(g=>({value:g.code,label:n(g.labelKey)}))),d=q({get:()=>{var g;return((g=i.value)==null?void 0:g.defaultTargetLang)??"zh-CN"},set:g=>{p({defaultTargetLang:g})}}),r=H(((u=i.value)==null?void 0:u.extraParams)??""),o=H("");_t(()=>{var g;return((g=i.value)==null?void 0:g.extraParams)??""},g=>{g!==r.value&&(r.value=g)});function c(g){const m=g.target.value;r.value=m;const y=m.trim();if(y===""){o.value="",p({extraParams:""});return}let v;try{v=JSON.parse(y)}catch(l){o.value=l instanceof Error?l.message:String(l);return}if(!v||typeof v!="object"||Array.isArray(v)){o.value=n("plugins.translate.extraParamsInvalid");return}o.value="",p({extraParams:y})}async function p(g){if(!t.cfg)return;const m=JSON.parse(JSON.stringify(t.cfg));m.translate={...m.translate,...g};try{await t.save(m)}catch(y){Ks("plugin-translate","save config failed",{error:Rt(y)})}}return(g,m)=>i.value?($(),F("div",yH,[b("label",null,[b("span",null,L(C(n)("plugins.translate.baseUrl")),1),b("input",{type:"text",value:i.value.baseUrl,onChange:m[0]||(m[0]=y=>p({baseUrl:y.target.value})),placeholder:"https://api.openai.com"},null,40,bH)]),b("label",null,[b("span",null,L(C(n)("plugins.translate.apiKey")),1),b("input",{type:"password",value:i.value.apiKey,onChange:m[1]||(m[1]=y=>p({apiKey:y.target.value})),placeholder:"sk-..."},null,40,wH)]),b("label",null,[b("span",null,L(C(n)("plugins.translate.model")),1),b("input",{type:"text",value:i.value.model,onChange:m[2]||(m[2]=y=>p({model:y.target.value})),placeholder:"gpt-4o-mini"},null,40,SH)]),b("label",null,[b("span",null,L(C(n)("plugins.translate.defaultTargetLanguage")),1),Te(ns,{modelValue:d.value,"onUpdate:modelValue":m[3]||(m[3]=y=>d.value=y),options:a.value,"aria-label":C(n)("plugins.translate.defaultTargetLanguage")},null,8,["modelValue","options","aria-label"])]),b("label",null,[b("span",null,L(C(n)("plugins.translate.extraParams")),1),b("textarea",{class:"extra-params",rows:"3",spellcheck:"false",value:r.value,onInput:c,placeholder:'{"stream": true, "top_p": 0.9}'},null,40,CH),o.value?($(),F("span",kH,L(o.value),1)):($(),F("span",xH,L(C(n)("plugins.translate.extraParamsHint")),1))]),b("p",RH,L(C(n)("plugins.translate.keyStoredPlaintext",{path:"~/.config/atterm/config.json"})),1)])):Z("",!0)}}),PH=Ct(TH,[["__scopeId","data-v-2b2be568"]]),EH={class:"settings-plugins"},LH={class:"hint"},DH={key:0,class:"loading"},MH={key:1,class:"plugin-list"},AH={class:"row-head"},IH=["checked","onChange"],$H={class:"title"},OH={class:"desc"},FH={key:0,class:"fe-settings"},BH={class:"muted"},HH={key:2,class:"widget-settings"},NH=["checked"],zH={class:"muted"},UH={key:0,class:"empty"},VH=Ae({__name:"SettingsPlugins",setup(e){const t=Fr(),{t:n}=$t(),s=hn(),i=q(()=>n_.filter(r=>!r.desktopOnly||s.caps.wailsBindings));Dt(async()=>{t.cfg||await t.load()});async function a(r){var c;if(!((c=t.cfg)!=null&&c.widget))return;const o=JSON.parse(JSON.stringify(t.cfg));o.widget.aiOnly=r;try{await t.save(o)}catch(p){Ks("plugin","widget aiOnly save failed",{error:Rt(p)})}}async function d(r,o){try{await t.setEnabled(r,o)}catch(c){Ks("plugin","setEnabled failed",{error:Rt(c)})}}return(r,o)=>($(),F("section",EH,[b("p",LH,L(C(n)("settings.plugins.hint")),1),C(t).cfg?($(),F("ul",MH,[($(!0),F(Ie,null,at(i.value,c=>{var p,u;return $(),F("li",{key:c.id,class:"plugin-row"},[b("label",AH,[b("input",{type:"checkbox",checked:C(t).isPluginEnabled(c.id),onChange:g=>d(c.id,g.target.checked)},null,40,IH),b("span",$H,L(C(n)(c.titleKey)),1)]),b("p",OH,L(C(n)(c.descriptionKey)),1),c.id==="file-explorer"&&C(t).isPluginEnabled("file-explorer")?($(),F("div",FH,[b("p",BH,L(C(n)("settings.plugins.panelDragHint")),1)])):Z("",!0),c.id==="translate"&&C(t).isPluginEnabled("translate")?($(),bt(PH,{key:1})):Z("",!0),c.id==="desk-widget"&&C(t).isPluginEnabled("desk-widget")?($(),F("div",HH,[b("label",null,[b("input",{type:"checkbox",checked:((u=(p=C(t).cfg)==null?void 0:p.widget)==null?void 0:u.aiOnly)??!1,onChange:o[0]||(o[0]=g=>a(g.target.checked))},null,40,NH),b("span",null,L(C(n)("plugins.deskWidget.aiOnly")),1)]),b("p",zH,L(C(n)("plugins.deskWidget.aiOnlyHint")),1)])):Z("",!0)])}),128)),i.value.length===0?($(),F("li",UH,L(C(n)("settings.plugins.noneRegistered")),1)):Z("",!0)])):($(),F("div",DH,L(C(n)("common.loading")),1))]))}}),KH=Ct(VH,[["__scopeId","data-v-a25af5cc"]]),Di=[{id:"pane.split-vertical-new",group:"pane",labelKey:"settings.shortcuts.splitPaneVertically",defaultBinding:"Mod+KeyN"},{id:"pane.split-horizontal-new",group:"pane",labelKey:"settings.shortcuts.splitPaneHorizontally",defaultBinding:"Mod+Shift+KeyN"},{id:"pane.close",group:"pane",labelKey:"settings.shortcuts.closePane",defaultBinding:"Mod+KeyW"},{id:"pane.focus-left",group:"pane",labelKey:"settings.shortcuts.focusPaneLeft",defaultBinding:"Mod+Alt+ArrowLeft"},{id:"pane.focus-right",group:"pane",labelKey:"settings.shortcuts.focusPaneRight",defaultBinding:"Mod+Alt+ArrowRight"},{id:"pane.focus-up",group:"pane",labelKey:"settings.shortcuts.focusPaneUp",defaultBinding:"Mod+Alt+ArrowUp"},{id:"pane.focus-down",group:"pane",labelKey:"settings.shortcuts.focusPaneDown",defaultBinding:"Mod+Alt+ArrowDown"},{id:"terminal.search",group:"pane",labelKey:"settings.shortcuts.terminalSearch",defaultBinding:"Mod+KeyF"},{id:"tab.new",group:"tab",labelKey:"settings.shortcuts.newTab",defaultBinding:"Mod+KeyT"},{id:"tab.prev",group:"tab",labelKey:"settings.shortcuts.previousTab",defaultBinding:"Mod+Shift+BracketLeft"},{id:"tab.next",group:"tab",labelKey:"settings.shortcuts.nextTab",defaultBinding:"Mod+Shift+BracketRight"},{id:"toggleTaskSidebar",group:"sidebar",labelKey:"tasks.sidebar.collapse",defaultBinding:"Mod+KeyB"},{id:"sidebar.focus-search",group:"sidebar",labelKey:"settings.shortcuts.focusSidebarSearch",defaultBinding:"Mod+Shift+KeyF"}],li=Object.fromEntries(Di.map(e=>[e.id,e])),WH=Object.fromEntries(Di.map(e=>[e.defaultBinding,e.id])),jy=new Set(["KeyA","KeyB","KeyC","KeyD","KeyE","KeyF","KeyG","KeyH","KeyI","KeyJ","KeyK","KeyL","KeyM","KeyN","KeyO","KeyP","KeyQ","KeyR","KeyS","KeyT","KeyU","KeyV","KeyW","KeyX","KeyY","KeyZ","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","BracketLeft","BracketRight","Minus","Equal","Backquote","Comma","Period","Slash","Semicolon","Quote","Backslash"]);function qy(e,t){const n=t==="Meta"?e.metaKey:e.ctrlKey;if((t==="Meta"?e.ctrlKey:e.metaKey)||!jy.has(e.code)||!n&&!e.altKey&&!e.shiftKey)return null;const i=[];return n&&i.push("Mod"),e.altKey&&i.push("Alt"),e.shiftKey&&i.push("Shift"),i.push(e.code),i.join("+")}function Yy(e){const t={};for(const n of Di)t[n.id]=n.defaultBinding;for(const[n,s]of Object.entries(e))n in li&&(t[n]=s);return t}function jH(e,t){const n=e[t];if(!n)return[];const s=[];for(const[i,a]of Object.entries(e))i!==t&&a===n&&s.push(i);return s}function qH(e){const t={...WH};for(const[n,s]of Object.entries(e))if(n in li){for(const i of Object.keys(t))if(t[i]===n){delete t[i];break}s!==""&&(t[s]=n)}return t}const YH={KeyA:"A",KeyB:"B",KeyC:"C",KeyD:"D",KeyE:"E",KeyF:"F",KeyG:"G",KeyH:"H",KeyI:"I",KeyJ:"J",KeyK:"K",KeyL:"L",KeyM:"M",KeyN:"N",KeyO:"O",KeyP:"P",KeyQ:"Q",KeyR:"R",KeyS:"S",KeyT:"T",KeyU:"U",KeyV:"V",KeyW:"W",KeyX:"X",KeyY:"Y",KeyZ:"Z",Digit0:"0",Digit1:"1",Digit2:"2",Digit3:"3",Digit4:"4",Digit5:"5",Digit6:"6",Digit7:"7",Digit8:"8",Digit9:"9",ArrowLeft:"←",ArrowRight:"→",ArrowUp:"↑",ArrowDown:"↓",BracketLeft:"[",BracketRight:"]",Minus:"-",Equal:"=",Backquote:"`",Comma:",",Period:".",Slash:"/",Semicolon:";",Quote:"'",Backslash:"\\"};function GH(e,t){if(e==="")return"";const n=XH(e);if(n===null||n.code===null)return e;const s=YH[n.code]??n.code;if(t==="Meta"){let a="";return n.mod&&(a+="⌘"),n.alt&&(a+="⌥"),n.shift&&(a+="⇧"),a+s}const i=[];return n.mod&&i.push("Ctrl"),n.alt&&i.push("Alt"),n.shift&&i.push("Shift"),i.push(s),i.join("+")}function XH(e){if(e==="")return{mod:!1,alt:!1,shift:!1,code:null};const t=e.split("+");if(t.length<2)return null;const n=t[t.length-1];if(!jy.has(n))return null;const s=t.slice(0,-1),i=["Mod","Alt","Shift"];let a=0;const d={mod:!1,alt:!1,shift:!1};for(const r of s){for(;a{if(c.key==="Escape"){c.preventDefault(),c.stopPropagation(),o(),s("cancel");return}if(c.key==="Backspace"){c.preventDefault(),c.stopPropagation(),o(),s("update","");return}if(c.key==="Tab"||c.key==="Enter"){c.preventDefault(),c.stopPropagation();return}const p=qy(c,n.mod);p!==null&&(c.preventDefault(),c.stopPropagation(),o(),s("update",p))},document.addEventListener("keydown",d,{capture:!0}))}function o(){i.value=!1,d&&(document.removeEventListener("keydown",d,{capture:!0}),d=null)}return Vt(o),(c,p)=>($(),F("button",{type:"button",class:lt(["hotkey-cell",{capturing:i.value,empty:!i.value&&c.value===""}]),onClick:r},[i.value?($(),F(Ie,{key:0},[ot(L(C(a)("settings.shortcuts.pressKey")),1)],64)):c.value===""?($(),F(Ie,{key:1},[ot(L(C(a)("common.disabled")),1)],64)):($(),F(Ie,{key:2},[ot(L(c.value),1)],64))],2))}}),Ld=Ct(JH,[["__scopeId","data-v-80cabc38"]]),QH={class:"shortcut-settings"},ZH={class:"shortcut-group"},e7={class:"label"},t7=["title","onClick"],n7={key:0,class:"conflict"},s7={class:"shortcut-group"},i7={class:"label"},r7=["title","onClick"],o7={key:0,class:"conflict"},a7={key:0,class:"shortcut-group"},l7={class:"label"},c7=["title","onClick"],d7={key:0,class:"conflict"},u7={class:"actions-row"},h7=["disabled"],f7=["disabled"],p7={key:1,class:"error"},v7=Ae({__name:"SettingsShortcuts",props:{mod:{}},emits:["bindings-changed"],setup(e,{expose:t,emit:n}){function s(){return Xu()}const i=e,a=n,d=q(()=>i.mod??s()),{t:r}=$t(),o=H({}),c=H({}),p=H("");function u(){c.value=JSON.parse(JSON.stringify(o.value))}Dt(async()=>{try{o.value=await vm()}catch(T){p.value=(T==null?void 0:T.message)??String(T)}u()});const g=q(()=>JSON.stringify(o.value)!==JSON.stringify(c.value)),m=q(()=>Yy(c.value));function y(T){return m.value[T.id]??T.defaultBinding}function v(T){return jH(m.value,T.id)}const l=q(()=>Di.some(T=>v(T).length>0));function h(T,A){if(A===T.defaultBinding){const E={...c.value};delete E[T.id],c.value=E;return}c.value={...c.value,[T.id]:A}}function f(T){const A={...c.value};delete A[T.id],c.value=A}function _(){c.value={}}async function S(){const T={};for(const[A,E]of Object.entries(c.value))A in li&&E!==li[A].defaultBinding&&(T[A]=E);p.value="";try{await GS(T),o.value=T,a("bindings-changed",T)}catch(A){p.value=(A==null?void 0:A.message)??String(A)}}function k(){u()}const P=Di.filter(T=>T.group==="pane"),M=Di.filter(T=>T.group==="tab"),w=Di.filter(T=>T.group==="sidebar");return t({dirty:g}),(T,A)=>($(),F("div",QH,[b("section",ZH,[b("h3",null,L(C(r)("settings.shortcuts.pane")),1),($(!0),F(Ie,null,at(C(P),E=>($(),F("div",{key:E.id,class:"shortcut-row"},[b("div",e7,L(C(r)(E.labelKey)),1),Te(Ld,{value:y(E),mod:d.value,onUpdate:R=>h(E,R)},null,8,["value","mod","onUpdate"]),b("button",{class:"reset-row",title:C(r)("settings.shortcuts.resetTo",{binding:E.defaultBinding}),onClick:R=>f(E)},"↺",8,t7),v(E).length?($(),F("div",n7,L(C(r)("settings.shortcuts.conflictsWith",{labels:v(E).map(R=>C(li)[R]?C(r)(C(li)[R].labelKey):R).join(", ")})),1)):Z("",!0)]))),128))]),b("section",s7,[b("h3",null,L(C(r)("settings.shortcuts.tab")),1),($(!0),F(Ie,null,at(C(M),E=>($(),F("div",{key:E.id,class:"shortcut-row"},[b("div",i7,L(C(r)(E.labelKey)),1),Te(Ld,{value:y(E),mod:d.value,onUpdate:R=>h(E,R)},null,8,["value","mod","onUpdate"]),b("button",{class:"reset-row",title:C(r)("settings.shortcuts.resetTo",{binding:E.defaultBinding}),onClick:R=>f(E)},"↺",8,r7),v(E).length?($(),F("div",o7,L(C(r)("settings.shortcuts.conflictsWith",{labels:v(E).map(R=>C(li)[R]?C(r)(C(li)[R].labelKey):R).join(", ")})),1)):Z("",!0)]))),128))]),C(w).length>0?($(),F("section",a7,[b("h3",null,L(C(r)("settings.shortcuts.sidebar")),1),($(!0),F(Ie,null,at(C(w),E=>($(),F("div",{key:E.id,class:"shortcut-row"},[b("div",l7,L(C(r)(E.labelKey)),1),Te(Ld,{value:y(E),mod:d.value,onUpdate:R=>h(E,R)},null,8,["value","mod","onUpdate"]),b("button",{class:"reset-row",title:C(r)("settings.shortcuts.resetTo",{binding:E.defaultBinding}),onClick:R=>f(E)},"↺",8,c7),v(E).length?($(),F("div",d7,L(C(r)("settings.shortcuts.conflictsWith",{labels:v(E).map(R=>C(li)[R]?C(r)(C(li)[R].labelKey):R).join(", ")})),1)):Z("",!0)]))),128))])):Z("",!0),b("div",u7,[b("button",{class:"reset-all",onClick:_},L(C(r)("settings.shortcuts.resetAll")),1),A[0]||(A[0]=b("div",{class:"spacer"},null,-1)),b("button",{class:"discard",disabled:!g.value,onClick:k},L(C(r)("common.discard")),9,h7),b("button",{class:"save",disabled:!g.value||l.value,onClick:S},L(C(r)("common.save")),9,f7)]),p.value?($(),F("p",p7,L(p.value),1)):Z("",!0)]))}}),g7=Ct(v7,[["__scopeId","data-v-05d9d72b"]]);function m7(e){const t=s=>s.padEnd(24," ");return[`atterm desktop diagnostics — ${e.generated_at}`,"--------------------------------------------------",t("App version:")+e.app_version,t("OS:")+`${e.os} ${e.os_version} (${e.arch})`.replace(/\s+/g," ").trim(),t("WebView:")+(e.webview_summary||"(unknown)"),t("Relay URL:")+(e.relay_url||"(not configured)"),t("Relay status:")+e.relay_status,t("Relay token:")+(e.relay_token_redacted||"(none)"),t("Allow insecure HTTP:")+(e.allow_insecure_relay?"yes":"no"),t("Remote permission:")+e.remote_permission,t("Uplink paused:")+(e.uplink_paused?"yes":"no"),"","Recent relay errors (most recent first):",...e.recent_relay_errors.length===0?[" (none)"]:e.recent_relay_errors.map(s=>` ${s.timestamp} ${s.message}`),"","Config summary:",t(" Default shell:")+e.config.default_shell,t(" Locale:")+e.config.locale,t(" Theme:")+e.config.terminal_theme,t(" Notifications:")+(e.config.notifications_enabled?"enabled":"disabled"),t(" Shell integration:")+(e.config.shell_integration_enabled?"enabled":"disabled"),t(" WebGL renderer:")+(e.config.webgl_renderer_enabled?"enabled":"disabled"),t(" Logging:")+(e.config.logging_enabled?`enabled (${e.config.log_file_path})`:"disabled"),t(" Auto-check updates:")+(e.config.auto_check_updates?"enabled":"disabled"),t(" Command notify:")+`${e.config.command_notify_threshold_seconds}s`].join(` -`)}const _7={class:"diag"},y7={class:"hint"},b7={class:"preview","data-testid":"diag-preview"},w7={class:"row"},S7={key:0,class:"status"},C7=Ae({__name:"SettingsDiagnostics",setup(e){const{t}=$t(),n=H(null),s=H(""),i=H("");async function a(){i.value="",n.value=await eS(navigator.userAgent),s.value=m7(n.value)}async function d(){if(s.value)try{await navigator.clipboard.writeText(s.value),i.value=t("settings.diagnostics.copied"),setTimeout(()=>{i.value=""},1500)}catch{i.value=t("settings.diagnostics.copyFailed")}}async function r(){if(s.value)try{const o=await tS(s.value);o&&(i.value=t("settings.diagnostics.exported",{path:o}),setTimeout(()=>{i.value=""},3e3))}catch(o){i.value=o instanceof Error?o.message:String(o)}}return Dt(a),(o,c)=>($(),F("div",_7,[b("p",y7,L(C(t)("settings.diagnostics.hint")),1),b("pre",b7,L(s.value),1),b("div",w7,[b("button",{type:"button","data-testid":"diag-copy",onClick:d},L(C(t)("settings.diagnostics.copy")),1),b("button",{type:"button","data-testid":"diag-export",onClick:r},L(C(t)("settings.diagnostics.export")),1),b("button",{type:"button","data-testid":"diag-refresh",onClick:a},L(C(t)("settings.diagnostics.refresh")),1),i.value?($(),F("span",S7,L(i.value),1)):Z("",!0)])]))}}),k7=Ct(C7,[["__scopeId","data-v-1a4e377a"]]),x7={key:0,class:"configio","data-testid":"configio-panel"},R7={class:"configio-section"},T7={class:"section-title"},P7={class:"hint"},E7={class:"checkbox"},L7={class:"row"},D7=["disabled"],M7={key:0,class:"status","data-testid":"configio-export-status"},A7={key:1,class:"status error","data-testid":"configio-export-error"},I7={class:"configio-section"},$7={class:"section-title"},O7={class:"hint"},F7={class:"row"},B7={key:0,class:"status","data-testid":"configio-import-filename"},H7={key:0,class:"status","data-testid":"configio-import-loading"},N7={key:1,class:"status error","data-testid":"configio-preview-error"},z7={key:2,class:"configio-preview","data-testid":"configio-preview"},U7={key:0,class:"hint","data-testid":"configio-preview-empty"},V7={key:1,"data-testid":"configio-changes-add"},K7={key:2,"data-testid":"configio-changes-replace"},W7={key:3,"data-testid":"configio-changes-unchanged"},j7={key:4,"data-testid":"configio-skipped"},q7={class:"row"},Y7=["disabled"],G7={key:5,class:"status error","data-testid":"configio-apply-error"},X7={key:3,class:"configio-report","data-testid":"configio-report"},J7={"data-testid":"configio-report-summary"},Q7={"data-testid":"configio-report-applied"},Z7={key:0,"data-testid":"configio-report-skipped"},eN=Ae({__name:"SettingsConfigIO",setup(e){const{t}=$t(),s=hn().caps.wailsBindings,i=H(!1),a=H(!1),d=H(""),r=H("");async function o(){if(!(!s||a.value)){a.value=!0,d.value="",r.value="";try{const I=await HS(i.value);I&&(d.value=t("settings.configio.export.success",{path:I}))}catch(I){r.value=I instanceof Error?I.message:String(I)}finally{a.value=!1}}}const c=H(null),p=H(""),u=H(""),g=H(!1),m=H(null),y=H(""),v=H(!1),l=H(""),h=H(null),f=q(()=>{var I;return((I=m.value)==null?void 0:I.changes.filter(O=>O.action==="add"))??[]}),_=q(()=>{var I;return((I=m.value)==null?void 0:I.changes.filter(O=>O.action==="replace"))??[]}),S=q(()=>{var I;return((I=m.value)==null?void 0:I.changes.filter(O=>O.action==="unchanged"))??[]}),k=q(()=>{var I;return(((I=m.value)==null?void 0:I.changes.length)??0)>0}),P=q(()=>s&&!!m.value&&!!u.value&&!v.value);function M(){var I;s&&((I=c.value)==null||I.click())}function w(I){return typeof I.text=="function"?I.text():new Promise((O,U)=>{const W=new FileReader;W.onload=()=>O(String(W.result??"")),W.onerror=()=>U(W.error??new Error(t("settings.configio.import.fileReadError"))),W.readAsText(I)})}async function T(I){var W;const O=I.target,U=(W=O.files)==null?void 0:W[0];O.value="",U&&await A(U)}async function A(I){E(),p.value=I.name,g.value=!0;try{const O=await w(I),U=await NS(O);u.value=O,m.value=U}catch(O){y.value=O instanceof Error?O.message:String(O)}finally{g.value=!1}}function E(){p.value="",u.value="",m.value=null,y.value="",v.value=!1,l.value="",h.value=null}async function R(){if(P.value){v.value=!0,l.value="";try{h.value=await zS(u.value),m.value=null}catch(I){l.value=I instanceof Error?I.message:String(I)}finally{v.value=!1}}}function D(){E()}return(I,O)=>C(s)?($(),F("div",x7,[b("section",R7,[b("h4",T7,L(C(t)("settings.configio.export.title")),1),b("p",P7,L(C(t)("settings.configio.export.hint")),1),b("label",E7,[rt(b("input",{type:"checkbox","onUpdate:modelValue":O[0]||(O[0]=U=>i.value=U),"data-testid":"configio-env-checkbox"},null,512),[[ho,i.value]]),ot(" "+L(C(t)("settings.configio.export.includeEnvLabel")),1)]),b("div",L7,[b("button",{type:"button","data-testid":"configio-export-button",disabled:a.value,onClick:o},L(a.value?C(t)("settings.configio.export.exporting"):C(t)("settings.configio.export.button")),9,D7),d.value?($(),F("span",M7,L(d.value),1)):Z("",!0),r.value?($(),F("span",A7,L(r.value),1)):Z("",!0)])]),b("section",I7,[b("h4",$7,L(C(t)("settings.configio.import.title")),1),b("p",O7,L(C(t)("settings.configio.import.hint")),1),b("input",{ref_key:"fileInput",ref:c,class:"file-input",type:"file",accept:"application/json,.json","data-testid":"configio-import-file-input",onChange:T},null,544),b("div",F7,[b("button",{type:"button","data-testid":"configio-import-pick-button",onClick:M},L(C(t)("settings.configio.import.pickFile")),1),p.value?($(),F("span",B7,L(C(t)("settings.configio.import.fileLabel",{name:p.value})),1)):Z("",!0)]),g.value?($(),F("p",H7,L(C(t)("settings.configio.import.previewing")),1)):Z("",!0),y.value?($(),F("p",N7,L(C(t)("settings.configio.import.previewError",{error:y.value})),1)):Z("",!0),m.value?($(),F("div",z7,[b("h5",null,L(C(t)("settings.configio.import.previewTitle")),1),k.value?Z("",!0):($(),F("p",U7,L(C(t)("settings.configio.import.noChanges")),1)),f.value.length?($(),F("div",V7,[b("h6",null,L(C(t)("settings.configio.import.changesAdd"))+" ("+L(f.value.length)+")",1),b("ul",null,[($(!0),F(Ie,null,at(f.value,U=>($(),F("li",{key:U.key},[ot(L(U.key),1),U.detail?($(),F(Ie,{key:0},[ot(" — "+L(U.detail),1)],64)):Z("",!0)]))),128))])])):Z("",!0),_.value.length?($(),F("div",K7,[b("h6",null,L(C(t)("settings.configio.import.changesReplace"))+" ("+L(_.value.length)+")",1),b("ul",null,[($(!0),F(Ie,null,at(_.value,U=>($(),F("li",{key:U.key},[ot(L(U.key),1),U.detail?($(),F(Ie,{key:0},[ot(" — "+L(U.detail),1)],64)):Z("",!0)]))),128))])])):Z("",!0),S.value.length?($(),F("div",W7,[b("h6",null,L(C(t)("settings.configio.import.changesUnchanged"))+" ("+L(S.value.length)+")",1),b("ul",null,[($(!0),F(Ie,null,at(S.value,U=>($(),F("li",{key:U.key},L(U.key),1))),128))])])):Z("",!0),m.value.skipped.length?($(),F("div",j7,[b("h6",null,L(C(t)("settings.configio.import.skippedTitle"))+" ("+L(m.value.skipped.length)+")",1),b("ul",null,[($(!0),F(Ie,null,at(m.value.skipped,(U,W)=>($(),F("li",{key:W},L(U),1))),128))])])):Z("",!0),b("div",q7,[b("button",{type:"button","data-testid":"configio-apply-button",disabled:!P.value,onClick:R},L(v.value?C(t)("settings.configio.import.applying"):C(t)("settings.configio.import.apply")),9,Y7),b("button",{type:"button","data-testid":"configio-cancel-button",onClick:D},L(C(t)("common.cancel")),1)]),l.value?($(),F("p",G7,L(C(t)("settings.configio.import.applyError",{error:l.value})),1)):Z("",!0)])):Z("",!0),h.value?($(),F("div",X7,[b("h5",null,L(C(t)("settings.configio.import.appliedTitle")),1),b("p",J7,L(C(t)("settings.configio.import.appliedSummary",{count:h.value.applied.length})),1),b("ul",Q7,[($(!0),F(Ie,null,at(h.value.applied,U=>($(),F("li",{key:U.key},[ot(L(U.key),1),U.detail?($(),F(Ie,{key:0},[ot(" — "+L(U.detail),1)],64)):Z("",!0)]))),128))]),h.value.skipped.length?($(),F("div",Z7,[b("h6",null,L(C(t)("settings.configio.import.skippedTitle"))+" ("+L(h.value.skipped.length)+")",1),b("ul",null,[($(!0),F(Ie,null,at(h.value.skipped,(U,W)=>($(),F("li",{key:W},L(U),1))),128))])])):Z("",!0)])):Z("",!0)])])):Z("",!0)}}),tN=Ct(eN,[["__scopeId","data-v-9ef7411c"]]),nN={class:"snippet-run-panel"},sN={key:0,class:"select-phase"},iN={class:"hint"},rN={key:0,class:"error","data-testid":"snippet-run-error"},oN={class:"host-list"},aN=["data-testid","checked","onChange"],lN={class:"footer"},cN=["disabled","title"],dN={key:1,class:"results-phase"},uN={class:"rows"},hN=["data-testid","data-state"],fN={class:"row-head"},pN={class:"row-host"},vN=["data-testid","data-state"],gN=["data-testid"],mN=["data-testid"],_N=["data-testid"],yN={key:0,class:"error","data-testid":"snippet-run-error"},bN={class:"footer"},wN=["disabled"],SN=Ae({__name:"SnippetRunPanel",props:{snippetLabel:{},snippetText:{}},emits:["close"],setup(e,{expose:t,emit:n}){const s=e,i=n,{t:a}=$t(),d=hn(),r=H([]),o=H(new Set),c=H(null),p=H([]),u=H(!1),g=H(!1),m=H("");function y(R){var D;return((D=R.alias)==null?void 0:D.trim())||R.host.trim()}function v(R){const D=new Set(o.value);D.has(R)?D.delete(R):D.add(R),o.value=D}const l=q(()=>o.value.size>0&&!u.value),h=q(()=>p.value.some(R=>R.state==="pending"||R.state==="running"));async function f(){if(!l.value)return;m.value="",u.value=!0;const R=r.value.filter(D=>o.value.has(D.id)).map(D=>D.id);p.value=R.map(D=>{const I=r.value.find(O=>O.id===D);return{host_id:D,host_label:I?y(I):D,state:"pending",exit_code:0,output:"",truncated:!1}}),w=[];try{const D=await $S(s.snippetLabel,s.snippetText,R);c.value=D;const I=w;w=[];for(const O of I)O.run_id===D&&T(O)}catch(D){m.value=D instanceof Error?D.message:String(D),p.value=[],w=[]}finally{u.value=!1}}async function _(){if(!(!c.value||g.value)){g.value=!0,m.value="";try{await OS(c.value)}catch(R){m.value=R instanceof Error?R.message:String(R)}finally{g.value=!1}}}function S(R){switch(R.state){case"pending":return a("snippets.pending");case"running":return a("snippets.running");case"ok":return a("snippets.ok");case"failed":return a("snippets.failed");case"error":return`${a("snippets.error")} · ${R.error??""}`}}function k(R){if(R.state==="error"){const D=R.error??"";return R.output?`${D} -${R.output}`:D}return R.output}function P(){return p.value.map(R=>`=== ${R.host_label} === -${k(R)}`).join(` - -`)}async function M(){const R=P(),D=typeof navigator>"u"?void 0:navigator.clipboard;if(D!=null&&D.writeText){await D.writeText(R);return}ma(R)}let w=[];function T(R){const D=p.value.findIndex(I=>I.host_id===R.result.host_id);D>=0&&(p.value[D]=R.result)}function A(R){const D=R;if(!c.value){w.push(D);return}D.run_id===c.value&&T(D)}let E=null;return Dt(async()=>{E=d.events.on("snippet:run:progress",A);try{r.value=await tm()}catch(R){m.value=R instanceof Error?R.message:String(R)}}),Vt(()=>{E==null||E(),E=null}),t({buildCopyAllText:P}),(R,D)=>($(),F("div",{class:"snippet-run-overlay",onClick:D[2]||(D[2]=dt(I=>i("close"),["self"]))},[b("div",nN,[c.value?($(),F("div",dN,[b("ul",uN,[($(!0),F(Ie,null,at(p.value,I=>($(),F("li",{key:I.host_id,class:lt(["row",`state-${I.state}`]),"data-testid":`snippet-run-row-${I.host_id}`,"data-state":I.state},[b("div",fN,[b("span",pN,L(I.host_label),1),b("span",{class:"row-state","data-testid":`snippet-run-state-${I.host_id}`,"data-state":I.state},L(S(I)),9,vN)]),I.state==="failed"?($(),F("span",{key:0,class:"row-exitcode","data-testid":`snippet-run-exitcode-${I.host_id}`},L(C(a)("snippets.exitCode",{code:I.exit_code})),9,gN)):Z("",!0),I.state==="ok"||I.state==="failed"||I.state==="error"&&I.output?($(),F("pre",{key:1,class:"row-output","data-testid":`snippet-run-output-${I.host_id}`},L(I.output),9,mN)):Z("",!0),I.truncated?($(),F("p",{key:2,class:"row-truncated","data-testid":`snippet-run-truncated-${I.host_id}`},L(C(a)("snippets.truncated")),9,_N)):Z("",!0)],10,hN))),128))]),m.value?($(),F("p",yN,L(m.value),1)):Z("",!0),b("div",bN,[b("button",{"data-testid":"snippet-run-close",onClick:D[1]||(D[1]=I=>i("close"))},L(C(a)("common.close")),1),b("button",{"data-testid":"snippet-run-copyall",onClick:M},L(C(a)("snippets.copyAll")),1),h.value?($(),F("button",{key:0,"data-testid":"snippet-run-cancel",disabled:g.value,onClick:_},L(C(a)("snippets.cancel")),9,wN)):Z("",!0)])])):($(),F("div",sN,[b("p",iN,L(C(a)("snippets.selectHosts")),1),m.value?($(),F("p",rN,L(m.value),1)):Z("",!0),b("ul",oN,[($(!0),F(Ie,null,at(r.value,I=>($(),F("li",{key:I.id},[b("label",null,[b("input",{type:"checkbox","data-testid":`snippet-run-host-${I.id}`,checked:o.value.has(I.id),onChange:O=>v(I.id)},null,40,aN),b("span",null,L(y(I)),1)])]))),128))]),b("div",lN,[b("button",{"data-testid":"snippet-run-close",onClick:D[0]||(D[0]=I=>i("close"))},L(C(a)("common.close")),1),b("button",{class:"primary","data-testid":"snippet-run-start",disabled:!l.value,title:o.value.size===0?C(a)("snippets.noHostsSelected"):"",onClick:f},L(C(a)("snippets.runOnHosts")),9,cN)])]))])]))}}),CN=Ct(SN,[["__scopeId","data-v-ca33db20"]]),kN={class:"tab-pane"},xN={class:"hint"},RN={class:"show-toggle"},TN=["checked"],PN={class:"list"},EN=["data-testid"],LN=["title"],DN=["title"],MN={class:"hotkey"},AN={class:"actions"},IN=["disabled","onClick"],$N=["disabled","onClick"],ON=["onClick"],FN=["data-testid","onClick"],BN=["data-testid","onClick"],HN={key:0,class:"edit-row"},NN={class:"edit-top"},zN=["placeholder"],UN=["placeholder"],VN=["placeholder"],KN={class:"edit-actions"},WN={class:"footer"},jN={key:0,class:"error"},qN={class:"actions"},YN=Ae({__name:"SettingsTemplates",setup(e){const{t}=$t(),n=hn(),s=H([]),i=H(null),a=H(!1),d=H(!1),r=H(""),o=H(null),c=n.caps.wailsBindings;function p(E){o.value=E}function u(){o.value=null}async function g(){const E=await i_(n.templates);s.value=[...E],d.value=await n.templates.loadHidden()}let m=null;Dt(async()=>{await g(),m=n.events.on("prefs:changed",()=>{g()})}),Vt(()=>{m==null||m(),m=null});function y(){n.events.emit("quickTemplates:changed",null)}async function v(){r.value="";try{await n.templates.save(s.value),y()}catch(E){r.value=E instanceof Error?E.message:String(E)}}async function l(E){d.value=E;try{await n.templates.saveHidden(E),y()}catch(R){r.value=R instanceof Error?R.message:String(R)}}function h(){i.value={id:crypto.randomUUID(),label:"",text:"",hotkey:"",isNew:!0}}function f(E){i.value={id:E.id,label:E.label,text:E.text,hotkey:E.hotkey||"",isNew:!1}}function _(){i.value=null}async function S(){if(!i.value)return;const E=i.value;if(!E.label.trim()||!E.text)return;const R={id:E.id,label:E.label.trim(),text:E.text};if(E.hotkey.trim()&&(R.hotkey=E.hotkey.trim()),E.isNew)s.value.push(R);else{const D=s.value.findIndex(I=>I.id===E.id);D>=0&&(s.value[D]=R)}i.value=null,await v()}async function k(E){s.value=s.value.filter(R=>R.id!==E),await v()}async function P(E){const R=s.value.findIndex(D=>D.id===E);R<=0||([s.value[R-1],s.value[R]]=[s.value[R],s.value[R-1]],await v())}async function M(E){const R=s.value.findIndex(D=>D.id===E);R<0||R>=s.value.length-1||([s.value[R],s.value[R+1]]=[s.value[R+1],s.value[R]],await v())}function w(){a.value=!0}async function T(){a.value=!1,await n.templates.clear(),await g(),y()}function A(){a.value=!1}return(E,R)=>($(),F("div",kN,[b("p",xN,L(C(t)("settings.templates.intro")),1),b("label",RN,[b("input",{type:"checkbox","data-testid":"template-show-toggle",checked:!d.value,onChange:R[0]||(R[0]=D=>l(!D.target.checked))},null,40,TN),b("span",null,L(C(t)("settings.templates.showBar")),1)]),b("ul",PN,[($(!0),F(Ie,null,at(s.value,(D,I)=>($(),F("li",{key:D.id,class:"row","data-testid":`template-row-${D.id}`},[b("span",{class:"label",title:D.label},L(D.label),9,LN),b("code",{class:"text",title:D.text},L(D.text),9,DN),b("code",MN,L(D.hotkey||"—"),1),b("div",AN,[b("button",{disabled:I===0,onClick:O=>P(D.id)},"↑",8,IN),b("button",{disabled:I===s.value.length-1,onClick:O=>M(D.id)},"↓",8,$N),b("button",{onClick:O=>f(D)},L(C(t)("settings.templates.edit")),9,ON),C(c)?($(),F("button",{key:0,"data-testid":`template-run-${D.id}`,onClick:O=>p(D)},L(C(t)("snippets.runOnHosts")),9,FN)):Z("",!0),b("button",{class:"del","data-testid":`template-delete-${D.id}`,onClick:O=>k(D.id)},L(C(t)("settings.templates.delete")),9,BN)])],8,EN))),128))]),i.value?($(),F("div",HN,[b("div",NN,[rt(b("input",{"onUpdate:modelValue":R[1]||(R[1]=D=>i.value.label=D),class:"edit-label-input",placeholder:C(t)("settings.templates.label"),"data-testid":"template-edit-label"},null,8,zN),[[Tt,i.value.label]]),rt(b("input",{"onUpdate:modelValue":R[2]||(R[2]=D=>i.value.hotkey=D),class:"edit-hotkey-input",placeholder:C(t)("settings.templates.hotkey"),"data-testid":"template-edit-hotkey"},null,8,UN),[[Tt,i.value.hotkey]])]),rt(b("textarea",{"onUpdate:modelValue":R[3]||(R[3]=D=>i.value.text=D),class:"edit-text-input",rows:"3",placeholder:C(t)("settings.templates.text"),"data-testid":"template-edit-text"},null,8,VN),[[Tt,i.value.text]]),b("div",KN,[b("button",{onClick:_},L(C(t)("common.cancel")),1),b("button",{class:"primary","data-testid":"template-edit-save",onClick:S},L(C(t)("settings.templates.save")),1)])])):Z("",!0),b("div",WN,[b("button",{"data-testid":"template-add",onClick:h},L(C(t)("settings.templates.add")),1),b("button",{"data-testid":"template-reset",onClick:w},L(C(t)("settings.templates.reset")),1),r.value?($(),F("span",jN,L(r.value),1)):Z("",!0)]),a.value?($(),F("div",{key:1,class:"dialog-backdrop",onClick:A},[b("div",{class:"dialog",onClick:R[4]||(R[4]=dt(()=>{},["stop"]))},[b("p",null,L(C(t)("settings.templates.resetConfirm")),1),b("div",qN,[b("button",{onClick:A},L(C(t)("common.cancel")),1),b("button",{"data-testid":"template-reset-confirm",onClick:T},L(C(t)("settings.templates.reset")),1)])])])):Z("",!0),o.value?($(),bt(CN,{key:2,"snippet-label":o.value.label,"snippet-text":o.value.text,onClose:u},null,8,["snippet-label","snippet-text"])):Z("",!0)]))}}),GN=Ct(YN,[["__scopeId","data-v-d57ad1d6"]]),XN={class:"tab-pane"},JN={class:"hint"},QN={class:"hint"},ZN={class:"hint"},ez={class:"list"},tz=["data-testid"],nz=["title"],sz={key:0,class:"badge","data-testid":"profile-default-badge"},iz={class:"detail"},rz={class:"detail"},oz={class:"actions"},az=["data-testid","onClick"],lz=["data-testid"],cz=["data-testid","onClick"],dz=["data-testid","onClick"],uz={key:0,class:"hint"},hz={key:1,class:"edit-row","data-testid":"profile-editor"},fz={class:"settings-field-grid settings-field-grid--two","data-testid":"profile-primary-grid"},pz=["placeholder"],vz=["placeholder"],gz=["placeholder"],mz=["placeholder"],_z={class:"hint"},yz=["placeholder"],bz={class:"hint"},wz={class:"checkbox"},Sz={class:"hint"},Cz={class:"edit-actions"},kz={class:"footer"},xz={key:0,class:"error"},Rz=Ae({__name:"SettingsProfiles",emits:["profiles-changed"],setup(e,{emit:t}){const{t:n}=$t(),s=hn(),i=t,a=H([]),d=H(""),r=H(!0),o=H(""),c=H(null);async function p(){o.value="";try{const[P,M]=await Promise.all([xm(),fC()]);a.value=P??[],d.value=M??""}catch(P){o.value=(P==null?void 0:P.message)??String(P)}finally{r.value=!1}}let u=null;Dt(()=>{p(),u=s.events.on("prefs:changed",()=>{p()})}),Vt(()=>{u==null||u(),u=null});function g(P){return P?Object.entries(P).map(([M,w])=>`${M}=${w}`).join(` -`):""}function m(P){const M={};for(const w of P.split(` -`)){const T=w.trim();if(!T)continue;const A=T.indexOf("=");if(A<=0)continue;const E=T.slice(0,A).trim(),R=T.slice(A+1);E&&(M[E]=R)}return Object.keys(M).length>0?M:void 0}async function y(){o.value="";try{return await hC(a.value),i("profiles-changed"),!0}catch(P){const M=(P==null?void 0:P.message)??String(P);return await p(),o.value||(o.value=M),!1}}function v(){c.value={id:crypto.randomUUID(),name:"",shell:"",cwd:"",startupCmd:"",envText:"",syncEnv:!1,isNew:!0}}function l(P){c.value={id:P.id,name:P.name,shell:P.shell??"",cwd:P.cwd??"",startupCmd:P.startup_cmd??"",envText:g(P.env),syncEnv:!!P.sync_env,isNew:!1}}function h(){c.value=null}async function f(){if(!c.value)return;const P=c.value;if(!P.name.trim()){o.value=n("settings.profiles.nameRequired");return}const M={id:P.id,name:P.name.trim()};P.shell.trim()&&(M.shell=P.shell.trim()),P.cwd.trim()&&(M.cwd=P.cwd.trim()),P.startupCmd.trim()&&(M.startup_cmd=P.startupCmd.trim());const w=m(P.envText);w&&(M.env=w),P.syncEnv&&(M.sync_env=!0),P.isNew?a.value=[...a.value,M]:a.value=a.value.map(T=>T.id===P.id?M:T),c.value=null,await y()}async function _(P){const M=d.value===P;a.value=a.value.filter(T=>T.id!==P),await y()&&M&&await k()}async function S(P){const M=d.value;d.value=P,o.value="";try{await pC(P),i("profiles-changed")}catch(w){d.value=M,o.value=(w==null?void 0:w.message)??String(w)}}async function k(){await S("")}return(P,M)=>($(),F("div",XN,[b("p",JN,L(C(n)("settings.profiles.intro")),1),b("p",QN,L(C(n)("settings.profiles.precedenceHint")),1),b("p",ZN,L(C(n)("settings.profiles.envPrivacyIntro")),1),r.value?Z("",!0):($(),F(Ie,{key:0},[b("ul",ez,[($(!0),F(Ie,null,at(a.value,w=>($(),F("li",{key:w.id,class:"row","data-testid":`profile-row-${w.id}`},[b("span",{class:"name",title:w.name},[ot(L(w.name)+" ",1),w.id===d.value?($(),F("span",sz,L(C(n)("settings.profiles.defaultBadge")),1)):Z("",!0)],8,nz),b("code",iz,L(w.shell||C(n)("settings.profiles.shellUnset")),1),b("code",rz,L(w.cwd||C(n)("settings.profiles.cwdUnset")),1),b("div",oz,[w.id!==d.value?($(),F("button",{key:0,"data-testid":`profile-set-default-${w.id}`,onClick:T=>S(w.id)},L(C(n)("settings.profiles.setDefault")),9,az)):($(),F("button",{key:1,"data-testid":`profile-clear-default-${w.id}`,onClick:M[0]||(M[0]=T=>k())},L(C(n)("settings.profiles.clearDefault")),9,lz)),b("button",{"data-testid":`profile-edit-${w.id}`,onClick:T=>l(w)},L(C(n)("settings.profiles.edit")),9,cz),b("button",{class:"del","data-testid":`profile-delete-${w.id}`,onClick:T=>_(w.id)},L(C(n)("settings.profiles.delete")),9,dz)])],8,tz))),128))]),a.value.length===0?($(),F("p",uz,L(C(n)("settings.profiles.empty")),1)):Z("",!0)],64)),c.value?($(),F("div",hz,[b("div",fz,[rt(b("input",{"onUpdate:modelValue":M[1]||(M[1]=w=>c.value.name=w),class:"edit-input",placeholder:C(n)("settings.profiles.name"),"data-testid":"profile-edit-name"},null,8,pz),[[Tt,c.value.name]]),rt(b("input",{"onUpdate:modelValue":M[2]||(M[2]=w=>c.value.shell=w),class:"edit-input",placeholder:C(n)("settings.profiles.shellPlaceholder"),"data-testid":"profile-edit-shell"},null,8,vz),[[Tt,c.value.shell]])]),rt(b("input",{"onUpdate:modelValue":M[3]||(M[3]=w=>c.value.cwd=w),class:"edit-input",placeholder:C(n)("settings.profiles.cwdPlaceholder"),"data-testid":"profile-edit-cwd"},null,8,gz),[[Tt,c.value.cwd]]),rt(b("input",{"onUpdate:modelValue":M[4]||(M[4]=w=>c.value.startupCmd=w),class:"edit-input",placeholder:C(n)("settings.profiles.startupCmdPlaceholder"),"data-testid":"profile-edit-startup-cmd"},null,8,mz),[[Tt,c.value.startupCmd]]),b("p",_z,L(C(n)("settings.profiles.startupCmdHint")),1),rt(b("textarea",{"onUpdate:modelValue":M[5]||(M[5]=w=>c.value.envText=w),class:"edit-input edit-textarea",rows:"3",placeholder:C(n)("settings.profiles.envPlaceholder"),"data-testid":"profile-edit-env"},null,8,yz),[[Tt,c.value.envText]]),b("p",bz,L(C(n)("settings.profiles.envHint")),1),b("label",wz,[rt(b("input",{type:"checkbox","onUpdate:modelValue":M[6]||(M[6]=w=>c.value.syncEnv=w),"data-testid":"profile-edit-sync-env"},null,512),[[ho,c.value.syncEnv]]),ot(" "+L(C(n)("settings.profiles.syncEnv")),1)]),b("p",Sz,L(c.value.syncEnv?C(n)("settings.profiles.syncEnvOnHint"):C(n)("settings.profiles.syncEnvOffHint")),1),b("div",Cz,[b("button",{onClick:h},L(C(n)("common.cancel")),1),b("button",{class:"primary","data-testid":"profile-edit-save",onClick:f},L(C(n)("settings.profiles.save")),1)])])):Z("",!0),b("div",kz,[b("button",{"data-testid":"profile-add",onClick:v},L(C(n)("settings.profiles.add")),1),o.value?($(),F("span",xz,L(o.value),1)):Z("",!0)])]))}}),Tz=Ct(Rz,[["__scopeId","data-v-41aa374f"]]),Pz={class:"settings-tasks"},Ez={class:"preset-list"},Lz=["value","checked"],Dz={class:"preset-meta"},Mz={class:"preset-name"},Az={class:"preset-desc"},Iz={class:"preset-preview"},$z={class:"group-by-row","data-test":"settings-group-by"},Oz={class:"group-by-label"},Fz=["value","checked"],Bz={class:"expand-toggle"},Hz=["checked"],Nz=Ae({__name:"SettingsTasks",setup(e){const{t}=$t(),n=H(!0),s=["iconOnly","iconLabel"],i=["host","state"],a=Uu(),d=Um();Dt(async()=>{try{const u=await nm();(u==="iconOnly"||u==="iconLabel")&&(a.activeId.value=u)}catch{}try{const u=await sm();n.value=!u}catch{}});async function r(u){const g=u.target.value;await a.setPreset(g)}async function o(u){const g=u.target.checked;n.value=g,await im(!g)}async function c(u){const g=u.target.value;await d.setGroupBy(g)}function p(u){return t(u==="host"?"tasks.settings.groupByHost":"tasks.settings.groupByState")}return(u,g)=>($(),F("section",Pz,[b("div",Ez,[($(),F(Ie,null,at(s,m=>b("label",{key:m,class:"preset-option"},[b("input",{type:"radio",name:"preset",value:m,checked:C(a).activeId.value===m,onChange:r},null,40,Lz),b("div",Dz,[b("div",Mz,L(C(t)(`tasks.preset.${m}.name`)),1),b("div",Az,L(C(t)(`tasks.preset.${m}.description`)),1),b("div",Iz,[Te(hi,{state:"running",preset:C(ea)[m]},null,8,["preset"]),Te(hi,{state:"waiting_input",preset:C(ea)[m]},null,8,["preset"]),Te(hi,{state:"completed",preset:C(ea)[m]},null,8,["preset"]),Te(hi,{state:"failed",preset:C(ea)[m]},null,8,["preset"])])])])),64))]),b("div",$z,[b("span",Oz,L(C(t)("tasks.settings.groupBy")),1),($(),F(Ie,null,at(i,m=>b("label",{key:m,class:"group-by-option"},[b("input",{type:"radio",name:"taskGroupBy",value:m,checked:C(d).activeId.value===m,onChange:c},null,40,Fz),ot(" "+L(p(m)),1)])),64))]),b("label",Bz,[b("input",{type:"checkbox",checked:n.value,onChange:o},null,40,Hz),ot(" "+L(C(t)("tasks.settings.expandByDefault")),1)])]))}}),zz=Ct(Nz,[["__scopeId","data-v-d7749d1b"]]),Uz={class:"tab-pane"},Vz={class:"hook-install","data-test":"hook-install"},Kz={class:"hook-install__row"},Wz=["title"],jz={class:"hook-install__label"},qz={class:"hook-install__toggle"},Yz=["checked"],Gz={key:0,class:"hook-install__error"},Xz={class:"ai-only","data-test":"feishu-ai-only"},Jz={class:"ai-only__toggle"},Qz=["checked"],Zz={class:"remote-terminal","data-test":"feishu-remote-terminal"},eU={class:"remote-terminal__toggle"},tU=["checked"],nU={key:0,class:"remote-terminal__attach-label"},sU={key:0,class:"hint feishu-status-error","data-test":"feishu-load-error"},iU={key:1,class:"hint","data-test":"feishu-relay-disabled"},rU={key:2,class:"hint"},oU={class:"feishu-mode"},aU={class:"feishu-mode__label"},lU={class:"feishu-mode__label-text"},cU={class:"feishu-mode__effective"},dU={key:0,class:"feishu-mode__warn"},uU={class:"test-send","data-test":"feishu-test-send"},hU={class:"test-send__title"},fU={class:"hint"},pU={class:"test-send__buttons"},vU=["disabled","onClick","data-test"],gU={key:0,class:"test-send__ok","data-test":"feishu-test-ok"},mU={key:1,class:"error","data-test":"feishu-test-error"},_U={key:1,class:"feishu-configured","data-test":"feishu-configured"},yU={class:"configured-line"},bU={class:"configured-badge"},wU={key:0,class:"configured-appid"},SU={class:"field-label"},CU={class:"callback-row"},kU=["value"],xU={class:"hint"},RU={key:1,class:"hint","data-test":"feishu-longconn-hint"},TU={key:2,class:"error"},PU={class:"actions"},EU={key:3,class:"pair-hint"},LU={key:2,class:"feishu-fieldset settings-field-grid settings-field-grid--two","data-test":"feishu-credentials-grid"},DU={class:"field-label settings-field"},MU={class:"field-label settings-field"},AU={class:"field-label settings-field"},IU={class:"field-label settings-field"},$U={key:0,class:"error settings-field--full"},OU={class:"actions settings-field--full"},FU=2500,BU=15*60*1e3,HU=Ae({__name:"SettingsFeishu",setup(e){const{t}=$t(),n=H({enabled:!1,mode:"local",bound:!1,open_id:"",disabled:!1}),s=H({AppID:"",AppSecret:"",EncryptKey:"",VerifyToken:""}),i=H(""),a=H(""),d=H(!0),r=H("auto"),o=H(""),c=q(()=>[{value:"auto",label:t("settings.feishu.mode.options.auto")},{value:"local",label:t("settings.feishu.mode.options.local")},{value:"relay",label:t("settings.feishu.mode.options.relay")}]);async function p(G){const te=G.target.checked;try{await rC(te),d.value=te}catch{try{d.value=await Mf()}catch(oe){Lt("feishu","ai-notifications toggle out of sync with backend",{error:Rt(oe)})}}}async function u(G){try{await pS(G),r.value=G,o.value=await xf()}catch(te){r.value=await kf(),Ks("feishu","SetFeishuModePref failed",{error:Rt(te)})}}const g=H(!1),m=H("ai"),y=q(()=>[{value:"ai",label:t("settings.feishu.remoteTerminal.autoAttach.ai")},{value:"all",label:t("settings.feishu.remoteTerminal.autoAttach.all")},{value:"none",label:t("settings.feishu.remoteTerminal.autoAttach.none")}]);async function v(G){const te=G.target.checked;try{await Rf(te,m.value),g.value=te}catch{try{const oe=await Kc();g.value=oe.enabled,m.value=oe.auto_attach}catch(oe){Lt("feishu","remote-terminal settings out of sync with backend",{error:Rt(oe)})}}}async function l(G){try{await Rf(g.value,G),m.value=G}catch{try{const te=await Kc();g.value=te.enabled,m.value=te.auto_attach}catch(te){Lt("feishu","remote-terminal settings out of sync with backend",{error:Rt(te)})}}}const h=H(!1),f=H(!1),_=["command_success","command_failure","command_sealed","waiting_input"],S=H(""),k=H({ok:!1,error:""});async function P(G){S.value=G,k.value={ok:!1,error:""};try{await yS(G),k.value={ok:!0,error:""}}catch(te){k.value={ok:!1,error:te instanceof Error?te.message:String(te)}}finally{S.value=""}}const M=H({enabled:!0,binary_path:"",binary_ok:!1,binary_version:"",settings_path:"",settings_ok:!1,last_error:"",last_check:""});async function w(){try{n.value=await vS()}catch(G){n.value={enabled:!1,mode:n.value.mode,bound:!1,open_id:"",disabled:!1,error:G instanceof Error?G.message:String(G)}}}async function T(){try{M.value=await bS()}catch{}}const A=q(()=>M.value.enabled?M.value.binary_ok&&M.value.settings_ok?"hook-install__dot--green":"hook-install__dot--amber":"hook-install__dot--gray"),E=q(()=>M.value.enabled?M.value.binary_ok&&M.value.settings_ok?t("settings.feishu.hook_install.healthy"):t("settings.feishu.hook_install.needs_attention"):t("settings.feishu.hook_install.disabled"));async function R(G){const te=G.target.checked;try{await Tf(te)}finally{await T()}}async function D(){try{await Tf(!0)}finally{await T()}}Dt(async()=>{await w(),await T();try{d.value=await Mf()}catch{}try{const G=await Kc();g.value=G.enabled,m.value=G.auto_attach}catch{}try{r.value=await kf(),o.value=await xf()}catch{}});async function I(){a.value="";try{await gS(s.value),h.value=!1,await w()}catch(G){a.value=G instanceof Error?G.message:String(G)}}function O(){a.value="",h.value=!0}async function U(){if(n.value.callback_url)try{await navigator.clipboard.writeText(n.value.callback_url),f.value=!0,setTimeout(()=>{f.value=!1},1500)}catch{}}let W=null;function N(){W&&(clearInterval(W),W=null)}function z(){N();const G=Date.now();W=setInterval(async()=>{if(await w(),n.value.bound){i.value="",N();return}Date.now()-G>=BU&&N()},FU)}Vt(N);async function V(){try{i.value=await mS(),z()}catch(G){a.value=G instanceof Error?G.message:String(G)}}async function j(){try{N(),await _S(),i.value="",h.value=!1,await w()}catch(G){a.value=G instanceof Error?G.message:String(G)}}return(G,te)=>($(),F("div",Uz,[b("section",Vz,[b("header",Kz,[b("span",{class:lt(["hook-install__dot",A.value]),title:M.value.last_error||""},null,10,Wz),b("span",jz,L(E.value),1),b("label",qz,[b("input",{type:"checkbox",checked:M.value.enabled,onChange:R},null,40,Yz),b("span",null,L(C(t)("settings.feishu.hook_install.enable")),1)]),M.value.enabled&&(!M.value.binary_ok||!M.value.settings_ok)?($(),F("button",{key:0,type:"button",class:"hook-install__retry",onClick:D,"data-test":"hook-install-retry"},L(C(t)("settings.feishu.hook_install.retry")),1)):Z("",!0)]),M.value.enabled&&M.value.last_error?($(),F("p",Gz,L(M.value.last_error),1)):Z("",!0)]),b("section",Xz,[b("label",Jz,[b("input",{type:"checkbox",checked:d.value,onChange:p},null,40,Qz),b("span",null,L(C(t)("settings.feishu.aiOnlyNotifications")),1)])]),b("section",Zz,[b("label",eU,[b("input",{type:"checkbox",checked:g.value,onChange:v},null,40,tU),b("span",null,L(C(t)("settings.feishu.remoteTerminal.enable")),1)]),g.value?($(),F("div",nU,[b("span",null,L(C(t)("settings.feishu.remoteTerminal.autoAttachLabel")),1),Te(ns,{class:"remote-terminal__attach-select","model-value":m.value,options:y.value,"aria-label":C(t)("settings.feishu.remoteTerminal.autoAttachLabel"),"data-test":"feishu-auto-attach","onUpdate:modelValue":l},null,8,["model-value","options","aria-label"])])):Z("",!0)]),n.value.error?($(),F("div",sU,[b("span",null,L(C(t)("settings.feishu.load_error",{error:n.value.error})),1),b("button",{type:"button",class:"hook-install__retry",onClick:w,"data-test":"feishu-status-retry"},L(C(t)("settings.feishu.retry_status")),1)])):n.value.relay_disabled?($(),F("p",iU,L(C(t)("settings.feishu.relay_disabled")),1)):n.value.enabled?($(),F(Ie,{key:3},[b("div",oU,[b("div",aU,[b("span",lU,L(C(t)("settings.feishu.mode.label")),1),Te(ns,{class:"feishu-mode__select","model-value":r.value,options:c.value,"aria-label":C(t)("settings.feishu.mode.label"),"onUpdate:modelValue":u},null,8,["model-value","options","aria-label"])]),b("p",cU,[b("span",null,L(C(t)("settings.feishu.mode.effective.label"))+":",1),b("strong",null,L(o.value||"—"),1),r.value==="relay"&&o.value==="local"?($(),F("span",dU," ⚠ "+L(C(t)("settings.feishu.mode.effective.fallbackWarn")),1)):Z("",!0)])]),n.value.bound?($(),F(Ie,{key:0},[b("p",null,L(C(t)("settings.feishu.bound",{open_id:n.value.open_id})),1),b("section",uU,[b("p",hU,L(C(t)("settings.feishu.test_send.title")),1),b("p",fU,L(C(t)("settings.feishu.test_send.hint")),1),b("div",pU,[($(),F(Ie,null,at(_,oe=>b("button",{key:oe,type:"button",class:"btn-secondary",disabled:S.value!=="",onClick:re=>P(oe),"data-test":"feishu-test-"+oe},L(S.value===oe?C(t)("settings.feishu.test_send.sending"):C(t)(`settings.feishu.test_send.${oe}`)),9,vU)),64))]),k.value.ok?($(),F("p",gU,L(C(t)("settings.feishu.test_send.sent")),1)):k.value.error?($(),F("p",mU,L(C(t)("settings.feishu.test_send.failed",{error:k.value.error})),1)):Z("",!0)]),b("button",{type:"button",class:"btn-danger",onClick:j},L(C(t)("settings.feishu.delete")),1)],64)):n.value.configured&&!h.value?($(),F("div",_U,[b("p",yU,[b("span",bU,L(C(t)("settings.feishu.configured")),1),n.value.app_id?($(),F("span",wU,L(C(t)("settings.feishu.app_id_label"))+": "+L(n.value.app_id),1)):Z("",!0)]),n.value.callback_url?($(),F(Ie,{key:0},[b("label",SU,[ot(L(C(t)("settings.feishu.callback_label"))+" ",1),b("span",CU,[b("input",{value:n.value.callback_url,readonly:"",class:"field-input","data-test":"feishu-callback-url"},null,8,kU),b("button",{type:"button",class:"btn-primary",onClick:U,"data-test":"feishu-callback-copy"},L(f.value?C(t)("settings.feishu.copied"):C(t)("settings.feishu.copy")),1)])]),b("p",xU,L(C(t)("settings.feishu.callback_hint_relay")),1)],64)):($(),F("p",RU,L(C(t)("settings.feishu.longconn_hint_local")),1)),a.value?($(),F("div",TU,L(a.value),1)):Z("",!0),b("div",PU,[b("button",{type:"button",class:"btn-primary",onClick:V,"data-test":"feishu-begin-pair"},L(C(t)("settings.feishu.begin_pair")),1),b("button",{type:"button",class:"btn-secondary",onClick:O},L(C(t)("settings.feishu.reconfigure")),1)]),i.value?($(),F("p",EU,L(C(t)("settings.feishu.pair_hint",{code:i.value})),1)):Z("",!0)])):($(),F("fieldset",LU,[b("label",DU,[te[4]||(te[4]=ot("App ID ")),rt(b("input",{"onUpdate:modelValue":te[0]||(te[0]=oe=>s.value.AppID=oe),type:"text",class:"field-input"},null,512),[[Tt,s.value.AppID]])]),b("label",MU,[te[5]||(te[5]=ot("App Secret ")),rt(b("input",{"onUpdate:modelValue":te[1]||(te[1]=oe=>s.value.AppSecret=oe),type:"password",class:"field-input"},null,512),[[Tt,s.value.AppSecret]])]),b("label",AU,[te[6]||(te[6]=ot("Encrypt Key ")),rt(b("input",{"onUpdate:modelValue":te[2]||(te[2]=oe=>s.value.EncryptKey=oe),type:"password",class:"field-input"},null,512),[[Tt,s.value.EncryptKey]])]),b("label",IU,[te[7]||(te[7]=ot("Verify Token ")),rt(b("input",{"onUpdate:modelValue":te[3]||(te[3]=oe=>s.value.VerifyToken=oe),type:"password",class:"field-input"},null,512),[[Tt,s.value.VerifyToken]])]),a.value?($(),F("div",$U,L(a.value),1)):Z("",!0),b("div",OU,[b("button",{type:"button",class:"btn-primary",onClick:I},L(C(t)("settings.feishu.save")),1)])]))],64)):($(),F("p",rU,L(C(t)("settings.feishu.disabled")),1))]))}}),NU=Ct(HU,[["__scopeId","data-v-2aad46af"]]),zU={class:"tab-pane"},UU={key:0,class:"dim"},VU={class:"header-row"},KU={class:"hint"},WU={key:0,class:"header-actions"},jU=["disabled","aria-label"],qU=["disabled"],YU={key:0,class:"hint"},GU={key:1,class:"error"},XU={key:2,class:"dim"},JU={key:3,class:"device-list"},QU={class:"device-info"},ZU={class:"ua"},e9={class:"meta"},t9={key:0,class:"current-tag"},n9=["disabled","onClick"],s9=Ae({__name:"SettingsDevices",setup(e){const{t}=$t(),n=hn(),s=H([]),i=H(!0),a=H(!1),d=H(!1),r=H({}),o=H(""),c=H(!1);async function p(v=!1){v||(i.value=!0),a.value=!0,o.value="",c.value=!1;try{if(!n.sessions.listRelaySessions){c.value=!0,s.value=[];return}s.value=await n.sessions.listRelaySessions()}catch(l){const h=(l==null?void 0:l.message)??String(l);h.includes("not authenticated")?c.value=!0:o.value=h}finally{i.value=!1,a.value=!1}}Dt(()=>{p()});async function u(){await p(!0)}async function g(v){var h,f;const l=v.user_agent||t("settings.devices.unknownUA");if(window.confirm(t("settings.devices.revokeConfirm",{ua:l}))){r.value={...r.value,[v.id_hash]:!0};try{await((f=(h=n.sessions).revokeRelaySession)==null?void 0:f.call(h,v.id_hash)),await p(!0)}catch(_){o.value=(_==null?void 0:_.message)??String(_)}finally{const _={...r.value};delete _[v.id_hash],r.value=_}}}async function m(){var v,l;if(window.confirm(t("settings.devices.signOutOthersConfirm"))){d.value=!0;try{await((l=(v=n.sessions).signOutOtherRelaySessions)==null?void 0:l.call(v)),await p(!0)}catch(h){o.value=(h==null?void 0:h.message)??String(h)}finally{d.value=!1}}}function y(v){const l=new Date(v);return t("settings.devices.timeFormat",{y:l.getFullYear(),m:l.getMonth()+1,d:l.getDate(),hh:String(l.getHours()).padStart(2,"0"),mm:String(l.getMinutes()).padStart(2,"0")})}return(v,l)=>($(),F("div",zU,[i.value?($(),F("div",UU,L(C(t)("common.loading")),1)):($(),F(Ie,{key:1},[b("div",VU,[b("p",KU,L(C(t)("settings.devices.hint")),1),c.value?Z("",!0):($(),F("div",WU,[b("button",{type:"button",class:"icon-btn",disabled:a.value,"aria-label":C(t)("settings.devices.refresh"),onClick:u},L(a.value?"…":"⟳"),9,jU),b("button",{type:"button",class:"secondary",disabled:d.value||s.value.filter(h=>!h.is_current).length===0,onClick:m},L(d.value?C(t)("settings.devices.signingOut"):C(t)("settings.devices.signOutOthers")),9,qU)]))]),c.value?($(),F("p",YU,L(C(t)("settings.devices.notAuthenticated")),1)):o.value?($(),F("p",GU,L(o.value),1)):s.value.length===0?($(),F("p",XU,L(C(t)("settings.devices.empty")),1)):($(),F("div",JU,[($(!0),F(Ie,null,at(s.value,h=>($(),F("div",{key:h.id_hash,class:"device-row"},[b("div",QU,[b("div",ZU,L(h.user_agent||C(t)("settings.devices.unknownUA")),1),b("div",e9,L(C(t)("settings.devices.loginLine",{time:y(h.created_at),ip:h.ip_prefix})),1)]),h.is_current?($(),F("span",t9,L(C(t)("settings.devices.currentTag")),1)):($(),F("button",{key:1,type:"button",class:"danger-btn",disabled:!!r.value[h.id_hash],onClick:f=>g(h)},L(r.value[h.id_hash]?C(t)("settings.devices.revoking"):C(t)("settings.devices.revoke")),9,n9))]))),128))]))],64))]))}}),i9=Ct(s9,[["__scopeId","data-v-6015f38d"]]),r9={class:"received-files"},o9={class:"header"},a9={"data-testid":"total-bytes"},l9={class:"muted"},c9={class:"actions"},d9=["disabled"],u9={key:0,class:"error"},h9={key:1},f9={key:2,class:"empty"},p9={key:3,class:"sessions"},v9=["onClick"],g9={class:"session-name"},m9={class:"muted"},_9=["onClick"],y9={key:0,class:"files"},b9={class:"file-name"},w9={class:"muted"},S9=["onClick"],C9=Ae({__name:"SettingsReceivedFiles",setup(e){const t=H({total_bytes:0,sessions:[]}),n=H(!1),s=H(new Set),i=H("");function a(g){return g<1024?`${g} B`:g<1024*1024?`${(g/1024).toFixed(1)} KiB`:`${(g/(1024*1024)).toFixed(1)} MiB`}async function d(){n.value=!0,i.value="";try{t.value=await DR()}catch(g){i.value=String(g)}finally{n.value=!1}}async function r(){if(confirm("Clear ALL received files? This cannot be undone.")){try{await PR()}catch(g){i.value=String(g)}await d()}}async function o(g){try{await ER(g)}catch(m){i.value=String(m)}await d()}async function c(g,m){try{await LR(g,m)}catch(y){i.value=String(y)}await d()}async function p(){try{await MR()}catch(g){i.value=String(g)}}function u(g){const m=new Set(s.value);m.has(g)?m.delete(g):m.add(g),s.value=m}return Dt(d),(g,m)=>($(),F("div",r9,[b("div",o9,[b("div",null,[b("strong",a9,"Total: "+L(a(t.value.total_bytes)),1),b("span",l9," · "+L(t.value.sessions.length)+" sessions",1)]),b("div",c9,[b("button",{onClick:p},"Open folder"),b("button",{class:"danger",disabled:t.value.sessions.length===0,onClick:r},"Clear all",8,d9)])]),i.value?($(),F("div",u9,L(i.value),1)):Z("",!0),n.value?($(),F("div",h9,"Loading…")):t.value.sessions.length===0?($(),F("div",f9,"No files received.")):($(),F("ul",p9,[($(!0),F(Ie,null,at(t.value.sessions,y=>($(),F("li",{key:y.session_id,class:"session"},[b("div",{class:"session-row","data-testid":"session-row",onClick:v=>u(y.session_id)},[b("span",g9,L(y.session_name||y.session_id.slice(0,8)),1),b("span",m9," · "+L(y.files.length)+" files · "+L(a(y.bytes)),1),b("button",{class:"session-clear danger",onClick:dt(v=>o(y.session_id),["stop"])},"Clear",8,_9)],8,v9),s.value.has(y.session_id)?($(),F("ul",y9,[($(!0),F(Ie,null,at(y.files,v=>($(),F("li",{key:v.name,"data-testid":"file-row"},[b("span",b9,L(v.name),1),b("span",w9," · "+L(a(v.bytes)),1),b("button",{class:"file-delete danger",onClick:l=>c(y.session_id,v.name)},"Delete",8,S9)]))),128))])):Z("",!0)]))),128))]))]))}}),k9=Ct(C9,[["__scopeId","data-v-4b01c574"]]);function Gy(e=300,t=10){const n=H(Ti());let s=null;return Dt(()=>{if(n.value)return;let i=0;s=setInterval(()=>{i++;const a=Ti();a&&(n.value=a),(a||i>=t)&&(s!==null&&clearInterval(s),s=null)},e)}),Vt(()=>{s!==null&&clearInterval(s),s=null}),n}const x9=["locale_preference","quick_templates","notifications_enabled","ai_notifications_only","command_notify_threshold_seconds","shell_integration_enabled","pinned_session_ids"],zv=e=>`atterm.${e}.value`,Uv=e=>`atterm.${e}.meta`;function R9(){return{readValue(e){const t=localStorage.getItem(zv(e));if(t!==null)try{return JSON.parse(t)}catch{return}},writeValue(e,t){localStorage.setItem(zv(e),JSON.stringify(t))},readMeta(e){const t=localStorage.getItem(Uv(e));if(t===null)return{updatedAtLocal:0,dirty:!1};try{const n=JSON.parse(t);return{updatedAtLocal:Number((n==null?void 0:n.updatedAtLocal)??0),dirty:!!(n!=null&&n.dirty)}}catch{return{updatedAtLocal:0,dirty:!1}}},writeMeta(e,t){localStorage.setItem(Uv(e),JSON.stringify(t))},keys(){return[...x9]}}}function Xy(e){const t=R9().readValue(e);return typeof t=="string"?t:void 0}const T9="bbbac178-5e9b-45b4-8b79-3257d9af7ca5",P9="55480000-0000-4000-8000-000000000001",E9=241,L9=240;function Jy(e,t,n,s,i){let a;try{a=Hu(t)}catch{throw new Error(`${i}: value is not valid base64`)}const d=hl(e,n,s,a);if(!d)throw new Error(`${i}: could not decrypt (wrong account key or corrupted blob)`);let r;try{r=JSON.parse(new TextDecoder().decode(d))}catch{throw new Error(`${i}: decrypted payload is not valid JSON`)}if(typeof r!="object"||r===null||Array.isArray(r))throw new Error(`${i}: decrypted payload is not a JSON object`);return r}function D9(e,t){const n=Jy(e,t,T9,E9,"openProfilesBlob");return{profiles:(n.profiles??[]).map(i=>({id:i.id,name:i.name,shell:i.shell??"",cwd:i.cwd??"",startupCmd:i.startup_cmd??"",syncEnv:!!i.sync_env,env:i.env})),defaultProfileId:n.default_profile_id??""}}function M9(e,t){const n=Jy(e,t,P9,L9,"openSSHHostsBlob"),s=(n.hosts??[]).map(({host:a})=>({id:a.id,alias:a.alias??"",host:a.host,port:a.port??"",user:a.user,authKind:a.auth_kind,keyId:a.key_id??"",tags:a.tags??[],note:a.note??"",hasJumpChain:!!a.proxy_jump,isProxyCommandHost:!!a.proxy_command})),i=(n.keys??[]).map(({key:a})=>({id:a.id,name:a.name,keyType:a.key_type??""}));return{hosts:s,keys:i}}const A9={key:0,class:"mobile-profiles","data-testid":"mobile-profiles-panel"},I9={class:"hint"},$9={key:0,class:"status","data-testid":"mobile-profiles-locked"},O9={key:1,class:"status","data-testid":"mobile-profiles-no-data"},F9={key:2,class:"status error","data-testid":"mobile-profiles-error"},B9={key:3,class:"status","data-testid":"mobile-profiles-empty"},H9={key:0,class:"host-picker"},N9=["value"],z9={key:1,class:"status","data-testid":"mobile-profiles-no-hosts"},U9={key:2,class:"status error","data-testid":"mobile-profiles-create-error"},V9={class:"profile-list","data-testid":"mobile-profiles-list"},K9={class:"profile-header"},W9={class:"profile-name"},j9={key:0,class:"badge","data-testid":"mobile-profile-default-badge"},q9=["disabled","onClick"],Y9={class:"profile-fields"},G9={"data-testid":"mobile-profile-shell"},X9={"data-testid":"mobile-profile-cwd"},J9={"data-testid":"mobile-profile-startup-cmd"},Q9={"data-testid":"mobile-profile-env"},Z9={key:2,class:"env-list"},eV=Ae({__name:"SettingsProfilesMobile",emits:["session-created"],setup(e,{emit:t}){const{t:n}=$t(),s=hn(),i=s.caps.capacitor,a=t,d=i?Gy():H(null),r=H([]),o=H(""),c=H(""),p=H(!1);function u(){if(!i)return;c.value="";const P=d.value;if(!P)return;const M=Xy("profiles_encrypted");if(p.value=M!==void 0,M!==void 0)try{const w=D9(P,M);r.value=w.profiles,o.value=w.defaultProfileId}catch(w){c.value=w instanceof Error?w.message:String(w)}}_t(d,u,{immediate:!0});const g=q(()=>d.value?c.value?"error":p.value?r.value.length===0?"empty":"ready":"noData":"locked"),m=H([]),y=q(()=>{const P=new Map;for(const M of m.value)!M.host_id||P.has(M.host_id)||P.set(M.host_id,M.host||M.host_id);return[...P.entries()].map(([M,w])=>({id:M,name:w})).sort((M,w)=>M.name.localeCompare(w.name))}),v=H("");_t(y,P=>{var M;P.some(w=>w.id===v.value)||(v.value=((M=P[0])==null?void 0:M.id)??"")},{immediate:!0});async function l(){if(i)try{m.value=await s.sessions.listRemoteSessions()}catch{m.value=[]}}Dt(l);const h=H(null),f=H(""),_=new Set(["unknown_profile","permission_denied","request_in_flight","duplicate_request_id","unknown_host_id","invalid_request","upstream_unavailable","session_create_busy","timeout","relay_not_configured"]);function S(P){return _.has(P)?n(`settings.mobileProfiles.openErrors.${P}`):n("settings.mobileProfiles.openErrors.generic",{error:P})}async function k(P){if(h.value!==null)return;const M=v.value;if(!M)return;const w=s.sessions.createSessionWithProfile;if(!w){f.value=S("relay_not_configured");return}h.value=P,f.value="";try{const T=await w(M,P);a("session-created",T)}catch(T){f.value=S(T instanceof Error?T.message:String(T))}finally{h.value=null}}return(P,M)=>C(i)?($(),F("div",A9,[b("p",I9,L(C(n)("settings.mobileProfiles.intro")),1),g.value==="locked"?($(),F("p",$9,L(C(n)("settings.mobileSync.locked")),1)):g.value==="noData"?($(),F("p",O9,L(C(n)("settings.mobileSync.noData")),1)):g.value==="error"?($(),F("p",F9,L(C(n)("settings.mobileSync.error",{error:c.value})),1)):g.value==="empty"?($(),F("p",B9,L(C(n)("settings.mobileProfiles.empty")),1)):($(),F(Ie,{key:4},[y.value.length>0?($(),F("label",H9,[b("span",null,L(C(n)("settings.mobileProfiles.hostLabel")),1),rt(b("select",{"onUpdate:modelValue":M[0]||(M[0]=w=>v.value=w),"data-testid":"mobile-profiles-host-select"},[($(!0),F(Ie,null,at(y.value,w=>($(),F("option",{key:w.id,value:w.id},L(w.name),9,N9))),128))],512),[[Cg,v.value]])])):($(),F("p",z9,L(C(n)("settings.mobileProfiles.noHosts")),1)),f.value?($(),F("p",U9,L(f.value),1)):Z("",!0),b("ul",V9,[($(!0),F(Ie,null,at(r.value,w=>($(),F("li",{key:w.id,class:"profile-item","data-testid":"mobile-profile-item"},[b("div",K9,[b("span",W9,L(w.name||C(n)("common.unknown")),1),w.id===o.value?($(),F("span",j9,L(C(n)("settings.mobileProfiles.defaultBadge")),1)):Z("",!0),b("button",{type:"button",class:"open-btn","data-testid":"mobile-profile-open",disabled:!v.value||h.value!==null,onClick:T=>k(w.id)},L(h.value===w.id?C(n)("settings.mobileProfiles.opening"):C(n)("settings.mobileProfiles.openButton")),9,q9)]),b("dl",Y9,[b("dt",null,L(C(n)("settings.mobileProfiles.shell")),1),b("dd",G9,L(w.shell||C(n)("common.unknown")),1),b("dt",null,L(C(n)("settings.mobileProfiles.cwd")),1),b("dd",X9,L(w.cwd||C(n)("common.unknown")),1),b("dt",null,L(C(n)("settings.mobileProfiles.startupCmd")),1),b("dd",J9,L(w.startupCmd||C(n)("common.unknown")),1),b("dt",null,L(C(n)("settings.mobileProfiles.env")),1),b("dd",Q9,[w.syncEnv?!w.env||Object.keys(w.env).length===0?($(),F(Ie,{key:1},[ot(L(C(n)("settings.mobileProfiles.envNone")),1)],64)):($(),F("ul",Z9,[($(!0),F(Ie,null,at(w.env,(T,A)=>($(),F("li",{key:A},L(A)+"="+L(T),1))),128))])):($(),F(Ie,{key:0},[ot(L(C(n)("settings.mobileProfiles.envNotSynced")),1)],64))])])]))),128))])],64))])):Z("",!0)}}),tV=Ct(eV,[["__scopeId","data-v-1c4c4dd0"]]),nV={key:0,class:"mobile-hosts","data-testid":"mobile-hosts-panel"},sV={class:"hint"},iV={key:0,class:"status","data-testid":"mobile-hosts-locked"},rV={key:1,class:"status","data-testid":"mobile-hosts-no-data"},oV={key:2,class:"status error","data-testid":"mobile-hosts-error"},aV={key:3,class:"status","data-testid":"mobile-hosts-empty"},lV={key:4,class:"host-list","data-testid":"mobile-hosts-list"},cV={class:"host-header"},dV={class:"host-alias"},uV={class:"host-target"},hV={key:0,class:"badge badge-warn","data-testid":"mobile-host-proxy-command-badge"},fV={key:1,class:"badge","data-testid":"mobile-host-jump-chain-badge"},pV={class:"host-fields"},vV={"data-testid":"mobile-host-user"},gV={"data-testid":"mobile-host-port"},mV={"data-testid":"mobile-host-key"},_V={"data-testid":"mobile-host-tags"},yV={"data-testid":"mobile-host-note"},bV=Ae({__name:"SettingsSSHHostsMobile",setup(e){const{t}=$t(),s=hn().caps.capacitor,i=s?Gy():H(null),a=H([]),d=H([]),r=H(""),o=H(!1);function c(){if(!s)return;r.value="";const g=i.value;if(!g)return;const m=Xy("ssh_hosts_encrypted");if(o.value=m!==void 0,m!==void 0)try{const y=M9(g,m);a.value=y.hosts,d.value=y.keys}catch(y){r.value=y instanceof Error?y.message:String(y)}}_t(i,c,{immediate:!0});const p=q(()=>i.value?r.value?"error":o.value?a.value.length===0?"empty":"ready":"noData":"locked");function u(g){var m;return g?((m=d.value.find(y=>y.id===g))==null?void 0:m.name)??g:""}return(g,m)=>C(s)?($(),F("div",nV,[b("p",sV,L(C(t)("settings.mobileHosts.intro")),1),p.value==="locked"?($(),F("p",iV,L(C(t)("settings.mobileSync.locked")),1)):p.value==="noData"?($(),F("p",rV,L(C(t)("settings.mobileSync.noData")),1)):p.value==="error"?($(),F("p",oV,L(C(t)("settings.mobileSync.error",{error:r.value})),1)):p.value==="empty"?($(),F("p",aV,L(C(t)("settings.mobileHosts.empty")),1)):($(),F("ul",lV,[($(!0),F(Ie,null,at(a.value,y=>($(),F("li",{key:y.id,class:"host-item","data-testid":"mobile-host-item"},[b("div",cV,[b("span",dV,L(y.alias||y.host),1),b("span",uV,L(y.host),1),y.isProxyCommandHost?($(),F("span",hV,L(C(t)("settings.mobileHosts.proxyCommand")),1)):y.hasJumpChain?($(),F("span",fV,L(C(t)("settings.mobileHosts.jumpChain")),1)):Z("",!0)]),b("dl",pV,[b("dt",null,L(C(t)("settings.mobileHosts.user")),1),b("dd",vV,L(y.user||C(t)("common.unknown")),1),b("dt",null,L(C(t)("settings.mobileHosts.port")),1),b("dd",gV,L(y.port||C(t)("common.unknown")),1),y.keyId?($(),F(Ie,{key:0},[b("dt",null,L(C(t)("settings.mobileHosts.key")),1),b("dd",mV,L(u(y.keyId)),1)],64)):Z("",!0),y.tags.length?($(),F(Ie,{key:1},[b("dt",null,L(C(t)("settings.mobileHosts.tags")),1),b("dd",_V,L(y.tags.join(", ")),1)],64)):Z("",!0),y.note?($(),F(Ie,{key:2},[b("dt",null,L(C(t)("settings.mobileHosts.note")),1),b("dd",yV,L(y.note),1)],64)):Z("",!0)])]))),128))]))])):Z("",!0)}}),wV=Ct(bV,[["__scopeId","data-v-721a37c4"]]),SV=["data-state"],CV={class:"sync-row"},kV=["data-state"],xV={class:"sync-last","data-testid":"sync-last-synced"},RV={key:0,class:"sync-pending","data-testid":"sync-pending"},TV=["disabled"],PV={key:0,class:"sync-error","data-testid":"sync-error"},EV={key:1,class:"sync-error","data-testid":"sync-trigger-error"},LV={key:2,class:"sync-notice","data-testid":"sync-notice"},DV={key:0,class:"sync-notice-adopted","data-testid":"sync-notice-adopted"},MV={key:1,class:"sync-notice-conflict","data-testid":"sync-notice-conflict"},AV=Ae({__name:"SyncStatusIndicator",setup(e){const{t}=$t(),n=hn(),s=n.caps.wailsBindings,i=H({state:"idle",last_synced_at:0,pending_keys:0}),a=H(!1),d=H(""),r=H(null),o={locale_preference:"sync.keys.locale_preference",quick_templates:"sync.keys.quick_templates",notifications_enabled:"sync.keys.notifications_enabled",ai_notifications_only:"sync.keys.ai_notifications_only",command_notify_threshold_seconds:"sync.keys.command_notify_threshold_seconds",shell_integration_enabled:"sync.keys.shell_integration_enabled",pinned_session_ids:"sync.keys.pinned_session_ids",ssh_hosts_encrypted:"sync.keys.ssh_hosts_encrypted",terminal_theme:"sync.keys.terminal_theme",terminal_font_head:"sync.keys.terminal_font_head",terminal_font_size:"sync.keys.terminal_font_size",terminal_line_height:"sync.keys.terminal_line_height",terminal_cursor_style:"sync.keys.terminal_cursor_style",terminal_cursor_blink:"sync.keys.terminal_cursor_blink",terminal_scrollback:"sync.keys.terminal_scrollback",default_shell:"sync.keys.default_shell",shortcut_bindings:"sync.keys.shortcut_bindings",profiles_encrypted:"sync.keys.profiles_encrypted"};function c(f){const _=o[f];return _?t(_):f.replace(/_/g," ").replace(/\b\w/g,S=>S.toUpperCase())}const p=q(()=>{if(i.value.last_synced_at===0)return t("sync.lastSyncedNever");const f=Wy(Math.floor(i.value.last_synced_at/1e3));return t("sync.lastSyncedAt",{time:f})}),u=q(()=>{switch(i.value.state){case"idle":return t("sync.stateIdle");case"syncing":return t("sync.stateSyncing");case"offline":return t("sync.stateOffline");case"error":return t("sync.stateError")}});async function g(){if(!(i.value.state==="syncing"||a.value)){a.value=!0,d.value="";try{await BS()}catch(f){d.value=f instanceof Error?f.message:String(f)}finally{a.value=!1}}}function m(){r.value=null}function y(f){i.value=f,d.value=""}function v(f){var S,k;const _=f;(((S=_.adopted)==null?void 0:S.length)??0)===0&&(((k=_.conflict)==null?void 0:k.length)??0)===0||(r.value=_)}let l=null,h=null;return Dt(async()=>{if(s){l=n.events.on("sync:status",y),h=n.events.on("sync:pulled",v);try{i.value=await FS()}catch{}}}),Vt(()=>{l==null||l(),l=null,h==null||h(),h=null}),(f,_)=>C(s)?($(),F("div",{key:0,class:"sync-indicator","data-testid":"sync-indicator","data-state":i.value.state},[b("div",CV,[b("span",{class:lt(["sync-dot",`state-${i.value.state}`]),"aria-hidden":"true"},null,2),b("span",{class:"sync-state","data-testid":"sync-state","data-state":i.value.state},L(u.value),9,kV),b("span",xV,L(p.value),1),i.value.pending_keys>0?($(),F("span",RV,L(C(t)("sync.pendingKeys",{count:i.value.pending_keys})),1)):Z("",!0),b("button",{class:"sync-now-btn","data-testid":"sync-now-button",disabled:i.value.state==="syncing"||a.value,onClick:g},L(C(t)("sync.syncNow")),9,TV)]),i.value.last_error?($(),F("p",PV,L(i.value.last_error),1)):Z("",!0),d.value?($(),F("p",EV,L(d.value),1)):Z("",!0),r.value?($(),F("div",LV,[r.value.adopted&&r.value.adopted.length?($(),F("p",DV,L(C(t)("sync.pulledAdopted",{keys:r.value.adopted.map(c).join(", ")})),1)):Z("",!0),r.value.conflict&&r.value.conflict.length?($(),F("p",MV,L(C(t)("sync.pulledConflict",{keys:r.value.conflict.map(c).join(", ")})),1)):Z("",!0),b("button",{class:"sync-notice-dismiss","data-testid":"sync-notice-dismiss",onClick:m},L(C(t)("app.dismiss")),1)])):Z("",!0)],8,SV)):Z("",!0)}}),IV=Ct(AV,[["__scopeId","data-v-3da58fd3"]]),$V={class:"dialog"},OV={key:0},FV={key:0},BV={class:"dim"},HV={key:1},NV={class:"dim"},zV={key:1,class:"warn"},UV={class:"row"},VV=Ae({__name:"ConfirmInstallDialog",props:{version:{},localCount:{},remoteCount:{}},emits:["confirm","cancel"],setup(e){const{t}=$t(),n=i=>i===1?"sessions.endLocalSessionOne":"sessions.endLocalSessionMany",s=i=>i===1?"sessions.detachRemoteSessionOne":"sessions.detachRemoteSessionMany";return(i,a)=>($(),F("div",{class:"backdrop",onClick:a[2]||(a[2]=dt(d=>i.$emit("cancel"),["self"]))},[b("div",$V,[b("h2",null,L(C(t)("settings.updates.installTitle",{version:i.version})),1),b("p",null,[ot(L(C(t)("settings.updates.installIntro"))+" ",1),i.localCount>0||i.remoteCount>0?($(),F(Ie,{key:0},[ot(L(C(t)("settings.updates.installThisWill")),1)],64)):Z("",!0)]),i.localCount>0||i.remoteCount>0?($(),F("ul",OV,[i.localCount>0?($(),F("li",FV,[ot(L(C(t)(n(i.localCount),{count:i.localCount}))+" ",1),b("span",BV,L(C(t)("sessions.runningProcessesTerminated")),1)])):Z("",!0),i.remoteCount>0?($(),F("li",HV,[ot(L(C(t)(s(i.remoteCount),{count:i.remoteCount}))+" ",1),b("span",NV,L(C(t)("sessions.remotePtyKeepsRunning")),1)])):Z("",!0)])):Z("",!0),i.localCount>0?($(),F("p",zV,L(C(t)("sessions.saveWorkFirst")),1)):Z("",!0),b("div",UV,[b("button",{onClick:a[0]||(a[0]=d=>i.$emit("cancel"))},L(C(t)("common.cancel")),1),b("button",{class:lt(["primary",{danger:i.localCount>0}]),onClick:a[1]||(a[1]=d=>i.$emit("confirm"))},L(i.localCount>0?C(t)("settings.updates.forceInstall"):C(t)("settings.updates.installRestart")),3)])])]))}}),KV=Ct(VV,[["__scopeId","data-v-3b3531ba"]]),WV={class:"dialog"},jV={class:"header"},qV=["title"],YV={key:0,class:"error"},GV={key:1,class:"empty"},XV={key:2,class:"empty"},JV={key:3,class:"content-wrap"},QV={key:0,class:"hint"},ZV={class:"row"},eK={class:"lvl-filter"},tK={class:"lvl-filter-label"},nK={class:"lvl-filter-select"},sK={class:"lvl-filter-label"},iK={class:"tag-filter-select"},rK=["disabled"],oK=Ae({__name:"LogViewerDialog",props:{preview:{},loading:{type:Boolean},error:{}},emits:["close","refresh"],setup(e,{emit:t}){const n=e,s=t,{t:i}=$t(),a=H("DEBUG"),d=H(Sc),r=q(()=>Vy(n.preview.content,i("settings.logging.tagFilterAll"))),o=H(null);async function c(){var g;await un();const u=(g=o.value)==null?void 0:g.$el;u&&(u.scrollTop=u.scrollHeight)}_t(()=>n.preview.content,()=>{c()},{immediate:!0});async function p(){await navigator.clipboard.writeText(n.preview.content)}return(u,g)=>($(),F("div",{class:"backdrop",onClick:g[4]||(g[4]=dt(m=>s("close"),["self"]))},[b("div",WV,[b("div",jV,[b("h2",null,L(C(i)("settings.logging.title")),1),b("div",{class:"path",title:n.preview.path},L(n.preview.path),9,qV)]),n.error?($(),F("div",YV,L(n.error),1)):n.loading?($(),F("div",GV,L(C(i)("common.loading")),1)):n.preview.exists?($(),F("div",JV,[n.preview.truncated?($(),F("div",QV,L(C(i)("settings.logging.truncated")),1)):Z("",!0),Te(Ky,{ref_key:"contentEl",ref:o,class:"content",content:n.preview.content,minLevel:a.value,tag:d.value},null,8,["content","minLevel","tag"])])):($(),F("div",XV,L(C(i)("settings.logging.noContent")),1)),b("div",ZV,[b("div",eK,[b("span",tK,L(C(i)("settings.logging.levelFilter")),1),b("div",nK,[Te(ns,{modelValue:a.value,options:C(Uy),ariaLabel:C(i)("settings.logging.levelFilter"),"onUpdate:modelValue":g[0]||(g[0]=m=>a.value=m)},null,8,["modelValue","options","ariaLabel"])]),b("span",sK,L(C(i)("settings.logging.tagFilter")),1),b("div",iK,[Te(ns,{modelValue:d.value,options:r.value,ariaLabel:C(i)("settings.logging.tagFilter"),"onUpdate:modelValue":g[1]||(g[1]=m=>d.value=m)},null,8,["modelValue","options","ariaLabel"])])]),b("button",{onClick:g[2]||(g[2]=m=>s("refresh"))},L(C(i)("common.refresh")),1),b("button",{onClick:p,disabled:!n.preview.content},L(C(i)("common.copy")),9,rK),b("button",{class:"primary",onClick:g[3]||(g[3]=m=>s("close"))},L(C(i)("common.close")),1)])])]))}}),aK=Ct(oK,[["__scopeId","data-v-b060bffd"]]),lK={class:"settings-dialog"},cK={class:"settings-header"},dK=["disabled"],uK={class:"settings-body"},hK={class:"settings-nav"},fK=["innerHTML"],pK={class:"nav-label"},vK=["innerHTML"],gK={class:"nav-label"},mK=["innerHTML"],_K={class:"nav-label"},yK=["innerHTML"],bK={class:"nav-label"},wK=["innerHTML"],SK={class:"nav-label"},CK=["innerHTML"],kK={class:"nav-label"},xK=["innerHTML"],RK={class:"nav-label"},TK=["innerHTML"],PK={class:"nav-label"},EK=["innerHTML"],LK={class:"nav-label"},DK=["innerHTML"],MK={class:"nav-label"},AK=["innerHTML"],IK={class:"nav-label"},$K=["innerHTML"],OK={class:"nav-label"},FK=["innerHTML"],BK={class:"nav-label"},HK=["innerHTML"],NK={class:"nav-label"},zK=["innerHTML"],UK={class:"nav-label"},VK={class:"settings-pane"},KK={class:"settings-pane-header"},WK={class:"settings-pane-title"},jK={key:0,class:"settings-pane-subtitle"},qK={key:9,class:"diag-merged"},YK={key:0,class:"merged-section"},GK={class:"merged-section-title"},XK={class:"merged-section"},JK={key:0,class:"merged-section-title"},QK={class:"merged-section"},ZK={class:"merged-section-title"},eW={key:0,class:"settings-footer"},tW=["disabled"],nW=["disabled"],sW={class:"version-footer","data-testid":"settings-version-footer"},iW={class:"discard-dialog"},rW={class:"discard-row"},ps='viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"',oW=Ae({__name:"SettingsDialog",props:{localSessionCount:{},remoteSessionCount:{},terminalThemeId:{},initialTab:{}},emits:["close","relay-config-changed","terminal-theme-changed","command-notify-threshold-changed","appearance-changed","bindings-changed","profiles-changed","session-created"],setup(e,{emit:t}){const n=hn(),s=n.caps,{t:i,resolvedLocale:a}=$t(),d={general:{labelKey:"settings.tabs.general",english:"General preferences"},account:{labelKey:"settings.account.title",english:"Account"},tasks:{labelKey:"tasks.settings.section",english:"Tasks display"},relay:{labelKey:"settings.tabs.relay",english:"Relay"},plugins:{labelKey:"settings.tabs.plugins",english:"Plugins"},shortcuts:{labelKey:"settings.tabs.shortcuts",english:"Keyboard shortcuts"},templates:{labelKey:"settings.templates.tab",english:"Quick templates"},profiles:{labelKey:"settings.profiles.tab",english:"Session profiles"},logging:{labelKey:"settings.tabs.logging",english:"Logging"},updates:{labelKey:"settings.tabs.updates",english:"Updates"},diagnostics:{labelKey:"settings.diagnostics.tab",english:"Diagnostics"},feishu:{labelKey:"settings.feishu.title",english:"Feishu integration"},devices:{labelKey:"settings.tabs.devices",english:"Signed-in devices"},"received-files":{labelKey:"settings.tabs.receivedFiles",english:"Received files"},"mobile-profiles":{labelKey:"settings.tabs.mobileProfiles",english:"Synced profiles"},"mobile-hosts":{labelKey:"settings.tabs.mobileHosts",english:"SSH hosts"}},r=q(()=>i(d[m.value].labelKey)),o=q(()=>a.value==="zh-CN"?d[m.value].english:""),c={general:``,account:``,tasks:``,relay:``,plugins:``,shortcuts:``,templates:``,profiles:``,updates:``,diagnostics:``,feishu:``,devices:``,"received-files":``,"mobile-profiles":``,"mobile-hosts":``},p=e,u=t,g=p.initialTab==="logging"?"diagnostics":p.initialTab??"general",m=H(g),y=new Set;s.autoUpdate||y.add("updates"),s.pluginHost||(y.add("plugins"),y.add("shortcuts")),s.wailsBindings&&y.add("account"),s.wailsBindings||(y.add("relay"),y.add("diagnostics"),y.add("received-files"),y.add("feishu"),y.add("profiles")),s.capacitor||(y.add("mobile-profiles"),y.add("mobile-hosts")),y.has(m.value)&&(m.value="general");const v=H(Li(p.terminalThemeId).id);_t(()=>p.terminalThemeId,J=>{v.value=Li(J).id});const l=H(null),h=H(!1),f=H(null),_=H(!1),S=H(null),k=H(""),P=H(!1),M=H(!1),w=H(!1),T=H(""),A=H(""),E=q(()=>{const J=A.value.trim();return!J||J==="dev"?"AT Term (dev)":`AT Term ${J.startsWith("v")?J:`v${J}`}`});Dt(async()=>{if(s.wailsBindings)try{const J=await pm();v.value=Li(J).id}catch{}}),Dt(async()=>{try{A.value=await n.system.getAppVersion()}catch{}});function R(J){if(m.value!==J){if(m.value==="relay"&&h.value){f.value=J,_.value=!0;return}m.value=J}}function D(){_.value=!1,f.value&&(m.value=f.value,f.value=null),h.value=!1}function I(){_.value=!1,f.value=null}function O(){var J;(J=l.value)!=null&&J.saving||u("close")}function U(J){h.value=J}function W(){h.value=!1,u("relay-config-changed")}function N(J){v.value=Li(J).id,u("terminal-theme-changed",J)}function z(J){u("command-notify-threshold-changed",J)}function V(J){u("appearance-changed",J)}function j(J){u("bindings-changed",J)}function G(){u("profiles-changed")}async function te(){M.value=!0,await oe()}async function oe(){k.value="",P.value=!0;try{S.value=await fm()}catch(J){k.value=(J==null?void 0:J.message)??String(J)}finally{P.value=!1}}function re(J){T.value=J,w.value=!0}async function ye(){w.value=!1;try{await lm()}catch{}}function K(){var J;(J=l.value)==null||J.save()}return(J,Q)=>{var de,De,Pe,Ye;return $(),F("div",{class:"backdrop",onClick:dt(O,["self"])},[b("div",lK,[b("header",cK,[b("h2",null,L(C(i)("settings.title")),1),C(s).wailsBindings?($(),bt(IV,{key:0,class:"header-sync-indicator"})):Z("",!0),b("button",{class:"close-btn",onClick:O,disabled:(de=l.value)==null?void 0:de.saving},"×",8,dK)]),b("div",uK,[b("aside",hK,[b("button",{class:lt(["settings-nav-item",{active:m.value==="general"}]),onClick:Q[0]||(Q[0]=st=>R("general"))},[b("span",{class:"nav-icon",innerHTML:c.general},null,8,fK),b("span",pK,L(C(i)("settings.tabs.general")),1)],2),C(s).wailsBindings?Z("",!0):($(),F("button",{key:0,class:lt(["settings-nav-item",{active:m.value==="account"}]),onClick:Q[1]||(Q[1]=st=>R("account"))},[b("span",{class:"nav-icon",innerHTML:c.account},null,8,vK),b("span",gK,L(C(i)("settings.account.title")),1)],2)),b("button",{class:lt(["settings-nav-item",{active:m.value==="tasks"}]),onClick:Q[2]||(Q[2]=st=>R("tasks"))},[b("span",{class:"nav-icon",innerHTML:c.tasks},null,8,mK),b("span",_K,L(C(i)("tasks.settings.section")),1)],2),C(s).wailsBindings?($(),F("button",{key:1,class:lt(["settings-nav-item",{active:m.value==="relay"}]),onClick:Q[3]||(Q[3]=st=>R("relay"))},[b("span",{class:"nav-icon",innerHTML:c.relay},null,8,yK),b("span",bK,L(C(i)("settings.tabs.relay")),1)],2)):Z("",!0),b("button",{class:lt(["settings-nav-item",{active:m.value==="devices"}]),onClick:Q[4]||(Q[4]=st=>R("devices"))},[b("span",{class:"nav-icon",innerHTML:c.devices},null,8,wK),b("span",SK,L(C(i)("settings.tabs.devices")),1)],2),C(s).capacitor?($(),F("button",{key:2,class:lt(["settings-nav-item",{active:m.value==="mobile-profiles"}]),onClick:Q[5]||(Q[5]=st=>R("mobile-profiles"))},[b("span",{class:"nav-icon",innerHTML:c["mobile-profiles"]},null,8,CK),b("span",kK,L(C(i)("settings.tabs.mobileProfiles")),1)],2)):Z("",!0),C(s).capacitor?($(),F("button",{key:3,class:lt(["settings-nav-item",{active:m.value==="mobile-hosts"}]),onClick:Q[6]||(Q[6]=st=>R("mobile-hosts"))},[b("span",{class:"nav-icon",innerHTML:c["mobile-hosts"]},null,8,xK),b("span",RK,L(C(i)("settings.tabs.mobileHosts")),1)],2)):Z("",!0),C(s).pluginHost?($(),F("button",{key:4,class:lt(["settings-nav-item",{active:m.value==="plugins"}]),onClick:Q[7]||(Q[7]=st=>R("plugins"))},[b("span",{class:"nav-icon",innerHTML:c.plugins},null,8,TK),b("span",PK,L(C(i)("settings.tabs.plugins")),1)],2)):Z("",!0),C(s).pluginHost?($(),F("button",{key:5,class:lt(["settings-nav-item",{active:m.value==="shortcuts"}]),onClick:Q[8]||(Q[8]=st=>R("shortcuts"))},[b("span",{class:"nav-icon",innerHTML:c.shortcuts},null,8,EK),b("span",LK,L(C(i)("settings.tabs.shortcuts")),1)],2)):Z("",!0),b("button",{class:lt(["settings-nav-item",{active:m.value==="templates"}]),onClick:Q[9]||(Q[9]=st=>R("templates"))},[b("span",{class:"nav-icon",innerHTML:c.templates},null,8,DK),b("span",MK,L(C(i)("settings.templates.tab")),1)],2),C(s).wailsBindings?($(),F("button",{key:6,class:lt(["settings-nav-item",{active:m.value==="profiles"}]),onClick:Q[10]||(Q[10]=st=>R("profiles"))},[b("span",{class:"nav-icon",innerHTML:c.profiles},null,8,AK),b("span",IK,L(C(i)("settings.profiles.tab")),1)],2)):Z("",!0),C(s).autoUpdate?($(),F("button",{key:7,class:lt(["settings-nav-item",{active:m.value==="updates"}]),onClick:Q[11]||(Q[11]=st=>R("updates"))},[b("span",{class:"nav-icon",innerHTML:c.updates},null,8,$K),b("span",OK,L(C(i)("settings.tabs.updates")),1)],2)):Z("",!0),C(s).wailsBindings?($(),F("button",{key:8,class:lt(["settings-nav-item",{active:m.value==="diagnostics"}]),onClick:Q[12]||(Q[12]=st=>R("diagnostics"))},[b("span",{class:"nav-icon",innerHTML:c.diagnostics},null,8,FK),b("span",BK,L(C(i)("settings.diagnostics.tab")),1)],2)):Z("",!0),C(s).wailsBindings?($(),F("button",{key:9,class:lt(["settings-nav-item",{active:m.value==="feishu"}]),onClick:Q[13]||(Q[13]=st=>R("feishu"))},[b("span",{class:"nav-icon",innerHTML:c.feishu},null,8,HK),b("span",NK,L(C(i)("settings.feishu.title")),1)],2)):Z("",!0),C(s).wailsBindings?($(),F("button",{key:10,class:lt(["settings-nav-item",{active:m.value==="received-files"}]),onClick:Q[14]||(Q[14]=st=>R("received-files"))},[b("span",{class:"nav-icon",innerHTML:c["received-files"]},null,8,zK),b("span",UK,L(C(i)("settings.tabs.receivedFiles")),1)],2)):Z("",!0)]),b("section",VK,[b("header",KK,[b("h3",WK,L(r.value),1),o.value?($(),F("span",jK,L(o.value),1)):Z("",!0)]),rt(Te(oF,{"terminal-theme-id":v.value,onTerminalThemeChanged:N,onCommandNotifyThresholdChanged:z,onAppearanceChanged:V},null,8,["terminal-theme-id"]),[[Ss,m.value==="general"]]),!C(s).wailsBindings&&m.value==="account"?($(),bt(pB,{key:0})):Z("",!0),rt(Te(zz,null,null,512),[[Ss,m.value==="tasks"]]),C(s).wailsBindings?rt(($(),bt(s8,{key:1,ref_key:"relayRef",ref:l,onDirty:U,onRelayConfigChanged:W},null,512)),[[Ss,m.value==="relay"]]):Z("",!0),C(s).autoUpdate?rt(($(),bt(_H,{key:2,onRequestInstall:re},null,512)),[[Ss,m.value==="updates"]]):Z("",!0),C(s).pluginHost?rt(($(),bt(KH,{key:3},null,512)),[[Ss,m.value==="plugins"]]):Z("",!0),C(s).pluginHost?rt(($(),bt(g7,{key:4,onBindingsChanged:j},null,512)),[[Ss,m.value==="shortcuts"]]):Z("",!0),m.value==="templates"?($(),bt(GN,{key:5})):Z("",!0),m.value==="profiles"&&C(s).wailsBindings?($(),bt(Tz,{key:6,onProfilesChanged:G})):Z("",!0),m.value==="mobile-profiles"&&C(s).capacitor?($(),bt(tV,{key:7,onSessionCreated:Q[15]||(Q[15]=st=>u("session-created",st))})):Z("",!0),m.value==="mobile-hosts"&&C(s).capacitor?($(),bt(wV,{key:8})):Z("",!0),m.value==="diagnostics"&&C(s).wailsBindings?($(),F("div",qK,[C(s).fileDialog?($(),F("section",YK,[b("h4",GK,L(C(i)("settings.tabs.logging")),1),Te(V8,{onOpenLogViewer:te})])):Z("",!0),b("section",XK,[C(s).fileDialog?($(),F("h4",JK,L(C(i)("settings.diagnostics.section")),1)):Z("",!0),Te(k7)]),b("section",QK,[b("h4",ZK,L(C(i)("settings.configio.title")),1),Te(tN)])])):Z("",!0),m.value==="feishu"&&C(s).wailsBindings?($(),bt(NU,{key:10})):Z("",!0),m.value==="devices"?($(),bt(i9,{key:11})):Z("",!0),m.value==="received-files"&&C(s).wailsBindings?($(),bt(k9,{key:12})):Z("",!0)])]),m.value==="relay"?($(),F("footer",eW,[b("button",{onClick:O,disabled:(De=l.value)==null?void 0:De.saving},L(C(i)("common.cancel")),9,tW),b("button",{class:"primary",disabled:!((Pe=l.value)!=null&&Pe.canSave),onClick:K},L(((Ye=l.value)==null?void 0:Ye.saveLabel)??C(i)("settings.relay.saveConnect")),9,nW)])):Z("",!0),b("footer",sW,L(E.value),1)]),_.value?($(),F("div",{key:0,class:"discard-backdrop",onClick:dt(I,["self"])},[b("div",iW,[b("h3",null,L(C(i)("settings.discardRelayTitle")),1),b("p",null,L(C(i)("settings.discardRelayBody")),1),b("div",rW,[b("button",{onClick:I},L(C(i)("common.stay")),1),b("button",{class:"danger",onClick:D},L(C(i)("common.discard")),1)])])])):Z("",!0),w.value?($(),bt(KV,{key:1,version:T.value,"local-count":p.localSessionCount,"remote-count":p.remoteSessionCount,onConfirm:ye,onCancel:Q[16]||(Q[16]=st=>w.value=!1)},null,8,["version","local-count","remote-count"])):Z("",!0),M.value?($(),bt(aK,{key:2,preview:S.value??{path:"",exists:!1,truncated:!1,content:""},loading:P.value,error:k.value,onRefresh:oe,onClose:Q[17]||(Q[17]=st=>M.value=!1)},null,8,["preview","loading","error"])):Z("",!0)])}}}),aW=Ct(oW,[["__scopeId","data-v-5e0ae162"]]);function Qy(e){if(!e||typeof e!="object")return null;const t=e,n=typeof t.Fingerprint=="string"?t.Fingerprint:"",s=typeof t.Host=="string"?t.Host:"";if(!n||!s)return null;const i=typeof t.HopIndex=="number"&&t.HopIndex>0?t.HopIndex:0,a=typeof t.HopName=="string"?t.HopName:"";return{fingerprint:n,host:s,hopIndex:i,hopName:a}}const lW={class:"dialog"},cW={class:"row"},dW={class:"inline"},uW={class:"inline"},hW={key:0},fW={key:2,class:"tofu","data-test":"ssh-tofu"},pW={key:3,class:"error","data-test":"ssh-error"},vW={class:"row end"},gW=["disabled"],mW=Ae({__name:"NewSshDialog",emits:["connected","cancel"],setup(e,{emit:t}){const n=t,s=H(""),i=H("22"),a=H(""),d=H("password"),r=H(""),o=H(""),c=H(""),p=H(!1),u=H(""),g=H(null);function m(v){return{host:s.value,port:i.value||"22",user:a.value,auth_kind:d.value,password:d.value==="password"?r.value:void 0,private_key:d.value==="key"?o.value:void 0,passphrase:d.value==="key"?c.value:void 0,accepted_host_key_host:v==null?void 0:v.host,accepted_host_key_fingerprint:v==null?void 0:v.fingerprint}}async function y(v){if(!p.value){p.value=!0,u.value="";try{const l=await iS(m(v));g.value=null,n("connected",l.session_id)}catch(l){const h=Qy(l);h?g.value=h:(g.value=null,u.value=l instanceof Error?l.message:String(l))}finally{p.value=!1}}}return(v,l)=>($(),F("div",{class:"backdrop",onClick:l[11]||(l[11]=dt(h=>v.$emit("cancel"),["self"]))},[b("div",lW,[l[21]||(l[21]=b("h2",null,"New SSH Connection",-1)),b("label",null,[l[12]||(l[12]=ot("Host ")),rt(b("input",{"data-test":"ssh-host","onUpdate:modelValue":l[0]||(l[0]=h=>s.value=h),autocomplete:"off"},null,512),[[Tt,s.value]])]),b("label",null,[l[13]||(l[13]=ot("Port ")),rt(b("input",{"data-test":"ssh-port","onUpdate:modelValue":l[1]||(l[1]=h=>i.value=h),autocomplete:"off"},null,512),[[Tt,i.value]])]),b("label",null,[l[14]||(l[14]=ot("User ")),rt(b("input",{"data-test":"ssh-user","onUpdate:modelValue":l[2]||(l[2]=h=>a.value=h),autocomplete:"off"},null,512),[[Tt,a.value]])]),b("div",cW,[b("label",dW,[rt(b("input",{type:"radio",value:"password","onUpdate:modelValue":l[3]||(l[3]=h=>d.value=h),"data-test":"ssh-auth-password"},null,512),[[Fd,d.value]]),l[15]||(l[15]=ot(" Password "))]),b("label",uW,[rt(b("input",{type:"radio",value:"key","onUpdate:modelValue":l[4]||(l[4]=h=>d.value=h),"data-test":"ssh-auth-key"},null,512),[[Fd,d.value]]),l[16]||(l[16]=ot(" Private key "))])]),d.value==="password"?($(),F("label",hW,[l[17]||(l[17]=ot("Password ")),rt(b("input",{"data-test":"ssh-password",type:"password","onUpdate:modelValue":l[5]||(l[5]=h=>r.value=h),autocomplete:"off"},null,512),[[Tt,r.value]])])):($(),F(Ie,{key:1},[b("label",null,[l[18]||(l[18]=ot("Private key (PEM) ")),rt(b("textarea",{"data-test":"ssh-private-key","onUpdate:modelValue":l[6]||(l[6]=h=>o.value=h),rows:"4"},null,512),[[Tt,o.value]])]),b("label",null,[l[19]||(l[19]=ot("Passphrase (optional) ")),rt(b("input",{"data-test":"ssh-passphrase",type:"password","onUpdate:modelValue":l[7]||(l[7]=h=>c.value=h),autocomplete:"off"},null,512),[[Tt,c.value]])])],64)),g.value?($(),F("div",fW,[l[20]||(l[20]=b("p",{class:"warn"},"Unknown host key. Verify this fingerprint before trusting it:",-1)),b("code",null,L(g.value.fingerprint),1),b("button",{class:"primary","data-test":"ssh-accept-hostkey",onClick:l[8]||(l[8]=h=>y(g.value))}," Accept & Connect ")])):Z("",!0),u.value?($(),F("p",pW,L(u.value),1)):Z("",!0),b("div",vW,[b("button",{onClick:l[9]||(l[9]=h=>v.$emit("cancel"))},"Cancel"),b("button",{class:"primary","data-test":"ssh-connect",disabled:p.value,onClick:l[10]||(l[10]=h=>y(null))}," Connect ",8,gW)])])]))}}),_W=Ct(mW,[["__scopeId","data-v-c791c224"]]),yW=256*1024,bW=/-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----/;function wW(e){return bW.test(e)}const Vv="openssh-key-v1\0";function SW(e){if(!e)return!1;if(e.includes("ENCRYPTED PRIVATE KEY")||/^\s*Proc-Type:\s*4,ENCRYPTED/m.test(e))return!0;if(!e.includes("BEGIN OPENSSH PRIVATE KEY"))return!1;const t=CW(e);return t!==null&&t!=="none"}function CW(e){const t=e.replace(/-----BEGIN [^-]*-----/g,"").replace(/-----END [^-]*-----/g,"").replace(/\s+/g,"");if(t==="")return null;let n;try{n=atob(t)}catch{return null}if(!n.startsWith(Vv))return null;const s=Vv.length;if(n.length{const s=new FileReader;s.onload=()=>t(String(s.result??"")),s.onerror=()=>n(s.error??new Error("could not read file")),s.readAsText(e)})}async function RW(e){if(e.size>yW)throw new Error(`${e.name} is too large to be a private key.`);const t=await xW(e);if(!wW(t))throw new Error(`${e.name} is not a private key file.`);return{pem:t,suggestedName:TW(e.name),encrypted:SW(t)}}function TW(e){const t=e.split(/[/\\]/).pop()??"",n=t.toLowerCase();for(const s of kW)if(n.endsWith(s)&&t.length>s.length)return t.slice(0,-s.length);return t}const PW="22";function EW(e){const t=e.user.trim(),n=e.host.trim(),s=(e.port??"").trim(),i=s!==""&&s!==PW?`-p ${s} `:"",a=t===""?n:`${t}@${n}`;return`ssh ${i}${a}`}const Pu=e=>e.trim().toLowerCase();function Jl(e){const t=new Set,n=[];for(const s of e){const i=s.trim();if(i==="")continue;const a=Pu(i);t.has(a)||(t.add(a),n.push(i))}return n}function LW(e){return Jl(e.split(","))}function DW(e){return Jl(e.flatMap(n=>n.tags??[])).sort((n,s)=>n.localeCompare(s))}function MW(e,t){if(t.length===0)return!0;const n=new Set((e??[]).map(Pu));return t.every(s=>n.has(Pu(s)))}const AW={class:"ssh-shell"},IW={class:"ssh-header"},$W={class:"tabs"},OW={class:"tab-count"},FW={class:"tab-count"},BW={class:"tab-count"},HW={key:0,class:"search"},NW=["placeholder"],zW={key:1,class:"search-spacer"},UW=["disabled","title"],VW=["title"],KW={key:0,class:"ssh-error","data-test":"ssh-hosts-error"},WW={key:1,class:"ssh-tofu","data-test":"ssh-host-tofu"},jW={class:"tofu-title"},qW={class:"tofu-msg"},YW={class:"tofu-fp"},GW={key:0,class:"tofu-note"},XW={class:"tofu-actions"},JW={key:2,class:"ssh-success","data-test":"ssh-config-import-result"},QW={class:"ssh-body"},ZW={key:0,class:"empty"},ej={class:"empty-title"},tj={class:"empty-sub"},nj={key:0,class:"tag-bar","data-test":"ssh-tag-filter-bar"},sj=["data-test","onClick"],ij={key:1,class:"empty","data-test":"ssh-hosts-no-match"},rj={class:"empty-title"},oj={class:"empty-sub"},aj={key:2,class:"card-grid"},lj=["data-test","onDblclick","onContextmenu"],cj={class:"card-glyph"},dj={class:"card-main"},uj={class:"card-label"},hj={class:"card-sub"},fj={key:0,class:"card-proxy"},pj=["data-test","title"],vj={key:1,class:"card-tags"},gj=["data-test"],mj={class:"card-actions"},_j=["data-test","disabled","title","onClick"],yj=["title","onClick"],bj=["data-test","title","onClick"],wj={class:"ssh-body"},Sj={key:0,class:"empty"},Cj={class:"empty-title"},kj={class:"empty-sub"},xj={key:1,class:"card-grid"},Rj={class:"card-glyph"},Tj={class:"card-main"},Pj={class:"card-label"},Ej={class:"card-sub"},Lj={class:"card-actions"},Dj=["data-test","title","onClick"],Mj=["data-test","title","onClick"],Aj={class:"ssh-body"},Ij={key:0,class:"empty","data-test":"ssh-tunnels-empty"},$j={class:"empty-title"},Oj={class:"empty-sub"},Fj=["data-test"],Bj={class:"fwd-host-head"},Hj={class:"fwd-host-name"},Nj={class:"fwd-host-sub"},zj=["data-test","title"],Uj=["data-test"],Vj={class:"card-grid"},Kj=["data-test"],Wj={class:"card-glyph"},jj={class:"card-main"},qj={class:"card-label"},Yj={class:"fwd-kind"},Gj={key:0,class:"fwd-note"},Xj={class:"card-sub fwd-route"},Jj={key:0,class:"fwd-row-conns"},Qj=["data-test"],Zj={class:"fwd-card-side"},eq=["data-test"],tq={class:"card-actions"},nq=["data-test","title","disabled","onClick"],sq=["data-test","title","disabled","onClick"],iq=["data-test","title","disabled","onClick"],rq=["data-test","title","onClick"],oq=["data-test","title","onClick"],aq={key:0,class:"drawer"},lq={class:"drawer-head"},cq={class:"drawer-body"},dq={class:"field"},uq={class:"fl"},hq=["placeholder"],fq={class:"field-row"},pq={class:"field grow"},vq={class:"fl"},gq=["placeholder"],mq={class:"field port"},_q={class:"fl"},yq={class:"field tag-field"},bq={class:"fl"},wq={class:"tag-editor"},Sq=["data-test"],Cq=["data-test","title","onClick"],kq=["placeholder","onKeydown"],xq={key:0,class:"combo-menu","data-test":"ssh-tag-menu"},Rq=["data-test","onMousedown"],Tq={class:"field"},Pq={class:"fl"},Eq=["placeholder"],Lq={class:"seg"},Dq={key:0,class:"identity-hint","data-test":"ssh-host-identity-file"},Mq={class:"fl"},Aq={class:"hint"},Iq={key:1,class:"identity-hint proxy","data-test":"ssh-host-drawer-proxy"},$q={key:2,class:"field"},Oq={class:"fl"},Fq={key:0},Bq={key:0,class:"field"},Hq={class:"fl"},Nq={"data-test":"ssh-add-keyid"},zq={key:1,class:"empty-keys-hint"},Uq={class:"hint"},Vq={class:"fwd-section","data-test":"ssh-startup-section"},Kq={class:"fwd-section-head"},Wq={class:"fl"},jq={class:"hint"},qq={class:"field"},Yq=["placeholder"],Gq={class:"field-row"},Xq={class:"field port"},Jq={class:"fl"},Qq=["placeholder"],Zq={key:0,class:"hint grow","data-test":"ssh-startup-steps"},eY={class:"fwd-section","data-test":"ssh-forwards-section"},tY={class:"fwd-section-head"},nY={class:"fl"},sY={class:"hint"},iY={key:0,class:"hint","data-test":"ssh-forwards-none"},rY=["data-test"],oY={class:"fwd-rule-head"},aY={class:"seg sm"},lY=["data-test","onClick"],cY=["data-test","onClick"],dY=["data-test","onClick"],uY=["data-test","title","onClick"],hY={class:"hint"},fY={class:"field-row"},pY={class:"field grow"},vY={class:"fl"},gY=["data-test","onUpdate:modelValue"],mY={class:"field port"},_Y={class:"fl"},yY=["data-test","onUpdate:modelValue"],bY={key:0,class:"field-row"},wY={class:"field grow"},SY={class:"fl"},CY=["data-test","onUpdate:modelValue"],kY={class:"field port"},xY={class:"fl"},RY=["data-test","onUpdate:modelValue"],TY={class:"field"},PY={class:"fl"},EY=["data-test","onUpdate:modelValue","placeholder"],LY=["data-test"],DY={class:"drawer-foot"},MY=["disabled"],AY={key:0,class:"drawer"},IY={class:"drawer-head"},$Y={class:"drawer-body"},OY={class:"field"},FY={class:"fl"},BY=["placeholder"],HY={class:"field"},NY={class:"fl pem-label"},zY={key:0},UY={key:0,class:"pem-tools"},VY=["disabled","title"],KY=["title"],WY={class:"field"},jY={class:"fl"},qY={key:0,class:"enc-hint","data-test":"ssh-key-encrypted-hint"},YY={class:"import-block"},GY={class:"drawer-foot"},XY=["disabled"],JY={key:0,class:"drawer","data-test":"ssh-tunnel-drawer"},QY={class:"drawer-head"},ZY={class:"drawer-body"},eG={class:"field"},tG={class:"fl"},nG={"data-test":"ssh-tunnel-host"},sG={class:"hint"},iG={class:"seg"},rG={class:"hint"},oG={class:"field-row"},aG={class:"field grow"},lG={class:"fl"},cG={class:"field port"},dG={class:"fl"},uG={key:0,class:"field-row"},hG={class:"field grow"},fG={class:"fl"},pG={class:"field port"},vG={class:"fl"},gG={class:"field"},mG={class:"fl"},_G=["placeholder"],yG={key:1,class:"fwd-warn","data-test":"ssh-tunnel-bind-warning"},bG={class:"drawer-foot"},wG=["disabled"],SG=["disabled"],CG={key:0,class:"drawer wide","data-test":"ssh-config-import-drawer"},kG={class:"drawer-head"},xG={class:"drawer-body"},RG={key:0,class:"empty","data-test":"ssh-config-import-loading"},TG={class:"empty-sub"},PG={key:1,class:"ssh-error inline","data-test":"ssh-config-import-error"},EG={key:0,class:"empty","data-test":"ssh-config-import-empty"},LG={class:"empty-title"},DG={class:"empty-sub"},MG={key:0,class:"config-section-title"},AG={key:1,class:"config-entry-list"},IG={class:"config-entry-label"},$G=["data-test","checked","onChange"],OG={class:"config-entry-main"},FG={class:"config-entry-alias"},BG={class:"config-entry-sub"},HG={class:"config-entry-badges"},NG=["data-test","title"],zG=["data-test","title"],UG={class:"config-section-title"},VG={class:"config-skipped","data-test":"ssh-config-import-skipped"},KG={class:"skip-alias"},WG={class:"skip-reason"},jG={class:"config-note"},qG={class:"drawer-foot config-foot"},YG={key:0,class:"ssh-error inline","data-test":"ssh-config-import-confirm-error"},GG={class:"foot-actions"},XG=["disabled"],JG=3e3,QG=Ae({__name:"SshHostsPanel",emits:["connected","close"],setup(e,{emit:t}){var vr,Fi;const n=t,{t:s}=$t(),i=H("hosts"),a=H([]),d=H([]),r=H(""),o=H(""),c=H("");async function p(){[a.value,d.value]=await Promise.all([tm(),dS()])}function u(le){le.preventDefault()}let g;Dt(()=>{window.addEventListener("dragover",u),window.addEventListener("drop",u),p(),nt(),g=setInterval(()=>void nt(),JG)}),Vt(()=>{window.removeEventListener("dragover",u),window.removeEventListener("drop",u),g!==void 0&&clearInterval(g)});const m=H([]),y=q(()=>DW(a.value)),v=q(()=>{const le=o.value.trim().toLowerCase();return a.value.filter(pe=>MW(pe.tags,m.value)?le===""?!0:`${pe.alias??""} ${pe.host} ${pe.user} ${(pe.tags??[]).join(" ")}`.toLowerCase().includes(le):!1)});function l(le){const pe=m.value.indexOf(le);m.value=pe>=0?m.value.filter(ve=>ve!==le):[...m.value,le]}function h(){m.value=[]}const f=q(()=>d.value.map(le=>({value:le.id,label:le.key_type?`${le.name} (${le.key_type})`:le.name}))),_=H(!1),S=q(()=>{const le=be.value.trim().toLowerCase(),pe=new Set(ae.value.map(ve=>ve.toLowerCase()));return y.value.filter(ve=>!pe.has(ve.toLowerCase())&&(le===""||ve.toLowerCase().includes(le)))});function k(le){ae.value=Jl([...ae.value,...le])}function P(){k(LW(be.value)),be.value=""}function M(le){k([le]),be.value="",_.value=!1}function w(le){ae.value=ae.value.filter(pe=>pe!==le)}function T(){be.value===""&&(ae.value=ae.value.slice(0,-1))}function A(){P(),window.setTimeout(()=>_.value=!1,120)}function E(le){var pe;return((pe=le.alias)==null?void 0:pe.trim())||`${le.user}@${le.host}`}function R(le){const pe=le.port&&le.port!=="22"?`:${le.port}`:"",ve=le.auth_kind==="key"?s("ssh.subtitleAuthKey"):s("ssh.subtitleAuthPassword");return`${le.user}@${le.host}${pe} · ${ve}`}function D(le){return!!le.proxy_command}function I(le){return!!(le.proxy_jump||le.proxy_command)}function O(le){return D(le)?s("ssh.proxy.commandBadge"):s("ssh.proxy.jumpBadge",{target:le.proxy_jump??""})}function U(le){return D(le)?s("ssh.proxy.commandReason",{command:le.proxy_command??""}):le.proxy_jump?s("ssh.proxy.jumpReason",{target:le.proxy_jump}):""}const W=H(null);function N(le){return(le.alias??"").trim()||(le.host??"").trim()}const z=q(()=>{const le=W.value;if(!le)return"";const{prompt:pe}=le;if(pe.hopIndex===0)return s("ssh.hostKey.direct");const ve=N(le.host);return pe.hopName===ve?s("ssh.hostKey.targetHop",{target:ve,hop:pe.hopIndex}):s("ssh.hostKey.jumpHop",{name:pe.hopName,hop:pe.hopIndex,target:ve})});function V(){const le=W.value;le&&G(le.host.id,{host:le.prompt.host,fingerprint:le.prompt.fingerprint})}function j(){W.value=null}async function G(le,pe={host:"",fingerprint:""}){if(c.value)return;r.value="";const ve=a.value.find(Me=>Me.id===le);if(ve&&D(ve)){r.value=U(ve);return}c.value=le;try{const Me=await em(le,pe);W.value=null,n("connected",Me.session_id)}catch(Me){const zt=Qy(Me);if(zt&&ve){W.value={host:ve,prompt:zt};return}W.value=null,r.value=Me instanceof Error?Me.message:String(Me)}finally{c.value=""}}const te=H({open:!1,x:0,y:0,host:null}),oe=q(()=>[{key:"connect",label:s("ssh.hosts.menuConnect")},{key:"edit",label:s("ssh.hosts.menuEdit")},{key:"duplicate",label:s("ssh.hosts.menuDuplicate")},{key:"copy-ssh",label:s("ssh.hosts.menuCopySsh")},{key:"remove",label:s("ssh.hosts.menuRemove"),separatorBefore:!0}]);function re(le,pe){te.value={open:!0,x:le.clientX,y:le.clientY,host:pe}}function ye(){te.value={...te.value,open:!1,host:null}}async function K(le){const pe=te.value.host;if(pe)switch(le){case"connect":await G(pe.id);break;case"edit":x(pe);break;case"duplicate":await J(pe);break;case"copy-ssh":await Q(pe);break;case"remove":await xt(pe.id);break}}async function J(le){var ve;r.value="";const pe={...le,id:"",alias:(ve=le.alias)!=null&&ve.trim()?`${le.alias.trim()} copy`:""};try{const Me=await wf(pe,{});await p(),le.auth_kind==="password"&&x(Me??pe)}catch(Me){r.value=Me instanceof Error?Me.message:String(Me)}}async function Q(le){const pe=EW({user:le.user,host:le.host,port:le.port}),ve=typeof navigator>"u"?void 0:navigator.clipboard;if(ve!=null&&ve.writeText){await ve.writeText(pe);return}ma(pe)}const de=H(!1),De=H(null),Pe=H(null),Ye=H(""),st=H(""),yt=H("22"),ce=H(""),ae=H([]),be=H(""),he=H("password"),Le=H(""),et=H(""),je=H(""),_e=H("");function ie(){const le=Number.parseInt(_e.value.trim(),10);return Number.isFinite(le)&&le>0?le:0}const we=q(()=>je.value.split(` -`).filter(le=>le.trim()!=="").length);function Ee(){var le;De.value="",Pe.value=null,Ye.value="",st.value="",yt.value="22",ce.value="",ae.value=[],be.value="",he.value="password",Le.value="",et.value=((le=d.value[0])==null?void 0:le.id)??"",je.value="",_e.value="",Ze.value=[],de.value=!0}function x(le){var pe;De.value=le.id,Pe.value={...le},Ye.value=le.alias??"",st.value=le.host,yt.value=le.port||"22",ce.value=le.user,ae.value=Jl(le.tags??[]),be.value="",he.value=le.auth_kind,Le.value="",et.value=le.key_id??((pe=d.value[0])==null?void 0:pe.id)??"",je.value=le.startup_command??"",_e.value=le.startup_delay_ms?String(le.startup_delay_ms):"",Ze.value=wt(le.forwards),de.value=!0}function Re(){de.value=!1,De.value=null,Pe.value=null}const Xe=q(()=>st.value.trim()===""||ce.value.trim()===""?!1:he.value==="key"?et.value!=="":!0);async function Ue(){if(!Xe.value)return;r.value="";const le={alias:Ye.value.trim(),host:st.value.trim(),port:yt.value.trim()||"22",user:ce.value.trim(),tags:ae.value,auth_kind:he.value,key_id:he.value==="key"?et.value:void 0,startup_command:je.value,startup_delay_ms:ie(),forwards:wt(Ze.value)},pe={password:he.value==="password"?Le.value:void 0},ve=he.value==="password"&&Le.value!=="";try{De.value?await Vc({...Pe.value??{},id:De.value,...le},ve?pe:null):await wf({id:"",...le},pe),Re(),await p()}catch(Me){r.value=Me instanceof Error?Me.message:String(Me)}}async function xt(le){r.value="";try{await rS(le),await p()}catch(pe){r.value=pe instanceof Error?pe.message:String(pe)}}const Ze=H([]);function wt(le){return(le??[]).map(pe=>({id:pe.id,kind:pe.kind,bind_addr:pe.bind_addr??"",bind_port:pe.bind_port??"",target_host:pe.target_host??"",target_port:pe.target_port??"",note:pe.note??""}))}function tt(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`fwd-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function gt(){Ze.value=[...Ze.value,{id:tt(),kind:"local",bind_addr:"127.0.0.1",bind_port:"",target_host:"",target_port:"",note:""}]}function se(le){Ze.value=Ze.value.filter(pe=>pe.id!==le)}function ge(le,pe){le.kind=pe}function Oe(le){return s(le==="remote"?"ssh.forwards.kindRemoteHint":le==="dynamic"?"ssh.forwards.kindDynamicHint":"ssh.forwards.kindLocalHint")}function Ke(le){const pe=(le??"").trim().toLowerCase();if(pe===""||pe==="localhost"||pe==="::1"||pe==="[::1]")return!0;const ve=/^127\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(pe);return ve!==null&&ve.slice(1).every(Me=>Number(Me)<=255)}function Be(le){if(Ke(le.bind_addr))return"";const pe=(le.bind_addr??"").trim();return le.kind==="dynamic"?s("ssh.forwards.warnDynamic",{addr:pe}):le.kind==="remote"?s("ssh.forwards.warnRemote",{addr:pe}):s("ssh.forwards.warnLocal",{addr:pe})}const me=H([]),Fe=H("");function fe(le,pe){return`${le}/${pe}`}async function nt(){try{me.value=await cS()??[]}catch{}}const At=q(()=>{const le=new Map;for(const pe of me.value)le.set(fe(pe.host_id,pe.rule_id),pe);return le});function St(le,pe){return At.value.get(fe(le,pe))}function xe(le,pe){var ve;return((ve=St(le,pe))==null?void 0:ve.running)===!0}const qe=q(()=>a.value.filter(le=>{var pe;return(((pe=le.forwards)==null?void 0:pe.length)??0)>0})),ht=q(()=>me.value.filter(le=>le.running).length);function Et(le){return s(le==="remote"?"ssh.forwards.kindRemote":le==="dynamic"?"ssh.forwards.kindDynamic":"ssh.forwards.kindLocal")}function jt(le,pe){const ve=St(le.id,pe.id);return ve!=null&&ve.running&&ve.listen_addr?ve.listen_addr:`${(pe.bind_addr??"").trim()||"127.0.0.1"}:${(pe.bind_port??"").trim()}`}function Kt(le,pe){var Me;const ve=St(le.id,pe.id);return ve!=null&&ve.running?(Me=ve.target)!=null&&Me.trim()?ve.target:s("ssh.forwards.dynamicTarget"):pe.kind==="dynamic"?s("ssh.forwards.dynamicTarget"):`${(pe.target_host??"").trim()}:${(pe.target_port??"").trim()}`}function Yt(le,pe){const ve=St(le.id,pe.id);return ve?ve.running?s("ssh.forwards.stateRunning"):s("ssh.forwards.stateStopped"):s("ssh.forwards.stateIdle")}function nn(le,pe){const ve=St(le.id,pe.id);return ve?ve.running?"running":"stopped":"idle"}async function rn(le,pe){if(!(D(le)||Fe.value)){r.value="",Fe.value=fe(le.id,pe.id);try{await lS(le.id,pe.id)}catch(ve){r.value=ve instanceof Error?ve.message:String(ve)}finally{Fe.value="",await nt()}}}async function Mn(le,pe){if(!Fe.value){r.value="",Fe.value=fe(le.id,pe.id);try{await Sf(le.id,pe.id)}catch(ve){r.value=ve instanceof Error?ve.message:String(ve)}finally{Fe.value="",await nt()}}}function xn(){i.value="tunnels",nt()}const Xt=H(!1),Gt=H(""),Qt=H(""),an=H(!1),Ot=H(null),jn=q(()=>a.value.filter(le=>!D(le)).map(le=>({value:le.id,label:E(le)})));function is(){var le;r.value="",Qt.value="",Gt.value=((le=jn.value[0])==null?void 0:le.value)??"",Ot.value={id:tt(),kind:"local",bind_addr:"127.0.0.1",bind_port:"",target_host:"",target_port:"",note:""},Xt.value=!0}function An(le,pe){r.value="",Qt.value=pe.id,Gt.value=le.id,Ot.value=wt([pe])[0],Xt.value=!0}function Pn(){Xt.value=!1,Ot.value=null,Qt.value=""}const Rn=q(()=>{const le=Ot.value;return!le||Gt.value===""||(le.bind_port??"").trim()===""?!1:le.kind==="dynamic"?!0:(le.target_host??"").trim()!==""&&(le.target_port??"").trim()!==""});async function In(){const le=Ot.value;if(!Rn.value||!le||an.value)return;const pe=a.value.find(Jn=>Jn.id===Gt.value);if(!pe)return;r.value="",an.value=!0;const ve=wt([le])[0],Me=wt(pe.forwards),zt=Me.findIndex(Jn=>Jn.id===ve.id),On=zt>=0?Me.map((Jn,Nn)=>Nn===zt?ve:Jn):[...Me,ve];try{return await Vc({...pe,forwards:On},null),await p(),Pn(),{host:pe,rule:ve}}catch(Jn){r.value=Jn instanceof Error?Jn.message:String(Jn);return}finally{an.value=!1}}async function ke(){const le=await In();le&&await rn(le.host,le.rule)}async function Qe(le,pe){r.value="";try{St(le.id,pe.id)&&await Sf(le.id,pe.id),await Vc({...le,forwards:wt(le.forwards).filter(ve=>ve.id!==pe.id)},null),await p(),await nt()}catch(ve){r.value=ve instanceof Error?ve.message:String(ve)}}const ft=H(!1),It=H(null),ln=H(""),Nt=H(""),En=H(""),qn=H(!1),Ln=H(!1),Ts=H(!1);function Ws(){ln.value="",Nt.value="",En.value="",qn.value=!1,Ln.value=!1,Ts.value=!1}async function ei(){if(!(!It.value||Ts.value)){if(Ln.value){Ln.value=!1,Nt.value="",En.value="",qn.value=!1;return}r.value="",Ts.value=!0;try{const le=await Cf(It.value);Nt.value=le.private_key,En.value=le.passphrase??"",Ln.value=!0}catch(le){r.value=le instanceof Error?le.message:String(le)}finally{Ts.value=!1}}}async function ti(){if(It.value){r.value="";try{const le=Ln.value?Nt.value:(await Cf(It.value)).private_key,pe=typeof navigator>"u"?void 0:navigator.clipboard;pe!=null&&pe.writeText?await pe.writeText(le):ma(le)}catch(le){r.value=le instanceof Error?le.message:String(le)}}}function Ps(){It.value="",Ws(),ft.value=!0}function gi(){Re(),i.value="keys",Ps()}function mi(le){It.value=le.id,Ws(),ln.value=le.name,ft.value=!0}function Ii(){ft.value=!1,It.value=null}const $i=H(((Fi=(vr=window.matchMedia)==null?void 0:vr.call(window,"(hover: hover) and (pointer: fine)"))==null?void 0:Fi.matches)??!0),Oi=H(null),_i=H(!1);function Br(){var le;(le=Oi.value)==null||le.click()}async function dr(le){var Me;const pe=le.target,ve=(Me=pe.files)==null?void 0:Me[0];await yi(ve),pe.value=""}async function ur(le){var pe,ve;_i.value=!1,await yi((ve=(pe=le.dataTransfer)==null?void 0:pe.files)==null?void 0:ve[0])}async function yi(le){if(le){r.value="";try{const pe=await RW(le);Nt.value=pe.pem,qn.value=pe.encrypted,ln.value.trim()===""&&(ln.value=pe.suggestedName)}catch(pe){r.value=pe instanceof Error?pe.message:String(pe)}}}const us=q(()=>ln.value.trim()!==""&&(It.value?!0:Nt.value.trim()!==""));async function hr(){if(us.value){r.value="";try{It.value?await hS(It.value,ln.value.trim(),Nt.value,En.value):await uS(ln.value.trim(),Nt.value,En.value),Ii(),await p()}catch(le){r.value=le instanceof Error?le.message:String(le)}}}async function Hr(le){r.value="";try{await fS(le),await p()}catch(pe){r.value=pe instanceof Error?pe.message:String(pe)}}const hs=H(!1),bi=H(!1),ni=H(""),si=H(""),bn=H(null),_s=H(new Set),ys=H(!1),Es=H(null),Hn=q(()=>{var le;return((le=bn.value)==null?void 0:le.entries)??[]}),Yn=q(()=>{var le;return((le=bn.value)==null?void 0:le.skipped)??[]}),Do=q(()=>new Set(a.value.map(le=>le.alias).filter(Boolean)));function fs(le){return!!le.alias&&Do.value.has(le.alias)}function bs(le){return{...le}}async function Mo(){hs.value=!0,ni.value="",si.value="",Es.value=null,bn.value=null,_s.value=new Set,bi.value=!0;try{bn.value=await oS()}catch(le){ni.value=le instanceof Error?le.message:String(le)}finally{bi.value=!1}}function fr(){hs.value=!1}function Nr(le){const pe=new Set(_s.value);pe.has(le)?pe.delete(le):pe.add(le),_s.value=pe}const pr=q(()=>_s.value.size>0);async function Ao(){if(!(!bn.value||_s.value.size===0)){ys.value=!0,si.value="";try{const le=Hn.value.filter((ve,Me)=>_s.value.has(Me)).map(bs),pe=await aS(le);Es.value=pe,hs.value=!1,await p()}catch(le){si.value=le instanceof Error?le.message:String(le)}finally{ys.value=!1}}}return(le,pe)=>($(),F("div",{class:"ssh-overlay",onClick:pe[32]||(pe[32]=dt(ve=>le.$emit("close"),["self"]))},[b("div",AW,[b("header",IW,[b("div",$W,[b("button",{class:lt(["tab",{on:i.value==="hosts"}]),"data-test":"ssh-tab-hosts",onClick:pe[0]||(pe[0]=ve=>i.value="hosts")},[Te(C(Qr),{size:14}),ot(" "+L(C(s)("ssh.tabHosts"))+" ",1),b("span",OW,L(a.value.length),1)],2),b("button",{class:lt(["tab",{on:i.value==="keys"}]),"data-test":"ssh-tab-keys",onClick:pe[1]||(pe[1]=ve=>i.value="keys")},[Te(C(ja),{size:14}),ot(" "+L(C(s)("ssh.tabKeys"))+" ",1),b("span",FW,L(d.value.length),1)],2),b("button",{class:lt(["tab",{on:i.value==="tunnels"}]),"data-test":"ssh-tab-tunnels",onClick:xn},[Te(C(dl),{size:14}),ot(" "+L(C(s)("ssh.forwards.tab"))+" ",1),b("span",BW,L(ht.value),1)],2)]),i.value==="hosts"?($(),F("div",HW,[Te(C($g),{size:13,class:"search-icon"}),rt(b("input",{"onUpdate:modelValue":pe[2]||(pe[2]=ve=>o.value=ve),"data-test":"ssh-search",placeholder:C(s)("ssh.filterPlaceholder"),spellcheck:"false",autocomplete:"off"},null,8,NW),[[Tt,o.value]])])):($(),F("div",zW)),i.value==="hosts"?($(),F("button",{key:2,class:"new-btn ghost","data-test":"ssh-config-import-open",onClick:Mo},[Te(C(nf),{size:14}),ot(" "+L(C(s)("ssh.configImport.open")),1)])):Z("",!0),i.value==="hosts"?($(),F("button",{key:3,class:"new-btn","data-test":"ssh-new-host",onClick:Ee},[Te(C(Hi),{size:14}),ot(" "+L(C(s)("ssh.newHost")),1)])):i.value==="keys"?($(),F("button",{key:4,class:"new-btn","data-test":"ssh-key-new",onClick:Ps},[Te(C(Hi),{size:14}),ot(" "+L(C(s)("ssh.newKey")),1)])):($(),F(Ie,{key:5},[b("button",{class:"new-btn ghost","data-test":"ssh-tunnels-refresh",onClick:nt},[Te(C(Ig),{size:14}),ot(" "+L(C(s)("ssh.forwards.refresh")),1)]),b("button",{class:"new-btn","data-test":"ssh-tunnel-new",disabled:jn.value.length===0,title:jn.value.length===0?C(s)("ssh.forwards.newNeedsHost"):"",onClick:is},[Te(C(Hi),{size:14}),ot(" "+L(C(s)("ssh.forwards.new")),1)],8,UW)],64)),b("button",{class:"close-x",title:C(s)("common.close"),onClick:pe[3]||(pe[3]=ve=>le.$emit("close"))},[Te(C(ai),{size:16})],8,VW)]),r.value?($(),F("p",KW,L(r.value),1)):Z("",!0),W.value?($(),F("div",WW,[b("p",jW,L(C(s)("ssh.hostKey.title")),1),b("p",qW,L(z.value),1),b("code",YW,L(W.value.prompt.fingerprint),1),W.value.prompt.hopIndex>0?($(),F("p",GW,L(C(s)("ssh.hostKey.chainNote")),1)):Z("",!0),b("div",XW,[b("button",{"data-test":"ssh-host-reject-hostkey",onClick:j},L(C(s)("ssh.hostKey.reject")),1),b("button",{class:"new-btn","data-test":"ssh-host-accept-hostkey",onClick:V},L(C(s)("ssh.hostKey.accept")),1)])])):Z("",!0),Es.value!==null?($(),F("p",JW,L(C(s)("ssh.importedHosts",{count:Es.value})),1)):Z("",!0),rt(b("div",QW,[a.value.length===0?($(),F("div",ZW,[Te(C(Qr),{size:40,class:"empty-icon"}),b("p",ej,L(C(s)("ssh.hosts.emptyTitle")),1),b("p",tj,L(C(s)("ssh.hosts.emptySub")),1),b("button",{class:"new-btn ghost",onClick:Ee},[Te(C(Hi),{size:14}),ot(" "+L(C(s)("ssh.newHost")),1)])])):($(),F(Ie,{key:1},[y.value.length?($(),F("div",nj,[($(!0),F(Ie,null,at(y.value,ve=>($(),F("button",{key:ve,class:lt(["tag-pill",{on:m.value.includes(ve)}]),"data-test":`ssh-tag-filter-${ve}`,onClick:Me=>l(ve)},L(ve),11,sj))),128)),m.value.length?($(),F("button",{key:0,class:"tag-clear","data-test":"ssh-tag-filter-clear",onClick:h},[Te(C(ai),{size:11}),ot(" "+L(C(s)("ssh.hosts.clearTags")),1)])):Z("",!0)])):Z("",!0),v.value.length===0?($(),F("div",ij,[Te(C(Qr),{size:40,class:"empty-icon"}),b("p",rj,L(C(s)("ssh.hosts.noMatchTitle")),1),b("p",oj,L(C(s)("ssh.hosts.noMatchSub")),1)])):($(),F("div",aj,[($(!0),F(Ie,null,at(v.value,ve=>{var Me;return $(),F("article",{key:ve.id,class:lt(["card",{busy:c.value===ve.id}]),"data-test":`ssh-host-card-${ve.id}`,onDblclick:zt=>G(ve.id),onContextmenu:dt(zt=>re(zt,ve),["prevent"])},[b("div",cj,[ve.auth_kind==="key"?($(),bt(C(ja),{key:0,size:16})):($(),bt(C(Qr),{key:1,size:16}))]),b("div",dj,[b("div",uj,L(E(ve)),1),b("div",hj,L(R(ve)),1),I(ve)?($(),F("div",fj,[b("span",{class:lt(["proxy-badge",{blocked:D(ve)}]),"data-test":`ssh-host-proxy-${ve.id}`,title:U(ve)},L(O(ve)),11,pj)])):Z("",!0),(Me=ve.tags)!=null&&Me.length?($(),F("div",vj,[($(!0),F(Ie,null,at(ve.tags,zt=>($(),F("span",{key:zt,class:"card-tag","data-test":`ssh-host-tag-${ve.id}-${zt}`},L(zt),9,gj))),128))])):Z("",!0)]),b("div",mj,[b("button",{class:"act connect","data-test":`ssh-connect-${ve.id}`,disabled:c.value===ve.id||D(ve),title:U(ve)||C(s)("common.connect"),onClick:dt(zt=>G(ve.id),["stop"])},[Te(C(Sw),{size:13})],8,_j),b("button",{class:"act",title:C(s)("ssh.edit"),onClick:dt(zt=>x(ve),["stop"])},[Te(C(Bc),{size:13})],8,yj),b("button",{class:"act danger","data-test":`ssh-delete-${ve.id}`,title:C(s)("common.delete"),onClick:dt(zt=>xt(ve.id),["stop"])},[Te(C(qa),{size:13})],8,bj)])],42,lj)}),128))]))],64))],512),[[Ss,i.value==="hosts"]]),rt(b("div",wj,[d.value.length===0?($(),F("div",Sj,[Te(C(ja),{size:40,class:"empty-icon"}),b("p",Cj,L(C(s)("ssh.keys.emptyTitle")),1),b("p",kj,L(C(s)("ssh.keys.emptySub")),1),b("button",{class:"new-btn ghost",onClick:Ps},[Te(C(Hi),{size:14}),ot(" "+L(C(s)("ssh.newKey")),1)])])):($(),F("div",xj,[($(!0),F(Ie,null,at(d.value,ve=>($(),F("article",{key:ve.id,class:"card"},[b("div",Rj,[Te(C(ja),{size:16})]),b("div",Tj,[b("div",Pj,L(ve.name),1),b("div",Ej,L(ve.key_type?C(s)("ssh.keys.typeLabel",{type:ve.key_type}):C(s)("ssh.keys.genericSubtitle")),1)]),b("div",Lj,[b("button",{class:"act","data-test":`ssh-key-edit-${ve.id}`,title:C(s)("ssh.edit"),onClick:dt(Me=>mi(ve),["stop"])},[Te(C(Bc),{size:13})],8,Dj),b("button",{class:"act danger","data-test":`ssh-key-delete-${ve.id}`,title:C(s)("common.delete"),onClick:dt(Me=>Hr(ve.id),["stop"])},[Te(C(qa),{size:13})],8,Mj)])]))),128))]))],512),[[Ss,i.value==="keys"]]),rt(b("div",Aj,[qe.value.length===0?($(),F("div",Ij,[Te(C(dl),{size:40,class:"empty-icon"}),b("p",$j,L(C(s)("ssh.forwards.emptyTitle")),1),b("p",Oj,L(C(s)("ssh.forwards.emptySub")),1),jn.value.length?($(),F("button",{key:0,class:"new-btn ghost","data-test":"ssh-tunnel-new-empty",onClick:is},[Te(C(Hi),{size:14}),ot(" "+L(C(s)("ssh.forwards.new")),1)])):Z("",!0)])):Z("",!0),($(!0),F(Ie,null,at(qe.value,ve=>($(),F("section",{key:ve.id,class:"fwd-host","data-test":`ssh-tunnel-host-${ve.id}`},[b("header",Bj,[b("span",Hj,L(E(ve)),1),b("span",Nj,L(ve.user)+"@"+L(ve.host),1),I(ve)?($(),F("span",{key:0,class:lt(["proxy-badge",{blocked:D(ve)}]),"data-test":`ssh-tunnel-proxy-${ve.id}`,title:U(ve)},L(O(ve)),11,zj)):Z("",!0)]),D(ve)?($(),F("p",{key:0,class:"fwd-proxy-reason","data-test":`ssh-tunnel-proxy-reason-${ve.id}`},L(C(s)("ssh.forwards.proxyBlocked"))+" "+L(U(ve)),9,Uj)):Z("",!0),b("div",Vj,[($(!0),F(Ie,null,at(ve.forwards,Me=>{var zt,On,Jn;return $(),F("article",{key:Me.id,class:"card fwd-card","data-test":`ssh-tunnel-row-${ve.id}-${Me.id}`},[b("div",Wj,[Te(C(dl),{size:16})]),b("div",jj,[b("div",qj,[b("span",Yj,L(Et(Me.kind)),1),Me.note?($(),F("span",Gj,L(Me.note),1)):Z("",!0)]),b("div",Xj,L(jt(ve,Me))+" → "+L(Kt(ve,Me)),1),St(ve.id,Me.id)?($(),F("div",Jj,L(C(s)("ssh.forwards.conns",{count:((zt=St(ve.id,Me.id))==null?void 0:zt.conns)??0})),1)):Z("",!0),(On=St(ve.id,Me.id))!=null&&On.error?($(),F("p",{key:1,class:"fwd-row-error","data-test":`ssh-tunnel-error-${ve.id}-${Me.id}`},L((Jn=St(ve.id,Me.id))==null?void 0:Jn.error),9,Qj)):Z("",!0)]),b("div",Zj,[b("span",{class:lt(["fwd-state",nn(ve,Me)]),"data-test":`ssh-tunnel-state-${ve.id}-${Me.id}`},L(Yt(ve,Me)),11,eq),b("div",tq,[xe(ve.id,Me.id)?($(),F("button",{key:0,class:"act danger","data-test":`ssh-tunnel-stop-${ve.id}-${Me.id}`,title:C(s)("ssh.forwards.stop"),disabled:Fe.value!=="",onClick:Nn=>Mn(ve,Me)},[Te(C(bw),{size:13})],8,nq)):($(),F(Ie,{key:1},[b("button",{class:"act connect","data-test":`ssh-tunnel-start-${ve.id}-${Me.id}`,title:D(ve)?U(ve):C(s)("ssh.forwards.start"),disabled:D(ve)||Fe.value!=="",onClick:Nn=>rn(ve,Me)},[Te(C(mw),{size:13})],8,sq),St(ve.id,Me.id)?($(),F("button",{key:0,class:"act","data-test":`ssh-tunnel-dismiss-${ve.id}-${Me.id}`,title:C(s)("ssh.forwards.dismiss"),disabled:Fe.value!=="",onClick:Nn=>Mn(ve,Me)},[Te(C(ai),{size:13})],8,iq)):Z("",!0)],64)),b("button",{class:"act","data-test":`ssh-tunnel-edit-${ve.id}-${Me.id}`,title:C(s)("ssh.edit"),onClick:Nn=>An(ve,Me)},[Te(C(Bc),{size:13})],8,rq),b("button",{class:"act danger","data-test":`ssh-tunnel-delete-${ve.id}-${Me.id}`,title:C(s)("common.delete"),onClick:Nn=>Qe(ve,Me)},[Te(C(qa),{size:13})],8,oq)])])],8,Kj)}),128))])],8,Fj))),128))],512),[[Ss,i.value==="tunnels"]]),Te(Nm,{open:te.value.open,x:te.value.x,y:te.value.y,items:oe.value,onClose:ye,onSelect:K},null,8,["open","x","y","items"]),Te(ks,{name:"drawer"},{default:qt(()=>{var ve;return[de.value?($(),F("aside",aq,[b("div",lq,[b("span",null,L(De.value?C(s)("ssh.hostDrawer.titleEdit"):C(s)("ssh.hostDrawer.titleNew")),1),b("button",{class:"close-x",onClick:Re},[Te(C(ai),{size:15})])]),b("div",cq,[b("label",dq,[b("span",uq,L(C(s)("ssh.hostDrawer.address")),1),rt(b("input",{"data-test":"ssh-add-host","onUpdate:modelValue":pe[4]||(pe[4]=Me=>st.value=Me),placeholder:C(s)("ssh.hostDrawer.addressPlaceholder"),spellcheck:"false",autocomplete:"off"},null,8,hq),[[Tt,st.value]])]),b("div",fq,[b("label",pq,[b("span",vq,L(C(s)("ssh.hostDrawer.label")),1),rt(b("input",{"data-test":"ssh-add-alias","onUpdate:modelValue":pe[5]||(pe[5]=Me=>Ye.value=Me),placeholder:C(s)("ssh.hostDrawer.labelPlaceholder"),autocomplete:"off"},null,8,gq),[[Tt,Ye.value]])]),b("label",mq,[b("span",_q,L(C(s)("ssh.hostDrawer.port")),1),rt(b("input",{"data-test":"ssh-add-port","onUpdate:modelValue":pe[6]||(pe[6]=Me=>yt.value=Me),autocomplete:"off"},null,512),[[Tt,yt.value]])])]),b("label",yq,[b("span",bq,L(C(s)("ssh.hostDrawer.tags")),1),b("div",wq,[($(!0),F(Ie,null,at(ae.value,Me=>($(),F("span",{key:Me,class:"chip","data-test":`ssh-add-tag-chip-${Me}`},[ot(L(Me)+" ",1),b("button",{type:"button",class:"chip-x","data-test":`ssh-add-tag-remove-${Me}`,title:C(s)("ssh.hostDrawer.removeTag",{tag:Me}),onClick:dt(zt=>w(Me),["prevent"])},[Te(C(ai),{size:10})],8,Cq)],8,Sq))),128)),rt(b("input",{class:"tag-input","data-test":"ssh-add-tag-input","onUpdate:modelValue":pe[7]||(pe[7]=Me=>be.value=Me),placeholder:ae.value.length?"":C(s)("ssh.hostDrawer.tagsPlaceholder"),autocomplete:"off",spellcheck:"false",onFocus:pe[8]||(pe[8]=Me=>_.value=!0),onInput:pe[9]||(pe[9]=Me=>_.value=!0),onBlur:A,onKeydown:[Xn(dt(P,["prevent"]),["enter"]),Xn(dt(P,["prevent"]),[","]),Xn(T,["backspace"])]},null,40,kq),[[Tt,be.value]]),_.value&&S.value.length?($(),F("ul",xq,[($(!0),F(Ie,null,at(S.value,Me=>($(),F("li",{key:Me,class:"combo-opt","data-test":`ssh-tag-opt-${Me}`,onMousedown:dt(zt=>M(Me),["prevent"])},L(Me),41,Rq))),128))])):Z("",!0)])]),b("label",Tq,[b("span",Pq,L(C(s)("ssh.hostDrawer.username")),1),rt(b("input",{"data-test":"ssh-add-user","onUpdate:modelValue":pe[10]||(pe[10]=Me=>ce.value=Me),placeholder:C(s)("ssh.hostDrawer.usernamePlaceholder"),autocomplete:"off"},null,8,Eq),[[Tt,ce.value]])]),b("div",Lq,[b("button",{class:lt({on:he.value==="password"}),"data-test":"ssh-auth-password",onClick:pe[11]||(pe[11]=Me=>he.value="password")},L(C(s)("ssh.hostDrawer.authPassword")),3),b("button",{class:lt({on:he.value==="key"}),"data-test":"ssh-auth-key",onClick:pe[12]||(pe[12]=Me=>he.value="key")},L(C(s)("ssh.hostDrawer.authKey")),3)]),(ve=Pe.value)!=null&&ve.identity_file?($(),F("p",Dq,[b("span",Mq,L(C(s)("ssh.hostDrawer.identityFileLabel")),1),b("code",null,L(Pe.value.identity_file),1),b("span",Aq,L(C(s)("ssh.hostDrawer.identityFileHint")),1)])):Z("",!0),Pe.value&&I(Pe.value)?($(),F("p",Iq,L(U(Pe.value)),1)):Z("",!0),he.value==="password"?($(),F("label",$q,[b("span",Oq,[ot(L(C(s)("ssh.hostDrawer.password")),1),De.value?($(),F("em",Fq,L(C(s)("ssh.hostDrawer.keepBlank")),1)):Z("",!0)]),rt(b("input",{"data-test":"ssh-add-password",type:"password","onUpdate:modelValue":pe[13]||(pe[13]=Me=>Le.value=Me),autocomplete:"off"},null,512),[[Tt,Le.value]])])):($(),F(Ie,{key:3},[d.value.length?($(),F("label",Bq,[b("span",Hq,L(C(s)("ssh.hostDrawer.keyPicker")),1),b("div",Nq,[Te(ns,{modelValue:et.value,"onUpdate:modelValue":pe[14]||(pe[14]=Me=>et.value=Me),options:f.value,"aria-label":C(s)("ssh.hostDrawer.keyPickerAria")},null,8,["modelValue","options","aria-label"])])])):($(),F("div",zq,[b("p",Uq,L(C(s)("ssh.hostDrawer.noKeys")),1),b("button",{class:"btn primary sm","data-test":"ssh-host-add-key",onClick:gi},[Te(C(Hi),{size:13}),ot(" "+L(C(s)("ssh.hostDrawer.addKey")),1)])]))],64)),b("div",Vq,[b("div",Kq,[b("span",Wq,L(C(s)("ssh.startup.sectionTitle")),1)]),b("p",jq,L(C(s)("ssh.startup.sectionHint")),1),b("label",qq,[rt(b("textarea",{"data-test":"ssh-startup-command","onUpdate:modelValue":pe[15]||(pe[15]=Me=>je.value=Me),rows:"3",spellcheck:"false",autocomplete:"off",placeholder:C(s)("ssh.startup.placeholder")},null,8,Yq),[[Tt,je.value]])]),b("div",Gq,[b("label",Xq,[b("span",Jq,L(C(s)("ssh.startup.delay")),1),rt(b("input",{"data-test":"ssh-startup-delay","onUpdate:modelValue":pe[16]||(pe[16]=Me=>_e.value=Me),placeholder:String(1500),autocomplete:"off"},null,8,Qq),[[Tt,_e.value]])]),we.value?($(),F("p",Zq,L(C(s)("ssh.startup.steps",{count:we.value})),1)):Z("",!0)])]),b("div",eY,[b("div",tY,[b("span",nY,L(C(s)("ssh.forwards.sectionTitle")),1),b("button",{class:"btn sm",type:"button","data-test":"ssh-forward-add",onClick:dt(gt,["prevent"])},[Te(C(Hi),{size:13}),ot(" "+L(C(s)("ssh.forwards.add")),1)])]),b("p",sY,L(C(s)("ssh.forwards.sectionHint")),1),Ze.value.length===0?($(),F("p",iY,L(C(s)("ssh.forwards.noRules")),1)):Z("",!0),($(!0),F(Ie,null,at(Ze.value,Me=>($(),F("div",{key:Me.id,class:"fwd-rule","data-test":`ssh-forward-rule-${Me.id}`},[b("div",oY,[b("div",aY,[b("button",{type:"button",class:lt({on:Me.kind==="local"}),"data-test":`ssh-forward-kind-local-${Me.id}`,onClick:dt(zt=>ge(Me,"local"),["prevent"])},L(C(s)("ssh.forwards.kindLocal")),11,lY),b("button",{type:"button",class:lt({on:Me.kind==="remote"}),"data-test":`ssh-forward-kind-remote-${Me.id}`,onClick:dt(zt=>ge(Me,"remote"),["prevent"])},L(C(s)("ssh.forwards.kindRemote")),11,cY),b("button",{type:"button",class:lt({on:Me.kind==="dynamic"}),"data-test":`ssh-forward-kind-dynamic-${Me.id}`,onClick:dt(zt=>ge(Me,"dynamic"),["prevent"])},L(C(s)("ssh.forwards.kindDynamic")),11,dY)]),b("button",{type:"button",class:"act danger","data-test":`ssh-forward-remove-${Me.id}`,title:C(s)("ssh.forwards.remove"),onClick:dt(zt=>se(Me.id),["prevent"])},[Te(C(qa),{size:13})],8,uY)]),b("p",hY,L(Oe(Me.kind)),1),b("div",fY,[b("label",pY,[b("span",vY,L(C(s)("ssh.forwards.bindAddr")),1),rt(b("input",{"data-test":`ssh-forward-bind-addr-${Me.id}`,"onUpdate:modelValue":zt=>Me.bind_addr=zt,placeholder:"127.0.0.1",spellcheck:"false",autocomplete:"off"},null,8,gY),[[Tt,Me.bind_addr]])]),b("label",mY,[b("span",_Y,L(C(s)("ssh.forwards.bindPort")),1),rt(b("input",{"data-test":`ssh-forward-bind-port-${Me.id}`,"onUpdate:modelValue":zt=>Me.bind_port=zt,autocomplete:"off"},null,8,yY),[[Tt,Me.bind_port]])])]),Me.kind!=="dynamic"?($(),F("div",bY,[b("label",wY,[b("span",SY,L(C(s)("ssh.forwards.targetHost")),1),rt(b("input",{"data-test":`ssh-forward-target-host-${Me.id}`,"onUpdate:modelValue":zt=>Me.target_host=zt,spellcheck:"false",autocomplete:"off"},null,8,CY),[[Tt,Me.target_host]])]),b("label",kY,[b("span",xY,L(C(s)("ssh.forwards.targetPort")),1),rt(b("input",{"data-test":`ssh-forward-target-port-${Me.id}`,"onUpdate:modelValue":zt=>Me.target_port=zt,autocomplete:"off"},null,8,RY),[[Tt,Me.target_port]])])])):Z("",!0),b("label",TY,[b("span",PY,L(C(s)("ssh.forwards.label")),1),rt(b("input",{"data-test":`ssh-forward-note-${Me.id}`,"onUpdate:modelValue":zt=>Me.note=zt,placeholder:C(s)("ssh.forwards.labelPlaceholder"),autocomplete:"off"},null,8,EY),[[Tt,Me.note]])]),Be(Me)?($(),F("p",{key:1,class:"fwd-warn","data-test":`ssh-forward-bind-warning-${Me.id}`},L(Be(Me)),9,LY)):Z("",!0)],8,rY))),128))])]),b("div",DY,[b("button",{class:"btn ghost",onClick:Re},L(C(s)("common.cancel")),1),b("button",{class:"btn primary","data-test":"ssh-add-submit",disabled:!Xe.value,onClick:Ue},L(De.value?C(s)("common.save"):C(s)("ssh.hostDrawer.submitNew")),9,MY)])])):Z("",!0)]}),_:1}),Te(ks,{name:"drawer"},{default:qt(()=>[ft.value?($(),F("aside",AY,[b("div",IY,[b("span",null,L(It.value?C(s)("ssh.keyDrawer.titleEdit"):C(s)("ssh.keyDrawer.titleNew")),1),b("button",{class:"close-x",onClick:Ii},[Te(C(ai),{size:15})])]),b("div",$Y,[b("label",OY,[b("span",FY,L(C(s)("ssh.keyDrawer.name")),1),rt(b("input",{"data-test":"ssh-key-name","onUpdate:modelValue":pe[17]||(pe[17]=ve=>ln.value=ve),placeholder:C(s)("ssh.keyDrawer.namePlaceholder"),autocomplete:"off"},null,8,BY),[[Tt,ln.value]])]),b("label",HY,[b("span",NY,[b("span",null,[ot(L(C(s)("ssh.keyDrawer.pem")),1),It.value&&!Ln.value?($(),F("em",zY,L(C(s)("ssh.keyDrawer.keepBlank")),1)):Z("",!0)]),It.value?($(),F("span",UY,[b("button",{type:"button",class:"act","data-test":"ssh-key-reveal",disabled:Ts.value,title:Ln.value?C(s)("ssh.keyDrawer.hide"):C(s)("ssh.keyDrawer.reveal"),onClick:dt(ei,["prevent"])},[Ln.value?($(),bt(C(fw),{key:0,size:13})):($(),bt(C(Ag),{key:1,size:13}))],8,VY),b("button",{type:"button",class:"act","data-test":"ssh-key-copy",title:C(s)("ssh.keyDrawer.copy"),onClick:dt(ti,["prevent"])},[Te(C(hw),{size:13})],8,KY)])):Z("",!0)]),rt(b("textarea",{"data-test":"ssh-key-pem","onUpdate:modelValue":pe[18]||(pe[18]=ve=>Nt.value=ve),rows:"6",spellcheck:"false",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512),[[Tt,Nt.value]])]),b("label",WY,[b("span",jY,L(C(s)("ssh.keyDrawer.passphrase")),1),rt(b("input",{"data-test":"ssh-key-passphrase",type:"password","onUpdate:modelValue":pe[19]||(pe[19]=ve=>En.value=ve),autocomplete:"off"},null,512),[[Tt,En.value]])]),qn.value?($(),F("p",qY,L(C(s)("ssh.keyDrawer.encryptedHint")),1)):Z("",!0),b("div",YY,[b("input",{ref_key:"keyFileInput",ref:Oi,class:"file-input","data-test":"ssh-key-file-input",type:"file",onChange:dr},null,544),$i.value?($(),F("div",{key:0,class:lt(["dropzone",{over:_i.value}]),"data-test":"ssh-key-dropzone",onDragover:pe[20]||(pe[20]=dt(ve=>_i.value=!0,["prevent"])),onDragenter:pe[21]||(pe[21]=dt(ve=>_i.value=!0,["prevent"])),onDragleave:pe[22]||(pe[22]=ve=>_i.value=!1),onDrop:dt(ur,["prevent"])},[Te(C(pw),{size:20,class:"dropzone-icon"}),b("span",null,L(C(s)("ssh.keyDrawer.dropzone")),1)],34)):Z("",!0),b("button",{class:"btn import",type:"button","data-test":"ssh-key-import-btn",onClick:Br},[Te(C(ww),{size:13}),ot(" "+L(C(s)("ssh.keyDrawer.importFromFile")),1)])])]),b("div",GY,[b("button",{class:"btn ghost",onClick:Ii},L(C(s)("common.cancel")),1),b("button",{class:"btn primary","data-test":"ssh-key-submit",disabled:!us.value,onClick:hr},L(It.value?C(s)("common.save"):C(s)("ssh.keyDrawer.submitNew")),9,XY)])])):Z("",!0)]),_:1}),Te(ks,{name:"drawer"},{default:qt(()=>[Xt.value&&Ot.value?($(),F("aside",JY,[b("div",QY,[b("span",null,L(Qt.value?C(s)("ssh.forwards.drawerTitleEdit"):C(s)("ssh.forwards.drawerTitleNew")),1),b("button",{class:"close-x",onClick:Pn},[Te(C(ai),{size:15})])]),b("div",ZY,[b("label",eG,[b("span",tG,L(C(s)("ssh.forwards.hostPicker")),1),b("div",nG,[Te(ns,{modelValue:Gt.value,"onUpdate:modelValue":pe[23]||(pe[23]=ve=>Gt.value=ve),options:jn.value,disabled:Qt.value!=="","aria-label":C(s)("ssh.forwards.hostPickerAria")},null,8,["modelValue","options","disabled","aria-label"])])]),b("p",sG,L(C(s)("ssh.forwards.hostPickerHint")),1),b("div",iG,[b("button",{type:"button",class:lt({on:Ot.value.kind==="local"}),"data-test":"ssh-tunnel-kind-local",onClick:pe[24]||(pe[24]=dt(ve=>Ot.value.kind="local",["prevent"]))},L(C(s)("ssh.forwards.kindLocal")),3),b("button",{type:"button",class:lt({on:Ot.value.kind==="remote"}),"data-test":"ssh-tunnel-kind-remote",onClick:pe[25]||(pe[25]=dt(ve=>Ot.value.kind="remote",["prevent"]))},L(C(s)("ssh.forwards.kindRemote")),3),b("button",{type:"button",class:lt({on:Ot.value.kind==="dynamic"}),"data-test":"ssh-tunnel-kind-dynamic",onClick:pe[26]||(pe[26]=dt(ve=>Ot.value.kind="dynamic",["prevent"]))},L(C(s)("ssh.forwards.kindDynamic")),3)]),b("p",rG,L(Oe(Ot.value.kind)),1),b("div",oG,[b("label",aG,[b("span",lG,L(C(s)("ssh.forwards.bindAddr")),1),rt(b("input",{"data-test":"ssh-tunnel-bind-addr","onUpdate:modelValue":pe[27]||(pe[27]=ve=>Ot.value.bind_addr=ve),placeholder:"127.0.0.1",spellcheck:"false",autocomplete:"off"},null,512),[[Tt,Ot.value.bind_addr]])]),b("label",cG,[b("span",dG,L(C(s)("ssh.forwards.bindPort")),1),rt(b("input",{"data-test":"ssh-tunnel-bind-port","onUpdate:modelValue":pe[28]||(pe[28]=ve=>Ot.value.bind_port=ve),autocomplete:"off"},null,512),[[Tt,Ot.value.bind_port]])])]),Ot.value.kind!=="dynamic"?($(),F("div",uG,[b("label",hG,[b("span",fG,L(C(s)("ssh.forwards.targetHost")),1),rt(b("input",{"data-test":"ssh-tunnel-target-host","onUpdate:modelValue":pe[29]||(pe[29]=ve=>Ot.value.target_host=ve),spellcheck:"false",autocomplete:"off"},null,512),[[Tt,Ot.value.target_host]])]),b("label",pG,[b("span",vG,L(C(s)("ssh.forwards.targetPort")),1),rt(b("input",{"data-test":"ssh-tunnel-target-port","onUpdate:modelValue":pe[30]||(pe[30]=ve=>Ot.value.target_port=ve),autocomplete:"off"},null,512),[[Tt,Ot.value.target_port]])])])):Z("",!0),b("label",gG,[b("span",mG,L(C(s)("ssh.forwards.label")),1),rt(b("input",{"data-test":"ssh-tunnel-note","onUpdate:modelValue":pe[31]||(pe[31]=ve=>Ot.value.note=ve),placeholder:C(s)("ssh.forwards.labelPlaceholder"),autocomplete:"off"},null,8,_G),[[Tt,Ot.value.note]])]),Be(Ot.value)?($(),F("p",yG,L(Be(Ot.value)),1)):Z("",!0)]),b("div",bG,[b("button",{class:"btn ghost",onClick:Pn},L(C(s)("common.cancel")),1),b("button",{class:"btn","data-test":"ssh-tunnel-save-start",disabled:!Rn.value||an.value,onClick:ke},L(C(s)("ssh.forwards.saveAndStart")),9,wG),b("button",{class:"btn primary","data-test":"ssh-tunnel-save",disabled:!Rn.value||an.value,onClick:In},L(C(s)("common.save")),9,SG)])])):Z("",!0)]),_:1}),Te(ks,{name:"drawer"},{default:qt(()=>[hs.value?($(),F("aside",CG,[b("div",kG,[b("span",null,L(C(s)("ssh.configImport.title")),1),b("button",{class:"close-x",onClick:fr},[Te(C(ai),{size:15})])]),b("div",xG,[bi.value?($(),F("div",RG,[b("p",TG,L(C(s)("ssh.configImport.loading")),1)])):ni.value?($(),F("p",PG,L(ni.value),1)):bn.value?($(),F(Ie,{key:2},[Hn.value.length===0&&Yn.value.length===0?($(),F("div",EG,[Te(C(nf),{size:36,class:"empty-icon"}),b("p",LG,L(C(s)("ssh.configImport.emptyTitle")),1),b("p",DG,L(C(s)("ssh.configImport.emptySub")),1)])):($(),F(Ie,{key:1},[Hn.value.length?($(),F("p",MG,L(C(s)("ssh.configImport.importableTitle",{count:Hn.value.length})),1)):Z("",!0),Hn.value.length?($(),F("ul",AG,[($(!0),F(Ie,null,at(Hn.value,(ve,Me)=>($(),F("li",{key:`${ve.alias}-${Me}`,class:"config-entry"},[b("label",IG,[b("input",{type:"checkbox","data-test":`ssh-config-entry-check-${Me}`,checked:_s.value.has(Me),onChange:zt=>Nr(Me)},null,40,$G),b("span",OG,[b("span",FG,L(ve.alias||`${ve.user}@${ve.host}`),1),b("span",BG,L(ve.user)+"@"+L(ve.host)+L(ve.port&&ve.port!=="22"?`:${ve.port}`:""),1)]),b("span",HG,[fs(ve)?($(),F("span",{key:0,class:"overwrite-badge","data-test":`ssh-config-entry-overwrite-${Me}`,title:C(s)("ssh.configImport.overwriteTitle")},L(C(s)("ssh.configImport.overwriteBadge")),9,NG)):Z("",!0),I(ve)?($(),F("span",{key:1,class:lt(["proxy-badge",{blocked:D(ve)}]),"data-test":`ssh-config-entry-proxy-${Me}`,title:U(ve)},L(D(ve)?C(s)("ssh.configImport.proxyBadge",{label:O(ve)}):O(ve)),11,zG)):Z("",!0)])])]))),128))])):Z("",!0),Yn.value.length?($(),F(Ie,{key:2},[b("p",UG,L(C(s)("ssh.configImport.skippedTitle",{count:Yn.value.length})),1),b("ul",VG,[($(!0),F(Ie,null,at(Yn.value,(ve,Me)=>($(),F("li",{key:`${ve.alias}-${Me}`,class:"skip-row"},[b("span",KG,L(ve.alias),1),b("span",WG,L(ve.reason),1)]))),128))])],64)):Z("",!0)],64)),b("p",jG,L(bn.value.note),1)],64)):Z("",!0)]),b("div",qG,[si.value?($(),F("p",YG,L(si.value),1)):Z("",!0),b("div",GG,[b("button",{class:"btn ghost",onClick:fr},L(C(s)("common.cancel")),1),b("button",{class:"btn primary","data-test":"ssh-config-import-confirm",disabled:!pr.value||ys.value,onClick:Ao},L(ys.value?C(s)("ssh.configImport.importing"):C(s)("ssh.configImport.confirm",{count:_s.value.size})),9,XG)])])])):Z("",!0)]),_:1})])]))}}),ZG=Ct(QG,[["__scopeId","data-v-d1c3506a"]]),eX={class:"dialog"},tX={key:0},nX={class:"dim"},sX={key:1},iX={class:"dim"},rX={key:0,class:"warn"},oX={class:"row"},aX=Ae({__name:"ConfirmQuitDialog",props:{localCount:{},remoteCount:{}},emits:["confirm","cancel"],setup(e){const{t}=$t(),n=i=>i===1?"sessions.endLocalSessionOne":"sessions.endLocalSessionMany",s=i=>i===1?"sessions.detachRemoteSessionOne":"sessions.detachRemoteSessionMany";return(i,a)=>($(),F("div",{class:"backdrop",onClick:a[2]||(a[2]=dt(d=>i.$emit("cancel"),["self"]))},[b("div",eX,[b("h2",null,L(C(t)("sessions.quitTitle")),1),b("p",null,L(C(t)("sessions.closingWill")),1),b("ul",null,[i.localCount>0?($(),F("li",tX,[ot(L(C(t)(n(i.localCount),{count:i.localCount}))+" ",1),b("span",nX,L(C(t)("sessions.runningProcessesTerminated")),1)])):Z("",!0),i.remoteCount>0?($(),F("li",sX,[ot(L(C(t)(s(i.remoteCount),{count:i.remoteCount}))+" ",1),b("span",iX,L(C(t)("sessions.remotePtyKeepsRunning")),1)])):Z("",!0)]),i.localCount>0?($(),F("p",rX,L(C(t)("sessions.saveWorkFirst")),1)):Z("",!0),b("div",oX,[b("button",{onClick:a[0]||(a[0]=d=>i.$emit("cancel"))},L(C(t)("common.cancel")),1),b("button",{class:lt(["primary",{danger:i.localCount>0}]),onClick:a[1]||(a[1]=d=>i.$emit("confirm"))},L(C(t)("sessions.quit")),3)])])]))}}),lX=Ct(aX,[["__scopeId","data-v-380786e4"]]),cX={class:"startup-fatal","data-testid":"startup-fatal",role:"alert"},dX={class:"startup-fatal-panel"},uX={key:0,class:"startup-fatal-log"},hX={class:"startup-fatal-actions"},fX={key:1,class:"startup-fatal-copy-status"},pX=Ae({__name:"StartupFatalPanel",props:{fatal:{}},emits:["quit"],setup(e,{emit:t}){const n=e,s=t,{t:i}=$t(),a=H("");async function d(){var o;const r=["AT Term startup failed",n.fatal.message,n.fatal.log_path?`log: ${n.fatal.log_path}`:""].filter(Boolean).join(` -`);try{if(!((o=navigator.clipboard)!=null&&o.writeText))throw new Error("clipboard unavailable");await navigator.clipboard.writeText(r),a.value=i("app.startupFailureCopied")}catch{a.value=i("terminal.copyFailed")}}return(r,o)=>($(),F("div",cX,[b("section",dX,[b("h1",null,L(C(i)("app.startupFailureTitle")),1),b("p",null,L(C(i)("app.startupFailureIntro")),1),b("pre",null,L(r.fatal.message),1),r.fatal.log_path?($(),F("div",uX,[b("span",null,L(C(i)("app.startupFailureLogPath")),1),b("code",null,L(r.fatal.log_path),1)])):Z("",!0),b("div",hX,[b("button",{onClick:d},L(C(i)("app.startupFailureCopy")),1),b("button",{class:"danger",onClick:o[0]||(o[0]=c=>s("quit"))},L(C(i)("sessions.quit")),1)]),a.value?($(),F("p",fX,L(a.value),1)):Z("",!0)])]))}}),vX=Ct(pX,[["__scopeId","data-v-ad8304f2"]]),gX={class:"dialog",role:"dialog","aria-modal":"true"},mX={key:0},_X={key:1},yX={class:"row"},bX=Ae({__name:"ConfirmCloseSessionDialog",props:{title:{},isAi:{type:Boolean},isRunning:{type:Boolean},isRemote:{type:Boolean},count:{default:1}},emits:["confirm","cancel"],setup(e){const{t}=$t();return(n,s)=>($(),F("div",{class:"backdrop",onClick:s[2]||(s[2]=dt(i=>n.$emit("cancel"),["self"]))},[b("div",gX,[b("h2",null,L(C(t)("sessions.closeSessionTitle")),1),b("p",null,L(n.count>1?C(t)("sessions.closeSessionManyBody",{count:n.count}):C(t)("sessions.closeSessionBody",{title:n.title})),1),b("ul",null,[n.isAi?($(),F("li",mX,L(C(t)("sessions.closeAiSessionWarning")),1)):Z("",!0),n.isRunning?($(),F("li",_X,L(C(t)("sessions.closeRunningSessionWarning")),1)):Z("",!0),b("li",null,L(C(t)(n.isRemote?"sessions.closeRemoteDetachHint":"sessions.closeLocalTerminateHint")),1)]),b("div",yX,[b("button",{type:"button",onClick:s[0]||(s[0]=i=>n.$emit("cancel"))},L(C(t)("common.cancel")),1),b("button",{type:"button",class:"primary danger",onClick:s[1]||(s[1]=i=>n.$emit("confirm"))},L(C(t)("sessions.closeSessionConfirm")),1)])])]))}}),wX=Ct(bX,[["__scopeId","data-v-e95fa892"]]),SX={key:0,class:"recovery-dialog-backdrop",role:"dialog","aria-modal":"true"},CX={class:"recovery-dialog"},kX={class:"subtitle"},xX={class:"tab-list"},RX={class:"tab-row"},TX=["onUpdate:modelValue"],PX=["onClick"],EX={class:"tab-title"},LX={class:"tab-meta"},DX={key:0,class:"pane-list"},MX={class:"pane-shell"},AX={class:"pane-cwd"},IX={class:"pane-badge"},$X=["disabled"],OX=Ae({__name:"RecoveryDialog",props:{snapshot:{},open:{type:Boolean}},emits:["restore","discard"],setup(e,{emit:t}){const n=e,s=t,{t:i}=$t(),a=H({}),d=H({});Vs(()=>{if(n.snapshot)for(const v of n.snapshot.tabs)a.value[v.id]===void 0&&(a.value[v.id]=!0)});const r=q(()=>{const v=Math.floor(Date.now()/1e3),l=Math.max(0,v-n.snapshot.saved_at_unix);return Math.floor(l/60)}),o=q(()=>n.snapshot.clean_shutdown?i("recovery.dialog.subtitleClean",{minutes:r.value}):i("recovery.dialog.subtitleUnclean",{minutes:r.value})),c=q(()=>n.snapshot.tabs.filter(v=>a.value[v.id]).length),p=q(()=>n.snapshot.tabs.length),u=q(()=>c.value===p.value?i("recovery.dialog.btnRestoreAll",{count:p.value}):i("recovery.dialog.btnRestoreSelected",{count:c.value}));function g(v){var l,h;if(v.session_type!=="ai"&&v.last_command_line){const f=v.last_command_line.split(/\s+/)[0];if(f&&!["claude","codex","aider"].includes(f))return i("recovery.dialog.badgeUnclassified")}return v.session_type==="ai"?((l=v.ai)==null?void 0:l.kind)==="aider"||(h=v.ai)!=null&&h.session_id?i("recovery.dialog.badgeResumable"):i("recovery.dialog.badgeFresh"):i("recovery.dialog.badgeShell")}function m(v,l){var _;const h=l.panes[0],f=((_=h==null?void 0:h.last_cwd)==null?void 0:_.split("/").filter(Boolean).pop())??"";return`Tab ${v+1}`+(f?` · ${f}`:"")}function y(){const v=n.snapshot.tabs.filter(l=>a.value[l.id]);s("restore",v)}return(v,l)=>v.open?($(),F("div",SX,[b("div",CX,[b("header",null,[b("h2",null,L(C(i)("recovery.dialog.title")),1),b("p",kX,L(o.value),1)]),b("ul",xX,[($(!0),F(Ie,null,at(v.snapshot.tabs,(h,f)=>($(),F("li",{key:h.id},[b("label",RX,[rt(b("input",{type:"checkbox","onUpdate:modelValue":_=>a.value[h.id]=_},null,8,TX),[[ho,a.value[h.id]]]),b("button",{class:"caret",type:"button",onClick:_=>d.value[h.id]=!d.value[h.id]},L(d.value[h.id]?"▾":"▸"),9,PX),b("span",EX,L(m(f,h)),1),b("span",LX,L(h.panes.length)+" "+L(h.panes.length>1?"panes":"pane"),1)]),d.value[h.id]?($(),F("ul",DX,[($(!0),F(Ie,null,at(h.panes,_=>($(),F("li",{key:_.slot},[b("span",MX,L(_.shell.split("/").pop()||_.shell),1),b("span",AX,L(_.last_cwd),1),b("span",IX,L(g(_)),1)]))),128))])):Z("",!0)]))),128))]),b("footer",null,[b("button",{"data-testid":"btn-discard",class:"btn-secondary",onClick:l[0]||(l[0]=h=>s("discard"))},L(C(i)("recovery.dialog.btnDiscard")),1),b("button",{"data-testid":"btn-restore",class:"btn-primary",disabled:c.value===0,onClick:y},L(u.value),9,$X)])])])):Z("",!0)}}),FX=Ct(OX,[["__scopeId","data-v-4735cb7a"]]),BX={class:"startup-update-backdrop",role:"dialog","aria-modal":"true"},HX={class:"startup-update-dialog"},NX={class:"subtitle"},zX={class:"status"},UX={key:0,class:"notes"},VX=["disabled"],KX=["disabled"],WX=Ae({__name:"StartupUpdateDialog",emits:["dismiss","install"],setup(e,{emit:t}){const n=t,{t:s}=$t(),i=H(null),a=H(!1),d=H(!1);let r=null;Dt(async()=>{try{i.value=await fo()}catch{}r=window.setInterval(async()=>{try{i.value=await fo()}catch{}},2e3)}),Vt(()=>{r!==null&&window.clearInterval(r)});const o=q(()=>{const g=i.value;return g?g.error?g.error:g.ready?s("startupUpdate.statusReady",{version:g.latest}):g.downloading?s("startupUpdate.statusDownloading",{version:g.latest,pct:g.download_pct}):s("startupUpdate.statusAvailable",{version:g.latest}):""});async function c(){a.value=!0;try{await om()}catch{}finally{a.value=!1}}async function p(){d.value=!0;try{await am()}catch{}finally{d.value=!1}}async function u(){try{await lm(),n("install")}catch{}}return(g,m)=>{var y,v,l,h,f,_;return $(),F("div",BX,[b("div",HX,[b("header",null,[b("h2",null,L(C(s)("startupUpdate.title")),1),b("p",NX,L(C(s)("startupUpdate.currentToLatest",{current:((y=i.value)==null?void 0:y.current)??"",latest:((v=i.value)==null?void 0:v.latest)??""})),1)]),b("p",zX,L(o.value),1),(l=i.value)!=null&&l.notes?($(),F("details",UX,[b("summary",null,L(C(s)("startupUpdate.releaseNotes")),1),b("pre",null,L(i.value.notes),1)])):Z("",!0),b("footer",null,[b("button",{"data-testid":"startup-update-later",class:"btn-secondary",onClick:m[0]||(m[0]=S=>n("dismiss"))},L(C(s)("startupUpdate.later")),1),(h=i.value)!=null&&h.ready?($(),F("button",{key:0,"data-testid":"startup-update-install",class:"btn-primary",onClick:u},L(C(s)("startupUpdate.installRestart")),1)):(f=i.value)!=null&&f.downloading?($(),F("button",{key:1,"data-testid":"startup-update-cancel",class:"btn-primary danger",disabled:d.value,onClick:p},L(d.value?C(s)("startupUpdate.cancelling"):C(s)("startupUpdate.cancel",{pct:((_=i.value)==null?void 0:_.download_pct)??0})),9,VX)):($(),F("button",{key:2,"data-testid":"startup-update-download",class:"btn-primary",disabled:a.value,onClick:c},L(C(s)("startupUpdate.downloadInstall")),9,KX))])])])}}}),jX=Ct(WX,[["__scopeId","data-v-cb1e98fb"]]);function qX(e){const t=e.thresholdMs??3e3,n=e.mod;let s=null,i=!1;function a(){s!==null&&(clearTimeout(s),s=null)}function d(){i&&(i=!1,e.onHide())}function r(){s=null,i=!0,e.onShow()}function o(g){return!(g.key!==n||g.altKey||g.shiftKey||(n==="Meta"?g.ctrlKey:g.metaKey))}function c(g){if(o(g)){if(g.repeat||s!==null||i)return;s=setTimeout(r,t);return}a(),d()}function p(g){g.key===n&&(a(),d())}function u(){a(),d()}document.addEventListener("keydown",c,{capture:!0}),document.addEventListener("keyup",p,{capture:!0}),window.addEventListener("blur",u),Ql(()=>{a(),document.removeEventListener("keydown",c,{capture:!0}),document.removeEventListener("keyup",p,{capture:!0}),window.removeEventListener("blur",u)})}const YX={key:0,class:"hints-backdrop"},GX=["aria-label"],XX={class:"hints-header"},JX={class:"hints-group"},QX={class:"chord"},ZX={class:"label"},eJ={class:"hints-group"},tJ={class:"chord"},nJ={class:"label"},sJ=Ae({__name:"ShortcutHints",props:{mod:{},thresholdMs:{},bindings:{}},setup(e){function t(){return Xu()}const n=e,s=n.mod??t(),i=H(!1),{t:a}=$t();qX({mod:s,thresholdMs:n.thresholdMs??3e3,onShow:()=>{i.value=!0},onHide:()=>{i.value=!1}});const d=q(()=>Yy(n.bindings??{})),r=Di.filter(u=>u.group==="pane"),o=Di.filter(u=>u.group==="tab");function c(u){return GH(d.value[u.id]??"",s)}function p(u){return(d.value[u.id]??"")===""}return(u,g)=>($(),bt(ks,{name:"fade"},{default:qt(()=>[i.value?($(),F("div",YX,[b("div",{class:"hints-panel",role:"dialog","aria-label":C(a)("settings.shortcuts.keyboardShortcuts")},[b("div",XX,L(C(a)("settings.shortcuts.keyboardShortcuts")),1),b("section",JX,[b("h3",null,L(C(a)("settings.shortcuts.pane")),1),($(!0),F(Ie,null,at(C(r),m=>($(),F("div",{key:m.id,class:lt(["hint-row",{disabled:p(m)}])},[b("div",QX,L(p(m)?"—":c(m)),1),b("div",ZX,L(C(a)(m.labelKey)),1)],2))),128))]),b("section",eJ,[b("h3",null,L(C(a)("settings.shortcuts.tab")),1),($(!0),F(Ie,null,at(C(o),m=>($(),F("div",{key:m.id,class:lt(["hint-row",{disabled:p(m)}])},[b("div",tJ,L(p(m)?"—":c(m)),1),b("div",nJ,L(C(a)(m.labelKey)),1)],2))),128))])],8,GX)])):Z("",!0)]),_:1}))}}),iJ=Ct(sJ,[["__scopeId","data-v-f52d16ed"]]),rJ={class:"paste-preview-host"},oJ=["onMouseenter","onMouseleave"],aJ=["src","alt","onClick"],lJ={class:"paste-toast-name"},cJ=["aria-label","onClick"],dJ=["src","alt"],uJ=5e3,hJ=Ae({__name:"PasteImagePreviewHost",setup(e){const t=H([]),n=H(null),s=new Map;function i(y){const v=window.setTimeout(()=>r(y),uJ);s.set(y,v)}function a(y){const v=s.get(y);v!==void 0&&(window.clearTimeout(v),s.delete(y))}function d(y){let v;try{v=URL.createObjectURL(y.file)}catch(l){Lt("paste","preview createObjectURL failed",{error:Rt(l)});return}t.value.push({id:y.id,file:y.file,url:v,name:y.name}),i(y.id)}function r(y){a(y);const v=t.value.findIndex(h=>h.id===y);if(v===-1)return;const[l]=t.value.splice(v,1);URL.revokeObjectURL(l.url)}function o(y){a(y)}function c(y){t.value.some(v=>v.id===y)&&i(y)}function p(y){n.value&&URL.revokeObjectURL(n.value.url);try{n.value={url:URL.createObjectURL(y.file),name:y.name}}catch(v){Lt("paste","lightbox createObjectURL failed",{error:Rt(v)}),n.value=null}}function u(){n.value&&(URL.revokeObjectURL(n.value.url),n.value=null)}function g(y){y.key==="Escape"&&n.value&&u()}let m=null;return Dt(()=>{m=ca.on(d),document.addEventListener("keydown",g)}),Vt(()=>{m==null||m(),m=null,document.removeEventListener("keydown",g);for(const y of s.values())window.clearTimeout(y);s.clear();for(const y of t.value)URL.revokeObjectURL(y.url);t.value=[],n.value&&(URL.revokeObjectURL(n.value.url),n.value=null)}),(y,v)=>($(),F("div",rJ,[($(!0),F(Ie,null,at(t.value,l=>($(),F("div",{key:l.id,class:"paste-toast","data-testid":"paste-toast",onMouseenter:h=>o(l.id),onMouseleave:h=>c(l.id)},[b("img",{src:l.url,alt:l.name,class:"paste-toast-thumb",onClick:h=>p(l)},null,8,aJ),b("span",lJ,L(l.name),1),b("button",{type:"button",class:"paste-toast-close","data-testid":"paste-toast-close","aria-label":"close "+l.name,onClick:h=>r(l.id)},"×",8,cJ)],40,oJ))),128)),n.value?($(),F("div",{key:0,class:"paste-lightbox","data-testid":"paste-lightbox",onClick:u},[b("img",{src:n.value.url,alt:n.value.name,onClick:v[0]||(v[0]=dt(()=>{},["stop"]))},null,8,dJ)])):Z("",!0)]))}}),fJ=Ct(hJ,[["__scopeId","data-v-6eda1305"]]),pJ={class:"paste-file-host"},vJ={class:"paste-file-name"},gJ={class:"paste-file-size"},mJ=["aria-label","onClick"],_J=3e3,yJ=Ae({__name:"PasteFilePreviewHost",setup(e){const t=H([]),n=new Map;function s(c){return c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KiB`:`${(c/(1024*1024)).toFixed(1)} MiB`}function i(c){const p=window.setTimeout(()=>r(c),_J);n.set(c,p)}function a(c){const p=n.get(c);p!==void 0&&(window.clearTimeout(p),n.delete(c))}function d(c){t.value.push({id:c.id,name:c.name,size:c.size}),i(c.id)}function r(c){a(c);const p=t.value.findIndex(u=>u.id===c);p!==-1&&t.value.splice(p,1)}let o=null;return Dt(()=>{o=Zd.on(d)}),Vt(()=>{o==null||o(),o=null;for(const c of n.values())window.clearTimeout(c);n.clear(),t.value=[]}),(c,p)=>($(),F("div",pJ,[($(!0),F(Ie,null,at(t.value,u=>($(),F("div",{key:u.id,class:"paste-file-toast","data-testid":"paste-file-toast"},[p[0]||(p[0]=b("span",{class:"paste-file-icon"},"📎",-1)),b("span",vJ,L(u.name),1),b("span",gJ,"("+L(s(u.size))+")",1),b("button",{type:"button",class:"paste-file-close","data-testid":"paste-file-close","aria-label":"close "+u.name,onClick:g=>r(u.id)},"×",8,mJ)]))),128))]))}}),bJ=Ct(yJ,[["__scopeId","data-v-436c1298"]]),wJ=Ae({__name:"PluginHost",props:{slotId:{},context:{}},setup(e){const t=e,n=Fr(),{t:s}=$t(),i=ig([]),a=H(!1);async function d(){if(n.cfg&&!a.value){a.value=!0;try{const o=s_(t.slotId).filter(p=>n.isPluginEnabled(p.id)).filter(p=>p.slot!=="context-menu"&&p.slot!=="companion-window"),c=[];for(const p of o)try{const u=await p.load();c.push({descriptor:p,component:u.default})}catch(u){Ks("plugin","failed to load",{plugin:p.id,error:Rt(u)}),t.context.showToast(s("app.pluginFailedToLoad",{title:s(p.titleKey)}));try{await n.setEnabled(p.id,!1)}catch(g){Lt("plugin","disable-after-load-failure also failed",{plugin:p.id,error:Rt(g)})}}i.value=c}finally{a.value=!1}}}return Dt(async()=>{n.cfg||await n.load(),await d()}),_t(()=>n.cfg,()=>{d()},{deep:!0}),(r,o)=>($(),F("div",{class:lt(["plugin-host",`slot-${r.slotId}`])},[($(!0),F(Ie,null,at(i.value,c=>($(),bt(P0(c.component),{key:c.descriptor.id,context:r.context},null,8,["context"]))),128))],2))}}),Kv=Ct(wJ,[["__scopeId","data-v-db2df210"]]),Wv=3e4;function SJ(e,t={}){let n=!0;const s=t.transport??((a,d)=>fetch(a,d));async function i(a,d,r,o){var k,P,M;const c=e.baseUrl.replace(/\/+$/,"")+"/v1/chat/completions",p=`You are a translation engine. Detect the source language and translate to ${d}. Respond with strict JSON: {"detectedSrcLang":"","translated":""}. No commentary, no markdown.`,u=`You are a translation engine. Translate the following text to ${d}. Output ONLY the translation, no explanation, no quotes, no markdown.`,g={model:e.model,messages:[{role:"system",content:o?p:u},{role:"user",content:a}],temperature:.2};o&&(g.response_format={type:"json_object"});const m=CJ(e.extraParams);m&&Object.assign(g,m);const y=new AbortController,v=setTimeout(()=>y.abort(),Wv),l=()=>y.abort();r.addEventListener("abort",l);let h;try{h=await s(c,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},body:JSON.stringify(g),signal:y.signal})}catch(w){throw w instanceof DOMException&&w.name==="AbortError"?r.aborted?new Bs("aborted",on("plugins.translate.userCancelled")):new Bs("timeout",on("plugins.translate.requestTimedOut",{seconds:Wv/1e3})):new Bs("network",w instanceof Error?w.message:String(w))}finally{clearTimeout(v),r.removeEventListener("abort",l)}const f=await h.text();if(h.status===401||h.status===403)throw new Bs("auth",on("plugins.translate.authFailed",{status:h.status}),h.status,f.slice(0,200));if(h.status===429)throw new Bs("rate_limit",on("plugins.translate.rateLimited"),h.status,f.slice(0,200));if(h.status>=500)throw new Bs("server",on("plugins.translate.serverError",{status:h.status}),h.status,f.slice(0,200));if(h.status===400&&o&&/response_format|json_object/i.test(f))throw n=!1,new jv;if(!h.ok)throw new Bs("unknown",`HTTP ${h.status}`,h.status,f.slice(0,200));let _;try{_=JSON.parse(f)}catch{throw new Bs("parse",on("plugins.translate.providerNonJson"),h.status,f.slice(0,200))}const S=((M=(P=(k=_.choices)==null?void 0:k[0])==null?void 0:P.message)==null?void 0:M.content)??"";if(!o)return{translated:S.trim(),detectedSrcLang:"unknown"};try{const w=JSON.parse(S);if(typeof w.translated!="string")throw new Error(on("plugins.translate.missingTranslated"));const T=typeof w.detectedSrcLang=="string"?w.detectedSrcLang:"unknown";return{translated:w.translated,detectedSrcLang:T}}catch{return{translated:S,detectedSrcLang:"unknown"}}}return{async translate(a,d,r){try{return await i(a,d,r.signal,n)}catch(o){if(o instanceof jv)return await i(a,d,r.signal,!1);throw o}}}}class jv extends Error{constructor(){super(on("plugins.translate.responseFormatUnsupported"))}}function CJ(e){if(!e||!e.trim())return null;let t;try{t=JSON.parse(e)}catch(n){throw new Bs("unknown",on("plugins.translate.invalidExtraParams",{detail:n instanceof Error?n.message:String(n)}))}if(!t||typeof t!="object"||Array.isArray(t))throw new Bs("unknown",on("plugins.translate.invalidExtraParams",{detail:"must be JSON object"}));return t}const kJ={class:"translate-panel__handle"},xJ={class:"translate-panel__title"},RJ=["aria-label"],TJ={class:"translate-panel__source"},PJ={class:"translate-panel__label"},EJ={key:0,class:"translate-panel__detected"},LJ={class:"translate-panel__pre"},DJ={class:"translate-panel__target-row"},MJ={class:"translate-panel__label"},AJ={class:"translate-panel__target-select","data-testid":"translate-target"},IJ={class:"translate-panel__result"},$J={key:0,class:"translate-panel__loading"},OJ={key:1,class:"translate-panel__error",role:"alert"},FJ={key:2,class:"translate-panel__text"},BJ={key:3,class:"translate-panel__placeholder"},HJ={key:0,class:"translate-panel__history"},NJ=["onClick"],zJ={class:"translate-panel__history-source"},UJ={class:"translate-panel__history-translated"},VJ=Ae({__name:"TranslatePanel",setup(e){const t=Zu(),{t:n}=$t(),s=[{code:"zh-CN",labelKey:"plugins.translate.simplifiedChinese"},{code:"en",labelKey:"plugins.translate.targetEnglish"},{code:"ja",labelKey:"plugins.translate.targetJapanese"},{code:"ko",labelKey:"plugins.translate.targetKorean"},{code:"de",labelKey:"plugins.translate.targetGerman"},{code:"fr",labelKey:"plugins.translate.targetFrench"},{code:"es",labelKey:"plugins.translate.targetSpanish"}],i=q(()=>s.map(v=>({value:v.code,label:n(v.labelKey)}))),a=q({get:()=>t.targetLang,set:v=>{t.changeTarget(v)}}),d=H({x:-1,y:80}),r=H(!1),o=H({dx:0,dy:0});function c(v){if(v.target.closest(".translate-panel__handle")==null)return;r.value=!0;const h=v.currentTarget.getBoundingClientRect();o.value={dx:v.clientX-h.left,dy:v.clientY-h.top},d.value={x:h.left,y:h.top},v.preventDefault()}function p(v){r.value&&(d.value=g(v.clientX-o.value.dx,v.clientY-o.value.dy))}function u(){r.value=!1}function g(v,l){return{x:Math.max(8,Math.min(window.innerWidth-480-8,v)),y:Math.max(8,Math.min(window.innerHeight-320-8,l))}}window.addEventListener("mousemove",p),window.addEventListener("mouseup",u),nc(()=>{window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",u)});const m=q(()=>d.value.x<0?{left:`${Math.max(8,(window.innerWidth-480)/2)}px`,top:"80px"}:{left:`${d.value.x}px`,top:`${d.value.y}px`});function y(){t.retry()}return(v,l)=>{var h;return $(),bt(wl,{to:"body"},[C(t).visible?($(),F("div",{key:0,"data-testid":"translate-panel",class:"translate-panel",style:tn(m.value),onMousedown:c},[b("header",kJ,[b("span",xJ,L(C(n)("plugins.translate.title")),1),b("button",{type:"button",class:"translate-panel__close","data-testid":"translate-close","aria-label":C(n)("plugins.translate.closePanel"),onClick:l[0]||(l[0]=(...f)=>C(t).close&&C(t).close(...f))},"×",8,RJ)]),b("section",TJ,[b("div",PJ,[ot(L(C(n)("plugins.translate.source"))+" ",1),(h=C(t).result)!=null&&h.detectedSrcLang&&C(t).result.detectedSrcLang!=="unknown"?($(),F("span",EJ,"· "+L(C(n)("plugins.translate.detected",{lang:C(t).result.detectedSrcLang})),1)):Z("",!0)]),b("pre",LJ,L(C(t).source),1)]),b("section",DJ,[b("label",MJ,L(C(n)("plugins.translate.target")),1),b("div",AJ,[Te(ns,{modelValue:a.value,"onUpdate:modelValue":l[1]||(l[1]=f=>a.value=f),options:i.value,"aria-label":C(n)("plugins.translate.target")},null,8,["modelValue","options","aria-label"])])]),b("section",IJ,[C(t).loading?($(),F("div",$J,L(C(n)("plugins.translate.translating")),1)):C(t).error?($(),F("div",OJ,[b("div",null,L(C(t).error.message),1),b("button",{type:"button",onClick:y},L(C(n)("common.retry")),1)])):C(t).result?($(),F("div",FJ,L(C(t).result.translated),1)):($(),F("div",BJ,L(C(n)("plugins.translate.noResult")),1))]),C(t).history.length>0?($(),F("details",HJ,[b("summary",null,L(C(n)("plugins.translate.recent",{count:C(t).history.length})),1),b("ul",null,[($(!0),F(Ie,null,at(C(t).history,(f,_)=>($(),F("li",{key:_},[b("button",{type:"button",class:"translate-panel__history-row",onClick:S=>C(t).restoreFromHistory(f)},[b("span",zJ,L(f.source.slice(0,60)),1),l[2]||(l[2]=b("span",{class:"translate-panel__history-arrow"},"→",-1)),b("span",UJ,L(f.translated.slice(0,60)),1)],8,NJ)]))),128))])])):Z("",!0)],36)):Z("",!0)])}}}),KJ=Ct(VJ,[["__scopeId","data-v-be75a3d1"]]);var qv;(e=>{class t{constructor(o={}){Y(this,"in_per_sec");Y(this,"out_per_sec");typeof o=="string"&&(o=JSON.parse(o)),this.in_per_sec=o.in_per_sec,this.out_per_sec=o.out_per_sec}static createFrom(o={}){return new t(o)}}e.ByteStats=t;class n{constructor(o={}){Y(this,"at_ms");Y(this,"rtt_ms");typeof o=="string"&&(o=JSON.parse(o)),this.at_ms=o.at_ms,this.rtt_ms=o.rtt_ms}static createFrom(o={}){return new n(o)}}e.RTTSample=n;class s{constructor(o={}){Y(this,"last_ms");Y(this,"p50_ms");Y(this,"p95_ms");typeof o=="string"&&(o=JSON.parse(o)),this.last_ms=o.last_ms,this.p50_ms=o.p50_ms,this.p95_ms=o.p95_ms}static createFrom(o={}){return new s(o)}}e.RTTStats=s;class i{constructor(o={}){Y(this,"at_ms");Y(this,"reason");Y(this,"duration_ms");typeof o=="string"&&(o=JSON.parse(o)),this.at_ms=o.at_ms,this.reason=o.reason,this.duration_ms=o.duration_ms}static createFrom(o={}){return new i(o)}}e.ReconnectEvent=i;class a{constructor(o={}){Y(this,"count_last_hour");Y(this,"last_at_ms");Y(this,"last_reason");Y(this,"history");typeof o=="string"&&(o=JSON.parse(o)),this.count_last_hour=o.count_last_hour,this.last_at_ms=o.last_at_ms,this.last_reason=o.last_reason,this.history=this.convertValues(o.history,i)}static createFrom(o={}){return new a(o)}convertValues(o,c,p=!1){if(!o)return o;if(o.slice&&o.map)return o.map(u=>this.convertValues(u,c));if(typeof o=="object"){if(p){for(const u of Object.keys(o))o[u]=new c(o[u]);return o}return new c(o)}return o}}e.ReconnectStats=a;class d{constructor(o={}){Y(this,"state");Y(this,"rtt");Y(this,"rtt_samples");Y(this,"reconnect");Y(this,"bytes");Y(this,"seq_gaps");typeof o=="string"&&(o=JSON.parse(o)),this.state=o.state,this.rtt=this.convertValues(o.rtt,s),this.rtt_samples=this.convertValues(o.rtt_samples,n),this.reconnect=this.convertValues(o.reconnect,a),this.bytes=this.convertValues(o.bytes,t),this.seq_gaps=o.seq_gaps}static createFrom(o={}){return new d(o)}convertValues(o,c,p=!1){if(!o)return o;if(o.slice&&o.map)return o.map(u=>this.convertValues(u,c));if(typeof o=="object"){if(p){for(const u of Object.keys(o))o[u]=new c(o[u]);return o}return new c(o)}return o}}e.Snapshot=d})(qv||(qv={}));var Yv;(e=>{class t{constructor(s={}){Y(this,"AppID");Y(this,"AppSecret");Y(this,"EncryptKey");Y(this,"VerifyToken");typeof s=="string"&&(s=JSON.parse(s)),this.AppID=s.AppID,this.AppSecret=s.AppSecret,this.EncryptKey=s.EncryptKey,this.VerifyToken=s.VerifyToken}static createFrom(s={}){return new t(s)}}e.Credentials=t})(Yv||(Yv={}));var Gv;(e=>{class t{constructor(s={}){Y(this,"enabled");Y(this,"binary_path");Y(this,"binary_ok");Y(this,"binary_version");Y(this,"settings_path");Y(this,"settings_ok");Y(this,"last_error");Y(this,"last_check");typeof s=="string"&&(s=JSON.parse(s)),this.enabled=s.enabled,this.binary_path=s.binary_path,this.binary_ok=s.binary_ok,this.binary_version=s.binary_version,this.settings_path=s.settings_path,this.settings_ok=s.settings_ok,this.last_error=s.last_error,this.last_check=s.last_check}static createFrom(s={}){return new t(s)}}e.State=t})(Gv||(Gv={}));var Eu;(e=>{class t{constructor(x={}){Y(this,"kind");Y(this,"session_id");Y(this,"captured_at_unix");typeof x=="string"&&(x=JSON.parse(x)),this.kind=x.kind,this.session_id=x.session_id,this.captured_at_unix=x.captured_at_unix}static createFrom(x={}){return new t(x)}}e.AIInfo=t;class n{constructor(x={}){Y(this,"host");Y(this,"fingerprint");typeof x=="string"&&(x=JSON.parse(x)),this.host=x.host,this.fingerprint=x.fingerprint}static createFrom(x={}){return new n(x)}}e.AcceptedHostKey=n;class s{constructor(x={}){Y(this,"host_id");Y(this,"rule_id");Y(this,"kind");Y(this,"listen_addr");Y(this,"target");Y(this,"conns");Y(this,"started_at");Y(this,"running");Y(this,"error");typeof x=="string"&&(x=JSON.parse(x)),this.host_id=x.host_id,this.rule_id=x.rule_id,this.kind=x.kind,this.listen_addr=x.listen_addr,this.target=x.target,this.conns=x.conns,this.started_at=x.started_at,this.running=x.running,this.error=x.error}static createFrom(x={}){return new s(x)}}e.ActiveForward=s;class i{constructor(x={}){Y(this,"kind");Y(this,"text");Y(this,"filename");Y(this,"content_type");Y(this,"data_base64");Y(this,"reason");typeof x=="string"&&(x=JSON.parse(x)),this.kind=x.kind,this.text=x.text,this.filename=x.filename,this.content_type=x.content_type,this.data_base64=x.data_base64,this.reason=x.reason}static createFrom(x={}){return new i(x)}}e.ClipboardPastePayload=i;class a{constructor(x={}){Y(this,"atterm_export");Y(this,"exported_at");Y(this,"app_version");Y(this,"preferences");typeof x=="string"&&(x=JSON.parse(x)),this.atterm_export=x.atterm_export,this.exported_at=x.exported_at,this.app_version=x.app_version,this.preferences=x.preferences}static createFrom(x={}){return new a(x)}}e.ConfigExport=a;class d{constructor(x={}){Y(this,"default_shell");Y(this,"locale");Y(this,"terminal_theme");Y(this,"notifications_enabled");Y(this,"shell_integration_enabled");Y(this,"webgl_renderer_enabled");Y(this,"logging_enabled");Y(this,"log_file_path");Y(this,"auto_check_updates");Y(this,"command_notify_threshold_seconds");typeof x=="string"&&(x=JSON.parse(x)),this.default_shell=x.default_shell,this.locale=x.locale,this.terminal_theme=x.terminal_theme,this.notifications_enabled=x.notifications_enabled,this.shell_integration_enabled=x.shell_integration_enabled,this.webgl_renderer_enabled=x.webgl_renderer_enabled,this.logging_enabled=x.logging_enabled,this.log_file_path=x.log_file_path,this.auto_check_updates=x.auto_check_updates,this.command_notify_threshold_seconds=x.command_notify_threshold_seconds}static createFrom(x={}){return new d(x)}}e.ConfigSummary=d;class r{constructor(x={}){Y(this,"timestamp");Y(this,"message");typeof x=="string"&&(x=JSON.parse(x)),this.timestamp=x.timestamp,this.message=x.message}static createFrom(x={}){return new r(x)}}e.RelayErrorEntry=r;class o{constructor(x={}){Y(this,"generated_at");Y(this,"app_version");Y(this,"os");Y(this,"arch");Y(this,"os_version");Y(this,"webview_summary");Y(this,"user_agent");Y(this,"relay_url");Y(this,"relay_status");Y(this,"relay_token_redacted");Y(this,"allow_insecure_relay");Y(this,"remote_permission");Y(this,"uplink_paused");Y(this,"recent_relay_errors");Y(this,"config");typeof x=="string"&&(x=JSON.parse(x)),this.generated_at=x.generated_at,this.app_version=x.app_version,this.os=x.os,this.arch=x.arch,this.os_version=x.os_version,this.webview_summary=x.webview_summary,this.user_agent=x.user_agent,this.relay_url=x.relay_url,this.relay_status=x.relay_status,this.relay_token_redacted=x.relay_token_redacted,this.allow_insecure_relay=x.allow_insecure_relay,this.remote_permission=x.remote_permission,this.uplink_paused=x.uplink_paused,this.recent_relay_errors=this.convertValues(x.recent_relay_errors,r),this.config=this.convertValues(x.config,d)}static createFrom(x={}){return new o(x)}convertValues(x,Re,Xe=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ue=>this.convertValues(Ue,Re));if(typeof x=="object"){if(Xe){for(const Ue of Object.keys(x))x[Ue]=new Re(x[Ue]);return x}return new Re(x)}return x}}e.DiagnosticsPayload=o;class c{constructor(x={}){Y(this,"name");Y(this,"isDir");Y(this,"size");Y(this,"modTime");typeof x=="string"&&(x=JSON.parse(x)),this.name=x.name,this.isDir=x.isDir,this.size=x.size,this.modTime=x.modTime}static createFrom(x={}){return new c(x)}}e.DirEntry=c;class p{constructor(x={}){Y(this,"url");Y(this,"session_token");typeof x=="string"&&(x=JSON.parse(x)),this.url=x.url,this.session_token=x.session_token}static createFrom(x={}){return new p(x)}}e.Endpoint=p;class u{constructor(x={}){Y(this,"enabled");Y(this,"auto_attach");typeof x=="string"&&(x=JSON.parse(x)),this.enabled=x.enabled,this.auto_attach=x.auto_attach}static createFrom(x={}){return new u(x)}}e.FeishuRemoteTerminalSettings=u;class g{constructor(x={}){Y(this,"enabled");Y(this,"mode");Y(this,"bound");Y(this,"open_id");Y(this,"disabled");Y(this,"relay_disabled");Y(this,"error");Y(this,"configured");Y(this,"app_id");Y(this,"app_id_hash");Y(this,"callback_url");typeof x=="string"&&(x=JSON.parse(x)),this.enabled=x.enabled,this.mode=x.mode,this.bound=x.bound,this.open_id=x.open_id,this.disabled=x.disabled,this.relay_disabled=x.relay_disabled,this.error=x.error,this.configured=x.configured,this.app_id=x.app_id,this.app_id_hash=x.app_id_hash,this.callback_url=x.callback_url}static createFrom(x={}){return new g(x)}}e.FeishuStatusResp=g;class m{constructor(x={}){Y(this,"path");Y(this,"data");Y(this,"isBinary");Y(this,"truncatedAt");typeof x=="string"&&(x=JSON.parse(x)),this.path=x.path,this.data=x.data,this.isBinary=x.isBinary,this.truncatedAt=x.truncatedAt}static createFrom(x={}){return new m(x)}}e.FileContent=m;class y{constructor(x={}){Y(this,"enabled");Y(this,"panelWidthPx");Y(this,"panelCollapsed");Y(this,"innerTreeRatio");Y(this,"showHidden");Y(this,"showLineNumbers");typeof x=="string"&&(x=JSON.parse(x)),this.enabled=x.enabled,this.panelWidthPx=x.panelWidthPx,this.panelCollapsed=x.panelCollapsed,this.innerTreeRatio=x.innerTreeRatio,this.showHidden=x.showHidden,this.showLineNumbers=x.showLineNumbers}static createFrom(x={}){return new y(x)}}e.FileExplorerConfig=y;class v{constructor(x={}){Y(this,"path");Y(this,"size");Y(this,"modTime");Y(this,"isBinary");typeof x=="string"&&(x=JSON.parse(x)),this.path=x.path,this.size=x.size,this.modTime=x.modTime,this.isBinary=x.isBinary}static createFrom(x={}){return new v(x)}}e.FileMetaInfo=v;class l{constructor(x={}){Y(this,"id");Y(this,"kind");Y(this,"bind_addr");Y(this,"bind_port");Y(this,"target_host");Y(this,"target_port");Y(this,"note");typeof x=="string"&&(x=JSON.parse(x)),this.id=x.id,this.kind=x.kind,this.bind_addr=x.bind_addr,this.bind_port=x.bind_port,this.target_host=x.target_host,this.target_port=x.target_port,this.note=x.note}static createFrom(x={}){return new l(x)}}e.ForwardRule=l;class h{constructor(x={}){Y(this,"timestamp_ms");Y(this,"level");Y(this,"tag");Y(this,"message");typeof x=="string"&&(x=JSON.parse(x)),this.timestamp_ms=x.timestamp_ms,this.level=x.level,this.tag=x.tag,this.message=x.message}static createFrom(x={}){return new h(x)}}e.FrontendLogRecord=h;class f{constructor(x={}){Y(this,"host_id");Y(this,"host");Y(this,"user");typeof x=="string"&&(x=JSON.parse(x)),this.host_id=x.host_id,this.host=x.host,this.user=x.user}static createFrom(x={}){return new f(x)}}e.HostInfo=f;class _{constructor(x={}){Y(this,"key");Y(this,"action");Y(this,"detail");typeof x=="string"&&(x=JSON.parse(x)),this.key=x.key,this.action=x.action,this.detail=x.detail}static createFrom(x={}){return new _(x)}}e.ImportChange=_;class S{constructor(x={}){Y(this,"changes");Y(this,"skipped");typeof x=="string"&&(x=JSON.parse(x)),this.changes=this.convertValues(x.changes,_),this.skipped=x.skipped}static createFrom(x={}){return new S(x)}convertValues(x,Re,Xe=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ue=>this.convertValues(Ue,Re));if(typeof x=="object"){if(Xe){for(const Ue of Object.keys(x))x[Ue]=new Re(x[Ue]);return x}return new Re(x)}return x}}e.ImportPreview=S;class k{constructor(x={}){Y(this,"applied");Y(this,"skipped");typeof x=="string"&&(x=JSON.parse(x)),this.applied=this.convertValues(x.applied,_),this.skipped=x.skipped}static createFrom(x={}){return new k(x)}convertValues(x,Re,Xe=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ue=>this.convertValues(Ue,Re));if(typeof x=="object"){if(Xe){for(const Ue of Object.keys(x))x[Ue]=new Re(x[Ue]);return x}return new Re(x)}return x}}e.ImportReport=k;class P{constructor(x={}){Y(this,"host");Y(this,"fingerprint");typeof x=="string"&&(x=JSON.parse(x)),this.host=x.host,this.fingerprint=x.fingerprint}static createFrom(x={}){return new P(x)}}e.KnownHostEntry=P;class M{constructor(x={}){Y(this,"path");Y(this,"exists");Y(this,"truncated");Y(this,"content");typeof x=="string"&&(x=JSON.parse(x)),this.path=x.path,this.exists=x.exists,this.truncated=x.truncated,this.content=x.content}static createFrom(x={}){return new M(x)}}e.LogPreview=M;class w{constructor(x={}){Y(this,"enabled");Y(this,"path");Y(this,"effective_path");Y(this,"dev_dual_output");Y(this,"level");typeof x=="string"&&(x=JSON.parse(x)),this.enabled=x.enabled,this.path=x.path,this.effective_path=x.effective_path,this.dev_dual_output=x.dev_dual_output,this.level=x.level}static createFrom(x={}){return new w(x)}}e.LoggingConfig=w;class T{constructor(x={}){Y(this,"command");Y(this,"args");Y(this,"cwd");Y(this,"cols");Y(this,"rows");Y(this,"profile_id");Y(this,"ai_kind");Y(this,"initial_ai_session_id");Y(this,"initial_ai_command_line");typeof x=="string"&&(x=JSON.parse(x)),this.command=x.command,this.args=x.args,this.cwd=x.cwd,this.cols=x.cols,this.rows=x.rows,this.profile_id=x.profile_id,this.ai_kind=x.ai_kind,this.initial_ai_session_id=x.initial_ai_session_id,this.initial_ai_command_line=x.initial_ai_command_line}static createFrom(x={}){return new T(x)}}e.NewSessionReq=T;class A{constructor(x={}){Y(this,"session_id");typeof x=="string"&&(x=JSON.parse(x)),this.session_id=x.session_id}static createFrom(x={}){return new A(x)}}e.NewSessionResp=A;class E{constructor(x={}){Y(this,"token");Y(this,"expires_at");Y(this,"qr_url");Y(this,"wrapped");typeof x=="string"&&(x=JSON.parse(x)),this.token=x.token,this.expires_at=x.expires_at,this.qr_url=x.qr_url,this.wrapped=x.wrapped}static createFrom(x={}){return new E(x)}}e.PairingTokenResponse=E;class R{constructor(x={}){Y(this,"slot");Y(this,"remote");Y(this,"host_id");Y(this,"session_id");Y(this,"shell");Y(this,"shell_args");Y(this,"last_cwd");Y(this,"session_type");Y(this,"last_command_line");Y(this,"title");Y(this,"ai");typeof x=="string"&&(x=JSON.parse(x)),this.slot=x.slot,this.remote=x.remote,this.host_id=x.host_id,this.session_id=x.session_id,this.shell=x.shell,this.shell_args=x.shell_args,this.last_cwd=x.last_cwd,this.session_type=x.session_type,this.last_command_line=x.last_command_line,this.title=x.title,this.ai=this.convertValues(x.ai,t)}static createFrom(x={}){return new R(x)}convertValues(x,Re,Xe=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ue=>this.convertValues(Ue,Re));if(typeof x=="object"){if(Xe){for(const Ue of Object.keys(x))x[Ue]=new Re(x[Ue]);return x}return new Re(x)}return x}}e.PaneSnapshot=R;class D{constructor(x={}){Y(this,"enabled");Y(this,"aiOnly");Y(this,"collapsed");Y(this,"windowX");Y(this,"windowY");Y(this,"mutedUntilUnix");typeof x=="string"&&(x=JSON.parse(x)),this.enabled=x.enabled,this.aiOnly=x.aiOnly,this.collapsed=x.collapsed,this.windowX=x.windowX,this.windowY=x.windowY,this.mutedUntilUnix=x.mutedUntilUnix}static createFrom(x={}){return new D(x)}}e.WidgetConfig=D;class I{constructor(x={}){Y(this,"bindings");typeof x=="string"&&(x=JSON.parse(x)),this.bindings=x.bindings}static createFrom(x={}){return new I(x)}}e.ShortcutsConfig=I;class O{constructor(x={}){Y(this,"enabled");Y(this,"provider");Y(this,"baseUrl");Y(this,"apiKey");Y(this,"model");Y(this,"defaultTargetLang");Y(this,"extraParams");typeof x=="string"&&(x=JSON.parse(x)),this.enabled=x.enabled,this.provider=x.provider,this.baseUrl=x.baseUrl,this.apiKey=x.apiKey,this.model=x.model,this.defaultTargetLang=x.defaultTargetLang,this.extraParams=x.extraParams}static createFrom(x={}){return new O(x)}}e.TranslateConfig=O;class U{constructor(x={}){Y(this,"fileExplorer");Y(this,"translate");Y(this,"shortcuts");Y(this,"widget");typeof x=="string"&&(x=JSON.parse(x)),this.fileExplorer=this.convertValues(x.fileExplorer,y),this.translate=this.convertValues(x.translate,O),this.shortcuts=this.convertValues(x.shortcuts,I),this.widget=this.convertValues(x.widget,D)}static createFrom(x={}){return new U(x)}convertValues(x,Re,Xe=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ue=>this.convertValues(Ue,Re));if(typeof x=="object"){if(Xe){for(const Ue of Object.keys(x))x[Ue]=new Re(x[Ue]);return x}return new Re(x)}return x}}e.PluginConfig=U;class W{constructor(x={}){Y(this,"id");Y(this,"label");Y(this,"text");Y(this,"hotkey");typeof x=="string"&&(x=JSON.parse(x)),this.id=x.id,this.label=x.label,this.text=x.text,this.hotkey=x.hotkey}static createFrom(x={}){return new W(x)}}e.QuickTemplate=W;class N{constructor(x={}){Y(this,"name");Y(this,"bytes");Y(this,"received_at");typeof x=="string"&&(x=JSON.parse(x)),this.name=x.name,this.bytes=x.bytes,this.received_at=x.received_at}static createFrom(x={}){return new N(x)}}e.ReceivedFileEntry=N;class z{constructor(x={}){Y(this,"session_id");Y(this,"session_name");Y(this,"bytes");Y(this,"files");typeof x=="string"&&(x=JSON.parse(x)),this.session_id=x.session_id,this.session_name=x.session_name,this.bytes=x.bytes,this.files=this.convertValues(x.files,N)}static createFrom(x={}){return new z(x)}convertValues(x,Re,Xe=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ue=>this.convertValues(Ue,Re));if(typeof x=="object"){if(Xe){for(const Ue of Object.keys(x))x[Ue]=new Re(x[Ue]);return x}return new Re(x)}return x}}e.ReceivedFilesSessionEntry=z;class V{constructor(x={}){Y(this,"total_bytes");Y(this,"sessions");typeof x=="string"&&(x=JSON.parse(x)),this.total_bytes=x.total_bytes,this.sessions=this.convertValues(x.sessions,z)}static createFrom(x={}){return new V(x)}convertValues(x,Re,Xe=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ue=>this.convertValues(Ue,Re));if(typeof x=="object"){if(Xe){for(const Ue of Object.keys(x))x[Ue]=new Re(x[Ue]);return x}return new Re(x)}return x}}e.ReceivedFilesSummary=V;class j{constructor(x={}){Y(this,"id");Y(this,"layout");Y(this,"active_pane_idx");Y(this,"col_ratio");Y(this,"row_ratio");Y(this,"panes");typeof x=="string"&&(x=JSON.parse(x)),this.id=x.id,this.layout=x.layout,this.active_pane_idx=x.active_pane_idx,this.col_ratio=x.col_ratio,this.row_ratio=x.row_ratio,this.panes=this.convertValues(x.panes,R)}static createFrom(x={}){return new j(x)}convertValues(x,Re,Xe=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ue=>this.convertValues(Ue,Re));if(typeof x=="object"){if(Xe){for(const Ue of Object.keys(x))x[Ue]=new Re(x[Ue]);return x}return new Re(x)}return x}}e.TabSnapshot=j;class G{constructor(x={}){Y(this,"version");Y(this,"host_id");Y(this,"clean_shutdown");Y(this,"saved_at_unix");Y(this,"active_tab_id");Y(this,"tabs");typeof x=="string"&&(x=JSON.parse(x)),this.version=x.version,this.host_id=x.host_id,this.clean_shutdown=x.clean_shutdown,this.saved_at_unix=x.saved_at_unix,this.active_tab_id=x.active_tab_id,this.tabs=this.convertValues(x.tabs,j)}static createFrom(x={}){return new G(x)}convertValues(x,Re,Xe=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ue=>this.convertValues(Ue,Re));if(typeof x=="object"){if(Xe){for(const Ue of Object.keys(x))x[Ue]=new Re(x[Ue]);return x}return new Re(x)}return x}}e.RecoverySnapshot=G;class te{constructor(x={}){Y(this,"url");Y(this,"token");Y(this,"session_expires_at");Y(this,"allow_insecure_relay");Y(this,"disable_e2ee");Y(this,"remote_permission");Y(this,"last_email");Y(this,"connected");Y(this,"remote_proxy_url");Y(this,"remote_http_proxy_url");Y(this,"paused");typeof x=="string"&&(x=JSON.parse(x)),this.url=x.url,this.token=x.token,this.session_expires_at=x.session_expires_at,this.allow_insecure_relay=x.allow_insecure_relay,this.disable_e2ee=x.disable_e2ee,this.remote_permission=x.remote_permission,this.last_email=x.last_email,this.connected=x.connected,this.remote_proxy_url=x.remote_proxy_url,this.remote_http_proxy_url=x.remote_http_proxy_url,this.paused=x.paused}static createFrom(x={}){return new te(x)}}e.RelayConfig=te;class oe{constructor(x={}){Y(this,"user_id");Y(this,"email");Y(this,"is_admin");typeof x=="string"&&(x=JSON.parse(x)),this.user_id=x.user_id,this.email=x.email,this.is_admin=x.is_admin}static createFrom(x={}){return new oe(x)}}e.RelayMe=oe;class re{constructor(x={}){Y(this,"id_hash");Y(this,"user_agent");Y(this,"ip_prefix");Y(this,"created_at");Y(this,"expires_at");Y(this,"is_current");typeof x=="string"&&(x=JSON.parse(x)),this.id_hash=x.id_hash,this.user_agent=x.user_agent,this.ip_prefix=x.ip_prefix,this.created_at=x.created_at,this.expires_at=x.expires_at,this.is_current=x.is_current}static createFrom(x={}){return new re(x)}}e.RelaySessionRow=re;class ye{constructor(x={}){Y(this,"path");Y(this,"entries");Y(this,"truncated");Y(this,"total");typeof x=="string"&&(x=JSON.parse(x)),this.path=x.path,this.entries=this.convertValues(x.entries,c),this.truncated=x.truncated,this.total=x.total}static createFrom(x={}){return new ye(x)}convertValues(x,Re,Xe=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ue=>this.convertValues(Ue,Re));if(typeof x=="object"){if(Xe){for(const Ue of Object.keys(x))x[Ue]=new Re(x[Ue]);return x}return new Re(x)}return x}}e.SFTPListing=ye;class K{constructor(x={}){Y(this,"alias");Y(this,"reason");typeof x=="string"&&(x=JSON.parse(x)),this.alias=x.alias,this.reason=x.reason}static createFrom(x={}){return new K(x)}}e.SSHConfigImportSkipped=K;class J{constructor(x={}){Y(this,"id");Y(this,"alias");Y(this,"host");Y(this,"port");Y(this,"user");Y(this,"auth_kind");Y(this,"key_id");Y(this,"tags");Y(this,"note");Y(this,"startup_command");Y(this,"startup_delay_ms");Y(this,"identity_file");Y(this,"proxy_jump");Y(this,"proxy_command");Y(this,"forwards");typeof x=="string"&&(x=JSON.parse(x)),this.id=x.id,this.alias=x.alias,this.host=x.host,this.port=x.port,this.user=x.user,this.auth_kind=x.auth_kind,this.key_id=x.key_id,this.tags=x.tags,this.note=x.note,this.startup_command=x.startup_command,this.startup_delay_ms=x.startup_delay_ms,this.identity_file=x.identity_file,this.proxy_jump=x.proxy_jump,this.proxy_command=x.proxy_command,this.forwards=this.convertValues(x.forwards,l)}static createFrom(x={}){return new J(x)}convertValues(x,Re,Xe=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ue=>this.convertValues(Ue,Re));if(typeof x=="object"){if(Xe){for(const Ue of Object.keys(x))x[Ue]=new Re(x[Ue]);return x}return new Re(x)}return x}}e.SSHHost=J;class Q{constructor(x={}){Y(this,"entries");Y(this,"skipped");Y(this,"note");typeof x=="string"&&(x=JSON.parse(x)),this.entries=this.convertValues(x.entries,J),this.skipped=this.convertValues(x.skipped,K),this.note=x.note}static createFrom(x={}){return new Q(x)}convertValues(x,Re,Xe=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ue=>this.convertValues(Ue,Re));if(typeof x=="object"){if(Xe){for(const Ue of Object.keys(x))x[Ue]=new Re(x[Ue]);return x}return new Re(x)}return x}}e.SSHConfigImportPreview=Q;class de{constructor(x={}){Y(this,"host");Y(this,"port");Y(this,"user");Y(this,"auth_kind");Y(this,"password");Y(this,"private_key");Y(this,"passphrase");Y(this,"cols");Y(this,"rows");Y(this,"accepted_host_key_host");Y(this,"accepted_host_key_fingerprint");typeof x=="string"&&(x=JSON.parse(x)),this.host=x.host,this.port=x.port,this.user=x.user,this.auth_kind=x.auth_kind,this.password=x.password,this.private_key=x.private_key,this.passphrase=x.passphrase,this.cols=x.cols,this.rows=x.rows,this.accepted_host_key_host=x.accepted_host_key_host,this.accepted_host_key_fingerprint=x.accepted_host_key_fingerprint}static createFrom(x={}){return new de(x)}}e.SSHConnectReq=de;class De{constructor(x={}){Y(this,"id");Y(this,"name");Y(this,"key_type");typeof x=="string"&&(x=JSON.parse(x)),this.id=x.id,this.name=x.name,this.key_type=x.key_type}static createFrom(x={}){return new De(x)}}e.SSHKey=De;class Pe{constructor(x={}){Y(this,"private_key");Y(this,"passphrase");typeof x=="string"&&(x=JSON.parse(x)),this.private_key=x.private_key,this.passphrase=x.passphrase}static createFrom(x={}){return new Pe(x)}}e.SSHKeySecret=Pe;class Ye{constructor(x={}){Y(this,"service_id");Y(this,"client_ticket");Y(this,"client_to_host_key");Y(this,"host_to_client_key");Y(this,"port");Y(this,"path_prefix");typeof x=="string"&&(x=JSON.parse(x)),this.service_id=x.service_id,this.client_ticket=x.client_ticket,this.client_to_host_key=x.client_to_host_key,this.host_to_client_key=x.host_to_client_key,this.port=x.port,this.path_prefix=x.path_prefix}static createFrom(x={}){return new Ye(x)}}e.ServicePreviewMapping=Ye;class st{constructor(x={}){Y(this,"gateway_id");Y(this,"mapping_index");Y(this,"service_id");Y(this,"client_ticket");Y(this,"client_to_host_key");Y(this,"host_to_client_key");typeof x=="string"&&(x=JSON.parse(x)),this.gateway_id=x.gateway_id,this.mapping_index=x.mapping_index,this.service_id=x.service_id,this.client_ticket=x.client_ticket,this.client_to_host_key=x.client_to_host_key,this.host_to_client_key=x.host_to_client_key}static createFrom(x={}){return new st(x)}}e.ServicePreviewRebindRequest=st;class yt{constructor(x={}){Y(this,"mappings");Y(this,"service_id");Y(this,"client_ticket");Y(this,"client_to_host_key");Y(this,"host_to_client_key");typeof x=="string"&&(x=JSON.parse(x)),this.mappings=this.convertValues(x.mappings,Ye),this.service_id=x.service_id,this.client_ticket=x.client_ticket,this.client_to_host_key=x.client_to_host_key,this.host_to_client_key=x.host_to_client_key}static createFrom(x={}){return new yt(x)}convertValues(x,Re,Xe=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ue=>this.convertValues(Ue,Re));if(typeof x=="object"){if(Xe){for(const Ue of Object.keys(x))x[Ue]=new Re(x[Ue]);return x}return new Re(x)}return x}}e.ServicePreviewStartRequest=yt;class ce{constructor(x={}){Y(this,"id");Y(this,"url");typeof x=="string"&&(x=JSON.parse(x)),this.id=x.id,this.url=x.url}static createFrom(x={}){return new ce(x)}}e.ServicePreviewStartResponse=ce;class ae{constructor(x={}){Y(this,"id");Y(this,"name");Y(this,"shell");Y(this,"cwd");Y(this,"startup_cmd");Y(this,"env");Y(this,"sync_env");typeof x=="string"&&(x=JSON.parse(x)),this.id=x.id,this.name=x.name,this.shell=x.shell,this.cwd=x.cwd,this.startup_cmd=x.startup_cmd,this.env=x.env,this.sync_env=x.sync_env}static createFrom(x={}){return new ae(x)}}e.SessionProfile=ae;class be{constructor(x={}){Y(this,"deleted");typeof x=="string"&&(x=JSON.parse(x)),this.deleted=x.deleted}static createFrom(x={}){return new be(x)}}e.SignOutOthersResult=be;class he{constructor(x={}){Y(this,"fatal");Y(this,"message");Y(this,"log_path");typeof x=="string"&&(x=JSON.parse(x)),this.fatal=x.fatal,this.message=x.message,this.log_path=x.log_path}static createFrom(x={}){return new he(x)}}e.StartupError=he;class Le{constructor(x={}){Y(this,"state");Y(this,"last_synced_at");Y(this,"pending_keys");Y(this,"last_error");typeof x=="string"&&(x=JSON.parse(x)),this.state=x.state,this.last_synced_at=x.last_synced_at,this.pending_keys=x.pending_keys,this.last_error=x.last_error}static createFrom(x={}){return new Le(x)}}e.SyncStatus=Le;class et{constructor(x={}){Y(this,"baseUrl");Y(this,"apiKey");Y(this,"body");Y(this,"timeoutSeconds");typeof x=="string"&&(x=JSON.parse(x)),this.baseUrl=x.baseUrl,this.apiKey=x.apiKey,this.body=x.body,this.timeoutSeconds=x.timeoutSeconds}static createFrom(x={}){return new et(x)}}e.TranslateHTTPRequest=et;class je{constructor(x={}){Y(this,"status");Y(this,"body");typeof x=="string"&&(x=JSON.parse(x)),this.status=x.status,this.body=x.body}static createFrom(x={}){return new je(x)}}e.TranslateHTTPResponse=je;class _e{constructor(x={}){Y(this,"minor");Y(this,"latest");Y(this,"notes");Y(this,"asset_url");typeof x=="string"&&(x=JSON.parse(x)),this.minor=x.minor,this.latest=x.latest,this.notes=x.notes,this.asset_url=x.asset_url}static createFrom(x={}){return new _e(x)}}e.VersionLine=_e;class ie{constructor(x={}){Y(this,"current");Y(this,"latest");Y(this,"available");Y(this,"notes");Y(this,"checking");Y(this,"last_check_at");Y(this,"downloading");Y(this,"download_pct");Y(this,"ready");Y(this,"downloaded_exists");Y(this,"error");Y(this,"asset_url");Y(this,"asset_size");Y(this,"download_dir");Y(this,"download_path");Y(this,"lines");typeof x=="string"&&(x=JSON.parse(x)),this.current=x.current,this.latest=x.latest,this.available=x.available,this.notes=x.notes,this.checking=x.checking,this.last_check_at=x.last_check_at,this.downloading=x.downloading,this.download_pct=x.download_pct,this.ready=x.ready,this.downloaded_exists=x.downloaded_exists,this.error=x.error,this.asset_url=x.asset_url,this.asset_size=x.asset_size,this.download_dir=x.download_dir,this.download_path=x.download_path,this.lines=this.convertValues(x.lines,_e)}static createFrom(x={}){return new ie(x)}convertValues(x,Re,Xe=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ue=>this.convertValues(Ue,Re));if(typeof x=="object"){if(Xe){for(const Ue of Object.keys(x))x[Ue]=new Re(x[Ue]);return x}return new Re(x)}return x}}e.UpdateState=ie;class we{constructor(x={}){Y(this,"password");typeof x=="string"&&(x=JSON.parse(x)),this.password=x.password}static createFrom(x={}){return new we(x)}}e.sshCredential=we})(Eu||(Eu={}));const WJ=Ae({__name:"TranslatePanelHost",setup(e){const t=Zu(),n=Fr(),s=hn(),i=q(()=>{var d;return((d=n.cfg)==null?void 0:d.translate)??null});function a(d){return async(r,o)=>{const c=Eu.TranslateHTTPRequest.createFrom({baseUrl:d.baseUrl,apiKey:d.apiKey,body:o.body,timeoutSeconds:30}),p=await AR(c);return new Response(p.body,{status:p.status,headers:{"Content-Type":"application/json"}})}}return Vs(()=>{const d=i.value;if(!d||!d.apiKey||!d.baseUrl||!d.model){t.configure({provider:{translate:async()=>{throw new Error(on("plugins.translate.notConfigured"))}},defaultTargetLang:(d==null?void 0:d.defaultTargetLang)||"zh-CN"});return}const r=SJ({baseUrl:d.baseUrl,apiKey:d.apiKey,model:d.model,extraParams:d.extraParams},s.caps.wailsBindings?{transport:a({baseUrl:d.baseUrl,apiKey:d.apiKey})}:void 0);t.configure({provider:r,defaultTargetLang:d.defaultTargetLang})}),(d,r)=>($(),bt(KJ))}});function jJ(e){const t=q(()=>{var o;return((o=e.activePane.value)==null?void 0:o.sessionId)??null}),n=q(()=>{var o;return!!((o=e.activePane.value)!=null&&o.remote)}),s=q(()=>{const o=e.activePane.value;return o?e.sessionConnectionForPane(o):null}),i=q(()=>{const o=e.activePane.value;return o?e.endpointForPane(o):null}),a=q(()=>{const o=e.activePane.value;if(!o)return null;const c=e.sessionInfoForPane(o);return(c==null?void 0:c.cwd)??null});function d(o){const c=e.activePane.value;if(!c||!c.sessionId){e.showToast(on("app.noActiveSession"));return}const p=e.endpointForPane(c);if(!p){e.showToast(on("app.noEndpoint"));return}e.sendToSession(c.sessionId,p,o)}const r=q(()=>e.terminalThemeId.value);return{activePane:e.activePane,activeSessionId:t,activeIsRemote:n,activeSessionConnection:s,activeEndpoint:i,activeCwd:a,terminalThemeId:r,send:d,showToast:e.showToast}}const Xv=new Map;function qJ(e,t){return`${e.url}|${t}`}function YJ(e,t,n){const s=qJ(e,t);let i=Xv.get(s);i||(i=new Qg(e,t,{}),Xv.set(s,i),i.attach()),i.sendInput(n)}function GJ(e,t,n,s){if(t===n)return e;const i=e.slice(),a=i.findIndex(c=>c.id===t);if(a<0)return e;const[d]=i.splice(a,1),r=i.findIndex(c=>c.id===n);if(r<0)return i.push(d),i;const o=s==="after"?r+1:r;return i.splice(o,0,d),i}function XJ(e,t,n,s,i){const a=e.find(c=>c.id===s);if(!a)return null;const d=[];for(const c of a.panes)c.sessionId&&!c.remote&&d.push(c.sessionId);const r=i!=null&&i.detachOnly?[]:d.slice(),o=new Set(r);return{localIdsToClose:r,nextTabs:e.filter(c=>c.id!==s),nextLocalList:o.size===0?t:t.filter(c=>!o.has(c.id)),wasCurrent:n===s}}function JJ(e,t,n){const s=new Set(n),i=[];for(const a of e){if(!s.has(a.id))continue;a.panes.some(r=>r.sessionId&&(r.remote||t.has(r.sessionId)))||i.push(a.id)}return i}let Pr=null,wa=null,Mi=null,Pi=null;function QJ(){return new Promise(e=>{Pi=document.createElement("div"),Pi.style.cssText="position:fixed;top:0;left:0;width:0;height:0;overflow:hidden;pointer-events:none;visibility:hidden;",Mi=document.createElement("div"),Mi.style.cssText="position:absolute;top:0;left:0;width:400px;height:300px;",Pi.appendChild(Mi),document.body.appendChild(Pi),Pr=new Wm.Terminal({fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",fontSize:13,allowProposedApi:!0}),wa=new qm.FitAddon,Pr.loadAddon(wa),Pr.open(Mi),requestAnimationFrame(()=>e())})}function ZJ(){Pr==null||Pr.dispose(),Pi&&Pi.parentElement&&Pi.parentElement.removeChild(Pi),Pr=null,wa=null,Mi=null,Pi=null}function eQ(e,t){if(!wa||!Mi)return{cols:80,rows:24};Mi.style.width=`${Math.max(40,Math.floor(e))}px`,Mi.style.height=`${Math.max(40,Math.floor(t))}px`,Mi.offsetWidth;const n=wa.proposeDimensions();return!n||!n.cols||!n.rows?{cols:80,rows:24}:{cols:n.cols,rows:n.rows}}function al(e){const t=document.querySelector(".main");if(!t||t.clientWidth<100||t.clientHeight<100)return{cols:80,rows:24};const n=e==="vertical"||e==="grid2x2"?2:1,s=e==="horizontal"||e==="grid2x2"?2:1,i=(t.clientWidth-(n-1)*2)/n,a=(t.clientHeight-(s-1)*2)/s;return eQ(i,a)}function tQ(e){let t=0,n=0,s=0,i=0,a=0;function d(c){s=c.clientX,i=c.clientY,!a&&(a=requestAnimationFrame(()=>{a=0,e.onDrag(t-s,n-i),t=s,n=i}))}function r(){var c;window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",r),a&&cancelAnimationFrame(a),a=0,(c=e.onEnd)==null||c.call(e)}function o(c){t=c.clientX,n=c.clientY,s=t,i=n,c.preventDefault(),window.addEventListener("mousemove",d),window.addEventListener("mouseup",r)}return{onMouseDown:o}}function nQ(e){const t=Fr(),n=r_(),s=q(()=>{var u;return((u=t.cfg)==null?void 0:u.fileExplorer.panelWidthPx)??380}),i=H(null),a=q(()=>i.value??s.value),d=q({get:()=>{var u;return((u=t.cfg)==null?void 0:u.fileExplorer.panelCollapsed)??!0},set:u=>{if(!t.cfg)return;const g=JSON.parse(JSON.stringify(t.cfg));g.fileExplorer.panelCollapsed=u,t.save(g)}});function r(){d.value=!d.value}_t(()=>n.pending,async u=>{u&&(t.isPluginEnabled("file-explorer")||await t.setEnabled("file-explorer",!0),d.value&&(d.value=!1))});const o=q(()=>t.isPluginEnabled("file-explorer")),c=q(()=>Y4(e.terminalThemeId.value)?"light":"dimmed"),{onMouseDown:p}=tQ({onDrag:u=>{const g=i.value??s.value,m=Math.max(240,Math.min(g+u,window.innerWidth*.7));i.value=m},onEnd:()=>{if(i.value===null||!t.cfg){i.value=null;return}const u=JSON.parse(JSON.stringify(t.cfg));u.fileExplorer.panelWidthPx=i.value,t.save(u),i.value=null}});return{panelWidth:a,panelCollapsed:d,togglePanel:r,onPanelResizeDown:p,rightPanelHasPlugin:o,fileExplorerTheme:c}}function sQ(e,t,n,s){var i,a;return{command:e.shell||s||"/bin/sh",args:e.shell_args??[],cwd:e.last_cwd??"",cols:t,rows:n,ai_kind:((i=e.ai)==null?void 0:i.kind)??"",initial_ai_session_id:((a=e.ai)==null?void 0:a.session_id)??"",initial_ai_command_line:e.last_command_line??""}}function yl(e){return{id:e.session_id??"",command:e.shell??"",cwd:e.last_cwd??"",title:e.title??"",cols:0,rows:0,started_at:0,host_id:e.host_id??"",type:e.session_type??"",current_command:e.last_command_line??""}}const Jv="atterm.web.window_id",Zy="atterm.web.tabs.v1.";function iQ(){if(crypto!=null&&crypto.randomUUID)return crypto.randomUUID();const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=Array.from(e,n=>n.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function eb(){let e=sessionStorage.getItem(Jv);return e||(e=iQ(),sessionStorage.setItem(Jv,e)),e}function rQ(){const e=Zy+eb();try{const t=localStorage.getItem(e);return t?JSON.parse(t):null}catch{return null}}function oQ(e){const t=Zy+eb();localStorage.setItem(t,JSON.stringify(e))}function Qv(e){const t=/^#\/session\/([^?]+)(?:\?(.*))?$/.exec(e);if(!t)return{sid:null,focus:void 0,permission:void 0};const n=decodeURIComponent(t[1]),s=new URLSearchParams(t[2]??""),i=s.get("focus")==="input"?"input":void 0,a=s.get("permission")==="view"?"view":void 0;return{sid:n,focus:i,permission:a}}function aQ(e,t){const s=new URLSearchParams().toString();return`#/session/${encodeURIComponent(e)}${s?"?"+s:""}`}function lQ(e){const{enabled:t,tabs:n,currentTabId:s,currentTab:i,gotoTab:a,openRemoteAsTab:d,newId:r}=e;let o=null;function c(){o&&clearTimeout(o),o=setTimeout(()=>{o=null,oQ({tabs:n.value.map(m=>({id:m.id,layout:m.layout,active_pane_idx:m.activePaneIdx,col_ratio:m.colRatio,row_ratio:m.rowRatio,panes:m.panes.map((y,v)=>{var l,h;return{slot:v,session_id:y.sessionId??"",host_id:(l=y.lastSeenInfo)==null?void 0:l.host_id,sealed:(h=y.lastSeenInfo)==null?void 0:h.sealed}}).filter(y=>y.session_id)})),active_tab_id:s.value??""})},300)}function p(){const{sid:m}=Qv(location.hash);m&&d(m)}t&&(_t(i,m=>{const y=m==null?void 0:m.panes[m.activePaneIdx],v=(y==null?void 0:y.sessionId)??"",l=v?aQ(v):"#/";location.hash!==l&&history.replaceState({},"",l)}),_t(n,()=>{c()},{deep:!0}),Dt(()=>{window.addEventListener("hashchange",p)}),nc(()=>{window.removeEventListener("hashchange",p),o!==null&&window.clearTimeout(o)}));function u(m){const y=["single","vertical","horizontal","grid2x2"],v=[];let l=-1;for(const h of m.tabs){const f=y.includes(h.layout)?h.layout:"single",_={id:r(),layout:f,activePaneIdx:h.active_pane_idx,colRatio:h.col_ratio??Ds,rowRatio:h.row_ratio??Ds,panes:[]},S=th[f];for(let k=0;kM.slot===k);if(!P||!P.session_id){_.panes[k]={sessionId:null,remote:!1};continue}_.panes[k]={sessionId:P.session_id,remote:!0,lastSeenInfo:yl({slot:P.slot,host_id:P.host_id,session_id:P.session_id,shell:""})}}h.id===m.active_tab_id&&(l=v.length),n.value.push(_),v.push(_.id)}l>=0&&v[l]?a(v[l]):v.length>0&&a(v[0])}function g(){const m=rQ();if(m&&m.tabs.length>0)return u(m),!0;const{sid:y}=Qv(location.hash);return y?(d(y),!0):!1}return{tryRestoreOnBoot:g}}function cQ(e){return e.current_command||e.title||e.session_id.slice(0,8)}function dQ(e){const{isOpenRemoteSession:t}=e,n=H(null),s=H([]);let i=null;function a(v){return v.type==="ai"||v.task_state==="running"}function d(v){return!t(v.session_id)&&a(v)}const r=q(()=>{if(s.value.length>1)return"";const v=n.value;return v?cQ(v):""}),o=q(()=>s.value.some(v=>v.type==="ai")),c=q(()=>s.value.some(v=>v.task_state==="running")),p=q(()=>s.value.length>0&&s.value.every(v=>t(v.session_id)));function u(){n.value=null,s.value=[],i=null}function g(v,l){s.value=v,n.value=v[0]??null,i=l}function m(){const v=i;u(),v==null||v()}function y(){u()}return{pendingCloseSessions:s,pendingCloseTitle:r,pendingCloseIsAi:o,pendingCloseIsRunning:c,pendingCloseIsRemote:p,confirmCloseSession:m,cancelCloseSession:y,isCloseRiskySession:a,shouldConfirmCloseSession:d,openCloseSessionConfirm:g}}function uQ(e){if(e.ssh_host_id)return{kind:"reconnect",hostId:e.ssh_host_id};const t=(e.shell||e.title||e.last_command_line||"").trim();return t==="ssh"||t.startsWith("ssh ")?{kind:"adhoc"}:{kind:"local"}}const hQ=4;function fQ(e){const{tabs:t,localList:n,localHostID:s,pendingLocalIds:i,pins:a,hasLocalPty:d,newId:r,gotoTab:o,startNewTab:c,predictCellDims:p,pauseRecoverySnapshot:u}=e,g=H({open:!1,snapshot:null});async function m(h){var S;const f=((S=g.value.snapshot)==null?void 0:S.active_tab_id)??"";if(g.value={open:!1,snapshot:null},h.length===0){d&&await c();return}const _=u==null?void 0:u();try{await l(h,f)}finally{_==null||_()}}async function y(){g.value={open:!1,snapshot:null};try{await AS()}catch(h){Lt("recovery","discard failed",{error:Rt(h)})}d&&await c()}async function v(h,f){const _=new Array(h.length);let S=0;const k=Array.from({length:Math.min(hQ,h.length)},async()=>{for(;Sr()),S=h.map((D,I)=>({id:_[I],layout:D.layout,activePaneIdx:D.active_pane_idx,colRatio:D.col_ratio,rowRatio:D.row_ratio,panes:[]}));await a.ready();let k=-1;const P=(await Nu())[0]??"",M=[];for(let D=0;D{const{pickIdx:I,slot:O,tab:U}=D,W=U.panes.find(z=>z.slot===O);if(!W)return{pickIdx:I,slot:O,pane:{sessionId:null,remote:!1}};if(W.remote&&W.session_id)return{pickIdx:I,slot:O,pane:{sessionId:W.session_id,remote:!0,lastSeenInfo:yl(W)}};if(!d)return{pickIdx:I,slot:O,pane:{sessionId:null,remote:!1}};const N=uQ(W);if(N.kind==="reconnect")try{const z=await em(N.hostId),V=p(U.layout);return{pickIdx:I,slot:O,pane:{sessionId:z.session_id,remote:!1},seed:{id:z.session_id,command:W.title||"ssh",cwd:"",title:W.title||"ssh",type:"shell",cols:V.cols,rows:V.rows,started_at:Math.floor(Date.now()/1e3),host_id:s.value}}}catch{return{pickIdx:I,slot:O,pane:{sessionId:null,remote:!1,lastSeenInfo:yl({...W,title:(W.title||"ssh")+" — reconnect failed, open it again"})}}}if(N.kind==="adhoc")return{pickIdx:I,slot:O,pane:{sessionId:null,remote:!1,lastSeenInfo:yl({...W,title:(W.title||"ssh")+" — SSH disconnected, reconnect to resume"})}};try{const z=W.session_id||"",V=p(U.layout),j=sQ(W,V.cols,V.rows,P),G=await um(j);return{pickIdx:I,slot:O,pane:{sessionId:G.session_id,remote:!1},seed:{id:G.session_id,command:j.command,cwd:j.cwd||"",title:W.title||j.command,type:W.session_type||"",cols:V.cols,rows:V.rows,started_at:Math.floor(Date.now()/1e3),host_id:s.value},pinRename:z&&a.isPinned(z)?{oldSid:z,newSid:G.session_id}:void 0}}catch(z){return Lt("recovery","pane spawn failed",{error:Rt(z)}),{pickIdx:I,slot:O,pane:{sessionId:null,remote:!1}}}}),T=[],A=[];for(const D of w)S[D.pickIdx].panes[D.slot]=D.pane,D.seed&&T.push(D.seed),D.pinRename&&A.push(D.pinRename);for(const D of T)i.add(D.id);const E=new Set(n.value.map(D=>D.id)),R=T.filter(D=>!E.has(D.id));R.length>0&&(n.value=[...n.value,...R]);for(const D of A)a.rename(D.oldSid,D.newSid);t.value=[...t.value,...S],k>=0&&_[k]?o(_[k]):_.length>0&&o(_[0]),await a.flushNow()}return{recoveryDialogState:g,onRecoveryRestore:m,onRecoveryDiscard:y}}function pQ(){let e=null,t=null,n=null;function s(){t==null||t.detach(),t=null,n!==null&&(window.clearInterval(n),n=null)}function i(o,c){e==null||e.detach(),e=new mf(o,{onSessions:c.onSessions,onStatus:c.onStatus}),e.attach()}function a(o,c){s(),t=new mf(o,{onSessions:c.onSessions,onPrefsChanged:c.onPrefsChanged,onStatus:c.onStatus}),t.attach()}function d(o,c){s(),n=window.setInterval(()=>{o()},c)}function r(){e==null||e.detach(),e=null,s()}return{attachLocal:i,attachRemoteWS:a,startRemotePoll:d,stopRemote:s,isRemoteWSAttached:()=>t!==null,detachAll:r}}function vQ(e,t,n){const s=new Set(e.map(d=>d.id)),i=new Set,a=[];for(const d of n){if(s.has(d))continue;const r=t.find(o=>o.id===d);r&&(i.add(d),a.push(r))}return{localList:[...e,...a],pending:i}}function Zv(e){if(e.layout!=="single"||e.panes.length!==1)return null;const t=e.panes[0];return!(t!=null&&t.remote)||!t.sessionId?null:t.sessionId}function gQ(e){const t=new Set(e.remoteSessions.map(a=>a.id));for(const a of t)e.missingSince.delete(a);const n=new Set;for(const a of e.tabs){const d=Zv(a);d&&n.add(d)}for(const a of e.missingSince.keys())n.has(a)||e.missingSince.delete(a);const s=[],i=[];for(const a of e.tabs){const d=Zv(a);if(!d){i.push(a);continue}if(t.has(d)){i.push(a);continue}const r=e.missingSince.get(d)??e.nowMs;if(e.missingSince.set(d,r),e.nowMs-r>=e.graceMs){e.missingSince.delete(d),s.push(a.id);continue}i.push(a)}return{tabs:i,removedTabIds:s}}function mQ(e,t,n){if(!n)return{remote:!1,corrected:!1};const s=t.includes(e);return{remote:!s,corrected:s}}function _Q(){return Xu()}function yQ(e,t){var n,s,i;switch(e){case"pane.split-vertical-new":return t.onSplitVertical(),!0;case"pane.split-horizontal-new":return t.onSplitHorizontal(),!0;case"pane.close":return t.onClosePane(),!0;case"pane.focus-left":return t.onFocusPane("left"),!0;case"pane.focus-right":return t.onFocusPane("right"),!0;case"pane.focus-up":return t.onFocusPane("up"),!0;case"pane.focus-down":return t.onFocusPane("down"),!0;case"tab.new":return t.onNewTab(),!0;case"tab.prev":return t.onSwitchTab(-1),!0;case"tab.next":return t.onSwitchTab(1),!0;case"toggleTaskSidebar":return(n=t.onToggleTaskSidebar)==null||n.call(t),!0;case"sidebar.focus-search":return(s=t.onFocusSidebarSearch)==null||s.call(t),!0;case"terminal.search":return(i=t.onTerminalSearch)==null||i.call(t),!0}return!1}function bQ(e,t={}){const n=t.mod??_Q(),s=q(()=>{var d;const a=((d=t.bindings)==null?void 0:d.value)??{};return qH(a)});function i(a){const d=qy(a,n);if(d===null)return;const r=s.value[d];r&&yQ(r,e)&&(a.preventDefault(),a.stopPropagation())}document.addEventListener("keydown",i,{capture:!0}),Ql(()=>{document.removeEventListener("keydown",i,{capture:!0})})}function wQ(e,t,n={}){const s=q(()=>{const g=new Map;for(const m of e.value)g.set(m.session_id,m);for(const m of t.value)g.set(m.session_id,m);return[...g.values()]}),i=q(()=>{const g={};for(const m of s.value){const y=m.host_id||"";(g[y]||(g[y]=[])).push(m)}for(const m of Object.keys(g))g[m].sort(Ml);return g}),a=q(()=>{if(!n.localHostId)return i.value;const g={};for(const m of Object.keys(i.value))m!==n.localHostId&&(g[m]=i.value[m]);return g}),d=q(()=>{const g={};for(const[m,y]of Object.entries(i.value))g[m]=y.filter(v=>v.unread===!0).length;return g}),r=q(()=>Object.values(d.value).reduce((g,m)=>g+m,0)),o=q(()=>s.value.filter(g=>(g.task_state==="completed"||g.task_state==="failed")&&g.unread===!1).sort(Ex)),c=q(()=>{const g={};for(const m of s.value){const y=m.task_state??"idle";(g[y]||(g[y]=[])).push(m)}for(const m of Object.keys(g))g[m].sort((y,v)=>Ml(y,v));return g}),p=q(()=>{const g={};for(const[m,y]of Object.entries(c.value))g[m]=y.filter(v=>v.unread===!0).length;return g});function u(g){const m=i.value[g]??[];let y="idle",v=po("idle");for(const l of m){const h=l.task_state??"idle",f=po(h);f({id:v.id,layout:v.layout,active_pane_idx:v.activePaneIdx,col_ratio:v.colRatio,row_ratio:v.rowRatio,panes:v.panes.map((l,h)=>{var P;const f=l.sessionId?e.sessionInfoFor(l.sessionId):void 0,_=l.sessionId?t.get(l.sessionId):void 0,S=(f==null?void 0:f.type)==="ai",k=!!l.remote&&(!f||f.host_id!==e.localHostID.value);return{slot:h,remote:k||void 0,host_id:k?(f==null?void 0:f.host_id)??"":void 0,session_id:(!l.remote||k)&&l.sessionId?l.sessionId:void 0,shell:((P=f==null?void 0:f.command)==null?void 0:P.split(" ")[0])??"",shell_args:[],last_cwd:(f==null?void 0:f.cwd)??"",session_type:(f==null?void 0:f.type)??"",last_command_line:(f==null?void 0:f.current_command)??"",title:(f==null?void 0:f.title)??"",ai:S&&_?{..._}:void 0,ssh_host_id:(f==null?void 0:f.ssh_host_id)||void 0}})})).filter(v=>v.panes.length>0);return{version:1,host_id:"",clean_shutdown:!1,saved_at_unix:0,active_tab_id:e.currentTabId.value??"",tabs:y}}function r(){n&&(clearTimeout(n),n=null),s&&(clearTimeout(s),s=null),i=!1;try{MS(d()).catch(y=>{Lt("recovery","saveRecoverySnapshot failed",{error:Rt(y)})})}catch(y){Lt("recovery","saveRecoverySnapshot failed",{error:Rt(y)})}}function o(){a++,n&&(clearTimeout(n),n=null),s&&(clearTimeout(s),s=null);let y=!1;return()=>{y||(y=!0,a=Math.max(0,a-1),a===0&&i&&r())}}function c(){i=!0,!(a>0)&&(n&&clearTimeout(n),n=setTimeout(()=>{n=null,r()},SQ))}function p(){i=!0,!(a>0)&&(s||(s=setTimeout(()=>{s=null,r()},CQ)))}_t(()=>e.tabs.value.map(y=>({id:y.id,layout:y.layout,active:y.activePaneIdx,col:y.colRatio,row:y.rowRatio,paneIds:y.panes.map(v=>v.sessionId??"").join("|")})),()=>{c()},{deep:!0}),_t(e.currentTabId,()=>{p()}),_t(()=>e.tabs.value.map(y=>y.panes.map(v=>{const l=v.sessionId?e.sessionInfoFor(v.sessionId):void 0;return[v.sessionId??"",(l==null?void 0:l.type)??"",(l==null?void 0:l.title)??"",(l==null?void 0:l.cwd)??""].join("~")}).join("|")).join("||"),()=>{c()}),_t(()=>e.tabs.value.map(y=>y.panes.map(v=>{const l=v.sessionId?e.sessionInfoFor(v.sessionId):void 0;return(l==null?void 0:l.current_command)??""}).join("|")).join("||"),()=>{p()});const g=(e.onEvent??((y,v)=>hn().events.on(y,v)))("recovery:ai-sid",y=>{const v=(y==null?void 0:y.session_id)??"",l=(y==null?void 0:y.kind)??"",h=(y==null?void 0:y.ai_session_id)??"";if(!(!v||!l)&&!(l!=="claude"&&l!=="codex"&&l!=="aider")){if(!h){t.delete(v),c();return}t.set(v,{kind:l,session_id:h,captured_at_unix:Math.floor(Date.now()/1e3)}),c()}}),m=setInterval(()=>{i&&r()},kQ);return Ql(()=>{g==null||g(),n&&clearTimeout(n),s&&clearTimeout(s),clearInterval(m)}),{buildSnapshot:d,flushNow:r,pause:o}}function no(e){return e.id??e.session_id??""}const RQ=6,eg={idle:0,failed:1,waiting:2,running:3};function TQ(e){switch(e){case"waiting_input":return"waiting";case"failed":return"failed";case"running":return"running";default:return"idle"}}function PQ(e){switch(e){case"running":case"waiting_input":case"completed":case"failed":case"disconnected":case"closed":return e;default:return"idle"}}function EQ(e){const t=e.trim().replace(/[/\\]+$/,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n>=0?t.slice(n+1):t}function LQ(e){const t={current_command:e.current_command,title:e.title,session_id:no(e),cwd:e.cwd,type:e.type};if((e.current_command??"").trim()||(e.title??"").trim())return Pl(t);const n=EQ(e.cwd??"");if(n)return n;const s=(e.command??"").trim();return s?Or({current_command:s,title:"",session_id:no(e)}):Pl(t)}function DQ(e,t,n){const s=Dl(e.cwd,t);return!s||s===n?"":s}function MQ(e,t,n){if(t!=="running"&&t!=="waiting")return 0;const s=e.command_started_at;if(!s)return 0;const i=n-s*1e3;return i>0?i:0}function AQ(e,t={}){const n=t.nowMs??Date.now(),s=t.maxRows??RQ,i=(t.localHostId??"").trim(),a=t.home??"",d=t.aiOnly??!1,r=e.filter(f=>f.task_state!=="closed"&&(!d||f.type==="ai")),o=r.map(f=>{const _=TQ(f.task_state),S=(f.host_id??"").trim(),k=!!i&&!!S&&S!==i,P={current_command:f.current_command,title:f.title,session_id:no(f),cwd:f.cwd,type:f.type},M=LQ(f);return{row:{sessionId:no(f),title:M,subtitle:DQ(f,a,M),state:_,taskState:PQ(f.task_state),kind:f.type==="ai"?Or(P):"",remoteHost:k?(f.host??"").trim():"",ageMs:MQ(f,_,n),lastOutputAt:f.last_output_at??0,unread:f.unread===!0},source:f}});o.sort((f,_)=>Ml({...f.source,session_id:no(f.source)},{..._.source,session_id:no(_.source)}));const c=o.map(f=>f.row),p=c.filter(f=>f.state==="waiting").length,u=c.filter(f=>f.state==="failed").length,g=c.filter(f=>f.state==="running").length,m=c.filter(f=>f.unread).length,y=r.filter(f=>f.task_state==="completed").length;let v="idle";for(const f of c)eg[f.state]>eg[v]&&(v=f.state);const l=Math.max(0,c.filter(f=>f.state==="idle").length-y),h={waitingCount:p,failedCount:u,runningCount:g,completedCount:y,idleCount:l};return{mood:v,unreadCount:m,...h,...IQ(m,h),rows:c.slice(0,s),attentionIds:c.filter(f=>f.state==="waiting"||f.state==="failed").map(f=>f.sessionId),overflowCount:Math.max(0,c.length-s),aiOnly:d}}function IQ(e,t){const n=[];return t.failedCount>0&&n.push(`${t.failedCount} 个失败`),t.runningCount>0&&n.push(`${t.runningCount} 个在跑`),t.waitingCount>0&&n.push(`${t.waitingCount} 个等待输入`),t.completedCount>0&&n.push(`${t.completedCount} 个已完成`),{headline:e>0?`${e} 个会话有最新内容`:"暂无最新内容",subline:n.join(" · ")}}function $Q(e){const t=hn(),n=Fr();if(!t.deskWidget)return;const s=t.deskWidget;let i=!1,a="";async function d(o){if(o!==i)try{o?(a||(a=await zu().catch(()=>"")),await s.start(),i=!0,await r()):(await s.stop(),i=!1)}catch(c){if(Lt("widget","lifecycle change failed",{enabled:o,error:Rt(c)}),o){i=!1;try{await n.setEnabled("desk-widget",!1)}catch(p){Lt("widget","disable-after-start-failure also failed",{error:Rt(p)})}}}}async function r(){var c,p;if(!i)return;const o=AQ(e.sessions.value,{localHostId:e.localHostId.value,home:a,aiOnly:((p=(c=n.cfg)==null?void 0:c.widget)==null?void 0:p.aiOnly)??!1});try{await s.pushState(JSON.stringify(o))}catch(u){i=!1,Lt("widget","state push failed",{error:Rt(u)})}}_t(()=>n.isPluginEnabled("desk-widget"),o=>{d(o)},{immediate:!0}),_t(e.sessions,()=>void r(),{deep:!0}),_t(()=>{var o,c;return(c=(o=n.cfg)==null?void 0:o.widget)==null?void 0:c.aiOnly},()=>void r())}const OQ={key:1,class:"auth-error-banner",role:"alert"},FQ={class:"auth-error-msg"},BQ=["aria-label"],HQ={key:4,class:"main-row"},NQ={class:"main"},zQ={key:0,class:"empty"},UQ={key:2,class:"toast"},VQ=["title"],KQ=6e4,WQ=3e3,jQ=Ae({__name:"App",setup(e,{expose:t}){const n=hn(),s=n.caps,{t:i}=$t(),a=H(null),d=ia({});function r(ee){return d[ee]??0}const o={auth_invalid_token:"app.authInvalidToken",auth_user_disabled:"app.authUserDisabled",session_id_owner_mismatch:"app.sessionIdOwnerMismatch",forbidden:"app.forbidden"},c=q(()=>a.value?o[a.value]?i(o[a.value]):a.value:""),p=q(()=>s.localPty?i("app.startingFirstSession"):i("app.waitingForSessionSelection"));function u(){m.value="relay",De.value=!0}function g(){m.value="account",De.value=!0}const m=H(void 0),y=H(null),v=H(null),l=H(""),h=H(""),f=H([]),_=H(""),S=H([]),k=H([]),P=H([]),M=new Map,w=new Set;function T(ee){return{...ee,session_id:ee.id}}const A=q(()=>S.value.map(T)),E=q(()=>k.value.map(T)),R=wQ(A,E);$Q({sessions:R.all,localHostId:l});const D=Yu(),I=Gu(),O=H(!1);async function U(ee){O.value=ee;try{await im(ee)}catch{}}function W(ee){Bi(ee.session_id)}function N(ee,ue){const $e=OC(re.value,ue.sessionId);if(!$e)return;const Se=ee.panes.findIndex(en=>en.sessionId===ue.sessionId);if(Se!==-1){Se===ue.paneIdx?us(i("app.sessionAlreadyInTab")):ee.panes=FC(ee.panes,Se,ue.paneIdx),ee.activePaneIdx=ue.paneIdx,Zr();return}const mt=ee.panes[ue.paneIdx],Bt=mt&&!mt.sessionId?ue.paneIdx:null;if(Bt===null){const en=Sp(ee.layout,ee.panes,ue.paneIdx,"vertical",ee.colRatio,ee.rowRatio);if(en.noop){us(i("app.paneFull"));return}ee.layout=en.layout,ee.panes=en.panes,ee.colRatio=en.colRatio,ee.rowRatio=en.rowRatio,ee.activePaneIdx=en.newPaneIdx,j($e),ee.panes[en.newPaneIdx]=$e.pane,Zr();return}j($e),ee.panes[Bt]=$e.pane,ee.activePaneIdx=Bt,Zr()}function z(ee){return Of(re.value,ee)!==null}function V(ee){const ue=Of(re.value,ee);if(Zr(),!ue){us(i("terminal.alreadyOwnTab"));return}const $e=re.value.find(Se=>Se.id===ue.tabId);$e&&(Ls($e,ue.paneIdx,{detachOnly:!0}),Bi(ee,ue.pane.remote))}function j(ee){if(!ee.from)return;const ue=re.value.find($e=>$e.id===ee.from.tabId);ue&&Ls(ue,ee.from.paneIdx,{detachOnly:!0})}function G(ee){const ue=wr(re.value,ee.session_id);if(!ue)return;const $e=re.value.find(Se=>Se.id===ue.tabId);$e&&Ls($e,ue.paneIdx)}function te(ee){if(!Be(ee)){G(ee);return}me([ee],()=>G(ee))}async function oe(ee){try{await RS(ee)}catch{Lt("app","markSessionsSeen failed",{payload:JSON.stringify(ee)})}}const re=H([]),ye=H(null),K=H("loading"),J=H(""),Q=H(null),de=H(!1),De=H(!1),Pe=H(""),Ye=H(null),st=q(()=>{var ee;return((ee=Ye.value)==null?void 0:ee.is_admin)===!0});let yt=0;function ce(){yt++,Ye.value=null}async function ae(ee="",ue=!1){const $e=++yt;try{const Se=await n.relay.fetchMe();if($e!==yt)return;if(ee&&Se.user_id!==ee){Ye.value=null,Lt("app","discarded relay identity from a different authenticated user");return}Ye.value=Se}catch(Se){if($e!==yt)return;Ye.value=null,ue&&Lt("app","failed to refresh relay identity",{error:Rt(Se)})}}const be=H(!1);_t(st,ee=>{ee||(be.value=!1)});const he=H(!1),Le=H(!1),et=H(!1);let je=null,_e=null,ie=null,we=null,Ee=null,x=null;function Re(){if(Gt.value){Wc();return}if(nn==null||nn.flushNow(),Qn.value===0&&Bo.value===0){Wc();return}he.value=!0}function Xe(){he.value=!1,Wc()}function Ue(){he.value=!1}function xt(ee){var Se;const ue=wr(re.value,ee);if(!ue)return!1;const $e=re.value.find(mt=>mt.id===ue.tabId);return((Se=$e==null?void 0:$e.panes[ue.paneIdx])==null?void 0:Se.remote)===!0}const{pendingCloseSessions:Ze,pendingCloseTitle:wt,pendingCloseIsAi:tt,pendingCloseIsRunning:gt,pendingCloseIsRemote:se,confirmCloseSession:ge,cancelCloseSession:Oe,isCloseRiskySession:Ke,shouldConfirmCloseSession:Be,openCloseSessionConfirm:me}=dQ({isOpenRemoteSession:ee=>xt(ee)});function Fe(ee){const ue=ee.sessionId;if(!ue)return ee.lastSeenInfo?T(ee.lastSeenInfo):null;const $e=Nn(ue,ee.remote)??Nn(ue,!ee.remote)??ee.lastSeenInfo;return $e?T($e):null}function fe(ee){return ee.filter(ue=>!ue.remote).map(Fe).filter(ue=>!!ue&&Ke(ue))}const nt=H(!1);let At=null;const St=H(q4),xe=q(()=>Li(St.value)),qe=H({fontHead:"",fontSize:13,lineHeight:1,cursorStyle:"block",cursorBlink:!0,scrollback:5e3}),ht=q(()=>xe.value.appVars),Et=H(10),jt=Wu(),Kt=H(""),Yt=q(()=>jt.value&&Kt.value!=="darwin");let nn=null;const{recoveryDialogState:rn,onRecoveryRestore:Mn,onRecoveryDiscard:xn}=fQ({tabs:re,localList:S,localHostID:l,pendingLocalIds:w,pins:D,hasLocalPty:s.localPty,newId:()=>Qe(),gotoTab:ee=>On(ee),startNewTab:()=>zr(),predictCellDims:al,pauseRecoverySnapshot:()=>nn==null?void 0:nn.pause()}),Xt=H(!1),Gt=H(!1),Qt=H(null),an=H(!0);function Ot(){var $e;const ee=Qt.value;an.value&&((($e=ee==null?void 0:ee.tabs)==null?void 0:$e.length)??0)>0&&ee?rn.value={open:!0,snapshot:ee}:s.localPty&&zr()}function jn(){Xt.value=!1,Ot()}function is(){Gt.value=!0}async function An(ee){try{const ue=new Promise(Se=>window.setTimeout(Se,ee));return await Promise.race([rm().catch(()=>{}),ue]),!!(await fo()).available}catch{return!1}}let Pn=!1,Rn=null;const In=pQ();let ke="";const Qe=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():"tab-"+Math.random().toString(36).slice(2),ft=q(()=>re.value.find(ee=>ee.id===ye.value)??null),It=ia(new Set);_t(ye,ee=>{ee&&It.add(ee)},{immediate:!0});const ln=q(()=>re.value.filter(ee=>It.has(ee.id))),Nt=H(null),En=H(null),qn=q(()=>{const ee=ft.value;return(ee==null?void 0:ee.panes[ee.activePaneIdx])??null});_t(qn,ee=>{Nt.value=ee},{immediate:!0});const Ln=q(()=>{const ee=ft.value;if(!ee)return null;const ue=ee.panes[ee.activePaneIdx];return ue!=null&&ue.sessionId?Nn(ue.sessionId,ue.remote)??ue.lastSeenInfo??null:(ue==null?void 0:ue.lastSeenInfo)??null});_t(()=>{const ee=Ln.value;return[ee==null?void 0:ee.type,ee==null?void 0:ee.title]},([ee,ue])=>{var Se,mt;const $e=ee==="ai"&&ue?ue:"AT Term";(mt=(Se=n.system).windowSetTitle)==null||mt.call(Se,$e).catch(()=>{})},{immediate:!0});const Ts=q(()=>{var ee;return((ee=Ln.value)==null?void 0:ee.task_state)??null}),Ws=q(()=>{const ee=Ln.value;if(!ee)return"";if(ee.type==="ai"&&ee.title)return ee.title;if(ee.cwd){const $e=ee.cwd.replace(/\/+$/,"");if($e==="")return"/";const Se=$e.split("/").pop();if(Se)return Se}const ue=(ee.command||"").split(/\s+/)[0]||"";return ue.split("/").pop()||ue}),ei=new Map;kn("atterm:pluginInputSenders",ei);const ti=ia(new Map);kn("atterm:pluginSessionConnections",ti);const Ps=jJ({activePane:Nt,endpointForPane:ur,sessionInfoForPane:yi,sessionConnectionForPane:ee=>ee.sessionId?ti.get(ee.sessionId)??null:null,sendToSession:(ee,ue,$e)=>{const Se=ei.get(ee);if(Se){Se($e);return}YJ(ue,ee,$e)},showToast:us,terminalThemeId:St});kn("atterm:pluginContext",Ps);const{panelWidth:gi,panelCollapsed:mi,togglePanel:Ii,onPanelResizeDown:$i,rightPanelHasPlugin:Oi,fileExplorerTheme:_i}=nQ({terminalThemeId:St}),Br=q(()=>{const ee=new Set;for(const ue of re.value)for(const $e of ue.panes)$e.sessionId&&ee.add($e.sessionId);return ee}),dr=q(()=>Array.from(Br.value));function ur(ee){return ee.remote?v.value:y.value}function yi(ee){return ee.sessionId?Nn(ee.sessionId,ee.remote)??null:null}function us(ee){Pe.value=ee,Rn!==null&&window.clearTimeout(Rn),Rn=window.setTimeout(()=>{Pe.value="",Rn=null},2e3)}function hr(){const ee=new Map;for(const ue of S.value)ee.set(ue.id,ue);for(const ue of k.value)ee.set(ue.id,ue);return ee}function Hr(ee){const ue=new Set(S.value.map(Se=>Se.id)),$e=[];for(const Se of re.value){let mt=!1;for(let Bt=0;Btue.id));k.value=P.value.filter(ue=>!ee.has(ue.id))}function bi(ee){const ue=hr(),$e=vQ(ee,S.value,w);S.value=$e.localList,w.clear();for(const Se of $e.pending)w.add(Se);hs(),Hr(ue),K.value!=="ready"&&(K.value="ready")}function ni(ee){P.value=ee,hs();const ue=gQ({tabs:re.value,remoteSessions:k.value,missingSince:M,nowMs:Date.now(),graceMs:KQ});ue.removedTabIds.length>0&&(re.value=ue.tabs,ye.value&&ue.removedTabIds.includes(ye.value)&&(re.value.length>0?On(re.value[0].id):location.hash=""))}function si(ee){In.attachLocal(ee,{onSessions:bi,onStatus:ue=>{ue==="error"&&(K.value="error")}})}function bn(){n.events.emit("prefs:remote-changed",void 0)}function _s(ee){In.attachRemoteWS(ee,{onSessions:ni,onPrefsChanged:bn,onStatus:ue=>{ue==="error"&&(K.value="error")}})}async function ys(){try{ni(await nS())}catch(ee){Js("app","remote session poll failed; keeping last list",{error:Rt(ee)})}}async function Es(){const ue=(await n.sessions.listRemoteSessions()).map($e=>{const Se=$e;return{...Se,id:Se.id??Se.session_id??""}});ni(ue)}async function Hn(){const ee=await n.relay.load(),ue=ee?Nr(ee):null;return v.value=ue,ue?(_s(ue),!0):(In.stopRemote(),P.value=[],k.value=[],!1)}function Yn(){In.isRemoteWSAttached()||In.startRemotePoll(Es,3e3)}function Do(ee,ue){if(In.stopRemote(),P.value=[],k.value=[],M.clear(),v.value=ue,!!ee){if(ue){_s(ue);return}ys(),In.startRemotePoll(ys,2e3)}}async function fs(){let ee={url:"",token:"",connected:!1};try{ee=await Tl()}catch(en){Js("app","getRelayConfig failed; keeping last known",{error:Rt(en)})}const ue=ee.remote_http_proxy_url??"";ee.token&&ue?kg({baseURL:ue+"/relay-http",sessionToken:ee.token,expiresAt:null,allowInsecure:!1}):xg();const $e=!!(ee.connected&&ee.url),Se=ee.remote_proxy_url??"",mt=$e&&Se?{url:Se,session_token:ee.token}:null,Bt=`${$e}|${(mt==null?void 0:mt.url)??""}|${(mt==null?void 0:mt.session_token)??""}`;Bt!==ke&&(ke=Bt,Do($e,mt))}function bs(){s.wailsBindings&&fs()}function Mo(){bs(),ae()}function fr(){De.value=!1,m.value=void 0,bs()}function Nr(ee){if(!ee.token)return null;const ue=ee.homeInstanceURL||ee.url;if(!ue)return{url:`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}`,session_token:ee.token};try{const $e=new URL(ue);return{url:`${$e.protocol==="https:"?"wss:":"ws:"}//${$e.host}`,session_token:ee.token}}catch{return null}}async function pr(){const ee=await pm();St.value=Li(ee).id}function Ao(ee){St.value=Li(ee).id}async function vr(){const[ee,ue,$e,Se,mt,Bt]=await Promise.all([gm(),mm(),_m(),ym(),bm(),wm()]);qe.value={fontHead:ee,fontSize:ue,lineHeight:$e,cursorStyle:Se,cursorBlink:mt,scrollback:Bt}}function Fi(ee){qe.value=ee}function le(ee){Et.value=ee}async function pe(){f.value=await xm()??[],_.value&&!f.value.some(ee=>ee.id===_.value)&&(_.value="")}function ve(){pe()}function Me(){const ee=location.hash.match(/^#\/t\/([\w-]+)$/);return ee?ee[1]:null}function zt(){const ee=Me();ee&&re.value.some(ue=>ue.id===ee)&&(ye.value=ee)}function On(ee){ye.value=ee,location.hash!=="#/t/"+ee&&(location.hash="#/t/"+ee),be.value=!1}function Jn(ee,ue,$e){re.value=GJ(re.value,ee,ue,$e)}function Nn(ee,ue){return(ue?k.value:S.value).find($e=>$e.id===ee)}function Io(ee){var $e;const ue=ee.panes[ee.activePaneIdx];return!(ue!=null&&ue.sessionId)||ue.remote?"":(($e=Nn(ue.sessionId,!1))==null?void 0:$e.cwd)??""}async function $o(ee,ue,$e){const Se=await Nu();if(Se.length===0)throw new Error(i("app.noShellsFound"));const mt=await um({command:Se[0],cwd:ee,cols:ue.cols,rows:ue.rows,...$e?{profile_id:$e}:{}});return w.add(mt.session_id),S.value=[...S.value,{id:mt.session_id,command:Se[0],cwd:ee||"",title:Se[0],cols:ue.cols,rows:ue.rows,started_at:Math.floor(Date.now()/1e3),host_id:l.value}],mt.session_id}async function zr(){if(!de.value){de.value=!0,J.value="";try{const ee=ft.value?Io(ft.value):"",ue=await $o(ee,al("single"),_.value),$e=Qe();re.value.push({id:$e,layout:"single",panes:[{sessionId:ue,remote:!1}],activePaneIdx:0,colRatio:Ds,rowRatio:Ds}),On($e)}catch(ee){K.value="error",J.value=(ee==null?void 0:ee.message)??String(ee)}finally{de.value=!1}}}function Cc(ee){if(w.add(ee),!S.value.some($e=>$e.id===ee)){const $e=al("single");S.value=[...S.value,{id:ee,command:"ssh",cwd:"",title:"ssh",cols:$e.cols,rows:$e.rows,started_at:Math.floor(Date.now()/1e3),host_id:l.value}]}const ue=Qe();re.value.push({id:ue,layout:"single",panes:[{sessionId:ee,remote:!1}],activePaneIdx:0,colRatio:Ds,rowRatio:Ds}),On(ue)}function Ma(ee){Le.value=!1,et.value=!1,Cc(ee)}function kc(ee){fr(),Bi(ee)}async function Aa(ee){const ue=ft.value;if(!ue)return;const $e=Io(ue),Se=Sp(ue.layout,ue.panes,ue.activePaneIdx,ee,ue.colRatio,ue.rowRatio);if(Se.noop){us(i("app.paneFull"));return}ue.layout=Se.layout,ue.panes=Se.panes,ue.activePaneIdx=Se.activePaneIdx,ue.colRatio=Se.colRatio,ue.rowRatio=Se.rowRatio;try{const mt=await $o($e,al(Se.layout),_.value);ue.panes[Se.newPaneIdx]={sessionId:mt,remote:!1}}catch(mt){us(i("app.splitFailed",{message:(mt==null?void 0:mt.message)??String(mt)}))}}async function xc(){const ee=ft.value;ee&&Oo(ee,ee.activePaneIdx)}function Oo(ee,ue){const $e=ee.panes[ue],Se=$e?fe([$e]):[];if(Se.length>0){me(Se,()=>Ls(ee,ue));return}Ls(ee,ue)}function Ls(ee,ue,$e){const Se=ee.panes[ue];!(ee.layout==="single")&&(Se!=null&&Se.sessionId)&&!Se.remote&&!($e!=null&&$e.detachOnly)&&Rc(Se.sessionId);const Bt=j5(ee.layout,ee.panes,ue,ee.colRatio,ee.rowRatio);ee.layout=Bt.layout,ee.panes=Bt.panes,ee.activePaneIdx=Bt.activePaneIdx,ee.colRatio=Bt.colRatio,ee.rowRatio=Bt.rowRatio,Bt.closeTab&&ws(ee.id,$e)}function Rc(ee){w.delete(ee);const ue=S.value.filter($e=>$e.id!==ee);ue.length!==S.value.length&&(S.value=ue,hs()),Lf(ee).catch(()=>{})}function ws(ee,ue){const $e=XJ(re.value,S.value,ye.value,ee,ue);if($e){for(const Se of $e.localIdsToClose)w.delete(Se);re.value=$e.nextTabs,$e.nextLocalList!==S.value&&(S.value=$e.nextLocalList,hs()),$e.wasCurrent&&(re.value.length>0?On(re.value[0].id):location.hash="");for(const Se of $e.localIdsToClose)Lf(Se).catch(()=>{})}}function Tc(ee){const ue=re.value.find(Se=>Se.id===ee),$e=ue?fe(ue.panes):[];if($e.length>0){me($e,()=>ws(ee));return}ws(ee)}function Ia(ee){const ue=ft.value;if(!ue)return;const $e=G5(ue.layout,ue.activePaneIdx,ee);$e!==null&&(ue.activePaneIdx=$e)}function Fo(ee){if(re.value.length===0)return;const ue=re.value.findIndex(Se=>Se.id===ye.value);if(ue===-1)return;const $e=(ue+ee+re.value.length)%re.value.length;On(re.value[$e].id)}function Bi(ee,ue=!0){const $e=wr(re.value,ee);if($e){const Bt=re.value.find(en=>en.id===$e.tabId);Bt&&Bt.activePaneIdx!==$e.paneIdx&&(Bt.activePaneIdx=$e.paneIdx),On($e.tabId);return}const Se=mQ(ee,S.value.map(Bt=>Bt.id),ue);Se.corrected&&Lt("app","opened a local session through the remote path",{sessionId:ee});const mt=Qe();re.value.push({id:mt,layout:"single",panes:[{sessionId:ee,remote:Se.remote}],activePaneIdx:0,colRatio:Ds,rowRatio:Ds}),On(mt)}function $a(ee){return ee===1?"single":ee===2?"vertical":ee===3||ee===4?"grid2x2":null}function Oa(ee){return wr(re.value,ee)}function Fa(ee){const ue=re.value.findIndex($e=>$e.id===ee);return ue<0?0:ue+1}async function Pc(){const ee=Array.from(I.selectedIds.value),ue=$a(ee.length);if(!ue)return;for(const Bt of ee){const en=wr(re.value,Bt);if(!en)continue;const js=re.value.find(_r=>_r.id===en.tabId);js&&await Ls(js,en.paneIdx,{detachOnly:!0})}const $e=th[ue],Se=new Array($e).fill(null).map((Bt,en)=>enee.has(Se)),$e=ue.map(gr).filter(Se=>!!Se&&Ke(Se));if($e.length>0){me($e,()=>Ha(ue));return}Ha(ue)}async function Ha(ee){for(const ue of ee){const $e=wr(re.value,ue);if(!$e)continue;const Se=re.value.find(mt=>mt.id===$e.tabId);Se&&await Ls(Se,$e.paneIdx)}I.clear()}function Na(ee){var Bt,en,js,_r,za,Ua,Va,ii;const ue=ee,$e=typeof(ue==null?void 0:ue.session_id)=="string"?ue.session_id:typeof(ue==null?void 0:ue.sessionId)=="string"?ue.sessionId:"";if(!$e)return;const Se=wr(re.value,$e);if(!Se){const zo=k.value.some(Uo=>Uo.id===$e)||!S.value.some(Uo=>Uo.id===$e);Bi($e,zo),(en=(Bt=n.system).windowUnminimize)==null||en.call(Bt),(_r=(js=n.system).windowShow)==null||_r.call(js);return}const mt=re.value.find(zo=>zo.id===Se.tabId);mt&&(mt.activePaneIdx=Se.paneIdx,On(Se.tabId),(Ua=(za=n.system).windowUnminimize)==null||Ua.call(za),(ii=(Va=n.system).windowShow)==null||ii.call(Va))}const Ec=q(()=>re.value.map(ee=>{const ue=ee.panes[ee.activePaneIdx],$e=ue!=null&&ue.sessionId?Nn(ue.sessionId,ue.remote)??null:null,Se=!$e&&(ue!=null&&ue.lastSeenInfo)?ue.lastSeenInfo:null;return{id:ee.id,layout:ee.layout,activeSession:$e??Se,activeRemote:!!(ue!=null&&ue.remote),paneCount:ee.panes.length,disconnected:!$e&&!!Se}})),Lc=q(()=>R.all.value.length),Qn=q(()=>{let ee=0;for(const ue of re.value)for(const $e of ue.panes)$e.sessionId&&!$e.remote&&ee++;return ee}),Bo=q(()=>{let ee=0;for(const ue of re.value)for(const $e of ue.panes)$e.sessionId&&$e.remote&&ee++;return ee}),mr=H({});async function Ho(){mr.value=await vm()}function Dc(ee){mr.value=ee}const No=H(0);bQ({onSplitVertical:()=>Aa("vertical"),onSplitHorizontal:()=>Aa("horizontal"),onClosePane:xc,onFocusPane:Ia,onNewTab:()=>{s.localPty&&zr()},onSwitchTab:Fo,onToggleTaskSidebar:()=>U(!O.value),onFocusSidebarSearch:()=>{var ee;(ee=En.value)==null||ee.focusSearch()},onTerminalSearch:()=>{No.value++}},{bindings:mr}),nn=s.wailsBindings?xQ({tabs:re,currentTabId:ye,localHostID:l,sessionInfoFor:ee=>Nn(ee,!1)??Nn(ee,!0)}):null,_t([re,ye],()=>{re.value.length!==0&&(ye.value&&re.value.find(ee=>ee.id===ye.value)||On(re.value[0].id))});const Mc=lQ({enabled:!s.wailsBindings,tabs:re,currentTabId:ye,currentTab:ft,gotoTab:On,openRemoteAsTab:Bi,newId:Qe});return Dt(async()=>{if(s.wailsBindings)try{O.value=await sm()}catch{}je=n.events.on("before-close",Re),_e=n.events.on("notification:click",Na),ie=n.events.on("widget:activate",Na);try{const Se=await n.system.getEnvironment();Se!==null&&(Kt.value=(Se.platform??"").toLowerCase())}catch{}if(x=n.events.on("relay:auth-error",Se=>{const mt=Se;a.value=(mt==null?void 0:mt.reason)??null,ce()}),we=n.events.on("relay:auth-info",Se=>{const mt=Se,Bt=typeof(mt==null?void 0:mt.user_id)=="string"?mt.user_id:"";if(!Bt){ce();return}ae(Bt,!0)}),n.events.on("relay:viewers",Se=>{const mt=Se;mt&&typeof mt.session_id=="string"&&(d[mt.session_id]=mt.count??0)}),n.events.on("prefs:changed",()=>{s.wailsBindings&&(pr(),vr(),Ho(),pe())}),Ee=n.events.on("relay:auth-restored",()=>{ae("",!0),!s.wailsBindings&&(async()=>{try{await Hn()&&(K.value="ready",Yn())}catch(Se){Lt("app","failed to refresh relay state after login",{error:Rt(Se)})}})()}),ae(),zt(),window.addEventListener("hashchange",zt),s.wailsBindings)try{const Se=await WS();if(Se!=null&&Se.fatal){Q.value=Se,K.value="error",J.value=Se.message;return}}catch(Se){Lt("app","failed to load startup fatal state",{error:Rt(Se)})}if(await QJ(),s.wailsBindings)try{Et.value=await km()}catch(Se){Lt("app","failed to load command-notify threshold",{error:Rt(Se)})}let ee="",ue={version:1,host_id:"",clean_shutdown:!1,saved_at_unix:0,tabs:[]},$e=!0;if(s.wailsBindings)try{ee="refreshTerminalTheme",await pr(),ee="refreshTerminalAppearance",await vr(),ee="refreshShortcutBindings",await Ho(),ee="refreshProfiles",await pe(),ee="getEndpoint",y.value=await jS(),ee="getHostInfo";const Se=await hm();l.value=Se.host_id,h.value=Se.host,ee="loadRecoverySnapshot",ue=await DS(),$e=await dm(),ee="connectLocalSessionList",si(y.value),ee="refreshRelayConfig",await fs()}catch(Se){const mt=(Se==null?void 0:Se.name)??"Error",Bt=(Se==null?void 0:Se.message)??String(Se);Ks("boot",`step "${ee}" failed`,{name:mt,message:Bt,stack:Se==null?void 0:Se.stack}),K.value="error",J.value=`${ee}: ${mt}: ${Bt}`||i("app.wailsBindingsUnavailable");return}else try{ee="loadRelayConfig";const Se=await Hn();!Se&&!s.localPty&&g(),K.value="ready",Se&&Yn()}catch(Se){const mt=(Se==null?void 0:Se.name)??"Error",Bt=(Se==null?void 0:Se.message)??String(Se);Ks("boot",`web: step "${ee}" failed`,{name:mt,message:Bt,stack:Se==null?void 0:Se.stack}),In.startRemotePoll(Es,3e3)}s.wailsBindings&&(At=window.setInterval(async()=>{try{const Se=await fo();nt.value=!!(Se.available||Se.ready)}catch{}},5e3));try{if(!Pn&&re.value.length===0&&(Pn=!0,!Mc.tryRestoreOnBoot())){if(Qt.value=ue,an.value=$e,s.wailsBindings&&s.autoUpdate&&await cm()&&await An(WQ)){Xt.value=!0;return}Ot()}}catch(Se){const mt=(Se==null?void 0:Se.name)??"Error",Bt=(Se==null?void 0:Se.message)??String(Se);Ks("boot","auto-start failed",{name:mt,message:Bt,stack:Se==null?void 0:Se.stack}),K.value="error",J.value=`autoStart: ${mt}: ${Bt}`}}),nc(()=>{je==null||je(),je=null,_e==null||_e(),_e=null,ie==null||ie(),ie=null,we==null||we(),we=null,Ee==null||Ee(),Ee=null,x==null||x(),x=null,ce(),window.removeEventListener("hashchange",zt),In.detachAll(),Rn!==null&&window.clearTimeout(Rn),At!==null&&window.clearInterval(At),ZJ()}),t({me:Ye}),(ee,ue)=>{var $e;return $(),F("div",{class:lt(["app",[`fe-theme-${C(_i)}`,{"is-maximized":Yt.value}]]),style:tn(ht.value)},[C(s).windowControls?($(),bt(Zk,{key:0,status:K.value,"error-msg":J.value,"session-count":Lc.value,"remote-endpoint":v.value,"current-title":Ws.value,"current-task-state":Ts.value},null,8,["status","error-msg","session-count","remote-endpoint","current-title","current-task-state"])):Z("",!0),Te(fJ),Te(bJ),a.value?($(),F("div",OQ,[b("span",FQ,L(c.value),1),b("button",{class:"auth-error-action",onClick:u},L(C(i)("app.openSettings")),1),b("button",{class:"auth-error-dismiss",onClick:ue[0]||(ue[0]=Se=>a.value=null),"aria-label":C(i)("app.dismiss")},"×",8,BQ)])):Z("",!0),Q.value?Z("",!0):($(),bt(QC,{key:2,tabs:Ec.value,"current-id":ye.value,starting:de.value,"can-new-local":C(s).localPty,"update-badge":nt.value,"is-admin":st.value,"admin-open":be.value,profiles:f.value,"selected-profile-id":_.value,onActivate:On,onDetachSession:V,onClose:Tc,onNew:zr,onNewSsh:ue[1]||(ue[1]=Se=>et.value=!0),onReorder:Jn,onOpenSettings:ue[2]||(ue[2]=Se=>De.value=!0),onToggleAdmin:ue[3]||(ue[3]=Se=>be.value=!be.value),onSelectProfile:ue[4]||(ue[4]=Se=>_.value=Se)},null,8,["tabs","current-id","starting","can-new-local","update-badge","is-admin","admin-open","profiles","selected-profile-id"])),Q.value?($(),bt(vX,{key:3,fatal:Q.value,onQuit:Xe},null,8,["fatal"])):($(),F("div",HQ,[Te(V2,{ref_key:"taskSidebarRef",ref:En,collapsed:O.value,"by-host":C(R).byHost.value,"primary-state-for-host":C(R).primaryStateForHost,"completed-seen":C(R).completedSeen.value,"total-unread":C(R).totalUnread.value,"by-state-groups":C(R).byState.value,"active-session-id":(($e=Nt.value)==null?void 0:$e.sessionId)??null,"open-session-ids":dr.value,"local-host-id":l.value,"local-host":h.value,"pane-location-for":Oa,"can-detach-session":z,"tab-index-by-id":Fa,"onUpdate:collapsed":U,onOpen:W,onClose:te,onDetachSession:V,onMergeSelected:Pc,onCloseSelected:Ba,onMarkSeen:oe},null,8,["collapsed","by-host","primary-state-for-host","completed-seen","total-unread","by-state-groups","active-session-id","open-session-ids","local-host-id","local-host"]),b("main",NQ,[be.value?($(),bt(j4,{key:0})):y.value||v.value?($(),F(Ie,{key:1},[re.value.length===0?($(),F("div",zQ,L(p.value),1)):Z("",!0),($(!0),F(Ie,null,at(ln.value,Se=>rt(($(),bt(hP,{key:Se.id,tab:Se,"endpoint-for":ur,"session-info-for":yi,"viewer-count-for":r,active:Se.id===ye.value,"terminal-theme":xe.value.xtermTheme,"command-notify-threshold-sec":Et.value,"search-request-seq":No.value,appearance:qe.value,"service-preview-available":!!C(n).servicePreview,onSetActivePane:mt=>Se.activePaneIdx=mt,onClosePane:mt=>Oo(Se,mt),onDropSession:mt=>N(Se,mt),onDetachSession:V,onToast:us,"onUpdate:colRatio":mt=>{Se.colRatio=mt},"onUpdate:rowRatio":mt=>{Se.rowRatio=mt}},null,8,["tab","active","terminal-theme","command-notify-threshold-sec","search-request-seq","appearance","service-preview-available","onSetActivePane","onClosePane","onDropSession","onUpdate:colRatio","onUpdate:rowRatio"])),[[Ss,Se.id===ye.value]])),128))],64)):Z("",!0),Pe.value?($(),F("div",UQ,L(Pe.value),1)):Z("",!0)]),C(s).pluginHost&&C(Oi)?($(),F(Ie,{key:0},[b("button",{class:"panel-toggle",onClick:ue[5]||(ue[5]=(...Se)=>C(Ii)&&C(Ii)(...Se)),title:C(mi)?C(i)("app.showPanel"):C(i)("app.hidePanel")},L(C(mi)?"‹":"›"),9,VQ),C(mi)?Z("",!0):($(),F(Ie,{key:0},[b("div",{class:"right-resizer",onMousedown:ue[6]||(ue[6]=(...Se)=>C($i)&&C($i)(...Se))},null,32),Te(Kv,{"slot-id":"right-panel",context:C(Ps),class:"right-panel",style:tn({flex:"0 0 "+C(gi)+"px"})},null,8,["context","style"])],64))],64)):Z("",!0)])),C(s).pluginHost?($(),bt(Kv,{key:5,"slot-id":"bottom-toolbar",context:C(Ps),class:"bottom-toolbar"},null,8,["context"])):Z("",!0),C(s).pluginHost?($(),bt(WJ,{key:6})):Z("",!0),De.value?($(),bt(aW,{key:7,"local-session-count":Qn.value,"remote-session-count":Bo.value,"terminal-theme-id":St.value,"initial-tab":m.value,onTerminalThemeChanged:Ao,onCommandNotifyThresholdChanged:le,onAppearanceChanged:Fi,onBindingsChanged:Dc,onProfilesChanged:ve,onRelayConfigChanged:Mo,onSessionCreated:kc,onClose:fr},null,8,["local-session-count","remote-session-count","terminal-theme-id","initial-tab"])):Z("",!0),Le.value?($(),bt(_W,{key:8,onConnected:Ma,onCancel:ue[7]||(ue[7]=Se=>Le.value=!1)})):Z("",!0),et.value?($(),bt(ZG,{key:9,onConnected:Ma,onClose:ue[8]||(ue[8]=Se=>et.value=!1)})):Z("",!0),he.value?($(),bt(lX,{key:10,"local-count":Qn.value,"remote-count":Bo.value,onConfirm:Xe,onCancel:Ue},null,8,["local-count","remote-count"])):Z("",!0),C(Ze).length>0?($(),bt(wX,{key:11,title:C(wt),count:C(Ze).length,"is-ai":C(tt),"is-running":C(gt),"is-remote":C(se),onConfirm:C(ge),onCancel:C(Oe)},null,8,["title","count","is-ai","is-running","is-remote","onConfirm","onCancel"])):Z("",!0),C(rn).snapshot?($(),bt(FX,{key:12,open:C(rn).open,snapshot:C(rn).snapshot,onRestore:C(Mn),onDiscard:C(xn)},null,8,["open","snapshot","onRestore","onDiscard"])):Z("",!0),Xt.value?($(),bt(jX,{key:13,onDismiss:jn,onInstall:is})):Z("",!0),Te(iJ,{bindings:mr.value},null,8,["bindings"])],6)}}}),qQ=Ct(jQ,[["__scopeId","data-v-0b5f6b42"]]);function YQ(){E0(),Xh(er.value),_t(er,e=>{Xh(e)})}async function GQ(e){var s,i;nw(),await Tw(e.i18n),YQ();const t=ZC(e.createPlatform);await((s=e.beforeMount)==null?void 0:s.call(e,t));const n=L0(qQ);n.use(U0()),n.provide("platform",t),n.config.globalProperties.$platform=t,n.mount("#app"),await((i=e.afterMount)==null?void 0:i.call(e,t,n)),tw("boot","renderer ready",{href:typeof location>"u"?"":location.pathname})}const XQ={localPty:!1,autoUpdate:!1,pluginHost:!1,windowControls:!1,systemClipboard:!0,notifications:typeof Notification<"u",fileDialog:!0,wailsBindings:!1,capacitor:!1},JQ={async load(){const e=D0();return e?{url:e.baseURL,token:e.sessionToken??"",session_expires_at:e.expiresAt??0,allow_insecure_relay:e.allowInsecure,remote_permission:"full",last_email:"",connected:!1,...e.realmId!==void 0?{realmId:e.realmId}:{},...e.homeInstanceURL!==void 0?{homeInstanceURL:e.homeInstanceURL}:{}}:null},async save(e){kg({baseURL:e.url,sessionToken:e.token||null,expiresAt:e.session_expires_at||null,allowInsecure:e.allow_insecure_relay,...e.realmId!==void 0?{realmId:e.realmId}:{},...e.homeInstanceURL!==void 0?{homeInstanceURL:e.homeInstanceURL}:{}})},async clear(){xg()},async fetchMe(){const{data:e}=await vn("/api/me");return e},async logout(){await N0()}},QQ={async closeSession(e){await vn(`/api/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})},async listShells(){return[]},async listRemoteSessions(){const{listSessions:e}=await co(async()=>{const{listSessions:n}=await import("./sessions-RpM2fLHY.js");return{listSessions:n}},__vite__mapDeps([3,4,1,5]));return(await e()).map(n=>({...n,session_id:n.id}))},async markSessionsSeen(e){await vn("/api/sessions/seen",{method:"POST",body:JSON.stringify(e)})},async getPins(){try{const e=localStorage.getItem("atterm.pinned_session_ids.value");if(e===null)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}},async setPins(e){localStorage.setItem("atterm.pinned_session_ids.value",JSON.stringify(e));const{notifyLocalChange:t}=await co(async()=>{const{notifyLocalChange:n}=await import("./prefsSync-C5tz9Q-s.js");return{notifyLocalChange:n}},__vite__mapDeps([6,4,1]));t("pinned_session_ids")},async listRelaySessions(){const{data:e}=await vn("/api/me/sessions");return e},async revokeRelaySession(e){await vn(`/api/me/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})},async signOutOtherRelaySessions(){const{data:e}=await vn("/api/me/sessions/sign-out-others",{method:"POST"});return e}},tb=(()=>{const e=new Map;return{on(t,n){let s=e.get(t);return s||(s=new Set,e.set(t,s)),s.add(n),()=>{s.delete(n)}},emit(t,n){const s=e.get(t);if(s)for(const i of Array.from(s))try{i(n)}catch(a){Lt("events","listener threw",{event:t,error:Rt(a)})}}}})(),ZQ={async showNotification(e,t,n){if(!(typeof Notification>"u"))try{const s=new Notification(e,{body:t});n&&(s.onclick=()=>tb.emit("notification:click",n))}catch{}},async getClipboardPaste(){var e;if(typeof navigator>"u"||!((e=navigator.clipboard)!=null&&e.readText))return{kind:"none"};try{const t=await navigator.clipboard.readText();return t?{kind:"text",text:t}:{kind:"none"}}catch{return{kind:"none"}}},async openExternalURL(e){window.open(e,"_blank","noopener")},async getEnvironment(){return{buildType:"web",platform:navigator.userAgent,arch:""}},async getAppVersion(){const{fetchVersion:e}=await co(async()=>{const{fetchVersion:t}=await import("./version-Dm8mqW3q.js");return{fetchVersion:t}},__vite__mapDeps([7,4,1]));return e()}},Dd="atterm.quick_templates.value",tg="atterm.templates_hidden.value",Md="atterm.aux_keys.value",eZ={async load(){try{const e=localStorage.getItem(Dd);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}},async save(e){localStorage.setItem(Dd,JSON.stringify(e));const{notifyLocalChange:t}=await co(async()=>{const{notifyLocalChange:n}=await import("./prefsSync-C5tz9Q-s.js");return{notifyLocalChange:n}},__vite__mapDeps([6,4,1]));t("quick_templates")},async clear(){localStorage.setItem(Dd,JSON.stringify([]));const{notifyLocalChange:e}=await co(async()=>{const{notifyLocalChange:t}=await import("./prefsSync-C5tz9Q-s.js");return{notifyLocalChange:t}},__vite__mapDeps([6,4,1]));e("quick_templates")},async loadHidden(){try{return JSON.parse(localStorage.getItem(tg)??"false")}catch{return!1}},async saveHidden(e){localStorage.setItem(tg,JSON.stringify(e))}},tZ={async load(){try{const e=localStorage.getItem(Md);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}},async save(e){localStorage.setItem(Md,JSON.stringify(e))},async clear(){localStorage.removeItem(Md)}};function nZ(){return Vw(()=>z0()),{caps:XQ,relay:JQ,sessions:QQ,system:ZQ,events:tb,templates:eZ,auxKeys:tZ}}GQ({i18n:{loadPreference:async()=>localStorage.getItem("atterm.locale"),savePreference:async e=>localStorage.setItem("atterm.locale",String(e))},createPlatform:nZ,beforeMount:e=>{const t=new M0(A0(),I0());$0(t);const n=()=>{t.pull().then(()=>e.events.emit("prefs:changed",void 0)).catch(()=>{})};n(),e.events.on("prefs:remote-changed",n)}});export{dw as C,ww as U,ai as X,Lt as a,_Z as b,pn as c,uZ as d,Rt as e,ma as f,dZ as g,vZ as h,Y4 as i,hZ as j,mZ as k,cZ as l,gZ as m,fZ as n,$t as o,hn as p,Fr as q,tQ as r,pZ as s,on as t,r_ as u}; diff --git a/internal/relay/web-dist/assets/index-BKS_vG9j.js b/internal/relay/web-dist/assets/index-Ck_fIti9.js similarity index 99% rename from internal/relay/web-dist/assets/index-BKS_vG9j.js rename to internal/relay/web-dist/assets/index-Ck_fIti9.js index ee12e220..d91b4b4e 100644 --- a/internal/relay/web-dist/assets/index-BKS_vG9j.js +++ b/internal/relay/web-dist/assets/index-Ck_fIti9.js @@ -1,4 +1,4 @@ -import{L as U,E as c,a as d,C as L}from"./index-DRFRE0Ca.js";import{J as M,Q as a,g as E,K as b,L as A,z as C,v as I,r as Y,u as J,x as D,w as K,c as N,O as z,E as B,t as F,j as H,I as OO}from"./FileExplorer-BumK3wPT.js";import{i as aO,c as QO,s as e}from"./index-DblmzGAc.js";import"./useI18n-lwZlSdSx.js";import"./index-Ci2MtInW.js";import"./prefsSync-C5tz9Q-s.js";import"./client-DMh7GjbV.js";import"./Switch-DguIL3dU.js";import"./auth-B3RxKR1W.js";const iO=316,rO=317,k=1,$O=2,eO=3,tO=4,lO=318,ZO=320,nO=321,oO=5,PO=6,sO=0,T=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],q=125,pO=59,_=47,cO=42,SO=43,XO=45,gO=60,mO=44,YO=63,xO=46,TO=91,_O=new L({start:!1,shift(O,Q){return Q==oO||Q==PO||Q==ZO?O:Q==nO},strict:!1}),uO=new c((O,Q)=>{let{next:i}=O;(i==q||i==-1||Q.context)&&O.acceptToken(lO)},{contextual:!0,fallback:!0}),dO=new c((O,Q)=>{let{next:i}=O,r;T.indexOf(i)>-1||i==_&&((r=O.peek(1))==_||r==cO)||i!=q&&i!=pO&&i!=-1&&!Q.context&&O.acceptToken(iO)},{contextual:!0}),kO=new c((O,Q)=>{O.next==TO&&!Q.context&&O.acceptToken(rO)},{contextual:!0}),fO=new c((O,Q)=>{let{next:i}=O;if(i==SO||i==XO){if(O.advance(),i==O.next){O.advance();let r=!Q.context&&Q.canShift(k);O.acceptToken(r?k:$O)}}else i==YO&&O.peek(1)==xO&&(O.advance(),O.advance(),(O.next<48||O.next>57)&&O.acceptToken(eO))},{contextual:!0});function x(O,Q){return O>=65&&O<=90||O>=97&&O<=122||O==95||O>=192||!Q&&O>=48&&O<=57}const yO=new c((O,Q)=>{if(O.next!=gO||!Q.dialectEnabled(sO)||(O.advance(),O.next==_))return;let i=0;for(;T.indexOf(O.next)>-1;)O.advance(),i++;if(x(O.next,!0)){for(O.advance(),i++;x(O.next,!1);)O.advance(),i++;for(;T.indexOf(O.next)>-1;)O.advance(),i++;if(O.next==mO)return;for(let r=0;;r++){if(r==7){if(!x(O.next,!0))return;break}if(O.next!="extends".charCodeAt(r))break;O.advance(),i++}}O.acceptToken(tO,-i)}),wO=M({"get set async static":a.modifier,"for while do if else switch try catch finally return throw break continue default case defer":a.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":a.operatorKeyword,"let var const using function class extends":a.definitionKeyword,"import export from":a.moduleKeyword,"with debugger new":a.keyword,TemplateString:a.special(a.string),super:a.atom,BooleanLiteral:a.bool,this:a.self,null:a.null,Star:a.modifier,VariableName:a.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":a.function(a.variableName),VariableDefinition:a.definition(a.variableName),Label:a.labelName,PropertyName:a.propertyName,PrivatePropertyName:a.special(a.propertyName),"CallExpression/MemberExpression/PropertyName":a.function(a.propertyName),"FunctionDeclaration/VariableDefinition":a.function(a.definition(a.variableName)),"ClassDeclaration/VariableDefinition":a.definition(a.className),"NewExpression/VariableName":a.className,PropertyDefinition:a.definition(a.propertyName),PrivatePropertyDefinition:a.definition(a.special(a.propertyName)),UpdateOp:a.updateOperator,"LineComment Hashbang":a.lineComment,BlockComment:a.blockComment,Number:a.number,String:a.string,Escape:a.escape,ArithOp:a.arithmeticOperator,LogicOp:a.logicOperator,BitOp:a.bitwiseOperator,CompareOp:a.compareOperator,RegExp:a.regexp,Equals:a.definitionOperator,Arrow:a.function(a.punctuation),": Spread":a.punctuation,"( )":a.paren,"[ ]":a.squareBracket,"{ }":a.brace,"InterpolationStart InterpolationEnd":a.special(a.brace),".":a.derefOperator,", ;":a.separator,"@":a.meta,TypeName:a.typeName,TypeDefinition:a.definition(a.typeName),"type enum interface implements namespace module declare":a.definitionKeyword,"abstract global Privacy readonly override":a.modifier,"is keyof unique infer asserts":a.operatorKeyword,JSXAttributeValue:a.attributeValue,JSXText:a.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":a.angleBracket,"JSXIdentifier JSXNameSpacedName":a.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":a.attributeName,"JSXBuiltin/JSXIdentifier":a.standard(a.tagName)}),bO={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},zO={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},qO={__proto__:null,"<":193},jO=U.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{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z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:_O,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,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r?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[dO,kO,fO,yO,2,3,4,5,6,7,8,9,10,11,12,13,14,uO,new d("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new d("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:O=>bO[O]||-1},{term:343,get:O=>zO[O]||-1},{term:95,get:O=>qO[O]||-1}],tokenPrec:15201}),j=[e("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),e("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),e("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),e("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),e("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),e(`try { +import{L as U,E as c,a as d,C as L}from"./index-Bf0-KgBD.js";import{J as M,Q as a,g as E,K as b,L as A,z as C,v as I,r as Y,u as J,x as D,w as K,c as N,O as z,E as B,t as F,j as H,I as OO}from"./FileExplorer-BmPzqkbb.js";import{i as aO,c as QO,s as e}from"./index-DDP-KCe3.js";import"./useI18n-D4u8zssu.js";import"./index-zrZBIArQ.js";import"./prefsSync-Dj3wNxrO.js";import"./client-n-fLEpOg.js";import"./Switch-BlSJOKEO.js";import"./auth-BBmiA1GG.js";const iO=316,rO=317,k=1,$O=2,eO=3,tO=4,lO=318,ZO=320,nO=321,oO=5,PO=6,sO=0,T=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],q=125,pO=59,_=47,cO=42,SO=43,XO=45,gO=60,mO=44,YO=63,xO=46,TO=91,_O=new L({start:!1,shift(O,Q){return Q==oO||Q==PO||Q==ZO?O:Q==nO},strict:!1}),uO=new c((O,Q)=>{let{next:i}=O;(i==q||i==-1||Q.context)&&O.acceptToken(lO)},{contextual:!0,fallback:!0}),dO=new c((O,Q)=>{let{next:i}=O,r;T.indexOf(i)>-1||i==_&&((r=O.peek(1))==_||r==cO)||i!=q&&i!=pO&&i!=-1&&!Q.context&&O.acceptToken(iO)},{contextual:!0}),kO=new c((O,Q)=>{O.next==TO&&!Q.context&&O.acceptToken(rO)},{contextual:!0}),fO=new c((O,Q)=>{let{next:i}=O;if(i==SO||i==XO){if(O.advance(),i==O.next){O.advance();let r=!Q.context&&Q.canShift(k);O.acceptToken(r?k:$O)}}else i==YO&&O.peek(1)==xO&&(O.advance(),O.advance(),(O.next<48||O.next>57)&&O.acceptToken(eO))},{contextual:!0});function x(O,Q){return O>=65&&O<=90||O>=97&&O<=122||O==95||O>=192||!Q&&O>=48&&O<=57}const yO=new c((O,Q)=>{if(O.next!=gO||!Q.dialectEnabled(sO)||(O.advance(),O.next==_))return;let i=0;for(;T.indexOf(O.next)>-1;)O.advance(),i++;if(x(O.next,!0)){for(O.advance(),i++;x(O.next,!1);)O.advance(),i++;for(;T.indexOf(O.next)>-1;)O.advance(),i++;if(O.next==mO)return;for(let r=0;;r++){if(r==7){if(!x(O.next,!0))return;break}if(O.next!="extends".charCodeAt(r))break;O.advance(),i++}}O.acceptToken(tO,-i)}),wO=M({"get set async static":a.modifier,"for while do if else switch try catch finally return throw break continue default case defer":a.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":a.operatorKeyword,"let var const using function class extends":a.definitionKeyword,"import export from":a.moduleKeyword,"with debugger new":a.keyword,TemplateString:a.special(a.string),super:a.atom,BooleanLiteral:a.bool,this:a.self,null:a.null,Star:a.modifier,VariableName:a.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":a.function(a.variableName),VariableDefinition:a.definition(a.variableName),Label:a.labelName,PropertyName:a.propertyName,PrivatePropertyName:a.special(a.propertyName),"CallExpression/MemberExpression/PropertyName":a.function(a.propertyName),"FunctionDeclaration/VariableDefinition":a.function(a.definition(a.variableName)),"ClassDeclaration/VariableDefinition":a.definition(a.className),"NewExpression/VariableName":a.className,PropertyDefinition:a.definition(a.propertyName),PrivatePropertyDefinition:a.definition(a.special(a.propertyName)),UpdateOp:a.updateOperator,"LineComment Hashbang":a.lineComment,BlockComment:a.blockComment,Number:a.number,String:a.string,Escape:a.escape,ArithOp:a.arithmeticOperator,LogicOp:a.logicOperator,BitOp:a.bitwiseOperator,CompareOp:a.compareOperator,RegExp:a.regexp,Equals:a.definitionOperator,Arrow:a.function(a.punctuation),": Spread":a.punctuation,"( )":a.paren,"[ ]":a.squareBracket,"{ }":a.brace,"InterpolationStart InterpolationEnd":a.special(a.brace),".":a.derefOperator,", ;":a.separator,"@":a.meta,TypeName:a.typeName,TypeDefinition:a.definition(a.typeName),"type enum interface implements namespace module declare":a.definitionKeyword,"abstract global Privacy readonly override":a.modifier,"is keyof unique infer asserts":a.operatorKeyword,JSXAttributeValue:a.attributeValue,JSXText:a.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":a.angleBracket,"JSXIdentifier JSXNameSpacedName":a.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":a.attributeName,"JSXBuiltin/JSXIdentifier":a.standard(a.tagName)}),bO={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},zO={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},qO={__proto__:null,"<":193},jO=U.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#Gs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1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:_O,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,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#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[dO,kO,fO,yO,2,3,4,5,6,7,8,9,10,11,12,13,14,uO,new d("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new d("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:O=>bO[O]||-1},{term:343,get:O=>zO[O]||-1},{term:95,get:O=>qO[O]||-1}],tokenPrec:15201}),j=[e("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),e("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),e("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),e("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),e("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),e(`try { \${} } catch (\${error}) { \${} diff --git a/internal/relay/web-dist/assets/index-DblmzGAc.js b/internal/relay/web-dist/assets/index-DDP-KCe3.js similarity index 99% rename from internal/relay/web-dist/assets/index-DblmzGAc.js rename to internal/relay/web-dist/assets/index-DDP-KCe3.js index 7537c0ea..07a37cc9 100644 --- a/internal/relay/web-dist/assets/index-DblmzGAc.js +++ b/internal/relay/web-dist/assets/index-DDP-KCe3.js @@ -1 +1 @@ -import{O as E,o as T,n as A,S as x,B as D,A as L,E as k,D as g,m as O,c as w,l as P,C as M,M as v,W as B,F as R,R as W}from"./FileExplorer-BumK3wPT.js";class te{constructor(t,e,n,i){this.state=t,this.pos=e,this.explicit=n,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=E(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),n=Math.max(e.from,this.pos-250),i=e.text.slice(n-e.from,this.pos-e.from),l=i.search(V(t));return l<0?null:{from:n+l,to:this.pos,text:i.slice(l)}}get aborted(){return this.abortListeners==null}addEventListener(t,e,n){t=="abort"&&this.abortListeners&&(this.abortListeners.push(e),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function S(o){let t=Object.keys(o).join(""),e=/\w/.test(t);return e&&(t=t.replace(/\w/g,"")),`[${e?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function j(o){let t=Object.create(null),e=Object.create(null);for(let{label:i}of o){t[i[0]]=!0;for(let l=1;ltypeof i=="string"?{label:i}:i),[e,n]=t.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:j(t);return i=>{let l=i.matchBefore(n);return l||i.explicit?{from:l?l.from:i.pos,options:t,validFor:e}:null}}function oe(o,t){return e=>{for(let n=E(e.state).resolveInner(e.pos,-1);n;n=n.parent){if(o.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return t(e)}}function V(o,t){var e;let{source:n}=o,i=n[n.length-1]!="$";return i?new RegExp(`(?:${n})${i?"$":""}`,(e=o.flags)!==null&&e!==void 0?e:o.ignoreCase?"i":""):o}const q=L.define(),z=w.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class H{constructor(t,e,n,i){this.field=t,this.line=e,this.from=n,this.to=i}}class b{constructor(t,e,n){this.field=t,this.from=e,this.to=n}map(t){let e=t.mapPos(this.from,-1,v.TrackDel),n=t.mapPos(this.to,1,v.TrackDel);return e==null||n==null?null:new b(this.field,e,n)}}class I{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let n=[],i=[e],l=t.doc.lineAt(e),f=/^\s*/.exec(l.text)[0];for(let r of this.lines){if(n.length){let a=f,c=/^\t*/.exec(r)[0].length;for(let s=0;snew b(r.field,i[r.line]+r.from,i[r.line]+r.to));return{text:n,ranges:p}}static parse(t){let e=[],n=[],i=[],l;for(let f of t.split(/\r\n?|\n/)){for(;l=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(f);){let p=l[1]?+l[1]:null,r=l[2]||l[3]||"",a=-1,c=r.replace(/\\[{}]/g,s=>s[1]);for(let s=0;s=a&&d.field++}for(let s of i)if(s.line==n.length&&s.from>l.index){let d=l[2]?3+(l[1]||"").length:2;s.from-=d,s.to-=d}i.push(new H(a,n.length,l.index,l.index+c.length)),f=f.slice(0,l.index)+r+f.slice(l.index+l[0].length)}f=f.replace(/\\([{}])/g,(p,r,a)=>{for(let c of i)c.line==n.length&&c.from>a&&(c.from--,c.to--);return r}),n.push(f)}return new I(n,i)}}let K=g.widget({widget:new class extends B{toDOM(){let o=document.createElement("span");return o.className="cm-snippetFieldPosition",o}ignoreEvent(){return!1}}}),N=g.mark({class:"cm-snippetField"});class m{constructor(t,e){this.ranges=t,this.active=e,this.deco=g.set(t.map(n=>(n.from==n.to?K:N).range(n.from,n.to)),!0)}map(t){let e=[];for(let n of this.ranges){let i=n.map(t);if(!i)return null;e.push(i)}return new m(e,this.active)}selectionInsideField(t){return t.ranges.every(e=>this.ranges.some(n=>n.field==this.active&&n.from<=e.from&&n.to>=e.to))}}const h=x.define({map(o,t){return o&&o.map(t)}}),X=x.define(),u=O.define({create(){return null},update(o,t){for(let e of t.effects){if(e.is(h))return e.value;if(e.is(X)&&o)return new m(o.ranges,e.value)}return o&&t.docChanged&&(o=o.map(t.changes)),o&&t.selection&&!o.selectionInsideField(t.selection)&&(o=null),o},provide:o=>w.decorations.from(o,t=>t?t.deco:g.none)});function y(o,t){return k.create(o.filter(e=>e.field==t).map(e=>k.range(e.from,e.to)))}function U(o){let t=I.parse(o);return(e,n,i,l)=>{let{text:f,ranges:p}=t.instantiate(e.state,i),{main:r}=e.state.selection,a={changes:{from:i,to:l==r.from?r.to:l,insert:A.of(f)},scrollIntoView:!0,annotations:n?[q.of(n),T.userEvent.of("input.complete")]:void 0};if(p.length&&(a.selection=y(p,0)),p.some(c=>c.field>0)){let c=new m(p,0),s=a.effects=[h.of(c)];e.state.field(u,!1)===void 0&&s.push(x.appendConfig.of([u,Z,_,z]))}e.dispatch(e.state.update(a))}}function $(o){return({state:t,dispatch:e})=>{let n=t.field(u,!1);if(!n||o<0&&n.active==0)return!1;let i=n.active+o,l=o>0&&!n.ranges.some(f=>f.field==i+o);return e(t.update({selection:y(n.ranges,i),effects:h.of(l?null:new m(n.ranges,i)),scrollIntoView:!0})),!0}}const Y=({state:o,dispatch:t})=>o.field(u,!1)?(t(o.update({effects:h.of(null)})),!0):!1,G=$(1),J=$(-1),Q=[{key:"Tab",run:G,shift:J},{key:"Escape",run:Y}],F=R.define({combine(o){return o.length?o[0]:Q}}),Z=P.highest(M.compute([F],o=>o.facet(F)));function ie(o,t){return{...t,apply:U(o)}}const _=w.domEventHandlers({mousedown(o,t){let e=t.state.field(u,!1),n;if(!e||(n=t.posAtCoords({x:o.clientX,y:o.clientY}))==null)return!1;let i=e.ranges.find(l=>l.from<=n&&l.to>=n);return!i||i.field==e.active?!1:(t.dispatch({selection:y(e.ranges,i.field),effects:h.of(e.ranges.some(l=>l.field>i.field)?new m(e.ranges,i.field):null),scrollIntoView:!0}),!0)}}),C=new class extends W{};C.startSide=1;C.endSide=-1;export{te as C,ne as c,oe as i,ie as s}; +import{O as E,o as T,n as A,S as x,B as D,A as L,E as k,D as g,m as O,c as w,l as P,C as M,M as v,W as B,F as R,R as W}from"./FileExplorer-BmPzqkbb.js";class te{constructor(t,e,n,i){this.state=t,this.pos=e,this.explicit=n,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=E(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),n=Math.max(e.from,this.pos-250),i=e.text.slice(n-e.from,this.pos-e.from),l=i.search(V(t));return l<0?null:{from:n+l,to:this.pos,text:i.slice(l)}}get aborted(){return this.abortListeners==null}addEventListener(t,e,n){t=="abort"&&this.abortListeners&&(this.abortListeners.push(e),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function S(o){let t=Object.keys(o).join(""),e=/\w/.test(t);return e&&(t=t.replace(/\w/g,"")),`[${e?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function j(o){let t=Object.create(null),e=Object.create(null);for(let{label:i}of o){t[i[0]]=!0;for(let l=1;ltypeof i=="string"?{label:i}:i),[e,n]=t.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:j(t);return i=>{let l=i.matchBefore(n);return l||i.explicit?{from:l?l.from:i.pos,options:t,validFor:e}:null}}function oe(o,t){return e=>{for(let n=E(e.state).resolveInner(e.pos,-1);n;n=n.parent){if(o.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return t(e)}}function V(o,t){var e;let{source:n}=o,i=n[n.length-1]!="$";return i?new RegExp(`(?:${n})${i?"$":""}`,(e=o.flags)!==null&&e!==void 0?e:o.ignoreCase?"i":""):o}const q=L.define(),z=w.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class H{constructor(t,e,n,i){this.field=t,this.line=e,this.from=n,this.to=i}}class b{constructor(t,e,n){this.field=t,this.from=e,this.to=n}map(t){let e=t.mapPos(this.from,-1,v.TrackDel),n=t.mapPos(this.to,1,v.TrackDel);return e==null||n==null?null:new b(this.field,e,n)}}class I{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let n=[],i=[e],l=t.doc.lineAt(e),f=/^\s*/.exec(l.text)[0];for(let r of this.lines){if(n.length){let a=f,c=/^\t*/.exec(r)[0].length;for(let s=0;snew b(r.field,i[r.line]+r.from,i[r.line]+r.to));return{text:n,ranges:p}}static parse(t){let e=[],n=[],i=[],l;for(let f of t.split(/\r\n?|\n/)){for(;l=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(f);){let p=l[1]?+l[1]:null,r=l[2]||l[3]||"",a=-1,c=r.replace(/\\[{}]/g,s=>s[1]);for(let s=0;s=a&&d.field++}for(let s of i)if(s.line==n.length&&s.from>l.index){let d=l[2]?3+(l[1]||"").length:2;s.from-=d,s.to-=d}i.push(new H(a,n.length,l.index,l.index+c.length)),f=f.slice(0,l.index)+r+f.slice(l.index+l[0].length)}f=f.replace(/\\([{}])/g,(p,r,a)=>{for(let c of i)c.line==n.length&&c.from>a&&(c.from--,c.to--);return r}),n.push(f)}return new I(n,i)}}let K=g.widget({widget:new class extends B{toDOM(){let o=document.createElement("span");return o.className="cm-snippetFieldPosition",o}ignoreEvent(){return!1}}}),N=g.mark({class:"cm-snippetField"});class m{constructor(t,e){this.ranges=t,this.active=e,this.deco=g.set(t.map(n=>(n.from==n.to?K:N).range(n.from,n.to)),!0)}map(t){let e=[];for(let n of this.ranges){let i=n.map(t);if(!i)return null;e.push(i)}return new m(e,this.active)}selectionInsideField(t){return t.ranges.every(e=>this.ranges.some(n=>n.field==this.active&&n.from<=e.from&&n.to>=e.to))}}const h=x.define({map(o,t){return o&&o.map(t)}}),X=x.define(),u=O.define({create(){return null},update(o,t){for(let e of t.effects){if(e.is(h))return e.value;if(e.is(X)&&o)return new m(o.ranges,e.value)}return o&&t.docChanged&&(o=o.map(t.changes)),o&&t.selection&&!o.selectionInsideField(t.selection)&&(o=null),o},provide:o=>w.decorations.from(o,t=>t?t.deco:g.none)});function y(o,t){return k.create(o.filter(e=>e.field==t).map(e=>k.range(e.from,e.to)))}function U(o){let t=I.parse(o);return(e,n,i,l)=>{let{text:f,ranges:p}=t.instantiate(e.state,i),{main:r}=e.state.selection,a={changes:{from:i,to:l==r.from?r.to:l,insert:A.of(f)},scrollIntoView:!0,annotations:n?[q.of(n),T.userEvent.of("input.complete")]:void 0};if(p.length&&(a.selection=y(p,0)),p.some(c=>c.field>0)){let c=new m(p,0),s=a.effects=[h.of(c)];e.state.field(u,!1)===void 0&&s.push(x.appendConfig.of([u,Z,_,z]))}e.dispatch(e.state.update(a))}}function $(o){return({state:t,dispatch:e})=>{let n=t.field(u,!1);if(!n||o<0&&n.active==0)return!1;let i=n.active+o,l=o>0&&!n.ranges.some(f=>f.field==i+o);return e(t.update({selection:y(n.ranges,i),effects:h.of(l?null:new m(n.ranges,i)),scrollIntoView:!0})),!0}}const Y=({state:o,dispatch:t})=>o.field(u,!1)?(t(o.update({effects:h.of(null)})),!0):!1,G=$(1),J=$(-1),Q=[{key:"Tab",run:G,shift:J},{key:"Escape",run:Y}],F=R.define({combine(o){return o.length?o[0]:Q}}),Z=P.highest(M.compute([F],o=>o.facet(F)));function ie(o,t){return{...t,apply:U(o)}}const _=w.domEventHandlers({mousedown(o,t){let e=t.state.field(u,!1),n;if(!e||(n=t.posAtCoords({x:o.clientX,y:o.clientY}))==null)return!1;let i=e.ranges.find(l=>l.from<=n&&l.to>=n);return!i||i.field==e.active?!1:(t.dispatch({selection:y(e.ranges,i.field),effects:h.of(e.ranges.some(l=>l.field>i.field)?new m(e.ranges,i.field):null),scrollIntoView:!0}),!0)}}),C=new class extends W{};C.startSide=1;C.endSide=-1;export{te as C,ne as c,oe as i,ie as s}; diff --git a/internal/relay/web-dist/assets/index-DR4XN96w.js b/internal/relay/web-dist/assets/index-DPMPlQhe.js similarity index 99% rename from internal/relay/web-dist/assets/index-DR4XN96w.js rename to internal/relay/web-dist/assets/index-DPMPlQhe.js index 52a27784..de15ed2b 100644 --- a/internal/relay/web-dist/assets/index-DR4XN96w.js +++ b/internal/relay/web-dist/assets/index-DPMPlQhe.js @@ -1 +1 @@ -import{L as V,E as X}from"./index-DRFRE0Ca.js";import{J as d,Q as $,g as Z,H as R,L as s,z as t,r as c,u as y,x as U,w as l}from"./FileExplorer-BumK3wPT.js";import{html as w}from"./index-DZaDIMfZ.js";import"./useI18n-lwZlSdSx.js";import"./index-Ci2MtInW.js";import"./prefsSync-C5tz9Q-s.js";import"./client-DMh7GjbV.js";import"./Switch-DguIL3dU.js";import"./auth-B3RxKR1W.js";import"./index-gs2Ov3d4.js";import"./index-BKS_vG9j.js";import"./index-DblmzGAc.js";const W=1,p=2,q=275,u=3,b=276,_=277,m=278,f=4,k=5,G=6,x=7,r=8,h=9,v=10,g=11,j=12,E=13,I=14,N=15,L=16,F=17,C=18,H=19,A=20,K=21,D=22,B=23,M=24,J=25,OO=26,$O=27,QO=28,iO=29,aO=30,TO=31,PO=32,XO=33,SO=34,cO=35,eO=36,oO=37,_O=38,rO=39,nO=40,zO=41,YO=42,VO=43,dO=44,ZO=45,RO=46,sO=47,tO=48,yO=49,UO=50,lO=51,wO=52,WO=53,pO=54,qO=55,uO=56,bO=57,mO=58,fO=59,kO=60,GO=61,xO=62,e=63,hO=64,vO=65,gO=66,jO={abstract:f,and:k,array:G,as:x,true:r,false:r,break:h,case:v,catch:g,clone:j,const:E,continue:I,declare:L,default:N,do:F,echo:C,else:H,elseif:A,enddeclare:K,endfor:D,endforeach:B,endif:M,endswitch:J,endwhile:OO,enum:$O,extends:QO,final:iO,finally:aO,fn:TO,for:PO,foreach:XO,from:SO,function:cO,global:eO,goto:oO,if:_O,implements:rO,include:nO,include_once:zO,instanceof:YO,insteadof:VO,interface:dO,list:ZO,match:RO,namespace:sO,new:tO,null:yO,or:UO,print:lO,readonly:wO,require:WO,require_once:pO,return:qO,switch:uO,throw:bO,trait:mO,try:fO,unset:kO,use:GO,var:xO,public:e,private:e,protected:e,while:hO,xor:vO,yield:gO,__proto__:null};function n(O){let Q=jO[O.toLowerCase()];return Q??-1}function z(O){return O==9||O==10||O==13||O==32}function Y(O){return O>=97&&O<=122||O>=65&&O<=90}function T(O){return O==95||O>=128||Y(O)}function o(O){return O>=48&&O<=55||O>=97&&O<=102||O>=65&&O<=70}const EO={int:!0,integer:!0,bool:!0,boolean:!0,float:!0,double:!0,real:!0,string:!0,array:!0,object:!0,unset:!0,__proto__:null},IO=new X(O=>{if(O.next==40){O.advance();let Q=0;for(;z(O.peek(Q));)Q++;let i="",a;for(;Y(a=O.peek(Q));)i+=String.fromCharCode(a),Q++;for(;z(O.peek(Q));)Q++;O.peek(Q)==41&&EO[i.toLowerCase()]&&O.acceptToken(W)}else if(O.next==60&&O.peek(1)==60&&O.peek(2)==60){for(let a=0;a<3;a++)O.advance();for(;O.next==32||O.next==9;)O.advance();let Q=O.next==39;if(Q&&O.advance(),!T(O.next))return;let i=String.fromCharCode(O.next);for(;O.advance(),!(!T(O.next)&&!(O.next>=48&&O.next<=55));)i+=String.fromCharCode(O.next);if(Q){if(O.next!=39)return;O.advance()}if(O.next!=10&&O.next!=13)return;for(;;){let a=O.next==10||O.next==13;if(O.advance(),O.next<0)return;if(a){for(;O.next==32||O.next==9;)O.advance();let P=!0;for(let S=0;S{O.next<0&&O.acceptToken(m)}),LO=new X((O,Q)=>{O.next==63&&Q.canShift(_)&&O.peek(1)==62&&O.acceptToken(_)});function FO(O){let Q=O.peek(1);if(Q==110||Q==114||Q==116||Q==118||Q==101||Q==102||Q==92||Q==36||Q==34||Q==123)return 2;if(Q>=48&&Q<=55){let i=2,a;for(;i<5&&(a=O.peek(i))>=48&&a<=55;)i++;return i}if(Q==120&&o(O.peek(2)))return o(O.peek(3))?4:3;if(Q==117&&O.peek(2)==123)for(let i=3;;i++){let a=O.peek(i);if(a==125)return i==2?0:i+1;if(!o(a))break}return 0}const CO=new X((O,Q)=>{let i=!1;for(;!(O.next==34||O.next<0||O.next==36&&(T(O.peek(1))||O.peek(1)==123)||O.next==123&&O.peek(1)==36);i=!0){if(O.next==92){let a=FO(O);if(a){if(i)break;return O.acceptToken(u,a)}}else if(!i&&(O.next==91||O.next==45&&O.peek(1)==62&&T(O.peek(2))||O.next==63&&O.peek(1)==45&&O.peek(2)==62&&T(O.peek(3)))&&Q.canShift(b))break;O.advance()}i&&O.acceptToken(q)}),HO=d({"Visibility abstract final static":$.modifier,"for foreach while do if else elseif switch try catch finally return throw break continue default case":$.controlKeyword,"endif endfor endforeach endswitch endwhile declare enddeclare goto match":$.controlKeyword,"and or xor yield unset clone instanceof insteadof":$.operatorKeyword,"function fn class trait implements extends const enum global interface use var":$.definitionKeyword,"include include_once require require_once namespace":$.moduleKeyword,"new from echo print array list as":$.keyword,null:$.null,Boolean:$.bool,VariableName:$.variableName,"NamespaceName/...":$.namespace,"NamedType/...":$.typeName,Name:$.name,"CallExpression/Name":$.function($.variableName),"LabelStatement/Name":$.labelName,"MemberExpression/Name":$.propertyName,"MemberExpression/VariableName":$.special($.propertyName),"ScopedExpression/ClassMemberName/Name":$.propertyName,"ScopedExpression/ClassMemberName/VariableName":$.special($.propertyName),"CallExpression/MemberExpression/Name":$.function($.propertyName),"CallExpression/ScopedExpression/ClassMemberName/Name":$.function($.propertyName),"MethodDeclaration/Name":$.function($.definition($.variableName)),"FunctionDefinition/Name":$.function($.definition($.variableName)),"ClassDeclaration/Name":$.definition($.className),UpdateOp:$.updateOperator,ArithOp:$.arithmeticOperator,"LogicOp IntersectionType/&":$.logicOperator,BitOp:$.bitwiseOperator,CompareOp:$.compareOperator,ControlOp:$.controlOperator,AssignOp:$.definitionOperator,"$ ConcatOp":$.operator,LineComment:$.lineComment,BlockComment:$.blockComment,Integer:$.integer,Float:$.float,String:$.string,ShellExpression:$.special($.string),"=> ->":$.punctuation,"( )":$.paren,"#[ [ ]":$.squareBracket,"${ { }":$.brace,"-> ?->":$.derefOperator,", ; :: : \\":$.separator,"PhpOpen PhpClose":$.processingInstruction}),AO={__proto__:null,static:325,STATIC:325,class:351,CLASS:351},KO=V.deserialize({version:14,states:"%#[Q`OWOOQhQaOOP%oO`OOOOO#t'#Hh'#HhO%tO#|O'#DuOOO#u'#Dx'#DxQ&SOWO'#DxO&XO$VOOOOQ#u'#Dy'#DyO&lQaO'#D}O'[QdO'#EQO+QQdO'#IqO+_QdO'#ERO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",nodeNames:"⚠ ( HeredocString EscapeSequence abstract LogicOp array as Boolean break case catch clone const continue default declare do echo else elseif enddeclare endfor endforeach endif endswitch endwhile enum extends final finally fn for foreach from function global goto if implements include include_once LogicOp insteadof interface list match namespace new null LogicOp print readonly require require_once return switch throw trait try unset use var Visibility while LogicOp yield LineComment BlockComment TextInterpolation PhpClose Text PhpOpen Template TextInterpolation EmptyStatement ; } { Block : LabelStatement Name ExpressionStatement ConditionalExpression LogicOp MatchExpression ) ( ParenthesizedExpression MatchBlock MatchArm , => AssignmentExpression ArrayExpression ValueList & VariadicUnpacking ... Pair [ ] ListExpression ValueList Pair Pair SubscriptExpression MemberExpression -> ?-> Name VariableName DynamicVariable $ ${ CallExpression ArgList NamedArgument SpreadArgument CastExpression UnionType LogicOp IntersectionType OptionalType NamedType QualifiedName \\ NamespaceName Name NamespaceName Name ScopedExpression :: ClassMemberName DynamicMemberName AssignOp UpdateExpression UpdateOp YieldExpression BinaryExpression LogicOp LogicOp LogicOp BitOp BitOp BitOp CompareOp CompareOp BitOp ArithOp ConcatOp ArithOp ArithOp IncludeExpression RequireExpression CloneExpression UnaryExpression ControlOp LogicOp PrintIntrinsic FunctionExpression static ParamList Parameter #[ Attributes Attribute VariadicParameter PropertyParameter PropertyHooks PropertyHook UseList ArrowFunction NewExpression class BaseClause ClassInterfaceClause DeclarationList ConstDeclaration VariableDeclarator PropertyDeclaration VariableDeclarator MethodDeclaration UseDeclaration UseList UseInsteadOfClause UseAsClause UpdateExpression ArithOp ShellExpression ThrowExpression Integer Float String MemberExpression SubscriptExpression UnaryExpression ArithOp Interpolation String IfStatement ColonBlock SwitchStatement Block CaseStatement DefaultStatement ColonBlock WhileStatement EmptyStatement DoStatement ForStatement ForSpec SequenceExpression ForeachStatement ForSpec Pair GotoStatement ContinueStatement BreakStatement ReturnStatement TryStatement CatchDeclarator DeclareStatement EchoStatement UnsetStatement ConstDeclaration FunctionDefinition ClassDeclaration InterfaceDeclaration TraitDeclaration EnumDeclaration EnumBody EnumCase NamespaceDefinition NamespaceUseDeclaration UseGroup UseClause UseClause GlobalDeclaration FunctionStaticDeclaration Program",maxTerm:318,nodeProps:[["group",-36,2,8,49,82,84,86,89,94,95,103,107,108,112,113,116,120,126,132,137,139,140,154,155,156,157,160,161,173,174,188,190,191,192,193,194,200,"Expression",-28,75,79,81,83,201,203,208,210,211,214,217,218,219,220,221,223,224,225,226,227,228,229,230,231,234,235,239,240,"Statement",-4,121,123,124,125,"Type"],["isolate",-4,67,68,71,200,""],["openedBy",70,"phpOpen",77,"{",87,"(",102,"#["],["closedBy",72,"phpClose",78,"}",88,")",165,"]"]],propSources:[HO],skippedNodes:[0],repeatNodeCount:32,tokenData:"!GQ_R!]OX$zXY&^YZ'sZ]$z]^&^^p$zpq&^qr)Rrs+Pst+otu2buv5evw6rwx8Vxy>]yz>yz{?g{|@}|}Bb}!OCO!O!PDh!P!QKT!Q!R!!o!R![!$q![!]!,P!]!^!-a!^!_!-}!_!`!1S!`!a!2d!a!b!3t!b!c!7^!c!d!7z!d!e!9Y!e!}!7z!}#O!;b#O#P!V<%lO8VR9WV'TP%`QOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X<%lO9mQ9rV%`QOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X<%lO9mQ:^O%`QQ:aRO;'S9m;'S;=`:j;=`O9mQ:oW%`QOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X;=`<%l9m<%lO9mQ;[P;=`<%l9mR;fV'TP%`QOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zRV<%l~8V~O8V~~%fR=OW'TPOY8VYZ9PZ!^8V!^!_;{!_;'S8V;'S;=`=h;=`<%l9m<%lO8VR=mW%`QOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X;=`<%l8V<%lO9mR>YP;=`<%l8VR>dV!zQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zV?QV!yU'TP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P#S!?]#S#T!@n#T;'S!?];'S;=`!@s;=`<%l!?]<%lO!?]Q!@sO%UQQ!@vP;=`<%l!?]R!@|]OY!=yYZ!>qZ!a!=y!a!b!?]!b#O!=y#O#P!Au#P#S!=y#S#T!CP#T;'S!=y;'S;=`!Cm<%l~!=y~O!=y~~%fR!AzW'TPOY!=yYZ!>qZ!^!=y!^!_!@y!_;'S!=y;'S;=`!Bd;=`<%l!?]<%lO!=yR!BgWO#O!?]#O#P!?u#P#S!?]#S#T!@n#T;'S!?];'S;=`!@s;=`<%l!=y<%lO!?]R!CWV%UQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!CpP;=`<%l!=y_!CzV!p^'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_!DjY$UQ#n['TPOY$zYZ%fZ!^$z!^!_%k!_!`6U!`#p$z#p#q!EY#q;'S$z;'S;=`&W<%lO$zR!EaV$SQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!E}V!oQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!FkV$eQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z",tokenizers:[IO,CO,LO,0,1,2,3,NO],topRules:{Template:[0,73],Program:[1,241]},dynamicPrecedences:{298:1},specialized:[{term:284,get:(O,Q)=>n(O)<<1,external:n},{term:284,get:O=>AO[O]||-1}],tokenPrec:29889}),DO=s.define({name:"php",parser:KO.configure({props:[t.add({IfStatement:c({except:/^\s*({|else\b|elseif\b|endif\b)/}),TryStatement:c({except:/^\s*({|catch\b|finally\b)/}),SwitchBody:O=>{let Q=O.textAfter,i=/^\s*\}/.test(Q),a=/^\s*(case|default)\b/.test(Q);return O.baseIndent+(i?0:a?1:2)*O.unit},ColonBlock:O=>O.baseIndent+O.unit,"Block EnumBody DeclarationList":y({closing:"}"}),ArrowFunction:O=>O.baseIndent+O.unit,"String BlockComment":()=>null,Statement:c({except:/^({|end(for|foreach|switch|while)\b)/})}),U.add({"Block EnumBody DeclarationList SwitchBody ArrayExpression ValueList":l,ColonBlock(O){return{from:O.from+1,to:O.to}},BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*(?:case |default:|end(?:if|for(?:each)?|switch|while)|else(?:if)?|\{|\})$/,wordChars:"$",closeBrackets:{stringPrefixes:["b","B"]}}});function c$(O={}){let Q=[],i;if(O.baseLanguage!==null)if(O.baseLanguage)i=O.baseLanguage;else{let a=w({matchClosingTags:!1});Q.push(a.support),i=a.language}return new Z(DO.configure({wrap:i&&R(a=>a.type.isTop?{parser:i.parser,overlay:P=>P.name=="Text"}:null),top:O.plain?"Program":"Template"}),Q)}export{c$ as php,DO as phpLanguage}; +import{L as V,E as X}from"./index-Bf0-KgBD.js";import{J as d,Q as $,g as Z,H as R,L as s,z as t,r as c,u as y,x as U,w as l}from"./FileExplorer-BmPzqkbb.js";import{html as w}from"./index-DlIw5VzR.js";import"./useI18n-D4u8zssu.js";import"./index-zrZBIArQ.js";import"./prefsSync-Dj3wNxrO.js";import"./client-n-fLEpOg.js";import"./Switch-BlSJOKEO.js";import"./auth-BBmiA1GG.js";import"./index-8SnOqa2v.js";import"./index-Ck_fIti9.js";import"./index-DDP-KCe3.js";const W=1,p=2,q=275,u=3,b=276,_=277,m=278,f=4,k=5,G=6,x=7,r=8,h=9,v=10,g=11,j=12,E=13,I=14,N=15,L=16,F=17,C=18,H=19,A=20,K=21,D=22,B=23,M=24,J=25,OO=26,$O=27,QO=28,iO=29,aO=30,TO=31,PO=32,XO=33,SO=34,cO=35,eO=36,oO=37,_O=38,rO=39,nO=40,zO=41,YO=42,VO=43,dO=44,ZO=45,RO=46,sO=47,tO=48,yO=49,UO=50,lO=51,wO=52,WO=53,pO=54,qO=55,uO=56,bO=57,mO=58,fO=59,kO=60,GO=61,xO=62,e=63,hO=64,vO=65,gO=66,jO={abstract:f,and:k,array:G,as:x,true:r,false:r,break:h,case:v,catch:g,clone:j,const:E,continue:I,declare:L,default:N,do:F,echo:C,else:H,elseif:A,enddeclare:K,endfor:D,endforeach:B,endif:M,endswitch:J,endwhile:OO,enum:$O,extends:QO,final:iO,finally:aO,fn:TO,for:PO,foreach:XO,from:SO,function:cO,global:eO,goto:oO,if:_O,implements:rO,include:nO,include_once:zO,instanceof:YO,insteadof:VO,interface:dO,list:ZO,match:RO,namespace:sO,new:tO,null:yO,or:UO,print:lO,readonly:wO,require:WO,require_once:pO,return:qO,switch:uO,throw:bO,trait:mO,try:fO,unset:kO,use:GO,var:xO,public:e,private:e,protected:e,while:hO,xor:vO,yield:gO,__proto__:null};function n(O){let Q=jO[O.toLowerCase()];return Q??-1}function z(O){return O==9||O==10||O==13||O==32}function Y(O){return O>=97&&O<=122||O>=65&&O<=90}function T(O){return O==95||O>=128||Y(O)}function o(O){return O>=48&&O<=55||O>=97&&O<=102||O>=65&&O<=70}const EO={int:!0,integer:!0,bool:!0,boolean:!0,float:!0,double:!0,real:!0,string:!0,array:!0,object:!0,unset:!0,__proto__:null},IO=new X(O=>{if(O.next==40){O.advance();let Q=0;for(;z(O.peek(Q));)Q++;let i="",a;for(;Y(a=O.peek(Q));)i+=String.fromCharCode(a),Q++;for(;z(O.peek(Q));)Q++;O.peek(Q)==41&&EO[i.toLowerCase()]&&O.acceptToken(W)}else if(O.next==60&&O.peek(1)==60&&O.peek(2)==60){for(let a=0;a<3;a++)O.advance();for(;O.next==32||O.next==9;)O.advance();let Q=O.next==39;if(Q&&O.advance(),!T(O.next))return;let i=String.fromCharCode(O.next);for(;O.advance(),!(!T(O.next)&&!(O.next>=48&&O.next<=55));)i+=String.fromCharCode(O.next);if(Q){if(O.next!=39)return;O.advance()}if(O.next!=10&&O.next!=13)return;for(;;){let a=O.next==10||O.next==13;if(O.advance(),O.next<0)return;if(a){for(;O.next==32||O.next==9;)O.advance();let P=!0;for(let S=0;S{O.next<0&&O.acceptToken(m)}),LO=new X((O,Q)=>{O.next==63&&Q.canShift(_)&&O.peek(1)==62&&O.acceptToken(_)});function FO(O){let Q=O.peek(1);if(Q==110||Q==114||Q==116||Q==118||Q==101||Q==102||Q==92||Q==36||Q==34||Q==123)return 2;if(Q>=48&&Q<=55){let i=2,a;for(;i<5&&(a=O.peek(i))>=48&&a<=55;)i++;return i}if(Q==120&&o(O.peek(2)))return o(O.peek(3))?4:3;if(Q==117&&O.peek(2)==123)for(let i=3;;i++){let a=O.peek(i);if(a==125)return i==2?0:i+1;if(!o(a))break}return 0}const CO=new X((O,Q)=>{let i=!1;for(;!(O.next==34||O.next<0||O.next==36&&(T(O.peek(1))||O.peek(1)==123)||O.next==123&&O.peek(1)==36);i=!0){if(O.next==92){let a=FO(O);if(a){if(i)break;return O.acceptToken(u,a)}}else if(!i&&(O.next==91||O.next==45&&O.peek(1)==62&&T(O.peek(2))||O.next==63&&O.peek(1)==45&&O.peek(2)==62&&T(O.peek(3)))&&Q.canShift(b))break;O.advance()}i&&O.acceptToken(q)}),HO=d({"Visibility abstract final static":$.modifier,"for foreach while do if else elseif switch try catch finally return throw break continue default case":$.controlKeyword,"endif endfor endforeach endswitch endwhile declare enddeclare goto match":$.controlKeyword,"and or xor yield unset clone instanceof insteadof":$.operatorKeyword,"function fn class trait implements extends const enum global interface use var":$.definitionKeyword,"include include_once require require_once namespace":$.moduleKeyword,"new from echo print array list as":$.keyword,null:$.null,Boolean:$.bool,VariableName:$.variableName,"NamespaceName/...":$.namespace,"NamedType/...":$.typeName,Name:$.name,"CallExpression/Name":$.function($.variableName),"LabelStatement/Name":$.labelName,"MemberExpression/Name":$.propertyName,"MemberExpression/VariableName":$.special($.propertyName),"ScopedExpression/ClassMemberName/Name":$.propertyName,"ScopedExpression/ClassMemberName/VariableName":$.special($.propertyName),"CallExpression/MemberExpression/Name":$.function($.propertyName),"CallExpression/ScopedExpression/ClassMemberName/Name":$.function($.propertyName),"MethodDeclaration/Name":$.function($.definition($.variableName)),"FunctionDefinition/Name":$.function($.definition($.variableName)),"ClassDeclaration/Name":$.definition($.className),UpdateOp:$.updateOperator,ArithOp:$.arithmeticOperator,"LogicOp IntersectionType/&":$.logicOperator,BitOp:$.bitwiseOperator,CompareOp:$.compareOperator,ControlOp:$.controlOperator,AssignOp:$.definitionOperator,"$ ConcatOp":$.operator,LineComment:$.lineComment,BlockComment:$.blockComment,Integer:$.integer,Float:$.float,String:$.string,ShellExpression:$.special($.string),"=> ->":$.punctuation,"( )":$.paren,"#[ [ ]":$.squareBracket,"${ { }":$.brace,"-> ?->":$.derefOperator,", ; :: : \\":$.separator,"PhpOpen PhpClose":$.processingInstruction}),AO={__proto__:null,static:325,STATIC:325,class:351,CLASS:351},KO=V.deserialize({version:14,states:"%#[Q`OWOOQhQaOOP%oO`OOOOO#t'#Hh'#HhO%tO#|O'#DuOOO#u'#Dx'#DxQ&SOWO'#DxO&XO$VOOOOQ#u'#Dy'#DyO&lQaO'#D}O'[QdO'#EQO+QQdO'#IqO+_QdO'#ERO-RQaO'#EXO/bQ`O'#EUO/gQ`O'#E_O2UQaO'#E_O2]Q`O'#EgO2bQ`O'#EqO-RQaO'#EqO2mQpO'#FOO2rQ`O'#FOOOQS'#Iq'#IqO2wQ`O'#ExOOQS'#Ih'#IhO5SQdO'#IeO9UQeO'#F]O-RQaO'#FlO-RQaO'#FmO-RQaO'#FnO-RQaO'#FoO-RQaO'#FoO-RQaO'#FrOOQO'#Ir'#IrO9cQ`O'#FxOOQO'#Ht'#HtO9kQ`O'#HXO:VQ`O'#FsO:bQ`O'#HfO:mQ`O'#GPO:uQaO'#GQO-RQaO'#G`O-RQaO'#GcO;bOrO'#GfOOQS'#JP'#JPOOQS'#JO'#JOOOQS'#Ie'#IeO/bQ`O'#GmO/bQ`O'#GoO/bQ`O'#GtOhQaO'#GvO;iQ`O'#GwO;nQ`O'#GzO:]Q`O'#G}O;sQeO'#HOO;sQeO'#HPO;sQeO'#HQO;}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e,g,m-`-a-t-z.[.u.w/P/X/y0O0T0e0s0}1O1R1S1W1k1o1{2W2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_T$x{$|Q(q%QQ(v%TQ(y%VR2b1WQ%c!]Q(u%SQ,d(tQ/W,cQ/Y,eQ1Q/XR2_1RQ%q!fR)m%rR/p-O",nodeNames:"⚠ ( HeredocString EscapeSequence abstract LogicOp array as Boolean break case catch clone const continue default declare do echo else elseif enddeclare endfor endforeach endif endswitch endwhile enum extends final finally fn for foreach from function global goto if implements include include_once LogicOp insteadof interface list match namespace new null LogicOp print readonly require require_once return switch throw trait try unset use var Visibility while LogicOp yield LineComment BlockComment TextInterpolation PhpClose Text PhpOpen Template TextInterpolation EmptyStatement ; } { Block : LabelStatement Name ExpressionStatement ConditionalExpression LogicOp MatchExpression ) ( ParenthesizedExpression MatchBlock MatchArm , => AssignmentExpression ArrayExpression ValueList & VariadicUnpacking ... Pair [ ] ListExpression ValueList Pair Pair SubscriptExpression MemberExpression -> ?-> Name VariableName DynamicVariable $ ${ CallExpression ArgList NamedArgument SpreadArgument CastExpression UnionType LogicOp IntersectionType OptionalType NamedType QualifiedName \\ NamespaceName Name NamespaceName Name ScopedExpression :: ClassMemberName DynamicMemberName AssignOp UpdateExpression UpdateOp YieldExpression BinaryExpression LogicOp LogicOp LogicOp BitOp BitOp BitOp CompareOp CompareOp BitOp ArithOp ConcatOp ArithOp ArithOp IncludeExpression RequireExpression CloneExpression UnaryExpression ControlOp LogicOp PrintIntrinsic FunctionExpression static ParamList Parameter #[ Attributes Attribute VariadicParameter PropertyParameter PropertyHooks PropertyHook UseList ArrowFunction NewExpression class BaseClause ClassInterfaceClause DeclarationList ConstDeclaration VariableDeclarator PropertyDeclaration VariableDeclarator MethodDeclaration UseDeclaration UseList UseInsteadOfClause UseAsClause UpdateExpression ArithOp ShellExpression ThrowExpression Integer Float String MemberExpression SubscriptExpression UnaryExpression ArithOp Interpolation String IfStatement ColonBlock SwitchStatement Block CaseStatement DefaultStatement ColonBlock WhileStatement EmptyStatement DoStatement ForStatement ForSpec SequenceExpression ForeachStatement ForSpec Pair GotoStatement ContinueStatement BreakStatement ReturnStatement TryStatement CatchDeclarator DeclareStatement EchoStatement UnsetStatement ConstDeclaration FunctionDefinition ClassDeclaration InterfaceDeclaration TraitDeclaration EnumDeclaration EnumBody EnumCase NamespaceDefinition NamespaceUseDeclaration UseGroup UseClause UseClause GlobalDeclaration FunctionStaticDeclaration Program",maxTerm:318,nodeProps:[["group",-36,2,8,49,82,84,86,89,94,95,103,107,108,112,113,116,120,126,132,137,139,140,154,155,156,157,160,161,173,174,188,190,191,192,193,194,200,"Expression",-28,75,79,81,83,201,203,208,210,211,214,217,218,219,220,221,223,224,225,226,227,228,229,230,231,234,235,239,240,"Statement",-4,121,123,124,125,"Type"],["isolate",-4,67,68,71,200,""],["openedBy",70,"phpOpen",77,"{",87,"(",102,"#["],["closedBy",72,"phpClose",78,"}",88,")",165,"]"]],propSources:[HO],skippedNodes:[0],repeatNodeCount:32,tokenData:"!GQ_R!]OX$zXY&^YZ'sZ]$z]^&^^p$zpq&^qr)Rrs+Pst+otu2buv5evw6rwx8Vxy>]yz>yz{?g{|@}|}Bb}!OCO!O!PDh!P!QKT!Q!R!!o!R![!$q![!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=`&W<%lO$zR!EaV$SQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!E}V!oQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!FkV$eQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z",tokenizers:[IO,CO,LO,0,1,2,3,NO],topRules:{Template:[0,73],Program:[1,241]},dynamicPrecedences:{298:1},specialized:[{term:284,get:(O,Q)=>n(O)<<1,external:n},{term:284,get:O=>AO[O]||-1}],tokenPrec:29889}),DO=s.define({name:"php",parser:KO.configure({props:[t.add({IfStatement:c({except:/^\s*({|else\b|elseif\b|endif\b)/}),TryStatement:c({except:/^\s*({|catch\b|finally\b)/}),SwitchBody:O=>{let Q=O.textAfter,i=/^\s*\}/.test(Q),a=/^\s*(case|default)\b/.test(Q);return O.baseIndent+(i?0:a?1:2)*O.unit},ColonBlock:O=>O.baseIndent+O.unit,"Block EnumBody DeclarationList":y({closing:"}"}),ArrowFunction:O=>O.baseIndent+O.unit,"String BlockComment":()=>null,Statement:c({except:/^({|end(for|foreach|switch|while)\b)/})}),U.add({"Block EnumBody DeclarationList SwitchBody ArrayExpression ValueList":l,ColonBlock(O){return{from:O.from+1,to:O.to}},BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*(?:case |default:|end(?:if|for(?:each)?|switch|while)|else(?:if)?|\{|\})$/,wordChars:"$",closeBrackets:{stringPrefixes:["b","B"]}}});function c$(O={}){let Q=[],i;if(O.baseLanguage!==null)if(O.baseLanguage)i=O.baseLanguage;else{let a=w({matchClosingTags:!1});Q.push(a.support),i=a.language}return new Z(DO.configure({wrap:i&&R(a=>a.type.isTop?{parser:i.parser,overlay:P=>P.name=="Text"}:null),top:O.plain?"Program":"Template"}),Q)}export{c$ as php,DO as phpLanguage}; diff --git a/internal/relay/web-dist/assets/index-DfP-AjMF.css b/internal/relay/web-dist/assets/index-DfP-AjMF.css deleted file mode 100644 index 47b42757..00000000 --- a/internal/relay/web-dist/assets/index-DfP-AjMF.css +++ /dev/null @@ -1,32 +0,0 @@ -.tabbar.drop-active[data-v-e57c51b9]{box-shadow:inset 0 -2px 0 var(--accent);background:color-mix(in srgb,var(--accent) 8%,transparent)}.tabbar[data-v-e57c51b9]{position:sticky;top:0;z-index:12;display:flex;align-items:stretch;background:var(--panel);flex:0 0 auto;height:28px;overflow:hidden}.tabs[data-v-e57c51b9]{display:flex;flex:1 1 auto;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}.tabs[data-v-e57c51b9]::-webkit-scrollbar{display:none}.tab[data-v-e57c51b9]{display:flex;align-items:center;gap:6px;padding:0 8px 0 12px;border-right:1px solid var(--border);font-size:12px;color:var(--fg-dim);cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap;min-width:110px;max-width:220px;transition:background .12s;touch-action:pan-y}.tab.dragging[data-v-e57c51b9]{opacity:.5}.tab[data-v-e57c51b9]:hover{background:#ffffff0a}.tab.active[data-v-e57c51b9]{background:var(--bg);color:var(--fg);box-shadow:inset 0 -2px 0 var(--accent)}.tab .num[data-v-e57c51b9]{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:var(--fg-dim)}.tab.active .num[data-v-e57c51b9]{color:var(--accent)}.tab .dot[data-v-e57c51b9]{font-size:9px;color:var(--good)}.tab .remote-dot[data-v-e57c51b9]{color:#d29922}.tab .remote-dot.disconnected[data-v-e57c51b9]{color:var(--fg-dim)}.tab.disconnected .title[data-v-e57c51b9]{color:var(--fg-dim);font-style:italic}.tab .layout-icon[data-v-e57c51b9]{font-size:11px;color:var(--fg-dim);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:-1px}.tab .title[data-v-e57c51b9]{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis}.tab .close[data-v-e57c51b9]{border:none;background:transparent;padding:0 4px;font-size:14px;line-height:1;color:var(--fg-dim);border-radius:4px;opacity:0;transition:opacity .12s,background .12s,color .12s}.tab:hover .close[data-v-e57c51b9],.tab.active .close[data-v-e57c51b9]{opacity:1}.tab .close[data-v-e57c51b9]:hover{background:#f851492e;color:var(--bad)}.profile-picker[data-v-e57c51b9]{max-width:120px;height:100%;border:none;border-left:1px solid var(--border);background:transparent;color:var(--fg-dim);font-size:11px;padding:0 6px;cursor:pointer}.profile-picker[data-v-e57c51b9]:hover{color:var(--fg)}.plus[data-v-e57c51b9]{border:none;background:transparent;color:var(--fg-dim);font-size:18px;line-height:1;padding:0 14px;cursor:pointer;border-left:1px solid var(--border);transition:color .12s,background .12s}.plus[data-v-e57c51b9]:hover:not(:disabled){color:var(--accent);background:#58a6ff14}.plus[data-v-e57c51b9]:disabled{opacity:.4;cursor:not-allowed}.ssh-btn[data-v-e57c51b9]{display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--fg-dim);padding:0 10px;cursor:pointer;border-left:1px solid var(--border);transition:color .12s,background .12s}.ssh-btn[data-v-e57c51b9]:hover{color:var(--accent);background:#58a6ff14}.ssh-btn svg[data-v-e57c51b9]{display:block}.settings-btn[data-v-e57c51b9]{position:relative;display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--fg-dim);padding:0 10px;cursor:pointer;border-left:1px solid var(--border);transition:color .12s,background .12s}.settings-btn[data-v-e57c51b9]:hover{color:var(--accent);background:#58a6ff14}.settings-btn svg[data-v-e57c51b9]{display:block}.settings-btn .dot[data-v-e57c51b9]{position:absolute;top:4px;right:4px;width:6px;height:6px;background:#d29922;border-radius:50%}.admin-btn[data-v-e57c51b9]{position:relative;display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--fg-dim);padding:0 10px;cursor:pointer;border-left:1px solid var(--border);transition:color .12s,background .12s}.admin-btn[data-v-e57c51b9]:hover,.admin-btn.active[data-v-e57c51b9]{color:var(--accent);background:#58a6ff14}.tab.unread[data-v-e57c51b9]{background:color-mix(in srgb,var(--unread-c) 10%,transparent)}.tab.unread .title[data-v-e57c51b9]{font-weight:600;color:#fff}.tab.unread[data-v-e57c51b9]:not(.active){box-shadow:inset 0 -2px 0 var(--unread-c)}@media (max-width: 767px){.tabbar[data-v-e57c51b9]{height:36px}.tab[data-v-e57c51b9]{min-width:86px;max-width:150px;padding:0 6px 0 10px;gap:4px}.tab .num[data-v-e57c51b9]{display:none}.tab .close[data-v-e57c51b9]{opacity:1;padding:0 2px}.settings-btn[data-v-e57c51b9],.admin-btn[data-v-e57c51b9]{min-width:40px;padding:0 12px}}.window-controls[data-v-1ccfd0fb]{display:inline-flex;align-items:stretch;height:100%;margin-left:8px}.wc-btn[data-v-1ccfd0fb]{display:inline-flex;align-items:center;justify-content:center;width:36px;border:none;background:transparent;color:var(--fg-dim);cursor:pointer;transition:background .12s,color .12s}.wc-btn[data-v-1ccfd0fb]:hover{background:#ffffff14;color:var(--fg)}.wc-close[data-v-1ccfd0fb]:hover{background:#e81123;color:#fff}.conn-health-pill[data-v-5daa187a]{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;height:20px;border-radius:999px;border:1px solid var(--border, #ccc);background:transparent;color:inherit;font-size:11px;font-variant-numeric:tabular-nums;cursor:pointer;line-height:1;white-space:nowrap}.conn-health-pill .dot[data-v-5daa187a]{font-size:8px;line-height:1}.band-green[data-v-5daa187a]{color:var(--good, #16a34a);border-color:color-mix(in srgb,var(--good, #16a34a) 35%,transparent)}.band-yellow[data-v-5daa187a]{color:var(--warn, #d97706);border-color:color-mix(in srgb,var(--warn, #d97706) 35%,transparent)}.band-red[data-v-5daa187a]{color:var(--bad, #dc2626);border-color:color-mix(in srgb,var(--bad, #dc2626) 35%,transparent)}.band-off[data-v-5daa187a]{color:var(--fg-dim, #888)}.band-reconnecting[data-v-5daa187a]{color:var(--warn, #d97706);animation:conn-health-pulse-5daa187a 1s ease-in-out infinite}@keyframes conn-health-pulse-5daa187a{0%,to{opacity:1}50%{opacity:.35}}@media (prefers-reduced-motion: reduce){.band-reconnecting[data-v-5daa187a]{animation:none}}.drawer[data-v-c8bb9e85]{position:fixed;top:36px;right:8px;z-index:1100;width:280px;background:var(--bg, #fff);color:var(--fg, #111);border:1px solid var(--border, #ddd);border-radius:8px;box-shadow:0 8px 24px #0000001f;padding:10px 12px;font-size:12px;display:flex;flex-direction:column;gap:8px}.head[data-v-c8bb9e85]{display:flex;align-items:center;justify-content:space-between;font-weight:600}.close[data-v-c8bb9e85]{background:transparent;border:0;cursor:pointer;font-size:16px;line-height:1;color:inherit}.row[data-v-c8bb9e85]{display:flex;justify-content:space-between;padding:2px 0}.metric-label[data-v-c8bb9e85]{color:var(--fg-dim, #666)}.metric-value[data-v-c8bb9e85]{font-variant-numeric:tabular-nums}.spark[data-v-c8bb9e85]{color:var(--good, #16a34a);display:block}.reconn-table[data-v-c8bb9e85]{width:100%;border-collapse:collapse;font-size:11px}.reconn-table th[data-v-c8bb9e85],.reconn-table td[data-v-c8bb9e85]{text-align:left;padding:2px 4px;border-top:1px solid var(--border, #eee)}.gaps[data-v-c8bb9e85]{color:var(--warn, #d97706)}.titlebar[data-v-2cf685eb]{position:relative;display:flex;align-items:center;gap:12px;padding:6px 14px;background:var(--panel);border-bottom:1px solid var(--border);flex:0 0 auto;--wails-draggable: drag}.window-title[data-v-2cf685eb]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);max-width:50%;font-size:12px;color:var(--fg);font-weight:500;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 8px}.status[data-v-2cf685eb]{font-size:12px;color:var(--fg-dim);--wails-draggable: no-drag;flex:0 0 auto;margin-left:auto}.status .bad[data-v-2cf685eb]{color:var(--bad)}.status .dim[data-v-2cf685eb]{color:var(--good)}.e2ee-off-chip[data-v-2cf685eb]{--wails-draggable: no-drag;flex:0 0 auto;display:inline-flex;align-items:center;gap:4px;margin-left:8px;padding:2px 8px;font-size:11px;font-weight:600;line-height:1.4;color:#1f1300;background:#f4b740;border-radius:999px;letter-spacing:.02em;white-space:nowrap}.e2ee-off-chip .chip-icon[data-v-2cf685eb]{font-size:12px;line-height:1}.titlebar[data-v-2cf685eb]:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:3px;background:repeating-linear-gradient(90deg,transparent 0px,transparent 200px,rgba(74,222,128,.3) 320px,#4ade80 500px,#bbf7d0 560px,#4ade80 620px,rgba(74,222,128,.3) 800px,transparent 920px,transparent 1120px);background-size:1120px 100%;background-position:var(--sweep-offset, 0px) 0;box-shadow:0 -1px 6px #4ade8066;opacity:0;transition:opacity .25s ease;pointer-events:none}.titlebar.is-running[data-v-2cf685eb]:after{opacity:1}@media (prefers-reduced-motion: reduce){.titlebar[data-v-2cf685eb]:after{background:#4ade80}}.last-output[data-v-ea632618]{display:inline-flex;align-items:center;gap:3px;flex:none;color:var(--fg-dim, #6e7681);white-space:nowrap;font-family:var(--font-mono, ui-monospace, monospace);font-size:9px;line-height:1;font-variant-numeric:tabular-nums}.last-output-clock[data-v-ea632618]{width:10px;height:10px;flex:none}.last-output.live[data-v-ea632618]{color:var(--accent, #58a6ff)}.row-main[data-v-81d1a3d4]{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:1px}.row-top[data-v-81d1a3d4]{display:flex;align-items:center;gap:6px;min-width:0}.state-label[data-v-81d1a3d4]{font-size:11px;opacity:.85;white-space:nowrap;flex-shrink:0}.cmd-and-cwd[data-v-81d1a3d4]{flex:1 1 auto;min-width:0;display:flex;gap:6px;overflow:hidden;align-items:baseline}.cmd[data-v-81d1a3d4]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-family:var(--font-mono);flex:1 1 auto;min-width:0}.row-meta[data-v-81d1a3d4]{display:flex;align-items:center;gap:6px;min-width:0;padding-left:18px}.cwd[data-v-81d1a3d4]{color:var(--fg-dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--font-mono);font-size:.85em;flex:1 1 auto;min-width:0}.row-tail[data-v-81d1a3d4]{flex:0 0 auto;min-width:46px;align-self:stretch;display:flex;flex-direction:column;align-items:flex-end;justify-content:space-between;gap:3px}.row-tail.time-only[data-v-81d1a3d4]{justify-content:flex-end}.row-tail[data-v-81d1a3d4] .last-output{opacity:.65}.kind[data-v-81d1a3d4]{font-size:8.5px;line-height:1.4;padding:1px 4px;border-radius:3px;border:1px solid var(--border);color:var(--fg-dim);white-space:nowrap;transition:opacity .1s}.row-close[data-v-81d1a3d4]{position:absolute;top:4px;right:6px;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:13px;line-height:1;cursor:pointer;color:var(--fg-dim);border-radius:4px}.row-close[data-v-81d1a3d4]:hover{background:#f851492e;color:var(--bad)}.session-row-menu[data-v-f6b9c7cb]{position:fixed;z-index:1000;min-width:140px;padding:4px;background:var(--menu-bg, #1f1f22);border:1px solid rgba(255,255,255,.12);border-radius:6px;box-shadow:0 8px 24px #0006}.menu-item[data-v-f6b9c7cb]{display:block;width:100%;padding:6px 10px;background:transparent;border:none;color:inherit;text-align:left;cursor:pointer;border-radius:4px;font-size:13px}.menu-item[data-v-f6b9c7cb]:hover:not(.disabled),.menu-item[data-v-f6b9c7cb]:focus:not(.disabled){background:#ffffff14;outline:none}.menu-item.disabled[data-v-f6b9c7cb]{opacity:.4;cursor:not-allowed}.menu-separator[data-v-f6b9c7cb]{height:1px;margin:4px 6px;background:#ffffff1f}.session-details-popover[data-v-9528360b]{position:fixed;z-index:1000;min-width:260px;max-width:420px;width:min(420px,calc(100vw - 16px));box-sizing:border-box;padding:8px 10px 10px;background:var(--menu-bg, #1f1f22);border:1px solid rgba(255,255,255,.14);border-radius:8px;box-shadow:0 12px 32px #00000073;font-size:12px}.popover-title[data-v-9528360b]{font-weight:600;padding-bottom:6px;border-bottom:1px solid rgba(255,255,255,.08);margin-bottom:6px}.rows[data-v-9528360b]{display:flex;flex-direction:column;gap:3px;max-height:380px;overflow-x:auto;overflow-y:auto;-webkit-overflow-scrolling:touch}.row[data-v-9528360b]{display:grid;grid-template-columns:96px 1fr auto;gap:8px;align-items:baseline;min-width:max-content}.label[data-v-9528360b]{color:var(--fg-dim);white-space:nowrap}.value[data-v-9528360b]{overflow:visible;text-overflow:clip;white-space:nowrap;font-family:var(--font-mono);min-width:0}.copy[data-v-9528360b]{border:none;background:transparent;color:var(--fg-dim);cursor:pointer;padding:0 3px;font-size:12px;border-radius:3px}.copy[data-v-9528360b]:hover{color:var(--fg);background:#ffffff14}.task-grouped-list[data-v-42b39ad3]{display:flex;flex-direction:column;gap:8px;font-size:12px}.host-header[data-v-42b39ad3]{display:flex;align-items:center;gap:6px;font-weight:500;padding:4px 6px;cursor:pointer;-webkit-user-select:none;user-select:none}.host-header[data-v-42b39ad3]:hover{background:#ffffff0a;border-radius:4px}.host-header .caret[data-v-42b39ad3]{font-size:9px;opacity:.7;width:9px;display:inline-block}.host-name[data-v-42b39ad3]{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.counts[data-v-42b39ad3]{margin-left:auto;display:inline-flex;gap:2px;align-items:center;flex-shrink:0}.unread-badge[data-v-42b39ad3]{font-size:10px;opacity:.8;background:#ffffff0f;border-radius:3px;padding:1px 4px;white-space:nowrap;flex-shrink:0}.local-chip[data-v-42b39ad3]{font-size:10px;color:var(--accent);border:1px solid color-mix(in srgb,var(--accent) 40%,transparent);border-radius:3px;padding:0 4px;line-height:1.3;white-space:nowrap;flex-shrink:0}.mark-all[data-v-42b39ad3]{background:none;border:none;cursor:pointer;padding:0 4px;color:inherit}.host-group[data-v-42b39ad3]{display:flex;flex-direction:column;gap:4px}.group-header[data-v-42b39ad3]{display:flex;align-items:center;gap:6px;font-weight:500;padding:4px 6px;cursor:pointer;-webkit-user-select:none;user-select:none}.group-header[data-v-42b39ad3]:hover{background:#ffffff0a;border-radius:4px}.group-header .caret[data-v-42b39ad3]{font-size:9px;opacity:.7;width:9px;display:inline-block}.pinned-group .pin-icon[data-v-42b39ad3]{font-size:11px}.group-title[data-v-42b39ad3]{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.group-count[data-v-42b39ad3]{margin-left:auto;font-size:10px;opacity:.8;background:#ffffff0f;border-radius:3px;padding:1px 4px}.task-row[data-v-42b39ad3]{display:flex;flex-direction:row;align-items:stretch;gap:6px;padding:5px 8px;border:1px solid rgba(255,255,255,.08);background:#ffffff05;width:100%;text-align:left;cursor:pointer;color:inherit;border-radius:6px;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:pan-y;position:relative}.task-row[data-v-42b39ad3] .row-close{opacity:0;transition:opacity .1s}.task-row[data-v-42b39ad3]:hover .row-close,.task-row[data-v-42b39ad3]:focus-within .row-close{opacity:1}.task-row[data-v-42b39ad3]:hover .kind,.task-row[data-v-42b39ad3]:focus-within .kind{opacity:0}@media (hover: none){.task-row[data-v-42b39ad3] .row-close{position:static;align-self:flex-start;opacity:1}.task-row[data-v-42b39ad3] .kind{opacity:1}}.task-row[data-v-42b39ad3]:hover{background:#ffffff0f;border-color:#ffffff29}.task-row.active[data-v-42b39ad3]{background:color-mix(in srgb,var(--accent) 10%,transparent);border-color:color-mix(in srgb,var(--accent) 28%,var(--border));box-shadow:inset 2px 0 0 var(--accent)}.task-row.active[data-v-42b39ad3]:hover{background:color-mix(in srgb,var(--accent) 14%,transparent)}.task-row.selected[data-v-42b39ad3]{outline:2px solid var(--accent);outline-offset:-2px}.task-row.unread[data-v-42b39ad3]{background:color-mix(in srgb,var(--unread-c) 7%,transparent);border-color:color-mix(in srgb,var(--unread-c) 24%,var(--border));box-shadow:inset 2px 0 0 var(--unread-c)}.task-row.unread[data-v-42b39ad3]:hover{background:color-mix(in srgb,var(--unread-c) 12%,transparent)}.task-row.unread[data-v-42b39ad3] .cmd{font-weight:600;color:#fff}.task-row.active.unread[data-v-42b39ad3]{background:color-mix(in srgb,var(--unread-c) 14%,transparent);border-color:color-mix(in srgb,var(--accent) 28%,var(--border));box-shadow:inset 2px 0 0 var(--unread-c)}.task-row.dim[data-v-42b39ad3]{opacity:.6}.task-row.dim.active[data-v-42b39ad3]{opacity:.9}.task-row.dim.unread[data-v-42b39ad3]{opacity:1}.row-main[data-v-42b39ad3]{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:1px}.row-top[data-v-42b39ad3]{display:flex;align-items:center;gap:6px;min-width:0}.state-label[data-v-42b39ad3]{font-size:11px;opacity:.85;white-space:nowrap;flex-shrink:0}.cmd-and-cwd[data-v-42b39ad3]{flex:1 1 auto;min-width:0;display:flex;gap:6px;overflow:hidden;align-items:baseline}.cmd[data-v-42b39ad3]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-family:var(--font-mono);flex:1 1 auto;min-width:0}.row-meta[data-v-42b39ad3]{display:flex;align-items:center;gap:6px;min-width:0;padding-left:18px}.cwd[data-v-42b39ad3]{color:var(--fg-dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--font-mono);font-size:.85em;flex:1 1 auto;min-width:0}.row-tail[data-v-42b39ad3]{flex:0 0 auto;min-width:46px;align-self:stretch;display:flex;flex-direction:column;align-items:flex-end;justify-content:space-between;gap:3px}.row-tail.time-only[data-v-42b39ad3]{justify-content:flex-end}.row-tail[data-v-42b39ad3] .last-output{opacity:.65}.kind[data-v-42b39ad3]{font-size:8.5px;line-height:1.4;padding:1px 4px;border-radius:3px;border:1px solid var(--border);color:var(--fg-dim);white-space:nowrap;transition:opacity .1s}.completed-row-close[data-v-42b39ad3]{position:absolute;top:5px;right:8px;border:none;background:transparent;color:var(--fg-dim);border-radius:4px;cursor:pointer;font-size:13px;line-height:1;padding:1px 4px}.completed-row-close[data-v-42b39ad3]:hover{background:#f851492e;color:var(--bad)}.completed-fold[data-v-42b39ad3]{border-top:1px solid rgba(255,255,255,.06);margin-top:6px;padding-top:4px;display:flex;flex-direction:column;gap:4px}.fold-toggle[data-v-42b39ad3]{background:none;border:none;cursor:pointer;padding:4px 6px;width:100%;text-align:left;color:inherit;opacity:.7}.fold-mark-all[data-v-42b39ad3]{background:none;border:1px solid rgba(255,255,255,.12);cursor:pointer;padding:4px 8px;margin:4px 6px;color:inherit;border-radius:3px}.empty-hint[data-v-42b39ad3]{padding:24px 12px;text-align:center;color:var(--fg);opacity:.55;font-size:12px}.bulk-bar[data-v-c912fe83]{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:6px 4px}.counter[data-v-c912fe83]{font-size:11px;color:var(--fg-dim);margin-right:4px;white-space:nowrap}.btn[data-v-c912fe83]{background:none;border:1px solid rgba(255,255,255,.14);color:inherit;cursor:pointer;padding:3px 8px;font-size:11px;border-radius:3px;line-height:1.4}.btn[data-v-c912fe83]:hover:not(:disabled){background:#ffffff0f}.btn[data-v-c912fe83]:disabled{opacity:.4;cursor:not-allowed}.btn.primary[data-v-c912fe83]{border-color:color-mix(in srgb,var(--accent) 40%,var(--border));color:var(--accent)}.btn.primary[data-v-c912fe83]:hover:not(:disabled){background:color-mix(in srgb,var(--accent) 12%,transparent)}.btn.ghost[data-v-c912fe83]{border-color:transparent;opacity:.75}.task-sidebar-shell[data-v-0741527d]{display:contents}.task-sidebar[data-v-0741527d]{position:relative;background:var(--panel);border-right:1px solid var(--border);color:var(--fg);display:flex;flex-direction:column;height:100%}.task-sidebar.collapsed[data-v-0741527d]{width:32px}.sidebar-hamburger[data-v-0741527d]{position:fixed;top:34px;left:8px;z-index:20;padding:4px 8px;background:var(--panel);border:1px solid var(--border);color:inherit;border-radius:4px;cursor:pointer;font-size:12px;line-height:1}.task-sidebar.drawer[data-v-0741527d]{position:fixed;top:0;bottom:0;left:0;z-index:15;transform:translate(-100%);transition:transform .2s ease;box-shadow:2px 0 8px #0000004d}.task-sidebar.drawer.open[data-v-0741527d]{transform:translate(0)}.expanded[data-v-0741527d]{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}.resize-handle[data-v-0741527d]{position:absolute;top:0;right:-2px;width:4px;height:100%;cursor:ew-resize;-webkit-user-select:none;user-select:none;z-index:1}.resize-handle[data-v-0741527d]:hover{background:#ffffff0f}.sidebar-header[data-v-0741527d]{display:flex;align-items:center;padding:8px 10px;border-bottom:1px solid var(--border)}.title[data-v-0741527d]{flex:1 1 auto;min-width:0;font-weight:500;margin-right:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.search-icon-btn[data-v-0741527d]{background:none;border:none;color:inherit;cursor:pointer;padding:2px 4px;margin-right:6px;opacity:.7;display:inline-flex;align-items:center;justify-content:center;border-radius:3px}.search-icon-btn[data-v-0741527d]:hover{opacity:1;background:#ffffff0d}.collapse-button[data-v-0741527d],.expand-button[data-v-0741527d]{background:none;border:none;cursor:pointer;color:inherit;font-size:14px}.group-toggle[data-v-0741527d]{background:none;border:1px solid var(--border);color:inherit;cursor:pointer;border-radius:3px;font-size:11px;padding:1px 6px;margin-right:6px;opacity:.8}.group-toggle[data-v-0741527d]:hover{opacity:1;background:#ffffff0d}.sidebar-search[data-v-0741527d]{flex:1 1 auto;min-width:60px;background:#ffffff08;border:1px solid transparent;color:inherit;border-radius:3px;padding:1px 6px;font-size:12px;font-family:inherit;line-height:20px;margin-right:6px;outline:none}.sidebar-search[data-v-0741527d]:focus{border-color:var(--border);background:#ffffff0d}.sidebar-search[data-v-0741527d]::placeholder{opacity:.5}.list-wrap[data-v-0741527d]{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;padding:4px;scrollbar-width:none}.list-wrap[data-v-0741527d]::-webkit-scrollbar{display:none}footer[data-v-0741527d]{padding:8px;border-top:1px solid var(--border)}.mark-all[data-v-0741527d]{background:none;border:1px solid var(--border);cursor:pointer;padding:6px 10px;color:inherit;border-radius:3px;width:100%}.rail[data-v-0741527d]{display:flex;flex-direction:column;align-items:center;padding:6px 0;gap:4px}.rail-badge[data-v-0741527d]{font-size:10px;background:#ef4444;color:#fff;border-radius:8px;padding:1px 5px}.rail-icon[data-v-0741527d]{cursor:pointer;padding:2px}@media (max-width: 767px){.sidebar-hamburger[data-v-0741527d]{top:calc(env(safe-area-inset-top) + 42px);left:calc(env(safe-area-inset-left) + 8px);min-height:32px}.task-sidebar.drawer[data-v-0741527d]{top:env(safe-area-inset-top);bottom:env(safe-area-inset-bottom);max-width:min(86vw,360px)}}.select-dropdown[data-v-65a81c06]{position:relative;width:100%}.trigger[data-v-65a81c06]{-moz-appearance:none;appearance:none;-webkit-appearance:none;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;height:32px;padding:6px 10px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;font-size:13px;font-family:inherit;line-height:1.3;cursor:pointer;text-align:left}.trigger[data-v-65a81c06]:after{content:"▾";color:var(--fg-dim);font-size:11px;transition:transform .15s ease;flex-shrink:0}.trigger[data-v-65a81c06]:hover:not(:disabled):after{color:var(--fg)}.trigger[data-v-65a81c06]:hover:not(:disabled){border-color:var(--fg-dim)}.trigger[data-v-65a81c06]:focus-visible{outline:none;box-shadow:0 0 0 2px var(--accent)}.trigger[data-v-65a81c06]:disabled{cursor:not-allowed;opacity:.6}.trigger-label[data-v-65a81c06]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.trigger-open[data-v-65a81c06]:after{transform:rotate(180deg)}.menu[data-v-65a81c06]{position:absolute;top:calc(100% + 4px);left:0;right:0;max-height:240px;overflow-y:auto;margin:0;padding:4px 0;list-style:none;background:var(--bg);border:1px solid var(--border);border-radius:6px;box-shadow:0 6px 16px #00000059;z-index:1000}.option[data-v-65a81c06]{position:relative;display:flex;flex-direction:column;gap:2px;padding:8px 10px;cursor:pointer}.option-label[data-v-65a81c06]{color:var(--fg);font-size:13px;line-height:1.3}.option-description[data-v-65a81c06]{color:var(--fg-dim);font-size:12px;line-height:1.3}.option-highlight[data-v-65a81c06]{background:#ffffff0f}.option-selected[data-v-65a81c06]:before{content:"";position:absolute;top:4px;bottom:4px;left:0;width:2px;background:var(--accent);border-radius:2px}.option-selected .option-label[data-v-65a81c06]{color:var(--fg);font-weight:500}.sp-switcher[data-v-c9d59669]{position:relative;display:inline-flex;align-items:center;gap:6px;pointer-events:auto}.sp-seg[data-v-c9d59669]{display:inline-flex;align-items:center;gap:2px;background:var(--terminal-overlay, rgba(13, 17, 23, .92));border:1px solid var(--border);border-radius:8px;padding:2px}.sp-seg button[data-v-c9d59669]{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;flex:0 0 auto;border:0;border-radius:5px;padding:4px 8px;color:var(--fg-dim);background:transparent;font:12px var(--font-mono);cursor:pointer}.sp-seg button[data-v-c9d59669]:hover{color:var(--fg);background:#ffffff0f}.sp-seg button.active[data-v-c9d59669]{color:var(--fg);background:#ffffff1a}.sp-seg button.reconnecting[data-v-c9d59669]{color:var(--warning, #d29922)}.sp-caret[data-v-c9d59669]{color:var(--fg-dim);font-size:10px}.sp-dot[data-v-c9d59669]{width:6px;height:6px;border-radius:50%;background:var(--good, #3fb950);flex:0 0 auto}.sp-dot.reconnecting[data-v-c9d59669]{background:var(--warning, #d29922);animation:sp-pulse-c9d59669 1s infinite}@keyframes sp-pulse-c9d59669{50%{opacity:.3}}.sp-actions[data-v-c9d59669]{display:inline-flex;align-items:center;gap:2px;background:var(--terminal-overlay, rgba(13, 17, 23, .92));border:1px solid var(--border);border-radius:8px;padding:2px}.sp-actions button[data-v-c9d59669]{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:5px;color:var(--fg-dim);background:transparent;cursor:pointer}.sp-actions button[data-v-c9d59669]:hover{color:var(--fg);background:#ffffff0f}.sp-actions button.close[data-v-c9d59669]:hover{color:var(--bad);background:#f851491f}.sp-ico[data-v-c9d59669]{display:inline-flex;align-items:center;justify-content:center}.sp-actions svg[data-v-c9d59669]{width:13px;height:13px;display:block}.sp-menu[data-v-c9d59669]{position:absolute;top:32px;left:0;z-index:20;min-width:210px;background:var(--terminal-overlay, rgba(13, 17, 23, .98));border:1px solid var(--border);border-radius:8px;padding:4px;box-shadow:0 12px 30px #00000073}.sp-item[data-v-c9d59669]{display:flex;align-items:center;gap:8px;width:100%;padding:6px 8px;border:0;border-radius:6px;background:transparent;color:var(--fg-dim);font:12px var(--font-mono);cursor:pointer;white-space:nowrap;text-align:left}.sp-item[data-v-c9d59669]:hover{color:var(--fg);background:#ffffff0f}.sp-item.active[data-v-c9d59669]{color:var(--fg);background:#ffffff1a}.sp-lbl[data-v-c9d59669]{flex:1}.sp-mini[data-v-c9d59669]{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border-radius:5px;color:var(--fg-dim);flex:0 0 auto}.sp-mini[data-v-c9d59669]:hover{color:var(--fg);background:#ffffff1a}.sp-mini svg[data-v-c9d59669]{width:13px;height:13px;display:block}.sp-x[data-v-c9d59669]{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border-radius:5px;color:var(--fg-dim);flex:0 0 auto}.sp-x[data-v-c9d59669]:hover{color:var(--bad);background:#f851491f}.sp-sep[data-v-c9d59669]{height:1px;background:var(--border);margin:4px 2px}.sp-add[data-v-c9d59669]{color:var(--good, #3fb950)}.popover[data-v-063a4cb7]{position:fixed;transform:translate(-50%);background:#2b2c30;color:#fff;border-radius:8px;display:flex;box-shadow:0 6px 20px #0006;font-family:-apple-system,system-ui,sans-serif;z-index:1000}.popover[data-v-063a4cb7]:after{content:"";position:absolute;left:50%;transform:translate(-50%);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent}.popover.arrow-down[data-v-063a4cb7]:after{bottom:-5px;border-top:5px solid #2b2c30}.popover.arrow-up[data-v-063a4cb7]:after{top:-5px;border-bottom:5px solid #2b2c30}.btn[data-v-063a4cb7]{position:relative;background:none;border:none;color:#fff;padding:4px 11px;font-size:11px;font-family:inherit;cursor:pointer;border-right:1px solid #3f4046}.btn[data-v-063a4cb7]:last-child{border-right:none}.btn.send[data-v-063a4cb7]{color:#60a5fa;font-weight:600}.btn.cancel[data-v-063a4cb7]{font-size:14px;line-height:1;padding:4px 8px}.btn[data-v-063a4cb7]:disabled{opacity:.5;cursor:not-allowed}.btn[data-v-063a4cb7]:before{content:"";position:absolute;top:-8px;bottom:-8px;left:0;right:0}.term-search[data-v-302a13f7]{position:absolute;top:8px;left:12px;z-index:6;display:flex;align-items:center;gap:4px;padding:4px 6px;border:1px solid var(--border);border-radius:6px;background:var(--panel);box-shadow:0 4px 12px #00000059}.term-search-input[data-v-302a13f7]{width:180px;padding:2px 6px;border:1px solid var(--border);border-radius:4px;background:var(--bg);color:var(--fg);font-size:12px;outline:none}.term-search-input[data-v-302a13f7]:focus{border-color:var(--accent)}.term-search-count[data-v-302a13f7]{min-width:52px;color:var(--fg-dim);font-size:11px;text-align:center;white-space:nowrap}.term-search-btn[data-v-302a13f7]{padding:1px 6px;border:1px solid var(--border);border-radius:4px;background:#21262d;color:var(--fg);font-size:11px;line-height:16px;cursor:pointer}.term-search-btn[data-v-302a13f7]:hover:not(:disabled){background:var(--border)}.term-search-btn[data-v-302a13f7]:disabled{opacity:.4;cursor:default}.term-view[data-v-c76cd1d6]{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--terminal-bg);overflow:hidden}.term[data-v-c76cd1d6]{position:absolute;left:0;right:0;top:0;bottom:30px}.service-preview-frame[data-v-c76cd1d6]{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;border:0;background:#fff}.service-preview-reconnecting[data-v-c76cd1d6]{position:absolute;top:0;right:0;bottom:0;left:0;z-index:9;display:flex;gap:10px;align-items:center;justify-content:center;color:var(--fg);background:var(--terminal-overlay, rgba(13, 17, 23, .9));font:13px var(--font-mono)}.service-preview-reconnecting-spinner[data-v-c76cd1d6]{width:14px;height:14px;border:2px solid rgba(255,255,255,.25);border-top-color:var(--fg);border-radius:50%;animation:service-preview-spin-c76cd1d6 .8s linear infinite}@keyframes service-preview-spin-c76cd1d6{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.service-preview-reconnecting-spinner[data-v-c76cd1d6]{animation:none}}.service-preview-controls{position:relative;display:flex;align-items:center;gap:6px;padding:0;pointer-events:auto}.service-preview-port-form{position:absolute;top:34px;right:0;z-index:8;width:330px;padding:8px;display:flex;flex-direction:column;align-items:stretch;gap:6px;border:1px solid var(--border);border-radius:8px;background:var(--terminal-overlay);box-shadow:0 8px 24px #00000052}.service-preview-port-form button:not(.trigger){border:0;border-radius:5px;padding:4px 8px;color:var(--fg-dim);background:transparent;font:12px var(--font-mono);cursor:pointer}.service-preview-port-form button[type=submit]{color:var(--fg);background:#ffffff1a}.service-preview-port-form button:disabled{opacity:.55;cursor:default}.service-preview-host{width:100%}.service-preview-host .trigger{height:27px;padding:3px 7px;border-radius:5px;background:var(--bg);font:12px var(--font-mono)}.service-preview-host .menu{background:var(--terminal-overlay);font:12px var(--font-mono)}.service-preview-host .option{padding:6px 8px}.service-preview-mapping-row{display:grid;grid-template-columns:76px minmax(0,1fr) 24px;align-items:center;gap:5px}.service-preview-mapping-row input{width:auto;min-width:0}.service-preview-mapping-row input+input{width:auto}.service-preview-mapping-row.root-mapping{grid-template-columns:76px minmax(0,1fr)}.service-preview-path{color:var(--fg-dim);font:12px var(--font-mono)}.preview-add-mapping{white-space:nowrap}.service-preview-form-actions{display:flex;align-items:center;gap:4px}.service-preview-form-spacer{flex:1}.service-preview-port-form input{width:76px;border:1px solid var(--border);border-radius:5px;padding:3px 6px;color:var(--fg);background:var(--bg);font:12px var(--font-mono);outline:none}.service-preview-port-form input:focus{border-color:var(--accent)}.service-preview-port-form .service-preview-mapping-row input{width:100%}.template-bar[data-v-c76cd1d6]{position:absolute;left:0;right:0;bottom:0;height:30px;display:flex;align-items:center;gap:6px;overflow-x:auto;padding:2px 8px;border-top:1px solid var(--border);background:var(--panel);z-index:4;scrollbar-width:none}.template-bar[data-v-c76cd1d6]::-webkit-scrollbar{display:none}.aux-key-bar[data-v-c76cd1d6]{position:absolute;left:0;right:0;bottom:0;height:30px;display:flex;align-items:center;gap:6px;overflow:hidden;padding:2px 8px;border-top:1px solid var(--border);background:var(--panel);z-index:4}.aux-key-scroll[data-v-c76cd1d6]{min-width:0;flex:1 1 auto;height:100%;display:flex;align-items:center;gap:6px;overflow-x:auto;scrollbar-width:none}.aux-key-scroll[data-v-c76cd1d6]::-webkit-scrollbar{display:none}.file-picker-input[data-v-c76cd1d6]{display:none}.template-btn[data-v-c76cd1d6]{flex:0 0 auto;height:22px;padding:0 10px;border-radius:6px;background:var(--bg);border:1px solid var(--border);color:var(--fg);font-size:.76rem;font-family:var(--font-mono);cursor:pointer}.template-btn[data-v-c76cd1d6]:hover{border-color:var(--accent);color:var(--accent)}.aux-key-btn[data-v-c76cd1d6]{flex:0 0 auto;min-width:34px;height:22px;padding:0 9px;border-radius:6px;background:var(--bg);border:1px solid var(--border);color:var(--fg);font-size:.76rem;font-family:var(--font-mono);cursor:pointer}.aux-key-btn[data-v-c76cd1d6]:hover:not(:disabled){border-color:var(--accent);color:var(--accent)}.aux-key-btn[data-v-c76cd1d6]:disabled{color:var(--fg-dim);cursor:default;opacity:.55}.keyboard-toggle-btn[data-v-c76cd1d6]{min-width:76px;font-weight:600}.template-confirm-panel[data-v-c76cd1d6]{position:absolute;left:8px;right:8px;bottom:calc(60px + env(safe-area-inset-bottom));display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:6px;align-items:center;padding:7px;border:1px solid var(--border);border-radius:8px;background:var(--panel);z-index:6;box-shadow:0 8px 24px #0000004d}.template-confirm-copy[data-v-c76cd1d6]{min-width:0}.template-confirm-label[data-v-c76cd1d6]{color:var(--fg);font:600 .78rem var(--font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.template-confirm-text[data-v-c76cd1d6]{margin-top:2px;color:var(--fg-dim);font:.72rem var(--font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.template-confirm-btn[data-v-c76cd1d6]{height:30px;border-radius:6px;border:1px solid var(--border);background:var(--bg);color:var(--fg);padding:0 10px;cursor:pointer}.template-confirm-btn.primary[data-v-c76cd1d6]{border-color:var(--accent);color:var(--accent)}.paste-confirm-panel[data-v-c76cd1d6]{position:absolute;left:8px;right:8px;bottom:calc(30px + env(safe-area-inset-bottom));display:grid;grid-template-columns:1fr auto auto;gap:6px;align-items:center;padding:7px;border:1px solid var(--border);border-radius:8px;background:var(--panel);z-index:6;box-shadow:0 8px 24px #0000004d}.paste-confirm-input[data-v-c76cd1d6]{min-width:0;resize:vertical;border-radius:6px;border:1px solid var(--border);background:var(--terminal-bg);color:var(--fg);padding:6px 8px;font:.78rem var(--font-mono)}.paste-confirm-btn[data-v-c76cd1d6]{height:30px;border-radius:6px;border:1px solid var(--border);background:var(--bg);color:var(--fg);padding:0 10px;cursor:pointer}.paste-confirm-btn.primary[data-v-c76cd1d6]{border-color:var(--accent);color:var(--accent)}.paste-confirm-btn[data-v-c76cd1d6]:disabled{color:var(--fg-dim);border-color:var(--border);cursor:default;opacity:.55}.term[data-v-c76cd1d6] .xterm{padding:6px 8px}.term[data-v-c76cd1d6] .xterm-viewport{top:6px;right:8px;bottom:6px;left:8px;z-index:5;background:transparent!important;touch-action:pan-y;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.term[data-v-c76cd1d6] .xterm-helper-textarea{caret-color:transparent}.overlay[data-v-c76cd1d6]{position:absolute;top:8px;right:12px;background:var(--terminal-overlay);border:1px solid var(--border);border-radius:6px;padding:4px 10px;font-size:12px;color:var(--fg-dim);pointer-events:none}.overlay.avoid-top-right-badge[data-v-c76cd1d6]{top:34px}.viewer-overlay[data-v-c76cd1d6]{position:absolute;top:0;right:0;bottom:0;left:0;background:#00000059;display:flex;align-items:center;justify-content:center;pointer-events:none;-webkit-user-select:none;user-select:none;z-index:5}.viewer-overlay-card[data-v-c76cd1d6]{background:var(--terminal-overlay);border:1px solid var(--border);border-radius:10px;padding:14px 22px;text-align:center;pointer-events:auto;box-shadow:0 10px 30px #00000059}.viewer-overlay-title[data-v-c76cd1d6]{font-size:14px;font-weight:600;color:var(--fg)}.viewer-overlay-host[data-v-c76cd1d6]{margin-top:4px;font-size:12px;color:var(--fg);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;opacity:.85}.viewer-overlay-hint[data-v-c76cd1d6]{margin-top:6px;font-size:12px;color:var(--fg-dim)}.viewer-overlay-btn[data-v-c76cd1d6]{margin-top:8px;padding:6px 14px;border:none;border-radius:8px;background:#3b82f6;color:#fff;font-weight:600;pointer-events:auto;cursor:pointer}.overlay .warn[data-v-c76cd1d6]{color:#d29922}.overlay .bad[data-v-c76cd1d6]{color:var(--bad)}.overlay .dim[data-v-c76cd1d6]{color:var(--fg-dim)}.progress-track[data-v-c76cd1d6]{width:190px;height:4px;margin-top:6px;border-radius:999px;background:#94a3b83d;overflow:hidden}.progress-fill[data-v-c76cd1d6]{height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--accent),#4ade80);transition:width .12s ease}.term-context-menu[data-v-c76cd1d6]{position:fixed;min-width:150px;padding:6px;border-radius:8px;border:1px solid var(--border);background:#0d1117f5;box-shadow:0 10px 30px #00000059;z-index:1000}.term-context-item[data-v-c76cd1d6]{width:100%;border:none;background:transparent;color:var(--fg);text-align:left;padding:8px 10px;border-radius:6px;cursor:pointer}.term-context-item[data-v-c76cd1d6]:hover:not(:disabled){background:#ffffff0f}.term-context-item[data-v-c76cd1d6]:disabled{color:var(--fg-dim);cursor:default}.term-view.focused[data-v-c76cd1d6]{box-shadow:inset 0 0 0 1px var(--accent)}.pane-splitter[data-v-442ddd17]{position:absolute;z-index:5;background:transparent;-webkit-user-select:none;user-select:none;touch-action:none}.pane-splitter.col[data-v-442ddd17]{top:0;bottom:0;width:6px;cursor:col-resize}.pane-splitter.row[data-v-442ddd17]{left:0;right:0;height:6px;cursor:row-resize}.pane-splitter[data-v-442ddd17]:hover,.pane-splitter[data-v-442ddd17]:active{background:#ffffff14}.pane-grid[data-v-76c1e407]{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;gap:2px;background:var(--terminal-grid)}.pane-grid.single[data-v-76c1e407]{grid-template:"a"}.cell[data-v-76c1e407]{position:relative;background:var(--terminal-bg);overflow:hidden}.cell.drop-target[data-v-76c1e407]{box-shadow:inset 0 0 0 2px var(--accent)}.cell.drop-target[data-v-76c1e407]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background:color-mix(in srgb,var(--accent) 12%,transparent);pointer-events:none}.term-host[data-v-76c1e407]{position:absolute;top:0;right:0;bottom:0;left:0}.empty[data-v-76c1e407]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;color:var(--fg-dim);font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.cell-controls[data-v-76c1e407]{position:absolute;top:6px;right:8px;display:flex;align-items:center;gap:4px;z-index:6;pointer-events:none}.service-preview-controls-slot[data-v-76c1e407]{display:inline-flex;align-items:center;min-width:0;pointer-events:auto}.remote-badge[data-v-76c1e407]{display:inline-flex;align-items:center;gap:6px;background:#0d1117d9;border:1px solid var(--border);border-radius:10px;padding:2px 8px;font-size:11px;line-height:1.5;color:#d29922;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;-webkit-user-select:none;user-select:none;pointer-events:none}.remote-preview-trigger[data-v-76c1e407]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;border-radius:4px;color:inherit;background:transparent;cursor:pointer;pointer-events:auto}.remote-preview-trigger[data-v-76c1e407]:hover{color:var(--fg);background:#ffffff1a}.remote-preview-trigger svg[data-v-76c1e407]{display:block}.remote-badge svg[data-v-76c1e407]{display:block}.viewers-badge[data-v-76c1e407]{position:absolute;top:4px;right:4px;display:inline-flex;align-items:center;gap:4px;padding:1px 6px;border-radius:6px;background:#0000008c;color:var(--fg);font-size:11px;pointer-events:none}.viewers-badge svg[data-v-76c1e407]{display:block}.remote-badge .who[data-v-76c1e407]{font-weight:600}.remote-badge .who.dim[data-v-76c1e407],.remote-badge .sid[data-v-76c1e407]{color:var(--fg-dim);font-weight:400}.remote-badge .sid[data-v-76c1e407]:before{content:"·";margin-right:4px}.close-pane[data-v-76c1e407]{border:none;background:#0d1117b3;color:var(--fg-dim);font-size:14px;line-height:1;padding:2px 6px;border-radius:4px;cursor:pointer;opacity:0;pointer-events:auto;transition:opacity .12s,background .12s,color .12s}.cell:hover .close-pane[data-v-76c1e407]{opacity:1}.pane-grip[data-v-76c1e407]{opacity:0;transition:opacity .1s;cursor:grab;pointer-events:auto;-webkit-user-drag:element;padding:0 3px;font-size:12px;line-height:1;color:var(--fg-dim);-webkit-user-select:none;user-select:none}.pane-grip[data-v-76c1e407]:active{cursor:grabbing}.cell:hover .pane-grip[data-v-76c1e407]{opacity:1}@media (hover: none){.pane-grip[data-v-76c1e407]{display:none}}.close-pane[data-v-76c1e407]:hover{background:#f851492e;color:var(--bad)}.create-form[data-v-b7ce3097]{margin-bottom:1rem}.field[data-v-b7ce3097]{display:flex;flex-direction:column;gap:.25rem}.field-label[data-v-b7ce3097]{font-size:.75rem;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.06em}.secret-alert[data-v-b7ce3097]{margin:.5rem 0}.secret-msg[data-v-b7ce3097]{color:var(--fg-dim);font-size:.85rem;margin-bottom:.5rem}.secret-display[data-v-b7ce3097]{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.85rem;color:var(--good);word-break:break-all;display:block;padding:.25rem 0}.empty[data-v-b7ce3097]{color:var(--fg-dim);font-size:.875rem;margin:.5rem 0 0}.secret-alert[data-v-b54d534a]{margin-bottom:.5rem}.secret-msg[data-v-b54d534a]{color:var(--fg-dim);font-size:.85rem;margin-bottom:.5rem}.secret-display[data-v-b54d534a]{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.85rem;color:var(--good);word-break:break-all;display:block;padding:.25rem 0}.form-error[data-v-b54d534a]{color:var(--bad);font-size:.875rem;margin:.5rem 0 0}.hint[data-v-be878b2d]{color:var(--fg-dim);font-size:.875rem;margin:0 0 1rem}.muted[data-v-be878b2d]{color:var(--fg-dim);font-size:.875rem}.warn[data-v-be878b2d]{color:var(--warn, #d89614);font-size:.8125rem}.actions[data-v-be878b2d]{margin-top:1rem}.version code[data-v-be878b2d]{color:var(--fg)}.form-error[data-v-be878b2d]{color:var(--bad);font-size:.875rem;margin:.5rem 0 0}.hint[data-v-b32379d1]{color:var(--fg-dim);font-size:.875rem;margin:0 0 1rem}.muted[data-v-b32379d1]{color:var(--fg-dim);font-size:.875rem}.warn[data-v-b32379d1]{color:var(--warn, #d89614);font-size:.8125rem}.actions[data-v-b32379d1]{margin-top:1rem}.form-error[data-v-b32379d1]{color:var(--bad);font-size:.875rem;margin:.5rem 0 0}.traffic-dashboard[data-v-252de6da]{width:100%;max-width:1540px;margin:0 auto;color:var(--fg)}button[data-v-252de6da],input[data-v-252de6da]{font:inherit;letter-spacing:0}button[data-v-252de6da]{color:inherit}.traffic-titlebar[data-v-252de6da]{display:flex;align-items:flex-start;gap:16px;margin-bottom:14px}.traffic-titlebar h1[data-v-252de6da]{margin:0 0 4px;font-size:18px;font-weight:650}.traffic-titlebar p[data-v-252de6da],.panel-head p[data-v-252de6da]{margin:0;color:var(--fg-dim);font-size:11px}.traffic-titlebar>button[data-v-252de6da]{margin-left:auto}.icon-button[data-v-252de6da]{width:32px;height:32px;padding:0;border:1px solid var(--border);border-radius:6px;background:var(--panel);display:inline-grid;place-items:center;cursor:pointer}.icon-button[data-v-252de6da]:hover{border-color:var(--fg-dim);background:color-mix(in srgb,var(--panel) 88%,white)}.icon-button svg[data-v-252de6da]{width:15px;height:15px}.icon-button.small[data-v-252de6da]{width:27px;height:27px}.spinning[data-v-252de6da]{animation:spin-252de6da .8s linear infinite}@keyframes spin-252de6da{to{transform:rotate(360deg)}}.scope-section[data-v-252de6da]{min-width:0}.scope-heading[data-v-252de6da],.user-heading[data-v-252de6da]{display:flex;align-items:flex-end;gap:18px;min-height:54px;padding:0 2px 9px}.scope-heading>div>span[data-v-252de6da],.user-heading>div>span[data-v-252de6da],.panel-head>div>span[data-v-252de6da]{color:var(--fg-dim);font:700 9px ui-monospace,Menlo,monospace;text-transform:uppercase}.scope-heading h2[data-v-252de6da],.user-heading h2[data-v-252de6da]{margin:2px 0 0;font-size:14px}.scope-heading>small[data-v-252de6da]{margin-left:auto;color:var(--good);display:flex;align-items:center;gap:5px;font:10px ui-monospace,Menlo,monospace}.scope-heading>small svg[data-v-252de6da]{width:13px}.platform-strip[data-v-252de6da],.kpi-strip[data-v-252de6da]{border:1px solid var(--border);border-radius:8px;background:var(--panel);display:grid;grid-template-columns:repeat(4,minmax(0,1fr));overflow:hidden}.platform-cell[data-v-252de6da],.kpi-cell[data-v-252de6da]{min-width:0;min-height:78px;padding:12px 15px;border-left:1px solid var(--border);display:flex;flex-direction:column;justify-content:space-between}.platform-cell[data-v-252de6da]:first-child,.kpi-cell[data-v-252de6da]:first-child{border-left:0}.platform-cell>span[data-v-252de6da],.kpi-cell>span[data-v-252de6da]{color:var(--fg-dim);display:flex;align-items:center;gap:6px;font-size:10px}.platform-cell svg[data-v-252de6da]{width:13px;height:13px}.platform-cell strong[data-v-252de6da]{font:650 20px ui-monospace,Menlo,monospace}.platform-cell small[data-v-252de6da]{color:var(--fg-dim);font-size:9px}.platform-health[data-v-252de6da]{background:color-mix(in srgb,var(--good) 5%,transparent)}.platform-health strong[data-v-252de6da]{color:var(--good)}.user-section[data-v-252de6da]{margin-top:22px;padding-top:4px;border-top:1px solid var(--border)}.user-heading[data-v-252de6da]{align-items:center;padding-top:10px}.user-heading>div[data-v-252de6da]:first-child{min-width:210px}.filterbar[data-v-252de6da]{margin-left:auto;display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end}.segmented[data-v-252de6da]{display:inline-flex;align-items:center;gap:2px;padding:2px;border:1px solid var(--border);border-radius:7px;background:color-mix(in srgb,var(--bg) 75%,transparent)}.segmented button[data-v-252de6da]{height:26px;padding:0 9px;border:0;border-radius:5px;background:transparent;color:var(--fg-dim);cursor:pointer;font-size:11px;white-space:nowrap}.segmented button[data-v-252de6da]:hover{color:var(--fg)}.segmented button.active[data-v-252de6da]{color:var(--fg);background:color-mix(in srgb,var(--panel) 82%,white)}.user-selector[data-v-252de6da]{position:relative}.selector-trigger[data-v-252de6da]{width:min(260px,42vw);height:32px;padding:0 9px;border:1px solid var(--border);border-radius:6px;background:var(--panel);display:flex;align-items:center;gap:7px;cursor:pointer}.selector-trigger.active[data-v-252de6da],.selector-trigger[data-v-252de6da]:hover{border-color:var(--fg-dim)}.selector-trigger svg[data-v-252de6da]{width:14px;flex:0 0 auto}.selector-trigger span[data-v-252de6da]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}.selector-popover[data-v-252de6da]{position:absolute;z-index:20;top:calc(100% + 6px);right:0;width:min(360px,calc(100vw - 32px));border:1px solid color-mix(in srgb,var(--border) 75%,white);border-radius:7px;background:var(--bg);box-shadow:0 18px 46px #0009;overflow:hidden}.selector-head[data-v-252de6da],.selector-foot[data-v-252de6da]{display:flex;align-items:center;gap:10px;padding:11px 12px;border-bottom:1px solid var(--border)}.selector-head>div[data-v-252de6da]{flex:1;min-width:0}.selector-head strong[data-v-252de6da],.selector-head span[data-v-252de6da]{display:block}.selector-head span[data-v-252de6da]{margin-top:2px;color:var(--fg-dim);font-size:10px}.selector-head button[data-v-252de6da],.selector-foot button[data-v-252de6da],.flat-panel .panel-head button[data-v-252de6da],.selection-empty button[data-v-252de6da]{border:1px solid var(--border);border-radius:5px;background:var(--panel);padding:5px 8px;cursor:pointer;font-size:11px}.selector-head button[data-v-252de6da]{border:0;color:var(--accent);background:transparent}.search-box[data-v-252de6da]{margin:10px 12px;height:31px;border:1px solid var(--border);border-radius:5px;display:flex;align-items:center;gap:7px;padding:0 8px;background:var(--panel)}.search-box svg[data-v-252de6da]{width:13px;color:var(--fg-dim)}.search-box input[data-v-252de6da]{width:100%;min-width:0;border:0;outline:0;background:transparent;color:var(--fg)}.selector-options[data-v-252de6da]{max-height:278px;overflow-y:auto;padding:0 7px 7px}.selector-option[data-v-252de6da]{min-height:49px;padding:5px 7px;display:flex;align-items:center;gap:8px;border-radius:5px}.selector-option[data-v-252de6da]:hover{background:color-mix(in srgb,var(--panel) 70%,transparent)}.selector-option label[data-v-252de6da]{flex:1;min-width:0;display:flex;align-items:center;gap:9px;cursor:pointer}.selector-option label>span[data-v-252de6da]{min-width:0}.selector-option strong[data-v-252de6da],.selector-option small[data-v-252de6da]{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.selector-option small[data-v-252de6da]{color:var(--fg-dim);margin-top:2px}.selector-option button[data-v-252de6da]{border:0;background:transparent;color:var(--accent);cursor:pointer;font-size:10px}.selector-options>p[data-v-252de6da]{padding:16px;color:var(--fg-dim);text-align:center}.selector-foot[data-v-252de6da]{justify-content:flex-end;border-top:1px solid var(--border);border-bottom:0}.selector-foot .primary[data-v-252de6da]{background:var(--accent);color:#08111e;border-color:var(--accent)}.selection-banner[data-v-252de6da]{min-height:38px;margin-bottom:10px;padding:0 10px;border:1px solid color-mix(in srgb,var(--accent) 40%,var(--border));border-radius:6px;background:color-mix(in srgb,var(--accent) 8%,transparent);display:flex;align-items:center;gap:8px}.selection-banner>svg[data-v-252de6da]{width:14px;color:var(--accent)}.selection-banner>span[data-v-252de6da]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--fg-dim)}.selection-banner>button[data-v-252de6da]{margin-left:auto;width:25px;height:25px;border:0;background:transparent;cursor:pointer}.selection-banner>button svg[data-v-252de6da]{width:14px}.selection-empty[data-v-252de6da]{min-height:260px;border:1px dashed var(--border);border-radius:8px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;color:var(--fg-dim);text-align:center}.selection-empty>svg[data-v-252de6da]{width:38px;height:38px;padding:9px;border-radius:50%;background:color-mix(in srgb,var(--accent) 12%,transparent);color:var(--accent)}.selection-empty h3[data-v-252de6da]{margin:0;color:var(--fg);font-size:14px}.kpi-cell>div[data-v-252de6da]{display:flex;align-items:flex-end;gap:8px}.kpi-cell strong[data-v-252de6da]{font:650 21px ui-monospace,Menlo,monospace}.kpi-cell small[data-v-252de6da]{display:inline-flex;align-items:center;gap:2px;color:var(--fg-dim);font-size:9px}.kpi-cell small svg[data-v-252de6da]{width:11px}.kpi-cell small.up[data-v-252de6da]{color:var(--warn)}.kpi-cell small.down[data-v-252de6da]{color:var(--good)}.timeline-panel[data-v-252de6da],.flat-panel[data-v-252de6da],.diagnostics[data-v-252de6da]{margin-top:14px;border:1px solid var(--border);border-radius:8px;background:var(--panel);overflow:hidden}.panel-head[data-v-252de6da]{min-height:62px;padding:12px 14px;display:flex;align-items:flex-start;gap:14px;border-bottom:1px solid var(--border)}.panel-head h3[data-v-252de6da]{margin:2px 0 3px;font-size:13px}.timeline-head[data-v-252de6da]{min-height:82px}.timeline-controls[data-v-252de6da]{margin-left:auto;display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap;justify-content:flex-end}.timeline-controls>div[data-v-252de6da]{display:flex;flex-direction:column;gap:4px}.timeline-controls small[data-v-252de6da]{color:var(--fg-dim);font-size:9px}.chart-meta[data-v-252de6da]{min-height:34px;padding:0 14px;background:color-mix(in srgb,var(--bg) 55%,transparent);display:flex;align-items:center;gap:8px;color:var(--fg-dim);font-size:10px}.chart-meta span[data-v-252de6da]{padding:3px 6px;border:1px solid color-mix(in srgb,var(--accent) 35%,transparent);border-radius:4px;color:var(--accent);background:color-mix(in srgb,var(--accent) 8%,transparent)}.chart-empty[data-v-252de6da]{min-height:320px;display:grid;place-items:center;color:var(--fg-dim)}.svg-chart[data-v-252de6da]{position:relative;height:340px;padding:10px 12px 0}.svg-chart svg[data-v-252de6da]{width:100%;height:300px;overflow:visible}.svg-chart text[data-v-252de6da]{fill:var(--fg-dim);font-size:9px}.grid-lines line[data-v-252de6da]{stroke:var(--border);stroke-width:1;vector-effect:non-scaling-stroke}.line[data-v-252de6da]{fill:none;stroke-width:2;vector-effect:non-scaling-stroke}.line.outbound[data-v-252de6da]{stroke:var(--accent)}.line.inbound[data-v-252de6da]{stroke:#39c5cf}.legend[data-v-252de6da],.series-legend[data-v-252de6da]{display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:wrap;padding:6px 14px 12px;color:var(--fg-dim);font-size:10px}.legend span[data-v-252de6da],.series-legend span[data-v-252de6da]{display:flex;align-items:center;gap:5px}.legend i[data-v-252de6da],.series-legend i[data-v-252de6da]{width:9px;height:7px;border-radius:2px}.legend i.outbound[data-v-252de6da]{background:var(--accent)}.legend i.inbound[data-v-252de6da]{background:#39c5cf}.matrix-chart[data-v-252de6da]{min-height:330px;padding:15px 14px 7px;overflow-x:auto}.matrix-grid[data-v-252de6da]{min-width:720px;display:grid;grid-template-columns:190px minmax(510px,1fr);gap:3px 8px;align-items:center}.matrix-label[data-v-252de6da]{min-width:0;display:flex;gap:5px;font-size:9px;overflow:hidden}.matrix-label strong[data-v-252de6da],.matrix-label span[data-v-252de6da]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.matrix-label strong[data-v-252de6da]{max-width:105px}.matrix-label span[data-v-252de6da]{color:var(--fg-dim)}.matrix-cells[data-v-252de6da],.matrix-axis[data-v-252de6da]{display:grid;grid-template-columns:repeat(var(--columns),minmax(12px,1fr));gap:2px}.matrix-cells i[data-v-252de6da]{height:11px;border-radius:2px}.matrix-axis[data-v-252de6da]{min-width:720px;margin:7px 0 0 198px;padding-right:8px}.matrix-axis span[data-v-252de6da]{color:var(--fg-dim);text-align:center;font-size:8px;overflow:hidden}.bar-chart[data-v-252de6da]{height:320px;padding:18px 20px 0 54px;display:flex;align-items:flex-end;gap:clamp(3px,1.1vw,13px);border-bottom:1px solid var(--border);background:repeating-linear-gradient(to bottom,transparent 0,transparent 63px,color-mix(in srgb,var(--border) 65%,transparent) 64px)}.bar-column[data-v-252de6da]{flex:1;min-width:7px;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:7px}.bar-stack[data-v-252de6da]{width:min(34px,82%);height:260px;display:flex;flex-direction:column-reverse;justify-content:flex-start}.bar-stack i[data-v-252de6da]{display:block;min-height:0}.bar-column>span[data-v-252de6da]{height:18px;color:var(--fg-dim);font-size:8px;white-space:nowrap}.timeline-table-wrap[data-v-252de6da]{max-height:330px;overflow:auto;border-top:1px solid var(--border)}table[data-v-252de6da]{border-collapse:collapse;width:100%}.timeline-table[data-v-252de6da]{min-width:1050px;font-size:9px}th[data-v-252de6da]{color:var(--fg-dim);font-weight:600;text-align:left}.timeline-table th[data-v-252de6da],.timeline-table td[data-v-252de6da]{height:34px;padding:0 9px;border-right:1px solid var(--border);border-bottom:1px solid var(--border);white-space:nowrap;text-align:right}.timeline-table th[data-v-252de6da]:first-child,.timeline-table td[data-v-252de6da]:first-child,.timeline-table th[data-v-252de6da]:nth-child(2),.timeline-table td[data-v-252de6da]:nth-child(2){text-align:left}.timeline-table thead[data-v-252de6da]{position:sticky;top:0;background:var(--bg);z-index:2}.lower-grid[data-v-252de6da]{display:grid;grid-template-columns:minmax(280px,.7fr) minmax(520px,1.5fr);gap:14px}.flat-panel .panel-head[data-v-252de6da]{min-height:58px}.flat-panel .panel-head>button[data-v-252de6da]{margin-left:auto}.category-list[data-v-252de6da]{padding:7px}.category-list>button[data-v-252de6da]{width:100%;min-height:52px;padding:7px 8px;border:1px solid transparent;border-radius:5px;background:transparent;display:grid;grid-template-columns:minmax(0,1fr) 82px;grid-template-areas:"name value" "meter value";gap:5px 9px;cursor:pointer;text-align:left}.category-list>button[data-v-252de6da]:hover{background:color-mix(in srgb,var(--bg) 45%,transparent)}.category-list>button.active[data-v-252de6da]{border-color:color-mix(in srgb,var(--accent) 45%,transparent);background:color-mix(in srgb,var(--accent) 8%,transparent)}.category-name[data-v-252de6da]{grid-area:name;display:flex;align-items:center;gap:6px;min-width:0}.category-name>i[data-v-252de6da]{width:7px;height:7px;border-radius:2px}.category-name strong[data-v-252de6da]{font-size:10px}.category-name em[data-v-252de6da]{margin-left:auto;color:var(--fg-dim);font: 9px ui-monospace,Menlo,monospace}.meter[data-v-252de6da]{grid-area:meter;height:3px;border-radius:2px;background:var(--border);overflow:hidden}.meter i[data-v-252de6da]{display:block;height:100%}.category-value[data-v-252de6da]{grid-area:value;display:flex;flex-direction:column;justify-content:center;text-align:right}.category-value strong[data-v-252de6da]{font:600 11px ui-monospace,Menlo,monospace}.category-value small[data-v-252de6da]{margin-top:3px;color:var(--fg-dim);font-size:8px}.table-panel-head[data-v-252de6da]{align-items:center}.user-detail-select[data-v-252de6da]{width:min(290px,46%);margin-left:auto}.data-table-wrap[data-v-252de6da]{overflow-x:auto}.data-table[data-v-252de6da]{min-width:720px;font-size:10px}.data-table th[data-v-252de6da],.data-table td[data-v-252de6da]{height:42px;padding:0 10px;border-bottom:1px solid var(--border);white-space:nowrap}.data-table td:first-child strong[data-v-252de6da],.data-table td:first-child small[data-v-252de6da]{display:block;max-width:190px;overflow:hidden;text-overflow:ellipsis}.data-table td:first-child small[data-v-252de6da]{color:var(--fg-dim);margin-top:2px;font-size:8px}.data-table td[data-v-252de6da]:last-child{text-align:right}.positive[data-v-252de6da]{color:var(--warn)}.negative[data-v-252de6da]{color:var(--good)}.share[data-v-252de6da]{display:inline-block;width:55px;height:3px;margin-right:6px;background:var(--border);vertical-align:middle}.share i[data-v-252de6da]{display:block;height:100%;background:var(--accent)}.diagnostics[data-v-252de6da]{margin-top:14px}.diagnostic-grid[data-v-252de6da]{display:grid;grid-template-columns:1.35fr 1fr}.diagnostic-block[data-v-252de6da]{min-width:0;min-height:230px;padding:14px;border-left:1px solid var(--border)}.diagnostic-block[data-v-252de6da]:first-child{border-left:0}.diagnostic-block h4[data-v-252de6da]{margin:0 0 14px;font-size:11px}.activity-grid[data-v-252de6da]{overflow-x:auto;display:grid;grid-template-columns:120px minmax(400px,1fr);gap:4px 8px;align-items:center}.activity-grid>span[data-v-252de6da]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--fg-dim);font-size:9px}.activity-grid>div[data-v-252de6da]{display:grid;grid-template-columns:repeat(var(--columns),minmax(8px,1fr));gap:2px}.activity-grid i[data-v-252de6da]{height:16px;border-radius:2px}.density-list>div[data-v-252de6da]{min-height:38px;display:grid;grid-template-columns:90px minmax(70px,1fr) 84px;align-items:center;gap:8px;font-size:9px}.density-list>div>span[data-v-252de6da]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.density-list>div>div[data-v-252de6da]{height:4px;background:var(--border)}.density-list i[data-v-252de6da]{display:block;height:100%}.density-list strong[data-v-252de6da]{color:var(--fg-dim);text-align:right;font-weight:500}.drawer-backdrop[data-v-252de6da]{position:fixed;z-index:100;top:0;right:0;bottom:0;left:0;background:#0008;display:flex;justify-content:flex-end}.user-drawer[data-v-252de6da]{width:min(520px,100vw);height:100%;overflow-y:auto;border-left:1px solid var(--border);background:var(--bg);box-shadow:-18px 0 50px #0008}.drawer-head[data-v-252de6da]{min-height:92px;padding:18px;border-bottom:1px solid var(--border);display:flex;gap:12px}.drawer-head>div[data-v-252de6da]{min-width:0}.drawer-head>button[data-v-252de6da]{margin-left:auto}.drawer-head span[data-v-252de6da],.drawer-head small[data-v-252de6da]{color:var(--fg-dim);font-size:10px}.drawer-head h3[data-v-252de6da]{margin:5px 0;font-size:16px;overflow-wrap:anywhere}.drawer-kpis[data-v-252de6da]{display:grid;grid-template-columns:repeat(3,1fr);border-bottom:1px solid var(--border)}.drawer-kpis>div[data-v-252de6da]{min-width:0;min-height:74px;padding:13px;border-left:1px solid var(--border)}.drawer-kpis>div[data-v-252de6da]:first-child{border-left:0}.drawer-kpis span[data-v-252de6da],.drawer-kpis strong[data-v-252de6da]{display:block}.drawer-kpis span[data-v-252de6da]{color:var(--fg-dim);font-size:9px}.drawer-kpis strong[data-v-252de6da]{margin-top:10px;font:600 14px ui-monospace,Menlo,monospace}.user-drawer section[data-v-252de6da]{padding:16px 18px;border-bottom:1px solid var(--border)}.user-drawer section h4[data-v-252de6da]{margin:0 0 14px;display:flex;align-items:center;gap:7px;font-size:11px}.user-drawer section h4 svg[data-v-252de6da]{width:14px;color:var(--accent)}.drawer-bars[data-v-252de6da]{height:190px;display:flex;align-items:flex-end;gap:4px}.drawer-bars>div[data-v-252de6da]{flex:1;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:5px}.drawer-bars i[data-v-252de6da]{width:min(18px,75%);min-height:1px;background:var(--accent);border-radius:2px 2px 0 0}.drawer-bars span[data-v-252de6da]{color:var(--fg-dim);font-size:7px;white-space:nowrap}.user-drawer table[data-v-252de6da]{font-size:9px}.user-drawer th[data-v-252de6da],.user-drawer td[data-v-252de6da]{height:34px;padding:0 6px;border-bottom:1px solid var(--border);text-align:right}.user-drawer th[data-v-252de6da]:first-child,.user-drawer td[data-v-252de6da]:first-child,.user-drawer th[data-v-252de6da]:nth-child(2),.user-drawer td[data-v-252de6da]:nth-child(2){text-align:left}button[data-v-252de6da]:focus-visible,input[data-v-252de6da]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}@media (max-width: 1100px){.timeline-head[data-v-252de6da]{align-items:stretch;flex-direction:column}.timeline-controls[data-v-252de6da]{margin-left:0;justify-content:flex-start}.lower-grid[data-v-252de6da],.diagnostic-grid[data-v-252de6da]{grid-template-columns:1fr}.diagnostic-block[data-v-252de6da]{border-left:0;border-top:1px solid var(--border)}.diagnostic-block[data-v-252de6da]:first-child{border-top:0}}@media (max-width: 760px){.traffic-titlebar[data-v-252de6da]{padding-top:2px}.scope-heading[data-v-252de6da],.user-heading[data-v-252de6da]{align-items:flex-start;flex-direction:column;gap:8px}.scope-heading>small[data-v-252de6da],.filterbar[data-v-252de6da]{margin-left:0}.filterbar[data-v-252de6da]{width:100%;justify-content:flex-start}.selector-trigger[data-v-252de6da]{width:min(100%,310px)}.platform-strip[data-v-252de6da],.kpi-strip[data-v-252de6da]{grid-template-columns:repeat(2,minmax(0,1fr))}.platform-cell[data-v-252de6da]:nth-child(3),.kpi-cell[data-v-252de6da]:nth-child(3){border-left:0;border-top:1px solid var(--border)}.platform-cell[data-v-252de6da]:nth-child(4),.kpi-cell[data-v-252de6da]:nth-child(4){border-top:1px solid var(--border)}.timeline-controls[data-v-252de6da]{width:100%}.timeline-controls>div[data-v-252de6da]{width:100%}.timeline-controls .segmented[data-v-252de6da]{width:100%;overflow-x:auto}.timeline-controls .segmented button[data-v-252de6da]{flex:1}.matrix-grid[data-v-252de6da]{grid-template-columns:135px minmax(500px,1fr)}.matrix-axis[data-v-252de6da]{margin-left:143px}.bar-chart[data-v-252de6da]{padding-left:15px;overflow-x:auto}.bar-column[data-v-252de6da]{min-width:18px}.table-panel-head[data-v-252de6da]{align-items:flex-start;flex-direction:column}.user-detail-select[data-v-252de6da]{width:100%;margin-left:0}.drawer-kpis[data-v-252de6da]{grid-template-columns:1fr}.drawer-kpis>div[data-v-252de6da]{min-height:58px;border-left:0;border-top:1px solid var(--border)}.drawer-kpis>div[data-v-252de6da]:first-child{border-top:0}}@media (prefers-reduced-motion: reduce){.spinning[data-v-252de6da]{animation:none}}.admin-panel[data-v-6f7ef581]{display:flex;flex-direction:column;flex:1 1 auto;height:100%;min-height:0;min-width:0;overflow:hidden}.admin-tabs[data-v-6f7ef581]{display:flex;gap:2px;padding:8px 12px 0;border-bottom:1px solid var(--border);flex:0 0 auto}.admin-tabs button[data-v-6f7ef581]{background:transparent;border:none;border-bottom:2px solid transparent;color:var(--fg-dim);padding:8px 12px;cursor:pointer;font-size:13px}.admin-tabs button[data-v-6f7ef581]:hover{color:var(--fg)}.admin-tabs button.active[data-v-6f7ef581]{color:var(--accent);border-bottom-color:var(--accent);font-weight:600}.admin-body[data-v-6f7ef581]{flex:1 1 auto;min-height:0;overflow-y:auto;padding:20px 24px}.terminal-appearance[data-v-e31f8f67]{display:flex;flex-direction:column;gap:14px}.field-label[data-v-e31f8f67]{font-size:12px;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.05em}.hint[data-v-e31f8f67]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.error[data-v-e31f8f67]{color:var(--bad);font-size:12px;margin:0}.checkbox[data-v-e31f8f67]{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--fg)}.number-input[data-v-e31f8f67]{width:80px;padding:4px 8px;background:var(--bg);border:1px solid var(--border);border-radius:4px;color:var(--fg);font:inherit}.settings-field-grid .number-input[data-v-e31f8f67]{width:100%}.cursor-blink[data-v-e31f8f67]{min-height:18px}.scrollback-field[data-v-e31f8f67]{align-items:flex-start}.tab-pane[data-v-e7440565]{display:flex;flex-direction:column;gap:14px}.field-label[data-v-e7440565]{font-size:12px;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.05em}.hint[data-v-e7440565]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.error[data-v-e7440565]{color:var(--bad);font-size:12px;margin:0}.checkbox[data-v-e7440565]{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--fg)}.number-input[data-v-e7440565]{width:80px;padding:4px 8px;background:var(--bg);border:1px solid var(--border);border-radius:4px;color:var(--fg);font:inherit}.text-input[data-v-e7440565]{padding:6px 8px;background:var(--bg);border:1px solid var(--border);border-radius:4px;color:var(--fg);font:inherit}.custom-shell-row[data-v-e7440565]{display:flex;gap:8px}.custom-shell-row .text-input[data-v-e7440565]{flex:1 1 auto}.custom-shell-row button[data-v-e7440565]{padding:6px 10px;background:var(--panel);border:1px solid var(--border);border-radius:4px;color:var(--fg);font:inherit}.push-section[data-v-e7440565]{display:flex;flex-direction:column;gap:8px;padding-top:14px;border-top:1px solid var(--border)}.section-title[data-v-e7440565]{margin:0;font-size:12px;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.05em}.push-test-button[data-v-e7440565]{align-self:flex-start;padding:6px 10px;background:var(--panel);border:1px solid var(--border);border-radius:4px;color:var(--fg);font:inherit;cursor:pointer}.push-test-button[data-v-e7440565]:disabled{opacity:.5;cursor:not-allowed}.pair-consume[data-v-285ce5b2]{display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:12px;border:1px solid var(--border);border-radius:6px;background:#ffffff08}.pending[data-v-285ce5b2],.pair-error[data-v-285ce5b2]{display:flex;flex-direction:column;gap:6px;color:var(--fg-dim);font-size:13px}.pending p[data-v-285ce5b2],.pair-error p[data-v-285ce5b2]{margin:0}.step[data-v-285ce5b2],.elapsed[data-v-285ce5b2],.code[data-v-285ce5b2]{font-family:var(--font-mono);font-size:12px}.code[data-v-285ce5b2]{color:var(--bad)}.cancel[data-v-285ce5b2],.pair-error button[data-v-285ce5b2]{align-self:flex-start}.tab-pane[data-v-55932ce0]{display:flex;flex-direction:column;gap:12px}.account-section[data-v-55932ce0]{display:flex;flex-direction:column;gap:8px;padding-bottom:16px;border-bottom:1px solid var(--border)}.account-section[data-v-55932ce0]:last-child{border-bottom:none;padding-bottom:0}.account-section h3[data-v-55932ce0]{margin:0 0 4px;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--fg-dim)}.field-label[data-v-55932ce0]{font-size:12px;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.05em}.email-value[data-v-55932ce0]{margin:0;color:var(--fg);font-size:13px}.hint[data-v-55932ce0]{margin:0;color:var(--fg-dim);font-size:12px;line-height:1.5}.warning-text[data-v-55932ce0]{color:var(--bad)}.error[data-v-55932ce0]{color:var(--bad);font-size:12px;margin:0}.success[data-v-55932ce0]{color:var(--good);font-size:12px;margin:0}.relay-url-row[data-v-55932ce0]{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:8px}.checkbox-row[data-v-55932ce0]{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--fg-dim);font-size:12px}.checkbox-row input[data-v-55932ce0]{flex:0 0 auto}.inline-error[data-v-55932ce0]{color:var(--bad);font-size:12px;margin:0}input[type=text][data-v-55932ce0],input[type=email][data-v-55932ce0],select[data-v-55932ce0],input[type=password][data-v-55932ce0]{height:32px;padding:6px 10px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;font-size:13px}input[data-v-55932ce0]:focus{outline:none;box-shadow:0 0 0 2px var(--accent)}button.secondary[data-v-55932ce0]{align-self:flex-start;background:transparent;color:var(--fg-dim);border:1px solid var(--border);border-radius:6px;padding:6px 12px;font-size:13px;cursor:pointer}button.secondary[data-v-55932ce0]:hover:not(:disabled){color:var(--fg);background:#ffffff0a}button.secondary[data-v-55932ce0]:disabled{opacity:.5;cursor:not-allowed}button.primary-action[data-v-55932ce0]{background:var(--accent);border-color:var(--accent);color:#0d1117;font-weight:600}button.primary-action[data-v-55932ce0]:hover:not(:disabled){background:#79b8ff;color:#0d1117}.danger-btn[data-v-55932ce0]{align-self:flex-start;background:transparent;color:var(--bad);border:1px solid var(--bad);border-radius:6px;padding:6px 12px;font-size:13px;cursor:pointer}.danger-btn[data-v-55932ce0]:hover:not(:disabled){background:color-mix(in srgb,var(--bad) 8%,transparent 92%)}.danger-btn[data-v-55932ce0]:disabled{opacity:.5;cursor:not-allowed}.pairing-panel[data-v-45575575]{display:flex;flex-direction:column;gap:10px;padding:12px;border:1px solid var(--border);border-radius:10px}.title[data-v-45575575]{font-size:13px;font-weight:700;color:var(--fg)}.hint[data-v-45575575]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.45}.qr-wrap[data-v-45575575]{display:flex;flex-direction:column;align-items:center;gap:8px}.qr[data-v-45575575]{width:240px;height:240px;image-rendering:pixelated;background:#fff;padding:6px;border-radius:6px}.qr.dimmed[data-v-45575575]{opacity:.35}.countdown[data-v-45575575]{font-size:12px;color:var(--fg-dim)}.countdown.expired[data-v-45575575]{color:var(--bad)}.wrap-badge[data-v-45575575]{font-size:11px;color:var(--fg-dim);padding:2px 8px;border:1px solid var(--border);border-radius:4px}.wrap-warning[data-v-45575575]{font-size:11px;color:var(--warn);background:#ffc8000f;border-left:2px solid var(--warn);padding:6px 10px;margin:0;line-height:1.4;text-align:left;max-width:240px}.prefix[data-v-45575575]{font-family:ui-monospace,Menlo,monospace;font-size:11px;color:var(--fg-dim)}.error[data-v-45575575]{color:var(--bad);font-size:12px;margin:0}button[data-v-45575575]{height:30px;border:1px solid var(--accent);border-radius:7px;background:var(--accent);color:var(--bg);padding:0 12px;font-size:12px;font-weight:700;cursor:pointer}button[data-v-45575575]:disabled{opacity:.55}.url-label-row[data-v-100947b5]{display:flex;align-items:center;justify-content:space-between;gap:10px}.insecure-inline[data-v-100947b5]{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--fg-dim);text-transform:none;letter-spacing:normal;cursor:pointer;-webkit-user-select:none;user-select:none}.insecure-inline input[type=checkbox][data-v-100947b5]{margin:0}.url-input[data-v-100947b5]{display:flex;align-items:stretch;border:1px solid var(--border);border-radius:6px;overflow:hidden;background:var(--bg)}.url-input[data-v-100947b5]:focus-within{box-shadow:0 0 0 2px var(--accent)}.url-scheme[data-v-100947b5]{display:inline-flex;align-items:center;padding:0 8px;font-size:13px;color:var(--fg-dim);background:color-mix(in srgb,var(--fg-dim) 12%,transparent 88%);border-right:1px solid var(--border);-webkit-user-select:none;user-select:none;white-space:nowrap}.url-input.insecure .url-scheme[data-v-100947b5]{color:var(--warn, #d97706)}.url-input input[data-v-100947b5]{flex:1;border:0;border-radius:0;background:transparent;min-width:0}.url-input input[data-v-100947b5]:focus{box-shadow:none}.auth-switch[data-v-100947b5]{-webkit-appearance:none;-moz-appearance:none;appearance:none;align-self:flex-start;background:transparent;border:0;padding:0;margin:-4px 0 0;font:inherit;font-size:12px;color:var(--fg-dim);cursor:pointer}.auth-switch[data-v-100947b5]:disabled{cursor:not-allowed;opacity:.5}.auth-switch-action[data-v-100947b5]{color:var(--accent);text-decoration:underline;text-underline-offset:2px}.auth-switch:hover:not(:disabled) .auth-switch-action[data-v-100947b5]{text-decoration:none}.tab-pane[data-v-100947b5]{display:flex;flex-direction:column;gap:12px}.dim[data-v-100947b5]{color:var(--fg-dim);font-size:13px}.uplink-toggle-row[data-v-100947b5]{display:flex;align-items:center;gap:10px}.toggle-switch[data-v-100947b5]{display:inline-flex;align-items:center;gap:6px;cursor:pointer;-webkit-user-select:none;user-select:none}.toggle-switch.disabled[data-v-100947b5]{opacity:.5;cursor:not-allowed}.toggle-switch input[type=checkbox][data-v-100947b5]{position:absolute;opacity:0;width:0;height:0}.toggle-track[data-v-100947b5]{position:relative;display:inline-block;width:32px;height:18px;background:var(--fg-dim);border-radius:9px;transition:background .15s}.toggle-switch input:checked+.toggle-track[data-v-100947b5]{background:var(--good)}.toggle-thumb[data-v-100947b5]{position:absolute;top:2px;left:2px;width:14px;height:14px;background:var(--fg);border-radius:50%;transition:transform .15s}.toggle-switch input:checked+.toggle-track .toggle-thumb[data-v-100947b5]{transform:translate(14px)}.toggle-label[data-v-100947b5]{font-size:12px;color:var(--fg-dim);min-width:2.2em}.status-pill[data-v-100947b5]{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border:1px solid var(--border);border-radius:999px;font-size:12px;width:max-content}.status-pill .dot[data-v-100947b5]{font-size:10px;line-height:1}.status-pill.on .dot[data-v-100947b5]{color:var(--good)}.status-pill.off .dot[data-v-100947b5]{color:var(--fg-dim)}.status-pill.on[data-v-100947b5]{color:var(--good)}.status-pill.off[data-v-100947b5]{color:var(--fg-dim)}.status-pill.warn[data-v-100947b5],.status-pill.warn .dot[data-v-100947b5]{color:var(--warn, #d97706)}.status-pill.error[data-v-100947b5],.status-pill.error .dot[data-v-100947b5]{color:var(--bad)}.hint[data-v-100947b5]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.field-label[data-v-100947b5]{font-size:12px;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.05em}.checkbox[data-v-100947b5]{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--fg)}.error[data-v-100947b5]{color:var(--bad);font-size:12px;margin:0}.warning[data-v-100947b5]{color:var(--bad);font-size:12px;line-height:1.45;margin:0}input[type=text][data-v-100947b5],input[type=email][data-v-100947b5],input[type=password][data-v-100947b5]{height:32px;padding:6px 10px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;font-size:13px}input[data-v-100947b5]:focus{outline:none;box-shadow:0 0 0 2px var(--accent)}.password-field[data-v-100947b5]{position:relative;display:block}.password-field input[data-v-100947b5]{width:100%;padding-right:36px}.password-toggle[data-v-100947b5]{position:absolute;top:50%;right:8px;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;background:transparent;color:var(--fg-dim);border-radius:4px;cursor:pointer;transition:color .15s ease,background .15s ease}.password-toggle[data-v-100947b5]:hover:not(:disabled){color:var(--fg);background:color-mix(in srgb,var(--accent) 12%,transparent 88%)}.password-toggle[data-v-100947b5]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.password-toggle[data-v-100947b5]:disabled{opacity:.4;cursor:not-allowed}.danger-zone[data-v-100947b5]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-top:8px;padding-top:12px;border-top:1px solid var(--border)}.danger-zone-text[data-v-100947b5]{flex:1;min-width:0}.danger-btn[data-v-100947b5]{align-self:flex-start;background:transparent;color:var(--bad);border:1px solid var(--bad);border-radius:6px;padding:6px 12px;font-size:13px;cursor:pointer}.danger-btn[data-v-100947b5]:hover:not(:disabled){background:color-mix(in srgb,var(--bad) 8%,transparent 92%)}.danger-btn[data-v-100947b5]:disabled{opacity:.5;cursor:not-allowed}.log-lines[data-v-c9e8e2b4]{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;line-height:1.45;white-space:pre-wrap;word-break:break-word}.log-line[data-v-c9e8e2b4]{display:block}.ts[data-v-c9e8e2b4]{color:var(--fg-dim);margin-right:6px}.lvl[data-v-c9e8e2b4]{margin-right:6px;font-weight:700}.tag[data-v-c9e8e2b4]{color:var(--accent);margin-right:6px}.msg[data-v-c9e8e2b4]{color:var(--fg)}.raw[data-v-c9e8e2b4],.lvl-DEBUG .lvl[data-v-c9e8e2b4],.lvl-DEBUG .msg[data-v-c9e8e2b4]{color:var(--fg-dim)}.lvl-INFO .lvl[data-v-c9e8e2b4]{color:var(--fg)}.lvl-WARN .lvl[data-v-c9e8e2b4],.lvl-WARN .msg[data-v-c9e8e2b4]{color:var(--warn, #d2a86a)}.lvl-ERROR .lvl[data-v-c9e8e2b4],.lvl-ERROR .msg[data-v-c9e8e2b4]{color:var(--bad)}.tab-pane[data-v-cd8d05fa]{display:flex;flex-direction:column;gap:14px}.dim[data-v-cd8d05fa]{color:var(--fg-dim);font-size:13px}.checkbox[data-v-cd8d05fa]{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--fg)}.checkbox-row[data-v-cd8d05fa]{display:flex;align-items:center;gap:6px}.level-row[data-v-cd8d05fa]{display:flex;align-items:center;gap:8px}.level-label[data-v-cd8d05fa]{font-size:13px;color:var(--fg)}.level-select[data-v-cd8d05fa]{width:104px}.info-icon[data-v-cd8d05fa]{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;border:1px solid var(--fg-dim);border-radius:50%;color:var(--fg-dim);font-size:10px;font-style:italic;line-height:1;cursor:help;-webkit-user-select:none;user-select:none}.info-icon[data-v-cd8d05fa]:hover{color:var(--fg);border-color:var(--fg)}.kv[data-v-cd8d05fa]{display:flex;align-items:flex-start;gap:12px;font-size:12px}.kv .k[data-v-cd8d05fa]{color:var(--fg-dim);width:130px}.kv .v[data-v-cd8d05fa]{color:var(--fg)}.kv .path[data-v-cd8d05fa]{flex:1;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow-wrap:anywhere}.actions[data-v-cd8d05fa]{display:flex;gap:8px}.error[data-v-cd8d05fa]{color:var(--bad);font-size:12px;margin:0}button[data-v-cd8d05fa]{height:32px;padding:6px 14px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;cursor:pointer;font-size:13px}button[data-v-cd8d05fa]:hover{background:#ffffff0a}.tail-wrap[data-v-cd8d05fa]{display:flex;flex-direction:column;gap:6px;margin-top:4px}.tail-header[data-v-cd8d05fa]{display:flex;align-items:center;gap:8px}.tail-label[data-v-cd8d05fa]{font-size:12px;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.04em;flex:1 1 auto}.tail-refresh[data-v-cd8d05fa]{height:24px;padding:2px 10px;font-size:12px}.tail-paused[data-v-cd8d05fa]{height:24px;padding:2px 10px;font-size:12px;flex:0 0 auto;color:var(--accent);border-color:var(--accent)}.tail-level[data-v-cd8d05fa]{width:104px;flex:0 0 auto}.tail-tag[data-v-cd8d05fa]{width:152px;flex:0 0 auto}.tail-empty[data-v-cd8d05fa]{color:var(--fg-dim);font-size:12px;margin:0}.tail-error[data-v-cd8d05fa]{color:var(--bad);font-size:12px;margin:0}.tail-content[data-v-cd8d05fa]{margin:0;background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:10px;color:var(--fg);font-size:11px;line-height:1.45;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;max-height:280px;overflow:auto;white-space:pre-wrap;word-break:break-word}.tab-pane[data-v-c859d0af]{display:flex;flex-direction:column;gap:14px}.dim[data-v-c859d0af]{color:var(--fg-dim);font-size:13px}.grid[data-v-c859d0af]{display:grid;gap:6px;font-size:12px}.kv[data-v-c859d0af]{display:flex;align-items:flex-start;gap:12px}.kv .k[data-v-c859d0af]{color:var(--fg-dim);width:130px}.kv .v[data-v-c859d0af]{color:var(--fg)}.kv .path[data-v-c859d0af]{flex:1;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow-wrap:anywhere}.checkbox[data-v-c859d0af]{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--fg)}.proxy-box[data-v-c859d0af]{display:grid;gap:6px}.field-label[data-v-c859d0af]{color:var(--fg-dim);font-size:12px}.proxy-row[data-v-c859d0af]{display:flex;gap:8px}.proxy-row input[data-v-c859d0af]{flex:1;min-width:0;height:32px;padding:6px 10px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;font:inherit;font-size:13px}.hint[data-v-c859d0af]{margin:0;color:var(--fg-dim);font-size:12px;line-height:1.4}.notes[data-v-c859d0af]{font-size:12px;color:var(--fg)}.notes summary[data-v-c859d0af]{color:var(--fg-dim);cursor:pointer}.notes pre[data-v-c859d0af]{background:var(--bg);border:1px solid var(--border);padding:8px;border-radius:6px;white-space:pre-wrap;word-break:break-word;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;max-height:160px;overflow-y:auto;font-size:11px}.version-lines[data-v-c859d0af]{display:grid;gap:6px;font-size:13px;color:var(--fg)}.version-line label[data-v-c859d0af]{display:flex;align-items:center;gap:8px;cursor:pointer}.actions[data-v-c859d0af]{display:flex;gap:8px}.error[data-v-c859d0af]{color:var(--bad);font-size:12px;margin:0}button[data-v-c859d0af]{height:32px;padding:6px 14px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;cursor:pointer;font-size:13px}button[data-v-c859d0af]:hover:not(:disabled){background:#ffffff0a}button[data-v-c859d0af]:disabled{opacity:.5;cursor:default}button.primary[data-v-c859d0af]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}button.primary[data-v-c859d0af]:hover:not(:disabled){background:#79b8ff;border-color:#79b8ff}button.primary.danger[data-v-c859d0af]{background:var(--bad);color:#0d1117;border-color:var(--bad)}button.primary.danger[data-v-c859d0af]:hover:not(:disabled){background:#ff6f6a;border-color:#ff6f6a}button.secondary[data-v-c859d0af]{background:transparent;color:var(--fg-dim);border:1px solid var(--border)}button.secondary[data-v-c859d0af]:hover:not(:disabled){color:var(--fg);background:#ffffff0a}.translate-settings[data-v-2b2be568]{margin-top:8px;padding-top:8px;border-top:1px solid #2d333b;font-size:12px;display:flex;flex-direction:column;gap:8px}.translate-settings label[data-v-2b2be568]{display:flex;flex-direction:column;gap:3px}.translate-settings label span[data-v-2b2be568]{opacity:.7;font-size:11px}.translate-settings input[data-v-2b2be568],.translate-settings select[data-v-2b2be568]{background:#00000040;color:inherit;border:1px solid #2d333b;border-radius:3px;padding:4px 6px;font-size:12px}.extra-params[data-v-2b2be568]{background:#00000040;color:inherit;border:1px solid #2d333b;border-radius:3px;padding:4px 6px;font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;resize:vertical;min-height:56px}.extra-params-error[data-v-2b2be568]{color:#f87171;font-size:11px}.hint[data-v-2b2be568]{opacity:.55;font-size:11px}.muted[data-v-2b2be568]{opacity:.55;font-size:11px;margin:4px 0 0}.settings-plugins[data-v-a25af5cc]{padding:12px 16px;color:var(--settings-fg, #c9d1d9)}.hint[data-v-a25af5cc]{margin:0 0 12px;font-size:12px;opacity:.7}.plugin-list[data-v-a25af5cc]{list-style:none;margin:0;padding:0}.plugin-row[data-v-a25af5cc]{border:1px solid #2d333b;border-radius:6px;padding:10px 12px;margin-bottom:8px}.row-head[data-v-a25af5cc]{display:flex;align-items:center;gap:8px;font-weight:600}.desc[data-v-a25af5cc]{margin:6px 0 0 24px;font-size:12px;opacity:.7}.empty[data-v-a25af5cc]{font-size:12px;opacity:.5}.fe-settings[data-v-a25af5cc]{margin-top:8px;padding-top:8px;border-top:1px solid #2d333b;font-size:12px;display:flex;flex-direction:column;gap:6px}.fe-settings label[data-v-a25af5cc]{display:inline-flex;align-items:center;gap:6px}.fe-settings .muted[data-v-a25af5cc]{margin:6px 0 0;opacity:.6;font-size:11px}.widget-settings[data-v-a25af5cc]{margin:8px 0 0 24px;padding-top:8px;border-top:1px solid #2d333b;font-size:12px}.widget-settings label[data-v-a25af5cc]{display:inline-flex;align-items:center;gap:6px}.widget-settings .muted[data-v-a25af5cc]{margin:6px 0 0;opacity:.6;font-size:11px}.hotkey-cell[data-v-80cabc38]{font-family:SF Mono,Menlo,monospace;font-size:12px;background:#0d1117;border:1px solid #2d333b;color:#c9d1d9;padding:3px 8px;border-radius:4px;cursor:pointer;min-width:160px;text-align:left}.hotkey-cell[data-v-80cabc38]:hover{background:#161b22}.hotkey-cell.capturing[data-v-80cabc38]{background:#58a6ff1f;border-color:var(--accent);color:var(--accent)}.hotkey-cell.empty[data-v-80cabc38]{color:#6e7681;font-style:italic}.shortcut-settings[data-v-05d9d72b]{padding:8px 4px;font-size:12px;color:var(--fg)}.shortcut-group[data-v-05d9d72b]{margin-bottom:18px}.shortcut-group h3[data-v-05d9d72b]{margin:4px 0 8px;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--fg-dim)}.shortcut-row[data-v-05d9d72b]{display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:8px;padding:4px 0}.label[data-v-05d9d72b]{color:var(--fg)}.reset-row[data-v-05d9d72b]{background:transparent;border:1px solid #2d333b;color:var(--fg-dim);padding:2px 8px;border-radius:4px;cursor:pointer}.reset-row[data-v-05d9d72b]:hover{background:#ffffff0a;color:var(--fg)}.conflict[data-v-05d9d72b]{grid-column:1 / -1;color:#f85149;font-size:11px;padding-left:4px}.actions-row[data-v-05d9d72b]{display:flex;gap:8px;margin-top:12px;align-items:center}.spacer[data-v-05d9d72b]{flex:1}.actions-row button[data-v-05d9d72b]{background:#21262d;border:1px solid #2d333b;color:#c9d1d9;padding:4px 12px;border-radius:4px;cursor:pointer}.actions-row button[data-v-05d9d72b]:disabled{opacity:.4;cursor:default}.actions-row .save[data-v-05d9d72b]{background:var(--accent);color:#0d1117;border-color:var(--accent)}.actions-row .save[data-v-05d9d72b]:disabled{background:#21262d;color:#c9d1d9;border-color:#2d333b}.error[data-v-05d9d72b]{color:#f85149;font-size:12px;margin:8px 0 0}@media (max-width: 640px){.shortcut-row[data-v-05d9d72b]{grid-template-columns:minmax(0,1fr) minmax(0,140px) auto}.shortcut-row[data-v-05d9d72b] .hotkey-cell{min-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.actions-row[data-v-05d9d72b]{flex-wrap:wrap}}.diag[data-v-1a4e377a]{display:flex;flex-direction:column;gap:10px}.hint[data-v-1a4e377a]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.preview[data-v-1a4e377a]{background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:10px;font-family:ui-monospace,Menlo,monospace;font-size:11px;line-height:1.4;max-height:320px;overflow:auto;white-space:pre;color:var(--fg);margin:0}.row[data-v-1a4e377a]{display:flex;gap:8px;align-items:center}button[data-v-1a4e377a]{height:30px;border:1px solid var(--accent);border-radius:7px;background:var(--accent);color:var(--bg);padding:0 12px;font-size:12px;font-weight:700;cursor:pointer}.status[data-v-1a4e377a]{font-size:12px;color:var(--fg-dim)}.configio[data-v-9ef7411c]{display:flex;flex-direction:column;gap:16px;margin-top:12px;padding-top:12px;border-top:1px solid var(--border)}.configio-section[data-v-9ef7411c]{display:flex;flex-direction:column;gap:8px}.section-title[data-v-9ef7411c]{margin:0;font-size:13px}.hint[data-v-9ef7411c]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.checkbox[data-v-9ef7411c]{display:flex;align-items:center;gap:6px;font-size:12px}.row[data-v-9ef7411c]{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.status[data-v-9ef7411c]{font-size:12px;color:var(--fg-dim)}.status.error[data-v-9ef7411c]{color:var(--bad)}.file-input[data-v-9ef7411c]{display:none}.configio-preview[data-v-9ef7411c],.configio-report[data-v-9ef7411c]{border:1px solid var(--border);border-radius:6px;padding:10px;background:var(--bg);display:flex;flex-direction:column;gap:6px}.configio-preview h5[data-v-9ef7411c],.configio-report h5[data-v-9ef7411c]{margin:0;font-size:12px}.configio-preview h6[data-v-9ef7411c],.configio-report h6[data-v-9ef7411c]{margin:4px 0 2px;font-size:11px;color:var(--fg-dim)}.configio-preview ul[data-v-9ef7411c],.configio-report ul[data-v-9ef7411c]{margin:0;padding-left:18px;font-size:12px}button[data-v-9ef7411c]{height:30px;border:1px solid var(--accent);border-radius:7px;background:var(--accent);color:var(--bg);padding:0 12px;font-size:12px;font-weight:700;cursor:pointer}button[data-v-9ef7411c]:disabled{opacity:.5;cursor:default}.snippet-run-overlay[data-v-ca33db20]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0000008c;display:flex;align-items:center;justify-content:center;z-index:60}.snippet-run-panel[data-v-ca33db20]{background:#11182b;border:1px solid #1e2638;border-radius:11px;padding:16px 18px;min-width:360px;max-width:560px;max-height:80vh;overflow-y:auto;display:flex;flex-direction:column;gap:12px;color:#e6e7ea}.hint[data-v-ca33db20]{font-size:12px;color:var(--fg-dim);margin:0}.host-list[data-v-ca33db20]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;max-height:40vh;overflow-y:auto}.host-list label[data-v-ca33db20]{display:flex;align-items:center;gap:8px;font-size:.85rem}.rows[data-v-ca33db20]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.row[data-v-ca33db20]{border:1px solid var(--border);border-radius:6px;padding:8px 10px;background:var(--bg);display:flex;flex-direction:column;gap:4px}.row-head[data-v-ca33db20]{display:flex;justify-content:space-between;align-items:center;gap:8px}.row-host[data-v-ca33db20]{font-weight:600;font-family:var(--font-mono);font-size:.85rem}.row-state[data-v-ca33db20]{font-size:.78rem}.row.state-ok .row-state[data-v-ca33db20]{color:var(--good, #3fb950)}.row.state-failed .row-state[data-v-ca33db20],.row.state-error .row-state[data-v-ca33db20]{color:var(--bad)}.row.state-running .row-state[data-v-ca33db20]{color:var(--accent)}.row-exitcode[data-v-ca33db20]{font-size:.74rem;color:var(--fg-dim);font-family:var(--font-mono)}.row-output[data-v-ca33db20]{font-family:var(--font-mono);font-size:.76rem;white-space:pre-wrap;word-break:break-word;background:#ffffff08;border-radius:4px;padding:6px 8px;margin:0;max-height:30vh;overflow-y:auto}.row-truncated[data-v-ca33db20]{font-size:.72rem;color:var(--fg-dim);margin:0;font-style:italic}.error[data-v-ca33db20]{color:var(--bad);font-size:.75rem;margin:0}.footer[data-v-ca33db20]{display:flex;gap:8px;justify-content:flex-end}.footer .primary[data-v-ca33db20]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.tab-pane[data-v-d57ad1d6]{display:flex;flex-direction:column;gap:10px}.hint[data-v-d57ad1d6]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.show-toggle[data-v-d57ad1d6]{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--fg)}.list[data-v-d57ad1d6]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.row[data-v-d57ad1d6]{display:grid;grid-template-columns:7rem 1fr 5rem auto;gap:8px;align-items:center;padding:8px 10px;background:var(--bg);border:1px solid var(--border);border-radius:6px}.label[data-v-d57ad1d6]{font-weight:600;font-family:var(--font-mono);font-size:.85rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text[data-v-d57ad1d6]{font-family:var(--font-mono);font-size:.78rem;color:var(--fg-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hotkey[data-v-d57ad1d6]{font-family:var(--font-mono);font-size:.74rem;color:var(--fg-dim);text-align:center}.actions[data-v-d57ad1d6]{display:flex;gap:4px}.actions button[data-v-d57ad1d6]{height:24px;padding:0 8px;font-size:.74rem}.actions .del[data-v-d57ad1d6]{color:var(--bad);border-color:#f8514966}.edit-row[data-v-d57ad1d6]{display:flex;flex-direction:column;gap:8px;padding:10px;background:var(--panel);border:1px solid var(--accent);border-radius:6px}.edit-top[data-v-d57ad1d6]{display:grid;grid-template-columns:1fr 8rem;gap:8px}.edit-row input[data-v-d57ad1d6],.edit-row textarea[data-v-d57ad1d6]{padding:6px 8px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:4px;font-size:.85rem;font-family:var(--font-mono);width:100%;box-sizing:border-box}.edit-row input[data-v-d57ad1d6]{height:28px}.edit-row textarea[data-v-d57ad1d6]{resize:vertical;min-height:60px;line-height:1.4}.edit-actions[data-v-d57ad1d6]{display:flex;gap:6px;justify-content:flex-end}.edit-actions button[data-v-d57ad1d6]{height:28px;padding:0 14px;font-size:.78rem}.edit-actions .primary[data-v-d57ad1d6]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.footer[data-v-d57ad1d6]{display:flex;gap:8px;align-items:center}.error[data-v-d57ad1d6]{color:var(--bad);font-size:.75rem}.dialog-backdrop[data-v-d57ad1d6]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0000008c;display:flex;align-items:center;justify-content:center;z-index:50}.dialog[data-v-d57ad1d6]{background:#11182b;padding:14px 18px;border:1px solid #1e2638;border-radius:11px;max-width:320px;display:flex;flex-direction:column;gap:10px;color:#e6e7ea}@media (max-width: 640px){.row[data-v-d57ad1d6]{grid-template-columns:minmax(0,1fr) auto}.text[data-v-d57ad1d6]{grid-column:1 / -1;grid-row:2}.hotkey[data-v-d57ad1d6]{grid-column:2;grid-row:1}.actions[data-v-d57ad1d6]{grid-column:1 / -1;flex-wrap:wrap}.edit-top[data-v-d57ad1d6]{grid-template-columns:minmax(0,1fr)}}.tab-pane[data-v-41aa374f]{display:flex;flex-direction:column;gap:10px}.hint[data-v-41aa374f]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.list[data-v-41aa374f]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.row[data-v-41aa374f]{display:grid;grid-template-columns:9rem 1fr 1fr auto;gap:8px;align-items:center;padding:8px 10px;background:var(--bg);border:1px solid var(--border);border-radius:6px}.name[data-v-41aa374f]{font-weight:600;font-size:.85rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:flex;align-items:center;gap:6px}.badge[data-v-41aa374f]{font-size:.65rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--accent);border:1px solid var(--accent);border-radius:3px;padding:1px 4px}.detail[data-v-41aa374f]{font-family:var(--font-mono);font-size:.78rem;color:var(--fg-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.actions[data-v-41aa374f]{display:flex;gap:4px}.actions button[data-v-41aa374f]{height:24px;padding:0 8px;font-size:.74rem}.actions .del[data-v-41aa374f]{color:var(--bad);border-color:#f8514966}.edit-row[data-v-41aa374f]{display:flex;flex-direction:column;gap:8px;padding:10px;background:var(--panel);border:1px solid var(--accent);border-radius:6px}.edit-input[data-v-41aa374f]{padding:6px 8px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:4px;font-size:.85rem;font-family:var(--font-mono);width:100%;box-sizing:border-box;height:28px}.edit-textarea[data-v-41aa374f]{height:auto;resize:vertical;min-height:60px;line-height:1.4}.checkbox[data-v-41aa374f]{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--fg)}.edit-actions[data-v-41aa374f]{display:flex;gap:6px;justify-content:flex-end}.edit-actions button[data-v-41aa374f]{height:28px;padding:0 14px;font-size:.78rem}.edit-actions .primary[data-v-41aa374f]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.footer[data-v-41aa374f]{display:flex;gap:8px;align-items:center}.error[data-v-41aa374f]{color:var(--bad);font-size:.75rem}@media (max-width: 640px){.row[data-v-41aa374f]{grid-template-columns:repeat(2,minmax(0,1fr))}.name[data-v-41aa374f]{grid-column:1 / -1}.actions[data-v-41aa374f]{grid-column:1 / -1;flex-wrap:wrap;justify-content:flex-end}}.section-title[data-v-d7749d1b]{font-size:14px;font-weight:500;margin:0 0 12px}.preset-list[data-v-d7749d1b]{display:flex;flex-direction:column;gap:12px;margin-bottom:16px}.preset-option[data-v-d7749d1b]{display:flex;gap:10px;padding:10px;border:1px solid rgba(255,255,255,.08);border-radius:4px;cursor:pointer}.preset-option[data-v-d7749d1b]:hover{background:#ffffff08}.preset-name[data-v-d7749d1b]{font-weight:500}.preset-desc[data-v-d7749d1b]{font-size:12px;opacity:.7;margin:4px 0}.preset-preview[data-v-d7749d1b]{display:flex;gap:10px;margin-top:6px}.expand-toggle[data-v-d7749d1b]{display:flex;align-items:center;gap:8px;padding:6px 0}.group-by-row[data-v-d7749d1b]{display:flex;align-items:center;gap:14px;margin-bottom:10px;flex-wrap:wrap}.group-by-label[data-v-d7749d1b]{font-size:13px}.group-by-option[data-v-d7749d1b]{display:flex;align-items:center;gap:4px;font-size:13px;cursor:pointer}.feishu-fieldset[data-v-2aad46af]{border:none;padding:0;margin:0}.field-label[data-v-2aad46af]{display:flex;flex-direction:column;gap:.25rem;font-size:13px;color:var(--fg-dim)}.field-input[data-v-2aad46af]{padding:6px 10px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;font-size:13px}.actions[data-v-2aad46af]{display:flex;gap:.5rem;margin-top:.25rem}.feishu-configured[data-v-2aad46af]{display:flex;flex-direction:column;gap:.75rem}.configured-line[data-v-2aad46af]{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin:0;font-size:13px}.configured-badge[data-v-2aad46af]{display:inline-block;padding:2px 8px;border-radius:4px;background:var(--good);color:var(--bg);font-size:12px}.configured-appid[data-v-2aad46af]{color:var(--fg-dim);font-family:var(--mono, monospace)}.callback-row[data-v-2aad46af]{display:flex;gap:.5rem;align-items:center}.callback-row .field-input[data-v-2aad46af]{flex:1;font-family:var(--mono, monospace)}.btn-secondary[data-v-2aad46af]{background:transparent;color:var(--fg-dim);border:1px solid var(--border);border-radius:6px;padding:6px 12px;font-size:13px;cursor:pointer}.error[data-v-2aad46af]{color:#f87171;font-size:13px}.test-send[data-v-2aad46af]{border-top:1px solid var(--border);border-bottom:1px solid var(--border);padding:12px 0;margin:4px 0;display:flex;flex-direction:column;gap:6px}.test-send__title[data-v-2aad46af]{font-size:13px;font-weight:600;color:var(--fg);margin:0}.test-send .hint[data-v-2aad46af]{margin:0}.test-send__buttons[data-v-2aad46af]{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}.test-send__buttons .btn-secondary[data-v-2aad46af]:disabled{opacity:.5;cursor:default}.test-send__ok[data-v-2aad46af]{color:var(--good);font-size:13px;margin:0}.pair-hint[data-v-2aad46af]{font-size:13px;color:var(--fg-dim);margin-top:.5rem}.hint[data-v-2aad46af]{font-size:13px;color:var(--fg-dim);margin:0 0 1rem}.feishu-status-error[data-v-2aad46af]{display:flex;align-items:center;gap:8px;color:var(--warn)}.hook-install[data-v-2aad46af]{padding:8px 0 12px;border-bottom:1px solid var(--border);margin-bottom:12px}.hook-install__row[data-v-2aad46af]{display:flex;align-items:center;gap:8px}.hook-install__dot[data-v-2aad46af]{display:inline-block;width:8px;height:8px;border-radius:50%}.hook-install__dot--green[data-v-2aad46af]{background:var(--good)}.hook-install__dot--amber[data-v-2aad46af]{background:var(--warn)}.hook-install__dot--gray[data-v-2aad46af]{background:var(--neutral)}.hook-install__label[data-v-2aad46af]{flex:1;font-size:13px}.hook-install__toggle[data-v-2aad46af]{display:flex;gap:4px;align-items:center;font-size:12px}.hook-install__retry[data-v-2aad46af]{font-size:12px;padding:2px 8px}.hook-install__error[data-v-2aad46af]{font-size:12px;color:var(--warn);margin:6px 0 0}.ai-only[data-v-2aad46af]{padding:0 0 12px;border-bottom:1px solid var(--border);margin-bottom:12px}.ai-only__toggle[data-v-2aad46af]{display:flex;gap:6px;align-items:center;font-size:13px}.remote-terminal[data-v-2aad46af]{padding:0 0 12px;border-bottom:1px solid var(--border);margin-bottom:12px;display:flex;flex-direction:column;gap:8px}.remote-terminal__toggle[data-v-2aad46af]{display:flex;gap:6px;align-items:center;font-size:13px}.remote-terminal__attach-label[data-v-2aad46af]{display:flex;gap:8px;align-items:center;font-size:13px;color:var(--fg-dim);padding-left:22px}.remote-terminal__attach-select[data-v-2aad46af]{width:220px}.feishu-mode[data-v-2aad46af]{margin:8px 0}.feishu-mode__label[data-v-2aad46af]{display:flex;gap:8px;align-items:center;font-size:13px;color:var(--fg-dim)}.feishu-mode__label-text[data-v-2aad46af]{flex-shrink:0}.feishu-mode__select[data-v-2aad46af]{width:240px}.feishu-mode__effective[data-v-2aad46af]{margin:4px 0 0;font-size:12px;color:var(--fg-dim, #999)}.feishu-mode__warn[data-v-2aad46af]{color:var(--warn, #d89614);margin-left:8px}.tab-pane[data-v-6015f38d]{display:flex;flex-direction:column;gap:12px}.dim[data-v-6015f38d]{color:var(--fg-dim);font-size:13px}.hint[data-v-6015f38d]{margin:0;color:var(--fg-dim);font-size:12px;line-height:1.5}.error[data-v-6015f38d]{color:var(--bad);font-size:12px;margin:0}.header-row[data-v-6015f38d]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.header-actions[data-v-6015f38d]{display:flex;align-items:center;gap:8px;flex-shrink:0}.icon-btn[data-v-6015f38d]{width:28px;height:28px;padding:0;border:1px solid var(--border);border-radius:6px;background:transparent;color:var(--fg-dim);cursor:pointer;font-size:14px}.icon-btn[data-v-6015f38d]:hover:not(:disabled){color:var(--fg);background:#ffffff0a}.icon-btn[data-v-6015f38d]:disabled{opacity:.5;cursor:not-allowed}button.secondary[data-v-6015f38d]{background:transparent;color:var(--fg-dim);border:1px solid var(--border);border-radius:6px;padding:6px 12px;font-size:13px;cursor:pointer}button.secondary[data-v-6015f38d]:hover:not(:disabled){color:var(--fg);background:#ffffff0a}button.secondary[data-v-6015f38d]:disabled{opacity:.5;cursor:not-allowed}.device-list[data-v-6015f38d]{display:flex;flex-direction:column;border-top:1px solid var(--border)}.device-row[data-v-6015f38d]{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--border)}.device-info[data-v-6015f38d]{flex:1;min-width:0}.ua[data-v-6015f38d]{color:var(--fg);font-size:13px;overflow-wrap:anywhere}.meta[data-v-6015f38d]{color:var(--fg-dim);font-size:12px;margin-top:2px}.current-tag[data-v-6015f38d]{color:var(--fg-dim);font-size:12px;padding:2px 8px;border:1px solid var(--border);border-radius:999px;flex-shrink:0}.danger-btn[data-v-6015f38d]{background:transparent;color:var(--bad);border:1px solid var(--bad);border-radius:6px;padding:6px 12px;font-size:13px;cursor:pointer;flex-shrink:0}.danger-btn[data-v-6015f38d]:hover:not(:disabled){background:color-mix(in srgb,var(--bad) 8%,transparent 92%)}.danger-btn[data-v-6015f38d]:disabled{opacity:.5;cursor:not-allowed}.received-files[data-v-4b01c574]{display:flex;flex-direction:column;gap:12px;padding:8px 4px}.header[data-v-4b01c574]{display:flex;justify-content:space-between;align-items:center}.actions[data-v-4b01c574]{display:flex;gap:8px}.actions button[data-v-4b01c574]{padding:4px 10px}.actions button.danger[data-v-4b01c574]{color:#d33}.muted[data-v-4b01c574]{color:var(--fg-dim, #999);font-size:.875rem}.error[data-v-4b01c574]{color:#d33;padding:4px 0;font-size:.875rem}.sessions[data-v-4b01c574]{list-style:none;padding:0;margin:0}.session[data-v-4b01c574]{border-bottom:1px solid var(--border, #333);padding:8px 0}.session-row[data-v-4b01c574]{display:flex;align-items:center;gap:8px;cursor:pointer}.session-name[data-v-4b01c574]{font-weight:500}.session-clear[data-v-4b01c574]{margin-left:auto;padding:2px 8px;font-size:.85rem}.session-clear.danger[data-v-4b01c574]{color:#d33}.files[data-v-4b01c574]{list-style:none;padding-left:16px;margin:4px 0 0}.files li[data-v-4b01c574]{display:flex;align-items:center;gap:8px;padding:2px 0}.file-name[data-v-4b01c574]{font-family:monospace;font-size:.875rem}.file-delete[data-v-4b01c574]{margin-left:auto;font-size:.8rem;padding:1px 6px}.file-delete.danger[data-v-4b01c574]{color:#d33}.empty[data-v-4b01c574]{color:var(--fg-dim, #999);padding:8px 0}@media (max-width: 640px){.header[data-v-4b01c574]{flex-wrap:wrap;align-items:flex-start;gap:8px}.actions[data-v-4b01c574],.session-row[data-v-4b01c574],.files li[data-v-4b01c574]{flex-wrap:wrap}.file-name[data-v-4b01c574]{min-width:0;overflow-wrap:anywhere}}.mobile-profiles[data-v-1c4c4dd0]{display:flex;flex-direction:column;gap:12px}.hint[data-v-1c4c4dd0]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.status[data-v-1c4c4dd0]{font-size:13px;color:var(--fg-dim);margin:0}.status.error[data-v-1c4c4dd0]{color:var(--bad)}.profile-list[data-v-1c4c4dd0]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}.profile-item[data-v-1c4c4dd0]{border:1px solid var(--border);border-radius:8px;padding:10px 12px;background:var(--bg)}.profile-header[data-v-1c4c4dd0]{display:flex;align-items:center;gap:8px;margin-bottom:6px}.profile-name[data-v-1c4c4dd0]{font-weight:600;font-size:13px;color:var(--fg);flex:1}.badge[data-v-1c4c4dd0]{font-size:11px;padding:1px 6px;border-radius:4px;background:#58a6ff29;color:var(--accent)}.host-picker[data-v-1c4c4dd0]{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--fg-dim)}.host-picker select[data-v-1c4c4dd0]{font-size:12px;padding:2px 6px}.open-btn[data-v-1c4c4dd0]{font-size:12px;padding:3px 10px;border-radius:6px;border:1px solid var(--border);background:var(--bg);color:var(--fg);cursor:pointer}.open-btn[data-v-1c4c4dd0]:disabled{opacity:.5;cursor:default}.profile-fields[data-v-1c4c4dd0]{margin:0;display:grid;grid-template-columns:auto 1fr;gap:2px 10px;font-size:12px}.profile-fields dt[data-v-1c4c4dd0]{color:var(--fg-dim)}.profile-fields dd[data-v-1c4c4dd0]{margin:0;color:var(--fg);word-break:break-all}.env-list[data-v-1c4c4dd0]{list-style:none;margin:0;padding:0}.mobile-hosts[data-v-721a37c4]{display:flex;flex-direction:column;gap:12px}.hint[data-v-721a37c4]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.status[data-v-721a37c4]{font-size:13px;color:var(--fg-dim);margin:0}.status.error[data-v-721a37c4]{color:var(--bad)}.host-list[data-v-721a37c4]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}.host-item[data-v-721a37c4]{border:1px solid var(--border);border-radius:8px;padding:10px 12px;background:var(--bg)}.host-header[data-v-721a37c4]{display:flex;align-items:center;gap:8px;margin-bottom:6px;flex-wrap:wrap}.host-alias[data-v-721a37c4]{font-weight:600;font-size:13px;color:var(--fg)}.host-target[data-v-721a37c4]{font-size:12px;color:var(--fg-dim)}.badge[data-v-721a37c4]{font-size:11px;padding:1px 6px;border-radius:4px;background:#58a6ff29;color:var(--accent)}.badge-warn[data-v-721a37c4]{background:#f8514929;color:var(--bad)}.host-fields[data-v-721a37c4]{margin:0;display:grid;grid-template-columns:auto 1fr;gap:2px 10px;font-size:12px}.host-fields dt[data-v-721a37c4]{color:var(--fg-dim)}.host-fields dd[data-v-721a37c4]{margin:0;color:var(--fg);word-break:break-all}.sync-indicator[data-v-3da58fd3]{display:flex;flex-direction:column;gap:4px;font-size:.78rem}.sync-row[data-v-3da58fd3]{display:flex;align-items:center;gap:8px}.sync-dot[data-v-3da58fd3]{width:8px;height:8px;border-radius:50%;flex-shrink:0;background:var(--fg-dim)}.sync-dot.state-idle[data-v-3da58fd3]{background:var(--good, #3fb950)}.sync-dot.state-syncing[data-v-3da58fd3]{background:var(--accent)}.sync-dot.state-offline[data-v-3da58fd3]{background:var(--fg-dim)}.sync-dot.state-error[data-v-3da58fd3]{background:var(--bad)}.sync-state[data-v-3da58fd3]{color:var(--fg)}.sync-state[data-state=error][data-v-3da58fd3]{color:var(--bad)}.sync-state[data-state=offline][data-v-3da58fd3],.sync-last[data-v-3da58fd3],.sync-pending[data-v-3da58fd3]{color:var(--fg-dim)}.sync-pending[data-v-3da58fd3]{font-weight:600}.sync-now-btn[data-v-3da58fd3]{margin-left:auto;font-size:.76rem;padding:2px 8px}.sync-error[data-v-3da58fd3]{color:var(--bad);margin:0}.sync-notice[data-v-3da58fd3]{display:flex;flex-direction:column;gap:4px;border:1px solid var(--border);border-radius:6px;padding:6px 8px;background:var(--bg)}.sync-notice-adopted[data-v-3da58fd3],.sync-notice-conflict[data-v-3da58fd3]{margin:0}.sync-notice-dismiss[data-v-3da58fd3]{align-self:flex-end;font-size:.72rem;padding:2px 8px}.backdrop[data-v-3b3531ba]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:110}.dialog[data-v-3b3531ba]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:460px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:12px}.dialog h2[data-v-3b3531ba]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.dialog p[data-v-3b3531ba]{margin:0;font-size:13px;color:var(--fg);line-height:1.5}.dialog ul[data-v-3b3531ba]{margin:0;padding-left:18px;font-size:13px;color:var(--fg);line-height:1.6}.dialog .dim[data-v-3b3531ba]{color:var(--fg-dim);font-size:12px}.dialog .warn[data-v-3b3531ba]{color:#d29922;font-size:12px}.row[data-v-3b3531ba]{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}.primary[data-v-3b3531ba]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.primary[data-v-3b3531ba]:hover{background:#79b8ff;border-color:#79b8ff;color:#0d1117}.primary.danger[data-v-3b3531ba]{background:var(--bad);color:#0d1117;border-color:var(--bad)}.primary.danger[data-v-3b3531ba]:hover{background:#ff6f6a;border-color:#ff6f6a;color:#0d1117}.backdrop[data-v-b060bffd]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:110}.dialog[data-v-b060bffd]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:min(860px,calc(100vw - 32px));max-height:calc(100vh - 32px);box-sizing:border-box;display:flex;flex-direction:column;gap:12px}.header[data-v-b060bffd]{display:flex;flex-direction:column;gap:4px}.header h2[data-v-b060bffd]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.path[data-v-b060bffd]{color:var(--fg-dim);font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow-wrap:anywhere}.content-wrap[data-v-b060bffd]{min-height:0;display:flex;flex-direction:column;gap:8px}.content[data-v-b060bffd]{margin:0;background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:12px;overflow:auto;min-height:200px;max-height:calc(100vh - 220px);color:var(--fg);font-size:11px;line-height:1.45;white-space:pre-wrap;word-break:break-word;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.row[data-v-b060bffd]{display:flex;justify-content:flex-end;gap:8px}.hint[data-v-b060bffd],.empty[data-v-b060bffd]{color:var(--fg-dim);font-size:12px}.error[data-v-b060bffd]{color:var(--bad);font-size:12px}.primary[data-v-b060bffd]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.lvl-filter[data-v-b060bffd]{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--fg-dim);margin-right:auto}.lvl-filter-select[data-v-b060bffd]{width:104px}.tag-filter-select[data-v-b060bffd]{width:168px}.backdrop[data-v-5e0ae162]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:100}.settings-dialog[data-v-5e0ae162]{background:var(--panel);border:1px solid var(--border);border-radius:8px;width:720px;height:540px;max-width:calc(100vw - 32px);max-height:calc(100vh - 32px);box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden}.settings-header[data-v-5e0ae162]{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--border)}.settings-header h2[data-v-5e0ae162]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.header-sync-indicator[data-v-5e0ae162]{flex:1;min-width:0;margin:0 16px}.close-btn[data-v-5e0ae162]{background:transparent;border:none;color:var(--fg-dim);font-size:18px;line-height:1;cursor:pointer;padding:4px 8px;border-radius:4px}.close-btn[data-v-5e0ae162]:hover:not(:disabled){background:#ffffff0f;color:var(--fg)}.settings-body[data-v-5e0ae162]{flex:1 1 auto;display:flex;min-height:0}.settings-nav[data-v-5e0ae162]{width:160px;flex:0 0 160px;border-right:1px solid var(--border);display:flex;flex-direction:column;padding:8px 6px;gap:2px}.settings-nav-item[data-v-5e0ae162]{display:flex;align-items:center;gap:8px;width:100%;text-align:left;background:transparent;border:none;color:var(--fg-dim);padding:8px 12px;border-radius:6px;cursor:pointer;font-size:13px}.settings-nav-item .nav-icon[data-v-5e0ae162]{display:inline-flex;width:16px;height:16px;flex:0 0 16px;color:var(--fg-dim)}.settings-nav-item .nav-icon[data-v-5e0ae162] svg{width:16px;height:16px}.settings-nav-item.active .nav-icon[data-v-5e0ae162]{color:var(--accent)}.settings-nav-item .nav-label[data-v-5e0ae162]{flex:1 1 auto;min-width:0}.settings-nav-item[data-v-5e0ae162]:hover{background:#ffffff0a;color:var(--fg)}.settings-nav-item.active[data-v-5e0ae162]{background:#58a6ff1f;color:var(--accent);font-weight:600}.settings-pane[data-v-5e0ae162]{flex:1 1 auto;padding:20px 24px;overflow-y:auto}.settings-pane-header[data-v-5e0ae162]{display:flex;align-items:baseline;gap:10px;margin:0 0 16px}.settings-pane-title[data-v-5e0ae162]{margin:0;font-size:20px;font-weight:600;letter-spacing:-.01em;color:var(--fg)}.settings-pane-subtitle[data-v-5e0ae162]{font-size:12px;color:var(--fg-dim)}.settings-footer[data-v-5e0ae162]{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid var(--border)}.settings-footer button[data-v-5e0ae162]{height:32px;padding:6px 14px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;cursor:pointer;font-size:13px}.settings-footer button[data-v-5e0ae162]:hover:not(:disabled){background:#ffffff0a}.settings-footer button[data-v-5e0ae162]:disabled{opacity:.5;cursor:default}.settings-footer .primary[data-v-5e0ae162]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.settings-footer .primary[data-v-5e0ae162]:hover:not(:disabled){background:#79b8ff;border-color:#79b8ff}.settings-footer .danger[data-v-5e0ae162]{border-color:var(--bad);color:var(--bad)}.settings-footer .danger[data-v-5e0ae162]:hover:not(:disabled){background:#f851491a}.version-footer[data-v-5e0ae162]{flex:0 0 auto;padding:4px 16px 8px;font-size:11px;color:var(--fg-dim);text-align:right}.diag-merged[data-v-5e0ae162]{display:flex;flex-direction:column;gap:20px}.merged-section[data-v-5e0ae162]{display:flex;flex-direction:column;gap:10px}.merged-section+.merged-section[data-v-5e0ae162]{border-top:1px solid var(--border);padding-top:18px}.merged-section-title[data-v-5e0ae162]{margin:0;font-size:13px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.discard-backdrop[data-v-5e0ae162]{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:105}.discard-dialog[data-v-5e0ae162]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:380px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:12px}.discard-dialog h3[data-v-5e0ae162]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.discard-dialog p[data-v-5e0ae162]{margin:0;font-size:13px;color:var(--fg);line-height:1.5}.discard-row[data-v-5e0ae162]{display:flex;justify-content:flex-end;gap:8px}.discard-row button[data-v-5e0ae162]{height:32px;padding:6px 14px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;cursor:pointer;font-size:13px}.discard-row button[data-v-5e0ae162]:hover{background:#ffffff0a}.discard-row .danger[data-v-5e0ae162]{border-color:var(--bad);color:var(--bad)}.discard-row .danger[data-v-5e0ae162]:hover{background:#f851491a}@media (max-width: 640px){.backdrop[data-v-5e0ae162]{align-items:stretch;justify-content:stretch;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}.settings-dialog[data-v-5e0ae162]{width:100vw;height:auto;max-width:100vw;max-height:100dvh;border-left:none;border-right:none;border-radius:0}.settings-header[data-v-5e0ae162]{padding:10px 12px}.settings-body[data-v-5e0ae162]{flex-direction:column}.settings-nav[data-v-5e0ae162]{width:100%;flex:0 0 auto;flex-direction:row;overflow-x:auto;overflow-y:hidden;border-right:none;border-bottom:1px solid var(--border);padding:6px 8px;scrollbar-width:none}.settings-nav[data-v-5e0ae162]::-webkit-scrollbar{display:none}.settings-nav-item[data-v-5e0ae162]{flex:0 0 auto;width:auto;min-height:34px;padding:6px 10px;white-space:nowrap}.settings-pane[data-v-5e0ae162]{min-height:0;padding:14px 16px 18px}.settings-pane-header[data-v-5e0ae162]{margin-bottom:12px}.settings-pane-title[data-v-5e0ae162]{font-size:18px}.settings-footer[data-v-5e0ae162]{padding:10px 12px}.version-footer[data-v-5e0ae162]{padding:4px 12px 8px}}.backdrop[data-v-c791c224]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:110}.dialog[data-v-c791c224]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:460px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:10px}.dialog h2[data-v-c791c224]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.dialog label[data-v-c791c224]{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--fg-dim)}.dialog label.inline[data-v-c791c224]{flex-direction:row;align-items:center;gap:6px;color:var(--fg)}.dialog input[data-v-c791c224],.dialog textarea[data-v-c791c224]{background:var(--bg);border:1px solid var(--border);border-radius:4px;padding:6px 8px;color:var(--fg);font-size:13px}.row[data-v-c791c224]{display:flex;gap:12px}.row.end[data-v-c791c224]{justify-content:flex-end;margin-top:4px}.tofu[data-v-c791c224]{display:flex;flex-direction:column;gap:6px;border:1px solid #d29922;border-radius:6px;padding:10px}.tofu code[data-v-c791c224]{font-size:12px;word-break:break-all;color:var(--fg)}.warn[data-v-c791c224]{color:#d29922;font-size:12px;margin:0}.error[data-v-c791c224]{color:var(--bad);font-size:12px;margin:0}.primary[data-v-c791c224]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.ssh-overlay[data-v-d1c3506a]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:120;background:#010409b8;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);display:flex;align-items:center;justify-content:center}.ssh-shell[data-v-d1c3506a]{position:relative;width:min(1040px,calc(100vw - 48px));height:min(720px,calc(100vh - 48px));background:radial-gradient(120% 80% at 100% 0%,rgba(88,166,255,.06),transparent 55%),var(--bg);border:1px solid var(--border);border-radius:12px;box-shadow:0 24px 64px #0000008c;overflow:hidden;display:flex;flex-direction:column}.ssh-header[data-v-d1c3506a]{display:flex;align-items:center;gap:12px;padding:10px 16px;border-bottom:1px solid var(--border);background:var(--panel)}.tabs[data-v-d1c3506a]{display:flex;gap:4px}.tab[data-v-d1c3506a]{display:inline-flex;align-items:center;gap:6px;background:transparent;border:1px solid transparent;color:var(--fg-dim);font-size:12px;font-weight:600;letter-spacing:.04em;padding:6px 12px;border-radius:7px;cursor:pointer;transition:all .12s}.tab[data-v-d1c3506a]:hover{color:var(--fg)}.tab.on[data-v-d1c3506a]{color:var(--fg);background:var(--bg);border-color:var(--border)}.tab-count[data-v-d1c3506a]{font-size:10px;color:var(--fg-dim);background:#8b949e29;padding:1px 6px;border-radius:999px}.search[data-v-d1c3506a]{flex:1;max-width:360px;display:flex;align-items:center;gap:7px;background:var(--bg);border:1px solid var(--border);border-radius:7px;padding:0 10px}.search-spacer[data-v-d1c3506a]{flex:1}.search-icon[data-v-d1c3506a]{color:var(--fg-dim);flex:none}.search input[data-v-d1c3506a]{flex:1;background:transparent;border:none;outline:none;color:var(--fg);font-size:13px;padding:7px 0}.new-btn[data-v-d1c3506a]{display:inline-flex;align-items:center;gap:5px;background:var(--accent);color:#04101f;border:none;font-size:12px;font-weight:600;padding:7px 12px;border-radius:7px;cursor:pointer;transition:filter .12s}.new-btn[data-v-d1c3506a]:hover{filter:brightness(1.1)}.new-btn.ghost[data-v-d1c3506a]{background:transparent;color:var(--accent);border:1px solid var(--accent)}.close-x[data-v-d1c3506a]{display:inline-flex;align-items:center;justify-content:center;background:transparent;border:none;color:var(--fg-dim);cursor:pointer;padding:4px;border-radius:6px;transition:color .12s,background .12s}.close-x[data-v-d1c3506a]:hover{color:var(--fg);background:#8b949e1f}.ssh-error[data-v-d1c3506a]{margin:0;padding:8px 16px;font-size:12px;color:var(--bad);background:#f8514914;border-bottom:1px solid rgba(248,81,73,.2)}.ssh-error.inline[data-v-d1c3506a]{border-bottom:none;border-radius:6px}.ssh-tofu[data-v-d1c3506a]{margin:0;padding:10px 16px;display:flex;flex-direction:column;gap:6px;background:#d2992214;border-bottom:1px solid rgba(210,153,34,.3)}.ssh-tofu p[data-v-d1c3506a]{margin:0;font-size:12px;line-height:1.5}.ssh-tofu .tofu-title[data-v-d1c3506a]{font-weight:600;color:var(--warn, #d29922)}.ssh-tofu .tofu-msg[data-v-d1c3506a]{color:var(--fg)}.ssh-tofu .tofu-note[data-v-d1c3506a]{color:var(--fg-dim);font-size:11px}.ssh-tofu .tofu-fp[data-v-d1c3506a]{font-size:12px;word-break:break-all;color:var(--fg)}.ssh-tofu .tofu-actions[data-v-d1c3506a]{display:flex;gap:8px;justify-content:flex-end}.ssh-success[data-v-d1c3506a]{margin:0;padding:8px 16px;font-size:12px;color:var(--good, #3fb950);background:#3fb95014;border-bottom:1px solid rgba(63,185,80,.2)}.ssh-body[data-v-d1c3506a]{flex:1;overflow-y:auto;padding:18px 16px 24px}.tag-bar[data-v-d1c3506a]{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 2px 14px}.tag-pill[data-v-d1c3506a]{background:var(--panel);border:1px solid var(--border);color:var(--fg-dim);font-size:11px;padding:4px 10px;border-radius:999px;cursor:pointer;transition:color .12s,border-color .12s,background .12s}.tag-pill[data-v-d1c3506a]:hover{color:var(--fg);border-color:var(--neutral)}.tag-pill.on[data-v-d1c3506a]{color:#04101f;background:var(--accent);border-color:var(--accent);font-weight:600}.tag-clear[data-v-d1c3506a]{display:inline-flex;align-items:center;gap:3px;background:transparent;border:none;color:var(--fg-dim);font-size:11px;padding:4px 6px;cursor:pointer}.tag-clear[data-v-d1c3506a]:hover{color:var(--fg)}.card-proxy[data-v-d1c3506a]{display:flex;margin-top:5px}.card-proxy .proxy-badge[data-v-d1c3506a]{max-width:100%;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.card-tags[data-v-d1c3506a]{display:flex;flex-wrap:wrap;gap:4px;margin-top:5px}.card-tag[data-v-d1c3506a]{font-size:10px;color:var(--fg-dim);background:#8b949e29;padding:1px 7px;border-radius:999px;white-space:nowrap}.card-grid[data-v-d1c3506a]{display:grid;gap:10px;grid-template-columns:repeat(auto-fill,minmax(288px,1fr))}.card[data-v-d1c3506a]{position:relative;display:flex;align-items:center;gap:11px;padding:12px;background:var(--panel);border:1px solid var(--border);border-radius:10px;transition:border-color .14s,transform .14s,box-shadow .14s}.card[data-v-d1c3506a]:hover{border-color:var(--accent);transform:translateY(-1px);box-shadow:0 6px 18px #00000059}.card.busy[data-v-d1c3506a]{opacity:.6}.card-glyph[data-v-d1c3506a]{flex:none;width:34px;height:34px;border-radius:8px;display:flex;align-items:center;justify-content:center;color:var(--accent);background:#58a6ff1a;border:1px solid rgba(88,166,255,.18)}.card-main[data-v-d1c3506a]{flex:1;min-width:0}.card-label[data-v-d1c3506a]{font-size:13px;font-weight:600;color:var(--fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.card-sub[data-v-d1c3506a]{font-size:11px;color:var(--fg-dim);font-family:var(--font-mono-strict);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}.card-actions[data-v-d1c3506a]{flex:none;display:flex;gap:4px;align-items:center}.act[data-v-d1c3506a]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;background:var(--bg);border:1px solid var(--border);color:var(--fg);cursor:pointer;transition:color .12s,background .12s,border-color .12s}.act svg[data-v-d1c3506a]{display:block;flex:none;width:15px;height:15px}.act[data-v-d1c3506a]:hover{color:#fff;border-color:var(--neutral);background:#8b949e2e}.act.connect[data-v-d1c3506a]{background:var(--accent);border-color:var(--accent);color:#04101f}.act.connect[data-v-d1c3506a]:hover:not(:disabled){filter:brightness(1.12)}.act.danger[data-v-d1c3506a]{color:var(--fg-dim)}.act.danger[data-v-d1c3506a]:hover{color:#fff;border-color:var(--bad);background:#f8514933}.act[data-v-d1c3506a]:disabled{opacity:.5;cursor:default}.empty[data-v-d1c3506a]{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:var(--fg-dim)}.empty-icon[data-v-d1c3506a]{color:var(--neutral);opacity:.5;margin-bottom:6px}.empty-title[data-v-d1c3506a]{margin:0;font-size:14px;color:var(--fg);font-weight:600}.empty-sub[data-v-d1c3506a]{margin:0 0 12px;font-size:12px}.drawer[data-v-d1c3506a]{position:absolute;top:0;right:0;bottom:0;width:360px;max-width:84%;background:var(--panel);border-left:1px solid var(--border);box-shadow:-20px 0 48px #00000073;display:flex;flex-direction:column}.drawer.wide[data-v-d1c3506a]{width:480px}.drawer-head[data-v-d1c3506a]{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--border);font-size:12px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--fg-dim)}.drawer-body[data-v-d1c3506a]{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px}.field[data-v-d1c3506a]{display:flex;flex-direction:column;gap:5px}.field-row[data-v-d1c3506a]{display:flex;gap:10px}.field.grow[data-v-d1c3506a]{flex:1}.field.port[data-v-d1c3506a]{width:78px;flex:none}.fl[data-v-d1c3506a]{font-size:11px;color:var(--fg-dim)}.fl em[data-v-d1c3506a]{color:var(--neutral);font-style:normal}.field input[data-v-d1c3506a],.field textarea[data-v-d1c3506a]{background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:7px 9px;color:var(--fg);font-size:13px;outline:none;transition:border-color .12s}.field input[data-v-d1c3506a]:focus,.field textarea[data-v-d1c3506a]:focus{border-color:var(--accent)}.field textarea[data-v-d1c3506a]{resize:vertical;font-family:var(--font-mono-strict);font-size:12px}.hint[data-v-d1c3506a]{font-size:12px;color:var(--fg-dim);margin:0}.tag-editor[data-v-d1c3506a]{position:relative;display:flex;flex-wrap:wrap;align-items:center;gap:4px;background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:5px 6px;transition:border-color .12s}.tag-editor[data-v-d1c3506a]:focus-within{border-color:var(--accent)}.tag-editor .chip[data-v-d1c3506a]{display:inline-flex;align-items:center;gap:3px;font-size:11px;color:var(--fg);background:#58a6ff24;border:1px solid rgba(88,166,255,.28);padding:1px 4px 1px 8px;border-radius:999px}.chip-x[data-v-d1c3506a]{display:inline-flex;align-items:center;justify-content:center;background:transparent;border:none;color:var(--fg-dim);cursor:pointer;padding:1px;border-radius:999px;line-height:1}.chip-x[data-v-d1c3506a]:hover{color:#fff;background:#f8514959}.tag-input[data-v-d1c3506a]{flex:1;min-width:90px;background:transparent;border:none;outline:none;color:var(--fg);font-size:13px;padding:2px 3px}.combo[data-v-d1c3506a]{position:relative;display:flex}.combo input[data-v-d1c3506a]{flex:1;padding-right:26px;width:100%}.combo-caret[data-v-d1c3506a]{position:absolute;right:6px;top:50%;transform:translateY(-50%);background:transparent;border:none;color:var(--fg-dim);cursor:pointer;font-size:11px;padding:2px 4px;line-height:1}.combo-caret[data-v-d1c3506a]:hover{color:var(--fg)}.combo-menu[data-v-d1c3506a]{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:10;margin:0;padding:4px 0;list-style:none;max-height:180px;overflow-y:auto;background:var(--bg);border:1px solid var(--border);border-radius:6px;box-shadow:0 6px 16px #00000059}.combo-opt[data-v-d1c3506a]{padding:7px 10px;font-size:13px;color:var(--fg);cursor:pointer}.combo-opt[data-v-d1c3506a]:hover{background:#ffffff0f}.identity-hint[data-v-d1c3506a]{margin:-4px 0 0;display:flex;flex-direction:column;gap:3px;font-size:11px;color:var(--fg-dim);line-height:1.4}.identity-hint code[data-v-d1c3506a]{font-family:var(--font-mono-strict);font-size:11px;color:var(--fg);background:var(--bg);border:1px solid var(--border);border-radius:5px;padding:4px 7px;word-break:break-all}.identity-hint.proxy[data-v-d1c3506a]{color:var(--warn, #d29922)}.empty-keys-hint[data-v-d1c3506a]{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.enc-hint[data-v-d1c3506a]{margin:-4px 0 0;font-size:11px;color:var(--warn, #d29922)}.import-block[data-v-d1c3506a]{margin-top:4px;display:flex;flex-direction:column;gap:8px}.file-input[data-v-d1c3506a]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.dropzone[data-v-d1c3506a]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:18px 12px;text-align:center;border:1px dashed var(--border);border-radius:8px;color:var(--fg-dim);font-size:11px;line-height:1.4;transition:border-color .12s,background .12s,color .12s}.dropzone-icon[data-v-d1c3506a]{color:var(--neutral)}.dropzone.over[data-v-d1c3506a]{border-color:var(--accent);color:var(--fg);background:#58a6ff14}.dropzone.over .dropzone-icon[data-v-d1c3506a]{color:var(--accent)}.btn.import[data-v-d1c3506a]{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%}.btn.import svg[data-v-d1c3506a]{display:block}.btn.import[data-v-d1c3506a]:hover{background:#8b949e1a}.btn.sm[data-v-d1c3506a]{display:inline-flex;align-items:center;gap:5px;padding:6px 11px;font-size:12px}.btn.sm svg[data-v-d1c3506a]{display:block}.seg[data-v-d1c3506a]{display:flex;background:var(--bg);border:1px solid var(--border);border-radius:7px;padding:3px;gap:3px}.seg button[data-v-d1c3506a]{flex:1;background:transparent;border:none;color:var(--fg-dim);font-size:12px;padding:6px 0;border-radius:5px;cursor:pointer;transition:all .12s}.seg button.on[data-v-d1c3506a]{background:var(--accent);color:#04101f;font-weight:600}.drawer-foot[data-v-d1c3506a]{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid var(--border)}.btn[data-v-d1c3506a]{font-size:12px;padding:8px 14px;border-radius:7px;cursor:pointer;border:1px solid var(--border);background:transparent;color:var(--fg);transition:all .12s}.btn.ghost[data-v-d1c3506a]:hover{background:#8b949e1a}.btn.primary[data-v-d1c3506a]{background:var(--accent);color:#04101f;border-color:var(--accent);font-weight:600}.btn.primary[data-v-d1c3506a]:hover:not(:disabled){filter:brightness(1.1)}.btn.primary[data-v-d1c3506a]:disabled{opacity:.4;cursor:default}.drawer-enter-active[data-v-d1c3506a],.drawer-leave-active[data-v-d1c3506a]{transition:transform .18s ease,opacity .18s ease}.drawer-enter-from[data-v-d1c3506a],.drawer-leave-to[data-v-d1c3506a]{transform:translate(24px);opacity:0}.config-section-title[data-v-d1c3506a]{margin:4px 0 2px;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--fg-dim)}.config-entry-list[data-v-d1c3506a]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.config-entry[data-v-d1c3506a]{background:var(--bg);border:1px solid var(--border);border-radius:8px}.config-entry-label[data-v-d1c3506a]{display:flex;align-items:center;gap:10px;padding:9px 10px;cursor:pointer}.config-entry-main[data-v-d1c3506a]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.config-entry-alias[data-v-d1c3506a]{font-size:13px;font-weight:600;color:var(--fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.config-entry-sub[data-v-d1c3506a]{font-size:11px;color:var(--fg-dim);font-family:var(--font-mono-strict);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.config-entry-badges[data-v-d1c3506a]{flex:none;display:flex;flex-direction:column;align-items:flex-end;gap:4px}.proxy-badge[data-v-d1c3506a]{flex:none;font-size:10px;color:var(--fg-dim);background:#8b949e1f;border:1px solid rgba(139,148,158,.3);padding:3px 8px;border-radius:999px;max-width:150px;line-height:1.3;text-align:right}.proxy-badge.blocked[data-v-d1c3506a]{color:var(--warn, #d29922);background:#d299221f;border-color:#d299224d}.overwrite-badge[data-v-d1c3506a]{flex:none;font-size:10px;color:var(--fg-dim);background:#8b949e29;border:1px solid var(--border);padding:3px 8px;border-radius:999px;line-height:1.3;white-space:nowrap}.config-skipped[data-v-d1c3506a]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}.skip-row[data-v-d1c3506a]{display:flex;align-items:baseline;gap:8px;padding:6px 10px;background:#8b949e14;border-radius:6px}.skip-alias[data-v-d1c3506a]{font-size:12px;font-weight:600;color:var(--fg);flex:none}.skip-reason[data-v-d1c3506a]{font-size:11px;color:var(--fg-dim)}.config-note[data-v-d1c3506a]{margin:6px 0 0;font-size:11px;color:var(--fg-dim);line-height:1.5}.config-foot[data-v-d1c3506a]{flex-direction:column;align-items:stretch;gap:8px}.foot-actions[data-v-d1c3506a]{display:flex;justify-content:flex-end;gap:8px}.fwd-section[data-v-d1c3506a]{display:flex;flex-direction:column;gap:8px;padding-top:12px;border-top:1px solid var(--border)}.fwd-section-head[data-v-d1c3506a]{display:flex;align-items:center;justify-content:space-between;gap:8px}.fwd-section-head .fl[data-v-d1c3506a]{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}.fwd-rule[data-v-d1c3506a]{display:flex;flex-direction:column;gap:8px;padding:10px;background:var(--bg);border:1px solid var(--border);border-radius:8px}.fwd-rule-head[data-v-d1c3506a]{display:flex;align-items:center;gap:8px}.fwd-rule-head .seg[data-v-d1c3506a]{flex:1}.seg.sm button[data-v-d1c3506a]{font-size:11px;padding:4px 0}.fwd-warn[data-v-d1c3506a]{margin:0;padding:8px 9px;font-size:11px;line-height:1.5;color:var(--warn, #d29922);background:#d299221a;border:1px solid rgba(210,153,34,.32);border-radius:6px}.fwd-host[data-v-d1c3506a]{margin-bottom:16px}.fwd-host-head[data-v-d1c3506a]{display:flex;align-items:baseline;gap:8px;margin-bottom:6px}.fwd-host-name[data-v-d1c3506a]{font-size:13px;font-weight:600;color:var(--fg)}.fwd-host-sub[data-v-d1c3506a]{font-size:11px;color:var(--fg-dim);font-family:var(--font-mono-strict)}.fwd-proxy-reason[data-v-d1c3506a]{margin:0 0 8px;font-size:11px;line-height:1.5;color:var(--warn, #d29922)}.fwd-card[data-v-d1c3506a]{align-items:flex-start}.fwd-card-side[data-v-d1c3506a]{flex:none;display:flex;flex-direction:column;align-items:flex-end;gap:6px}.fwd-card .card-label[data-v-d1c3506a]{display:flex;align-items:baseline;gap:6px}.fwd-route[data-v-d1c3506a]{white-space:normal;overflow:visible;word-break:break-all}.fwd-kind[data-v-d1c3506a]{font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--accent)}.fwd-note[data-v-d1c3506a]{font-size:12px;color:var(--fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.fwd-row-conns[data-v-d1c3506a]{margin-top:2px;font-size:10px;color:var(--fg-dim)}.fwd-row-error[data-v-d1c3506a]{margin:5px 0 0;font-size:11px;line-height:1.5;color:var(--bad)}.fwd-state[data-v-d1c3506a]{flex:none;font-size:10px;padding:3px 9px;border-radius:999px;border:1px solid var(--border);color:var(--fg-dim);background:#8b949e24}.fwd-state.running[data-v-d1c3506a]{color:var(--good, #3fb950);border-color:#3fb95059;background:#3fb9501f}.fwd-state.stopped[data-v-d1c3506a]{color:var(--bad);border-color:#f8514959;background:#f851491f}.pem-label[data-v-d1c3506a]{display:flex;align-items:center;justify-content:space-between;gap:8px}.pem-tools[data-v-d1c3506a]{display:flex;gap:4px}.backdrop[data-v-380786e4]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:110}.dialog[data-v-380786e4]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:460px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:12px}.dialog h2[data-v-380786e4]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.dialog p[data-v-380786e4]{margin:0;font-size:13px;color:var(--fg);line-height:1.5}.dialog ul[data-v-380786e4]{margin:0;padding-left:18px;font-size:13px;color:var(--fg);line-height:1.6}.dialog .dim[data-v-380786e4]{color:var(--fg-dim);font-size:12px}.dialog .warn[data-v-380786e4]{color:#d29922;font-size:12px}.row[data-v-380786e4]{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}.primary[data-v-380786e4]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.primary[data-v-380786e4]:hover{background:#79b8ff;border-color:#79b8ff;color:#0d1117}.primary.danger[data-v-380786e4]{background:var(--bad);color:#0d1117;border-color:var(--bad)}.primary.danger[data-v-380786e4]:hover{background:#ff6f6a;border-color:#ff6f6a;color:#0d1117}.startup-fatal[data-v-ad8304f2]{flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;padding:24px;background:#0d1117}.startup-fatal-panel[data-v-ad8304f2]{width:min(680px,100%);display:flex;flex-direction:column;gap:14px;color:var(--fg)}.startup-fatal-panel h1[data-v-ad8304f2]{margin:0;font-size:20px;font-weight:650}.startup-fatal-panel p[data-v-ad8304f2]{margin:0;color:var(--fg-dim);line-height:1.5}.startup-fatal-panel pre[data-v-ad8304f2]{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;padding:12px;border:1px solid #30363d;border-radius:6px;background:#161b22;color:#ffb3b3;font-size:12px;line-height:1.45}.startup-fatal-log[data-v-ad8304f2]{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:8px;align-items:baseline;color:var(--fg-dim);font-size:12px}.startup-fatal-log code[data-v-ad8304f2]{min-width:0;overflow-wrap:anywhere;color:var(--fg)}.startup-fatal-actions[data-v-ad8304f2]{display:flex;gap:8px;flex-wrap:wrap}.startup-fatal-actions button[data-v-ad8304f2]{height:30px;padding:0 12px;border:1px solid #30363d;border-radius:6px;background:#21262d;color:var(--fg);cursor:pointer}.startup-fatal-actions button[data-v-ad8304f2]:hover{background:#30363d}.startup-fatal-actions button.danger[data-v-ad8304f2]{border-color:#8b2e2e;color:#ffb3b3}.startup-fatal-copy-status[data-v-ad8304f2]{margin:0;color:var(--fg-dim);font-size:12px}.backdrop[data-v-e95fa892]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:111}.dialog[data-v-e95fa892]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:430px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:12px}.dialog h2[data-v-e95fa892]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.dialog p[data-v-e95fa892]{margin:0;font-size:13px;color:var(--fg);line-height:1.5}.dialog ul[data-v-e95fa892]{margin:0;padding-left:18px;font-size:13px;color:var(--fg);line-height:1.6}.row[data-v-e95fa892]{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}.primary[data-v-e95fa892]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.primary.danger[data-v-e95fa892]{background:var(--bad);color:#0d1117;border-color:var(--bad)}.primary.danger[data-v-e95fa892]:hover{background:#ff6f6a;border-color:#ff6f6a;color:#0d1117}.recovery-dialog-backdrop[data-v-4735cb7a]{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000073;display:flex;align-items:center;justify-content:center;z-index:200}.recovery-dialog[data-v-4735cb7a]{background:var(--bg, #0d1117);color:var(--fg, #d1d5db);border-radius:8px;min-width:480px;max-width:720px;max-height:80vh;overflow:hidden;display:flex;flex-direction:column}.recovery-dialog header[data-v-4735cb7a]{padding:16px 20px 0}.recovery-dialog h2[data-v-4735cb7a]{font-size:1.1rem;margin:0}.subtitle[data-v-4735cb7a]{font-size:.85rem;opacity:.7;margin:4px 0 12px}.tab-list[data-v-4735cb7a]{list-style:none;padding:0 20px;margin:0;overflow:auto}.tab-row[data-v-4735cb7a]{display:flex;align-items:center;gap:8px;padding:6px 0;cursor:default}.caret[data-v-4735cb7a]{background:transparent;border:0;color:inherit;cursor:pointer;padding:0 4px}.tab-title[data-v-4735cb7a]{flex:1}.tab-meta[data-v-4735cb7a]{opacity:.6;font-size:.8rem}.pane-list[data-v-4735cb7a]{list-style:none;padding-left:36px;margin:4px 0 8px;font-size:.85rem}.pane-list li[data-v-4735cb7a]{display:flex;gap:8px;padding:2px 0}.pane-shell[data-v-4735cb7a]{font-family:monospace}.pane-cwd[data-v-4735cb7a]{opacity:.7;flex:1}.pane-badge[data-v-4735cb7a]{opacity:.85;font-size:.75rem}footer[data-v-4735cb7a]{display:flex;justify-content:flex-end;gap:8px;padding:12px 20px 16px}.btn-primary[data-v-4735cb7a]{background:#2563eb;color:#fff;border:0;padding:6px 12px;border-radius:4px;cursor:pointer}.btn-primary[data-v-4735cb7a]:disabled{opacity:.4;cursor:not-allowed}.btn-secondary[data-v-4735cb7a]{background:transparent;color:inherit;border:1px solid #444;padding:6px 12px;border-radius:4px;cursor:pointer}.startup-update-backdrop[data-v-cb1e98fb]{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000073;display:flex;align-items:center;justify-content:center;z-index:210}.startup-update-dialog[data-v-cb1e98fb]{background:var(--bg, #0d1117);color:var(--fg, #d1d5db);border-radius:8px;min-width:420px;max-width:640px;max-height:80vh;overflow:hidden;display:flex;flex-direction:column;padding:16px 20px;gap:12px}.startup-update-dialog header[data-v-cb1e98fb]{display:flex;flex-direction:column;gap:4px}.startup-update-dialog h2[data-v-cb1e98fb]{font-size:1.1rem;margin:0}.subtitle[data-v-cb1e98fb]{font-size:.85rem;opacity:.7;margin:0;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.status[data-v-cb1e98fb]{font-size:.85rem;margin:0}.notes[data-v-cb1e98fb]{font-size:12px}.notes summary[data-v-cb1e98fb]{opacity:.7;cursor:pointer}.notes pre[data-v-cb1e98fb]{background:var(--bg);border:1px solid var(--border, #444);padding:8px;border-radius:6px;white-space:pre-wrap;word-break:break-word;max-height:160px;overflow-y:auto;font-size:11px;margin:6px 0 0}footer[data-v-cb1e98fb]{display:flex;justify-content:flex-end;gap:8px}.btn-primary[data-v-cb1e98fb]{background:var(--accent, #2563eb);color:#0d1117;border:0;padding:6px 12px;border-radius:4px;cursor:pointer;font-weight:600}.btn-primary.danger[data-v-cb1e98fb]{background:var(--bad, #ef4444)}.btn-primary[data-v-cb1e98fb]:disabled{opacity:.5;cursor:default}.btn-secondary[data-v-cb1e98fb]{background:transparent;color:inherit;border:1px solid var(--border, #444);padding:6px 12px;border-radius:4px;cursor:pointer}.hints-backdrop[data-v-f52d16ed]{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:200;pointer-events:none}.hints-panel[data-v-f52d16ed]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:480px;max-width:calc(100vw - 32px);max-height:calc(100vh - 32px);overflow-y:auto;color:var(--fg);pointer-events:auto}.hints-header[data-v-f52d16ed]{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--fg-dim);margin-bottom:12px}.hints-group[data-v-f52d16ed]{margin-bottom:14px}.hints-group[data-v-f52d16ed]:last-child{margin-bottom:0}.hints-group h3[data-v-f52d16ed]{margin:0 0 6px;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--fg-dim)}.hint-row[data-v-f52d16ed]{display:grid;grid-template-columns:120px 1fr;gap:12px;padding:3px 0;font-size:12px}.hint-row.disabled[data-v-f52d16ed]{color:var(--fg-dim)}.chord[data-v-f52d16ed]{font-family:SF Mono,Menlo,monospace;text-align:right}.label[data-v-f52d16ed]{color:inherit}.fade-enter-active[data-v-f52d16ed],.fade-leave-active[data-v-f52d16ed]{transition:opacity .1s ease}.fade-enter-from[data-v-f52d16ed],.fade-leave-to[data-v-f52d16ed]{opacity:0}.paste-preview-host[data-v-6eda1305]{position:fixed;top:88px;right:.75rem;z-index:50;display:flex;flex-direction:column;gap:8px;pointer-events:none}.paste-toast[data-v-6eda1305]{pointer-events:auto;width:200px;padding:8px;background:var(--bg, #1f2024);color:var(--fg, #e6e6e6);border:1px solid var(--border, #3a3b40);border-radius:6px;box-shadow:0 4px 14px #00000059;display:flex;flex-direction:column;gap:4px;position:relative}.paste-toast-thumb[data-v-6eda1305]{width:100%;max-height:120px;object-fit:contain;cursor:zoom-in;border-radius:4px;background:#000}.paste-toast-name[data-v-6eda1305]{font-size:12px;opacity:.8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.paste-toast-close[data-v-6eda1305]{position:absolute;top:4px;right:6px;background:transparent;border:none;color:inherit;font-size:16px;line-height:1;cursor:pointer;opacity:.7}.paste-toast-close[data-v-6eda1305]:hover{opacity:1}.paste-lightbox[data-v-6eda1305]{position:fixed;top:0;right:0;bottom:0;left:0;background:#000000d9;z-index:100;display:flex;align-items:center;justify-content:center;cursor:zoom-out;pointer-events:auto}.paste-lightbox img[data-v-6eda1305]{max-width:90vw;max-height:90vh;cursor:default}.paste-file-host[data-v-436c1298]{position:fixed;top:88px;right:.75rem;z-index:50;display:flex;flex-direction:column;gap:8px;pointer-events:none}.paste-file-toast[data-v-436c1298]{pointer-events:auto;padding:8px 12px;background:var(--bg, #1f2024);color:var(--fg, #e6e6e6);border:1px solid var(--border, #3a3b40);border-radius:6px;box-shadow:0 4px 14px #00000059;display:flex;align-items:center;gap:6px;font-size:12px;max-width:260px}.paste-file-icon[data-v-436c1298]{opacity:.7}.paste-file-name[data-v-436c1298]{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.paste-file-size[data-v-436c1298]{opacity:.7}.paste-file-close[data-v-436c1298]{margin-left:auto;background:transparent;border:none;color:inherit;font-size:16px;line-height:1;cursor:pointer;opacity:.7}.paste-file-close[data-v-436c1298]:hover{opacity:1}.plugin-host[data-v-db2df210]{display:contents}.plugin-host.slot-right-panel[data-v-db2df210]{display:flex;flex-direction:column;height:100%}.plugin-host.slot-bottom-toolbar[data-v-db2df210]{display:flex;flex-direction:row;align-items:center;min-height:0}.translate-panel[data-v-be75a3d1]{position:fixed;width:480px;max-height:70vh;overflow:auto;background:var(--ed-tab-bg, #21262d);border:1px solid var(--ed-border, #2d333b);border-radius:6px;box-shadow:0 8px 24px #00000080;color:var(--ed-row-fg, #c9d1d9);z-index:9999;display:flex;flex-direction:column}.translate-panel__handle[data-v-be75a3d1]{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;cursor:grab;background:var(--ed-row-hover, #30363d);border-bottom:1px solid var(--ed-border, #2d333b);-webkit-user-select:none;user-select:none}.translate-panel__title[data-v-be75a3d1]{font-weight:600;font-size:13px}.translate-panel__close[data-v-be75a3d1]{background:transparent;border:none;color:inherit;font-size:18px;cursor:pointer;padding:0 4px}.translate-panel__label[data-v-be75a3d1]{font-size:11px;opacity:.7;text-transform:uppercase;letter-spacing:.04em;padding:6px 12px 0}.translate-panel__detected[data-v-be75a3d1]{text-transform:none;opacity:.6}.translate-panel__pre[data-v-be75a3d1]{margin:4px 12px 8px;padding:6px;background:#00000040;border-radius:4px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;max-height:200px;overflow:auto;white-space:pre-wrap}.translate-panel__target-row[data-v-be75a3d1]{display:flex;align-items:center;gap:8px;padding:8px 12px;border-top:1px solid var(--ed-border, #2d333b)}.translate-panel__target-select[data-v-be75a3d1]{flex:1}.translate-panel__result[data-v-be75a3d1]{padding:12px;border-top:1px solid var(--ed-border, #2d333b);min-height:60px}.translate-panel__loading[data-v-be75a3d1]{opacity:.7}.translate-panel__error[data-v-be75a3d1]{color:#f87171;font-size:12px;display:flex;flex-direction:column;gap:6px}.translate-panel__text[data-v-be75a3d1]{font-size:13px;max-height:240px;overflow:auto;white-space:pre-wrap}.translate-panel__placeholder[data-v-be75a3d1]{opacity:.5;font-size:12px}.translate-panel__history[data-v-be75a3d1]{padding:8px 12px;border-top:1px solid var(--ed-border, #2d333b);font-size:12px}.translate-panel__history summary[data-v-be75a3d1]{cursor:pointer;opacity:.8}.translate-panel__history ul[data-v-be75a3d1]{list-style:none;margin:6px 0 0;padding:0}.translate-panel__history-row[data-v-be75a3d1]{display:block;width:100%;text-align:left;background:transparent;border:none;color:inherit;cursor:pointer;padding:4px 0;font-size:11px}.translate-panel__history-row[data-v-be75a3d1]:hover{opacity:.85}.translate-panel__history-source[data-v-be75a3d1]{opacity:.7}.translate-panel__history-arrow[data-v-be75a3d1]{margin:0 6px;opacity:.5}.fe-theme-dimmed{--ed-shell-bg: #22272e;--ed-tree-bg: #2d333b;--ed-tree-header-bg: #22272e;--ed-tree-header-fg: rgba(173, 186, 199, .7);--ed-row-fg: #adbac7;--ed-row-hover: #373e47;--ed-row-selected: #444c56;--ed-folder: #d4a14a;--ed-chevron: rgba(173, 186, 199, .7);--ed-indent-guide: rgba(173, 186, 199, .1);--ed-tab-bg: #2d333b;--ed-tab-fg: #768390;--ed-tab-hover-fg: #adbac7;--ed-tab-active-bg: #22272e;--ed-tab-active-fg: #cdd9e5;--ed-tab-active-bar: #539bf5;--ed-border: #444c56;--ed-editor-bg: #22272e;--ed-editor-fg: #adbac7;--ed-gutter-bg: #22272e;--ed-gutter-fg: #545d68;--ed-muted: rgba(173, 186, 199, .6);--ed-error: #f47067}.fe-theme-light{--ed-shell-bg: #ffffff;--ed-tree-bg: #f6f8fa;--ed-tree-header-bg: #eef0f4;--ed-tree-header-fg: rgba(36, 41, 47, .7);--ed-row-fg: #24292f;--ed-row-hover: rgba(36, 41, 47, .06);--ed-row-selected: rgba(0, 92, 197, .13);--ed-folder: #54aeff;--ed-chevron: rgba(36, 41, 47, .55);--ed-indent-guide: rgba(36, 41, 47, .08);--ed-tab-bg: #eef0f4;--ed-tab-fg: #57606a;--ed-tab-hover-fg: #24292f;--ed-tab-active-bg: #ffffff;--ed-tab-active-fg: #24292f;--ed-tab-active-bar: #fd8c73;--ed-border: #d0d7de;--ed-editor-bg: #ffffff;--ed-editor-fg: #24292f;--ed-gutter-bg: #f6f8fa;--ed-gutter-fg: #6e7781;--ed-muted: rgba(36, 41, 47, .6);--ed-error: #cf222e}.app[data-v-0b5f6b42]{display:flex;flex-direction:column;height:100vh}.app.is-maximized[data-v-0b5f6b42]{padding:8px}.auth-error-banner[data-v-0b5f6b42]{display:flex;align-items:center;gap:8px;padding:7px 16px;background:#5a1e1e;border-bottom:1px solid #8b2e2e;color:#ffb3b3;font-size:12px;flex:0 0 auto}.auth-error-msg[data-v-0b5f6b42]{flex:1 1 auto}.auth-error-action[data-v-0b5f6b42]{flex:0 0 auto;border:1px solid #8b2e2e;background:transparent;color:#ffb3b3;border-radius:4px;padding:2px 8px;font-size:12px;cursor:pointer}.auth-error-action[data-v-0b5f6b42]:hover{background:#ffb3b31a}.auth-error-dismiss[data-v-0b5f6b42]{flex:0 0 auto;border:none;background:transparent;color:#ffb3b3;font-size:16px;line-height:1;cursor:pointer;padding:0 4px}.auth-error-dismiss[data-v-0b5f6b42]:hover{color:#fff}.main-row[data-v-0b5f6b42]{display:flex;flex:1 1 auto;min-height:0}.main[data-v-0b5f6b42]{flex:1 1 auto;display:flex;flex-direction:column;position:relative;background:#000;overflow:hidden;min-width:0}.right-resizer[data-v-0b5f6b42]{width:4px;cursor:col-resize;background:transparent;flex:0 0 4px}.right-resizer[data-v-0b5f6b42]:hover{background:var(--ed-border, #2d333b)}.panel-toggle[data-v-0b5f6b42]{background:var(--ed-tab-bg, #21262d);border:1px solid var(--ed-border, #2d333b);color:var(--ed-row-fg, #c9d1d9);cursor:pointer;padding:0 4px;font-size:11px;align-self:stretch;flex:0 0 auto}.panel-toggle[data-v-0b5f6b42]:hover{background:var(--ed-row-hover, #30363d);color:var(--ed-tab-hover-fg, #ffffff)}.right-panel[data-v-0b5f6b42]:empty{display:none}.right-panel[data-v-0b5f6b42]{border-left:1px solid var(--ed-border, #2d333b);overflow:hidden}.bottom-toolbar[data-v-0b5f6b42]:empty{display:none}.bottom-toolbar[data-v-0b5f6b42]{flex:0 0 24px;height:24px;background:var(--ed-tab-bg, var(--terminal-bg));border-top:1px solid var(--ed-border, rgba(255, 255, 255, .08))}.empty[data-v-0b5f6b42]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;color:var(--fg-dim);font-size:13px}.toast[data-v-0b5f6b42]{position:absolute;bottom:36px;left:50%;transform:translate(-50%);background:#0d1117eb;border:1px solid var(--border);color:var(--fg);padding:6px 12px;border-radius:6px;font-size:12px;pointer-events:none}@media (max-width: 767px){.app[data-v-0b5f6b42]{height:100dvh;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);background:var(--bg);overflow:hidden}.main-row[data-v-0b5f6b42],.main[data-v-0b5f6b42]{min-width:0}.auth-error-banner[data-v-0b5f6b42]{padding:7px 10px;gap:6px}.auth-error-action[data-v-0b5f6b42]{padding:2px 6px}.toast[data-v-0b5f6b42]{bottom:calc(12px + env(safe-area-inset-bottom));max-width:calc(100vw - 24px);text-align:center}}/** - * Copyright (c) 2014 The xterm.js authors. All rights reserved. - * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) - * https://github.com/chjj/term.js - * @license MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * Originally forked from (with the author's permission): - * Fabrice Bellard's javascript vt100 for jslinux: - * http://bellard.org/jslinux/ - * Copyright (c) 2011 Fabrice Bellard - * The original design remains. The terminal itself - * has been extended to include xterm CSI codes, among - * other features. - */.xterm{cursor:text;position:relative;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 .xterm-scroll-area{visibility:hidden}.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,.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.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{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{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}:root{--bg: #0d1117;--panel: #161b22;--border: #30363d;--fg: #c9d1d9;--fg-dim: #8b949e;--accent: #58a6ff;--good: #3fb950;--bad: #f85149;--warn: #d29922;--neutral: #6e7681;--terminal-bg: #000000;--terminal-grid: #11161d;--terminal-overlay: rgba(13, 17, 23, .85);--font-sans: "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;--font-mono: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", ui-monospace, Menlo, Consolas, "Roboto Mono", monospace;--font-mono-strict: ui-monospace, Menlo, Consolas, "Roboto Mono", monospace}*{box-sizing:border-box}html,body{margin:0;padding:0;height:100%;background:var(--bg);color:var(--fg);font-family:var(--font-sans);font-size:14px}#app{height:100%}@supports (height: 100dvh){html,body,#app{height:100dvh}}.xterm-viewport::-webkit-scrollbar{width:10px;height:10px}.xterm-viewport::-webkit-scrollbar-track{background:transparent}.xterm-viewport::-webkit-scrollbar-thumb{background:#ffffff1a;border-radius:5px;border:2px solid transparent;background-clip:padding-box}.xterm-viewport::-webkit-scrollbar-thumb:hover{background:#ffffff40;background-clip:padding-box}.xterm-viewport::-webkit-scrollbar-corner{background:transparent}button,input,select{font:inherit;color:var(--fg)}button{background:transparent;border:1px solid var(--border);border-radius:6px;padding:6px 12px;cursor:pointer;transition:border-color .12s,color .12s}button:hover{border-color:var(--accent);color:var(--accent)}button.primary{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}button.primary:hover{background:#79b8ff;border-color:#79b8ff;color:#0d1117}input,select{background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:6px 10px}input:focus,select:focus{outline:none;border-color:var(--accent)}.settings-field-grid{display:grid;gap:14px 12px;min-width:0}.settings-field-grid--two{grid-template-columns:repeat(2,minmax(0,1fr))}.settings-field-grid--compact{grid-template-columns:minmax(72px,.65fr) minmax(72px,.65fr) minmax(90px,.85fr) minmax(170px,1.6fr)}.settings-field{display:flex;flex-direction:column;gap:6px;min-width:0}.settings-field--full{grid-column:1 / -1}.settings-field>input,.settings-field>.select-dropdown,.settings-field>.password-field{min-width:0;width:100%}@media (max-width: 640px){.settings-field-grid--two,.settings-field-grid--compact{grid-template-columns:minmax(0,1fr)}.settings-field--full{grid-column:auto}} diff --git a/internal/relay/web-dist/assets/index-DZaDIMfZ.js b/internal/relay/web-dist/assets/index-DlIw5VzR.js similarity index 98% rename from internal/relay/web-dist/assets/index-DZaDIMfZ.js rename to internal/relay/web-dist/assets/index-DlIw5VzR.js index c80dfa97..d7cb2ae7 100644 --- a/internal/relay/web-dist/assets/index-DZaDIMfZ.js +++ b/internal/relay/web-dist/assets/index-DlIw5VzR.js @@ -1 +1 @@ -import{L as be,E as $,C as he}from"./index-DRFRE0Ca.js";import{H as Te,J as Pe,Q as b,g as xe,L as Ve,z as ye,x as we,q as ve,c as Xe,O as K,E as $e}from"./FileExplorer-BumK3wPT.js";import{cssLanguage as J,css as qe}from"./index-gs2Ov3d4.js";import{typescriptLanguage as _e,jsxLanguage as Ce,tsxLanguage as ke,javascriptLanguage as M,javascript as Qe}from"./index-BKS_vG9j.js";import"./useI18n-lwZlSdSx.js";import"./index-Ci2MtInW.js";import"./prefsSync-C5tz9Q-s.js";import"./client-DMh7GjbV.js";import"./Switch-DguIL3dU.js";import"./auth-B3RxKR1W.js";import"./index-DblmzGAc.js";const Ae=55,Ye=1,Me=56,Re=2,Ee=57,Ze=3,z=4,Be=5,R=6,ee=7,te=8,ae=9,le=10,ze=11,De=12,We=13,q=58,Ne=14,Ge=15,D=59,re=21,Ie=23,ne=24,je=25,A=27,se=28,Ue=29,Le=32,Fe=35,He=37,Ke=38,Je=0,et=1,tt={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},at={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},W={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function lt(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let N=null,G=null,I=0;function Y(e,a){let r=e.pos+a;if(I==r&&G==e)return N;let l=e.peek(a),t="";for(;lt(l);)t+=String.fromCharCode(l),l=e.peek(++a);return G=e,I=r,N=t?t.toLowerCase():l==rt||l==nt?void 0:null}const oe=60,X=62,E=47,rt=63,nt=33,st=45;function j(e,a){this.name=e,this.parent=a}const ot=[R,le,ee,te,ae],it=new he({start:null,shift(e,a,r,l){return ot.indexOf(a)>-1?new j(Y(l,1)||"",e):e},reduce(e,a){return a==re&&e?e.parent:e},reuse(e,a,r,l){let t=a.type.id;return t==R||t==He?new j(Y(l,1)||"",e):e},strict:!1}),ut=new $((e,a)=>{if(e.next!=oe){e.next<0&&a.context&&e.acceptToken(q);return}e.advance();let r=e.next==E;r&&e.advance();let l=Y(e,0);if(l===void 0)return;if(!l)return e.acceptToken(r?Ge:Ne);let t=a.context?a.context.name:null;if(r){if(l==t)return e.acceptToken(ze);if(t&&at[t])return e.acceptToken(q,-2);if(a.dialectEnabled(Je))return e.acceptToken(De);for(let s=a.context;s;s=s.parent)if(s.name==l)return;e.acceptToken(We)}else{if(l=="script")return e.acceptToken(ee);if(l=="style")return e.acceptToken(te);if(l=="textarea")return e.acceptToken(ae);if(tt.hasOwnProperty(l))return e.acceptToken(le);t&&W[t]&&W[t][l]?e.acceptToken(q,-1):e.acceptToken(R)}},{contextual:!0}),Ot=new $(e=>{for(let a=0,r=0;;r++){if(e.next<0){r&&e.acceptToken(D);break}if(e.next==st)a++;else if(e.next==X&&a>=2){r>=3&&e.acceptToken(D,-2);break}else a=0;e.advance()}});function dt(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const ct=new $((e,a)=>{if(e.next==E&&e.peek(1)==X){let r=a.dialectEnabled(et)||dt(a.context);e.acceptToken(r?Be:z,2)}else e.next==X&&e.acceptToken(z,1)});function Z(e,a,r){let l=2+e.length;return new $(t=>{for(let s=0,o=0,i=0;;i++){if(t.next<0){i&&t.acceptToken(a);break}if(s==0&&t.next==oe||s==1&&t.next==E||s>=2&&so?t.acceptToken(a,-o):t.acceptToken(r,-(o-2));break}else if((t.next==10||t.next==13)&&i){t.acceptToken(a,1);break}else s=o=0;t.advance()}})}const pt=Z("script",Ae,Ye),mt=Z("style",Me,Re),ft=Z("textarea",Ee,Ze),gt=Pe({"Text RawText IncompleteTag IncompleteCloseTag":b.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":b.angleBracket,TagName:b.tagName,"MismatchedCloseTag/TagName":[b.tagName,b.invalid],AttributeName:b.attributeName,"AttributeValue UnquotedAttributeValue":b.attributeValue,Is:b.definitionOperator,"EntityReference CharacterReference":b.character,Comment:b.blockComment,ProcessingInst:b.processingInstruction,DoctypeDecl:b.documentMeta}),St=be.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb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ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:it,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[gt],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#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Ov(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let f=i.type.id;if(f==Ue)return _(i,u,r);if(f==Le)return _(i,u,l);if(f==Fe)return _(i,u,t);if(f==re&&s.length){let p=i.node,d=p.firstChild,m=d&&U(d,u),O;if(m){for(let c of s)if(c.tag==m&&(!c.attrs||c.attrs(O||(O=ie(d,u))))){let S=p.lastChild,h=S.type.id==Ke?S.from:p.to;if(h>d.to)return{parser:c.parser,overlay:[{from:d.to,to:h}]}}}}if(o&&f==ne){let p=i.node,d;if(d=p.firstChild){let m=o[u.read(d.from,d.to)];if(m)for(let O of m){if(O.tagName&&O.tagName!=U(p.parent,u))continue;let c=p.lastChild;if(c.type.id==A){let S=c.from+1,h=c.lastChild,T=c.to-(h&&h.isError?0:1);if(T>S)return{parser:O.parser,overlay:[{from:S,to:T}],bracketed:!0}}else if(c.type.id==se)return{parser:O.parser,overlay:[{from:c.from,to:c.to}]}}}}return null})}const V=["_blank","_self","_top","_parent"],C=["ascii","utf-8","utf-16","latin1","latin1"],k=["get","post","put","delete"],Q=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],g=["true","false"],n={},bt={a:{attrs:{href:null,ping:null,type:null,media:null,target:V,hreflang:null}},abbr:n,address:n,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:n,aside:n,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:n,base:{attrs:{href:null,target:V}},bdi:n,bdo:n,blockquote:{attrs:{cite:null}},body:n,br:n,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Q,formmethod:k,formnovalidate:["novalidate"],formtarget:V,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:n,center:n,cite:n,code:n,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:n,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:n,div:n,dl:n,dt:n,em:n,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:n,figure:n,footer:n,form:{attrs:{action:null,name:null,"accept-charset":C,autocomplete:["on","off"],enctype:Q,method:k,novalidate:["novalidate"],target:V}},h1:n,h2:n,h3:n,h4:n,h5:n,h6:n,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:n,hgroup:n,hr:n,html:{attrs:{manifest:null}},i:n,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Q,formmethod:k,formnovalidate:["novalidate"],formtarget:V,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:n,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:n,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:n,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:C,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:n,noscript:n,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:n,param:{attrs:{name:null,value:null}},pre:n,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:n,rt:n,ruby:n,samp:n,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:C}},section:n,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:n,source:{attrs:{src:null,type:null,media:null}},span:n,strong:n,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:n,summary:n,sup:n,table:n,tbody:n,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:n,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:n,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:n,time:{attrs:{datetime:null}},title:n,tr:n,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:n,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:n},Oe={accesskey:null,class:null,contenteditable:g,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:g,autocorrect:g,autocapitalize:g,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":g,"aria-autocomplete":["inline","list","both","none"],"aria-busy":g,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":g,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":g,"aria-hidden":g,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":g,"aria-multiselectable":g,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":g,"aria-relevant":null,"aria-required":g,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},de="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of de)Oe[e]=null;class y{constructor(a,r){this.tags={...bt,...a},this.globalAttrs={...Oe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}y.default=new y;function P(e,a,r=e.length){if(!a)return"";let l=a.firstChild,t=l&&l.getChild("TagName");return t?e.sliceString(t.from,Math.min(t.to,r)):""}function x(e,a=!1){for(;e;e=e.parent)if(e.name=="Element")if(a)a=!1;else return e;return null}function ce(e,a,r){let l=r.tags[P(e,x(a))];return(l==null?void 0:l.children)||r.allTags}function B(e,a){let r=[];for(let l=x(a);l&&!l.type.isTop;l=x(l.parent)){let t=P(e,l);if(t&&l.lastChild.name=="CloseTag")break;t&&r.indexOf(t)<0&&(a.name=="EndTag"||a.from>=l.firstChild.to)&&r.push(t)}return r}const pe=/^[:\-\.\w\u00b7-\uffff]*$/;function L(e,a,r,l,t){let s=/\s*>/.test(e.sliceDoc(t,t+5))?"":">",o=x(r,r.name=="StartTag"||r.name=="TagName");return{from:l,to:t,options:ce(e.doc,o,a).map(i=>({label:i,type:"type"})).concat(B(e.doc,r).map((i,u)=>({label:"/"+i,apply:"/"+i+s,type:"type",boost:99-u}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function F(e,a,r,l){let t=/\s*>/.test(e.sliceDoc(l,l+5))?"":">";return{from:r,to:l,options:B(e.doc,a).map((s,o)=>({label:s,apply:s+t,type:"type",boost:99-o})),validFor:pe}}function ht(e,a,r,l){let t=[],s=0;for(let o of ce(e.doc,r,a))t.push({label:"<"+o,type:"type"});for(let o of B(e.doc,r))t.push({label:"",type:"type",boost:99-s++});return{from:l,to:l,options:t,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Tt(e,a,r,l,t){let s=x(r),o=s?a.tags[P(e.doc,s)]:null,i=o&&o.attrs?Object.keys(o.attrs):[],u=o&&o.globalAttrs===!1?i:i.length?i.concat(a.globalAttrNames):a.globalAttrNames;return{from:l,to:t,options:u.map(f=>({label:f,type:"property"})),validFor:pe}}function Pt(e,a,r,l,t){var s;let o=(s=r.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),i=[],u;if(o){let f=e.sliceDoc(o.from,o.to),p=a.globalAttrs[f];if(!p){let d=x(r),m=d?a.tags[P(e.doc,d)]:null;p=(m==null?void 0:m.attrs)&&m.attrs[f]}if(p){let d=e.sliceDoc(l,t).toLowerCase(),m='"',O='"';/^['"]/.test(d)?(u=d[0]=='"'?/^[^"]*$/:/^[^']*$/,m="",O=e.sliceDoc(t,t+1)==d[0]?"":d[0],d=d.slice(1),l++):u=/^[^\s<>='"]*$/;for(let c of p)i.push({label:c,apply:m+c+O,type:"constant"})}}return{from:l,to:t,options:i,validFor:u}}function me(e,a){let{state:r,pos:l}=a,t=K(r).resolveInner(l,-1),s=t.resolve(l);for(let o=l,i;s==t&&(i=t.childBefore(o));){let u=i.lastChild;if(!u||!u.type.isError||u.fromme(l,t)}const Vt=M.parser.configure({top:"SingleExpression"}),fe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:_e.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Ce.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:ke.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Vt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:M.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:J.parser}],ge=[{name:"style",parser:J.parser.configure({top:"Styles"})}].concat(de.map(e=>({name:e,parser:M.parser}))),Se=Ve.define({name:"html",parser:St.configure({props:[ye.add({Element(e){let a=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+a[0].length?e.continue():e.lineIndent(e.node.from)+(a[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),v=Se.configure({wrap:ue(fe,ge)});function Rt(e={}){let a="",r;e.matchClosingTags===!1&&(a="noMatch"),e.selfClosingTags===!0&&(a=(a?a+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=ue((e.nestedLanguages||[]).concat(fe),(e.nestedAttributes||[]).concat(ge)));let l=r?Se.configure({wrap:r,dialect:a}):a?v.configure({dialect:a}):v;return new xe(l,[v.data.of({autocomplete:xt(e)}),e.autoCloseTags!==!1?yt:[],Qe().support,qe().support])}const H=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),yt=Xe.inputHandler.of((e,a,r,l,t)=>{if(e.composing||e.state.readOnly||a!=r||l!=">"&&l!="/"||!v.isActiveAt(e.state,a,-1))return!1;let s=t(),{state:o}=s,i=o.changeByRange(u=>{var f,p,d;let m=o.doc.sliceString(u.from-1,u.to)==l,{head:O}=u,c=K(o).resolveInner(O,-1),S;if(m&&l==">"&&c.name=="EndTag"){let h=c.parent;if(((p=(f=h.parent)===null||f===void 0?void 0:f.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(S=P(o.doc,h.parent,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=``;return{range:u,changes:{from:O,to:T,insert:w}}}}else if(m&&l=="/"&&c.name=="IncompleteCloseTag"){let h=c.parent;if(c.from==O-2&&((d=h.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(S=P(o.doc,h,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=`${S}>`;return{range:$e.cursor(O+w.length,-1),changes:{from:O,to:T,insert:w}}}}return{range:u}});return i.changes.empty?!1:(e.dispatch([s,o.update(i,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{yt as autoCloseTags,Rt as html,Mt as htmlCompletionSource,xt as htmlCompletionSourceWith,v as htmlLanguage}; +import{L as be,E as $,C as he}from"./index-Bf0-KgBD.js";import{H as Te,J as Pe,Q as b,g as xe,L as Ve,z as ye,x as we,q as ve,c as Xe,O as K,E as $e}from"./FileExplorer-BmPzqkbb.js";import{cssLanguage as J,css as qe}from"./index-8SnOqa2v.js";import{typescriptLanguage as _e,jsxLanguage as Ce,tsxLanguage as ke,javascriptLanguage as M,javascript as Qe}from"./index-Ck_fIti9.js";import"./useI18n-D4u8zssu.js";import"./index-zrZBIArQ.js";import"./prefsSync-Dj3wNxrO.js";import"./client-n-fLEpOg.js";import"./Switch-BlSJOKEO.js";import"./auth-BBmiA1GG.js";import"./index-DDP-KCe3.js";const Ae=55,Ye=1,Me=56,Re=2,Ee=57,Ze=3,z=4,Be=5,R=6,ee=7,te=8,ae=9,le=10,ze=11,De=12,We=13,q=58,Ne=14,Ge=15,D=59,re=21,Ie=23,ne=24,je=25,A=27,se=28,Ue=29,Le=32,Fe=35,He=37,Ke=38,Je=0,et=1,tt={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},at={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},W={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function lt(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let N=null,G=null,I=0;function Y(e,a){let r=e.pos+a;if(I==r&&G==e)return N;let l=e.peek(a),t="";for(;lt(l);)t+=String.fromCharCode(l),l=e.peek(++a);return G=e,I=r,N=t?t.toLowerCase():l==rt||l==nt?void 0:null}const oe=60,X=62,E=47,rt=63,nt=33,st=45;function j(e,a){this.name=e,this.parent=a}const ot=[R,le,ee,te,ae],it=new he({start:null,shift(e,a,r,l){return ot.indexOf(a)>-1?new j(Y(l,1)||"",e):e},reduce(e,a){return a==re&&e?e.parent:e},reuse(e,a,r,l){let t=a.type.id;return t==R||t==He?new j(Y(l,1)||"",e):e},strict:!1}),ut=new $((e,a)=>{if(e.next!=oe){e.next<0&&a.context&&e.acceptToken(q);return}e.advance();let r=e.next==E;r&&e.advance();let l=Y(e,0);if(l===void 0)return;if(!l)return e.acceptToken(r?Ge:Ne);let t=a.context?a.context.name:null;if(r){if(l==t)return e.acceptToken(ze);if(t&&at[t])return e.acceptToken(q,-2);if(a.dialectEnabled(Je))return e.acceptToken(De);for(let s=a.context;s;s=s.parent)if(s.name==l)return;e.acceptToken(We)}else{if(l=="script")return e.acceptToken(ee);if(l=="style")return e.acceptToken(te);if(l=="textarea")return e.acceptToken(ae);if(tt.hasOwnProperty(l))return e.acceptToken(le);t&&W[t]&&W[t][l]?e.acceptToken(q,-1):e.acceptToken(R)}},{contextual:!0}),Ot=new $(e=>{for(let a=0,r=0;;r++){if(e.next<0){r&&e.acceptToken(D);break}if(e.next==st)a++;else if(e.next==X&&a>=2){r>=3&&e.acceptToken(D,-2);break}else a=0;e.advance()}});function dt(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const ct=new $((e,a)=>{if(e.next==E&&e.peek(1)==X){let r=a.dialectEnabled(et)||dt(a.context);e.acceptToken(r?Be:z,2)}else e.next==X&&e.acceptToken(z,1)});function Z(e,a,r){let l=2+e.length;return new $(t=>{for(let s=0,o=0,i=0;;i++){if(t.next<0){i&&t.acceptToken(a);break}if(s==0&&t.next==oe||s==1&&t.next==E||s>=2&&so?t.acceptToken(a,-o):t.acceptToken(r,-(o-2));break}else if((t.next==10||t.next==13)&&i){t.acceptToken(a,1);break}else s=o=0;t.advance()}})}const pt=Z("script",Ae,Ye),mt=Z("style",Me,Re),ft=Z("textarea",Ee,Ze),gt=Pe({"Text RawText IncompleteTag IncompleteCloseTag":b.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":b.angleBracket,TagName:b.tagName,"MismatchedCloseTag/TagName":[b.tagName,b.invalid],AttributeName:b.attributeName,"AttributeValue UnquotedAttributeValue":b.attributeValue,Is:b.definitionOperator,"EntityReference CharacterReference":b.character,Comment:b.blockComment,ProcessingInst:b.processingInstruction,DoctypeDecl:b.documentMeta}),St=be.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O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O~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:it,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["open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%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let f=i.type.id;if(f==Ue)return _(i,u,r);if(f==Le)return _(i,u,l);if(f==Fe)return _(i,u,t);if(f==re&&s.length){let p=i.node,d=p.firstChild,m=d&&U(d,u),O;if(m){for(let c of s)if(c.tag==m&&(!c.attrs||c.attrs(O||(O=ie(d,u))))){let S=p.lastChild,h=S.type.id==Ke?S.from:p.to;if(h>d.to)return{parser:c.parser,overlay:[{from:d.to,to:h}]}}}}if(o&&f==ne){let p=i.node,d;if(d=p.firstChild){let m=o[u.read(d.from,d.to)];if(m)for(let O of m){if(O.tagName&&O.tagName!=U(p.parent,u))continue;let c=p.lastChild;if(c.type.id==A){let S=c.from+1,h=c.lastChild,T=c.to-(h&&h.isError?0:1);if(T>S)return{parser:O.parser,overlay:[{from:S,to:T}],bracketed:!0}}else if(c.type.id==se)return{parser:O.parser,overlay:[{from:c.from,to:c.to}]}}}}return null})}const V=["_blank","_self","_top","_parent"],C=["ascii","utf-8","utf-16","latin1","latin1"],k=["get","post","put","delete"],Q=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],g=["true","false"],n={},bt={a:{attrs:{href:null,ping:null,type:null,media:null,target:V,hreflang:null}},abbr:n,address:n,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:n,aside:n,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:n,base:{attrs:{href:null,target:V}},bdi:n,bdo:n,blockquote:{attrs:{cite:null}},body:n,br:n,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Q,formmethod:k,formnovalidate:["novalidate"],formtarget:V,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:n,center:n,cite:n,code:n,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:n,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:n,div:n,dl:n,dt:n,em:n,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:n,figure:n,footer:n,form:{attrs:{action:null,name:null,"accept-charset":C,autocomplete:["on","off"],enctype:Q,method:k,novalidate:["novalidate"],target:V}},h1:n,h2:n,h3:n,h4:n,h5:n,h6:n,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:n,hgroup:n,hr:n,html:{attrs:{manifest:null}},i:n,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Q,formmethod:k,formnovalidate:["novalidate"],formtarget:V,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:n,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:n,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:n,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:C,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:n,noscript:n,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:n,param:{attrs:{name:null,value:null}},pre:n,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:n,rt:n,ruby:n,samp:n,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:C}},section:n,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:n,source:{attrs:{src:null,type:null,media:null}},span:n,strong:n,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:n,summary:n,sup:n,table:n,tbody:n,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:n,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:n,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:n,time:{attrs:{datetime:null}},title:n,tr:n,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:n,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:n},Oe={accesskey:null,class:null,contenteditable:g,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:g,autocorrect:g,autocapitalize:g,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":g,"aria-autocomplete":["inline","list","both","none"],"aria-busy":g,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":g,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":g,"aria-hidden":g,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":g,"aria-multiselectable":g,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":g,"aria-relevant":null,"aria-required":g,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},de="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of de)Oe[e]=null;class y{constructor(a,r){this.tags={...bt,...a},this.globalAttrs={...Oe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}y.default=new y;function P(e,a,r=e.length){if(!a)return"";let l=a.firstChild,t=l&&l.getChild("TagName");return t?e.sliceString(t.from,Math.min(t.to,r)):""}function x(e,a=!1){for(;e;e=e.parent)if(e.name=="Element")if(a)a=!1;else return e;return null}function ce(e,a,r){let l=r.tags[P(e,x(a))];return(l==null?void 0:l.children)||r.allTags}function B(e,a){let r=[];for(let l=x(a);l&&!l.type.isTop;l=x(l.parent)){let t=P(e,l);if(t&&l.lastChild.name=="CloseTag")break;t&&r.indexOf(t)<0&&(a.name=="EndTag"||a.from>=l.firstChild.to)&&r.push(t)}return r}const pe=/^[:\-\.\w\u00b7-\uffff]*$/;function L(e,a,r,l,t){let s=/\s*>/.test(e.sliceDoc(t,t+5))?"":">",o=x(r,r.name=="StartTag"||r.name=="TagName");return{from:l,to:t,options:ce(e.doc,o,a).map(i=>({label:i,type:"type"})).concat(B(e.doc,r).map((i,u)=>({label:"/"+i,apply:"/"+i+s,type:"type",boost:99-u}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function F(e,a,r,l){let t=/\s*>/.test(e.sliceDoc(l,l+5))?"":">";return{from:r,to:l,options:B(e.doc,a).map((s,o)=>({label:s,apply:s+t,type:"type",boost:99-o})),validFor:pe}}function ht(e,a,r,l){let t=[],s=0;for(let o of ce(e.doc,r,a))t.push({label:"<"+o,type:"type"});for(let o of B(e.doc,r))t.push({label:"",type:"type",boost:99-s++});return{from:l,to:l,options:t,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Tt(e,a,r,l,t){let s=x(r),o=s?a.tags[P(e.doc,s)]:null,i=o&&o.attrs?Object.keys(o.attrs):[],u=o&&o.globalAttrs===!1?i:i.length?i.concat(a.globalAttrNames):a.globalAttrNames;return{from:l,to:t,options:u.map(f=>({label:f,type:"property"})),validFor:pe}}function Pt(e,a,r,l,t){var s;let o=(s=r.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),i=[],u;if(o){let f=e.sliceDoc(o.from,o.to),p=a.globalAttrs[f];if(!p){let d=x(r),m=d?a.tags[P(e.doc,d)]:null;p=(m==null?void 0:m.attrs)&&m.attrs[f]}if(p){let d=e.sliceDoc(l,t).toLowerCase(),m='"',O='"';/^['"]/.test(d)?(u=d[0]=='"'?/^[^"]*$/:/^[^']*$/,m="",O=e.sliceDoc(t,t+1)==d[0]?"":d[0],d=d.slice(1),l++):u=/^[^\s<>='"]*$/;for(let c of p)i.push({label:c,apply:m+c+O,type:"constant"})}}return{from:l,to:t,options:i,validFor:u}}function me(e,a){let{state:r,pos:l}=a,t=K(r).resolveInner(l,-1),s=t.resolve(l);for(let o=l,i;s==t&&(i=t.childBefore(o));){let u=i.lastChild;if(!u||!u.type.isError||u.fromme(l,t)}const Vt=M.parser.configure({top:"SingleExpression"}),fe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:_e.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Ce.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:ke.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Vt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:M.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:J.parser}],ge=[{name:"style",parser:J.parser.configure({top:"Styles"})}].concat(de.map(e=>({name:e,parser:M.parser}))),Se=Ve.define({name:"html",parser:St.configure({props:[ye.add({Element(e){let a=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+a[0].length?e.continue():e.lineIndent(e.node.from)+(a[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),v=Se.configure({wrap:ue(fe,ge)});function Rt(e={}){let a="",r;e.matchClosingTags===!1&&(a="noMatch"),e.selfClosingTags===!0&&(a=(a?a+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=ue((e.nestedLanguages||[]).concat(fe),(e.nestedAttributes||[]).concat(ge)));let l=r?Se.configure({wrap:r,dialect:a}):a?v.configure({dialect:a}):v;return new xe(l,[v.data.of({autocomplete:xt(e)}),e.autoCloseTags!==!1?yt:[],Qe().support,qe().support])}const H=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),yt=Xe.inputHandler.of((e,a,r,l,t)=>{if(e.composing||e.state.readOnly||a!=r||l!=">"&&l!="/"||!v.isActiveAt(e.state,a,-1))return!1;let s=t(),{state:o}=s,i=o.changeByRange(u=>{var f,p,d;let m=o.doc.sliceString(u.from-1,u.to)==l,{head:O}=u,c=K(o).resolveInner(O,-1),S;if(m&&l==">"&&c.name=="EndTag"){let h=c.parent;if(((p=(f=h.parent)===null||f===void 0?void 0:f.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(S=P(o.doc,h.parent,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=``;return{range:u,changes:{from:O,to:T,insert:w}}}}else if(m&&l=="/"&&c.name=="IncompleteCloseTag"){let h=c.parent;if(c.from==O-2&&((d=h.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(S=P(o.doc,h,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=`${S}>`;return{range:$e.cursor(O+w.length,-1),changes:{from:O,to:T,insert:w}}}}return{range:u}});return i.changes.empty?!1:(e.dispatch([s,o.update(i,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{yt as autoCloseTags,Rt as html,Mt as htmlCompletionSource,xt as htmlCompletionSourceWith,v as htmlLanguage}; diff --git a/internal/relay/web-dist/assets/index-CVE6o20G.js b/internal/relay/web-dist/assets/index-DmukWKLV.js similarity index 97% rename from internal/relay/web-dist/assets/index-CVE6o20G.js rename to internal/relay/web-dist/assets/index-DmukWKLV.js index ca9abaeb..e0466db1 100644 --- a/internal/relay/web-dist/assets/index-CVE6o20G.js +++ b/internal/relay/web-dist/assets/index-DmukWKLV.js @@ -1 +1 @@ -import{L as V,E as S,C as _}from"./index-DRFRE0Ca.js";import{J as w,Q as t,g as Z,L,z as B,u as v,x as E,w as M}from"./FileExplorer-BumK3wPT.js";import"./useI18n-lwZlSdSx.js";import"./index-Ci2MtInW.js";import"./prefsSync-C5tz9Q-s.js";import"./client-DMh7GjbV.js";import"./Switch-DguIL3dU.js";import"./auth-B3RxKR1W.js";const f=63,p=64,j=1,A=2,U=3,H=4,W=5,N=6,I=7,y=65,u=66,F=8,K=9,J=10,OO=11,eO=12,Y=13,aO=19,rO=20,QO=29,tO=33,PO=34,oO=47,nO=0,$=1,b=2,d=3,g=4;class s{constructor(e,a,r){this.parent=e,this.depth=a,this.type=r,this.hash=(e?e.hash+e.hash<<8:0)+a+(a<<4)+r}}s.top=new s(null,-1,nO);function X(O,e){for(let a=0,r=e-O.pos-1;;r--,a++){let P=O.peek(r);if(o(P)||P==-1)return a}}function x(O){return O==32||O==9}function o(O){return O==10||O==13}function z(O){return x(O)||o(O)}function l(O){return O<0||z(O)}const sO=new _({start:s.top,reduce(O,e){return O.type==d&&(e==rO||e==PO)?O.parent:O},shift(O,e,a,r){if(e==U)return new s(O,X(r,r.pos),$);if(e==y||e==W)return new s(O,X(r,r.pos),b);if(e==f)return O.parent;if(e==aO||e==tO)return new s(O,0,d);if(e==Y&&O.type==g)return O.parent;if(e==oO){let P=/[1-9]/.exec(r.read(r.pos,a.pos));if(P)return new s(O,O.depth+ +P[0],g)}return O},hash(O){return O.hash}});function c(O,e,a=0){return O.peek(a)==e&&O.peek(a+1)==e&&O.peek(a+2)==e&&l(O.peek(a+3))}const lO=new S((O,e)=>{if(O.next==-1&&e.canShift(p))return O.acceptToken(p);let a=O.peek(-1);if((o(a)||a<0)&&e.context.type!=d){if(c(O,45))if(e.canShift(f))O.acceptToken(f);else return O.acceptToken(j,3);if(c(O,46))if(e.canShift(f))O.acceptToken(f);else return O.acceptToken(A,3);let r=0;for(;O.next==32;)r++,O.advance();(r{if(e.context.type==d){O.next==63&&(O.advance(),l(O.next)&&O.acceptToken(I));return}if(O.next==45)O.advance(),l(O.next)&&O.acceptToken(e.context.type==$&&e.context.depth==X(O,O.pos-1)?H:U);else if(O.next==63)O.advance(),l(O.next)&&O.acceptToken(e.context.type==b&&e.context.depth==X(O,O.pos-1)?N:W);else{let a=O.pos;for(;;)if(x(O.next)){if(O.pos==a)return;O.advance()}else if(O.next==33)C(O);else if(O.next==38)m(O);else if(O.next==42){m(O);break}else if(O.next==39||O.next==34){if(T(O,!0))break;return}else if(O.next==91||O.next==123){if(!XO(O))return;break}else{G(O,!0,!1,0);break}for(;x(O.next);)O.advance();if(O.next==58){if(O.pos==a&&e.canShift(QO))return;let r=O.peek(1);l(r)&&O.acceptTokenTo(e.context.type==b&&e.context.depth==X(O,a)?u:y,a)}}},{contextual:!0});function cO(O){return O>32&&O<127&&O!=34&&O!=37&&O!=44&&O!=60&&O!=62&&O!=92&&O!=94&&O!=96&&O!=123&&O!=124&&O!=125}function q(O){return O>=48&&O<=57||O>=97&&O<=102||O>=65&&O<=70}function D(O,e){return O.next==37?(O.advance(),q(O.next)&&O.advance(),q(O.next)&&O.advance(),!0):cO(O.next)||e&&O.next==44?(O.advance(),!0):!1}function C(O){if(O.advance(),O.next==60){for(O.advance();;)if(!D(O,!0)){O.next==62&&O.advance();break}}else for(;D(O,!1););}function m(O){for(O.advance();!l(O.next)&&i(O.next)!="f";)O.advance()}function T(O,e){let a=O.next,r=!1,P=O.pos;for(O.advance();;){let Q=O.next;if(Q<0)break;if(O.advance(),Q==a)if(Q==39)if(O.next==39)O.advance();else break;else break;else if(Q==92&&a==34)O.next>=0&&O.advance();else if(o(Q)){if(e)return!1;r=!0}else if(e&&O.pos>=P+1024)return!1}return!r}function XO(O){for(let e=[],a=O.pos+1024;;)if(O.next==91||O.next==123)e.push(O.next),O.advance();else if(O.next==39||O.next==34){if(!T(O,!0))return!1}else if(O.next==93||O.next==125){if(e[e.length-1]!=O.next-2)return!1;if(e.pop(),O.advance(),!e.length)return!0}else{if(O.next<0||O.pos>a||o(O.next))return!1;O.advance()}}const dO="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function i(O){return O<33?"u":O>125?"s":dO[O-33]}function k(O,e){let a=i(O);return a!="u"&&!(e&&a=="f")}function G(O,e,a,r){if(i(O.next)=="s"||(O.next==63||O.next==58||O.next==45)&&k(O.peek(1),a))O.advance();else return!1;let P=O.pos;for(;;){let Q=O.next,n=0,R=r+1;for(;z(Q);){if(o(Q)){if(e)return!1;R=0}else R++;Q=O.peek(++n)}if(!(Q>=0&&(Q==58?k(O.peek(n+1),a):Q==35?O.peek(n-1)!=32:k(Q,a)))||!a&&R<=r||R==0&&!a&&(c(O,45,n)||c(O,46,n)))break;if(e&&i(Q)=="f")return!1;for(let h=n;h>=0;h--)O.advance();if(e&&O.pos>P+1024)return!1}return!0}const RO=new S((O,e)=>{if(O.next==33)C(O),O.acceptToken(eO);else if(O.next==38||O.next==42){let a=O.next==38?J:OO;m(O),O.acceptToken(a)}else O.next==39||O.next==34?(T(O,!1),O.acceptToken(K)):G(O,!1,e.context.type==d,e.context.depth)&&O.acceptToken(F)}),iO=new S((O,e)=>{let a=e.context.type==g?e.context.depth:-1,r=O.pos;O:for(;;){let P=0,Q=O.next;for(;Q==32;)Q=O.peek(++P);if(!P&&(c(O,45,P)||c(O,46,P))||!o(Q)&&(a<0&&(a=Math.max(e.context.depth+1,P)),PYAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO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OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive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ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[lO,fO,RO,iO,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),bO=L.define({name:"yaml",parser:kO.configure({props:[B.add({Stream:O=>{for(let e=O.node.resolve(O.pos,-1);e&&e.to>=O.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.fromO.pos)return null}}return null},FlowMapping:v({closing:"}"}),FlowSequence:v({closing:"]"})}),E.add({"FlowMapping FlowSequence":M,"Item Pair BlockLiteral":(O,e)=>({from:e.doc.lineAt(O.from).to,to:O.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function DO(){return new Z(bO)}export{DO as yaml,bO as yamlLanguage}; +import{L as V,E as S,C as _}from"./index-Bf0-KgBD.js";import{J as w,Q as t,g as Z,L,z as B,u as v,x as E,w as M}from"./FileExplorer-BmPzqkbb.js";import"./useI18n-D4u8zssu.js";import"./index-zrZBIArQ.js";import"./prefsSync-Dj3wNxrO.js";import"./client-n-fLEpOg.js";import"./Switch-BlSJOKEO.js";import"./auth-BBmiA1GG.js";const f=63,p=64,j=1,A=2,U=3,H=4,W=5,N=6,I=7,y=65,u=66,F=8,K=9,J=10,OO=11,eO=12,Y=13,aO=19,rO=20,QO=29,tO=33,PO=34,oO=47,nO=0,$=1,b=2,d=3,g=4;class s{constructor(e,a,r){this.parent=e,this.depth=a,this.type=r,this.hash=(e?e.hash+e.hash<<8:0)+a+(a<<4)+r}}s.top=new s(null,-1,nO);function X(O,e){for(let a=0,r=e-O.pos-1;;r--,a++){let P=O.peek(r);if(o(P)||P==-1)return a}}function x(O){return O==32||O==9}function o(O){return O==10||O==13}function z(O){return x(O)||o(O)}function l(O){return O<0||z(O)}const sO=new _({start:s.top,reduce(O,e){return O.type==d&&(e==rO||e==PO)?O.parent:O},shift(O,e,a,r){if(e==U)return new s(O,X(r,r.pos),$);if(e==y||e==W)return new s(O,X(r,r.pos),b);if(e==f)return O.parent;if(e==aO||e==tO)return new s(O,0,d);if(e==Y&&O.type==g)return O.parent;if(e==oO){let P=/[1-9]/.exec(r.read(r.pos,a.pos));if(P)return new s(O,O.depth+ +P[0],g)}return O},hash(O){return O.hash}});function c(O,e,a=0){return O.peek(a)==e&&O.peek(a+1)==e&&O.peek(a+2)==e&&l(O.peek(a+3))}const lO=new S((O,e)=>{if(O.next==-1&&e.canShift(p))return O.acceptToken(p);let a=O.peek(-1);if((o(a)||a<0)&&e.context.type!=d){if(c(O,45))if(e.canShift(f))O.acceptToken(f);else return O.acceptToken(j,3);if(c(O,46))if(e.canShift(f))O.acceptToken(f);else return O.acceptToken(A,3);let r=0;for(;O.next==32;)r++,O.advance();(r{if(e.context.type==d){O.next==63&&(O.advance(),l(O.next)&&O.acceptToken(I));return}if(O.next==45)O.advance(),l(O.next)&&O.acceptToken(e.context.type==$&&e.context.depth==X(O,O.pos-1)?H:U);else if(O.next==63)O.advance(),l(O.next)&&O.acceptToken(e.context.type==b&&e.context.depth==X(O,O.pos-1)?N:W);else{let a=O.pos;for(;;)if(x(O.next)){if(O.pos==a)return;O.advance()}else if(O.next==33)C(O);else if(O.next==38)m(O);else if(O.next==42){m(O);break}else if(O.next==39||O.next==34){if(T(O,!0))break;return}else if(O.next==91||O.next==123){if(!XO(O))return;break}else{G(O,!0,!1,0);break}for(;x(O.next);)O.advance();if(O.next==58){if(O.pos==a&&e.canShift(QO))return;let r=O.peek(1);l(r)&&O.acceptTokenTo(e.context.type==b&&e.context.depth==X(O,a)?u:y,a)}}},{contextual:!0});function cO(O){return O>32&&O<127&&O!=34&&O!=37&&O!=44&&O!=60&&O!=62&&O!=92&&O!=94&&O!=96&&O!=123&&O!=124&&O!=125}function q(O){return O>=48&&O<=57||O>=97&&O<=102||O>=65&&O<=70}function D(O,e){return O.next==37?(O.advance(),q(O.next)&&O.advance(),q(O.next)&&O.advance(),!0):cO(O.next)||e&&O.next==44?(O.advance(),!0):!1}function C(O){if(O.advance(),O.next==60){for(O.advance();;)if(!D(O,!0)){O.next==62&&O.advance();break}}else for(;D(O,!1););}function m(O){for(O.advance();!l(O.next)&&i(O.next)!="f";)O.advance()}function T(O,e){let a=O.next,r=!1,P=O.pos;for(O.advance();;){let Q=O.next;if(Q<0)break;if(O.advance(),Q==a)if(Q==39)if(O.next==39)O.advance();else break;else break;else if(Q==92&&a==34)O.next>=0&&O.advance();else if(o(Q)){if(e)return!1;r=!0}else if(e&&O.pos>=P+1024)return!1}return!r}function XO(O){for(let e=[],a=O.pos+1024;;)if(O.next==91||O.next==123)e.push(O.next),O.advance();else if(O.next==39||O.next==34){if(!T(O,!0))return!1}else if(O.next==93||O.next==125){if(e[e.length-1]!=O.next-2)return!1;if(e.pop(),O.advance(),!e.length)return!0}else{if(O.next<0||O.pos>a||o(O.next))return!1;O.advance()}}const dO="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function i(O){return O<33?"u":O>125?"s":dO[O-33]}function k(O,e){let a=i(O);return a!="u"&&!(e&&a=="f")}function G(O,e,a,r){if(i(O.next)=="s"||(O.next==63||O.next==58||O.next==45)&&k(O.peek(1),a))O.advance();else return!1;let P=O.pos;for(;;){let Q=O.next,n=0,R=r+1;for(;z(Q);){if(o(Q)){if(e)return!1;R=0}else R++;Q=O.peek(++n)}if(!(Q>=0&&(Q==58?k(O.peek(n+1),a):Q==35?O.peek(n-1)!=32:k(Q,a)))||!a&&R<=r||R==0&&!a&&(c(O,45,n)||c(O,46,n)))break;if(e&&i(Q)=="f")return!1;for(let h=n;h>=0;h--)O.advance();if(e&&O.pos>P+1024)return!1}return!0}const RO=new S((O,e)=>{if(O.next==33)C(O),O.acceptToken(eO);else if(O.next==38||O.next==42){let a=O.next==38?J:OO;m(O),O.acceptToken(a)}else O.next==39||O.next==34?(T(O,!1),O.acceptToken(K)):G(O,!1,e.context.type==d,e.context.depth)&&O.acceptToken(F)}),iO=new S((O,e)=>{let a=e.context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|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:sO,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[SO],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[lO,fO,RO,iO,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),bO=L.define({name:"yaml",parser:kO.configure({props:[B.add({Stream:O=>{for(let e=O.node.resolve(O.pos,-1);e&&e.to>=O.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.fromO.pos)return null}}return null},FlowMapping:v({closing:"}"}),FlowSequence:v({closing:"]"})}),E.add({"FlowMapping FlowSequence":M,"Item Pair BlockLiteral":(O,e)=>({from:e.doc.lineAt(O.from).to,to:O.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function DO(){return new Z(bO)}export{DO as yaml,bO as yamlLanguage}; diff --git a/internal/relay/web-dist/assets/index-Dy-6tZbQ.js b/internal/relay/web-dist/assets/index-DoVrcQoW.js similarity index 99% rename from internal/relay/web-dist/assets/index-Dy-6tZbQ.js rename to internal/relay/web-dist/assets/index-DoVrcQoW.js index 200bb854..491260e7 100644 --- a/internal/relay/web-dist/assets/index-Dy-6tZbQ.js +++ b/internal/relay/web-dist/assets/index-DoVrcQoW.js @@ -1 +1 @@ -import{L as t,E as Z,a as o}from"./index-DRFRE0Ca.js";import{J as S,Q as e,g as s,L as m,z as d,v as Y,r as a,u as w,x as n,w as V}from"./FileExplorer-BumK3wPT.js";import"./useI18n-lwZlSdSx.js";import"./index-Ci2MtInW.js";import"./prefsSync-C5tz9Q-s.js";import"./client-DMh7GjbV.js";import"./Switch-DguIL3dU.js";import"./auth-B3RxKR1W.js";const P=1,l=2,q=3,T=82,z=76,_=117,h=85,c=97,j=122,b=65,p=90,v=95,i=48,U=34,R=40,r=41,W=32,x=62,f=new Z(O=>{if(O.next==z||O.next==h?O.advance():O.next==_&&(O.advance(),O.next==i+8&&O.advance()),O.next!=T||(O.advance(),O.next!=U))return;O.advance();let Q="";for(;O.next!=R;){if(O.next==W||O.next<=13||O.next==r)return;Q+=String.fromCharCode(O.next),O.advance()}for(O.advance();;){if(O.next<0)return O.acceptToken(P);if(O.next==r){let $=!0;for(let X=0;$&&X{if(O.next==x)O.peek(1)==x&&O.acceptToken(l,1);else{let Q=!1,$=0;for(;;$++){if(O.next>=b&&O.next<=p)Q=!0;else{if(O.next>=c&&O.next<=j)return;if(O.next!=v&&!(O.next>=i&&O.next<=i+9))break}O.advance()}Q&&$>1&&O.acceptToken(q)}},{extend:!0}),k=S({"typedef struct union enum class typename decltype auto template operator friend noexcept namespace using requires concept import export module __attribute__ __declspec __based":e.definitionKeyword,"extern MsCallModifier MsPointerModifier extern static register thread_local inline const volatile restrict _Atomic mutable constexpr constinit consteval virtual explicit VirtualSpecifier Access":e.modifier,"if else switch for while do case default return break continue goto throw try catch":e.controlKeyword,"co_return co_yield co_await":e.controlKeyword,"new sizeof delete static_assert":e.operatorKeyword,"NULL nullptr":e.null,this:e.self,"True False":e.bool,"TypeSize PrimitiveType":e.standard(e.typeName),TypeIdentifier:e.typeName,FieldIdentifier:e.propertyName,"CallExpression/FieldExpression/FieldIdentifier":e.function(e.propertyName),"ModuleName/Identifier":e.namespace,PartitionName:e.labelName,StatementIdentifier:e.labelName,"Identifier DestructorName":e.variableName,"CallExpression/Identifier":e.function(e.variableName),"CallExpression/ScopedIdentifier/Identifier":e.function(e.variableName),"FunctionDeclarator/Identifier FunctionDeclarator/DestructorName":e.function(e.definition(e.variableName)),NamespaceIdentifier:e.namespace,OperatorName:e.operator,ArithOp:e.arithmeticOperator,LogicOp:e.logicOperator,BitOp:e.bitwiseOperator,CompareOp:e.compareOperator,AssignOp:e.definitionOperator,UpdateOp:e.updateOperator,LineComment:e.lineComment,BlockComment:e.blockComment,Number:e.number,String:e.string,"RawString SystemLibString":e.special(e.string),CharLiteral:e.character,EscapeSequence:e.escape,"UserDefinedLiteral/Identifier":e.literal,PreprocArg:e.meta,"PreprocDirectiveName #include #ifdef #ifndef #if #define #else #endif #elif":e.processingInstruction,MacroName:e.special(e.name),"( )":e.paren,"[ ]":e.squareBracket,"{ }":e.brace,"< >":e.angleBracket,". ->":e.derefOperator,", ;":e.separator}),u={__proto__:null,bool:36,char:36,int:36,float:36,double:36,void:36,size_t:36,ssize_t:36,intptr_t:36,uintptr_t:36,charptr_t:36,int8_t:36,int16_t:36,int32_t:36,int64_t:36,uint8_t:36,uint16_t:36,uint32_t:36,uint64_t:36,char8_t:36,char16_t:36,char32_t:36,char64_t:36,const:70,volatile:72,restrict:74,_Atomic:76,mutable:78,constexpr:80,constinit:82,consteval:84,struct:88,__declspec:92,final:148,override:148,public:152,private:152,protected:152,virtual:154,extern:160,static:162,register:164,inline:166,thread_local:168,__attribute__:172,__based:178,__restrict:180,__uptr:180,__sptr:180,_unaligned:180,__unaligned:180,noexcept:194,requires:198,TRUE:798,true:798,FALSE:800,false:800,typename:218,class:220,template:234,throw:248,__cdecl:256,__clrcall:256,__stdcall:256,__fastcall:256,__thiscall:256,__vectorcall:256,try:260,catch:264,export:282,import:286,case:296,default:298,if:308,else:314,switch:318,do:322,while:324,for:330,return:334,break:338,continue:342,goto:346,co_return:350,co_yield:354,using:362,typedef:366,namespace:380,new:398,delete:400,co_await:402,concept:406,enum:410,static_assert:414,friend:422,union:424,explicit:430,operator:444,module:456,signed:518,unsigned:518,long:518,short:518,decltype:528,auto:530,sizeof:566,NULL:572,nullptr:586,this:588},G={__proto__:null,"<":767},y={__proto__:null,">":135},E={__proto__:null,operator:388,new:576,delete:582},C=t.deserialize({version:14,states:"$<[Q!QQVOOP'gOUOOO([OWO'#CdO,UQUO'#CgO,`QUO'#FjO-vQbO'#CxO.XQUO'#CxO0WQUO'#KaO0_QUO'#CwO0jOpO'#DvO0rQ!dO'#D]OOQR'#JP'#JPO5[QVO'#GUO5iQUO'#JWOOQQ'#JW'#JWO8}QUO'#KtOxQVO'#IbO!(}QVO'#IdO!?SQUO'#IgO!?ZQVO'#IjP!AQO!LQO'#CaP!A]{,UO'#CbP!6q{,UO'#CbP!Ah{7[O'#CbP!6q{,UO'#CbP!Am{,UO'#CbP!AxOSO'#IzPOOO)CEp)CEpOOOO'#I}'#I}O!BSOWO,59OOOQR,59O,59OO!(}QVO,59VOOQQ,59X,59XOOQR'#Do'#DoO!(}QVO,5;ROOQR,5qOOQR'#IX'#IXOOQR'#IY'#IYOOQR'#IZ'#IZOOQR'#I['#I[O!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!D^QVO,5>zOOQQ,5?W,5?WO!FPQVO'#CjO!IxQUO'#CzOOQQ,59d,59dOOQQ,59c,59cOOQQ,5<},5<}O!JVQ&lO,5=mO!?SQUO,5?RO!LyQVO,5?UO!MQQbO,59dO!M]QVO'#FYOOQQ,5?P,5?PO!MmQVO,59WO!MtO`O,5:bO!MyQbO'#D^O!N[QbO'#KeO!NjQ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x#y#z#{#|#}$P$W$Y$[$g$h$m%_%o&S&Y&d&h&z&{'O'Q'R'e'l'm'|(c(e(l)q)w*m*n*q*w*{+]+_+m+o+p,U,W,s,v,|-d-e-h-n.W.X.]/U/X/d/k/t/v/{/}1T1i1j1t1x2S2U2k2n2q3P3U3X3s4Y4]4b4k5d5o5{6i6m6p6r6t7O7Q7V7l7t7w8o8q8w8}9O9]9a9g9i9v9y9z:V:Y:`:b:g:l:pS%bf0p#d%lgnp|#O$i%O%P%U%f%j%k%y&u'w'x(T*_*e*g*y+b,q,{-f-w.O.m.t.v0e1R1S1W1[2g2r5k6q;b;c;d;j;k;l;y;z;{;| MacroName LineComment BlockComment PreprocDirective #include String EscapeSequence SystemLibString Identifier ) ( ArgumentList ConditionalExpression AssignmentExpression CallExpression PrimitiveType FieldExpression FieldIdentifier DestructorName TemplateMethod ScopedFieldIdentifier NamespaceIdentifier TemplateType TypeIdentifier ScopedTypeIdentifier ScopedNamespaceIdentifier :: NamespaceIdentifier TypeIdentifier TemplateArgumentList < TypeDescriptor const volatile restrict _Atomic mutable constexpr constinit consteval StructSpecifier struct MsDeclspecModifier __declspec Attribute AttributeName Identifier AttributeArgs { } [ ] UpdateOp ArithOp ArithOp ArithOp LogicOp BitOp BitOp BitOp CompareOp CompareOp CompareOp > CompareOp BitOp UpdateOp , Number CharLiteral AttributeArgs VirtualSpecifier BaseClassClause Access virtual FieldDeclarationList FieldDeclaration extern static register inline thread_local AttributeSpecifier __attribute__ PointerDeclarator MsBasedModifier __based MsPointerModifier FunctionDeclarator ParameterList ParameterDeclaration PointerDeclarator FunctionDeclarator Noexcept noexcept RequiresClause requires True False ParenthesizedExpression CommaExpression LambdaExpression LambdaCaptureSpecifier TemplateParameterList OptionalParameterDeclaration TypeParameterDeclaration typename class VariadicParameterDeclaration VariadicDeclarator ReferenceDeclarator OptionalTypeParameterDeclaration VariadicTypeParameterDeclaration TemplateTemplateParameterDeclaration template AbstractFunctionDeclarator AbstractPointerDeclarator AbstractArrayDeclarator AbstractParenthesizedDeclarator AbstractReferenceDeclarator ThrowSpecifier throw TrailingReturnType CompoundStatement FunctionDefinition MsCallModifier TryStatement try CatchClause catch LinkageSpecification Declaration InitDeclarator InitializerList InitializerPair SubscriptDesignator FieldDesignator ExportDeclaration export ImportDeclaration import ModuleName PartitionName HeaderName CaseStatement case default LabeledStatement StatementIdentifier ExpressionStatement IfStatement if ConditionClause Declaration else SwitchStatement switch DoStatement do while WhileStatement ForStatement for ReturnStatement return BreakStatement break ContinueStatement continue GotoStatement goto CoReturnStatement co_return CoYieldStatement co_yield AttributeStatement ForRangeLoop AliasDeclaration using TypeDefinition typedef PointerDeclarator FunctionDeclarator ArrayDeclarator ParenthesizedDeclarator ThrowStatement NamespaceDefinition namespace ScopedIdentifier Identifier OperatorName operator ArithOp BitOp CompareOp LogicOp new delete co_await ConceptDefinition concept UsingDeclaration enum StaticAssertDeclaration static_assert ConcatenatedString TemplateDeclaration FriendDeclaration friend union FunctionDefinition ExplicitFunctionSpecifier explicit FieldInitializerList FieldInitializer DefaultMethodClause DeleteMethodClause FunctionDefinition OperatorCast operator TemplateInstantiation FunctionDefinition FunctionDefinition Declaration ModuleDeclaration module RequiresExpression RequirementList SimpleRequirement TypeRequirement CompoundRequirement ReturnTypeRequirement ConstraintConjuction LogicOp ConstraintDisjunction LogicOp ArrayDeclarator ParenthesizedDeclarator ReferenceDeclarator TemplateFunction OperatorName StructuredBindingDeclarator ArrayDeclarator ParenthesizedDeclarator ReferenceDeclarator BitfieldClause FunctionDefinition FunctionDefinition Declaration FunctionDefinition Declaration AccessSpecifier UnionSpecifier ClassSpecifier EnumSpecifier SizedTypeSpecifier TypeSize EnumeratorList Enumerator DependentType Decltype decltype auto PlaceholderTypeSpecifier ParameterPackExpansion ParameterPackExpansion FieldIdentifier PointerExpression SubscriptExpression BinaryExpression ArithOp LogicOp LogicOp BitOp UnaryExpression LogicOp BitOp UpdateExpression CastExpression SizeofExpression sizeof CoAwaitExpression CompoundLiteralExpression NULL NewExpression new NewDeclarator DeleteExpression delete ParameterPackExpansion nullptr this UserDefinedLiteral ParamPack #define PreprocArg #if #ifdef #ifndef #else #endif #elif PreprocDirectiveName Macro Program",maxTerm:433,nodeProps:[["group",-35,1,8,11,15,16,17,19,71,72,100,101,102,104,191,208,229,242,243,270,271,272,277,280,281,282,284,285,286,287,290,292,293,294,295,296,"Expression",-13,18,25,26,27,43,255,256,257,258,262,263,265,266,"Type",-19,126,129,147,150,152,153,158,160,163,164,166,168,170,172,174,176,178,179,188,"Statement"],["isolate",-4,4,5,8,10,""],["openedBy",12,"(",52,"{",54,"["],["closedBy",13,")",51,"}",53,"]"]],propSources:[k],skippedNodes:[0,3,4,5,6,7,10,297,298,299,300,301,302,303,304,305,306,308,349,350],repeatNodeCount:43,tokenData:"&AbMfR!UOX$eXY/]YZ5gZ]$e]^1g^p$epq/]qr5}rs8Zst:Ttu$euv!AWvw!Cbwx!Eqxy!Flyz!Gmz{!Hn{|!Iw|}!LX}!O!MY!O!P# m!P!Q#8a!Q!R#@T!R![$'k![!]$@f!]!^$Bn!^!_$Co!_!`%C`!`!a%Dg!a!b%HP!b!c$e!c!n%IQ!n!o%Jl!o!w%IQ!w!x%Jl!x!}%IQ!}#O%Mx#O#P& }#P#Q&3[#Q#R&5a#R#S%IQ#S#T$e#T#i%IQ#i#j&6j#j#o%IQ#o#p&8[#p#q&9]#q#r&;o#r#s&|#Y#o;x#o;'S$e;'S;=`/V<%lO$eGz?Xe)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#Y;x#Y#Z@j#Z#o;x#o;'S$e;'S;=`/V<%lO$eGz@ue)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#];x#]#^BW#^#o;x#o;'S$e;'S;=`/V<%l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#O#P'b#P#R$e#R#S&?z#S#T$e#T#o&?z#o;'S$e;'S;=`/V<%lO$e,t&>ie)d`(wS'f,UOX$eXY&>`Zp$epq&>`qr$ers%dsw$ewx*mx!P$e!P!Q-V!Q!c$e!c!}&?z!}#O$e#O#P'b#P#R$e#R#S&?z#S#T$e#T#o&?z#o;'S$e;'S;=`/V<%lO$e,t&@Vc)d`(wSeY'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![&?z![!c$e!c!}&?z!}#O$e#O#P'b#P#R$e#R#S&?z#S#T$e#T#o&?z#o;'S$e;'S;=`/V<%lO$e",tokenizers:[f,g,1,2,3,4,5,6,7,8,9,10,new o("j~RQYZXz{^~^O(s~~aP!P!Qd~iO(t~~",25,356)],topRules:{Program:[0,307]},dynamicPrecedences:{17:1,65:1,87:1,94:1,119:1,184:1,187:-10,240:-10,241:1,244:-1,246:-10,247:1,262:-1,267:2,268:2,306:-10,371:3,425:1,426:3,427:1,428:1},specialized:[{term:362,get:O=>u[O]||-1},{term:33,get:O=>G[O]||-1},{term:66,get:O=>y[O]||-1},{term:369,get:O=>E[O]||-1}],tokenPrec:24852}),F=m.define({name:"cpp",parser:C.configure({props:[d.add({IfStatement:a({except:/^\s*({|else\b)/}),TryStatement:a({except:/^\s*({|catch)\b/}),LabeledStatement:Y,CaseStatement:O=>O.baseIndent+O.unit,BlockComment:()=>null,CompoundStatement:w({closing:"}"}),Statement:a({except:/^{/})}),n.add({"DeclarationList CompoundStatement EnumeratorList FieldDeclarationList InitializerList":V,BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\})$/,closeBrackets:{stringPrefixes:["L","u","U","u8","LR","UR","uR","u8R","R"]}}});function J(){return new s(F)}export{J as cpp,F as cppLanguage}; +import{L as t,E as Z,a as o}from"./index-Bf0-KgBD.js";import{J as S,Q as e,g as s,L as m,z as d,v as Y,r as a,u as w,x as n,w as V}from"./FileExplorer-BmPzqkbb.js";import"./useI18n-D4u8zssu.js";import"./index-zrZBIArQ.js";import"./prefsSync-Dj3wNxrO.js";import"./client-n-fLEpOg.js";import"./Switch-BlSJOKEO.js";import"./auth-BBmiA1GG.js";const P=1,l=2,q=3,T=82,z=76,_=117,h=85,c=97,j=122,b=65,p=90,v=95,i=48,U=34,R=40,r=41,W=32,x=62,f=new Z(O=>{if(O.next==z||O.next==h?O.advance():O.next==_&&(O.advance(),O.next==i+8&&O.advance()),O.next!=T||(O.advance(),O.next!=U))return;O.advance();let Q="";for(;O.next!=R;){if(O.next==W||O.next<=13||O.next==r)return;Q+=String.fromCharCode(O.next),O.advance()}for(O.advance();;){if(O.next<0)return O.acceptToken(P);if(O.next==r){let $=!0;for(let X=0;$&&X{if(O.next==x)O.peek(1)==x&&O.acceptToken(l,1);else{let Q=!1,$=0;for(;;$++){if(O.next>=b&&O.next<=p)Q=!0;else{if(O.next>=c&&O.next<=j)return;if(O.next!=v&&!(O.next>=i&&O.next<=i+9))break}O.advance()}Q&&$>1&&O.acceptToken(q)}},{extend:!0}),k=S({"typedef struct union enum class typename decltype auto template operator friend noexcept namespace using requires concept import export module __attribute__ __declspec __based":e.definitionKeyword,"extern MsCallModifier MsPointerModifier extern static register thread_local inline const volatile restrict _Atomic mutable constexpr constinit consteval virtual explicit VirtualSpecifier Access":e.modifier,"if else switch for while do case default return break continue goto throw try catch":e.controlKeyword,"co_return co_yield co_await":e.controlKeyword,"new sizeof delete static_assert":e.operatorKeyword,"NULL nullptr":e.null,this:e.self,"True False":e.bool,"TypeSize PrimitiveType":e.standard(e.typeName),TypeIdentifier:e.typeName,FieldIdentifier:e.propertyName,"CallExpression/FieldExpression/FieldIdentifier":e.function(e.propertyName),"ModuleName/Identifier":e.namespace,PartitionName:e.labelName,StatementIdentifier:e.labelName,"Identifier DestructorName":e.variableName,"CallExpression/Identifier":e.function(e.variableName),"CallExpression/ScopedIdentifier/Identifier":e.function(e.variableName),"FunctionDeclarator/Identifier FunctionDeclarator/DestructorName":e.function(e.definition(e.variableName)),NamespaceIdentifier:e.namespace,OperatorName:e.operator,ArithOp:e.arithmeticOperator,LogicOp:e.logicOperator,BitOp:e.bitwiseOperator,CompareOp:e.compareOperator,AssignOp:e.definitionOperator,UpdateOp:e.updateOperator,LineComment:e.lineComment,BlockComment:e.blockComment,Number:e.number,String:e.string,"RawString SystemLibString":e.special(e.string),CharLiteral:e.character,EscapeSequence:e.escape,"UserDefinedLiteral/Identifier":e.literal,PreprocArg:e.meta,"PreprocDirectiveName #include #ifdef #ifndef #if #define #else #endif #elif":e.processingInstruction,MacroName:e.special(e.name),"( )":e.paren,"[ ]":e.squareBracket,"{ }":e.brace,"< >":e.angleBracket,". ->":e.derefOperator,", ;":e.separator}),u={__proto__:null,bool:36,char:36,int:36,float:36,double:36,void:36,size_t:36,ssize_t:36,intptr_t:36,uintptr_t:36,charptr_t:36,int8_t:36,int16_t:36,int32_t:36,int64_t:36,uint8_t:36,uint16_t:36,uint32_t:36,uint64_t:36,char8_t:36,char16_t:36,char32_t:36,char64_t:36,const:70,volatile:72,restrict:74,_Atomic:76,mutable:78,constexpr:80,constinit:82,consteval:84,struct:88,__declspec:92,final:148,override:148,public:152,private:152,protected:152,virtual:154,extern:160,static:162,register:164,inline:166,thread_local:168,__attribute__:172,__based:178,__restrict:180,__uptr:180,__sptr:180,_unaligned:180,__unaligned:180,noexcept:194,requires:198,TRUE:798,true:798,FALSE:800,false:800,typename:218,class:220,template:234,throw:248,__cdecl:256,__clrcall:256,__stdcall:256,__fastcall:256,__thiscall:256,__vectorcall:256,try:260,catch:264,export:282,import:286,case:296,default:298,if:308,else:314,switch:318,do:322,while:324,for:330,return:334,break:338,continue:342,goto:346,co_return:350,co_yield:354,using:362,typedef:366,namespace:380,new:398,delete:400,co_await:402,concept:406,enum:410,static_assert:414,friend:422,union:424,explicit:430,operator:444,module:456,signed:518,unsigned:518,long:518,short:518,decltype:528,auto:530,sizeof:566,NULL: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O9]9a9g9i9v9y9z:V:Y:`:b:g:l:pS%bf0p#d%lgnp|#O$i%O%P%U%f%j%k%y&u'w'x(T*_*e*g*y+b,q,{-f-w.O.m.t.v0e1R1S1W1[2g2r5k6q;b;c;d;j;k;l;y;z;{;| MacroName LineComment BlockComment PreprocDirective #include String EscapeSequence SystemLibString Identifier ) ( ArgumentList ConditionalExpression AssignmentExpression CallExpression PrimitiveType FieldExpression FieldIdentifier DestructorName TemplateMethod ScopedFieldIdentifier NamespaceIdentifier TemplateType TypeIdentifier ScopedTypeIdentifier ScopedNamespaceIdentifier :: NamespaceIdentifier TypeIdentifier TemplateArgumentList < TypeDescriptor const volatile restrict _Atomic mutable constexpr constinit consteval StructSpecifier struct MsDeclspecModifier __declspec Attribute AttributeName Identifier AttributeArgs { } [ ] UpdateOp ArithOp ArithOp ArithOp LogicOp BitOp BitOp BitOp CompareOp CompareOp CompareOp > CompareOp BitOp UpdateOp , Number CharLiteral AttributeArgs VirtualSpecifier BaseClassClause Access virtual FieldDeclarationList FieldDeclaration extern static register inline thread_local AttributeSpecifier __attribute__ PointerDeclarator MsBasedModifier __based MsPointerModifier FunctionDeclarator ParameterList ParameterDeclaration PointerDeclarator FunctionDeclarator Noexcept noexcept RequiresClause requires True False ParenthesizedExpression CommaExpression LambdaExpression LambdaCaptureSpecifier TemplateParameterList OptionalParameterDeclaration TypeParameterDeclaration typename class VariadicParameterDeclaration VariadicDeclarator ReferenceDeclarator OptionalTypeParameterDeclaration VariadicTypeParameterDeclaration TemplateTemplateParameterDeclaration template AbstractFunctionDeclarator AbstractPointerDeclarator AbstractArrayDeclarator AbstractParenthesizedDeclarator AbstractReferenceDeclarator ThrowSpecifier throw TrailingReturnType CompoundStatement FunctionDefinition MsCallModifier TryStatement try CatchClause catch LinkageSpecification Declaration InitDeclarator InitializerList InitializerPair SubscriptDesignator FieldDesignator ExportDeclaration export ImportDeclaration import ModuleName PartitionName HeaderName CaseStatement case default LabeledStatement StatementIdentifier ExpressionStatement IfStatement if ConditionClause Declaration else SwitchStatement switch DoStatement do while WhileStatement ForStatement for ReturnStatement return BreakStatement break ContinueStatement continue GotoStatement goto CoReturnStatement co_return CoYieldStatement co_yield AttributeStatement ForRangeLoop AliasDeclaration using TypeDefinition typedef PointerDeclarator FunctionDeclarator ArrayDeclarator ParenthesizedDeclarator ThrowStatement NamespaceDefinition namespace ScopedIdentifier Identifier OperatorName operator ArithOp BitOp CompareOp LogicOp new delete co_await ConceptDefinition concept UsingDeclaration enum StaticAssertDeclaration static_assert ConcatenatedString TemplateDeclaration FriendDeclaration friend union FunctionDefinition ExplicitFunctionSpecifier explicit FieldInitializerList FieldInitializer DefaultMethodClause DeleteMethodClause FunctionDefinition OperatorCast operator TemplateInstantiation FunctionDefinition FunctionDefinition Declaration ModuleDeclaration module RequiresExpression RequirementList SimpleRequirement TypeRequirement CompoundRequirement ReturnTypeRequirement ConstraintConjuction LogicOp ConstraintDisjunction LogicOp ArrayDeclarator ParenthesizedDeclarator ReferenceDeclarator TemplateFunction OperatorName StructuredBindingDeclarator ArrayDeclarator ParenthesizedDeclarator ReferenceDeclarator BitfieldClause FunctionDefinition FunctionDefinition Declaration FunctionDefinition Declaration AccessSpecifier UnionSpecifier ClassSpecifier EnumSpecifier SizedTypeSpecifier TypeSize EnumeratorList Enumerator DependentType Decltype decltype auto PlaceholderTypeSpecifier ParameterPackExpansion ParameterPackExpansion FieldIdentifier PointerExpression SubscriptExpression BinaryExpression ArithOp LogicOp LogicOp BitOp UnaryExpression LogicOp BitOp UpdateExpression CastExpression SizeofExpression sizeof CoAwaitExpression CompoundLiteralExpression NULL NewExpression new NewDeclarator DeleteExpression delete ParameterPackExpansion nullptr this UserDefinedLiteral ParamPack #define PreprocArg #if #ifdef #ifndef #else #endif #elif PreprocDirectiveName Macro Program",maxTerm:433,nodeProps:[["group",-35,1,8,11,15,16,17,19,71,72,100,101,102,104,191,208,229,242,243,270,271,272,277,280,281,282,284,285,286,287,290,292,293,294,295,296,"Expression",-13,18,25,26,27,43,255,256,257,258,262,263,265,266,"Type",-19,126,129,147,150,152,153,158,160,163,164,166,168,170,172,174,176,178,179,188,"Statement"],["isolate",-4,4,5,8,10,""],["openedBy",12,"(",52,"{",54,"["],["closedBy",13,")",51,"}",53,"]"]],propSources:[k],skippedNodes:[0,3,4,5,6,7,10,297,298,299,300,301,302,303,304,305,306,308,349,350],repeatNodeCount:43,tokenData:"&AbMfR!UOX$eXY/]YZ5gZ]$e]^1g^p$epq/]qr5}rs8Zst:Ttu$euv!AWvw!Cbwx!Eqxy!Flyz!Gmz{!Hn{|!Iw|}!LX}!O!MY!O!P# m!P!Q#8a!Q!R#@T!R![$'k![!]$@f!]!^$Bn!^!_$Co!_!`%C`!`!a%Dg!a!b%HP!b!c$e!c!n%IQ!n!o%Jl!o!w%IQ!w!x%Jl!x!}%IQ!}#O%Mx#O#P& }#P#Q&3[#Q#R&5a#R#S%IQ#S#T$e#T#i%IQ#i#j&6j#j#o%IQ#o#p&8[#p#q&9]#q#r&;o#r#s&|#Y#o;x#o;'S$e;'S;=`/V<%lO$eGz?Xe)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#Y;x#Y#Z@j#Z#o;x#o;'S$e;'S;=`/V<%lO$eGz@ue)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#];x#]#^BW#^#o;x#o;'S$e;'S;=`/V<%lO$eGzBce)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#b;x#b#cCt#c#o;x#o;'S$e;'S;=`/V<%lO$eGzDPe)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x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f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![&?z![!c$e!c!}&?z!}#O$e#O#P'b#P#R$e#R#S&?z#S#T$e#T#o&?z#o;'S$e;'S;=`/V<%lO$e",tokenizers:[f,g,1,2,3,4,5,6,7,8,9,10,new o("j~RQYZXz{^~^O(s~~aP!P!Qd~iO(t~~",25,356)],topRules:{Program:[0,307]},dynamicPrecedences:{17:1,65:1,87:1,94:1,119:1,184:1,187:-10,240:-10,241:1,244:-1,246:-10,247:1,262:-1,267:2,268:2,306:-10,371:3,425:1,426:3,427:1,428:1},specialized:[{term:362,get:O=>u[O]||-1},{term:33,get:O=>G[O]||-1},{term:66,get:O=>y[O]||-1},{term:369,get:O=>E[O]||-1}],tokenPrec:24852}),F=m.define({name:"cpp",parser:C.configure({props:[d.add({IfStatement:a({except:/^\s*({|else\b)/}),TryStatement:a({except:/^\s*({|catch)\b/}),LabeledStatement:Y,CaseStatement:O=>O.baseIndent+O.unit,BlockComment:()=>null,CompoundStatement:w({closing:"}"}),Statement:a({except:/^{/})}),n.add({"DeclarationList CompoundStatement EnumeratorList FieldDeclarationList InitializerList":V,BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\})$/,closeBrackets:{stringPrefixes:["L","u","U","u8","LR","UR","uR","u8R","R"]}}});function J(){return new s(F)}export{J as cpp,F as cppLanguage}; diff --git a/internal/relay/web-dist/assets/index-C5ykaaYB.js b/internal/relay/web-dist/assets/index-HGllhEs0.js similarity index 98% rename from internal/relay/web-dist/assets/index-C5ykaaYB.js rename to internal/relay/web-dist/assets/index-HGllhEs0.js index 4179d5e3..2ea68a00 100644 --- a/internal/relay/web-dist/assets/index-C5ykaaYB.js +++ b/internal/relay/web-dist/assets/index-HGllhEs0.js @@ -1 +1 @@ -import{L as v,E as i,C as _}from"./index-DRFRE0Ca.js";import{J as W,Q as e,g,z as k,x as U,L as x,w as V,r as E}from"./FileExplorer-BumK3wPT.js";import{defineCSSCompletionSource as N}from"./index-gs2Ov3d4.js";import"./useI18n-lwZlSdSx.js";import"./index-Ci2MtInW.js";import"./prefsSync-C5tz9Q-s.js";import"./client-DMh7GjbV.js";import"./Switch-DguIL3dU.js";import"./auth-B3RxKR1W.js";const j=168,X=169,C=170,I=1,D=2,w=3,L=171,F=172,Y=4,z=173,K=5,A=174,T=175,Z=176,s=177,p=6,G=7,B=8,H=9,c=0,R=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],M=58,J=40,m=95,OO=91,l=45,$O=46,f=35,eO=37,u=123,QO=125,d=47,S=42,r=10,q=61,tO=43,aO=38;function o(O){return O>=65&&O<=90||O>=97&&O<=122||O>=161}function y(O){return O>=48&&O<=57}function h(O){let $;return O.next==d&&(($=O.peek(1))==d||$==S)}const nO=new i((O,$)=>{if($.dialectEnabled(c)){let Q;if(O.next<0&&$.canShift(Z))O.acceptToken(Z);else if(((Q=O.peek(-1))==r||Q<0)&&$.canShift(T)){let t=0;for(;O.next!=r&&R.includes(O.next);)O.advance(),t++;O.next==r||h(O)?O.acceptToken(T,-t):t&&O.acceptToken(s)}else if(O.next==r)O.acceptToken(A,1);else if(R.includes(O.next)){for(O.advance();O.next!=r&&R.includes(O.next);)O.advance();O.acceptToken(s)}}else{let Q=0;for(;R.includes(O.next);)O.advance(),Q++;Q&&O.acceptToken(s)}},{contextual:!0}),rO=new i((O,$)=>{if(h(O)){if(O.advance(),$.dialectEnabled(c)){let Q=-1;for(let t=1;;t++){let a=O.peek(-t-1);if(a==r||a<0){Q=t+1;break}else if(!R.includes(a))break}if(Q>-1){let t=O.next==S,a=0;for(O.advance();O.next>=0;)if(O.next==r){O.advance();let n=0;for(;O.next!=r&&R.includes(O.next);)n++,O.advance();if(n=0;)O.advance();O.acceptToken(p)}else{for(O.advance();O.next>=0;){let{next:Q}=O;if(O.advance(),Q==S&&O.next==d){O.advance();break}}O.acceptToken(G)}}}),RO=new i((O,$)=>{(O.next==tO||O.next==q)&&$.dialectEnabled(c)&&O.acceptToken(O.next==q?B:H,1)}),iO=new i((O,$)=>{if(!$.dialectEnabled(c))return;let Q=$.context.depth;if(O.next<0&&Q){O.acceptToken(X);return}if(O.peek(-1)==r){let a=0;for(;O.next!=r&&R.includes(O.next);)O.advance(),a++;a!=Q&&O.next!=r&&!h(O)&&(a{for(let Q=!1,t=0,a=0;;a++){let{next:n}=O;if(o(n)||n==l||n==m||Q&&y(n))!Q&&(n!=l||a>0)&&(Q=!0),t===a&&n==l&&t++,O.advance();else if(n==f&&O.peek(1)==u){O.acceptToken(K,2);break}else{Q&&O.acceptToken(t==2&&$.canShift(Y)?Y:$.canShift(z)?z:n==J?L:F);break}}}),lO=new i(O=>{if(O.next==QO){for(O.advance();o(O.next)||O.next==l||O.next==m||y(O.next);)O.advance();O.next==f&&O.peek(1)==u?O.acceptToken(D,2):O.acceptToken(I)}}),dO=new i(O=>{if(R.includes(O.peek(-1))){let{next:$}=O;(o($)||$==m||$==f||$==$O||$==OO||$==M&&o(O.peek(1))||$==l||$==aO||$==S)&&O.acceptToken(C)}}),SO=new i(O=>{if(!R.includes(O.peek(-1))){let{next:$}=O;if($==eO&&(O.advance(),O.acceptToken(w)),o($)){do O.advance();while(o(O.next)||y(O.next));O.acceptToken(w)}}});function b(O,$){this.parent=O,this.depth=$,this.hash=(O?O.hash+O.hash<<8:0)+$+($<<4)}const cO=new b(null,0),sO=new _({start:cO,shift(O,$,Q,t){return $==j?new b(O,Q.pos-t.pos):$==X?O.parent:O},hash(O){return O.hash}}),XO=W({"AtKeyword import charset namespace keyframes media supports include mixin use forward extend at-root":e.definitionKeyword,"Keyword selector":e.keyword,ControlKeyword:e.controlKeyword,NamespaceName:e.namespace,KeyframeName:e.labelName,KeyframeRangeName:e.operatorKeyword,TagName:e.tagName,"ClassName Suffix":e.className,PseudoClassName:e.constant(e.className),IdName:e.labelName,"FeatureName PropertyName":e.propertyName,AttributeName:e.attributeName,NumberLiteral:e.number,KeywordQuery:e.keyword,UnaryQueryOp:e.operatorKeyword,"CallTag ValueName":e.atom,VariableName:e.variableName,SassVariableName:e.special(e.variableName),Callee:e.operatorKeyword,Unit:e.unit,"UniversalSelector NestingSelector IndentedMixin IndentedInclude":e.definitionOperator,MatchOp:e.compareOperator,"ChildOp SiblingOp, LogicOp":e.logicOperator,BinOp:e.arithmeticOperator,"Important Global Default":e.modifier,Comment:e.blockComment,LineComment:e.lineComment,ColorLiteral:e.color,"ParenthesizedContent StringLiteral":e.string,"InterpolationStart InterpolationContinue InterpolationEnd":e.meta,': "..."':e.punctuation,"PseudoOp #":e.derefOperator,"; ,":e.separator,"( )":e.paren,"[ ]":e.squareBracket,"{ }":e.brace}),PO={__proto__:null,not:62,using:197,as:207,with:211,without:211,hide:225,show:225,if:263,from:269,to:271,through:273,in:279},mO={__proto__:null,url:82,"url-prefix":82,domain:82,regexp:82,lang:104,"nth-child":104,"nth-last-child":104,"nth-of-type":104,"nth-last-of-type":104,dir:104,"host-context":104},fO={__proto__:null,"@import":162,"@include":194,"@mixin":200,"@function":200,"@use":204,"@extend":214,"@at-root":218,"@forward":222,"@media":228,"@charset":232,"@namespace":236,"@keyframes":242,"@supports":254,"@if":258,"@else":260,"@for":266,"@each":276,"@while":282,"@debug":286,"@warn":286,"@error":286,"@return":286},yO={__proto__:null,layer:166,not:184,only:184,selector:190},hO=v.deserialize({version:14,states:"!$WQ`Q+tOOO#fQ+tOOP#mOpOOOOQ#U'#Ch'#ChO#rQ(pO'#CjOOQ#U'#Ci'#CiO%_Q)QO'#GXO%rQ.jO'#CnO&mQ#dO'#D]O'dQ(pO'#CgO'kQ)OO'#D_O'vQ#dO'#DfO'{Q#dO'#DiO(QQ#dO'#DqOOQ#U'#GX'#GXO(VQ(pO'#GXO(^Q(nO'#DuO%rQ.jO'#D}O%rQ.jO'#E`O%rQ.jO'#EcO%rQ.jO'#EeO(cQ)OO'#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ft",nodeNames:"⚠ InterpolationEnd InterpolationContinue Unit VariableName InterpolationStart LineComment Comment IndentedMixin IndentedInclude StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector SuffixedSelector Suffix Interpolation SassVariableName ValueName ) ( ParenthesizedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp LogicOp UnaryExpression LogicOp NamespacedValue . CallExpression Callee ArgList : ... , CallLiteral CallTag ParenthesizedContent ] [ LineNames LineName ClassSelector ClassName PseudoClassSelector :: PseudoClassName PseudoClassName ArgList PseudoClassName ArgList IdSelector # IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp PlaceholderSelector ClassName Block { Declaration PropertyName Map Important Global Default ; } ImportStatement AtKeyword import Layer layer LayerName KeywordQuery FeatureQuery FeatureName BinaryQuery ComparisonQuery CompareOp UnaryQuery LogicOp ParenthesizedQuery SelectorQuery selector IncludeStatement include Keyword MixinStatement mixin UseStatement use Keyword Star Keyword ExtendStatement extend RootStatement at-root ForwardStatement forward Keyword MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports IfStatement ControlKeyword ControlKeyword Keyword ForStatement ControlKeyword Keyword Keyword Keyword EachStatement ControlKeyword Keyword WhileStatement ControlKeyword OutputStatement ControlKeyword AtRule Styles",maxTerm:196,context:sO,nodeProps:[["openedBy",1,"InterpolationStart",5,"InterpolationEnd",21,"(",43,"[",78,"{"],["isolate",-3,6,7,26,""],["closedBy",22,")",44,"]",70,"}"]],propSources:[XO],skippedNodes:[0,6,7,146],repeatNodeCount:21,tokenData:"!$Q~RyOq#rqr$jrs0jst2^tu8{uv;hvw;{wx<^xy={yz>^z{>c{|>||}Co}!ODQ!O!PDo!P!QFY!Q![Fk![!]Gf!]!^Hb!^!_Hs!_!`Is!`!aJ^!a!b#r!b!cKa!c!}#r!}#OMn#O#P#r#P#QNP#Q#RNb#R#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],tokenPrec:3217}),P=x.define({name:"sass",parser:hO.configure({props:[U.add({Block:V,Comment(O,$){return{from:O.from+2,to:$.sliceDoc(O.to-2,O.to)=="*/"?O.to-2:O.to}}}),k.add({Declaration:E()})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*\}$/,wordChars:"$-"}}),wO=P.configure({dialect:"indented",props:[k.add({"Block RuleSet":O=>O.baseIndent+O.unit}),U.add({Block:O=>({from:O.from,to:O.to})})]}),YO=N(O=>O.name=="VariableName"||O.name=="SassVariableName");function uO(O){return new g(O!=null&&O.indented?wO:P,P.data.of({autocomplete:YO}))}export{uO as sass,YO as sassCompletionSource,P as sassLanguage}; +import{L as v,E as i,C as _}from"./index-Bf0-KgBD.js";import{J as W,Q as e,g,z as k,x as U,L as x,w as V,r as E}from"./FileExplorer-BmPzqkbb.js";import{defineCSSCompletionSource as N}from"./index-8SnOqa2v.js";import"./useI18n-D4u8zssu.js";import"./index-zrZBIArQ.js";import"./prefsSync-Dj3wNxrO.js";import"./client-n-fLEpOg.js";import"./Switch-BlSJOKEO.js";import"./auth-BBmiA1GG.js";const j=168,X=169,C=170,I=1,D=2,w=3,L=171,F=172,Y=4,z=173,K=5,A=174,T=175,Z=176,s=177,p=6,G=7,B=8,H=9,c=0,R=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],M=58,J=40,m=95,OO=91,l=45,$O=46,f=35,eO=37,u=123,QO=125,d=47,S=42,r=10,q=61,tO=43,aO=38;function o(O){return O>=65&&O<=90||O>=97&&O<=122||O>=161}function y(O){return O>=48&&O<=57}function h(O){let $;return O.next==d&&(($=O.peek(1))==d||$==S)}const nO=new i((O,$)=>{if($.dialectEnabled(c)){let Q;if(O.next<0&&$.canShift(Z))O.acceptToken(Z);else if(((Q=O.peek(-1))==r||Q<0)&&$.canShift(T)){let t=0;for(;O.next!=r&&R.includes(O.next);)O.advance(),t++;O.next==r||h(O)?O.acceptToken(T,-t):t&&O.acceptToken(s)}else if(O.next==r)O.acceptToken(A,1);else if(R.includes(O.next)){for(O.advance();O.next!=r&&R.includes(O.next);)O.advance();O.acceptToken(s)}}else{let Q=0;for(;R.includes(O.next);)O.advance(),Q++;Q&&O.acceptToken(s)}},{contextual:!0}),rO=new i((O,$)=>{if(h(O)){if(O.advance(),$.dialectEnabled(c)){let Q=-1;for(let t=1;;t++){let a=O.peek(-t-1);if(a==r||a<0){Q=t+1;break}else if(!R.includes(a))break}if(Q>-1){let t=O.next==S,a=0;for(O.advance();O.next>=0;)if(O.next==r){O.advance();let n=0;for(;O.next!=r&&R.includes(O.next);)n++,O.advance();if(n=0;)O.advance();O.acceptToken(p)}else{for(O.advance();O.next>=0;){let{next:Q}=O;if(O.advance(),Q==S&&O.next==d){O.advance();break}}O.acceptToken(G)}}}),RO=new i((O,$)=>{(O.next==tO||O.next==q)&&$.dialectEnabled(c)&&O.acceptToken(O.next==q?B:H,1)}),iO=new i((O,$)=>{if(!$.dialectEnabled(c))return;let Q=$.context.depth;if(O.next<0&&Q){O.acceptToken(X);return}if(O.peek(-1)==r){let a=0;for(;O.next!=r&&R.includes(O.next);)O.advance(),a++;a!=Q&&O.next!=r&&!h(O)&&(a{for(let Q=!1,t=0,a=0;;a++){let{next:n}=O;if(o(n)||n==l||n==m||Q&&y(n))!Q&&(n!=l||a>0)&&(Q=!0),t===a&&n==l&&t++,O.advance();else if(n==f&&O.peek(1)==u){O.acceptToken(K,2);break}else{Q&&O.acceptToken(t==2&&$.canShift(Y)?Y:$.canShift(z)?z:n==J?L:F);break}}}),lO=new i(O=>{if(O.next==QO){for(O.advance();o(O.next)||O.next==l||O.next==m||y(O.next);)O.advance();O.next==f&&O.peek(1)==u?O.acceptToken(D,2):O.acceptToken(I)}}),dO=new i(O=>{if(R.includes(O.peek(-1))){let{next:$}=O;(o($)||$==m||$==f||$==$O||$==OO||$==M&&o(O.peek(1))||$==l||$==aO||$==S)&&O.acceptToken(C)}}),SO=new i(O=>{if(!R.includes(O.peek(-1))){let{next:$}=O;if($==eO&&(O.advance(),O.acceptToken(w)),o($)){do O.advance();while(o(O.next)||y(O.next));O.acceptToken(w)}}});function b(O,$){this.parent=O,this.depth=$,this.hash=(O?O.hash+O.hash<<8:0)+$+($<<4)}const cO=new b(null,0),sO=new _({start:cO,shift(O,$,Q,t){return $==j?new b(O,Q.pos-t.pos):$==X?O.parent:O},hash(O){return O.hash}}),XO=W({"AtKeyword import charset namespace keyframes media supports include mixin use forward extend at-root":e.definitionKeyword,"Keyword selector":e.keyword,ControlKeyword:e.controlKeyword,NamespaceName:e.namespace,KeyframeName:e.labelName,KeyframeRangeName:e.operatorKeyword,TagName:e.tagName,"ClassName Suffix":e.className,PseudoClassName:e.constant(e.className),IdName:e.labelName,"FeatureName PropertyName":e.propertyName,AttributeName:e.attributeName,NumberLiteral:e.number,KeywordQuery:e.keyword,UnaryQueryOp:e.operatorKeyword,"CallTag ValueName":e.atom,VariableName:e.variableName,SassVariableName:e.special(e.variableName),Callee:e.operatorKeyword,Unit:e.unit,"UniversalSelector NestingSelector IndentedMixin IndentedInclude":e.definitionOperator,MatchOp:e.compareOperator,"ChildOp SiblingOp, LogicOp":e.logicOperator,BinOp:e.arithmeticOperator,"Important Global Default":e.modifier,Comment:e.blockComment,LineComment:e.lineComment,ColorLiteral:e.color,"ParenthesizedContent StringLiteral":e.string,"InterpolationStart InterpolationContinue InterpolationEnd":e.meta,': "..."':e.punctuation,"PseudoOp #":e.derefOperator,"; ,":e.separator,"( )":e.paren,"[ ]":e.squareBracket,"{ }":e.brace}),PO={__proto__:null,not:62,using:197,as:207,with:211,without:211,hide:225,show:225,if:263,from:269,to:271,through:273,in:279},mO={__proto__:null,url:82,"url-prefix":82,domain:82,regexp:82,lang:104,"nth-child":104,"nth-last-child":104,"nth-of-type":104,"nth-last-of-type":104,dir:104,"host-context":104},fO={__proto__:null,"@import":162,"@include":194,"@mixin":200,"@function":200,"@use":204,"@extend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aQ!vbQ!wcQ!xdQ#OgQ#WiQ#crQ#guQ#hvS#q!Q$dQ#x!TQ$e!tQ%l#sQ%m#tQ%n#ul%u$O$a%v&Q&j'S'V'^'t(U(Y(^(w)UQ&S$cS&W$e&YQ&g$wQ&{%_Q'O%bQ'X%{Q'f&XQ(`'bQ(h'qQ(t(QR(u(SR%x$OR&R$aR&P$`QzPQ$^!fR%}$_X#ly#j#m%eQ#VhQ#_mQ$h!uR&^$iW#Rhm!u$iQ#^lQ$|#QQ%S#SQ&m%PQ&n%QQ'p&dR(f'oQ%O#QQ'v&kR)R(nQ#apQ$k!vQ$n!xQ$q!zQ$v#OQ%V#WQ%W#YQ%]#_Q%d#hQ&]$hQ&f$uQ&q%XQ'k&^Q'l&_S'm&`&bQ(k'sQ(}(eR)Q(jR&h$wR#ft",nodeNames:"⚠ InterpolationEnd InterpolationContinue Unit VariableName InterpolationStart LineComment Comment IndentedMixin IndentedInclude StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector SuffixedSelector Suffix Interpolation SassVariableName ValueName ) ( ParenthesizedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp LogicOp UnaryExpression LogicOp NamespacedValue . CallExpression Callee ArgList : ... , CallLiteral CallTag ParenthesizedContent ] [ LineNames LineName ClassSelector ClassName PseudoClassSelector :: PseudoClassName PseudoClassName ArgList PseudoClassName ArgList IdSelector # IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp PlaceholderSelector ClassName Block { Declaration PropertyName Map Important Global Default ; } ImportStatement AtKeyword import Layer layer LayerName KeywordQuery FeatureQuery FeatureName BinaryQuery ComparisonQuery CompareOp UnaryQuery LogicOp ParenthesizedQuery SelectorQuery selector IncludeStatement include Keyword MixinStatement mixin UseStatement use Keyword Star Keyword ExtendStatement extend RootStatement at-root ForwardStatement forward Keyword MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports IfStatement ControlKeyword ControlKeyword Keyword ForStatement ControlKeyword Keyword Keyword Keyword EachStatement ControlKeyword Keyword WhileStatement ControlKeyword OutputStatement ControlKeyword AtRule Styles",maxTerm:196,context:sO,nodeProps:[["openedBy",1,"InterpolationStart",5,"InterpolationEnd",21,"(",43,"[",78,"{"],["isolate",-3,6,7,26,""],["closedBy",22,")",44,"]",70,"}"]],propSources:[XO],skippedNodes:[0,6,7,146],repeatNodeCount:21,tokenData:"!$Q~RyOq#rqr$jrs0jst2^tu8{uv;hvw;{wx<^xy={yz>^z{>c{|>||}Co}!ODQ!O!PDo!P!QFY!Q![Fk![!]Gf!]!^Hb!^!_Hs!_!`Is!`!aJ^!a!b#r!b!cKa!c!}#r!}#OMn#O#P#r#P#QNP#Q#RNb#R#T#r#T#UNw#U#c#r#c#d!!Y#d#o#r#o#p!!o#p#qNb#q#r!#Q#r#s!#c#s;'S#r;'S;=`!#z<%lO#rW#uSOy$Rz;'S$R;'S;=`$d<%lO$RW$WSzWOy$Rz;'S$R;'S;=`$d<%lO$RW$gP;=`<%l$RY$m[Oy$Rz!_$R!_!`%c!`#W$R#W#X%v#X#Z$R#Z#[)Z#[#]$R#]#^,V#^;'S$R;'S;=`$d<%lO$RY%jSzWlQOy$Rz;'S$R;'S;=`$d<%lO$RY%{UzWOy$Rz#X$R#X#Y&_#Y;'S$R;'S;=`$d<%lO$RY&dUzWOy$Rz#Y$R#Y#Z&v#Z;'S$R;'S;=`$d<%lO$RY&{UzWOy$Rz#T$R#T#U'_#U;'S$R;'S;=`$d<%lO$RY'dUzWOy$Rz#i$R#i#j'v#j;'S$R;'S;=`$d<%lO$RY'{UzWOy$Rz#`$R#`#a(_#a;'S$R;'S;=`$d<%lO$RY(dUzWOy$Rz#h$R#h#i(v#i;'S$R;'S;=`$d<%lO$RY(}S!nQzWOy$Rz;'S$R;'S;=`$d<%lO$RY)`UzWOy$Rz#`$R#`#a)r#a;'S$R;'S;=`$d<%lO$R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;'S;=`$d<%lO$Rk! cUzWOy$Rz#W$R#W#X! u#X;'S$R;'S;=`$d<%lO$Rk! |SmczWOy$Rz;'S$R;'S;=`$d<%lO$Rk!!]UOy$Rz#f$R#f#g! u#g;'S$R;'S;=`$d<%lO$RZ!!tS!hROy$Rz;'S$R;'S;=`$d<%lO$RZ!#VS!pROy$Rz;'S$R;'S;=`$d<%lO$R]!#hU!dPOy$Rz!_$R!_!`;T!`;'S$R;'S;=`$d<%lO$RW!#}P;=`<%l#r",tokenizers:[iO,dO,lO,SO,oO,nO,rO,RO,0,1,2,3,4],topRules:{StyleSheet:[0,10],Styles:[1,145]},dialects:{indented:0},specialized:[{term:172,get:O=>PO[O]||-1},{term:171,get:O=>mO[O]||-1},{term:80,get:O=>fO[O]||-1},{term:173,get:O=>yO[O]||-1}],tokenPrec:3217}),P=x.define({name:"sass",parser:hO.configure({props:[U.add({Block:V,Comment(O,$){return{from:O.from+2,to:$.sliceDoc(O.to-2,O.to)=="*/"?O.to-2:O.to}}}),k.add({Declaration:E()})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*\}$/,wordChars:"$-"}}),wO=P.configure({dialect:"indented",props:[k.add({"Block RuleSet":O=>O.baseIndent+O.unit}),U.add({Block:O=>({from:O.from,to:O.to})})]}),YO=N(O=>O.name=="VariableName"||O.name=="SassVariableName");function uO(O){return new g(O!=null&&O.indented?wO:P,P.data.of({autocomplete:YO}))}export{uO as sass,YO as sassCompletionSource,P as sassLanguage}; diff --git a/internal/relay/web-dist/assets/index-CidLZrB5.js b/internal/relay/web-dist/assets/index-_4Qee-Ew.js similarity index 99% rename from internal/relay/web-dist/assets/index-CidLZrB5.js rename to internal/relay/web-dist/assets/index-_4Qee-Ew.js index 23e8bc6d..4d48f8ac 100644 --- a/internal/relay/web-dist/assets/index-CidLZrB5.js +++ b/internal/relay/web-dist/assets/index-_4Qee-Ew.js @@ -1 +1 @@ -import{L as o,E as a}from"./index-DRFRE0Ca.js";import{J as Z,Q,g as _,L as q,z as l,r,x as w,w as V}from"./FileExplorer-BumK3wPT.js";import"./useI18n-lwZlSdSx.js";import"./index-Ci2MtInW.js";import"./prefsSync-C5tz9Q-s.js";import"./client-DMh7GjbV.js";import"./Switch-DguIL3dU.js";import"./auth-B3RxKR1W.js";const g=1,R=2,b=3,y=4,T=5,s=98,c=101,p=102,t=114,v=69,X=48,W=46,d=43,f=45,Y=35,z=34,x=124,U=60,h=62;function n(O){return O>=48&&O<=57}function e(O){return n(O)||O==95}const G=new a((O,i)=>{if(n(O.next)){let P=!1;do O.advance();while(e(O.next));if(O.next==W){if(P=!0,O.advance(),n(O.next))do O.advance();while(e(O.next));else if(O.next==W||O.next>127||/\w/.test(String.fromCharCode(O.next)))return}if(O.next==c||O.next==v){if(P=!0,O.advance(),(O.next==d||O.next==f)&&O.advance(),!e(O.next))return;do O.advance();while(e(O.next))}if(O.next==p){let $=O.peek(1);if($==X+3&&O.peek(2)==X+2||$==X+6&&O.peek(2)==X+4)O.advance(3),P=!0;else return}P&&O.acceptToken(T)}else if(O.next==s||O.next==t){if(O.next==s&&O.advance(),O.next!=t)return;O.advance();let P=0;for(;O.next==Y;)P++,O.advance();if(O.next!=z)return;O.advance();O:for(;;){if(O.next<0)return;let $=O.next==z;if(O.advance(),$){for(let S=0;S{O.next==x&&O.acceptToken(g,1)}),u=new a(O=>{O.next==U?O.acceptToken(R,1):O.next==h&&O.acceptToken(b,1)}),k=Z({"const macro_rules struct union enum type fn impl trait let static":Q.definitionKeyword,"mod use crate":Q.moduleKeyword,"pub unsafe async mut extern default move":Q.modifier,"for if else loop while match continue break return await":Q.controlKeyword,"as in ref":Q.operatorKeyword,"where _ crate super dyn":Q.keyword,self:Q.self,String:Q.string,Char:Q.character,RawString:Q.special(Q.string),Boolean:Q.bool,Identifier:Q.variableName,"CallExpression/Identifier":Q.function(Q.variableName),BoundIdentifier:Q.definition(Q.variableName),"FunctionItem/BoundIdentifier":Q.function(Q.definition(Q.variableName)),LoopLabel:Q.labelName,FieldIdentifier:Q.propertyName,"CallExpression/FieldExpression/FieldIdentifier":Q.function(Q.propertyName),Lifetime:Q.special(Q.variableName),ScopeIdentifier:Q.namespace,TypeIdentifier:Q.typeName,"MacroInvocation/Identifier MacroInvocation/ScopedIdentifier/Identifier":Q.macroName,"MacroInvocation/TypeIdentifier MacroInvocation/ScopedIdentifier/TypeIdentifier":Q.macroName,'"!"':Q.macroName,UpdateOp:Q.updateOperator,LineComment:Q.lineComment,BlockComment:Q.blockComment,Integer:Q.integer,Float:Q.float,ArithOp:Q.arithmeticOperator,LogicOp:Q.logicOperator,BitOp:Q.bitwiseOperator,CompareOp:Q.compareOperator,"=":Q.definitionOperator,".. ... => ->":Q.punctuation,"( )":Q.paren,"[ ]":Q.squareBracket,"{ }":Q.brace,". DerefOp":Q.derefOperator,"&":Q.operator,", ; ::":Q.separator,"Attribute/...":Q.meta}),j={__proto__:null,self:28,super:32,crate:34,impl:46,true:72,false:72,pub:88,in:92,const:96,unsafe:104,async:108,move:110,if:114,let:118,ref:142,mut:144,_:198,else:200,match:204,as:248,return:252,await:262,break:270,continue:276,while:312,loop:316,for:320,macro_rules:327,mod:334,extern:342,struct:346,where:364,union:379,enum:382,type:390,default:395,fn:396,trait:412,use:420,static:438,dyn:476},E=o.deserialize({version:14,states:"$2xQ]Q_OOP$wOWOOO&sQWO'#CnO)WQWO'#I`OOQP'#I`'#I`OOQQ'#Ie'#IeO)hO`O'#C}OOQR'#Ih'#IhO)sQWO'#IuOOQO'#Hk'#HkO)xQWO'#DpOOQR'#Iw'#IwO)xQWO'#DpO*ZQWO'#DpOOQO'#Iv'#IvO,SQWO'#J`O,ZQWO'#EiOOQV'#Hp'#HpO,cQYO'#F{OOQV'#El'#ElOOQV'#Em'#EmOOQV'#En'#EnO.YQ_O'#EkO0_Q_O'#EoO2gQWOOO4QQ_O'#FPO7hQWO'#J`OOQV'#FY'#FYO7{Q_O'#F^O:WQ_O'#FaOOQO'#F`'#F`O=sQ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ineComment BlockComment SourceFile ] InnerAttribute ! [ MetaItem self Metavariable super crate Identifier ScopedIdentifier :: QualifiedScope AbstractType impl SelfType MetaType TypeIdentifier ScopedTypeIdentifier ScopeIdentifier TypeArgList TypeBinding = Lifetime String Escape Char Boolean Integer } { Block ; ConstItem Vis pub ( in ) const BoundIdentifier : UnsafeBlock unsafe AsyncBlock async move IfExpression if LetDeclaration let LiteralPattern ArithOp MetaPattern SelfPattern ScopedIdentifier TuplePattern ScopedTypeIdentifier , StructPattern FieldPatternList FieldPattern ref mut FieldIdentifier .. RefPattern SlicePattern CapturedPattern ReferencePattern & MutPattern RangePattern ... OrPattern MacroPattern ParenthesizedTokens TokenBinding Identifier TokenRepetition ArithOp BitOp LogicOp UpdateOp CompareOp -> => ArithOp BracketedTokens BracedTokens _ else MatchExpression match MatchBlock MatchArm Attribute Guard UnaryExpression ArithOp DerefOp LogicOp ReferenceExpression TryExpression BinaryExpression ArithOp ArithOp BitOp BitOp BitOp BitOp LogicOp LogicOp AssignmentExpression TypeCastExpression as ReturnExpression return RangeExpression CallExpression ArgList AwaitExpression await FieldExpression GenericFunction BreakExpression break LoopLabel ContinueExpression continue IndexExpression ArrayExpression TupleExpression MacroInvocation UnitExpression ClosureExpression ParamList Parameter Parameter ParenthesizedExpression StructExpression FieldInitializerList ShorthandFieldInitializer FieldInitializer BaseFieldInitializer MatchArm WhileExpression while LoopExpression loop ForExpression for MacroInvocation MacroDefinition macro_rules MacroRule EmptyStatement ModItem mod DeclarationList AttributeItem ForeignModItem extern StructItem struct TypeParamList ConstrainedTypeParameter TraitBounds HigherRankedTraitBound RemovedTraitBound OptionalTypeParameter ConstParameter WhereClause where LifetimeClause TypeBoundClause FieldDeclarationList FieldDeclaration OrderedFieldDeclarationList UnionItem union EnumItem enum EnumVariantList EnumVariant TypeItem type FunctionItem default fn ParamList Parameter SelfParameter VariadicParameter VariadicParameter ImplItem TraitItem trait AssociatedType LetDeclaration UseDeclaration use ScopedIdentifier UseAsClause ScopedIdentifier UseList ScopedUseList UseWildcard ExternCrateDeclaration StaticItem static ExpressionStatement ExpressionStatement GenericType FunctionType ForLifetimes ParamList VariadicParameter Parameter VariadicParameter Parameter ReferenceType PointerType TupleType UnitType ArrayType MacroInvocation EmptyType DynamicType dyn BoundedType",maxTerm:359,nodeProps:[["isolate",-4,4,6,7,33,""],["group",-42,4,5,14,15,16,17,18,19,33,35,36,37,40,51,53,56,101,107,111,112,113,122,123,125,127,128,130,132,133,134,137,139,140,141,142,143,144,148,149,155,157,159,"Expression",-16,22,24,25,26,27,222,223,230,231,232,233,234,235,236,237,239,"Type",-20,42,161,162,165,166,169,170,172,188,190,194,196,204,205,207,208,209,217,218,220,"Statement",-17,49,60,62,63,64,65,68,74,75,76,77,78,80,81,83,84,99,"Pattern"],["openedBy",9,"[",38,"{",47,"("],["closedBy",12,"]",39,"}",45,")"]],propSources:[k],skippedNodes:[0,6,7,240],repeatNodeCount:32,tokenData:"$%h_R!XOX$nXY5gYZ6iZ]$n]^5g^p$npq5gqr7Xrs9cst:Rtu;Tuv>vvwAQwxCbxy!+Tyz!,Vz{!-X{|!/_|}!0g}!O!1i!O!P!3v!P!Q!8[!Q!R!Bw!R![!Dr![!]#+q!]!^#-{!^!_#.}!_!`#1b!`!a#3o!a!b#6S!b!c#7U!c!}#8W!}#O#:T#O#P#;V#P#Q#Cb#Q#R#Dd#R#S#8W#S#T$n#T#U#8W#U#V#El#V#f#8W#f#g#Ic#g#o#8W#o#p$ S#p#q$!U#q#r$$f#r${$n${$|#8W$|4w$n4w5b#8W5b5i$n5i6S#8W6S;'S$n;'S;=`4s<%lO$nU$u]'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$nU%uV'_Q'OSOz&[z{&v{!P&[!P!Q'x!Q;'S&[;'S;=`*s<%lO&[S&aV'OSOz&[z{&v{!P&[!P!Q'x!Q;'S&[;'S;=`*s<%lO&[S&yVOz'`z{&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$n!P!Q,z!Q![#8W![!c$n!c!}#8W!}#O$n#O#P&[#P#R$n#R#S#8W#S#T$n#T#o#8W#o${$n${$|#8W$|4w$n4w5b#8W5b5i$n5i6S#8W6S;'S$n;'S;=`4s<%lO$nV#Kji'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q!c$n!c!}#MX!}#O$n#O#P&[#P#R$n#R#S#MX#S#T$n#T#o#MX#o${$n${$|#MX$|4w$n4w5b#MX5b5i$n5i6S#MX6S;'S$n;'S;=`4s<%lO$nV#Mbj'_Q'OS'TPOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q![#MX![!c$n!c!}#MX!}#O$n#O#P&[#P#R$n#R#S#MX#S#T$n#T#o#MX#o${$n${$|#MX$|4w$n4w5b#MX5b5i$n5i6S#MX6S;'S$n;'S;=`4s<%lO$n_$ ]]wX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_$!_a'rX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q!_$n!_!`@O!`#O$n#O#P&[#P#p$n#p#q$#d#q;'S$n;'S;=`4s<%lO$n_$#m]'|X'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_$$o]vX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n",tokenizers:[m,u,G,0,1,2,3],topRules:{SourceFile:[0,8]},specialized:[{term:281,get:O=>j[O]||-1}],tokenPrec:15596}),I=q.define({name:"rust",parser:E.configure({props:[l.add({IfExpression:r({except:/^\s*({|else\b)/}),"String BlockComment":()=>null,AttributeItem:O=>O.continue(),"Statement MatchArm":r()}),w.add(O=>{if(/(Block|edTokens|List)$/.test(O.name))return V;if(O.name=="BlockComment")return i=>({from:i.from+2,to:i.to-2})})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:\{|\})$/,closeBrackets:{stringPrefixes:["b","r","br"]}}});function K(){return new _(I)}export{K as rust,I as rustLanguage}; +import{L as o,E as a}from"./index-Bf0-KgBD.js";import{J as Z,Q,g as _,L as q,z as l,r,x as w,w as V}from"./FileExplorer-BmPzqkbb.js";import"./useI18n-D4u8zssu.js";import"./index-zrZBIArQ.js";import"./prefsSync-Dj3wNxrO.js";import"./client-n-fLEpOg.js";import"./Switch-BlSJOKEO.js";import"./auth-BBmiA1GG.js";const g=1,R=2,b=3,y=4,T=5,s=98,c=101,p=102,t=114,v=69,X=48,W=46,d=43,f=45,Y=35,z=34,x=124,U=60,h=62;function n(O){return O>=48&&O<=57}function e(O){return n(O)||O==95}const G=new a((O,i)=>{if(n(O.next)){let P=!1;do O.advance();while(e(O.next));if(O.next==W){if(P=!0,O.advance(),n(O.next))do O.advance();while(e(O.next));else if(O.next==W||O.next>127||/\w/.test(String.fromCharCode(O.next)))return}if(O.next==c||O.next==v){if(P=!0,O.advance(),(O.next==d||O.next==f)&&O.advance(),!e(O.next))return;do O.advance();while(e(O.next))}if(O.next==p){let $=O.peek(1);if($==X+3&&O.peek(2)==X+2||$==X+6&&O.peek(2)==X+4)O.advance(3),P=!0;else return}P&&O.acceptToken(T)}else if(O.next==s||O.next==t){if(O.next==s&&O.advance(),O.next!=t)return;O.advance();let P=0;for(;O.next==Y;)P++,O.advance();if(O.next!=z)return;O.advance();O:for(;;){if(O.next<0)return;let $=O.next==z;if(O.advance(),$){for(let S=0;S{O.next==x&&O.acceptToken(g,1)}),u=new a(O=>{O.next==U?O.acceptToken(R,1):O.next==h&&O.acceptToken(b,1)}),k=Z({"const macro_rules struct union enum type fn impl trait let static":Q.definitionKeyword,"mod use crate":Q.moduleKeyword,"pub unsafe async mut extern default move":Q.modifier,"for if else loop while match continue break return await":Q.controlKeyword,"as in ref":Q.operatorKeyword,"where _ crate super dyn":Q.keyword,self:Q.self,String:Q.string,Char:Q.character,RawString:Q.special(Q.string),Boolean:Q.bool,Identifier:Q.variableName,"CallExpression/Identifier":Q.function(Q.variableName),BoundIdentifier:Q.definition(Q.variableName),"FunctionItem/BoundIdentifier":Q.function(Q.definition(Q.variableName)),LoopLabel:Q.labelName,FieldIdentifier:Q.propertyName,"CallExpression/FieldExpression/FieldIdentifier":Q.function(Q.propertyName),Lifetime:Q.special(Q.variableName),ScopeIdentifier:Q.namespace,TypeIdentifier:Q.typeName,"MacroInvocation/Identifier MacroInvocation/ScopedIdentifier/Identifier":Q.macroName,"MacroInvocation/TypeIdentifier MacroInvocation/ScopedIdentifier/TypeIdentifier":Q.macroName,'"!"':Q.macroName,UpdateOp:Q.updateOperator,LineComment:Q.lineComment,BlockComment:Q.blockComment,Integer:Q.integer,Float:Q.float,ArithOp:Q.arithmeticOperator,LogicOp:Q.logicOperator,BitOp:Q.bitwiseOperator,CompareOp:Q.compareOperator,"=":Q.definitionOperator,".. ... => ->":Q.punctuation,"( )":Q.paren,"[ ]":Q.squareBracket,"{ }":Q.brace,". DerefOp":Q.derefOperator,"&":Q.operator,", ; ::":Q.separator,"Attribute/...":Q.meta}),j={__proto__:null,self:28,super:32,crate:34,impl:46,true:72,false:72,pub:88,in:92,const:96,unsafe:104,async:108,move:110,if:114,let:118,ref:142,mut:144,_:198,else:200,match:204,as:248,return:252,await:262,break:270,continue:276,while:312,loop:316,for:320,macro_rules:327,mod:334,extern:342,struct:346,where:364,union:379,enum:382,type:390,default:395,fn:396,trait:412,use:420,static:438,dyn:476},E=o.deserialize({version:14,states:"$2xQ]Q_OOP$wOWOOO&sQWO'#CnO)WQWO'#I`OOQP'#I`'#I`OOQQ'#Ie'#IeO)hO`O'#C}OOQR'#Ih'#IhO)sQWO'#IuOOQO'#Hk'#HkO)xQWO'#DpOOQR'#Iw'#IwO)xQWO'#DpO*ZQWO'#DpOOQO'#Iv'#IvO,SQ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`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8gR0k+ZR0j+ZQ'R!qQ)c%XQ+w&|R4y1PX'Q!q%X&|1PR+y&|R+x&|T/S*S4TT/R*S4TR.o)sR.n)sR){%p",nodeNames:"⚠ | < > RawString Float LineComment BlockComment SourceFile ] InnerAttribute ! [ MetaItem self Metavariable super crate Identifier ScopedIdentifier :: QualifiedScope AbstractType impl SelfType MetaType TypeIdentifier ScopedTypeIdentifier ScopeIdentifier TypeArgList TypeBinding = Lifetime String Escape Char Boolean Integer } { Block ; ConstItem Vis pub ( in ) const BoundIdentifier : UnsafeBlock unsafe AsyncBlock async move IfExpression if LetDeclaration let LiteralPattern ArithOp MetaPattern SelfPattern ScopedIdentifier TuplePattern ScopedTypeIdentifier , StructPattern FieldPatternList FieldPattern ref mut FieldIdentifier .. RefPattern SlicePattern CapturedPattern ReferencePattern & MutPattern RangePattern ... OrPattern MacroPattern ParenthesizedTokens TokenBinding Identifier TokenRepetition ArithOp BitOp LogicOp UpdateOp CompareOp -> => ArithOp BracketedTokens BracedTokens _ else MatchExpression match MatchBlock MatchArm Attribute Guard UnaryExpression ArithOp DerefOp LogicOp ReferenceExpression TryExpression BinaryExpression ArithOp ArithOp BitOp BitOp BitOp BitOp LogicOp LogicOp AssignmentExpression TypeCastExpression as ReturnExpression return RangeExpression CallExpression ArgList AwaitExpression await FieldExpression GenericFunction BreakExpression break LoopLabel ContinueExpression continue IndexExpression ArrayExpression TupleExpression MacroInvocation UnitExpression ClosureExpression ParamList Parameter Parameter ParenthesizedExpression StructExpression FieldInitializerList ShorthandFieldInitializer FieldInitializer BaseFieldInitializer MatchArm WhileExpression while LoopExpression loop ForExpression for MacroInvocation MacroDefinition macro_rules MacroRule EmptyStatement ModItem mod DeclarationList AttributeItem ForeignModItem extern StructItem struct TypeParamList ConstrainedTypeParameter TraitBounds HigherRankedTraitBound RemovedTraitBound OptionalTypeParameter ConstParameter WhereClause where LifetimeClause TypeBoundClause FieldDeclarationList FieldDeclaration OrderedFieldDeclarationList UnionItem union EnumItem enum EnumVariantList EnumVariant TypeItem type FunctionItem default fn ParamList Parameter SelfParameter VariadicParameter VariadicParameter ImplItem TraitItem trait AssociatedType LetDeclaration UseDeclaration use ScopedIdentifier UseAsClause ScopedIdentifier UseList ScopedUseList UseWildcard ExternCrateDeclaration StaticItem static ExpressionStatement ExpressionStatement GenericType FunctionType ForLifetimes ParamList VariadicParameter Parameter VariadicParameter Parameter ReferenceType PointerType TupleType UnitType ArrayType MacroInvocation EmptyType DynamicType dyn BoundedType",maxTerm:359,nodeProps:[["isolate",-4,4,6,7,33,""],["group",-42,4,5,14,15,16,17,18,19,33,35,36,37,40,51,53,56,101,107,111,112,113,122,123,125,127,128,130,132,133,134,137,139,140,141,142,143,144,148,149,155,157,159,"Expression",-16,22,24,25,26,27,222,223,230,231,232,233,234,235,236,237,239,"Type",-20,42,161,162,165,166,169,170,172,188,190,194,196,204,205,207,208,209,217,218,220,"Statement",-17,49,60,62,63,64,65,68,74,75,76,77,78,80,81,83,84,99,"Pattern"],["openedBy",9,"[",38,"{",47,"("],["closedBy",12,"]",39,"}",45,")"]],propSources:[k],skippedNodes:[0,6,7,240],repeatNodeCount:32,tokenData:"$%h_R!XOX$nXY5gYZ6iZ]$n]^5g^p$npq5gqr7Xrs9cst:Rtu;Tuv>vvwAQwxCbxy!+Tyz!,Vz{!-X{|!/_|}!0g}!O!1i!O!P!3v!P!Q!8[!Q!R!Bw!R![!Dr![!]#+q!]!^#-{!^!_#.}!_!`#1b!`!a#3o!a!b#6S!b!c#7U!c!}#8W!}#O#:T#O#P#;V#P#Q#Cb#Q#R#Dd#R#S#8W#S#T$n#T#U#8W#U#V#El#V#f#8W#f#g#Ic#g#o#8W#o#p$ S#p#q$!U#q#r$$f#r${$n${$|#8W$|4w$n4w5b#8W5b5i$n5i6S#8W6S;'S$n;'S;=`4s<%lO$nU$u]'_Q'OSOY$nYZ%nZ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ile:[0,8]},specialized:[{term:281,get:O=>j[O]||-1}],tokenPrec:15596}),I=q.define({name:"rust",parser:E.configure({props:[l.add({IfExpression:r({except:/^\s*({|else\b)/}),"String BlockComment":()=>null,AttributeItem:O=>O.continue(),"Statement MatchArm":r()}),w.add(O=>{if(/(Block|edTokens|List)$/.test(O.name))return V;if(O.name=="BlockComment")return i=>({from:i.from+2,to:i.to-2})})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:\{|\})$/,closeBrackets:{stringPrefixes:["b","r","br"]}}});function K(){return new _(I)}export{K as rust,I as rustLanguage}; diff --git a/internal/relay/web-dist/assets/index-zrZBIArQ.js b/internal/relay/web-dist/assets/index-zrZBIArQ.js new file mode 100644 index 00000000..4835d7b7 --- /dev/null +++ b/internal/relay/web-dist/assets/index-zrZBIArQ.js @@ -0,0 +1,2116 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FileExplorer-BmPzqkbb.js","assets/useI18n-D4u8zssu.js","assets/FileExplorer-DKo_tolh.css","assets/sessions-BYTwjtj6.js","assets/client-n-fLEpOg.js","assets/auth-BBmiA1GG.js","assets/prefsSync-Dj3wNxrO.js","assets/version-DDxXxorX.js"])))=>i.map(i=>d[i]); +var r0=Object.defineProperty;var o0=(e,t,n)=>t in e?r0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var q=(e,t,n)=>o0(e,typeof t!="symbol"?t+"":t,n);import{bH as F,bf as sh,at as Bg,aR as zt,aM as a0,bF as _a,b9 as Vl,b8 as Hg,c5 as l0,aE as c0,bu as wc,cv as wt,bj as hn,c7 as d0,a7 as W,aL as H,ap as $e,br as Vt,bw as $,ad as O,bl as Gt,ac as Q,aa as _,F as Me,bt as It,bk as nt,bJ as st,ca as w,c3 as T,ak as Pe,ab as Ct,cA as pt,v as kt,ai as et,cz as jn,cy as ct,cr as Et,_ as So,bY as Ng,cs as Ci,T as ya,ah as u0,bG as nu,aD as Ug,bq as h0,bm as Fn,bo as zn,af as ui,cf as en,a as f0,bC as Rn,b as p0,c6 as ut,cj as rh,b4 as Ba,V as iu,bg as fr,bp as v0,bs as zg,aq as vo,bD as Wn,bK as Vg,ae as oh,aK as Nr,bN as nd,cu as Ur,aJ as Sc,bU as Cc,bx as g0,b7 as m0,aZ as ah,w as _0,aY as Co,A as Kg,c8 as Oo,M as su,c as y0,q as wf,ax as b0,U as Sf,a$ as Cf,o as El,bc as w0,b6 as kf,b5 as S0,Q as C0,c4 as lh,b2 as k0,b0 as x0,aX as R0,b1 as Wg,aC as ru,z as T0,aP as E0,y as P0,x as L0,bM as ch,H as Re,K as tt,G as Ke,d as Un,cb as bn,cl as Ht,av as D0,ce as rs,ag as Mt,cm as Bn,bI as Cs,s as xi,a1 as I0,L as We,O as xn,bS as qi,e as kc,S as $i,bQ as Jt,ci as Rs,aV as M0,aH as go,J as A0,bA as $0,cw as Yi,aB as ci,bb as xf,u as jg,$ as O0,r as F0,ch as Qn,P as rt,ar as qg,a2 as B0,R as kn,N as H0,a0 as Rf,t as N0,f as U0,aW as z0,c2 as Bt,b_ as Ks,aF as Ha,aw as Yg,ba as V0,cc as _r,aO as oo,aT as Gg,aU as Xg,l as Jg,Y as K0,bB as Zg,bd as Qg,bn as dh,bW as W0,m as Oi,by as j0,bE as em,c9 as q0,cg as tm,au as Y0,ck as G0,B as yn,aN as X0,as as J0,C as Z0,a8 as Q0,al as ew,bv as xc,bL as tw,an as nw,X as xs,bR as Ri,c0 as nm,c1 as iw,ao as sw,bh as rw,aj as ow,aS as aw,D as lw,bT as cw,W as dw,bz as uw,az as hw,bZ as fw,g as Rc,cx as qt,cd as Fo,aA as im,j as sm,k as sr,bi as Tf,aI as pw,n as vw,am as gw,h as mw,bP as rm,cq as om,cn as ko,co as _w,cp as ou,bV as am,Z as lm,aQ as yw,bX as Ef,a9 as bw,be as ww}from"./useI18n-D4u8zssu.js";import{PrefsSyncEngine as Sw,localStorageAdapter as Cw,apiRelayClient as kw,setSharedPrefsSync as xw}from"./prefsSync-Dj3wNxrO.js";import{a as gn,A as is}from"./client-n-fLEpOg.js";import{f as cm,g as Rw,a as Wi,N as dm,b as Kl}from"./Switch-BlSJOKEO.js";import{c as Tw,o as Ew,S as Pw,b as Lw,l as Dw}from"./auth-BBmiA1GG.js";/*! + * pinia v3.0.4 + * (c) 2025 Eduardo San Martin Morote + * @license MIT + */let um;const Tc=e=>um=e,hm=Symbol();function au(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var ba;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(ba||(ba={}));function Iw(){const e=Bg(!0),t=e.run(()=>F({}));let n=[],i=[];const s=sh({install(a){Tc(s),s._a=a,a.provide(hm,s),a.config.globalProperties.$pinia=s,i.forEach(d=>n.push(d)),i=[]},use(a){return this._a?n.push(a):i.push(a),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return s}const fm=()=>{};function Pf(e,t,n,i=fm){e.add(t);const s=()=>{e.delete(t)&&i()};return!n&&c0()&&wc(s),s}function eo(e,...t){e.forEach(n=>{n(...t)})}const Mw=e=>e(),Lf=Symbol(),id=Symbol();function lu(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,i)=>e.set(i,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const i=t[n],s=e[n];au(s)&&au(i)&&e.hasOwnProperty(n)&&!Vl(i)&&!Hg(i)?e[n]=lu(s,i):e[n]=i}return e}const Aw=Symbol();function $w(e){return!au(e)||!Object.prototype.hasOwnProperty.call(e,Aw)}const{assign:nr}=Object;function Ow(e){return!!(Vl(e)&&e.effect)}function Fw(e,t,n,i){const{state:s,actions:a,getters:d}=t,r=n.state.value[e];let o;function c(){r||(n.state.value[e]=s?s():{});const h=d0(n.state.value[e]);return nr(h,a,Object.keys(d||{}).reduce((u,v)=>(u[v]=sh(W(()=>{Tc(n);const m=n._s.get(e);return d[v].call(m,m)})),u),{}))}return o=pm(e,c,t,n,i,!0),o}function pm(e,t,n={},i,s,a){let d;const r=nr({actions:{}},n),o={deep:!0};let c,h,u=new Set,v=new Set,m;const b=i.state.value[e];!a&&!b&&(i.state.value[e]={}),F({});let g;function l(S){let P;c=h=!1,typeof S=="function"?(S(i.state.value[e]),P={type:ba.patchFunction,storeId:e,events:m}):(lu(i.state.value[e],S),P={type:ba.patchObject,payload:S,storeId:e,events:m});const A=g=Symbol();hn().then(()=>{g===A&&(c=!0)}),h=!0,eo(u,P,i.state.value[e])}const f=a?function(){const{state:P}=n,A=P?P():{};this.$patch(L=>{nr(L,A)})}:fm;function p(){d.stop(),u.clear(),v.clear(),i._s.delete(e)}const y=(S,P="")=>{if(Lf in S)return S[id]=P,S;const A=function(){Tc(i);const L=Array.from(arguments),x=new Set,D=new Set;function M(Y){x.add(Y)}function B(Y){D.add(Y)}eo(v,{args:L,name:A[id],store:k,after:M,onError:B});let z;try{z=S.apply(this&&this.$id===e?this:k,L)}catch(Y){throw eo(D,Y),Y}return z instanceof Promise?z.then(Y=>(eo(x,Y),Y)).catch(Y=>(eo(D,Y),Promise.reject(Y))):(eo(x,z),z)};return A[Lf]=!0,A[id]=P,A},C={_p:i,$id:e,$onAction:Pf.bind(null,v),$patch:l,$reset:f,$subscribe(S,P={}){const A=Pf(u,S,P.detached,()=>L()),L=d.run(()=>wt(()=>i.state.value[e],x=>{(P.flush==="sync"?h:c)&&S({storeId:e,type:ba.direct,events:m},x)},nr({},o,P)));return A},$dispose:p},k=_a(C);i._s.set(e,k);const I=(i._a&&i._a.runWithContext||Mw)(()=>i._e.run(()=>(d=Bg()).run(()=>t({action:y}))));for(const S in I){const P=I[S];if(Vl(P)&&!Ow(P)||Hg(P))a||(b&&$w(P)&&(Vl(P)?P.value=b[S]:lu(P,b[S])),i.state.value[e][S]=P);else if(typeof P=="function"){const A=y(P,S);I[S]=A,r.actions[S]=P}}return nr(k,I),nr(l0(k),I),Object.defineProperty(k,"$state",{get:()=>i.state.value[e],set:S=>{l(P=>{nr(P,S)})}}),i._p.forEach(S=>{nr(k,d.run(()=>S({store:k,app:i._a,pinia:i,options:r})))}),b&&a&&n.hydrate&&n.hydrate(k.$state,b),c=!0,h=!0,k}/*! #__NO_SIDE_EFFECTS__ */function uh(e,t,n){let i;const s=typeof t=="function";i=s?n:t;function a(d,r){const o=a0();return d=d||(o?zt(hm,null):null),d&&Tc(d),d=um,d._s.has(e)||(s?pm(e,t,i,d):Fw(e,i,d)),d._s.get(e)}return a.$id=e,a}const Bw=64,Hw=1e3,Pl=512,Nw=/pass|token|key|secret|cred|auth/i;let Fs=[],mo=null,ao=0,sd=!1,oa=[];function vm(){var e,t,n;return typeof window<"u"&&typeof((n=(t=(e=window.go)==null?void 0:e.main)==null?void 0:t.App)==null?void 0:n.AppendFrontendLogs)=="function"}function Uw(e){if(!e)return"";const t=[];for(const[n,i]of Object.entries(e)){if(i===void 0)continue;const s=Nw.test(n)?"***":String(i);t.push(`${n}=${JSON.stringify(s)}`)}return t.length?" "+t.join(" "):""}function zw(e){switch(e){case"ERROR":return console.error;case"WARN":return console.warn;case"DEBUG":return console.debug;default:return console.info}}function Vw(e,t,n){if(Fs.push({timestamp_ms:Date.now(),level:e,tag:t,message:n}),Fs.length>Pl&&(ao+=Fs.length-Pl,Fs=Fs.slice(-Pl)),e==="ERROR"||Fs.length>=Bw){Wl();return}Kw()}function Kw(){mo===null&&(mo=setTimeout(()=>{mo=null,Wl()},Hw))}async function Wl(){if(mo!==null&&(clearTimeout(mo),mo=null),sd)return;if(!vm()){Fs=[],oa=[],ao=0;return}const e=oa.concat(Fs);if(oa=[],Fs=[],ao>0&&(e.push({timestamp_ms:Date.now(),level:"WARN",tag:"log",message:`dropped ${ao} log record(s): renderer buffer overflow`}),ao=0),e.length!==0){sd=!0;try{await window.go.main.App.AppendFrontendLogs(e)}catch{oa.length===0?oa=e.slice(-Pl):ao+=e.length}finally{sd=!1}}}function Ec(e,t,n,i){const s=n+Uw(i);vm()||zw(e)(`[${t}] ${s}`),Vw(e,t,s)}function ss(e,t,n){Ec("DEBUG",e,t,n)}function Ww(e,t,n){Ec("INFO",e,t,n)}function Pt(e,t,n){Ec("WARN",e,t,n)}function Gi(e,t,n){Ec("ERROR",e,t,n)}function xt(e){if(e instanceof Error)return`${e.name}: ${e.message}`;if(typeof e=="string")return e;try{return String(e)}catch{return"unknown error"}}function jw(){typeof window>"u"||(window.addEventListener("beforeunload",()=>void Wl()),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Wl()}))}/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qw=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Df=e=>e==="";/** + * @license lucide-vue-next v1.0.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=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const If=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + * @license lucide-vue-next v1.0.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=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase());/** + * @license lucide-vue-next v1.0.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=e=>{const t=Gw(e);return t.charAt(0).toUpperCase()+t.slice(1)};/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var aa={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Jw=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":i,strokeWidth:s,"stroke-width":a,size:d=aa.width,color:r=aa.stroke,...o},{slots:c})=>H("svg",{...aa,...o,width:d,height:d,stroke:r,"stroke-width":Df(n)||Df(i)||n===!0||i===!0?Number(s||a||aa["stroke-width"])*24/Number(d):s||a||aa["stroke-width"],class:Yw("lucide",o.class,...e?[`lucide-${If(Xw(e))}-icon`,`lucide-${If(e)}`]:["lucide-icon"]),...!c.default&&!qw(o)&&{"aria-hidden":"true"}},[...t.map(h=>H(...h)),...c.default?[c.default()]:[]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pn=(e,t)=>(n,{slots:i,attrs:s})=>H(Jw,{...s,...n,iconNode:t,name:e},i);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ll=pn("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jl=pn("arrow-down-right",[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gm=pn("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zw=pn("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qw=pn("clock-3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const e1=pn("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const t1=pn("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mm=pn("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mf=pn("file-down",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const n1=pn("file-up",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cu=pn("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const i1=pn("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-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cl=pn("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _m=pn("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _o=pn("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-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rd=pn("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const s1=pn("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xs=pn("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ym=pn("radio",[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hh=pn("refresh-cw",[["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-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bm=pn("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const co=pn("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-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const r1=pn("shield-user",[["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:"M6.376 18.91a6 6 0 0 1 11.249.003",key:"hnjrf2"}],["circle",{cx:"12",cy:"11",r:"4",key:"1gt34v"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const o1=pn("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dl=pn("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const a1=pn("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const od=pn("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gs=pn("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const l1=pn("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),c1={common:{language:"Language",system:"System",english:"English",simplifiedChinese:"Simplified Chinese",save:"Save",cancel:"Cancel",close:"Close",refresh:"Refresh",copy:"Copy",paste:"Paste",send:"Send",disconnect:"Disconnect",connect:"Connect",settings:"Settings",loading:"loading...",disabled:"disabled",discard:"discard",stay:"stay",delete:"Delete",retry:"Retry",unknown:"(unknown)",countSessions:"{count} sessions",countSessionsOne:"1 session",minimize:"Minimize",maximize:"Maximize",restore:"Restore",yes:"Yes",no:"No"},app:{authInvalidToken:"Invalid or revoked API token. Generate a new one in web settings.",authUserDisabled:"Account disabled. Contact your relay admin.",sessionIdOwnerMismatch:"Session id collision. Restart the desktop app.",forbidden:"Not authorized to connect to this relay.",openSettings:"Open settings",dismiss:"Dismiss",showPanel:"Show panel",hidePanel:"Hide panel",startingFirstSession:"starting first session...",waitingForSessionSelection:"waiting for session selection...",noShellsFound:"no shells found on this machine",wailsBindingsUnavailable:"Wails bindings unavailable",wailsBindingsNotReady:"Wails bindings not ready",sessionAlreadyInTab:"Session is already open in this tab",paneFull:"pane full - close one first",splitFailed:"split failed: {message}",noActiveSession:"No active session",noEndpoint:"No endpoint",pluginFailedToLoad:'Plugin "{title}" failed to load',startupFailureTitle:"AT Term could not start",startupFailureIntro:"The desktop backend hit a fatal startup error. Your terminal sessions were not started.",startupFailureLogPath:"Log file",startupFailureCopy:"Copy diagnostics",startupFailureCopied:"Startup diagnostics copied"},titlebar:{e2eeOffChip:"Plaintext",e2eeOffTitle:"End-to-end encryption is disabled: this desktop's agent is sending terminal output, session title / cwd / current command, and command-finished notifications to the relay in clear text. Turn it back on in Settings → Remote relay."},terminal:{route:{relay:"Relay",connectingDirect:"Connecting direct",direct:"Direct",current:"Route: {route}",iceState:"ICE: {state}",candidateType:"Candidate: {type}",setupTime:"Setup: {ms} ms",fallbackReason:"Fallback: {reason}",fallback:{accountKeyUnavailable:"E2EE key is locked",signalEndpointUnavailable:"direct signaling is unavailable",webrtcUnavailable:"WebRTC is unavailable in this runtime",timeout:"direct setup timed out",signalingRejected:"signaling was rejected",hostUnavailable:"host direct endpoint is unavailable",iceFailed:"ICE connectivity failed",authenticationFailed:"peer authentication failed",backpressure:"direct channel was congested",protocolError:"direct protocol error",directDisconnected:"direct channel disconnected",preferenceDisabled:"direct connection was disabled",transportError:"direct transport failed"}},connecting:"connecting...",reconnecting:"reconnecting...",ended:"session ended",sessionEndedBanner:"[AT Term] session ended (exit {exitCode})",connectionError:"connection error",remoteHasTakenControl:"remote has taken control",byHost:"by {host}",pressSpaceToTakeBack:"press space to take back",takeControl:"Take control",takeControlQueued:"Relay is reconnecting; takeover is queued",clearBuffer:"clear buffer",search:{placeholder:"Find",next:"Next match",prev:"Previous match",close:"Close search",noResults:"No results"},sendSelection:"send",pickImage:"image",pickFile:"file",emptyPaneHint:"[empty pane - press Cmd+N / Ctrl+N to fill]",remote:"remote",remotePrefix:"[remote] ",shellFallback:"shell",emptyTab:"(empty)",tabDisconnectedSuffix:"(disconnected)",closePaneTitle:"close pane (Cmd+W / Ctrl+W)",dragPaneOut:"drag onto the tab bar for its own tab",detachToTab:"Own tab",alreadyOwnTab:"Session already has its own tab",remoteViewerWatching:"{count} remote viewer(s) watching",relaySettings:"relay settings",adminPanel:"admin panel",newTab:"new tab",starting:"starting...",newTabProfileLabel:"profile for new tabs / splits",useDefaultProfile:"Default profile",layoutVertical:"side-by-side split",layoutHorizontal:"stacked split",layoutGrid2x2:"2x2 grid split",sessionStatusOne:"{count} session",sessionStatusMany:"{count} sessions",uplinkOn:"uplink on",imagePasteRequiresFull:"image paste requires full remote permission",pasteSessionNotWritable:"session is not writable right now",clipboardEmpty:"clipboard has no text or image",clipboardImageTooLarge:"clipboard image is too large",clipboardImageToolsMissing:"install xclip, wl-paste, or xsel to paste images",readOnlySession:"session is read-only",websocketNotOpen:"websocket is not open",imageTooLarge:"image too large: {size} bytes exceeds {limit}",copyFailed:"copy failed",pasteFailed:"paste failed",driverNow:"you are now the driver",viewerNow:"you are now a viewer",preview:{open:"Preview web service",opening:"Opening…",portPrompt:"Enter the loopback port of the web service on the remote desktop (for example 3000)",targetHost:"Remote service loopback address",additionalPort:"Additional service port",pathPrefix:"Path prefix",addMapping:"Add service mapping",removeMapping:"Remove service mapping",invalidPathPrefix:"Additional mappings need distinct path prefixes (for example /api or /ws)",desktopOnly:"Remote Preview is available in the desktop app",requiresConnection:"Wait for the remote session to connect before opening Preview",requiresDriver:"Take control of the remote session before opening Preview",requiresFullPermission:"Remote Preview requires full permission from the host",invalidPort:"Port must be an integer from 1 to 65535",noLongerAllowed:"Preview permission was withdrawn while opening",openFailed:"Could not open remote preview: {error}",terminal:"Terminal",previewPort:"Preview :{port}",switch:"Switch preview",closeThis:"Close this preview",newPreview:"New preview…",reconnecting:"Reconnecting…",frameTitle:"Remote web preview :{port}",openInBrowser:"Open in system browser",copyURL:"Copy preview URL",urlCopied:"Preview URL copied",browserOpenFailed:"Could not open the system browser",copyFailed:"Could not copy the preview URL"},bellNotification:"Bell in {session}",commandFinishedNotification:"Command finished - exit {exitCode} - {elapsed} - {session}",loadingHistoryBytes:"loading history - {bytes}",loadingHistoryProgress:"loading history {pct}% - {bytes} / {total}",contextMenu:{openLink:"Open Link",copyLink:"Copy Link"},resize:"Fit PTY to terminal",link:{openFailed:"Failed to open link",openFailedNoHome:"Cannot resolve ~ (home directory unavailable)"}},sessions:{local:"local",remote:"remote",remoteSessions:"remote sessions",hostIdTitle:"host_id {hostId}",sessionTitle:"session {sessionId}",cancelEsc:"cancel (esc)",endLocalSessionOne:"End {count} local shell session",endLocalSessionMany:"End {count} local shell sessions",detachRemoteSessionOne:"Detach from {count} remote session",detachRemoteSessionMany:"Detach from {count} remote sessions",runningProcessesTerminated:"(running processes will be terminated)",remotePtyKeepsRunning:"(the remote PTY keeps running on its host)",saveWorkFirst:"Save your work first.",quitTitle:"quit AT Term",closingWill:"Closing AT Term will:",quit:"quit",closeSessionTitle:"Close session?",closeSessionBody:'Close "{title}"?',closeSessionManyBody:"Close {count} sessions?",closeAiSessionWarning:"This is an AI session. Confirm the task is finished or the context is saved before closing.",closeRunningSessionWarning:"This session is still running. Closing it may interrupt the active command.",closeLocalTerminateHint:"Local sessions will be ended and running processes will be terminated.",closeRemoteDetachHint:"Remote sessions will be detached from this window; the remote PTY keeps running.",closeSessionConfirm:"Close session",unknownHost:"unknown host",thisMachine:"this machine"},ssh:{tabHosts:"Hosts",tabKeys:"Keys",filterPlaceholder:"Filter hosts…",newHost:"New Host",newKey:"New Key",edit:"Edit",subtitleAuthKey:"key",subtitleAuthPassword:"password",importedHosts:"Imported {count} host(s)",hosts:{emptyTitle:"No saved hosts",emptySub:"Add a host to connect and take it over from any device.",clearTags:"Clear",noMatchTitle:"No hosts match",noMatchSub:"Loosen the filter or clear the selected tags.",menuConnect:"Connect",menuEdit:"Edit Host Details",menuDuplicate:"Duplicate",menuCopySsh:"Copy SSH command",menuRemove:"Remove"},keys:{emptyTitle:"No keys yet",emptySub:"Add a private key here, then reference it from a host.",typeLabel:"Type {type}",genericSubtitle:"SSH key"},proxy:{jumpBadge:"Via {target}",commandBadge:"ProxyCommand",jumpReason:"Connects through jump host {target}. Every hop on the chain must itself be a saved host in atterm — atterm signs in to each one with that host's own credential, and never sends this host's.",commandReason:"Configured with a ProxyCommand ({command}) — atterm never runs that command, so this host cannot be connected directly."},hostKey:{title:"Unknown host key",direct:"Unknown host key. Verify this fingerprint before trusting it:",jumpHop:"This fingerprint belongs to {name}, hop {hop} on the route to {target} — it is not {target} itself. Check it against {name} before trusting it:",targetHop:"This fingerprint belongs to {target}, the host you asked to connect (reached as hop {hop}). Verify it before trusting it:",chainNote:"Each machine on the route is asked about separately; accepting this one accepts nothing else.",accept:"Accept & Connect",reject:"Cancel"},hostDrawer:{titleNew:"New Host",titleEdit:"Edit Host",address:"Address",addressPlaceholder:"IP or hostname",label:"Label",labelPlaceholder:"optional",port:"Port",tags:"Tags",tagsPlaceholder:"comma separated",removeTag:"Remove {tag}",username:"Username",usernamePlaceholder:"user",authPassword:"Password",authKey:"Key",identityFileLabel:"From ~/.ssh/config",identityFileHint:"Import this key under Keys, then select it below.",password:"Password",keepBlank:"(leave blank to keep)",keyPicker:"Key",keyPickerAria:"SSH key",noKeys:"No keys yet.",addKey:"Add a key",submitNew:"Add Host"},keyDrawer:{titleNew:"New Key",titleEdit:"Edit Key",name:"Name",namePlaceholder:"e.g. aws",pem:"Private key (PEM)",keepBlank:"(leave blank to keep)",passphrase:"Passphrase",encryptedHint:"This key is encrypted — enter its passphrase above.",dropzone:"Drag and drop a private key file to import",importFromFile:"Import from key file",submitNew:"Add Key",reveal:"Show the stored private key",hide:"Hide",copy:"Copy the private key"},startup:{sectionTitle:"Startup command",sectionHint:"For a bastion that shows a menu instead of a shell. Each line is typed and followed by Enter, one per prompt — for JumpServer that is the asset at Opt>, then the system user at ID>.",placeholder:"one answer per line",delay:"Step interval (ms)",steps:"{count} steps will be sent after login."},forwards:{tab:"Tunnels",sectionTitle:"Port forwarding",sectionHint:"Rules are configuration only. Nothing starts until you start it under Tunnels.",add:"Add rule",remove:"Remove this rule",noRules:"No forwarding rules yet.",kindLocal:"Local",kindRemote:"Remote",kindDynamic:"Dynamic",kindLocalHint:"This machine listens; each connection is opened from the SSH host to the target (ssh -L).",kindRemoteHint:"The SSH host listens; each connection it accepts is opened from this machine to the target (ssh -R).",kindDynamicHint:"This machine listens as a SOCKS5 proxy; every connection names its own destination, resolved on the SSH host (ssh -D).",bindAddr:"Bind address",bindPort:"Port",targetHost:"Target host",targetPort:"Target port",label:"Label",labelPlaceholder:"optional",warnLocal:"Binding {addr} instead of 127.0.0.1 puts this forwarded service in front of anyone on the same network, with no SSH credential — they reach it through your machine. This rule syncs to every device you sign in on and binds the same way there.",warnRemote:"Binding {addr} instead of 127.0.0.1 asks the SSH host to accept connections from anyone on the same network as that host, with no SSH credential, and hand them to the target below through your machine. Most sshd configs refuse it unless GatewayPorts is on. This rule syncs to every device you sign in on.",warnDynamic:"Binding {addr} instead of 127.0.0.1 makes this an unauthenticated SOCKS5 open proxy: anyone on the same network can reach everything this SSH host can reach, to any destination they name, using your SSH credential and appearing in the far side's logs as you. This rule syncs to every device you sign in on and binds the same way there.",emptyTitle:"No forwarding rules",emptySub:"Create one here, or add a rule in a host's Port forwarding section.",new:"New tunnel",newNeedsHost:"Save an SSH host first — a tunnel runs over one.",drawerTitleNew:"New tunnel",drawerTitleEdit:"Edit tunnel",hostPicker:"SSH host",hostPickerAria:"SSH host this tunnel runs over",hostPickerHint:"The tunnel runs over this host's connection — the bastion, when the target is behind one. It is saved as one of that host's forwarding rules.",saveAndStart:"Save and start",start:"Start",stop:"Stop",dismiss:"Dismiss",stateIdle:"Not started",stateRunning:"Running",stateStopped:"Stopped",conns:"{count} accepted",dynamicTarget:"SOCKS5 (destination per connection)",proxyBlocked:"Tunnels cannot be started for this host.",refresh:"Refresh"},configImport:{open:"Import from ~/.ssh/config",title:"Import from ~/.ssh/config",loading:"Reading ~/.ssh/config…",emptyTitle:"No importable hosts",emptySub:"No usable Host entries were found in ~/.ssh/config.",importableTitle:"Importable hosts ({count})",skippedTitle:"Skipped ({count})",overwriteBadge:"Updates existing",overwriteTitle:"A saved host already uses this label — importing updates it in place",proxyBadge:"{label} — not directly connectable",importing:"Importing…",confirm:"Import selected hosts ({count})"}},settings:{title:"Settings",tabs:{general:"General",relay:"Relay",logging:"Logging",updates:"Updates",plugins:"Plugins",shortcuts:"Shortcuts",devices:"Signed-in devices",receivedFiles:"Received files",mobileProfiles:"Synced profiles",mobileHosts:"SSH hosts"},discardRelayTitle:"Discard unsaved relay changes?",discardRelayBody:"Your edits to relay URL, token, permissions, or insecure mode are not saved yet.",general:{languageLabel:"Language",languageHint:"Use System to follow your device language.",terminalTheme:"terminal theme",terminalThemeHint:"Applies to all terminal panes immediately and is saved as your local desktop preference.",terminalFont:"terminal font",terminalFontHint:"Your choice is placed ahead of the built-in fallback chain; CJK glyphs keep using the bundled families.",terminalFontSize:"font size",terminalLineHeight:"line height",terminalCursorStyle:"cursor style",terminalCursorStyleBlock:"Block",terminalCursorStyleUnderline:"Underline",terminalCursorStyleBar:"Bar",terminalCursorBlink:"blink the cursor",terminalScrollback:"scrollback lines",terminalScrollbackHint:"Roughly {mb} MB per pane at this setting. Every open pane pays it.",notificationsBell:"Show system notifications on terminal bell",notificationsHint:"Only fires when the AT Term window is not focused.",shellIntegration:"Enable shell integration",shellIntegrationHint:"Injects OSC 133 hooks into zsh / bash / fish / pwsh at session start so we can detect when a command finishes. Only affects new sessions.",recoveryEnabled:"Show recovery prompt at launch",recoveryEnabledHint:"Ask before restoring last session's tabs and panes.",defaultShell:"default shell",auto:"Auto",customPath:"Custom path...",defaultShellHint:"Auto chooses a platform default for new local sessions. Pick a detected shell or save a custom shell path if you prefer Git Bash, PowerShell 7, or another terminal program.",customShellPath:"custom shell path",customShellRequired:"custom shell path is required",saveCustom:"save custom",webglRenderer:"Use WebGL terminal renderer",webglHint:"GPU-rasterized rendering keeps light themes free of cell ghosting on dense TUI output. Off by default on Linux because NVIDIA proprietary + X11 + WebKitGTK paint the cursor / last cell a frame late, which surfaces as visible typing lag. Affects new terminal sessions only.",commandNotifyThreshold:"Command-finished notification threshold (seconds)",commandNotifyHint:"Commands shorter than this duration do not produce a notification. Requires shell integration to be enabled.",pushNotifications:{title:"Push notifications",enable:"Enable push notifications",test:"Send test notification",errors:{denied:"Browser denied the notification permission.",disabled:"Push notifications are disabled on the server.",keyFailed:"Could not fetch the push key from the relay.",subscribeFailed:"Browser subscription failed.",subscribeRejected:"The relay rejected the subscription.",generic:"Push notification request failed."}},themes:{classicLabel:"AT Term Classic",classicDescription:"Current black terminal look.",nordLabel:"Nord / Arctic",nordDescription:"Cool low-contrast dark palette.",solarizedDarkLabel:"Solarized Dark",solarizedDarkDescription:"Classic warm low-contrast dark palette.",daylightLabel:"Daylight",daylightDescription:"Light palette for bright environments."}},configio:{title:"Import & export",export:{title:"Export",hint:"Save your preferences, SSH hosts, and session profiles to a JSON file you can move to another machine. Your SSH passwords and private keys are never included in this file.",includeEnvLabel:"Include profile environment variables that aren't set to sync — these can contain API tokens and other secrets",button:"Export…",exporting:"Exporting…",success:"Saved to {path}"},import:{title:"Import",hint:"Choose a previously exported JSON file. Nothing is applied until you confirm. Imported SSH hosts never bring a credential with them: new hosts need a password or key added here afterward, and if an existing host's address changed, its saved credential is cleared for safety and needs to be re-entered too.",pickFile:"Choose file…",fileLabel:"File: {name}",previewing:"Reading file…",fileReadError:"Could not read file",previewError:"Could not read this file: {error}",previewTitle:"Preview — nothing applied yet",changesAdd:"Add",changesReplace:"Replace",changesUnchanged:"Unchanged",noChanges:"Nothing would change.",skippedTitle:"Skipped",apply:"Apply import",applying:"Applying…",applyError:"Import failed: {error}",appliedTitle:"Import applied",appliedSummary:"Applied {count} change(s)."}},relay:{uplink:"Uplink",off:"OFF",on:"ON",connectedAs:"connected as {identity}",notConfigured:"not configured",paused:"paused (config kept)",connecting:"Connecting…",relayInvalid:"Invalid relay address",versionProbeFailed:"Failed to reach relay: {reason}",loginFailedInline:"Login failed: {reason}",credentialsRequired:"Email and password required",hint:"configure a remote atterm-relay so this machine's sessions can be attached from other devices. when no one is attached, no bytes leave this machine.",relayUrl:"relay url",preferDirectConnection:"Prefer direct connection",preferDirectConnectionHint:"After the Relay attaches and restores history, try an encrypted peer-to-peer terminal route. If direct setup fails, the session stays on Relay. This setting applies only to the current device; enabling it on desktop also accepts direct connections from other devices.",scheme:"Relay protocol",email:"Email",password:"Password",passwordShow:"Show password",passwordHide:"Hide password",modeLogin:"Log in",modeRegister:"Register",noAccountPrompt:"Need an account?",haveAccountPrompt:"Have an account?",claimToken:"Claim token (optional)",claimTokenPlaceholder:"claim_…",claimTokenHint:"Paste the token printed by `atterm-relay` bootstrap to claim an admin account. Leave empty for a regular user.",insecureMode:"trust self-signed cert",allowCleartext:"allow cleartext HTTP outside this device",insecureWarning:"Skips TLS certificate verification for this relay, so a relay serving a self-signed certificate is reachable. The connection is still encrypted, but an attacker able to intercept it could impersonate the relay. Enable only for a relay you control (e.g. atterm-relay's self-signed quick-start); prefer a real certificate for anything public.",cleartextWarning:"HTTP has no TLS transport encryption. Use it for a loopback development relay only; non-loopback addresses additionally require the cleartext opt-in above.",disableE2EE:"disable end-to-end encryption (testing / debug only)",disableE2EEWarning:"Session content (terminal output, session title / cwd / current command, command-finished notifications) is sent to the relay without end-to-end sealing, so the relay server itself can read it. Transport TLS (if enabled) still applies. Your account key stays loaded — only outbound sealing is paused. The title bar keeps a ⚠ Plaintext indicator while this is on.",saving:"saving...",saveConnect:"save & connect",clearTitle:"Clear relay info",clearHint:"Removes the saved relay address, account, and login info from this device. Open terminals are not affected.",clearAction:"Clear",clearing:"Clearing…",clearConfirm:"Clear all relay info saved on this device?",clearFailed:"Clear failed: {reason}",pairing:{title:"Mobile pairing",hint:"Generate a single-use QR code so a phone can attach to this relay without copy-pasting tokens.",generate:"Generate QR",generating:"generating...",regenerate:"Regenerate",expiresIn:"expires in",expired:"expired - generate a new code",wrappedBadge:"includes E2EE key",unwrappedWarning:"E2EE key is locked — mobile will connect but sealed session details won't decrypt. Log in with email + password in the Relay settings above to unlock."}},logging:{title:"desktop logs",noContent:"no log file content is available yet.",truncated:"showing the most recent portion of the log file.",writeLogs:"write logs to file",currentFile:"current log file",changeLocation:"change location",resetDefault:"reset default",viewLogs:"view logs",liveTail:"Live tail (auto-refreshes every 3s)",levelFilter:"Show",tagFilter:"Subsystem",tagFilterAll:"All",writeLevel:"Log level",writeLevelHint:"Minimum severity written to the file. DEBUG adds per-frame and per-keystroke tracing — useful when reproducing a problem, noisy otherwise.",ptyInputDebug:"Log terminal input bytes",ptyInputDebugHint:"Diagnose stuck or dropped input. Recorded regardless of the log level above.",tailPaused:"Paused",tailPausedHint:"Following paused while scrolled up — click or scroll to the bottom to resume"},updates:{devDisabled:"development build - auto-update disabled",checking:"checking...",readyToInstall:"{version} downloaded - ready to install",downloadingStatus:"downloading {version} ({pct}%)",available:"{version} available",upToDate:"up to date - last checked {ago}",notChecked:"not checked yet",justNow:"just now",minutesAgo:"{count} min ago",hoursAgo:"{count} h ago",daysAgo:"{count} d ago",currentVersion:"current version",status:"status",downloadPath:"download path",autoCheck:"automatically check for updates",ghProxy:"GitHub download proxy",proxyHint:"Optional. Only GitHub Release file downloads use this proxy; update checks and signature verification stay unchanged.",releaseNotes:"release notes",checkNow:"check now",versionLine:"{minor} line",downloadVersion:"download {version}",cancelDownload:"Cancel ({pct}%)",cancelling:"Cancelling…",redownload:"Redownload",redownloadPrompt:"{version} is already downloaded on this device. Redownload?",forceInstallRestart:"force install & restart",installTitle:"install AT Term {version}",installIntro:"AT Term will quit and relaunch on the new version.",installThisWill:" This will:",forceInstall:"force install",installRestart:"install & restart"},plugins:{hint:"Plugins are loaded on demand. Disabled plugins do not affect startup time or memory.",panelDragHint:"Panel width and inner ratio are adjusted by dragging in the panel. View options live in the file tree's context menu.",noneRegistered:"No plugins registered."},shortcuts:{keyboardShortcuts:"Keyboard Shortcuts",pane:"Pane",tab:"Tab",sidebar:"Sidebar",pressKey:"Press a key...",resetTo:"Reset to {binding}",conflictsWith:"Conflicts with: {labels}",resetAll:"Reset all to defaults",splitPaneVertically:"Split pane vertically",splitPaneHorizontally:"Split pane horizontally",closePane:"Close pane",focusPaneLeft:"Focus pane left",focusPaneRight:"Focus pane right",focusPaneUp:"Focus pane up",focusPaneDown:"Focus pane down",newTab:"New tab",previousTab:"Previous tab",nextTab:"Next tab",focusSidebarSearch:"Focus sidebar search",terminalSearch:"Search terminal"},diagnostics:{tab:"Diagnostics",section:"Diagnostics snapshot",hint:"Snapshot of the desktop runtime, with API tokens and headers redacted. Useful for bug reports.",copy:"Copy",export:"Export…",refresh:"Refresh",copied:"Copied to clipboard.",copyFailed:"Copy failed.",exported:"Saved to {path}"},feishu:{title:"Feishu Integration",disabled:"Feishu integration is not active.",relay_disabled:"The server (relay) has Feishu integration turned off.",load_error:"Couldn't fetch Feishu status: {error}",retry_status:"Retry",mode:{label:"Mode",options:{auto:"Auto (follow Relay login)",local:"Force Local (local LongConn)",relay:"Force Relay (depend on Relay)"},effective:{label:"Effective mode",fallbackWarn:"Relay requested but not effectively logged in"}},bound:"Bound to open_id: {open_id}",save:"Save Credentials",begin_pair:"Start Pair",pair_hint:'Send "/bind {code}" to the bot in private chat within 15 minutes.',delete:"Delete Binding",configured:"Credentials saved",app_id_label:"App ID",callback_label:"Event callback URL",callback_hint_relay:'In Feishu "Event Subscriptions", choose "Send events to developer server" and paste the URL above.',longconn_hint_local:'Local long-connection mode: in Feishu "Event Subscriptions", choose "Receive events via long connection" — no callback URL needed.',copy:"Copy",copied:"Copied",reconfigure:"Re-enter credentials",aiOnlyNotifications:"Notify for AI sessions only",remoteTerminal:{enable:"Enable Feishu remote terminal",autoAttachLabel:"Auto-attach sessions",autoAttach:{ai:"AI sessions only",all:"All sessions",none:"Never (manual attach)"}},hook_install:{enable:"Auto-install Claude Code hook",retry:"Retry",healthy:"Hook installed and healthy",needs_attention:"Hook needs attention",disabled:"Hook auto-install disabled"},test_send:{title:"Test send",hint:"Send a sample card to your bound Feishu account to verify the notification path works.",command_success:"Command finished (success)",command_failure:"Command finished (failure)",command_sealed:"Command finished (this device only)",waiting_input:"Waiting for input",sending:"Sending…",sent:"Sent — check Feishu",failed:"Send failed: {error}"}},templates:{tab:"Templates",intro:"Each template sends its text to the active session when clicked.",add:"Add template",label:"Label",text:"Send text",hotkey:"Hotkey (e.g. Alt+1)",showBar:"Show template bar above the terminal",save:"Save",edit:"Edit",delete:"Delete",reset:"Reset to defaults",resetConfirm:"Replace your list with the defaults?"},profiles:{tab:"Session profiles",intro:"A profile is a named launch configuration for new tabs and splits: shell, working directory, startup command, and environment variables.",precedenceHint:"New session order: an explicitly picked profile wins, then the default profile below, then falls back to General → default shell + your home directory. default shell is not replaced by profiles — it's what runs when no profile applies.",envPrivacyIntro:`Environment variables stay on this machine by default and are never synced. Turn on "sync these environment variables" per profile to send that profile's env, end-to-end encrypted, to your other devices.`,empty:"No profiles yet.",add:"Add profile",edit:"Edit",delete:"Delete",save:"Save",name:"Name",shellPlaceholder:"Shell path (leave blank to use default shell)",cwdPlaceholder:"Working directory (leave blank to use home)",shellUnset:"default shell",cwdUnset:"home directory",startupCmdPlaceholder:"Startup command (optional)",startupCmdHint:"Runs once the shell's first prompt appears, same as AI-session resume — not sent as raw keystrokes.",envPlaceholder:"KEY=value, one per line",envHint:"TERM is always protected: a profile can never override it, to keep terminal rendering correct.",syncEnv:"Sync these environment variables to my other devices",syncEnvOffHint:"Off (default): these environment variables stay on this machine only and are stripped before anything is synced. Every other field (name, shell, cwd, startup command) still syncs.",syncEnvOnHint:"On: these environment variables travel encrypted to your other signed-in devices, end-to-end sealed so the relay cannot read them.",setDefault:"Set as default",clearDefault:"Unset default",defaultBadge:"Default",nameRequired:"Name is required."},mobileSync:{locked:"Waiting for your account key — make sure you're signed in.",noData:"Nothing has synced from a desktop yet.",error:"Couldn't read the synced data: {error}"},mobileProfiles:{intro:"Profiles synced from your desktop, for reference only. Edit them on the machine that runs them.",empty:"Your desktop has no session profiles configured.",defaultBadge:"Default",shell:"Shell",cwd:"Working directory",startupCmd:"Startup command",env:"Environment",envNone:"None",envNotSynced:"Not synced from that machine",hostLabel:"Open on",noHosts:"No desktop found. Open a session on a desktop from this account first, so this phone can find it.",openButton:"Open",opening:"Opening…",openErrors:{unknown_profile:"That profile no longer exists on the desktop.",permission_denied:"That desktop is published read-only — it cannot start new sessions from a phone.",request_in_flight:"A session is already being created. Wait for it to finish before trying again.",duplicate_request_id:"That request was already sent. Wait for it to finish.",unknown_host_id:"That desktop isn't reachable right now.",invalid_request:"Couldn't send that request. Try again.",upstream_unavailable:"Couldn't reach that desktop. Try again.",session_create_busy:"That desktop is busy right now. Try again in a moment.",timeout:"Timed out waiting for that desktop to respond. It was not retried — check the desktop before trying again.",relay_not_configured:"Sign in to a relay on this phone first.",generic:"Couldn't start a session: {error}"}},mobileHosts:{intro:"SSH hosts synced from your desktop, for reference only. This device cannot connect to them.",empty:"Your desktop has no SSH hosts configured.",user:"User",port:"Port",tags:"Tags",note:"Note",jumpChain:"Reaches this host via a jump chain",proxyCommand:"Uses ProxyCommand — not dialable",key:"Key"},devices:{hint:"Devices signed in to this relay account.",refresh:"Refresh",signOutOthers:"Sign out other devices",signingOut:"Signing out…",signOutOthersConfirm:"Sign out every device except this one?",revoke:"Revoke",revoking:"Revoking…",revokeConfirm:"Revoke this device ({ua})?",currentTag:"Current",loginLine:"Signed in {time} · {ip}",timeFormat:"{y}-{m}-{d} {hh}:{mm}",empty:"No signed-in devices yet.",unknownUA:"Unknown device",notAuthenticated:"Log in to your relay account first (Settings → Relay)."},account:{title:"Account",email:"Email",logout:{button:"Log out",submitting:"Logging out..."},traffic:{title:"Traffic usage",period:"Last {days} days (UTC)",range:"Time range",dayUnit:"d",refresh:"Refresh traffic",relay:"Relay",p2p:"P2P direct",kpiTotal:"Total traffic",kpiOutbound:"Outbound",kpiInbound:"Inbound",kpiFrames:"Frames",trendNew:"No prior data",trendFlat:"Flat",p2pTraffic:"Direct traffic",offloadShare:"Offload share",offloadHint:"Share of traffic sent without Relay forwarding",successRate:"Direct success",fallbacks:"Fallbacks",fallbackHint:"Connections that returned to Relay",inOut:"In {incoming} · Out {outgoing}",sentReceived:"Sent {sent} · Received {received}",connectionCounts:"{attempts} attempts · {successes} direct · {fallbacks} fallback",dailyTrend:"Daily Relay and P2P traffic",coreAnalysis:"Core analysis",timelineTitle:"Relay traffic timeline",view:"View",groupTimeline:"Category",frameTimeline:"Frame type",directionTrend:"Direction trend",colDirection:"Direction",metric:"Metric",bytes:"Bytes",frames:"Frames",direction:{all:"All",out:"Outbound",in:"Inbound"},dirOut:"Outbound",dirIn:"Inbound",categorySummary:"Category summary",totalComposition:"Relay traffic composition",outIn:"Out {out} · In {incoming}",frameBreakdown:"Frame type breakdown",topFrames:"Top frame types by traffic",colFrameType:"Frame type",colBytes:"Bytes",colFrames:"Frames",directQuality:"Direct connection quality",aggregateOnly:"Aggregate statistics only",categories:{terminal:"Terminal relay",state:"State sync",config:"Configuration",fs:"File browser",preview:"Remote preview",other:"Other"},empty:"No traffic recorded in this period.",loadFailed:"Could not load traffic.",retry:"Retry"},changePassword:{title:"Change password",oldPassword:"Current password",newPassword:"New password",confirmPassword:"Confirm new password",hintLength:"New password must be at least 8 characters.",hintMismatch:"Passwords do not match.",submit:"Update password",submitting:"Updating…",successToast:"Password updated"},dangerZone:{title:"Danger zone",warning:"Deleting your account is permanent and cannot be undone.",toggle:"Delete account",currentPassword:"Current password",typeEmailToConfirm:"Type your email to confirm",deleteButton:"Delete account",deleting:"Deleting…",confirmPrompt:"This action cannot be undone."},errors:{wrongPassword:"Current password is incorrect.",sessionExpired:"Your session has expired, please log in again.",rateLimited:"Too many attempts, please try again later.",network:"Network error.",generic:"Something went wrong, please try again."}}},mobile:{relayUrl:"Relay URL",email:"Email",password:"Password",passwordShow:"Show password",passwordHide:"Hide password",emailRequired:"Email is required",passwordRequired:"Password is required",invalidCredentials:"Invalid email or password",rateLimited:"Too many attempts, please try again later",loginButton:"Log in",allowInsecure:"Allow insecure HTTP/WS (non-loopback)",originRejected:"Relay rejected the origin. Start the relay with ATTERM_ORIGINS containing capacitor://localhost.",cannotReachRelay:"Cannot reach relay: {message}",relayUrlRequired:"relay URL is required",relayUrlMalformed:"invalid or malformed relay URL",relayUrlProtocol:"relay URL must start with http:// or https://",relayUrlNoPath:"relay URL must not contain a path, query, or fragment",relayUrlInsecure:'enable "Allow insecure HTTP/WS" to use http:// with a non-loopback host',taskSections:{needs_attention:"Needs attention",running:"Running",completed:"Completed",failed:"Failed",disconnected:"Disconnected"},taskStates:{idle:"idle",running:"running",waiting_input:"waiting input",completed:"completed",failed:"failed",disconnected:"disconnected",closed:"closed"},taskTypes:{ai:"AI",test:"Test",build:"Build",deploy:"Deploy"},started:"started",lastOutput:"last output",openBadge:"open",back:"Back",pasteClipboard:"Paste",pasteImage:"Image",pasteConfirm:"Paste",pastePreview:"Clipboard text",protectMode:{banner:"Tap-protect mode · enable Control mode below to type"},settings:{title:"Settings",back:"Back",language:"Language",templates:"Quick templates",auxKeys:"Shortcut keys",logout:"Log out",add:"Add",edit:"Edit",delete:"Delete",reset:"Reset to defaults",resetConfirm:"Replace your list with the defaults?",label:"Label",text:"Send text",seq:"Send bytes (\\r \\n \\t \\e \\xNN ^X)",showBar:"Show template bar above the terminal",save:"Save"},image:{prompt:"Add image",fromLibrary:"Photo Library",takePhoto:"Take Photo"},pairing:{connecting:"Pairing…",failed:"Pairing failed.",back:"Try again",scan:"Scan QR code",cameraDenied:"Camera permission required to scan the QR code.",noQrDetected:"No QR code detected — try again.",scanNotAvailable:"QR scanning is not available in this build — enter the relay URL manually below.",errInvalidUrl:"The QR code does not contain a valid pairing link.",errInvalidScheme:"QR scheme must be https. To pair with http, enable the insecure HTTP/WS toggle on the setup screen and rescan.",errPlatformUnsupported:"This platform does not support QR pairing.",errCannotReachRelay:"Cannot reach the relay. Check the QR address or your network, then try again.",errTimeout:"Pairing timed out after 15s. Confirm the relay is reachable, then try again.",errPairInvalid:"The pairing token is invalid or expired. Generate a new QR.",errCancelled:"Pairing cancelled.",errGeneric:"Pairing failed: {message}",stepParsing:"Parsing QR…",stepRequesting:"Contacting relay…",stepSaving:"Saving config…"},insecure:{warning:{title:"Insecure relay (HTTP)",body:"API tokens and terminal output are transmitted unencrypted. Use HTTPS in production.",dismiss:"Dismiss"}},selection:{copy:"Copy",send:"Send",cancel:"Cancel",copied:"Copied to clipboard",copyFailed:"Copy failed"}},tasks:{bulk:{selectedCount:"{count} selected",mergeTab:"Merge tab",mergeTooMany:"Merge up to 4",close:"Close ({count})",closeHint:"Close {count} open panes",closeNoneOpen:"None of the selected sessions are open in this window",cancel:"Cancel"},details:{title:"Session details",sessionId:"Session ID",type:"Type",host:"Host",cwd:"CWD",command:"Command",state:"State",startedAt:"Started",commandStartedAt:"Cmd started",commandEndedAt:"Cmd ended",commandDuration:"Cmd duration",commandExitCode:"Cmd exit code",unread:"Unread",pinned:"Pinned",paneLocation:"Open in",paneAt:"Tab {tab} · Pane {pane}",paneNone:"Not open in this window"},rowMenu:{details:"Details",merge:"Merge into new tab ({n})",closeSelected:"Close selected ({n})"},sidebar:{title:"Sessions",collapse:"Collapse sidebar (Cmd/Ctrl+B)",expand:"Expand sidebar (Cmd/Ctrl+B)",searchPlaceholder:"Search",openDrawer:"Open sidebar",closeDrawer:"Close sidebar"},preset:{iconOnly:{name:"Icon only",description:"Color + glyph carry the state. Most compact."},iconLabel:{name:"Icon + label",description:"Adds a short status label (Running / Waiting / Done) next to the icon. More explicit."}},pinned:{title:"Pinned",menuPin:"Pin to top",menuUnpin:"Unpin"},search:{empty:'No sessions match "{q}"'},markAllRead:"Mark all read",completedFold:"Completed",unreadBadge:"{count} unread",settings:{section:"Session bar",preset:"Display style",expandByDefault:"Expand session bar by default",groupBy:"Group by",groupByHost:"Host",groupByState:"State"}},plugins:{fileExplorer:{title:"File Explorer",description:"Side panel with file tree and read-only syntax-highlighted preview. Follows the active pane's cwd.",noActivePaneShort:"(no active pane)",noActivePane:"No active pane.",selectFile:"Select a file.",pinCurrentCwd:"Pin current cwd",unpinFollow:"Unpin (follow active pane)",showHidden:"Show hidden files",showLineNumbers:"Show line numbers in editor",searchFiles:"Search files",noSearchResults:"No matching files.",searchTruncated:"Showing first 200 matches.",fileChanged:"File changed on disk",reload:"Reload",tooLarge:"File too large to preview. Open externally.",binary:"Binary file - no preview.",errorPrefix:"Error: {message}",unexpectedContentType:"Unexpected file content type",unknownError:"Preview failed for an unknown reason",openInSystem:"Open in System App",unsupportedPreview:"Inline preview unavailable for this file type.",showAsCode:"View as code",showAsRender:"View as image",save:"Save",dontSave:"Don't Save",cancel:"Cancel",dirty:"Unsaved changes",staleModTime:"File was modified on disk since you opened it.",overwrite:"Overwrite",reloadDiscard:"Reload (discard changes)",confirmCloseTitle:"Save changes to {name}?",newFile:"New File",newFolder:"New Folder",rename:"Rename",delete:"Delete",copyPath:"Copy Path",sendToTerminal:"Send to Terminal",pathCopied:"Path copied",moveToTrash:"Move to Trash",confirmTrash:"Move {name} to Trash?",confirmHardDelete:"Permanently delete {name}? This cannot be undone.",saveFailed:"Save failed: {message}",sourceLabel:"File source",sourceActivePane:"Active pane",listingTruncated:"{path}: the host returned {shown} of {total} entries; the rest were not listed.",sshUpload:"Upload a file to {dir}",sshUploadDone:"Uploaded {name} to {dir}",sshUploadExists:"{path} already exists on the remote host. Nothing was written — there is no trash there, so an overwrite could not be undone. Rename or delete it first.",sshNoOpenExternal:"There is no way to hand a file on an SSH host to this machine's system apps.",sshNoInlineAsset:"This file type cannot be previewed inline from an SSH host.",sshNoRecursiveDelete:"{path} is a directory on an SSH host. Deleting one would remove everything inside it, permanently — there is no trash there and no way to undo it — so the panel does not offer it. Delete it from a terminal on that host instead.",sshBridgeDisposed:"This SSH file source was closed.",treeLoadFailed:"Could not list {path}: {message}",retry:"Try again"},deskWidget:{title:"Desk Widget",description:"A small always-on-top window showing which sessions are running, failed, or waiting for you — AI agents and plain shells alike. Click a row to jump to that tab.",aiOnly:"Only show AI sessions",aiOnlyHint:"Limits the widget to sessions running claude / codex / aider. Off by default: session state comes from OSC 133, so it works for any command."},translate:{title:"Translate",description:"Translate the selected text via an OpenAI-compatible API; result shown in a floating panel.",selection:"Translate selection",notConfigured:"Translate plugin not configured",closePanel:"Close translate panel",source:"Source",detected:"detected {lang}",target:"Target",translating:"Translating...",noResult:"No result yet.",recent:"Recent ({count})",baseUrl:"Base URL",apiKey:"API Key",model:"Model",defaultTargetLanguage:"Default target language",keyStoredPlaintext:"API key is stored plaintext in {path}.",extraParams:"Extra params",extraParamsHint:"JSON object merged into every request body (e.g. stream, top_p, max_tokens). Wins over defaults.",extraParamsInvalid:"Not a valid JSON object.",invalidExtraParams:"invalid extra params: {detail}",simplifiedChinese:"Chinese (Simplified)",targetEnglish:"English",targetJapanese:"Japanese",targetKorean:"Korean",targetGerman:"German",targetFrench:"French",targetSpanish:"Spanish",userCancelled:"user cancelled",requestTimedOut:"request timed out after {seconds}s",authFailed:"auth failed ({status})",rateLimited:"rate limited (429)",serverError:"server error ({status})",providerNonJson:"provider returned non-JSON outer envelope",missingTranslated:"missing translated",responseFormatUnsupported:"response_format unsupported"}},connHealth:{pillLabelConnecting:"connecting…",pillLabelReconnecting:"reconnecting…",pillLabelOff:"off",drawerTitle:"Connection health",drawerRttNow:"RTT (now)",drawerRttP50P95:"p50 / p95 (5 min)",drawerBytesIn:"↓ in",drawerBytesOut:"↑ out",drawerState:"State",drawerReconnectsLastHour:"Reconnects (1 h)",drawerReconnectsTime:"time",drawerReconnectsReason:"reason",drawerReconnectsDowntime:"downtime",drawerSeqGaps:"Seq gaps observed:"},startupUpdate:{title:"Update available",currentToLatest:"{current} → {latest}",releaseNotes:"release notes",statusAvailable:"{version} is available",statusDownloading:"downloading {version} ({pct}%)",statusReady:"{version} downloaded — ready to install",downloadInstall:"Download & install",cancel:"Cancel ({pct}%)",cancelling:"Cancelling…",installRestart:"Install & restart",later:"Later"},recovery:{dialog:{title:"Restore your previous session?",subtitleClean:"Last cleanly exited · {minutes} min ago",subtitleUnclean:"Last session ended unexpectedly · {minutes} min ago",btnRestoreAll:"Restore all {count}",btnRestoreSelected:"Restore {count} selected",btnDiscard:"Discard all",badgeResumable:"resumable",badgeFresh:"fresh (sid not captured)",badgeShell:"(no AI)",badgeUnclassified:"not classified as AI"},pane:{failed:"(failed)"}},snippets:{runOnHosts:"Run on hosts…",selectHosts:"Select hosts",pending:"Pending",running:"Running…",ok:"OK",failed:"Failed",error:"Error",exitCode:"Exit code {code}",truncated:"Output truncated",copyAll:"Copy all",cancel:"Cancel",noHostsSelected:"Select at least one host"},sync:{stateIdle:"Up to date",stateSyncing:"Syncing…",stateOffline:"Not syncing",stateError:"Sync failed",syncNow:"Sync now",lastSyncedNever:"Never synced",lastSyncedAt:"Last synced {time}",pendingKeys:"{count} change(s) waiting to sync",pulledAdopted:"Updated from another device: {keys}",pulledConflict:"Kept this device's version (changed elsewhere too): {keys}",keys:{locale_preference:"Language",quick_templates:"Quick templates",notifications_enabled:"Notifications",ai_notifications_only:"AI-only notifications",command_notify_threshold_seconds:"Command-finished notification threshold",shell_integration_enabled:"Shell integration",pinned_session_ids:"Pinned sessions",ssh_hosts_encrypted:"SSH hosts",terminal_theme:"Terminal theme",terminal_font_head:"Terminal font",terminal_font_size:"Terminal font size",terminal_line_height:"Terminal line height",terminal_cursor_style:"Cursor style",terminal_cursor_blink:"Cursor blink",terminal_scrollback:"Scrollback lines",default_shell:"Default shell",shortcut_bindings:"Keyboard shortcuts",profiles_encrypted:"Session profiles"}}},d1={common:{language:"语言",system:"跟随系统",english:"英语",simplifiedChinese:"简体中文",save:"保存",cancel:"取消",close:"关闭",refresh:"刷新",copy:"复制",paste:"粘贴",send:"发送",disconnect:"断开连接",connect:"连接",settings:"设置",loading:"加载中...",disabled:"已禁用",discard:"放弃",stay:"留在此处",delete:"删除",retry:"重试",unknown:"(未知)",countSessions:"{count} 个会话",countSessionsOne:"1 个会话",minimize:"最小化",maximize:"最大化",restore:"还原",yes:"是",no:"否"},app:{authInvalidToken:"API token 无效或已撤销。请在网页设置中生成新的 token。",authUserDisabled:"账号已禁用。请联系 relay 管理员。",sessionIdOwnerMismatch:"会话 ID 冲突。请重启桌面应用。",forbidden:"无权连接到此 relay。",openSettings:"打开设置",dismiss:"关闭提示",showPanel:"显示面板",hidePanel:"隐藏面板",startingFirstSession:"正在启动第一个会话...",waitingForSessionSelection:"等待会话选择...",noShellsFound:"此机器上找不到 shell",wailsBindingsUnavailable:"Wails 绑定不可用",wailsBindingsNotReady:"Wails 绑定尚未就绪",sessionAlreadyInTab:"该会话已在当前标签页",paneFull:"面板已满 - 请先关闭一个",splitFailed:"分屏失败:{message}",noActiveSession:"没有活动会话",noEndpoint:"没有 endpoint",pluginFailedToLoad:"插件“{title}”加载失败",startupFailureTitle:"AT Term 启动失败",startupFailureIntro:"桌面后端遇到了致命启动错误。终端会话尚未启动。",startupFailureLogPath:"日志文件",startupFailureCopy:"复制诊断信息",startupFailureCopied:"启动诊断信息已复制"},titlebar:{e2eeOffChip:"明文",e2eeOffTitle:"已禁用端到端加密:本机 agent 现在以明文向 relay 发送终端输出、会话标题 / cwd / 当前命令、命令完成通知。在 Settings → Remote relay 关闭即可恢复加密。"},terminal:{route:{relay:"Relay",connectingDirect:"正在建立直连",direct:"直连",current:"当前路径:{route}",iceState:"ICE 状态:{state}",candidateType:"候选类型:{type}",setupTime:"建立耗时:{ms} 毫秒",fallbackReason:"回退原因:{reason}",fallback:{accountKeyUnavailable:"E2EE 密钥未解锁",signalEndpointUnavailable:"直连信令不可用",webrtcUnavailable:"当前运行环境不支持 WebRTC",timeout:"直连建立超时",signalingRejected:"信令被拒绝",hostUnavailable:"主机直连端点不可用",iceFailed:"ICE 连通失败",authenticationFailed:"对端认证失败",backpressure:"直连通道拥塞",protocolError:"直连协议错误",directDisconnected:"直连通道已断开",preferenceDisabled:"直连已关闭",transportError:"直连传输失败"}},connecting:"连接中...",reconnecting:"重新连接中...",ended:"会话已结束",sessionEndedBanner:"[AT Term] 会话已结束(退出码 {exitCode})",connectionError:"连接错误",remoteHasTakenControl:"远端已接管控制",byHost:"来自 {host}",pressSpaceToTakeBack:"按空格取回控制",takeControl:"接管控制",takeControlQueued:"Relay 正在重连,接管请求已排队",clearBuffer:"清空缓冲区",search:{placeholder:"查找",next:"下一个匹配",prev:"上一个匹配",close:"关闭搜索",noResults:"无匹配"},sendSelection:"发送",pickImage:"图片",pickFile:"文件",emptyPaneHint:"[空面板 - 按 Cmd+N / Ctrl+N 填充]",remote:"远端",remotePrefix:"[远端] ",shellFallback:"shell",emptyTab:"(空)",tabDisconnectedSuffix:"(已断开)",closePaneTitle:"关闭面板 (Cmd+W / Ctrl+W)",dragPaneOut:"拖到标签条可独立成标签页",detachToTab:"独立标签页",alreadyOwnTab:"该会话已是独立标签页",remoteViewerWatching:"{count} 个远端查看者正在观看",relaySettings:"relay 设置",adminPanel:"管理面板",newTab:"新建标签页",starting:"启动中...",newTabProfileLabel:"新建标签页 / 分屏用的配置档",useDefaultProfile:"默认配置档",layoutVertical:"左右分屏",layoutHorizontal:"上下分屏",layoutGrid2x2:"2x2 网格分屏",sessionStatusOne:"{count} 个会话",sessionStatusMany:"{count} 个会话",uplinkOn:"uplink 已开启",imagePasteRequiresFull:"粘贴图片需要 full 远端权限",pasteSessionNotWritable:"当前会话暂时不可写入",clipboardEmpty:"剪贴板没有可粘贴的文本或图片",clipboardImageTooLarge:"剪贴板图片过大",clipboardImageToolsMissing:"请安装 xclip、wl-paste 或 xsel 以粘贴图片",readOnlySession:"会话为只读",websocketNotOpen:"websocket 未打开",imageTooLarge:"图片过大:{size} 字节,超过 {limit}",copyFailed:"复制失败",pasteFailed:"粘贴失败",driverNow:"你现在是控制者",viewerNow:"你现在是查看者",preview:{open:"预览 Web 服务",opening:"正在打开…",portPrompt:"输入远端桌面上 Web 服务的 loopback 端口(例如 3000)",targetHost:"远程服务 loopback 地址",additionalPort:"附加服务端口",pathPrefix:"路径前缀",addMapping:"添加服务映射",removeMapping:"移除服务映射",invalidPathPrefix:"附加服务映射必须使用不同的路径前缀(例如 /api、/ws)",desktopOnly:"远程预览仅在桌面客户端可用",requiresConnection:"请等待远程会话连接后再打开预览",requiresDriver:"请先接管远程会话,再打开预览",requiresFullPermission:"远程预览需要主机授予完整权限",invalidPort:"端口必须是 1–65535 的整数",noLongerAllowed:"打开过程中 Preview 权限已失效",openFailed:"无法打开远程预览:{error}",terminal:"终端",previewPort:"预览 :{port}",switch:"切换预览",closeThis:"关闭此预览",newPreview:"新开预览…",reconnecting:"正在重连…",frameTitle:"远程 Web 预览 :{port}",openInBrowser:"在系统浏览器打开",copyURL:"复制预览地址",urlCopied:"预览地址已复制",browserOpenFailed:"无法打开系统浏览器",copyFailed:"复制预览地址失败"},bellNotification:"{session} 中有响铃",commandFinishedNotification:"命令已完成 - 退出码 {exitCode} - {elapsed} - {session}",loadingHistoryBytes:"正在加载历史 - {bytes}",loadingHistoryProgress:"正在加载历史 {pct}% - {bytes} / {total}",contextMenu:{openLink:"打开链接",copyLink:"复制链接"},resize:"适配终端尺寸",link:{openFailed:"无法打开链接",openFailedNoHome:"无法解析 ~(拿不到 home 目录)"}},sessions:{local:"本地",remote:"远端",remoteSessions:"远端会话",hostIdTitle:"host_id {hostId}",sessionTitle:"会话 {sessionId}",cancelEsc:"取消 (esc)",endLocalSessionOne:"结束 {count} 个本地 shell 会话",endLocalSessionMany:"结束 {count} 个本地 shell 会话",detachRemoteSessionOne:"从 {count} 个远端会话分离",detachRemoteSessionMany:"从 {count} 个远端会话分离",runningProcessesTerminated:"(运行中的进程将被终止)",remotePtyKeepsRunning:"(远端 PTY 会继续在其主机上运行)",saveWorkFirst:"请先保存你的工作。",quitTitle:"退出 AT Term",closingWill:"关闭 AT Term 将会:",quit:"退出",closeSessionTitle:"关闭会话?",closeSessionBody:"确认关闭「{title}」?",closeSessionManyBody:"确认关闭 {count} 个会话?",closeAiSessionWarning:"这是 AI 会话,关闭前请确认任务已经结束或已保存需要的上下文。",closeRunningSessionWarning:"这是运行中的会话,关闭可能中断正在执行的命令。",closeLocalTerminateHint:"本地会话会被结束,运行中的进程将被终止。",closeRemoteDetachHint:"远端会话会从当前窗口分离,远端 PTY 会继续运行。",closeSessionConfirm:"确认关闭",unknownHost:"未知主机",thisMachine:"本机"},ssh:{tabHosts:"主机",tabKeys:"密钥",filterPlaceholder:"筛选主机…",newHost:"新建主机",newKey:"新建密钥",edit:"编辑",subtitleAuthKey:"密钥",subtitleAuthPassword:"密码",importedHosts:"已导入 {count} 台主机",hosts:{emptyTitle:"还没有保存的主机",emptySub:"添加一台主机后就能连接它,并在任意设备上接管这个会话。",clearTags:"清除",noMatchTitle:"没有匹配的主机",noMatchSub:"放宽筛选条件,或清除已选中的标签。",menuConnect:"连接",menuEdit:"编辑主机信息",menuDuplicate:"复制一份",menuCopySsh:"复制 SSH 命令",menuRemove:"移除"},keys:{emptyTitle:"还没有密钥",emptySub:"先在这里添加私钥,再在主机里引用它。",typeLabel:"类型 {type}",genericSubtitle:"SSH 密钥"},proxy:{jumpBadge:"经 {target}",commandBadge:"ProxyCommand",jumpReason:"经跳板机 {target} 连接。链路上每一跳都必须是 atterm 里已保存的主机——atterm 用那台主机自己的凭据登录它,绝不会把这台主机的凭据发过去。",commandReason:"配置了 ProxyCommand({command}):atterm 不会执行这条命令,所以这台主机不能直接连。"},hostKey:{title:"未知的主机密钥",direct:"未知的主机密钥。信任之前请先核对这个指纹:",jumpHop:"这个指纹属于 {name},是通往 {target} 途中的第 {hop} 跳,不是 {target} 本身。请对着 {name} 核对之后再信任:",targetHop:"这个指纹属于 {target},也就是你要连的那台主机(在链路上是第 {hop} 跳)。核对之后再信任:",chainNote:"链路上每台机器都会单独询问一次;接受这一台不代表接受其它任何一台。",accept:"接受并连接",reject:"取消"},hostDrawer:{titleNew:"新建主机",titleEdit:"编辑主机",address:"地址",addressPlaceholder:"IP 或主机名",label:"别名",labelPlaceholder:"可不填",port:"端口",tags:"标签",tagsPlaceholder:"用逗号分隔",removeTag:"移除 {tag}",username:"用户名",usernamePlaceholder:"user",authPassword:"密码",authKey:"密钥",identityFileLabel:"来自 ~/.ssh/config",identityFileHint:"先到「密钥」里导入这个私钥,再回来在下面选中它。",password:"密码",keepBlank:"(留空表示不修改)",keyPicker:"密钥",keyPickerAria:"SSH 密钥",noKeys:"还没有密钥。",addKey:"添加密钥",submitNew:"添加主机"},keyDrawer:{titleNew:"新建密钥",titleEdit:"编辑密钥",name:"名称",namePlaceholder:"例如 aws",pem:"私钥(PEM)",keepBlank:"(留空表示不修改)",passphrase:"口令",encryptedHint:"这个私钥是加密的,请在上面填写它的口令。",dropzone:"把私钥文件拖到这里导入",importFromFile:"从密钥文件导入",submitNew:"添加密钥",reveal:"查看已保存的私钥",hide:"隐藏",copy:"复制私钥"},startup:{sectionTitle:"启动命令",sectionHint:"给那些登录后先给一个菜单、而不是直接给 shell 的堡垒机用。每行会依次输入并回车,一行对应一个提示符——JumpServer 就是先在 Opt> 选资产,再在 ID> 选系统用户。",placeholder:"一行一个回答",delay:"步骤间隔(毫秒)",steps:"登录后会依次发送 {count} 步。"},forwards:{tab:"隧道",sectionTitle:"端口转发",sectionHint:"规则只是配置,要到「隧道」里手动启动才会生效。",add:"添加规则",remove:"删除这条规则",noRules:"还没有转发规则。",kindLocal:"本地",kindRemote:"远程",kindDynamic:"动态",kindLocalHint:"本机监听,每条连接由 SSH 主机去连目标(ssh -L)。",kindRemoteHint:"SSH 主机监听,它收到的每条连接由本机去连目标(ssh -R)。",kindDynamicHint:"本机以 SOCKS5 代理监听,每条连接自带目标地址,由 SSH 主机解析(ssh -D)。",bindAddr:"监听地址",bindPort:"端口",targetHost:"目标主机",targetPort:"目标端口",label:"备注",labelPlaceholder:"可不填",warnLocal:"监听 {addr} 而不是 127.0.0.1,意味着同网段的任何人都能经由你这台机器访问这个被转发的服务,不需要任何 SSH 凭据。这条规则会同步到你登录的每台设备,在那些设备上也这样监听。",warnRemote:"监听 {addr} 而不是 127.0.0.1,意味着 SSH 主机会接受同网段任何人的连接(不需要任何 SSH 凭据),并经由你这台机器转给下面的目标。远端 sshd 默认的 GatewayPorts 通常会拒绝这种绑定。这条规则会同步到你登录的每台设备。",warnDynamic:"监听 {addr} 而不是 127.0.0.1,会让它变成一个无认证的 SOCKS5 开放代理:同网段的任何人都能访问这台 SSH 主机能访问的一切,目标由调用方自己指定,用的是你的 SSH 凭据,在对端日志里显示成你。这条规则会同步到你登录的每台设备,在那些设备上也这样监听。",emptyTitle:"还没有转发规则",emptySub:"可以直接在这里新建,也可以在某台主机的「端口转发」里添加。",new:"新建隧道",newNeedsHost:"先保存一台 SSH 主机——隧道要跑在主机的连接上。",drawerTitleNew:"新建隧道",drawerTitleEdit:"编辑隧道",hostPicker:"SSH 主机",hostPickerAria:"这条隧道所走的 SSH 主机",hostPickerHint:"隧道走这台主机的连接——目标在跳板机后面时,这里选的就是跳板机。它会保存成这台主机的一条转发规则。",saveAndStart:"保存并启动",start:"启动",stop:"停止",dismiss:"清除",stateIdle:"未启动",stateRunning:"运行中",stateStopped:"已停止",conns:"已接受 {count} 条",dynamicTarget:"SOCKS5(目标由每条连接指定)",proxyBlocked:"这台主机不能启动隧道。",refresh:"刷新"},configImport:{open:"从 ~/.ssh/config 导入",title:"从 ~/.ssh/config 导入",loading:"正在读取 ~/.ssh/config…",emptyTitle:"没有可导入的主机",emptySub:"在 ~/.ssh/config 里没有找到可用的 Host 条目。",importableTitle:"可导入的主机({count})",skippedTitle:"已跳过({count})",overwriteBadge:"更新已有",overwriteTitle:"已保存的主机里已经有这个别名,导入会就地更新它",proxyBadge:"{label} · 不能直接连接",importing:"导入中…",confirm:"导入选中的主机({count})"}},settings:{title:"设置",tabs:{general:"通用",relay:"Relay",logging:"日志",updates:"更新",plugins:"插件",shortcuts:"快捷键",devices:"已登录设备",receivedFiles:"接收文件",mobileProfiles:"同步的配置",mobileHosts:"SSH 主机"},discardRelayTitle:"放弃未保存的 relay 更改?",discardRelayBody:"你对 relay URL、token、权限或 insecure mode 的编辑尚未保存。",general:{languageLabel:"语言",languageHint:"选择跟随系统时,会使用设备语言。",terminalTheme:"终端主题",terminalThemeHint:"立即应用到所有终端面板,并保存为本地桌面偏好。",terminalFont:"终端字体",terminalFontHint:"所选字体会排在内置回退链之前;中日韩字符仍由内置字体族渲染。",terminalFontSize:"字号",terminalLineHeight:"行高",terminalCursorStyle:"光标样式",terminalCursorStyleBlock:"方块",terminalCursorStyleUnderline:"下划线",terminalCursorStyleBar:"竖线",terminalCursorBlink:"光标闪烁",terminalScrollback:"回滚行数",terminalScrollbackHint:"当前设置下每个 pane 约占 {mb} MB,开几个就是几份。",notificationsBell:"终端响铃时显示系统通知",notificationsHint:"仅在 AT Term 窗口未聚焦时触发。",shellIntegration:"启用 shell 集成",shellIntegrationHint:"在会话启动时向 zsh / bash / fish / pwsh 注入 OSC 133 hooks,用于检测命令何时完成。仅影响新会话。",recoveryEnabled:"启动时检测并提示恢复上次会话",recoveryEnabledHint:"在启动时询问是否恢复上次的标签页和分屏。",defaultShell:"默认 shell",auto:"自动",customPath:"自定义路径...",defaultShellHint:"自动为新本地会话选择平台默认 shell。也可以选择检测到的 shell,或保存自定义 shell 路径,例如 Git Bash、PowerShell 7 或其他终端程序。",customShellPath:"自定义 shell 路径",customShellRequired:"必须填写自定义 shell 路径",saveCustom:"保存自定义项",webglRenderer:"使用 WebGL 终端渲染器",webglHint:"GPU 光栅化渲染可避免浅色主题在密集 TUI 输出中出现单元格残影。Linux 默认关闭,因为 NVIDIA 专有驱动 + X11 + WebKitGTK 会让光标/最后一个单元格晚一帧绘制,表现为可见输入延迟。仅影响新终端会话。",commandNotifyThreshold:"命令完成通知阈值(秒)",commandNotifyHint:"短于此时长的命令不会产生通知。需要启用 shell 集成。",pushNotifications:{title:"推送通知",enable:"启用推送通知",test:"发送测试通知",errors:{denied:"浏览器拒绝了通知权限。",disabled:"服务器已禁用推送通知。",keyFailed:"无法从 relay 获取推送密钥。",subscribeFailed:"浏览器订阅失败。",subscribeRejected:"relay 拒绝了此订阅。",generic:"推送通知请求失败。"}},themes:{classicLabel:"AT Term 经典",classicDescription:"当前的黑色终端外观。",nordLabel:"Nord / Arctic",nordDescription:"冷色低对比度深色调色板。",solarizedDarkLabel:"Solarized Dark",solarizedDarkDescription:"经典暖色低对比度深色调色板。",daylightLabel:"Daylight",daylightDescription:"适合明亮环境的浅色调色板。"}},configio:{title:"导入与导出",export:{title:"导出",hint:"将偏好设置、SSH 主机和会话配置导出为 JSON 文件,可拷贝到另一台设备上使用。文件中不会包含你的 SSH 密码或私钥。",includeEnvLabel:"包含未设置同步的会话配置环境变量(可能含有 API token 等敏感信息)",button:"导出…",exporting:"导出中…",success:"已保存到 {path}"},import:{title:"导入",hint:"选择之前导出的 JSON 文件。确认前不会应用任何更改。导入的 SSH 主机不会带来凭据:新增的主机需要之后在这里补充密码或私钥;如果某个已有主机的地址发生了变化,其已保存的凭据会为安全起见被清除,同样需要重新填写。",pickFile:"选择文件…",fileLabel:"文件:{name}",previewing:"正在读取文件…",fileReadError:"无法读取文件",previewError:"无法读取该文件:{error}",previewTitle:"预览 — 尚未应用",changesAdd:"新增",changesReplace:"替换",changesUnchanged:"无变化",noChanges:"没有需要变更的内容。",skippedTitle:"已跳过",apply:"应用导入",applying:"应用中…",applyError:"导入失败:{error}",appliedTitle:"导入已应用",appliedSummary:"已应用 {count} 项变更。"}},relay:{uplink:"Uplink",off:"关",on:"开",connectedAs:"已连接为 {identity}",notConfigured:"未配置",paused:"已暂停(保留配置)",connecting:"正在连接…",relayInvalid:"relay 地址无效",versionProbeFailed:"无法连接到 relay:{reason}",loginFailedInline:"登录失败:{reason}",credentialsRequired:"请填邮箱和密码",hint:"配置远端 atterm-relay 后,此机器上的会话可从其他设备附加。无人附加时,不会有字节离开此机器。",relayUrl:"relay url",preferDirectConnection:"优先使用直连",preferDirectConnectionHint:"Relay 完成连接和历史恢复后,尝试建立端到端加密的 P2P 终端通道;直连失败时继续使用 Relay。该设置仅对当前设备生效;桌面端开启后,也会接受其他设备发起的直连。",scheme:"Relay 协议",email:"邮箱",password:"密码",passwordShow:"显示密码",passwordHide:"隐藏密码",modeLogin:"登录",modeRegister:"注册",noAccountPrompt:"没有账号?",haveAccountPrompt:"已有账号?",claimToken:"领取码(可选)",claimTokenPlaceholder:"claim_…",claimTokenHint:"粘贴 `atterm-relay` bootstrap 输出的领取码以注册为管理员账户;留空则注册为普通用户。",insecureMode:"信任自签证书",allowCleartext:"允许本机外的明文 HTTP",insecureWarning:"跳过该 relay 的 TLS 证书校验,使自签证书的 relay 可被连接。连接仍然是加密的,但能够中间人拦截的攻击者可冒充该 relay。仅对你自己掌控的 relay 启用(例如 atterm-relay 的自签 quick-start);对外公开服务请使用正式证书。",cleartextWarning:"HTTP 没有 TLS 传输加密,仅建议用于 loopback 本地开发 Relay;非本机地址还必须显式勾选上方明文连接选项。",disableE2EE:"禁用端到端加密(测试 / 调试用)",disableE2EEWarning:"会话内容(终端输出、标题 / cwd / 当前命令、命令完成通知)将不经端到端封装直接发送给 relay,relay 服务器本身即可读取。传输层 TLS(若启用)仍然生效。账号密钥仍保留,仅暂停本机出站封装。开启期间标题栏会持续显示 ⚠ Plaintext 提醒。",saving:"保存中...",saveConnect:"保存并连接",clearTitle:"清理 relay 信息",clearHint:"这将清除本机保存的 relay 地址、账号和登录信息。已经打开的本地终端不受影响。",clearAction:"清理",clearing:"清理中…",clearConfirm:"确定要清除本机保存的 relay 信息吗?",clearFailed:"清理失败:{reason}",pairing:{title:"移动端配对",hint:"生成一次性二维码,让手机无需复制 token 即可接入此 relay。",generate:"生成二维码",generating:"生成中...",regenerate:"重新生成",expiresIn:"剩余",expired:"已过期 - 请重新生成",wrappedBadge:"含 E2EE 密钥",unwrappedWarning:"当前 E2EE 密钥未解锁 — 手机端扫码后将看不到会话详情。请先在上方 Relay 设置里用邮箱/密码登录以解锁。"}},logging:{title:"桌面日志",noContent:"暂时没有可用的日志文件内容。",truncated:"正在显示日志文件的最近部分。",writeLogs:"将日志写入文件",currentFile:"当前日志文件",changeLocation:"更改位置",resetDefault:"重置默认值",viewLogs:"查看日志",liveTail:"实时尾部(每 3 秒刷新)",levelFilter:"显示",tagFilter:"子系统",tagFilterAll:"全部",writeLevel:"日志级别",writeLevelHint:"写入文件的最低级别。DEBUG 会记录逐帧、逐按键的细节——复现问题时有用,平时很吵。",ptyInputDebug:"记录终端输入字节",ptyInputDebugHint:"排查输入丢失 / 卡死。不受上面的日志级别限制,勾选即记录。",tailPaused:"已暂停",tailPausedHint:"向上滚动时已暂停跟随 —— 点此或滚动到底部恢复"},updates:{devDisabled:"开发构建 - 自动更新已禁用",checking:"检查中...",readyToInstall:"{version} 已下载 - 可安装",downloadingStatus:"正在下载 {version} ({pct}%)",available:"{version} 可用",upToDate:"已是最新 - 上次检查 {ago}",notChecked:"尚未检查",justNow:"刚刚",minutesAgo:"{count} 分钟前",hoursAgo:"{count} 小时前",daysAgo:"{count} 天前",currentVersion:"当前版本",status:"状态",downloadPath:"下载路径",autoCheck:"自动检查更新",ghProxy:"GitHub 下载代理",proxyHint:"可选。只有 GitHub Release 文件下载会使用此代理;更新检查与签名验证保持不变。",releaseNotes:"发布说明",checkNow:"立即检查",versionLine:"{minor} 线",downloadVersion:"下载 {version}",cancelDownload:"取消 ({pct}%)",cancelling:"取消中…",redownload:"重新下载",redownloadPrompt:"本机已下载过 {version} 的安装包。是否重新下载?",forceInstallRestart:"强制安装并重启",installTitle:"安装 AT Term {version}",installIntro:"AT Term 将退出并以新版本重新启动。",installThisWill:" 这将:",forceInstall:"强制安装",installRestart:"安装并重启"},plugins:{hint:"插件按需加载。禁用的插件不会影响启动时间或内存。",panelDragHint:"可在面板中拖拽调整面板宽度和内部比例。显示选项在文件树的右键菜单中。",noneRegistered:"未注册插件。"},shortcuts:{keyboardShortcuts:"键盘快捷键",pane:"面板",tab:"标签页",sidebar:"侧栏",pressKey:"按一个键...",resetTo:"重置为 {binding}",conflictsWith:"冲突:{labels}",resetAll:"全部重置为默认值",splitPaneVertically:"垂直分割面板",splitPaneHorizontally:"水平分割面板",closePane:"关闭面板",focusPaneLeft:"聚焦左侧面板",focusPaneRight:"聚焦右侧面板",focusPaneUp:"聚焦上方面板",focusPaneDown:"聚焦下方面板",newTab:"新建标签页",previousTab:"上一个标签页",nextTab:"下一个标签页",focusSidebarSearch:"聚焦侧栏搜索",terminalSearch:"搜索终端"},diagnostics:{tab:"诊断",section:"诊断快照",hint:"桌面端运行时快照,API token 和请求头已脱敏。适合反馈问题时附上。",copy:"复制",export:"导出…",refresh:"刷新",copied:"已复制到剪贴板",copyFailed:"复制失败",exported:"已保存到 {path}"},feishu:{title:"飞书集成",disabled:"飞书集成尚未启用。",relay_disabled:"服务端(relay)已关闭飞书集成。",load_error:"无法获取飞书状态:{error}",retry_status:"重试",mode:{label:"模式",options:{auto:"自动(跟随 Relay 登录态)",local:"强制 Local(本机 LongConn)",relay:"强制 Relay(依赖 Relay 转发)"},effective:{label:"生效模式",fallbackWarn:"已请求 relay 但未登录 / UPLINK 关闭"}},bound:"已绑定到 open_id:{open_id}",save:"保存凭据",begin_pair:"开始绑定",pair_hint:"请在 15 分钟内向机器人发送私聊:/bind {code}",delete:"解绑",configured:"凭据已保存",app_id_label:"App ID",callback_label:"事件回调地址",callback_hint_relay:"在飞书「事件订阅」选择『将事件发送至开发者服务器』,并填入上面的地址。",longconn_hint_local:"本地长连接模式:在飞书「事件订阅」选择『使用长连接接收事件』,无需填回调地址。",copy:"复制",copied:"已复制",reconfigure:"重新配置凭据",aiOnlyNotifications:"仅 AI 会话通知",remoteTerminal:{enable:"启用飞书远程接管",autoAttachLabel:"自动接管会话",autoAttach:{ai:"仅 AI 会话",all:"所有会话",none:"不自动接管"}},hook_install:{enable:"自动安装 Claude Code Hook",retry:"重试",healthy:"Hook 已安装且健康",needs_attention:"Hook 需要修复",disabled:"Hook 自动安装已关闭"},test_send:{title:"测试发送",hint:"向已绑定的飞书账号发送一张测试卡片,验证通知链路是否打通。",command_success:"命令完成(成功)",command_failure:"命令完成(失败)",command_sealed:"命令完成(仅本机可见)",waiting_input:"等待输入",sending:"发送中…",sent:"已发送,请在飞书查看",failed:"发送失败:{error}"}},templates:{tab:"快捷模板",intro:"每个模板被点击时会把它的文本发到当前会话。",add:"新增模板",label:"标签",text:"发送文本",hotkey:"快捷键(如 Alt+1)",showBar:"在终端上方显示快捷模板栏",save:"保存",edit:"编辑",delete:"删除",reset:"恢复默认",resetConfirm:"用默认列表覆盖当前模板?"},profiles:{tab:"会话配置档",intro:"配置档(profile)是新开 tab / split 时用的一组命名启动配置:shell、启动目录、启动命令、环境变量。",precedenceHint:"新建会话的优先级:显式选的配置档 > 下面设置的默认配置档 > 通用设置里的默认 shell + 主目录。配置档不会取代默认 shell——没有配置档生效时,用的还是它。",envPrivacyIntro:"环境变量默认只留在这台机器,不会同步。想同步某个配置档的环境变量,在它上面单独打开「同步这些环境变量」。",empty:"还没有配置档。",add:"新增配置档",edit:"编辑",delete:"删除",save:"保存",name:"名称",shellPlaceholder:"shell 路径(留空则用默认 shell)",cwdPlaceholder:"启动目录(留空则用主目录)",shellUnset:"默认 shell",cwdUnset:"主目录",startupCmdPlaceholder:"启动命令(可选)",startupCmdHint:"在 shell 出现第一个提示符后执行一次,走的是 AI 会话恢复同一条路径——不是按原始按键发送。",envPlaceholder:"KEY=值,一行一个",envHint:"TERM 始终受保护:配置档无法覆盖它,以保证终端渲染正常。",syncEnv:"把这些环境变量同步到我的其他设备",syncEnvOffHint:"关闭(默认):这些环境变量只留在这台机器,同步前会被剥离;名称、shell、目录、启动命令等其余字段仍会同步。",syncEnvOnHint:"开启:这些环境变量会加密同步到你其他已登录的设备,端到端封装,relay 读不到明文。",setDefault:"设为默认",clearDefault:"取消默认",defaultBadge:"默认",nameRequired:"请填写名称。"},mobileSync:{locked:"正在等待账户密钥——请确认已登录。",noData:"还没有任何桌面同步过数据。",error:"无法读取同步的数据:{error}"},mobileProfiles:{intro:"从桌面同步的配置,仅供查看。请在运行它们的机器上编辑。",empty:"桌面上还没有会话配置。",defaultBadge:"默认",shell:"Shell",cwd:"工作目录",startupCmd:"启动命令",env:"环境变量",envNone:"无",envNotSynced:"未从该机器同步",hostLabel:"在此桌面打开",noHosts:"没有找到可用的桌面。请先在这个账号下的某台桌面上打开一个会话,这样手机才能发现它。",openButton:"打开",opening:"正在打开…",openErrors:{unknown_profile:"该配置在桌面上已不存在。",permission_denied:"该桌面以只读方式发布,无法从手机新建会话。",request_in_flight:"已有一个创建请求正在处理,请等它完成后再试。",duplicate_request_id:"该请求已发送过,请等它完成。",unknown_host_id:"暂时无法连接到该桌面。",invalid_request:"请求发送失败,请重试。",upstream_unavailable:"无法连接到该桌面,请重试。",session_create_busy:"该桌面当前繁忙,请稍后重试。",timeout:"等待桌面响应超时,系统不会自动重试——请先检查桌面状态再重试。",relay_not_configured:"请先在此手机上登录 relay。",generic:"无法创建会话:{error}"}},mobileHosts:{intro:"从桌面同步的 SSH 主机,仅供查看。此设备无法连接它们。",empty:"你的桌面还没有配置 SSH 主机。",user:"用户",port:"端口",tags:"标签",note:"备注",jumpChain:"需要通过跳板链才能到达此主机",proxyCommand:"使用 ProxyCommand——不能直接连接",key:"密钥"},devices:{hint:"此账号已登录的浏览器 / 桌面 / 移动设备。",refresh:"刷新",signOutOthers:"登出其他设备",signingOut:"登出中…",signOutOthersConfirm:"确定要登出除本机外的所有设备吗?",revoke:"撤销",revoking:"撤销中…",revokeConfirm:"确定要撤销此设备 ({ua}) 吗?",currentTag:"当前",loginLine:"登录于 {time} · {ip}",timeFormat:"{y}年{m}月{d}日 {hh}:{mm}",empty:"尚未有登录设备。",unknownUA:"未知设备",notAuthenticated:'请先在 "Relay" 页登录 relay 账号。'},account:{title:"账号",email:"邮箱",logout:{button:"退出登录",submitting:"退出中..."},traffic:{title:"流量统计",period:"最近 {days} 天(UTC)",range:"时间范围",dayUnit:"天",refresh:"刷新流量统计",relay:"Relay",p2p:"P2P 直连",kpiTotal:"总流量",kpiOutbound:"出站流量",kpiInbound:"入站流量",kpiFrames:"帧数",trendNew:"上期为 0",trendFlat:"持平",p2pTraffic:"直连流量",offloadShare:"卸载占比",offloadHint:"无需 Relay 转发的流量占比",successRate:"直连成功率",fallbacks:"回退次数",fallbackHint:"重新回到 Relay 的连接次数",inOut:"入站 {incoming} · 出站 {outgoing}",sentReceived:"发送 {sent} · 接收 {received}",connectionCounts:"尝试 {attempts} · 直连 {successes} · 回退 {fallbacks}",dailyTrend:"每日 Relay 与 P2P 流量",coreAnalysis:"核心分析",timelineTitle:"Relay 流量时序",view:"视图",groupTimeline:"流量类别",frameTimeline:"帧类型",directionTrend:"方向走势",colDirection:"方向",metric:"指标",bytes:"字节",frames:"帧数",direction:{all:"全部",out:"出站",in:"入站"},dirOut:"出站",dirIn:"入站",categorySummary:"类别摘要",totalComposition:"Relay 流量构成",outIn:"出 {out} · 入 {incoming}",frameBreakdown:"帧类型构成",topFrames:"按流量排序的主要帧类型",colFrameType:"帧类型",colBytes:"字节",colFrames:"帧数",directQuality:"直连质量",aggregateOnly:"仅展示聚合统计",categories:{terminal:"终端转发",state:"状态同步",config:"配置同步",fs:"文件浏览",preview:"远程预览",other:"其他"},empty:"该时段尚无流量记录。",loadFailed:"流量统计加载失败。",retry:"重试"},changePassword:{title:"修改密码",oldPassword:"当前密码",newPassword:"新密码",confirmPassword:"确认新密码",hintLength:"新密码至少需要 8 位。",hintMismatch:"两次输入的密码不一致。",submit:"更新密码",submitting:"更新中…",successToast:"密码已更新"},dangerZone:{title:"危险区",warning:"注销账号是永久性操作,无法撤销。",toggle:"注销账号",currentPassword:"当前密码",typeEmailToConfirm:"输入你的邮箱以确认",deleteButton:"注销账号",deleting:"注销中…",confirmPrompt:"此操作不可恢复。"},errors:{wrongPassword:"旧密码不正确。",sessionExpired:"会话已过期,请重新登录。",rateLimited:"请稍后重试。",network:"网络错误。",generic:"操作失败,请重试。"}}},mobile:{relayUrl:"Relay URL",email:"邮箱",password:"密码",passwordShow:"显示密码",passwordHide:"隐藏密码",emailRequired:"请输入邮箱",passwordRequired:"请输入密码",invalidCredentials:"邮箱或密码错误",rateLimited:"操作过于频繁,请稍后再试",loginButton:"登录",allowInsecure:"允许 insecure HTTP/WS(非 loopback)",originRejected:"Relay 拒绝了此 origin。请启动 relay 时让 ATTERM_ORIGINS 包含 capacitor://localhost。",cannotReachRelay:"无法连接 relay:{message}",relayUrlRequired:"必须填写 relay URL",relayUrlMalformed:"relay URL 无效或格式错误",relayUrlProtocol:"relay URL 必须以 http:// 或 https:// 开头",relayUrlNoPath:"relay URL 不能包含路径、查询或片段",relayUrlInsecure:'若要将 http:// 用于非 loopback 主机,请启用 "允许 insecure HTTP/WS"',taskSections:{needs_attention:"需要处理",running:"运行中",completed:"已完成",failed:"失败",disconnected:"已断开"},taskStates:{idle:"空闲",running:"运行中",waiting_input:"等待输入",completed:"已完成",failed:"失败",disconnected:"已断开",closed:"已关闭"},taskTypes:{ai:"AI",test:"测试",build:"构建",deploy:"部署"},started:"开始于",lastOutput:"最近输出",openBadge:"已打开",back:"返回",pasteClipboard:"粘贴",pasteImage:"图片",pasteConfirm:"确认粘贴",pastePreview:"剪贴板文本",protectMode:{banner:"防误触模式 · 打开下方控制模式可输入"},settings:{title:"设置",back:"返回",language:"语言",templates:"快捷模板",auxKeys:"快捷按键",logout:"退出登录",add:"新增",edit:"编辑",delete:"删除",reset:"恢复默认",resetConfirm:"用默认列表覆盖当前设置?",label:"标签",text:"发送文本",seq:"发送字节(\\r \\n \\t \\e \\xNN ^X)",showBar:"在终端上方显示快捷模板栏",save:"保存"},image:{prompt:"添加图片",fromLibrary:"从相册选择",takePhoto:"拍照"},pairing:{connecting:"配对中…",failed:"配对失败",back:"重试",scan:"扫描二维码",cameraDenied:"需要相机权限才能扫描二维码",noQrDetected:"未识别到二维码,请重试",scanNotAvailable:"此版本暂不支持扫码功能,请在下方手动填入 relay 地址",errInvalidUrl:"二维码内容不是合法的配对链接",errInvalidScheme:"二维码地址不是 https,无法配对(如需 http 请回到设置打开 insecure 开关)",errPlatformUnsupported:"当前平台不支持二维码配对",errCannotReachRelay:"无法连接 relay,请检查二维码地址或网络后重试",errTimeout:"配对请求超时(15s),请确认 relay 可达后重试",errPairInvalid:"二维码配对令牌无效或已过期,请重新生成",errCancelled:"已取消配对",errGeneric:"配对失败:{message}",stepParsing:"解析二维码…",stepRequesting:"请求 relay 服务器…",stepSaving:"保存配置…"},insecure:{warning:{title:"不安全的 relay (HTTP)",body:"API token 和终端输出会以明文方式传输。生产环境请使用 HTTPS。",dismiss:"知道了"}},selection:{copy:"复制",send:"发送",cancel:"取消",copied:"已复制到剪贴板",copyFailed:"复制失败"}},tasks:{bulk:{selectedCount:"已选 {count}",mergeTab:"合并 tab",mergeTooMany:"最多合并 4 个",close:"关闭 ({count})",closeHint:"关闭 {count} 个已打开的 pane",closeNoneOpen:"选中集合中没有本窗口已打开的会话",cancel:"取消"},details:{title:"会话详细信息",sessionId:"Session ID",type:"类型",host:"主机",cwd:"工作目录",command:"命令",state:"状态",startedAt:"开始于",commandStartedAt:"命令开始",commandEndedAt:"命令结束",commandDuration:"命令耗时",commandExitCode:"退出码",unread:"未读",pinned:"已置顶",paneLocation:"所在位置",paneAt:"Tab {tab} · Pane {pane}",paneNone:"本窗口未打开"},rowMenu:{details:"详细信息",merge:"合并 tab ({n})",closeSelected:"关闭已打开 ({n})"},sidebar:{title:"会话",collapse:"折叠侧栏 (Cmd/Ctrl+B)",expand:"展开侧栏 (Cmd/Ctrl+B)",searchPlaceholder:"搜索",openDrawer:"打开侧栏",closeDrawer:"关闭侧栏"},preset:{iconOnly:{name:"仅图标",description:"用颜色 + 图标传达状态。最紧凑。"},iconLabel:{name:"图标 + 文案",description:"图标旁加一段「运行中 / 等待输入 / 已完成」文字。更直观。"}},pinned:{title:"置顶",menuPin:"置顶",menuUnpin:"取消置顶"},search:{empty:'搜索 "{q}" 无匹配会话'},markAllRead:"全部标已读",completedFold:"已完成",unreadBadge:"{count} 条未读",settings:{section:"会话栏",preset:"显示样式",expandByDefault:"默认展开会话栏",groupBy:"分组方式",groupByHost:"按主机",groupByState:"按状态"}},plugins:{fileExplorer:{title:"文件浏览器",description:"侧边面板,包含文件树和只读语法高亮预览。跟随当前面板的 cwd。",noActivePaneShort:"(无活动面板)",noActivePane:"无活动面板。",selectFile:"选择一个文件。",pinCurrentCwd:"固定当前 cwd",unpinFollow:"取消固定(跟随活动面板)",showHidden:"显示隐藏文件",showLineNumbers:"在编辑器中显示行号",searchFiles:"搜索文件名",noSearchResults:"没有匹配的文件。",searchTruncated:"仅显示前 200 个匹配项。",fileChanged:"磁盘上的文件已更改",reload:"重新加载",tooLarge:"文件过大,无法预览。请在外部打开。",binary:"二进制文件 - 无法预览。",errorPrefix:"错误:{message}",unexpectedContentType:"文件内容类型异常",unknownError:"预览失败,原因未知",openInSystem:"用系统应用打开",unsupportedPreview:"此文件类型暂不支持内嵌预览。",showAsCode:"看源码",showAsRender:"看渲染",save:"保存",dontSave:"不保存",cancel:"取消",dirty:"有未保存的更改",staleModTime:"文件在你打开后已被外部修改。",overwrite:"覆盖",reloadDiscard:"重新加载(放弃更改)",confirmCloseTitle:"是否保存对 {name} 的更改?",newFile:"新建文件",newFolder:"新建文件夹",rename:"重命名",delete:"删除",copyPath:"复制路径",sendToTerminal:"终端引用",pathCopied:"路径已复制",moveToTrash:"移到回收站",confirmTrash:"把 {name} 移到回收站?",confirmHardDelete:"永久删除 {name}?此操作无法撤销。",saveFailed:"保存失败:{message}",sourceLabel:"文件来源",sourceActivePane:"当前面板",listingTruncated:"{path}:共 {total} 项,主机只返回了 {shown} 项,其余未列出。",sshUpload:"上传文件到 {dir}",sshUploadDone:"已把 {name} 上传到 {dir}",sshUploadExists:"远端已存在 {path},没有写入任何内容——那边没有回收站,覆盖无法撤销。请先重命名或删除它。",sshNoOpenExternal:"SSH 主机上的文件无法交给本机的系统应用打开。",sshNoInlineAsset:"SSH 主机上的这类文件无法内嵌预览。",sshNoRecursiveDelete:"{path} 是 SSH 主机上的目录。删除它会连同里面的一切一起永久删除——那边没有回收站,也无法撤销——所以面板不提供这个操作。请在该主机的终端里删除。",sshBridgeDisposed:"该 SSH 文件来源已关闭。",treeLoadFailed:"无法列出 {path}:{message}",retry:"重试"},deskWidget:{title:"桌面挂件",description:"一个置顶的小窗口,显示哪些会话在跑、失败了、或者在等你输入——AI agent 和普通 shell 一视同仁。点会话行可直接跳到对应标签页。",aiOnly:"仅显示 AI 会话",aiOnlyHint:"只显示跑着 claude / codex / aider 的会话。默认关闭:会话状态来自 OSC 133,任何命令都适用。"},translate:{title:"翻译",description:"通过兼容 OpenAI 的 API 翻译选中文本,并在浮动面板中显示结果。",selection:"翻译选中文本",notConfigured:"翻译插件尚未配置",closePanel:"关闭翻译面板",source:"原文",detected:"检测到 {lang}",target:"目标语言",translating:"翻译中...",noResult:"还没有结果。",recent:"最近 ({count})",baseUrl:"Base URL",apiKey:"API Key",model:"模型",defaultTargetLanguage:"默认目标语言",keyStoredPlaintext:"API key 以明文存储在 {path}。",extraParams:"额外参数",extraParamsHint:"合并进每次请求 body 的 JSON 对象(例如 stream、top_p、max_tokens),会覆盖默认值。",extraParamsInvalid:"不是合法的 JSON 对象。",invalidExtraParams:"额外参数无效:{detail}",simplifiedChinese:"中文(简体)",targetEnglish:"英语",targetJapanese:"日语",targetKorean:"韩语",targetGerman:"德语",targetFrench:"法语",targetSpanish:"西班牙语",userCancelled:"用户已取消",requestTimedOut:"请求在 {seconds}s 后超时",authFailed:"认证失败 ({status})",rateLimited:"请求过于频繁 (429)",serverError:"服务器错误 ({status})",providerNonJson:"provider 返回的外层响应不是 JSON",missingTranslated:"缺少 translated 字段",responseFormatUnsupported:"不支持 response_format"}},connHealth:{pillLabelConnecting:"连接中…",pillLabelReconnecting:"重连中…",pillLabelOff:"已关闭",drawerTitle:"连接质量",drawerRttNow:"RTT(当前)",drawerRttP50P95:"p50 / p95(最近 5 分钟)",drawerBytesIn:"↓ 接收",drawerBytesOut:"↑ 发送",drawerState:"状态",drawerReconnectsLastHour:"最近 1 小时重连",drawerReconnectsTime:"时间",drawerReconnectsReason:"原因",drawerReconnectsDowntime:"断开时长",drawerSeqGaps:"观察到的序号跳跃:"},startupUpdate:{title:"有可用更新",currentToLatest:"{current} → {latest}",releaseNotes:"更新说明",statusAvailable:"{version} 可用",statusDownloading:"正在下载 {version}({pct}%)",statusReady:"{version} 已下载 — 可安装",downloadInstall:"下载并安装",cancel:"取消({pct}%)",cancelling:"正在取消…",installRestart:"安装并重启",later:"稍后"},recovery:{dialog:{title:"恢复上次的会话?",subtitleClean:"上次正常退出 · {minutes} 分钟前",subtitleUnclean:"上次异常结束 · {minutes} 分钟前",btnRestoreAll:"恢复全部 {count} 个",btnRestoreSelected:"恢复选中的 {count} 个",btnDiscard:"全部丢弃",badgeResumable:"可续接",badgeFresh:"无 sid(不自动续接)",badgeShell:"(无 AI)",badgeUnclassified:"未识别为 AI"},pane:{failed:"(已失败)"}},snippets:{runOnHosts:"在多台主机上运行…",selectHosts:"选择主机",pending:"等待中",running:"运行中…",ok:"成功",failed:"失败",error:"出错",exitCode:"退出码 {code}",truncated:"输出已截断",copyAll:"复制全部",cancel:"取消",noHostsSelected:"请至少选择一台主机"},sync:{stateIdle:"已是最新",stateSyncing:"同步中…",stateOffline:"未同步",stateError:"同步失败",syncNow:"立即同步",lastSyncedNever:"从未同步",lastSyncedAt:"上次同步 {time}",pendingKeys:"还有 {count} 项改动待同步",pulledAdopted:"已从其他设备更新:{keys}",pulledConflict:"保留了本机版本(其他设备也改过):{keys}",keys:{locale_preference:"语言",quick_templates:"快捷模板",notifications_enabled:"通知",ai_notifications_only:"仅 AI 通知",command_notify_threshold_seconds:"命令完成通知阈值",shell_integration_enabled:"Shell 集成",pinned_session_ids:"置顶会话",ssh_hosts_encrypted:"SSH 主机",terminal_theme:"终端主题",terminal_font_head:"终端字体",terminal_font_size:"终端字号",terminal_line_height:"终端行高",terminal_cursor_style:"光标样式",terminal_cursor_blink:"光标闪烁",terminal_scrollback:"回滚行数",default_shell:"默认 shell",shortcut_bindings:"键盘快捷键",profiles_encrypted:"会话配置"}}},Af={en:c1,"zh-CN":d1},u1=[{labelKey:"common.system",value:"system"},{labelKey:"common.english",value:"en"},{labelKey:"common.simplifiedChinese",value:"zh-CN"}],ur=F("system"),Pc=F("en");let Dl,wm=Cm,la;function h1(e,t){if(e!=="system")return e;for(const n of t){const i=n.trim().toLowerCase();if(i!==""){if(i==="zh"||i.startsWith("zh-"))return"zh-CN";if(i==="en"||i.startsWith("en-"))return"en"}}return"en"}async function f1(e={}){la==null||la(),la=void 0,Dl=e.savePreference,wm=e.getLanguages??Cm;const t=e.loadPreference?await e.loadPreference():"system";ur.value=g1(t),du(),la=(e.listenLanguageChange??y1)(()=>{du()})}async function p1(e){const t=ur.value,n=Pc.value;ur.value=e,du();try{await(Dl==null?void 0:Dl(e))}catch(i){throw ur.value=t,Sm(n),i}}function cn(e,t={}){const n=$f(Af[Pc.value],e)??$f(Af.en,e);return n===void 0?e:m1(n,t)}function du(){Sm(h1(ur.value,wm()))}function Sm(e){Pc.value=e,v1(e)}function v1(e){typeof document>"u"||(document.documentElement.lang=e)}function g1(e){return e==="en"||e==="zh-CN"||e==="system"?e:"system"}function $f(e,t){let n=e;for(const i of t.split(".")){if(!_1(n)||!(i in n))return;n=n[i]}return typeof n=="string"?n:void 0}function m1(e,t){return e.replace(/\{([A-Za-z0-9_]+)\}/g,(n,i)=>{const s=t[i];return s===void 0?n:String(s)})}function _1(e){return typeof e=="object"&&e!==null}function Cm(){return typeof navigator>"u"?[]:navigator.languages.length>0?navigator.languages:[navigator.language]}function y1(e){return typeof window>"u"?()=>{}:(window.addEventListener("languagechange",e),()=>window.removeEventListener("languagechange",e))}function Ot(){return{t:cn,languageOptions:u1,localePreference:ur,resolvedLocale:Pc,setLocalePreference:p1}}function b1(){return window.runtime.InitializeNotifications()}function w1(){return window.runtime.IsNotificationAvailable()}function S1(){return window.runtime.RequestNotificationAuthorization()}function C1(){return window.runtime.CheckNotificationAuthorization()}function k1(e){return window.runtime.SendNotification(e)}function Ue(){var t,n;const e=(n=(t=window.go)==null?void 0:t.main)==null?void 0:n.App;if(!e)throw new Error(cn("app.wailsBindingsNotReady"));return e}const km=1,rr=6,ar=16,tn={OPEN:1,IN:2,OUT:3,RESIZE:4,META:5,CLOSE:6,ATTACH:16,LIST:17,LIST_RESP:18,REPLAY_PROGRESS:19,PREFS_CHANGED:20,PING:32,PONG:33,PASTE_IMAGE:51,CLAIM_DRIVER:52,PASTE_FILE:55,FS_REQUEST:56,FS_RESPONSE:57,FS_EVENT:58,SESSION_CREATE:59,SESSION_CREATED:60,SERVICE_OPEN:61,SERVICE_OPENED:62,SERVICE_CLOSE:63},x1=new TextEncoder,R1=new TextDecoder;function T1(e){const t=e.replace(/-/g,"");if(t.length!==32)throw new Error("bad uuid");const n=new Uint8Array(ar);for(let i=0;i= 0, got ${e}`)}}function Ea(e,t,n=""){const i=L1(e),s=e==null?void 0:e.length;if(!i||t!==void 0){const d=n&&`"${n}" `,r="",o=i?`length=${s}`:`type=${typeof e}`,c=d+"expected Uint8Array"+r+", got "+o;throw i?new RangeError(c):new TypeError(c)}return e}function fh(e){if(typeof e!="function"||typeof e.create!="function")throw new TypeError("Hash must wrapped by utils.createHasher");if(ql(e.outputLen),ql(e.blockLen),e.outputLen<1)throw new Error('"outputLen" must be >= 1');if(e.blockLen<1)throw new Error('"blockLen" must be >= 1')}function Yl(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function xm(e,t){Ea(e,void 0,"digestInto() output");const n=t.outputLen;if(e.length='+n)}function Pa(...e){for(let t=0;t>>t}function as(e){if(typeof e!="string")throw new TypeError("string expected");return new Uint8Array(new TextEncoder().encode(e))}function D1(e,t={}){const n=(s,a)=>e(a).update(s).digest(),i=e(void 0);return n.outputLen=i.outputLen,n.blockLen=i.blockLen,n.canXOF=i.canXOF,n.create=s=>e(s),Object.assign(n,t),Object.freeze(n)}function I1(e=32){ql(e,"bytesLength");const t=typeof globalThis=="object"?globalThis.crypto:null;if(typeof(t==null?void 0:t.getRandomValues)!="function")throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const M1=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function A1(e,t,n){return e&t^~e&n}function $1(e,t,n){return e&t^e&n^t&n}class O1{constructor(t,n,i,s){q(this,"blockLen");q(this,"outputLen");q(this,"canXOF",!1);q(this,"padOffset");q(this,"isLE");q(this,"buffer");q(this,"view");q(this,"finished",!1);q(this,"length",0);q(this,"pos",0);q(this,"destroyed",!1);this.blockLen=t,this.outputLen=n,this.padOffset=i,this.isLE=s,this.buffer=new Uint8Array(t),this.view=ad(this.buffer)}update(t){Yl(this),Ea(t);const{view:n,buffer:i,blockLen:s}=this,a=t.length;for(let d=0;ds-d&&(this.process(i,0),d=0);for(let u=d;uh.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;ue<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,ai=Br?e=>e:e=>Rm(e)>>>0,N1=e=>{for(let t=0;te:N1;function U1(e,t){if(t==null||typeof t!="object")throw new Error("options must be defined");return Object.assign(e,t)}function z1(e,t){if(e.length!==t.length)return!1;let n=0;for(let i=0;i[],a=(r,o)=>i(o,...s(r)).update(r).digest(),d=i(new Uint8Array(e),...s(new Uint8Array(0)));return a.outputLen=d.outputLen,a.blockLen=d.blockLen,a.create=(r,...o)=>i(r,...o),a}const K1=(e,t)=>{function n(i,...s){if(li(i,void 0,"key"),e.nonceLength!==void 0){const h=s[0];li(h,e.varSizeNonce?void 0:e.nonceLength,"nonce")}const a=e.tagLength;a&&s[1]!==void 0&&li(s[1],void 0,"AAD");const d=t(i,...s),r=(h,u)=>{if(u!==void 0){if(h!==2)throw new Error("cipher output not supported");li(u,void 0,"output")}};let o=!1;return{encrypt(h,u){if(o)throw new Error("cannot encrypt() twice with same key + nonce");return o=!0,li(h),r(d.encrypt.length,u),d.encrypt(h,u)},decrypt(h,u){if(li(h),a&&h.lengthUint8Array.from(e.split(""),t=>t.charCodeAt(0)),j1=lr(Ns(Tm("expand 16-byte k"))),q1=lr(Ns(Tm("expand 32-byte k")));function Tt(e,t){return e<>>32-t}const ca=64,Y1=16,vu=2**32-1,Ff=Uint32Array.of();function G1(e,t,n,i,s,a,d,r){const o=s.length,c=new Uint8Array(ca),h=Ns(c),u=Br&&La(s)&&La(a),v=u?Ns(s):Ff,m=u?Ns(a):Ff;if(!Br){for(let b=0;b=vu)throw new Error("arx: counter overflow");const g=Math.min(ca,o-b);for(let l=0,f;l=vu)throw new Error("arx: counter overflow");const g=Math.min(ca,o-b);if(u&&g===ca){const l=b/4;if(b%4!==0)throw new Error("arx: invalid block position");for(let f=0,p;f{li(r,void 0,"key"),li(o,void 0,"nonce"),li(c,void 0,"data");const v=c.length;if(h=pu(v,h,!1),wa(u),u<0||u>=vu)throw new Error("arx: counter overflow");const m=[];let b=r.length,g,l;if(b===32)m.push(g=Gl(r)),l=q1;else if(b===16&&n)g=new Uint8Array(32),g.set(r),g.set(r,16),l=j1,m.push(g);else throw li(r,32,"arx key"),new Error("invalid key size");(!Br||!La(o))&&m.push(o=Gl(o));let f=Ns(g);if(i){if(o.length!==24)throw new Error("arx: extended nonce must be 24 bytes");const C=o.subarray(0,16);if(Br)i(l,f,Ns(C),f);else{const k=lr(Uint32Array.from(l));i(k,f,Ns(C),f),hr(k),lr(f)}o=o.subarray(16)}else Br||lr(f);const p=16-s;if(p!==o.length)throw new Error(`arx: nonce must be ${p} or 16 bytes`);if(p!==12){const C=new Uint8Array(12);C.set(o,a?0:12-o.length),o=C,m.push(o)}const y=lr(Ns(o));try{return G1(e,l,f,y,c,h,u,d),h}finally{hr(...m)}}}function Gn(e,t){return e[t++]&255|(e[t++]&255)<<8}class J1{constructor(t){q(this,"blockLen",16);q(this,"outputLen",16);q(this,"buffer",new Uint8Array(16));q(this,"r",new Uint16Array(10));q(this,"h",new Uint16Array(10));q(this,"pad",new Uint16Array(8));q(this,"pos",0);q(this,"finished",!1);q(this,"destroyed",!1);t=Gl(li(t,32,"key"));const n=Gn(t,0),i=Gn(t,2),s=Gn(t,4),a=Gn(t,6),d=Gn(t,8),r=Gn(t,10),o=Gn(t,12),c=Gn(t,14);this.r[0]=n&8191,this.r[1]=(n>>>13|i<<3)&8191,this.r[2]=(i>>>10|s<<6)&7939,this.r[3]=(s>>>7|a<<9)&8191,this.r[4]=(a>>>4|d<<12)&255,this.r[5]=d>>>1&8190,this.r[6]=(d>>>14|r<<2)&8191,this.r[7]=(r>>>11|o<<5)&8065,this.r[8]=(o>>>8|c<<8)&8191,this.r[9]=c>>>5&127;for(let h=0;h<8;h++)this.pad[h]=Gn(t,16+2*h)}process(t,n,i=!1){const s=i?0:2048,{h:a,r:d}=this,r=d[0],o=d[1],c=d[2],h=d[3],u=d[4],v=d[5],m=d[6],b=d[7],g=d[8],l=d[9],f=Gn(t,n+0),p=Gn(t,n+2),y=Gn(t,n+4),C=Gn(t,n+6),k=Gn(t,n+8),E=Gn(t,n+10),I=Gn(t,n+12),S=Gn(t,n+14);let P=a[0]+(f&8191),A=a[1]+((f>>>13|p<<3)&8191),L=a[2]+((p>>>10|y<<6)&8191),x=a[3]+((y>>>7|C<<9)&8191),D=a[4]+((C>>>4|k<<12)&8191),M=a[5]+(k>>>1&8191),B=a[6]+((k>>>14|E<<2)&8191),z=a[7]+((E>>>11|I<<5)&8191),Y=a[8]+((I>>>8|S<<8)&8191),U=a[9]+(S>>>5|s),N=0,V=N+P*r+A*(5*l)+L*(5*g)+x*(5*b)+D*(5*m);N=V>>>13,V&=8191,V+=M*(5*v)+B*(5*u)+z*(5*h)+Y*(5*c)+U*(5*o),N+=V>>>13,V&=8191;let j=N+P*o+A*r+L*(5*l)+x*(5*g)+D*(5*b);N=j>>>13,j&=8191,j+=M*(5*m)+B*(5*v)+z*(5*u)+Y*(5*h)+U*(5*c),N+=j>>>13,j&=8191;let G=N+P*c+A*o+L*r+x*(5*l)+D*(5*g);N=G>>>13,G&=8191,G+=M*(5*b)+B*(5*m)+z*(5*v)+Y*(5*u)+U*(5*h),N+=G>>>13,G&=8191;let te=N+P*h+A*c+L*o+x*r+D*(5*l);N=te>>>13,te&=8191,te+=M*(5*g)+B*(5*b)+z*(5*m)+Y*(5*v)+U*(5*u),N+=te>>>13,te&=8191;let se=N+P*u+A*h+L*c+x*o+D*r;N=se>>>13,se&=8191,se+=M*(5*l)+B*(5*g)+z*(5*b)+Y*(5*m)+U*(5*v),N+=se>>>13,se&=8191;let oe=N+P*v+A*u+L*h+x*c+D*o;N=oe>>>13,oe&=8191,oe+=M*r+B*(5*l)+z*(5*g)+Y*(5*b)+U*(5*m),N+=oe>>>13,oe&=8191;let Fe=N+P*m+A*v+L*u+x*h+D*c;N=Fe>>>13,Fe&=8191,Fe+=M*o+B*r+z*(5*l)+Y*(5*g)+U*(5*b),N+=Fe>>>13,Fe&=8191;let K=N+P*b+A*m+L*v+x*u+D*h;N=K>>>13,K&=8191,K+=M*c+B*o+z*r+Y*(5*l)+U*(5*g),N+=K>>>13,K&=8191;let Z=N+P*g+A*b+L*m+x*v+D*u;N=Z>>>13,Z&=8191,Z+=M*h+B*c+z*o+Y*r+U*(5*l),N+=Z>>>13,Z&=8191;let J=N+P*l+A*g+L*b+x*m+D*v;N=J>>>13,J&=8191,J+=M*u+B*h+z*c+Y*o+U*r,N+=J>>>13,J&=8191,N=(N<<2)+N|0,N=N+V|0,V=N&8191,N=N>>>13,j+=N,a[0]=V,a[1]=j,a[2]=G,a[3]=te,a[4]=se,a[5]=oe,a[6]=Fe,a[7]=K,a[8]=Z,a[9]=J}finalize(){const{h:t,pad:n}=this,i=new Uint16Array(10);let s=t[1]>>>13;t[1]&=8191;for(let r=2;r<10;r++)t[r]+=s,s=t[r]>>>13,t[r]&=8191;t[0]+=s*5,s=t[0]>>>13,t[0]&=8191,t[1]+=s,s=t[1]>>>13,t[1]&=8191,t[2]+=s,i[0]=t[0]+5,s=i[0]>>>13,i[0]&=8191;for(let r=1;r<10;r++)i[r]=t[r]+s,s=i[r]>>>13,i[r]&=8191;i[9]-=8192;let a=(s^1)-1;for(let r=0;r<10;r++)i[r]&=a;a=~a;for(let r=0;r<10;r++)t[r]=t[r]&a|i[r];t[0]=(t[0]|t[1]<<13)&65535,t[1]=(t[1]>>>3|t[2]<<10)&65535,t[2]=(t[2]>>>6|t[3]<<7)&65535,t[3]=(t[3]>>>9|t[4]<<4)&65535,t[4]=(t[4]>>>12|t[5]<<1|t[6]<<14)&65535,t[5]=(t[6]>>>2|t[7]<<11)&65535,t[6]=(t[7]>>>5|t[8]<<8)&65535,t[7]=(t[8]>>>8|t[9]<<5)&65535;let d=t[0]+n[0];t[0]=d&65535;for(let r=1;r<8;r++)d=(t[r]+n[r]|0)+(d>>>16)|0,t[r]=d&65535;hr(i)}update(t){Of(this),li(t),t=Gl(t);const{buffer:n,blockLen:i}=this,s=t.length;for(let a=0;a>>0,t[a++]=i[d]>>>8}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const i=t.slice(0,n);return this.destroy(),i}}const Z1=V1(32,e=>new J1(e));function Q1(e,t,n,i,s,a=20){let d=e[0],r=e[1],o=e[2],c=e[3],h=t[0],u=t[1],v=t[2],m=t[3],b=t[4],g=t[5],l=t[6],f=t[7],p=s,y=n[0],C=n[1],k=n[2],E=d,I=r,S=o,P=c,A=h,L=u,x=v,D=m,M=b,B=g,z=l,Y=f,U=p,N=y,V=C,j=k;for(let te=0;te{e.update(t);const n=t.length%16;n&&e.update(nS.subarray(n))},iS=new Uint8Array(32);function Hf(e,t,n,i,s){s!==void 0&&li(s,void 0,"AAD");const a=e(t,n,iS),d=W1(i.length,s?s.length:0,!0),r=Z1.create(a);s&&Bf(r,s),Bf(r,i),r.update(d);const o=r.digest();return hr(a,d),o}const sS=e=>(t,n,i)=>({encrypt(a,d){const r=a.length;d=pu(r+16,d,!1),d.set(a);const o=d.subarray(0,-16);e(t,n,o,o,1);const c=Hf(e,t,n,o,i);return d.set(c,r),hr(c),d},decrypt(a,d){d=pu(a.length-16,d,!1);const r=a.subarray(0,-16),o=a.subarray(-16),c=Hf(e,t,n,r,i);if(!z1(o,c))throw hr(c),new Error("invalid tag");return d.set(a.subarray(0,-16)),e(t,n,d,d,1),hr(c),d}}),Bo=K1({blockSize:64,nonceLength:24,tagLength:16},sS(tS));class Nf{constructor(t,n){q(this,"oHash");q(this,"iHash");q(this,"blockLen");q(this,"outputLen");q(this,"canXOF",!1);q(this,"finished",!1);q(this,"destroyed",!1);if(fh(t),Ea(n,void 0,"key"),this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?t.create().update(n).digest():n);for(let a=0;a{const e=(t,n,i)=>new Nf(t,n).update(i).digest();return e.create=(t,n)=>new Nf(t,n),e})();function rS(e,t,n){return fh(e),n===void 0&&(n=new Uint8Array(e.outputLen)),Lc(e,n,t)}const ld=Uint8Array.of(0),Uf=Uint8Array.of();function oS(e,t,n,i=32){fh(e),ql(i,"length"),Ea(t,void 0,"prk");const s=e.outputLen;if(t.length255*s)throw new Error("Length must be <= 255*HashLen");const a=Math.ceil(i/s);n===void 0?n=Uf:Ea(n,void 0,"info");const d=new Uint8Array(a*s),r=Lc.create(e,t),o=r._cloneInto(),c=new Uint8Array(r.outputLen);for(let h=0;hoS(e,rS(e,t,n),i,s),aS=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Zs=new Uint32Array(64);class lS extends O1{constructor(t){super(64,t,8,!1)}get(){const{A:t,B:n,C:i,D:s,E:a,F:d,G:r,H:o}=this;return[t,n,i,s,a,d,r,o]}set(t,n,i,s,a,d,r,o){this.A=t|0,this.B=n|0,this.C=i|0,this.D=s|0,this.E=a|0,this.F=d|0,this.G=r|0,this.H=o|0}process(t,n){for(let u=0;u<16;u++,n+=4)Zs[u]=t.getUint32(n,!1);for(let u=16;u<64;u++){const v=Zs[u-15],m=Zs[u-2],b=ps(v,7)^ps(v,18)^v>>>3,g=ps(m,17)^ps(m,19)^m>>>10;Zs[u]=g+Zs[u-7]+b+Zs[u-16]|0}let{A:i,B:s,C:a,D:d,E:r,F:o,G:c,H:h}=this;for(let u=0;u<64;u++){const v=ps(r,6)^ps(r,11)^ps(r,25),m=h+v+A1(r,o,c)+aS[u]+Zs[u]|0,g=(ps(i,2)^ps(i,13)^ps(i,22))+$1(i,s,a)|0;h=c,c=o,o=r,r=d+m|0,d=a,a=s,s=i,i=m+g|0}i=i+this.A|0,s=s+this.B|0,a=a+this.C|0,d=d+this.D|0,r=r+this.E|0,o=o+this.F|0,c=c+this.G|0,h=h+this.H|0,this.set(i,s,a,d,r,o,c,h)}roundClean(){Pa(Zs)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Pa(this.buffer)}}class cS extends lS{constructor(){super(32);q(this,"A",Js[0]|0);q(this,"B",Js[1]|0);q(this,"C",Js[2]|0);q(this,"D",Js[3]|0);q(this,"E",Js[4]|0);q(this,"F",Js[5]|0);q(this,"G",Js[6]|0);q(this,"H",Js[7]|0)}}const os=D1(()=>new cS,M1(1));as("atterm-account-key-v1");function ph(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),i=atob(t+n),s=new Uint8Array(i.length);for(let a=0;a255)throw new Error(`fs segments: bad segment count ${e.length}`);let t=1;for(const a of e){if(a.length>Dm)throw new Error("fs segments: segment too large");t+=4+a.length}const n=new Uint8Array(t),i=new DataView(n.buffer);n[0]=e.length;let s=1;for(const a of e)i.setUint32(s,a.length,!1),s+=4,n.set(a,s),s+=a.length;return n}function Vf(e){if(e.length<1)return null;const t=e[0];if(t===0)return null;const n=new DataView(e.buffer,e.byteOffset,e.byteLength),i=[];let s=1;for(let a=0;ae.length)return null;const d=n.getUint32(s,!1);if(d>Dm||(s+=4,s+d>e.length))return null;i.push(e.slice(s,s+d)),s+=d}return s!==e.length?null:i}const mS=as("atterm-direct-handshake-v1"),_S=as("atterm-direct-proof-v1"),yS=as("atterm-direct-client-v1"),bS=as("atterm-direct-host-v1"),wS=as("atterm-direct-finish-v1"),SS=as("atterm-direct-traffic-v1"),Im=1,fa=14,Kf=16,zr=16*1024;var Ml=(e=>(e[e.View=1]="View",e[e.Control=2]="Control",e[e.Full=3]="Full",e))(Ml||{}),gu=(e=>(e[e.Client=1]="Client",e[e.Host=2]="Host",e))(gu||{}),_s=(e=>(e[e.Frame=1]="Frame",e[e.Fragment=2]="Fragment",e[e.DirectReady=3]="DirectReady",e[e.Ping=4]="Ping",e[e.Pong=5]="Pong",e[e.Close=6]="Close",e))(_s||{});function Vr(...e){const t=e.reduce((s,a)=>s+a.length,0),n=new Uint8Array(t);let i=0;for(const s of e)n.set(s,i),i+=s.length;return n}function Wf(e){if(!/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(e))throw new Error("invalid UUID");const t=e.replaceAll("-",""),n=new Uint8Array(16);for(let i=0;i65535)throw new Error("direct transcript field too large");const t=new Uint8Array(2+e.length);return new DataView(t.buffer).setUint16(0,e.length,!1),t.set(e,2),t}function dd(e,t){const n=as(t);if(n.length===0||n.length>128)throw new Error(`invalid ${e}`);return Al(n)}function CS(e){if(e.ticket.length!==32)throw new Error("direct ticket must be 32 bytes");if(e.permission<1||e.permission>3)throw new Error("invalid direct permission");if(e.expiresAtUnixMs<=0n)throw new Error("invalid direct expiry");if(e.clientPublicKey.length!==65||e.hostPublicKey.length!==65)throw new Error("P-256 public keys must be 65 bytes");const t=new Uint8Array([e.permission]),n=new Uint8Array(8);return new DataView(n.buffer).setBigUint64(0,e.expiresAtUnixMs,!1),Vr(mS,Wf(e.attemptId),Al(e.ticket),Wf(e.sessionId),dd("user_id",e.userId),dd("host_id",e.hostId),dd("client_instance_id",e.clientInstanceId),t,n,Al(e.clientPublicKey),Al(e.hostPublicKey))}function vh(e,t){if(e.length!==32)throw new Error("account_key must be 32 bytes");return Dc(os,e,os(t),_S,32)}function jf(e,t,n){const i=n===1?yS:n===2?bS:null;if(!i)throw new Error("invalid direct role");return Lc(os,vh(e,t),Vr(i,os(t)))}function kS(e,t){return Lc(os,vh(e,t),Vr(wS,os(t)))}async function xS(e,t){const n={name:"ECDH",namedCurve:"P-256"},i=await crypto.subtle.importKey("jwk",e,n,!1,["deriveBits"]),s=await crypto.subtle.importKey("raw",t,n,!1,[]),a=await crypto.subtle.deriveBits({name:"ECDH",public:s},i,256);return new Uint8Array(a)}function RS(e,t,n){const i=os(n),s=Dc(os,t,vh(e,n),Vr(SS,i),96);return{clientToHostKey:s.slice(0,32),hostToClientKey:s.slice(32,64),clientToHostNoncePrefix:s.slice(64,80),hostToClientNoncePrefix:s.slice(80,96)}}function Mm(e){return e>=1&&e<=6}function Am(e,t){if(e.length!==16)throw new Error("direct nonce prefix must be 16 bytes");const n=new Uint8Array(24);return n.set(e),new DataView(n.buffer).setBigUint64(16,t,!1),n}function TS(e,t,n){if(!Mm(e))throw new Error("invalid direct record kind");if(t<0n||t>0xffffffffffffffffn)throw new Error("invalid direct record counter");if(n>zr)throw new Error("direct record plaintext too large");const i=new Uint8Array(fa);i[0]=Im,i[1]=e;const s=new DataView(i.buffer);return s.setBigUint64(2,t,!1),s.setUint32(10,n,!1),i}function ES(e,t,n,i,s,a){if(e.length!==32||n.length!==32)throw new Error("invalid direct record key binding");const d=TS(i,s,a.length),r=Vr(n,d),o=Bo(e,Am(t,s),r).encrypt(a);return Vr(d,o)}function PS(e,t,n,i,s){if(e.length!==32||n.length!==32)throw new Error("invalid direct record key binding");if(s.lengthzr||s.length!==fa+c+Kf)throw new Error("invalid direct record length");const h=Vr(n,a),u=Bo(e,Am(t,o),h).decrypt(s.subarray(fa));return{kind:r,plaintext:u}}const Da=16,qf=zr-Da,$m=16*1024*1024,LS=1e4;function DS(e,t){if(e<0n||e>0xffffffffffffffffn)throw new Error("invalid direct fragment message id");if(t.length<=zr)throw new Error("direct frame does not require fragmentation");if(t.length>$m)throw new Error("direct frame too large");const n=[];for(let i=0;iLS)throw this.reset(),new Error("direct reassembly timeout");if(t.length<=Da||t.length>zr)throw new Error("invalid direct fragment size");const i=new DataView(t.buffer,t.byteOffset,t.byteLength),s=i.getBigUint64(0,!1),a=i.getUint32(8,!1),d=i.getUint32(12,!1),r=t.subarray(Da);if(d<=zr||d>$m||a+r.length>d)throw new Error("invalid direct fragment bounds");if(!this.buffer){if(a!==0)throw new Error("invalid direct fragment offset");this.messageId=s,this.total=d,this.startedAtMs=n,this.buffer=new Uint8Array(d)}if(s!==this.messageId||d!==this.total||a!==this.next)throw new Error("direct fragment ordering mismatch");if(this.buffer.set(r,a),this.next+=r.length,this.next!==this.total)return null;const o=this.buffer;return this.reset(),o}reset(){this.messageId=0n,this.total=0,this.next=0,this.startedAtMs=0,this.buffer=null}}const hl=1,MS=1,AS=2,$S=3,OS=4,$l=65,FS=32,BS=2+$l+FS;function HS(e){const t=e.replaceAll("-","");if(!/^[0-9a-fA-F]{32}$/.test(t))throw new Error("invalid direct attempt UUID");const n=new Uint8Array(16);for(let i=0;is+a.length,0),n=new Uint8Array(t);let i=0;for(const s of e)n.set(s,i),i+=s.length;return n}class gh{constructor(t,n,i,s){q(this,"state","await_host_hello");q(this,"keys",null);q(this,"helloSent",!1);this.authorization=t,this.accountKey=n,this.privateJWK=i,this.clientPublicKey=s}static async create(t,n){if(n.length!==32)throw new Error("direct handshake requires a 32-byte account_key");if(t.ticket.length!==32)throw new Error("direct ticket must be 32 bytes");if(t.expiresAtUnixMs<=BigInt(Date.now()))throw new Error("direct authorization expired");const i={name:"ECDH",namedCurve:"P-256"},s=await crypto.subtle.generateKey(i,!0,["deriveBits"]),a=new Uint8Array(await crypto.subtle.exportKey("raw",s.publicKey)),d=await crypto.subtle.exportKey("jwk",s.privateKey);if(a.length!==$l)throw new Error("invalid generated P-256 public key");return new gh(t,n.slice(),d,a)}clientHello(){if(this.state!=="await_host_hello"||this.helloSent)throw new Error("direct CLIENT_HELLO already sent");return this.helloSent=!0,Yf(new Uint8Array([hl,MS]),HS(this.authorization.attemptId),this.authorization.ticket,this.clientPublicKey)}async handleHostHello(t){if(this.state!=="await_host_hello"||!this.helloSent)throw new Error("unexpected direct HOST_HELLO");if(t.length!==BS||t[0]!==hl||t[1]!==AS)throw new Error("malformed direct HOST_HELLO");if(!this.privateJWK)throw new Error("direct private key unavailable");const n=t.slice(2,2+$l),i=t.slice(2+$l),s=CS({...this.authorization,clientPublicKey:this.clientPublicKey,hostPublicKey:n}),a=jf(this.accountKey,s,gu.Host);if(!NS(i,a))throw new Error("direct host proof mismatch");const d=await xS(this.privateJWK,n);this.privateJWK=null;const r=RS(this.accountKey,d,s);d.fill(0),this.keys={...r,transcriptHash:os(s)};const o=jf(this.accountKey,s,gu.Client),c=kS(this.accountKey,s);return this.state="await_auth_ok",Yf(new Uint8Array([hl,$S]),o,c)}handleAuthOK(t){if(this.state!=="await_auth_ok")throw new Error("unexpected direct AUTH_OK");if(t.length!==2||t[0]!==hl||t[1]!==OS||!this.keys)throw new Error("malformed direct AUTH_OK");return this.state="complete",this.accountKey.fill(0),this.keys}dispose(){this.privateJWK=null,this.accountKey.fill(0),this.keys&&(this.keys.clientToHostKey.fill(0),this.keys.hostToClientKey.fill(0),this.keys.clientToHostNoncePrefix.fill(0),this.keys.hostToClientNoncePrefix.fill(0),this.keys.transcriptHash.fill(0),this.keys=null)}}class US{constructor(t){q(this,"sendCounter",0n);q(this,"receiveCounter",0n);q(this,"nextMessageId",1n);this.keys=t}seal(t,n){const i=ES(this.keys.clientToHostKey,this.keys.clientToHostNoncePrefix,this.keys.transcriptHash,t,this.sendCounter,n);return this.sendCounter++,i}sealFrame(t){if(t.length<=zr)return[this.seal(_s.Frame,t)];const n=DS(this.nextMessageId,t);return this.nextMessageId++,n.map(i=>this.seal(_s.Fragment,i))}open(t){const n=PS(this.keys.hostToClientKey,this.keys.hostToClientNoncePrefix,this.keys.transcriptHash,this.receiveCounter,t);return this.receiveCounter++,n}}function zS(e){switch(e){case"view":return Ml.View;case"control":return Ml.Control;case"full":return Ml.Full;default:throw new Error("invalid direct permission")}}function VS(e){if(!/^[A-Za-z0-9_-]+$/.test(e))throw new Error("invalid direct ticket");const t=e.replaceAll("-","+").replaceAll("_","/"),n=t+"=".repeat((4-t.length%4)%4),i=atob(n),s=Uint8Array.from(i,a=>a.charCodeAt(0));if(s.length!==32)throw new Error("invalid direct ticket length");return s}const Om=1,KS=64*1024,WS=3e4,jS=1024*1024;function qS(e){if(typeof e!="string"||e.length>KS)throw new Error("invalid direct signaling message");const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))throw new Error("invalid direct signaling message");const n=t;if(n.version!==Om||typeof n.kind!="string")throw new Error("unsupported direct signaling message");return n}function YS(e){return JSON.stringify({version:Om,...e})}function GS(e){if(e instanceof Error)return e;if(e&&typeof e=="object"){const t=e,n=new Error(typeof t.message=="string"?t.message:String(e));return typeof t.name=="string"&&t.name&&(n.name=t.name),n}return new Error(String(e))}function fl(e){const t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(e),t}async function XS(e){e.iceGatheringState!=="complete"&&await new Promise(t=>{const n=()=>{e.iceGatheringState==="complete"&&(e.removeEventListener("icegatheringstatechange",n),t())};e.addEventListener("icegatheringstatechange",n)})}class JS{constructor(t){q(this,"signalWS",null);q(this,"pc",null);q(this,"dc",null);q(this,"handshake",null);q(this,"codec",null);q(this,"reassembler",new IS);q(this,"requestId",crypto.randomUUID());q(this,"attemptId","");q(this,"started",!1);q(this,"helloAccepted",!1);q(this,"closed",!1);q(this,"authenticated",!1);q(this,"hostHelloHandled",!1);q(this,"timeout",null);q(this,"signalChain",Promise.resolve());q(this,"receiveChain",Promise.resolve());q(this,"accountKey");if(this.options=t,t.accountKey.length!==32)throw new Error("direct transport requires a 32-byte account_key");if(!Number.isSafeInteger(t.sinceSeq)||t.sinceSeq<0)throw new Error("invalid direct replay cursor");if(!t.clientInstanceId||t.clientInstanceId.length>128)throw new Error("invalid direct client instance id");this.accountKey=t.accountKey.slice()}start(){if(this.started||this.closed)return;this.started=!0;const t=this.options.webSocketFactory??((s,a)=>a?new WebSocket(s,a):new WebSocket(s));let n;try{n=t(this.options.signalURL,this.options.signalProtocols)}catch(s){this.fail(s);return}this.signalWS=n;const i=this.options.timeoutMs??WS;this.timeout=window.setTimeout(()=>this.fail(new Error("direct attempt timed out")),i),n.onopen=()=>{this.sendSignal({kind:"hello",role:"client",client_instance_id:this.options.clientInstanceId})},n.onmessage=s=>{try{this.handleSignal(qS(s.data))}catch(a){this.fail(a)}},n.onerror=()=>{},n.onclose=()=>{this.signalWS=null,this.authenticated||this.fail(new Error("direct signaling disconnected"))}}notifyDiagnostics(t){var n,i;try{(i=(n=this.options.callbacks).onDiagnostics)==null||i.call(n,t)}catch{}}sendFrame(t){if(this.closed||!this.authenticated||!this.codec||!this.dc||this.dc.readyState!=="open")return!1;if(this.dc.bufferedAmount>jS)return this.fail(new Error("direct data channel backpressure limit")),!1;try{for(const n of this.codec.sealFrame(t))this.dc.send(fl(n));return!0}catch(n){return this.fail(n),!1}}close(){this.finish()}handleSignal(t){if(!this.closed)switch(t.kind){case"hello_ok":if(this.helloAccepted)throw new Error("duplicate direct hello acknowledgement");this.helloAccepted=!0,this.sendSignal({kind:"direct_request",request_id:this.requestId,session_id:this.options.sessionId,client_instance_id:this.options.clientInstanceId,since_seq:this.options.sinceSeq});return;case"direct_attempt":if(t.request_id!==this.requestId)throw new Error("direct request id mismatch");this.beginAttempt(t).catch(n=>this.fail(n));return;case"signal":if(!this.attemptId||t.attempt_id!==this.attemptId)throw new Error("direct signal attempt mismatch");this.signalChain=this.signalChain.then(()=>this.applyRemoteSignal(t)).catch(n=>this.fail(n));return;case"consumed":if(t.attempt_id!==this.attemptId)throw new Error("direct consumed attempt mismatch");return;case"cancel":throw new Error(`direct attempt cancelled: ${t.code||"peer_cancelled"}`);case"error":throw new Error(`direct signaling rejected: ${t.code||"unknown_error"}`);case"host_registered":return;default:throw new Error(`unexpected direct signaling message: ${t.kind}`)}}async beginAttempt(t){if(this.attemptId)throw new Error("duplicate direct attempt");if(!t.attempt_id||!t.ticket||!t.session_id||!t.user_id||!t.host_id||!t.client_instance_id||!t.permission||!Number.isSafeInteger(t.expires_at_unix_ms))throw new Error("incomplete direct authorization");if(t.session_id!==this.options.sessionId||t.client_instance_id!==this.options.clientInstanceId)throw new Error("direct authorization claims mismatch");const n=BigInt(t.expires_at_unix_ms),i={attemptId:t.attempt_id,ticket:VS(t.ticket),sessionId:t.session_id,userId:t.user_id,hostId:t.host_id,clientInstanceId:t.client_instance_id,permission:zS(t.permission),expiresAtUnixMs:n};if(this.attemptId=i.attemptId,this.handshake=await gh.create(i,this.accountKey),this.closed)return;const a=(this.options.peerConnectionFactory??(c=>new RTCPeerConnection(c)))({iceServers:this.options.iceServers??[{urls:["stun:stun.cloudflare.com:3478"]}]});this.pc=a;const d=()=>{this.notifyDiagnostics({iceState:a.iceConnectionState}),(a.iceConnectionState==="connected"||a.iceConnectionState==="completed")&&this.reportSelectedCandidateType(a)};a.oniceconnectionstatechange=d,a.onconnectionstatechange=()=>{(a.connectionState==="failed"||a.connectionState==="disconnected"||a.connectionState==="closed")&&this.fail(new Error(`direct peer connection ${a.connectionState}`))},d();const r=a.createDataChannel("atterm-terminal-v1",{ordered:!0});if(!r.ordered||r.maxPacketLifeTime!==null||r.maxRetransmits!==null)throw new Error("direct data channel is not ordered and reliable");this.dc=r,r.binaryType="arraybuffer",r.onopen=()=>{try{if(!this.handshake)throw new Error("direct handshake unavailable");r.send(fl(this.handshake.clientHello()))}catch(c){this.fail(c)}},r.onmessage=c=>{if(!(c.data instanceof ArrayBuffer)){this.fail(new Error("direct data channel requires binary messages"));return}const h=new Uint8Array(c.data);this.receiveChain=this.receiveChain.then(()=>this.handleDataMessage(h)).catch(u=>this.fail(u))},r.onerror=()=>this.fail(new Error("direct data channel error")),r.onclose=()=>this.fail(new Error("direct data channel closed"));const o=await a.createOffer();if(await a.setLocalDescription(o),await XS(a),!a.localDescription)throw new Error("direct local offer unavailable");this.sendSignal({kind:"signal",attempt_id:this.attemptId,signal_type:"offer",payload:JSON.stringify(a.localDescription)}),this.sendSignal({kind:"signal",attempt_id:this.attemptId,signal_type:"ice_end",payload:""})}async reportSelectedCandidateType(t){if(typeof t.getStats=="function")try{const n=await t.getStats();if(this.closed||this.pc!==t)return;let i="";const s=new Map;if(n.forEach(o=>{const c=o;s.set(c.id,c),c.type==="transport"&&c.selectedCandidatePairId&&(i=c.selectedCandidatePairId),!i&&c.type==="candidate-pair"&&c.state==="succeeded"&&(c.selected||c.nominated)&&(i=c.id)}),!i)return;const a=s.get(i);if(!(a!=null&&a.localCandidateId))return;const d=s.get(a.localCandidateId),r=d==null?void 0:d.candidateType;if(r!=="host"&&r!=="srflx"&&r!=="prflx"&&r!=="relay")return;this.notifyDiagnostics({iceState:t.iceConnectionState,candidateType:r})}catch{}}async applyRemoteSignal(t){if(!this.pc||typeof t.signal_type!="string"||typeof t.payload!="string")throw new Error("direct peer connection unavailable");switch(t.signal_type){case"answer":{const n=JSON.parse(t.payload);if(!n||typeof n!="object"||n.type!=="answer")throw new Error("invalid direct answer");await this.pc.setRemoteDescription(n);return}case"ice_candidate":{const n=JSON.parse(t.payload);if(!n||typeof n!="object")throw new Error("invalid direct ICE candidate");await this.pc.addIceCandidate(n);return}case"ice_end":return;default:throw new Error("unsupported direct signal")}}async handleDataMessage(t){var i,s;if(!this.handshake||!this.dc)throw new Error("direct handshake unavailable");if(!this.hostHelloHandled){const a=await this.handshake.handleHostHello(t);this.hostHelloHandled=!0,this.dc.send(fl(a));return}if(!this.authenticated){const a=this.handshake.handleAuthOK(t);this.codec=new US(a),this.authenticated=!0,this.timeout!==null&&(window.clearTimeout(this.timeout),this.timeout=null),this.accountKey.fill(0),(s=(i=this.options.callbacks).onAuthenticated)==null||s.call(i);return}if(!this.codec)throw new Error("direct record codec unavailable");const n=this.codec.open(t);switch(n.kind){case _s.Frame:this.options.callbacks.onFrame(n.plaintext);return;case _s.Fragment:{const a=this.reassembler.add(n.plaintext);a&&this.options.callbacks.onFrame(a);return}case _s.DirectReady:{if(n.plaintext.length!==8)throw new Error("invalid DIRECT_READY payload");const a=new DataView(n.plaintext.buffer,n.plaintext.byteOffset,n.plaintext.byteLength).getBigUint64(0,!1);if(a>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("DIRECT_READY sequence exceeds client range");this.options.callbacks.onReady(Number(a));return}case _s.Ping:if(n.plaintext.length!==8)throw new Error("invalid direct PING payload");this.dc.send(fl(this.codec.seal(_s.Pong,n.plaintext)));return;case _s.Pong:if(n.plaintext.length!==8)throw new Error("invalid direct PONG payload");return;case _s.Close:throw new Error("direct peer closed route");default:throw new Error("unsupported direct record")}}sendSignal(t){if(!this.signalWS||this.signalWS.readyState!==WebSocket.OPEN)throw new Error("direct signaling is not open");this.signalWS.send(YS(t))}fail(t){if(this.closed)return;const n=GS(t);if(this.authenticated)try{this.sendSignal({kind:"direct_result",code:"route_lost"})}catch{}this.finish();try{this.options.callbacks.onFailure(n)}catch{}}finish(){var s;if(this.closed)return;this.closed=!0,this.timeout!==null&&(window.clearTimeout(this.timeout),this.timeout=null),this.accountKey.fill(0),(s=this.handshake)==null||s.dispose(),this.handshake=null,this.codec=null,this.reassembler.reset();const t=this.signalWS,n=this.dc,i=this.pc;this.signalWS=null,this.dc=null,this.pc=null;try{t==null||t.close()}catch{}try{n==null||n.close()}catch{}try{i==null||i.close()}catch{}this.signalChain=Promise.resolve(),this.receiveChain=Promise.resolve()}}var Dn=(e=>(e[e.None=0]="None",e[e.Relay=1]="Relay",e[e.Direct=2]="Direct",e))(Dn||{}),Mi=(e=>(e[e.RelayAttached=1]="RelayAttached",e[e.DirectConnecting=2]="DirectConnecting",e[e.DirectReplay=3]="DirectReplay",e[e.DirectActive=4]="DirectActive",e[e.RelayReattaching=5]="RelayReattaching",e))(Mi||{});class Gf{constructor(t=0){q(this,"routeState",1);q(this,"routeGeneration",1);q(this,"lastCommittedSeq");q(this,"directStartSeq",0);q(this,"directObservedSeq",0);q(this,"directReady",!1);this.lastCommittedSeq=t}get state(){return this.routeState}get generation(){return this.routeGeneration}get committedSeq(){return this.lastCommittedSeq}beginDirect(){if(this.routeState!==1)throw new Error("invalid direct route transition");return this.routeState=2,this.directStartSeq=this.lastCommittedSeq,this.directObservedSeq=this.lastCommittedSeq,this.directReady=!1,this.routeGeneration}beginDirectReplay(t){if(this.requireGeneration(t),this.routeState!==2)throw new Error("invalid direct route transition");this.routeState=3}noteDirectReady(t,n){if(this.requireGeneration(t),this.routeState!==3||!Number.isSafeInteger(n)||n=this.lastCommittedSeq}activateDirect(t){if(this.requireGeneration(t),!this.canActivateDirect(t))throw new Error("invalid direct route transition");this.routeState=4}abortDirect(t){if(this.requireGeneration(t),this.routeState!==2&&this.routeState!==3)throw new Error("invalid direct route transition");this.routeGeneration++,this.routeState=1}directLost(t){if(this.requireGeneration(t),this.routeState!==4)throw new Error("invalid direct route transition");return this.routeGeneration++,this.routeState=5,this.routeGeneration}relayAttached(t){if(this.requireGeneration(t),this.routeState!==5)throw new Error("invalid direct route transition");this.routeState=1}inputRoute(){switch(this.routeState){case 1:case 2:case 3:return 1;case 4:return 2;default:return 0}}acceptOutput(t,n,i){if(t!==this.routeGeneration||i<=0)return!1;let s=!1;switch(this.routeState){case 1:case 2:case 5:s=n===1;break;case 3:s=n===1||n===2;break;case 4:s=n===2;break}return!s||(n===2&&this.routeState===3&&(this.directObservedSeq=Math.max(this.directObservedSeq,i)),i<=this.lastCommittedSeq)?!1:(this.lastCommittedSeq=i,!0)}acceptsRoute(t,n){if(t!==this.routeGeneration)return!1;switch(this.routeState){case 1:case 2:case 5:return n===1;case 3:return n===1||n===2;case 4:return n===2}return!1}requireGeneration(t){if(t!==this.routeGeneration)throw new Error("stale direct route generation")}}function Xf(e,t=!1){const n=xt(e).toLowerCase();return n.includes("rtcpeerconnection")||n.includes("webrtc is unavailable")?"webrtc_unavailable":n.includes("timed out")||n.includes("ticket_expired")?"timeout":n.includes("host_offline")||n.includes("peer_disconnected")?"host_unavailable":n.includes("signaling rejected")||n.includes("signaling disconnected")?"signaling_rejected":n.includes("peer connection failed")||n.includes("ice")?"ice_failed":n.includes("handshake")||n.includes("proof")||n.includes("auth")?"authentication_failed":n.includes("backpressure")?"backpressure":n.includes("unsupported")||n.includes("invalid direct")||n.includes("record")?"protocol_error":t||n.includes("disconnected")||n.includes("channel closed")||n.includes("peer closed")?"direct_disconnected":"transport_error"}const Jf=10*1024*1024,ZS=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,QS=3e4,eC=3e4;function Zf(e,t){return e!==WebSocket.OPEN?cn("terminal.websocketNotOpen"):t>Jf?cn("terminal.imageTooLarge",{size:t,limit:Jf}):null}function mu(e){const t=new Uint8Array(e);let n="";const i=32768;for(let s=0;st?`${i}…`:i}class Qf{constructor(t,n){q(this,"ws",null);q(this,"reconnectAttempts",0);q(this,"reconnectTimer",null);q(this,"detached",!1);q(this,"listParseFailures",0);this.endpoint=t,this.handlers=n}attach(){this.detached||this.openWS()}detach(){if(this.detached=!0,this.reconnectTimer!==null&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws){try{this.ws.close()}catch{}this.ws=null}}openWS(){var i,s;if(this.detached)return;const t=bu(this.endpoint,"/client-sessions");let n;try{n=t.protocols?new WebSocket(t.url,t.protocols):new WebSocket(t.url)}catch(a){this.handleOpenFailure(a,t);return}n.binaryType="arraybuffer",this.ws=n,(s=(i=this.handlers).onStatus)==null||s.call(i,this.reconnectAttempts>0?"reconnecting":"connecting"),n.onopen=()=>{var a,d;(d=(a=this.handlers).onStatus)==null||d.call(a,"attached")},n.onmessage=a=>{var o,c;let d;try{d=uu(new Uint8Array(a.data))}catch{return}if(this.reconnectAttempts=0,d.type===tn.PREFS_CHANGED){(c=(o=this.handlers).onPrefsChanged)==null||c.call(o);return}if(d.type!==tn.LIST_RESP)return;let r;try{r=Bm(JSON.parse($s(d.payload)))}catch(h){this.noteUnusableListFrame(d.payload,h);return}this.listParseFailures=0;try{this.handlers.onSessions(r)}catch(h){Pt("conn","session list handler threw",{url:this.endpoint.url,error:xt(h)})}},n.onclose=()=>{var d,r;if(this.ws=null,this.detached)return;(r=(d=this.handlers).onStatus)==null||r.call(d,"reconnecting");const a=Math.min(8e3,500*Math.pow(2,this.reconnectAttempts++));this.reconnectTimer=window.setTimeout(()=>this.openWS(),a)},n.onerror=()=>{}}noteUnusableListFrame(t,n){this.listParseFailures++;const i=this.listParseFailures;i!==1&&i%100!==0||Pt("conn","dropping unusable LIST_RESP",{url:this.endpoint.url,consecutive:i,payload_len:t.length,payload_head:cC(t),error:xt(n)})}handleOpenFailure(t,n){var a,d,r;const i=t;if(Gi("conn","session-list: new WebSocket failed",{url:n.url,protocols:(a=n.protocols)==null?void 0:a.join(","),name:i==null?void 0:i.name,message:(i==null?void 0:i.message)??String(t)}),this.ws=null,(r=(d=this.handlers).onStatus)==null||r.call(d,"error"),this.detached)return;const s=Math.min(8e3,500*Math.pow(2,this.reconnectAttempts++));this.reconnectTimer=window.setTimeout(()=>this.openWS(),s)}}function dC(e,t){const n=ys();if(!n)return zf([Xn(JSON.stringify(e))]);const i=Xn(JSON.stringify({path:e.path,new_path:e.new_path})),s=Lm(n,t,tn.FS_REQUEST,i),a={...e};return delete a.path,delete a.new_path,zf([Xn(JSON.stringify(a)),s])}function ep(e){let t="";for(const n of e)t+=String.fromCharCode(n);return btoa(t)}class Fm{constructor(t,n,i={},s={}){q(this,"ws",null);q(this,"sidBytes");q(this,"lastSeq",0);q(this,"route",new Gf);q(this,"direct",null);q(this,"directAttempted",!1);q(this,"reconnectAttempts",0);q(this,"reconnectTimer",null);q(this,"detached",!1);q(this,"suspended",!1);q(this,"pendingResize",null);q(this,"pendingInputs",[]);q(this,"clientID");q(this,"clientName");q(this,"remote");q(this,"preferDirect");q(this,"directEndpoint");q(this,"directTransportFactory");q(this,"directTransportSupported");q(this,"pendingDriverClaim",!1);q(this,"relayReplayComplete",!1);q(this,"directStartedAt",0);q(this,"directDiagnostics",null);q(this,"lastFallbackReason");q(this,"currentDriverClientID","");q(this,"isDriverRole",!1);q(this,"recoverDriverIfVacant",!1);q(this,"recoverDriverVacant",!1);q(this,"pendingFSRequests",new Map);q(this,"retiredFSRequestIDs",new Set);q(this,"fsEventHandlers",new Set);q(this,"pendingServiceOpens",new Map);this.endpoint=t,this.sessionId=n,this.handlers=i,this.sidBytes=T1(n),this.clientID=crypto.randomUUID(),this.clientName=(s.clientName??"").trim()||nC(),this.remote=s.remote??!1,this.preferDirect=s.preferDirect??!1,this.directEndpoint=s.directEndpoint??null;const a=s.directTransportFactory;this.directTransportFactory=a??(d=>new JS(d)),this.directTransportSupported=a?()=>!0:()=>typeof globalThis.RTCPeerConnection=="function"}decryptOut(t,n){if(t.length<41||t[0]!==1)return t;const s=ys();return s?fS(t,s,this.sessionId,n):null}attach(){this.detached||(this.suspended&&(this.route=new Gf(this.lastSeq),this.directAttempted=!1,this.relayReplayComplete=!1),this.suspended=!1,!(this.ws||this.reconnectTimer!==null)&&this.openWS(this.route.generation))}setPreferDirect(t){var i,s;if(this.preferDirect===t)return;if(this.preferDirect=t,t){this.directAttempted=!1,this.relayReplayComplete&&this.maybeStartDirect();return}const n=this.direct;if(this.direct=null,n==null||n.close(),this.route.state===Mi.DirectConnecting||this.route.state===Mi.DirectReplay){try{this.route.abortDirect(this.route.generation)}catch{}this.emitRoute("relay","preference_disabled");return}if(this.route.state===Mi.DirectActive){const a=this.route.directLost(this.route.generation);this.emitRoute("relay","preference_disabled"),(s=(i=this.handlers).onStatus)==null||s.call(i,"reconnecting"),this.openWS(a)}}suspend(){var t;if(!this.detached&&(this.suspended=!0,this.rejectPendingFSRequests(new Error("filesystem request failed: connection suspended")),this.rejectPendingServiceOpens(new Error("service preview failed: connection suspended")),this.retiredFSRequestIDs.clear(),(t=this.direct)==null||t.close(),this.direct=null,this.pendingDriverClaim=!1,this.reconnectTimer!==null&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws)){try{this.ws.close()}catch{}this.ws=null}}detach(){var t;if(this.detached=!0,this.suspended=!1,this.rejectPendingFSRequests(new Error("filesystem request failed: connection detached")),this.rejectPendingServiceOpens(new Error("service preview failed: connection detached")),this.retiredFSRequestIDs.clear(),(t=this.direct)==null||t.close(),this.direct=null,this.pendingDriverClaim=!1,this.reconnectTimer!==null&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws){try{this.ws.close()}catch{}this.ws=null}}sendFSRequest(t,n=QS){const i=this.ws;if(!i||i.readyState!==WebSocket.OPEN)return Promise.reject(new Error("filesystem request failed: websocket is not open"));const s=t.request_id||this.newUniqueFSRequestID();if(this.pendingFSRequests.has(s))return Promise.reject(new Error(`duplicate filesystem request_id: ${s}`));if(this.retiredFSRequestIDs.has(s))return Promise.reject(new Error(`retired filesystem request_id after timeout: ${s}`));const a={...t,request_id:s},d=dC(a,this.sessionId);return new Promise((r,o)=>{const c=window.setTimeout(()=>{this.pendingFSRequests.delete(s),this.retiredFSRequestIDs.add(s),o(new Error(`filesystem request timed out: ${s}`))},n);this.pendingFSRequests.set(s,{resolve:r,reject:o,timer:c});try{i.send(Kn(tn.FS_REQUEST,this.sidBytes,d))}catch(h){window.clearTimeout(c),this.pendingFSRequests.delete(s),o(h instanceof Error?h:new Error(String(h)))}})}openService(t,n="localhost",i=eC){const s=this.ws;if(!s||s.readyState!==WebSocket.OPEN)return Promise.reject(new Error("service preview failed: websocket is not open"));if(!Number.isInteger(t)||t<1||t>65535)return Promise.reject(new Error("service preview failed: invalid port"));if(!["localhost","127.0.0.1","::1"].includes(n))return Promise.reject(new Error("service preview failed: target must be loopback"));const a=ys();if(!a||a.length!==32)return Promise.reject(new Error("service preview requires unlocked E2EE"));const d=crypto.randomUUID(),r=crypto.randomUUID(),o=gS(a,r),c=Lm(a,this.sessionId,tn.SERVICE_OPEN,Xn(JSON.stringify({port:t,scheme:"http",host:n}))),h=Xn(JSON.stringify({request_id:d,service_id:r,sealed:ep(c)}));return new Promise((u,v)=>{const m=window.setTimeout(()=>{this.pendingServiceOpens.delete(d),v(new Error("service preview timed out"))},i);this.pendingServiceOpens.set(d,{serviceId:r,resolve:u,reject:v,timer:m,clientToHostKey:o.clientToHost,hostToClientKey:o.hostToClient});try{s.send(Kn(tn.SERVICE_OPEN,this.sidBytes,h))}catch(b){window.clearTimeout(m),this.pendingServiceOpens.delete(d),v(b instanceof Error?b:new Error(String(b)))}})}closeService(t){const n=this.ws;if(!(!n||n.readyState!==WebSocket.OPEN))try{n.send(Kn(tn.SERVICE_CLOSE,this.sidBytes,Xn(JSON.stringify({service_id:t}))))}catch{}}onFSEvent(t){return this.fsEventHandlers.add(t),()=>{this.fsEventHandlers.delete(t)}}sendInput(t){var i;const n=this.route.inputRoute();if(n===Dn.Direct){(i=this.direct)!=null&&i.sendFrame(Kn(tn.IN,this.sidBytes,Xn(t)))||this.pendingInputs.push(t);return}if(n===Dn.None){this.pendingInputs.push(t);return}if(!this.ws||this.ws.readyState===WebSocket.CONNECTING){this.pendingInputs.push(t);return}this.ws.readyState===WebSocket.OPEN&&this.ws.send(Kn(tn.IN,this.sidBytes,Xn(t)))}claimDriver(){var s,a;if(this.detached||this.suspended)return!1;const t=Xn(JSON.stringify({client_id:this.clientID,client_name:this.clientName})),n=Kn(tn.CLAIM_DRIVER,this.sidBytes,t),i=this.route.inputRoute();return i===Dn.Direct?(s=this.direct)!=null&&s.sendFrame(n)?(this.pendingDriverClaim=!1,!0):(this.pendingDriverClaim=!0,!1):i===Dn.Relay&&((a=this.ws)==null?void 0:a.readyState)===WebSocket.OPEN?(this.ws.send(n),this.pendingDriverClaim=!1,!0):(this.pendingDriverClaim=!0,!1)}async sendPasteImage(t,n="clipboard-image"){var d,r;const i=this.ws,s=Zf(i==null?void 0:i.readyState,t.size);if(s||!i)throw(r=(d=this.handlers).onStatus)==null||r.call(d,"error"),new Error(s??"websocket is not open");const a=Xn(JSON.stringify({filename:n,content_type:t.type||"image/png",data:mu(await t.arrayBuffer())}));return ss("conn","sending paste image",{filename:n,contentType:t.type||"image/png",bytes:t.size}),i.send(Kn(tn.PASTE_IMAGE,this.sidBytes,a)),!0}async sendPasteFile(t,n){var d,r;const i=this.ws,s=Zf(i==null?void 0:i.readyState,t.size);if(s||!i)throw(r=(d=this.handlers).onStatus)==null||r.call(d,"error"),new Error(s??"websocket is not open");const a=Xn(JSON.stringify({filename:n,content_type:t.type||"application/octet-stream",data:mu(await t.arrayBuffer())}));return ss("conn","sending paste file",{filename:n,contentType:t.type||"application/octet-stream",bytes:t.size}),i.send(Kn(tn.PASTE_FILE,this.sidBytes,a)),!0}sendResize(t,n){var s;if(this.route.inputRoute()===Dn.Direct){(s=this.direct)!=null&&s.sendFrame(Kn(tn.RESIZE,this.sidBytes,ul(t,n)))?this.pendingResize=null:this.pendingResize={cols:t,rows:n};return}if(this.ws&&this.ws.readyState===WebSocket.OPEN){this.ws.send(Kn(tn.RESIZE,this.sidBytes,ul(t,n))),this.pendingResize=null;return}this.pendingResize={cols:t,rows:n}}openWS(t){var s,a;if(this.detached||this.suspended||!this.route.acceptsRoute(t,Dn.Relay))return;const n=bu(this.endpoint,"/client");let i;try{i=n.protocols?new WebSocket(n.url,n.protocols):new WebSocket(n.url)}catch(d){this.handleOpenFailure(d,n,t);return}i.binaryType="arraybuffer",this.ws=i,(a=(s=this.handlers).onStatus)==null||a.call(s,this.reconnectAttempts===0?"connecting":"reconnecting"),i.onopen=()=>{var r,o;if(this.ws!==i||!this.route.acceptsRoute(t,Dn.Relay)){try{i.close()}catch{}return}this.retiredFSRequestIDs.clear(),this.recoverDriverIfVacant=this.isDriverRole,this.recoverDriverVacant=!1,this.route.state!==Mi.RelayReattaching&&((o=(r=this.handlers).onStatus)==null||o.call(r,"attached"));const d=Xn(JSON.stringify({session_id:this.sessionId,since_seq:this.route.committedSeq,client_id:this.clientID,client_name:this.clientName}));i.send(Kn(tn.ATTACH,this.sidBytes,d)),this.route.inputRoute()===Dn.Relay&&this.flushPendingRelayWrites(i)},i.onmessage=d=>{if(this.ws!==i||!this.route.acceptsRoute(t,Dn.Relay))return;let r;try{r=uu(new Uint8Array(d.data))}catch{return}this.reconnectAttempts=0,this.handleProtocolFrame(r,Dn.Relay,t)},i.onclose=d=>{var o,c;if(this.ws!==i||(this.ws=null,this.rejectPendingFSRequests(new Error("filesystem request failed: websocket closed")),this.rejectPendingServiceOpens(new Error("service preview failed: websocket closed")),this.retiredFSRequestIDs.clear(),this.detached||this.suspended))return;Pt("conn","session websocket closed",{sessionId:this.sessionId,code:d==null?void 0:d.code,reason:d==null?void 0:d.reason,wasClean:d==null?void 0:d.wasClean,attempt:this.reconnectAttempts}),(c=(o=this.handlers).onStatus)==null||c.call(o,"reconnecting");const r=Math.min(8e3,500*Math.pow(2,this.reconnectAttempts++));this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.openWS(this.route.generation)},r)},i.onerror=()=>{}}handleProtocolFrame(t,n,i){var s,a,d,r,o,c,h,u,v,m,b,g,l,f,p,y;if(this.route.acceptsRoute(i,n)){if(!this.sameSessionID(t.sid)){if(n===Dn.Direct)throw new Error("direct frame session mismatch");return}if(t.type===tn.OUT){const{seq:C,data:k}=E1(t.payload);if(C===0){if(n===Dn.Direct)throw new Error("direct OUT is missing sequence");const I=this.remote?this.decryptOut(k,C):k;I&&((a=(s=this.handlers).onOutput)==null||a.call(s,I));return}if(!this.route.acceptOutput(i,n,C)){ss("conn","dropping duplicate OUT",{sessionId:this.sessionId,seq:C,lastSeq:this.route.committedSeq,route:n===Dn.Direct?"direct":"relay"}),n===Dn.Direct&&this.maybeActivateDirect(i);return}const E=this.remote?this.decryptOut(k,C):k;E&&((r=(d=this.handlers).onOutput)==null||r.call(d,E)),this.lastSeq=this.route.committedSeq,n===Dn.Direct&&this.maybeActivateDirect(i);return}if(t.type===tn.CLOSE){try{(c=(o=this.handlers).onClose)==null||c.call(o,JSON.parse($s(t.payload)))}catch{(u=(h=this.handlers).onClose)==null||u.call(h,{exit_code:0})}(m=(v=this.handlers).onStatus)==null||m.call(v,"ended"),(b=this.direct)==null||b.close(),this.direct=null;return}if(t.type===tn.META){this.handleMeta(t.payload,n);return}if(t.type===tn.REPLAY_PROGRESS){let C;try{C=JSON.parse($s(t.payload))}catch{return}(l=(g=this.handlers).onReplayProgress)==null||l.call(g,C),n===Dn.Relay&&C.phase==="end"&&(this.relayReplayComplete=!0,this.route.state===Mi.RelayReattaching?(this.route.relayAttached(i),(p=(f=this.handlers).onStatus)==null||p.call(f,"attached"),this.emitRoute("relay",this.lastFallbackReason),this.recoverDriverIfVacant&&this.recoverDriverVacant&&(this.recoverDriverIfVacant=!1,this.recoverDriverVacant=!1,this.claimDriver()),((y=this.ws)==null?void 0:y.readyState)===WebSocket.OPEN&&this.flushPendingRelayWrites(this.ws)):this.maybeStartDirect());return}if(n===Dn.Direct)throw new Error(`unsupported direct frame type 0x${t.type.toString(16).padStart(2,"0")}`);t.type===tn.FS_RESPONSE?this.handleFSResponse(t.payload):t.type===tn.FS_EVENT?this.handleFSEvent(t.payload):t.type===tn.SERVICE_OPENED&&this.handleServiceOpened(t.payload)}}handleMeta(t,n){var s,a,d,r;let i;try{const o=JSON.parse($s(t));if(!Ho(o))throw new Error("META is not an object");i=o;const c=ys();if(c&&typeof i.sealed=="string"&&i.sealed.length>0){const h=vS(ph(i.sealed),c,this.sessionId);h&&(h.cwd!==void 0&&(i.cwd=h.cwd),h.title!==void 0&&(i.title=h.title),h.current_command!==void 0&&(i.current_command=h.current_command))}}catch(o){if(n===Dn.Direct)throw new Error(`invalid direct META: ${xt(o)}`);return}try{(a=(s=this.handlers).onMeta)==null||a.call(s,i);const o=String(i.driver_client_id??""),c=String(i.driver_client_name??"");if(n===Dn.Relay&&this.recoverDriverIfVacant){if(o===""){this.recoverDriverVacant=!0,this.route.state!==Mi.RelayReattaching&&(this.recoverDriverIfVacant=!1,this.recoverDriverVacant=!1,this.claimDriver());return}this.recoverDriverIfVacant=!1,this.recoverDriverVacant=!1}if(o!==this.currentDriverClientID){this.currentDriverClientID=o;const h=o!==""&&o===this.clientID;this.isDriverRole=h,(r=(d=this.handlers).onDriverChange)==null||r.call(d,o,h,c)}}catch{}}maybeStartDirect(){if(!this.preferDirect||!this.remote||this.directAttempted||this.route.state!==Mi.RelayAttached||this.detached||this.suspended)return;if(!this.directEndpoint){this.directAttempted=!0,this.emitRoute("relay","signal_endpoint_unavailable");return}if(!this.directTransportSupported()){this.directAttempted=!0,this.emitRoute("relay","webrtc_unavailable");return}const t=ys();if(!t||t.length!==32){this.directAttempted=!0,this.emitRoute("relay","account_key_unavailable");return}this.directAttempted=!0,this.directStartedAt=performance.now(),this.directDiagnostics=null,this.lastFallbackReason=void 0;const n=this.route.beginDirect();this.emitRoute("connecting-direct");const i=bu(this.directEndpoint,"/direct-signal");let s;try{s=this.directTransportFactory({signalURL:i.url,signalProtocols:i.protocols,sessionId:this.sessionId,sinceSeq:this.route.committedSeq,clientInstanceId:this.clientID,accountKey:t,callbacks:{onAuthenticated:()=>{this.direct!==s||n!==this.route.generation||this.route.beginDirectReplay(n)},onFrame:a=>{this.direct!==s||n!==this.route.generation||this.handleProtocolFrame(uu(a),Dn.Direct,n)},onReady:a=>{this.direct!==s||n!==this.route.generation||(this.route.noteDirectReady(n,a),this.maybeActivateDirect(n))},onDiagnostics:a=>{this.direct!==s||n!==this.route.generation||(this.directDiagnostics=a,this.emitRoute(this.route.state===Mi.DirectActive?"direct":"connecting-direct"))},onFailure:a=>this.handleDirectFailure(n,s,a)}}),this.direct=s,s.start()}catch(a){if(this.route.generation===n)try{this.route.abortDirect(n)}catch{}this.direct=null,this.lastFallbackReason=Xf(a),this.emitRoute("relay",this.lastFallbackReason),Pt("direct","direct attempt setup failed",{sessionId:this.sessionId,error:xt(a)})}}maybeActivateDirect(t){const n=this.direct;if(!n||!this.route.canActivateDirect(t))return;if(this.isDriverRole){const s=Xn(JSON.stringify({client_id:this.clientID,client_name:this.clientName}));if(!n.sendFrame(Kn(tn.CLAIM_DRIVER,this.sidBytes,s)))return}this.route.activateDirect(t),this.emitRoute("direct"),this.reconnectTimer!==null&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const i=this.ws;this.ws=null,this.rejectPendingFSRequests(new Error("filesystem request failed: direct terminal route activated")),this.rejectPendingServiceOpens(new Error("service preview failed: direct terminal route activated")),this.retiredFSRequestIDs.clear();try{i==null||i.close()}catch{}this.flushPendingDirectWrites(n)}handleDirectFailure(t,n,i){var d,r;if(this.direct!==n||t!==this.route.generation)return;this.direct=null;const s=this.route.state===Mi.DirectActive;if(this.lastFallbackReason=Xf(i,s),Pt("direct","direct route failed",{sessionId:this.sessionId,error:xt(i)}),this.route.state===Mi.DirectConnecting||this.route.state===Mi.DirectReplay){this.route.abortDirect(t),this.emitRoute("relay",this.lastFallbackReason);return}if(this.route.state!==Mi.DirectActive||this.detached||this.suspended)return;const a=this.route.directLost(t);this.emitRoute("relay",this.lastFallbackReason),(r=(d=this.handlers).onStatus)==null||r.call(d,"reconnecting"),this.openWS(a)}emitRoute(t,n){var s,a,d,r;const i=this.directStartedAt>0&&t!=="relay"?Math.max(0,Math.round(performance.now()-this.directStartedAt)):void 0;try{(r=(d=this.handlers).onRouteChange)==null||r.call(d,{route:t,...(s=this.directDiagnostics)!=null&&s.iceState?{iceState:this.directDiagnostics.iceState}:{},...(a=this.directDiagnostics)!=null&&a.candidateType?{candidateType:this.directDiagnostics.candidateType}:{},...i!==void 0?{setupTimeMs:i}:{},...n?{fallbackReason:n}:{}})}catch{}}flushPendingRelayWrites(t){if(this.pendingDriverClaim){const n=Xn(JSON.stringify({client_id:this.clientID,client_name:this.clientName}));t.send(Kn(tn.CLAIM_DRIVER,this.sidBytes,n)),this.pendingDriverClaim=!1}if(this.pendingResize){const{cols:n,rows:i}=this.pendingResize;t.send(Kn(tn.RESIZE,this.sidBytes,ul(n,i))),this.pendingResize=null}if(this.pendingInputs.length>0){const n=this.pendingInputs;this.pendingInputs=[];for(const i of n)t.send(Kn(tn.IN,this.sidBytes,Xn(i)))}}flushPendingDirectWrites(t){if(this.pendingDriverClaim){const n=Xn(JSON.stringify({client_id:this.clientID,client_name:this.clientName}));if(!t.sendFrame(Kn(tn.CLAIM_DRIVER,this.sidBytes,n)))return;this.pendingDriverClaim=!1}if(this.pendingResize){const{cols:n,rows:i}=this.pendingResize;if(!t.sendFrame(Kn(tn.RESIZE,this.sidBytes,ul(n,i))))return;this.pendingResize=null}for(;this.pendingInputs.length>0;){const n=this.pendingInputs[0];if(!t.sendFrame(Kn(tn.IN,this.sidBytes,Xn(n))))return;this.pendingInputs.shift()}}sameSessionID(t){if(t.length!==this.sidBytes.length)return!1;for(let n=0;n{this.reconnectTimer=null,this.openWS(this.route.generation)},a)}newFSRequestID(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`fs-${crypto.randomUUID()}`:`fs-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}handleServiceOpened(t){let n;try{n=JSON.parse($s(t))}catch{return}if(!n.request_id)return;const i=this.pendingServiceOpens.get(n.request_id);if(i){if(window.clearTimeout(i.timer),this.pendingServiceOpens.delete(n.request_id),!n.ok||!n.client_ticket||n.service_id!==i.serviceId){i.reject(new Error(n.error||"service preview rejected"));return}i.resolve({serviceId:i.serviceId,clientTicket:n.client_ticket,clientToHostKey:i.clientToHostKey,hostToClientKey:i.hostToClientKey})}}rejectPendingServiceOpens(t){for(const n of this.pendingServiceOpens.values())window.clearTimeout(n.timer),n.reject(t);this.pendingServiceOpens.clear()}newUniqueFSRequestID(){for(let t=0;t<5;t++){const n=this.newFSRequestID();if(!this.pendingFSRequests.has(n))return n}return`fs-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}handleFSResponse(t){const n=Vf(t);if(!n)return;let i;try{const a=JSON.parse($s(n[0]));if(!lC(a))return;i=a}catch{return}if(n.length>1&&!this.openSealedFSResponse(i,n))return;const s=this.pendingFSRequests.get(i.request_id);s&&(window.clearTimeout(s.timer),this.pendingFSRequests.delete(i.request_id),s.resolve(i))}handleFSEvent(t){const n=Vf(t);if(!n)return;let i;try{const s=JSON.parse($s(n[0]));if(!s||typeof s.watch_id!="string"||typeof s.event!="string")return;if(n.length>1){const a=ys();if(!a)return;const d=Il(a,this.sessionId,tn.FS_EVENT,n[1]);if(!d)return;const r=JSON.parse($s(d));s.path=r.path??""}if(typeof s.path!="string")return;i=s}catch{return}for(const s of this.fsEventHandlers)try{s(i)}catch(a){Pt("conn","fs event handler threw",{error:xt(a)})}}openSealedFSResponse(t,n){const i=ys();if(!i)return!1;const s=Il(i,this.sessionId,tn.FS_RESPONSE,n[1]);if(!s)return!1;try{Object.assign(t,JSON.parse($s(s)))}catch{return!1}if(n.length>2){const a=Il(i,this.sessionId,tn.FS_RESPONSE,n[2]);if(!a)return!1;const d=ep(a);t.content?t.content.data=d:t.chunk&&(t.chunk.data=d)}return!0}rejectPendingFSRequests(t){if(this.pendingFSRequests.size===0)return;const n=Array.from(this.pendingFSRequests.values());this.pendingFSRequests.clear();for(const i of n)window.clearTimeout(i.timer),i.reject(t)}}function Bm(e){const t=ys();return t?e.map(n=>{if(!n.sealed)return n;try{const i=uS(ph(n.sealed),t,n.id);if(!i)return n;const s={...n};return i.title!==void 0&&(s.title=i.title),i.cwd!==void 0&&(s.cwd=i.cwd),i.command!==void 0&&(s.command=i.command),i.current_command!==void 0&&(s.current_command=i.current_command),s}catch{return n}}):e}function uC(){return Ue().GetUplinkHealth()}function Xl(){return Ue().GetRelayConfig()}function tp(e){return Ue().SetRelayConfig({url:e.url,token:e.token,session_expires_at:e.session_expires_at??0,allow_insecure_relay:e.allow_insecure_relay??!1,disable_e2ee:e.disable_e2ee??!1,remote_permission:e.remote_permission??"full",last_email:e.last_email??"",connected:!1})}function hC(){return Ue().ClearRelayConfig()}function fC(e){return Ue().SetRelayDisableE2EE(e)}function pC(e){return Ue().SetUplinkPaused(e)}function vC(e,t,n,i){return Ue().LoginRemoteRelay(e,t,n,i)}function gC(e,t,n,i,s){return Ue().RegisterRemoteRelay(e,t,n,i,s)}function mC(){return Ue().LoadSavedRelayPassword()}function _C(e){return Ue().RememberRelayPassword(e)}function yC(e,t){return Ue().ProbeRelayVersion(e,t)}function np(){return Ue().FetchRelayMe()}function bC(){return Ue().CreatePairingToken()}function wC(e){return Ue().GetDiagnostics(e)}function SC(e){return Ue().ExportDiagnostics(e)}async function CC(){const e=await Ue().ListRemoteSessions(),t=JSON.parse(e);return Bm(t??[])}const kC={host:"",fingerprint:""};function xC(e){return Ue().NewSshSession(e)}function Hm(e,t=kC){return Ue().NewSshSessionByID(e,t)}function Nm(){return Ue().ListSSHHosts()}function ip(e,t){return Ue().AddSSHHost(e,t)}function ud(e,t){return Ue().UpdateSSHHost(e,t)}function RC(e){return Ue().DeleteSSHHost(e)}function TC(){return Ue().PreviewSSHConfigImport()}function EC(e){return Ue().ImportSSHHosts(e)}function PC(e,t){return Ue().StartForward(e,t)}function sp(e,t){return Ue().StopForward(e,t)}function LC(){return Ue().ListActiveForwards()}function Bte(){return Ue().ListSFTPHosts()}function Hte(e,t){return Ue().SFTPListDir(e,t)}function Nte(e,t){return Ue().SFTPFileMeta(e,t)}function Ute(e,t,n){return Ue().SFTPReadFile(e,t,n)}function zte(e,t,n,i,s){return Ue().SFTPWriteFile(e,t,Array.from(n),i,s)}function Vte(e,t){return Ue().SFTPCreateFile(e,t)}function Kte(e,t){return Ue().SFTPMkdir(e,t)}function Wte(e,t,n){return Ue().SFTPRename(e,t,n)}function jte(e,t,n){return Ue().SFTPRemove(e,t,n)}function qte(e){return Ue().SFTPDisconnect(e)}function DC(){return Ue().ListSSHKeys()}function IC(e,t,n){return Ue().AddSSHKey(e,t,n)}function MC(e,t,n,i){return Ue().UpdateSSHKey(e,t,n,i)}function AC(e){return Ue().DeleteSSHKey(e)}function rp(e){return Ue().RevealSSHKey(e)}function op(){return Ue().GetFeishuModePref()}function $C(e){return Ue().SetFeishuModePref(e)}function ap(){return Ue().GetFeishuEffectiveMode()}function hd(){return Ue().GetFeishuRemoteTerminalSettings()}function lp(e,t){return Ue().SetFeishuRemoteTerminalSettings(e,t)}function OC(){return Ue().GetFeishuStatus()}function FC(e){return Ue().SetFeishuCredentials(e)}function BC(){return Ue().BeginFeishuPair()}function HC(){return Ue().DeleteFeishuBinding()}function NC(e){return Ue().SendFeishuTestCard(e)}function UC(){return Ue().GetHookInstallState()}function cp(e){return Ue().SetHookInstallEnabled(e)}function Um(){return Ue().GetTaskPreset()}function zC(e){return Ue().SetTaskPreset(e)}function VC(){return Ue().GetTaskGroupBy()}function KC(e){return Ue().SetTaskGroupBy(e)}function zm(){return Ue().GetTaskSidebarCollapsed()}function Vm(e){return Ue().SetTaskSidebarCollapsed(e)}function WC(){return Ue().GetTaskSidebarWidth()}function jC(e){return Ue().SetTaskSidebarWidth(e)}function qC(e){return"all"in e&&e.all?Ue().MarkSessionsSeen([],!0):Ue().MarkSessionsSeen(e.ids,!1)}function YC(e,t,n,i){return Ue().BroadcastCommandFinished(e,t,n,i)}function xo(){return Ue().GetUpdateState()}function Km(){return Ue().CheckUpdate()}function Wm(){return Ue().StartDownload()}function GC(e){return Ue().DownloadVersion(e)}function jm(){return Ue().CancelDownload()}function dp(e){return Ue().ForceRedownload(e)}function qm(){return Ue().InstallUpdate()}function Ym(){return Ue().GetAutoCheckUpdates()}function XC(e){return Ue().SetAutoCheckUpdates(e)}function up(){return Ue().GetUpdateGHProxyURL()}function JC(e){return Ue().SetUpdateGHProxyURL(e)}function ZC(){return Ue().LoadRecoverySnapshot()}function QC(e){return Ue().SaveRecoverySnapshot(JSON.stringify(e))}function ek(){return Ue().DiscardRecoverySnapshot()}function Gm(){return Ue().GetRecoveryDialogEnabled()}function tk(e){return Ue().SetRecoveryDialogEnabled(e)}function nk(e,t,n){return Ue().RunSnippetOnHosts(e,t,n)}function ik(e){return Ue().CancelSnippetRun(e)}function sk(){return Ue().GetSyncStatus()}function rk(){return Ue().SyncNow()}function ok(e){return Ue().ExportConfig(e)}function ak(e){return Ue().PreviewConfigImport(e)}function lk(e){return Ue().ApplyConfigImport(e)}let Ol,wu=0;function ck(){Ol=void 0,wu=0}async function dk(){return Ol||(Ol=(async()=>{try{return await w1()?(await b1(),await C1()?!0:await S1()):!1}catch{return!1}})()),Ol}function uk(){return Ue().GetClipboardPastePayload()}function hk(){const e=Ue();return e.GetStartupError?e.GetStartupError():Promise.resolve({fatal:!1,message:"",log_path:""})}function fk(){return Ue().GetEndpoint()}function Xm(e){return Ue().NewSession(e)}function hp(e){return Ue().CloseSession(e)}let pa=null;function mh(){return pa||(pa=Ue().ListShells().catch(e=>{throw pa=null,e})),pa}function Jm(){return Ue().GetHostInfo()}function da(){return Ue().GetLoggingConfig()}function pl(e){return Ue().SetLoggingConfig({enabled:e.enabled,path:e.path??"",effective_path:"",dev_dual_output:!1,level:e.level??""})}function pk(){return Ue().PickLogFilePath()}function Zm(){return Ue().GetLogPreview()}function Qm(){return Ue().GetTerminalTheme()}function vk(e){return Ue().SetTerminalTheme(e)}function e_(){return Ue().GetShortcutBindings()}function gk(e){return Ue().SetShortcutBindings(e)}function t_(){return Ue().GetTerminalFontHead()}function mk(e){return Ue().SetTerminalFontHead(e)}function n_(){return Ue().GetTerminalFontSize()}function _k(e){return Ue().SetTerminalFontSize(e)}function i_(){return Ue().GetTerminalLineHeight()}function yk(e){return Ue().SetTerminalLineHeight(e)}function s_(){return Ue().GetTerminalCursorStyle()}function bk(e){return Ue().SetTerminalCursorStyle(e)}function r_(){return Ue().GetTerminalCursorBlink()}function wk(e){return Ue().SetTerminalCursorBlink(e)}function o_(){return Ue().GetTerminalScrollback()}function Sk(e){return Ue().SetTerminalScrollback(e)}function Ck(){return Ue().GetLocalePreference()}function kk(){return Ue().GetDefaultShell()}async function fp(e){await Ue().SetDefaultShell(e),pa=null}function fd(){return Ue().ConfirmQuit()}function a_(){return Ue().GetNotificationsEnabled()}function xk(e){return Ue().SetNotificationsEnabled(e)}function pp(){return Ue().GetAINotificationsOnly()}function Rk(e){return Ue().SetAINotificationsOnly(e)}function Tk(){return Ue().GetPtyInputDebugEnabled()}function Ek(e){return Ue().SetPtyInputDebugEnabled(e)}async function vp(e,t,n){try{if(!await a_())return}catch(i){ss("notify","enabled-lookup failed; defaulting to allow",{error:xt(i)})}if(await dk())try{wu+=1,await k1({id:`atterm-${Date.now()}-${wu}`,title:e,body:t,...n?{data:n}:{}});return}catch{ck()}return Ue().ShowNotification(e,t)}function Pk(){return Ue().GetShellIntegrationEnabled()}function Lk(e){return Ue().SetShellIntegrationEnabled(e)}function l_(){return Ue().GetWebglRendererEnabled()}function Dk(e){return Ue().SetWebglRendererEnabled(e)}function c_(){return Ue().GetCommandNotifyThresholdSeconds()}function Ik(e){return Ue().SetCommandNotifyThresholdSeconds(e)}function _h(){return Ue().GetUserHomeDir()}function d_(){const e=Ue();return e.GetProfiles?e.GetProfiles():Promise.resolve([])}function Mk(e){const t=Ue();return t.SetProfiles?t.SetProfiles(e):Promise.reject(new Error("SetProfiles binding is not available"))}function Ak(){const e=Ue();return e.GetDefaultProfileID?e.GetDefaultProfileID():Promise.resolve("")}function $k(e){const t=Ue();return t.SetDefaultProfileID?t.SetDefaultProfileID(e):Promise.reject(new Error("SetDefaultProfileID binding is not available"))}const u_={idle:"#6b7280",running:"#06b6d4",waiting_input:"#f59e0b",completed:"#22c55e",failed:"#ef4444",disconnected:"#6b7280",closed:"#6b7280"};function h_(e){return u_[e]}function gp(e,t){return{id:e,i18nKey:`tasks.preset.${e}`,colorOf:n=>u_[n],textOpacity:1,showLabel:t}}const va={iconOnly:gp("iconOnly",!1),iconLabel:gp("iconLabel",!0)};function f_(e){const t=F(e.defaultValue);let n=!1;async function i(){try{const r=await e.load();if(e.isValid(r)){t.value=r;return}}catch{}if(typeof localStorage<"u"){const r=localStorage.getItem(e.storageKey);e.isValid(r)&&(t.value=r)}}function s(){n||(n=!0,i())}async function a(r){t.value=r;try{await e.save(r)}catch{typeof localStorage<"u"&&localStorage.setItem(e.storageKey,String(r))}}function d(){n=!1,t.value=e.defaultValue}return{activeId:t,ensureLoaded:s,set:a,__resetForTests:d}}function Ok(e){return e==="iconOnly"||e==="iconLabel"}const vl=f_({defaultValue:"iconOnly",storageKey:"taskPreset",load:()=>Um(),save:e=>zC(e),isValid:Ok});function yh(){vl.ensureLoaded();const e=W(()=>va[vl.activeId.value]);return{activeId:vl.activeId,active:e,setPreset:vl.set}}const Fk=125,p_=F(0);let yo=0,bo=null,Su=0;function v_(e){e-Su>=Fk&&(Su=e,p_.value++),yo>0&&(bo=requestAnimationFrame(v_))}function Bk(){yo++,yo===1&&bo===null&&(Su=performance.now(),bo=requestAnimationFrame(v_))}function Hk(){yo!==0&&(yo--,yo===0&&bo!==null&&(cancelAnimationFrame(bo),bo=null))}function g_(){return{phase:p_,acquire:Bk,release:Hk}}const Nk=["data-state","data-unread"],Uk=["width","height"],zk=["fill"],Vk=["transform"],Kk=["stroke","transform"],Wk=["stroke"],jk=["stroke"],qk=["stroke"],Yk=["r","fill"],Gk=["fill"],mp="#0d1117",ks=$e({__name:"TaskStateIcon",props:{state:{},size:{default:12},preset:{},unread:{type:Boolean,default:!1}},setup(e){const t=e,n=yh(),i=W(()=>t.preset??n.active.value),s=W(()=>t.unread),a=W(()=>i.value.colorOf(t.state)),d=W(()=>s.value?mp:a.value),r=g_(),o=W(()=>t.state==="running"),c=W(()=>o.value?r.phase.value*30%360:0),h=W(()=>o.value?`rotate(${c.value} 8 8)`:void 0);let u=!1;return wt(o,v=>{v&&!u?(u=!0,r.acquire()):!v&&u&&(u=!1,r.release())},{immediate:!0}),Vt(()=>{u&&(u=!1,r.release())}),(v,m)=>($(),O("span",{class:"task-state-icon",style:Gt({color:a.value,display:"inline-flex",alignItems:"center",gap:"2px"}),"data-state":v.state,"data-unread":s.value?"true":void 0},[($(),O("svg",{width:v.size,height:v.size,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{overflow:"visible"}},[s.value?($(),O("circle",{key:0,class:"task-unread-disc",cx:"8",cy:"8",r:"7.5",fill:a.value},null,8,zk)):Q("",!0),_("g",{transform:s.value?"translate(8,8) scale(0.62) translate(-8,-8)":void 0},[v.state==="running"?($(),O("path",{key:0,class:"task-running-arc",d:"M14 8 a6 6 0 1 1 -3 -5.196",stroke:d.value,"stroke-width":"2","stroke-linecap":"round",transform:h.value},null,8,Kk)):v.state==="completed"?($(),O("path",{key:1,class:"task-completed-check",d:"M3 8 l3 3 l7 -7",stroke:d.value,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,Wk)):v.state==="failed"?($(),O("path",{key:2,d:"M4 4 L12 12 M12 4 L4 12",stroke:d.value,"stroke-width":"2","stroke-linecap":"round"},null,8,jk)):v.state==="waiting_input"?($(),O("path",{key:3,class:"task-waiting-prompt",d:"M3 4.5 L6.5 8 L3 11.5 M8 11.5 H13",stroke:d.value,"stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,8,qk)):($(),O("circle",{key:4,cx:"8",cy:"8",r:s.value?3.2:2,fill:d.value},null,8,Yk))],8,Vk),s.value?($(),O(Me,{key:1},[_("circle",{cx:"12.6",cy:"3.4",r:"3.3",fill:mp}),_("circle",{class:"task-unread-dot",cx:"12.6",cy:"3.4",r:"2.5",fill:a.value},null,8,Gk)],64)):Q("",!0)],8,Uk))],12,Nk))}});function bh(e,t){switch(e){case"running":return t("mobile.taskStates.running");case"waiting_input":return t("mobile.taskStates.waiting_input");case"completed":return t("mobile.taskStates.completed");case"failed":return t("mobile.taskStates.failed");case"disconnected":return t("mobile.taskStates.disconnected");case"closed":return t("mobile.taskStates.closed");default:return t("mobile.taskStates.idle")}}function m_(e){return e.current_command||e.title||e.session_id.slice(0,8)}function qr(e){const t=m_(e),n=t.split(/\s+/)[0]||t;return n.split("/").pop()||n}function __(e){const t=m_(e);return e.cwd?`${t} +${e.cwd}`:t}function Xk(e){const t=(e??"").replace(/\/+$/,"");return t?t.split("/").pop()??"":""}function Jk(e){return e.replace(/^[\s::;·•∙.∷⋮⋯\u2800-\u28ff]+/u,"").trim()}function y_(e,t,n){if(!t)return"";const i=Xk(n);if(!i)return"";const s=Jk(e);return qr({current_command:t,title:"",session_id:""})!=="codex"?"":s===i?s:""}function Zk(e){if(e.type!=="ai")return"";const t=(e.title??"").trim();if(!t)return"";const n=y_(t,e.current_command,e.cwd);return n||t}function Qk(e){const t=(e.title??"").trim();if(!t)return"";const n=y_(t,e.current_command,e.cwd);if(n)return n;const i=qr(e);if(t===i)return"";const s=t.split("/").pop();return s&&s===i?"":t}function Jl(e){const t=Qk(e);return t||qr(e)}function ex(e,t,n){const i=t==null?void 0:t[0];return(i==null?void 0:i.host)||e||n}function tx(e,t){var s;if(!t)return new Map;const n=[];for(const a of Object.keys(e)){const d=e[a];d&&d.length>0&&(((s=d[0])==null?void 0:s.host)??"")===t&&n.push(a)}if(n.length<2)return new Map;n.sort();const i=new Map;return n.forEach((a,d)=>i.set(a,d+1)),i}function nx(e,t,n,i){const s=ex(e,t,n);return i&&i>=1?`${s} #${i}`:s}const Ia="application/x-atterm-session";function Zl(e){return!!e&&Array.prototype.includes.call(e,Ia)}let wh="";function b_(e){wh=e}function w_(){return wh}function uo(){wh=""}function ix(e,t){if(!t)return null;for(const n of e){const i=n.panes.findIndex(s=>s.sessionId===t);if(i!==-1)return{pane:{...n.panes[i]},from:{tabId:n.id,paneIdx:i}}}return{pane:{sessionId:t,remote:!0}}}function _p(e,t){if(!t)return null;for(const n of e){const i=n.panes.findIndex(s=>s.sessionId===t);if(i!==-1)return n.panes.length<2?null:{tabId:n.id,paneIdx:i,pane:{...n.panes[i]}}}return null}function sx(e,t,n){const i=e.map(a=>({...a}));if(t===n||t<0||n<0||t>=i.length||n>=i.length)return i;const s=i[t];return i[t]=i[n],i[n]=s,i}const rx=["data-tab-id","title","onClick","onPointerdown"],ox={class:"num"},ax=["title"],lx={class:"title"},cx=["onClick"],dx=["aria-label","title","value"],ux={value:""},hx=["value"],fx=["disabled","title"],px=["title"],vx=["title"],gx={key:0,class:"dot"},mx=4,gl=40,yp=8,_x=$e({__name:"TabBar",props:{tabs:{},currentId:{},starting:{type:Boolean},canNewLocal:{type:Boolean,default:!0},updateBadge:{type:Boolean,default:!1},isAdmin:{type:Boolean,default:!1},adminOpen:{type:Boolean,default:!1},profiles:{default:()=>[]},selectedProfileId:{default:""}},emits:["activate","close","new","new-ssh","reorder","open-settings","toggle-admin","detach-session","select-profile"],setup(e,{emit:t}){const n=t,i=F(null),s=F(null);let a=0,d=null;function r(L){var D;const x=L.target;return!!x&&!!((D=x.closest)!=null&&D.call(x,".close"))}function o(L,x){x.button===0&&(r(x)||(i.value={fromId:L,startX:x.clientX,active:!1,pointerId:x.pointerId,overId:null,position:null,hadDrag:!1}))}function c(L){if(!s.value)return null;const x=Array.from(s.value.querySelectorAll(".tab"));if(x.length===0)return null;for(const M of x){const B=M.getBoundingClientRect();if(L>=B.left&&L<=B.right){const z=(B.left+B.right)/2;return{id:M.dataset.tabId,position:L{D.stopPropagation(),D.preventDefault(),L.removeEventListener("click",x,!0)};L.addEventListener("click",x,!0),setTimeout(()=>L.removeEventListener("click",x,!0),0)}function m(L){const x=i.value;x&&(x.hadDrag&&!L&&v(),i.value=null,d!==null&&(cancelAnimationFrame(d),d=null))}function b(L){!i.value||L.pointerId!==i.value.pointerId||m(!1)}function g(L){!i.value||L.pointerId!==i.value.pointerId||m(!0)}It(()=>{window.addEventListener("pointermove",u),window.addEventListener("pointerup",b),window.addEventListener("pointercancel",g)}),Vt(()=>{window.removeEventListener("pointermove",u),window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",g),d!==null&&cancelAnimationFrame(d)});const{t:l}=Ot();function f(L){if(!L)return l("terminal.emptyTab");if(L.cwd){const D=L.cwd.replace(/\/+$/,"");if(D==="")return"/";const M=D.split("/").pop();if(M)return M}const x=(L.command||"").split(/\s+/)[0]||l("terminal.shellFallback");return x.split("/").pop()||x}function p(L){if((L==null?void 0:L.unread)===!0)return{"--unread-c":h_(L.task_state??"idle")}}function y(L){if(L){const x=Zk({type:L.type,title:L.title,current_command:L.current_command,cwd:L.cwd});if(x)return x}return f(L)}function C(L){switch(L.layout){case"single":return"";case"vertical":return"▮▮";case"horizontal":return`▬ +▬`;case"grid2x2":return"▦"}}function k(L){switch(L.layout){case"single":return"";case"vertical":return l("terminal.layoutVertical");case"horizontal":return l("terminal.layoutHorizontal");case"grid2x2":return l("terminal.layoutGrid2x2")}}function E(L,x){L.stopPropagation(),n("close",x)}const I=F(!1);function S(L){var x;Zl((x=L.dataTransfer)==null?void 0:x.types)&&(L.preventDefault(),L.dataTransfer&&(L.dataTransfer.dropEffect="move"),I.value=!0)}function P(L){const x=L.relatedTarget;x&&L.currentTarget instanceof Node&&L.currentTarget.contains(x)||(I.value=!1)}function A(L){var D,M;if(I.value=!1,!Zl((D=L.dataTransfer)==null?void 0:D.types))return;L.preventDefault();const x=w_()||(((M=L.dataTransfer)==null?void 0:M.getData(Ia))??"");x&&n("detach-session",x)}return(L,x)=>($(),O("div",{class:nt(["tabbar",{"drop-active":I.value}]),"data-test":"tabbar",onDragover:S,onDragleave:P,onDrop:A},[_("div",{class:"tabs",ref_key:"tabsEl",ref:s},[($(!0),O(Me,null,st(L.tabs,(D,M)=>{var B,z,Y,U,N,V,j,G;return $(),O("div",{key:D.id,"data-tab-id":D.id,class:nt(["tab",{active:D.id===L.currentId,unread:((B=D.activeSession)==null?void 0:B.unread)===!0,remote:D.activeRemote,disconnected:D.disconnected,dragging:((z=i.value)==null?void 0:z.active)&&((Y=i.value)==null?void 0:Y.fromId)===D.id}]),style:Gt(p(D.activeSession)),title:(D.activeRemote?w(l)("terminal.remotePrefix"):"")+(D.disconnected?w(l)("terminal.tabDisconnectedSuffix")+" ":"")+(((U=D.activeSession)==null?void 0:U.command)??""),onClick:te=>n("activate",D.id),onPointerdown:te=>o(D.id,te)},[_("span",ox,T(M+1)+":",1),D.layout!=="single"?($(),O("span",{key:0,class:"layout-icon",title:k(D)},T(C(D)),9,ax)):D.activeRemote?($(),O("span",{key:1,class:nt(["dot remote-dot",{disconnected:D.disconnected}])},[Pe(ks,{state:((N=D.activeSession)==null?void 0:N.task_state)??"idle",unread:((V=D.activeSession)==null?void 0:V.unread)===!0,size:10},null,8,["state","unread"])],2)):($(),Ct(ks,{key:2,state:((j=D.activeSession)==null?void 0:j.task_state)??"idle",unread:((G=D.activeSession)==null?void 0:G.unread)===!0,size:10},null,8,["state","unread"])),_("span",lx,T(y(D.activeSession)),1),_("button",{class:"close",onPointerdown:x[0]||(x[0]=pt(()=>{},["stop"])),onClick:te=>E(te,D.id)},"×",40,cx)],46,rx)}),128))],512),L.canNewLocal&&L.profiles.length>0?($(),O("select",{key:0,class:"profile-picker","data-test":"new-tab-profile","aria-label":w(l)("terminal.newTabProfileLabel"),title:w(l)("terminal.newTabProfileLabel"),value:L.selectedProfileId,onChange:x[1]||(x[1]=D=>n("select-profile",D.target.value)),onClick:x[2]||(x[2]=pt(()=>{},["stop"]))},[_("option",ux,T(w(l)("terminal.useDefaultProfile")),1),($(!0),O(Me,null,st(L.profiles,D=>($(),O("option",{key:D.id,value:D.id},T(D.name),9,hx))),128))],40,dx)):Q("",!0),L.canNewLocal?($(),O("button",{key:1,class:"plus","data-test":"new-local-shell",disabled:L.starting,title:L.starting?w(l)("terminal.starting"):w(l)("terminal.newTab"),onClick:x[3]||(x[3]=D=>n("new"))},"+",8,fx)):Q("",!0),L.canNewLocal?($(),O("button",{key:2,class:"ssh-btn",type:"button","data-test":"new-ssh",title:"SSH hosts",onClick:x[4]||(x[4]=D=>n("new-ssh"))},[Pe(w(co),{size:14})])):Q("",!0),L.isAdmin?($(),O("button",{key:3,class:nt(["admin-btn",{active:L.adminOpen}]),type:"button","data-test":"admin-button",title:w(l)("terminal.adminPanel"),onClick:x[5]||(x[5]=D=>n("toggle-admin"))},[Pe(w(r1),{size:14})],10,px)):Q("",!0),_("button",{class:"settings-btn",type:"button","data-test":"tabbar-settings",title:w(l)("terminal.relaySettings"),onClick:x[6]||(x[6]=D=>n("open-settings"))},[x[7]||(x[7]=_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("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"}),_("circle",{cx:"12",cy:"12",r:"3"})],-1)),L.updateBadge?($(),O("span",gx)):Q("",!0)],8,vx)],34))}}),yx=kt(_x,[["__scopeId","data-v-e57c51b9"]]);let Sa=null;function bx(e){if(Sa)return Sa;const t=e();return Sa=t,t}function fn(){if(!Sa)throw new Error("platform: call initPlatform() in main.ts before usePlatform()");return Sa}const Ql=F(!1);let bp=!1;function wx(){bp||(bp=!0,Promise.resolve().then(()=>{const t=fn().system.windowIsMaximized;return t?t():Promise.resolve(!1)}).then(e=>{Ql.value=!!e}).catch(()=>{Ql.value=!1}))}function Sh(){return wx(),Ql}function S_(e){Ql.value=e}const Sx={class:"window-controls",style:{"--wails-draggable":"no-drag"}},Cx=["aria-label"],kx=["aria-label"],xx={key:0,width:"10",height:"10",viewBox:"0 0 10 10","aria-hidden":"true"},Rx={key:1,width:"10",height:"10",viewBox:"0 0 10 10","aria-hidden":"true"},Tx=["aria-label"],Ex=$e({__name:"WindowControls",setup(e){const t=fn(),{t:n}=Ot(),i=Sh(),s=W(()=>i.value?n("common.restore"):n("common.maximize"));function a(c){try{c()}catch(h){Pt("window","runtime call failed",{error:xt(h)})}}function d(){a(()=>{var c,h;(h=(c=t.system).windowMinimize)==null||h.call(c)})}function r(){a(()=>{var c,h;(h=(c=t.system).windowToggleMaximize)==null||h.call(c),S_(!i.value)})}function o(){a(()=>{var c,h;(h=(c=t.system).quit)==null||h.call(c)})}return(c,h)=>($(),O("div",Sx,[_("button",{class:"wc-btn",type:"button","data-testid":"window-min","aria-label":w(n)("common.minimize"),onClick:d},h[0]||(h[0]=[_("svg",{width:"10",height:"10",viewBox:"0 0 10 10","aria-hidden":"true"},[_("rect",{x:"1",y:"4.5",width:"8",height:"1",fill:"currentColor"})],-1)]),8,Cx),_("button",{class:"wc-btn",type:"button","data-testid":"window-max","aria-label":s.value,onClick:r},[w(i)?($(),O("svg",Rx,h[2]||(h[2]=[_("rect",{x:"1",y:"3",width:"6",height:"6",fill:"none",stroke:"currentColor"},null,-1),_("rect",{x:"3",y:"1",width:"6",height:"6",fill:"none",stroke:"currentColor"},null,-1)]))):($(),O("svg",xx,h[1]||(h[1]=[_("rect",{x:"1",y:"1",width:"8",height:"8",fill:"none",stroke:"currentColor"},null,-1)])))],8,kx),_("button",{class:"wc-btn wc-close",type:"button","data-testid":"window-close","aria-label":w(n)("common.close"),onClick:o},h[3]||(h[3]=[_("svg",{width:"10",height:"10",viewBox:"0 0 10 10","aria-hidden":"true"},[_("path",{d:"M1 1 L9 9 M9 1 L1 9",stroke:"currentColor","stroke-width":"1",fill:"none"})],-1)]),8,Tx)]))}}),Px=kt(Ex,[["__scopeId","data-v-1ccfd0fb"]]),Lx={state:"closed",rtt:{last_ms:null,p50_ms:null,p95_ms:null},rtt_samples:[],reconnect:{count_last_hour:0,last_at_ms:null,last_reason:"",history:[]},bytes:{in_per_sec:0,out_per_sec:0},seq_gaps:0};function Dx(e={}){const t=F(Lx);let n=null,i=!1;async function s(){try{t.value=await uC()}catch(d){ss("uplink","health poll failed; keeping last value",{error:xt(d)})}}function a(){var r;if(n!==null&&clearTimeout(n),i)return;const d=(r=e.fast)!=null&&r.call(e)?1e3:5e3;n=setTimeout(async()=>{await s(),a()},d)}return It(()=>{s(),a()}),Vt(()=>{i=!0,n!==null&&clearTimeout(n)}),t}const Ix=["aria-label"],Mx={class:"text"},Ax=$e({__name:"ConnHealthPill",props:{health:{},labels:{}},setup(e){const t=e,n=W(()=>{var a,d,r,o;return{connecting:((a=t.labels)==null?void 0:a.connecting)??"connecting…",reconnecting:((d=t.labels)==null?void 0:d.reconnecting)??"reconnecting…",off:((r=t.labels)==null?void 0:r.off)??"off",unknownMS:((o=t.labels)==null?void 0:o.unknownMS)??"—"}}),i=W(()=>{if(t.health.state==="reconnecting"||t.health.state==="connecting")return"band-reconnecting";if(t.health.state==="closed")return"band-off";const a=t.health.rtt.last_ms;return a===null||a<150?"band-green":a<500?"band-yellow":"band-red"}),s=W(()=>{if(t.health.state==="reconnecting")return n.value.reconnecting;if(t.health.state==="connecting")return n.value.connecting;if(t.health.state==="closed")return n.value.off;const a=t.health.rtt.last_ms;return a===null?n.value.unknownMS:`${a} ms`});return(a,d)=>($(),O("button",{class:nt(["conn-health-pill",i.value]),type:"button","aria-label":s.value},[d[0]||(d[0]=_("span",{class:"dot"},"●",-1)),_("span",Mx,T(s.value),1)],10,Ix))}}),$x=kt(Ax,[["__scopeId","data-v-5daa187a"]]),Ox=["aria-label"],Fx={class:"head"},Bx=["aria-label"],Hx={class:"rtt"},Nx={class:"row"},Ux={class:"metric-label"},zx={class:"metric-value"},Vx={class:"row"},Kx={class:"metric-label"},Wx={class:"metric-value"},jx={width:"240",height:"60",class:"spark","aria-hidden":"true"},qx=["d"],Yx={class:"bytes"},Gx={class:"row"},Xx={class:"metric-label"},Jx={class:"metric-value"},Zx={class:"row"},Qx={class:"metric-label"},e2={class:"metric-value"},t2={class:"recon"},n2={class:"row"},i2={class:"metric-label"},s2={class:"metric-value"},r2={class:"row"},o2={class:"metric-label"},a2={class:"metric-value"},l2={key:0,class:"reconn-table"},c2={key:0,class:"gaps"},d2=$e({__name:"ConnHealthDrawer",props:{health:{},open:{type:Boolean},labels:{}},emits:["close"],setup(e){const t=e,n=W(()=>{var r,o,c,h,u,v,m,b,g,l,f,p;return{title:((r=t.labels)==null?void 0:r.title)??"Connection health",rttNow:((o=t.labels)==null?void 0:o.rttNow)??"RTT (now)",rttP50P95:((c=t.labels)==null?void 0:c.rttP50P95)??"p50 / p95 (5 min)",bytesIn:((h=t.labels)==null?void 0:h.bytesIn)??"↓ in",bytesOut:((u=t.labels)==null?void 0:u.bytesOut)??"↑ out",state:((v=t.labels)==null?void 0:v.state)??"State",reconnectsLastHour:((m=t.labels)==null?void 0:m.reconnectsLastHour)??"Reconnects (1 h)",reconnectsTime:((b=t.labels)==null?void 0:b.reconnectsTime)??"time",reconnectsReason:((g=t.labels)==null?void 0:g.reconnectsReason)??"reason",reconnectsDowntime:((l=t.labels)==null?void 0:l.reconnectsDowntime)??"downtime",seqGaps:((f=t.labels)==null?void 0:f.seqGaps)??"Seq gaps observed:",close:((p=t.labels)==null?void 0:p.close)??"Close"}}),i=W(()=>{const r=t.health.rtt_samples;if(r.length<2)return"";const o=240,c=60,h=4,u=f=>h+f/(r.length-1)*(o-2*h),v=r.map(f=>f.rtt_ms),m=Math.min(...v),b=Math.max(...v),g=Math.max(1,b-m),l=f=>h+(1-(f-m)/g)*(c-2*h);return r.map((f,p)=>`${p===0?"M":"L"} ${u(p).toFixed(1)} ${l(f.rtt_ms).toFixed(1)}`).join(" ")}),s=r=>`${(r/1024).toFixed(1)} KB/s`,a=r=>r<1e3?`${r} ms`:`${Math.round(r/1e3)} s`,d=r=>new Date(r).toLocaleTimeString();return(r,o)=>r.open?($(),O("aside",{key:0,class:"drawer",role:"dialog","aria-label":n.value.title},[_("header",Fx,[_("span",null,T(n.value.title),1),_("button",{class:"close",type:"button","aria-label":n.value.close,onClick:o[0]||(o[0]=c=>r.$emit("close"))},"×",8,Bx)]),_("section",Hx,[_("div",Nx,[_("span",Ux,T(n.value.rttNow),1),_("span",zx,T(r.health.rtt.last_ms??"—")+" ms",1)]),_("div",Vx,[_("span",Kx,T(n.value.rttP50P95),1),_("span",Wx,T(r.health.rtt.p50_ms??"—")+" / "+T(r.health.rtt.p95_ms??"—")+" ms",1)]),($(),O("svg",jx,[_("path",{d:i.value,fill:"none",stroke:"currentColor","stroke-width":"1.5"},null,8,qx)]))]),_("section",Yx,[_("div",Gx,[_("span",Xx,T(n.value.bytesIn),1),_("span",Jx,T(s(r.health.bytes.in_per_sec)),1)]),_("div",Zx,[_("span",Qx,T(n.value.bytesOut),1),_("span",e2,T(s(r.health.bytes.out_per_sec)),1)])]),_("section",t2,[_("div",n2,[_("span",i2,T(n.value.state),1),_("span",s2,T(r.health.state),1)]),_("div",r2,[_("span",o2,T(n.value.reconnectsLastHour),1),_("span",a2,T(r.health.reconnect.count_last_hour),1)]),r.health.reconnect.history.length>0?($(),O("table",l2,[_("thead",null,[_("tr",null,[_("th",null,T(n.value.reconnectsTime),1),_("th",null,T(n.value.reconnectsReason),1),_("th",null,T(n.value.reconnectsDowntime),1)])]),_("tbody",null,[($(!0),O(Me,null,st(r.health.reconnect.history,c=>($(),O("tr",{key:c.at_ms},[_("td",null,T(d(c.at_ms)),1),_("td",null,T(c.reason),1),_("td",null,T(a(c.duration_ms)),1)]))),128))])])):Q("",!0)]),r.health.seq_gaps>0?($(),O("section",c2,T(n.value.seqGaps)+" "+T(r.health.seq_gaps),1)):Q("",!0)],8,Ox)):Q("",!0)}}),u2=kt(d2,[["__scopeId","data-v-c8bb9e85"]]),h2=["title"],f2={class:"status"},p2={key:1,class:"bad"},v2={key:0,class:"dim"},g2=["title"],m2=1120,_2=40,y2=$e({__name:"TitleBar",props:{status:{},errorMsg:{},sessionCount:{},remoteEndpoint:{},currentTitle:{},currentTaskState:{}},setup(e){const t=fn(),{t:n}=Ot(),i=F(!1),s=Dx({fast:()=>i.value}),a=W(()=>({connecting:n("connHealth.pillLabelConnecting"),reconnecting:n("connHealth.pillLabelReconnecting"),off:n("connHealth.pillLabelOff")})),d=W(()=>({title:n("connHealth.drawerTitle"),rttNow:n("connHealth.drawerRttNow"),rttP50P95:n("connHealth.drawerRttP50P95"),bytesIn:n("connHealth.drawerBytesIn"),bytesOut:n("connHealth.drawerBytesOut"),state:n("connHealth.drawerState"),reconnectsLastHour:n("connHealth.drawerReconnectsLastHour"),reconnectsTime:n("connHealth.drawerReconnectsTime"),reconnectsReason:n("connHealth.drawerReconnectsReason"),reconnectsDowntime:n("connHealth.drawerReconnectsDowntime"),seqGaps:n("connHealth.drawerSeqGaps"),close:n("common.close")})),r=e,o=W(()=>r.currentTaskState==="running"),c=g_(),h=W(()=>o.value?c.phase.value*_2%m2:0);let u=!1;wt(o,k=>{k&&!u?(u=!0,c.acquire()):!k&&u&&(u=!1,c.release())},{immediate:!0}),Vt(()=>{u&&(u=!1,c.release())});const v=F(!1),m=W(()=>n("titlebar.e2eeOffTitle")),b=W(()=>n("titlebar.e2eeOffChip"));It(async()=>{try{const k=await Xl();v.value=k.disable_e2ee??!1}catch{}}),t.events.on("e2ee-mode-changed",k=>{const E=k==null?void 0:k.disabled;typeof E=="boolean"&&(v.value=E)});const g=F("linux");It(async()=>{try{const k=await t.system.getEnvironment();if(k==null){Pt("titlebar","getEnvironment() returned null, falling back to linux");return}const E=(k.platform??"").toLowerCase();E==="darwin"||E==="windows"||E==="linux"?g.value=E:Pt("titlebar","unknown platform, falling back to linux",{platform:String(E)})}catch(k){Pt("titlebar","getEnvironment() failed, falling back to linux",{error:xt(k)})}});const l=W(()=>({"padding-left":g.value==="darwin"?"80px":void 0,"--sweep-offset":o.value?`${h.value}px`:void 0})),f=W(()=>g.value!=="darwin"),p=Sh(),y=W(()=>r.sessionCount===1?"terminal.sessionStatusOne":"terminal.sessionStatusMany");function C(){var k,E;(E=(k=t.system).windowToggleMaximize)==null||E.call(k),S_(!p.value)}return(k,E)=>($(),O("header",{class:nt(["titlebar",{"is-running":o.value}]),"data-testid":"titlebar-root",style:Gt(l.value),onDblclick:pt(C,["self"])},[_("div",{class:"window-title","data-testid":"titlebar-current-title",title:k.currentTitle||"",onDblclick:pt(C,["self"])},T(k.currentTitle||""),41,h2),_("div",f2,[k.status==="loading"?($(),O(Me,{key:0},[et(T(w(n)("terminal.starting")),1)],64)):k.status==="error"?($(),O("span",p2,T(k.errorMsg),1)):($(),O(Me,{key:2},[et(T(w(n)(y.value,{count:k.sessionCount}))+" ",1),k.remoteEndpoint?($(),O("span",v2," · "+T(w(n)("terminal.uplinkOn")),1)):Q("",!0)],64))]),v.value?($(),O("div",{key:0,class:"e2ee-off-chip",role:"status","data-testid":"titlebar-e2ee-off",title:m.value},[E[2]||(E[2]=_("span",{class:"chip-icon","aria-hidden":"true"},"⚠",-1)),_("span",null,T(b.value),1)],8,g2)):Q("",!0),k.remoteEndpoint?($(),Ct($x,{key:1,health:w(s),labels:a.value,class:"titlebar-conn-pill","data-testid":"titlebar-conn-health-pill",onClick:E[0]||(E[0]=I=>i.value=!i.value)},null,8,["health","labels"])):Q("",!0),k.remoteEndpoint?($(),Ct(u2,{key:2,health:w(s),open:i.value,labels:d.value,onClose:E[1]||(E[1]=I=>i.value=!1)},null,8,["health","open","labels"])):Q("",!0),f.value?($(),Ct(Px,{key:3})):Q("",!0)],38))}}),b2=kt(y2,[["__scopeId","data-v-2cf685eb"]]);function C_(e,t,n){if(!e||!Number.isFinite(e)||e<=0)return null;if(t==="running")return{text:"live",live:!0,title:"Output active"};const i=n-e*1e3,s=Math.max(0,i),a=Math.floor(s/1e3);if(a<60)return{text:"now",live:!1,title:"Last output just now"};if(a<60*60){const r=`${Math.floor(a/60)}m`;return{text:r,live:!1,title:`Last output ${r} ago`}}if(a<24*60*60){const r=`${Math.floor(a/3600)}h`;return{text:r,live:!1,title:`Last output ${r} ago`}}const d=`${Math.floor(a/(24*60*60))}d`;return{text:d,live:!1,title:`Last output ${d} ago`}}const w2=["title","aria-label"],S2=$e({__name:"LastOutputIndicator",props:{lastOutputAt:{},taskState:{},nowMs:{}},setup(e){const t=e,n=W(()=>C_(t.lastOutputAt,t.taskState,t.nowMs));return(i,s)=>n.value?($(),O("span",{key:0,class:nt(["last-output",{live:n.value.live}]),title:n.value.title,"aria-label":n.value.title,"data-test":"last-output"},[s[0]||(s[0]=_("svg",{class:"last-output-clock",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round","aria-hidden":"true"},[_("circle",{cx:"6",cy:"6",r:"4.5"}),_("path",{d:"M6 3.3v3l2 1.2"})],-1)),_("span",null,T(n.value.text),1)],10,w2)):Q("",!0)}}),k_=kt(S2,[["__scopeId","data-v-ea632618"]]);function ec(e,t){if(!e)return"";let n=e;if(t){if(n===t)return"~";n.startsWith(t+"/")&&(n="~"+n.slice(t.length))}const a=(n.startsWith("~/")?n.slice(2):n.replace(/^\//,"")).split("/").filter(Boolean);return a.length<=2?n:"…/"+a.slice(-2).join("/")}const C2={class:"row-main"},k2={class:"row-top"},x2={key:0,class:"state-label","data-test":"state-label"},R2=["title"],T2={class:"cmd"},E2={key:0,class:"row-meta","data-test":"row-meta"},P2={class:"cwd","data-test":"row-cwd"},L2={key:0,class:"kind","data-test":"row-kind"},D2=["title","aria-label"],I2=$e({__name:"TaskRowInner",props:{session:{},showStateLabel:{type:Boolean,default:!1},home:{default:""},showClose:{type:Boolean,default:!1},nowMs:{}},emits:["close"],setup(e,{emit:t}){const n=e,i=t,{t:s}=Ot(),a=W(()=>ec(n.session.cwd,n.home));W(()=>C_(n.session.last_output_at,n.session.task_state,n.nowMs)!==null);const d=W(()=>n.session.type==="ai"?qr(n.session):"");function r(o){return bh(o,s)}return(o,c)=>($(),O(Me,null,[_("span",C2,[_("span",k2,[Pe(ks,{state:n.session.task_state??"idle",unread:n.session.unread===!0},null,8,["state","unread"]),o.showStateLabel?($(),O("span",x2,T(r(n.session.task_state)),1)):Q("",!0),_("span",{class:"cmd-and-cwd",title:w(__)(n.session)},[_("span",T2,T(w(Jl)(n.session)),1)],8,R2)]),a.value?($(),O("span",E2,[_("span",P2,T(a.value),1)])):Q("",!0)]),_("span",{class:nt(["row-tail",{"time-only":!d.value}]),"data-test":"row-tail"},[d.value?($(),O("span",L2,T(d.value),1)):Q("",!0),Pe(k_,{"last-output-at":n.session.last_output_at,"task-state":n.session.task_state,"now-ms":n.nowMs},null,8,["last-output-at","task-state","now-ms"])],2),n.showClose?($(),O("span",{key:0,class:"row-close","data-test":"row-close",role:"button",tabindex:"0",title:w(s)("common.close"),"aria-label":w(s)("common.close"),onClick:c[0]||(c[0]=pt(h=>i("close"),["stop"])),onKeydown:[c[1]||(c[1]=jn(pt(h=>i("close"),["stop","prevent"]),["enter"])),c[2]||(c[2]=jn(pt(h=>i("close"),["stop","prevent"]),["space"]))]}," × ",40,D2)):Q("",!0)],64))}}),wp=kt(I2,[["__scopeId","data-v-81d1a3d4"]]),M2=["data-test"],A2=["data-test","disabled","onClick"],$2=$e({__name:"SessionRowMenu",props:{open:{type:Boolean,default:!1},x:{},y:{},items:{}},emits:["close","select"],setup(e,{emit:t}){const n=e,i=t,s=F(null),a=F(0),d=F(0);function r(){if(!s.value){a.value=n.x,d.value=n.y;return}const m=s.value.getBoundingClientRect(),b=window.innerWidth,g=window.innerHeight;a.value=n.x+m.width>b?Math.max(0,n.x-m.width):n.x,d.value=n.y+m.height>g?Math.max(0,n.y-m.height):n.y}const o=W(()=>({left:a.value+"px",top:d.value+"px"}));function c(m){m.disabled||(i("select",m.key),i("close"))}function h(m){m.key==="Escape"&&i("close")}function u(m){s.value&&(s.value.contains(m.target)||i("close"))}function v(m){if(!s.value)return;const b=m.relatedTarget;(!b||!s.value.contains(b))&&i("close")}return wt(()=>n.open,m=>{m?(a.value=n.x,d.value=n.y,requestAnimationFrame(r),window.addEventListener("keydown",h),window.addEventListener("mousedown",u)):(window.removeEventListener("keydown",h),window.removeEventListener("mousedown",u))},{immediate:!0}),It(()=>{n.open&&requestAnimationFrame(r)}),Vt(()=>{window.removeEventListener("keydown",h),window.removeEventListener("mousedown",u)}),(m,b)=>m.open?($(),O("div",{key:0,ref_key:"menuRef",ref:s,class:"session-row-menu","data-test":"session-row-menu",role:"menu",style:Gt(o.value),onFocusoutCapture:v,onContextmenu:b[0]||(b[0]=pt(()=>{},["prevent"]))},[($(!0),O(Me,null,st(m.items,g=>($(),O(Me,{key:g.key},[g.separatorBefore?($(),O("div",{key:0,class:"menu-separator","data-test":`session-row-menu-separator-${g.key}`,role:"separator"},null,8,M2)):Q("",!0),_("button",{class:nt(["menu-item",{disabled:g.disabled}]),"data-test":`session-row-menu-item-${g.key}`,role:"menuitem",type:"button",disabled:g.disabled,onClick:pt(l=>c(g),["stop"])},T(g.label),11,A2)],64))),128))],36)):Q("",!0)}}),x_=kt($2,[["__scopeId","data-v-f6b9c7cb"]]),yi=F(new Set);let Sp=!1,ua=null,$r=null,Cp=!1;const O2=300;async function Ch(){try{const e=await fn().sessions.getPins();yi.value=new Set(e)}catch{}}async function kp(){if(!Sp)return ua||(ua=(async()=>{try{await Ch()}finally{Sp=!0,ua=null}})(),ua)}function kh(){$r&&clearTimeout($r),$r=setTimeout(()=>{$r=null,fn().sessions.setPins(Array.from(yi.value)).catch(e=>{Pt("pins","schedulePersist failed",{error:xt(e)})})},O2)}function F2(){Cp||(Cp=!0,fn().events.on("prefs:changed",()=>{Ch()}))}function xp(e){if(!e||yi.value.has(e))return;const t=new Set(yi.value);t.add(e),yi.value=t,kh()}function Rp(e){if(!yi.value.has(e))return;const t=new Set(yi.value);t.delete(e),yi.value=t,kh()}function B2(e,t){if(!e||!t||e===t||!yi.value.has(e))return;const n=new Set(yi.value);n.delete(e),n.add(t),yi.value=n,kh()}async function H2(){$r&&(clearTimeout($r),$r=null);try{await fn().sessions.setPins(Array.from(yi.value))}catch(e){Pt("pins","flushNow persist failed",{error:xt(e)})}}function xh(){return kp(),F2(),{pinnedIds:yi,isPinned:e=>yi.value.has(e),pin:xp,unpin:Rp,toggle:e=>yi.value.has(e)?Rp(e):xp(e),rename:B2,flushNow:H2,ready:()=>kp(),reload:()=>Ch()}}const N2=["aria-label"],U2={class:"popover-title"},z2={class:"rows"},V2=["data-test"],K2={class:"label"},W2=["title"],j2=["title","aria-label","onClick"],q2=$e({__name:"SessionDetailsPopover",props:{open:{type:Boolean,default:!1},x:{},y:{},session:{},paneLocation:{},tabIndexById:{}},emits:["close"],setup(e,{emit:t}){const n=e,i=t,{t:s}=Ot(),a=xh(),d=F(null),r=F(0),o=F(0);function c(){if(!d.value){r.value=n.x,o.value=n.y;return}const p=d.value.getBoundingClientRect(),y=window.innerWidth,C=window.innerHeight;r.value=n.x+p.width>y?Math.max(0,n.x-p.width):n.x,o.value=n.y+p.height>C?Math.max(0,n.y-p.height):n.y}const h=W(()=>({left:r.value+"px",top:o.value+"px"}));function u(p){return p?new Date(p*1e3).toISOString().replace("T"," ").replace(/\.\d+Z$/,"Z"):""}function v(p){if(p==null)return"";if(p<1e3)return`${p}ms`;const y=p/1e3;if(y<60)return`${y.toFixed(1)}s`;const C=Math.floor(y/60),k=Math.round(y-C*60);return`${C}m${k}s`}async function m(p){try{await navigator.clipboard.writeText(p)}catch{}}const b=W(()=>{const p=n.session;if(!p)return[];const y=[];y.push({key:"sessionId",label:s("tasks.details.sessionId"),value:p.session_id,copy:!0}),p.type&&y.push({key:"type",label:s("tasks.details.type"),value:p.type});const C=[p.user,p.host].filter(Boolean).join("@");(C||p.host_id)&&y.push({key:"host",label:s("tasks.details.host"),value:C||p.host_id,copy:!0}),p.cwd&&y.push({key:"cwd",label:s("tasks.details.cwd"),value:p.cwd,copy:!0});const k=p.current_command||p.title;k&&y.push({key:"command",label:s("tasks.details.command"),value:k,copy:!0}),p.task_state&&y.push({key:"state",label:s("tasks.details.state"),value:bh(p.task_state,s)}),p.started_at&&y.push({key:"startedAt",label:s("tasks.details.startedAt"),value:u(p.started_at)}),p.command_started_at&&y.push({key:"commandStartedAt",label:s("tasks.details.commandStartedAt"),value:u(p.command_started_at)}),p.command_ended_at&&y.push({key:"commandEndedAt",label:s("tasks.details.commandEndedAt"),value:u(p.command_ended_at)});const E=v(p.command_duration_ms);E&&y.push({key:"commandDuration",label:s("tasks.details.commandDuration"),value:E}),typeof p.command_exit_code=="number"&&y.push({key:"commandExitCode",label:s("tasks.details.commandExitCode"),value:String(p.command_exit_code)}),y.push({key:"unread",label:s("tasks.details.unread"),value:p.unread?s("common.yes"):s("common.no")}),y.push({key:"pinned",label:s("tasks.details.pinned"),value:a.isPinned(p.session_id)?s("common.yes"):s("common.no")});const I=n.paneLocation,S=I?s("tasks.details.paneAt",{tab:n.tabIndexById(I.tabId),pane:I.paneIdx+1}):s("tasks.details.paneNone");return y.push({key:"paneLocation",label:s("tasks.details.paneLocation"),value:S}),y});function g(p){p.key==="Escape"&&i("close")}function l(p){d.value&&(d.value.contains(p.target)||i("close"))}function f(p){if(!d.value)return;const y=p.relatedTarget;(!y||!d.value.contains(y))&&i("close")}return wt(()=>n.open,p=>{p?(r.value=n.x,o.value=n.y,requestAnimationFrame(c),window.addEventListener("keydown",g),window.addEventListener("mousedown",l)):(window.removeEventListener("keydown",g),window.removeEventListener("mousedown",l))},{immediate:!0}),It(()=>{n.open&&requestAnimationFrame(c)}),Vt(()=>{window.removeEventListener("keydown",g),window.removeEventListener("mousedown",l)}),(p,y)=>p.open&&p.session?($(),O("div",{key:0,ref_key:"popoverRef",ref:d,class:"session-details-popover","data-test":"session-details-popover",role:"dialog","aria-label":w(s)("tasks.details.title"),tabindex:"-1",style:Gt(h.value),onFocusoutCapture:f,onContextmenu:y[0]||(y[0]=pt(()=>{},["prevent"]))},[_("div",U2,T(w(s)("tasks.details.title")),1),_("div",z2,[($(!0),O(Me,null,st(b.value,C=>($(),O("div",{key:C.key,class:"row","data-test":`details-field-${C.key}`},[_("span",K2,T(C.label),1),_("span",{class:"value",title:C.value},T(C.value),9,W2),C.copy?($(),O("button",{key:0,class:"copy",type:"button",title:w(s)("common.copy"),"aria-label":w(s)("common.copy"),onClick:pt(k=>m(C.value),["stop"])},"⧉",8,j2)):Q("",!0)],8,V2))),128))])],44,N2)):Q("",!0)}}),Y2=kt(q2,[["__scopeId","data-v-9528360b"]]),vs=F(new Set),Er=F(null);function Rh(){const e=W(()=>vs.value.size);function t(d){return vs.value.has(d)}function n(d){const r=new Set(vs.value);r.has(d)?r.delete(d):r.add(d),vs.value=r,Er.value=d}function i(d){vs.value=new Set([d]),Er.value=d}function s(d,r){if(!Er.value)return n(d);const o=r.indexOf(Er.value),c=r.indexOf(d);if(o<0||c<0)return n(d);const[h,u]=o0?Math.floor(t/G2):0}function R_(e,t){const n=Tp(t)-Tp(e);if(n!==0)return n;const i=Ep(t)-Ep(e);return i!==0?i:(e.session_id??"").localeCompare(t.session_id??"")}function tc(e,t){const n=Ro(e.task_state)-Ro(t.task_state);if(n!==0)return n;const i=(e.unread?0:1)-(t.unread?0:1);return i!==0?i:R_(e,t)}function X2(e,t){return R_(e,t)}const J2={class:"task-grouped-list"},Z2=["aria-expanded"],Q2={class:"caret","aria-hidden":"true"},eR={width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor"},tR={key:0,d:"M3 1 L7 5 L3 9 Z"},nR={key:1,d:"M1 3 L9 3 L5 8 Z"},iR={class:"group-title"},sR={class:"group-count"},rR=["data-session-id","data-active","data-selected","onClick","onContextmenu","onPointerdown","onDragstart"],oR=["data-test"],aR=["aria-expanded","onClick","onKeydown"],lR={class:"caret","aria-hidden":"true"},cR={width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor"},dR={key:0,d:"M3 1 L7 5 L3 9 Z"},uR={key:1,d:"M1 3 L9 3 L5 8 Z"},hR={class:"host-name"},fR={key:0,class:"local-chip","data-test":"local-chip"},pR={class:"counts"},vR={class:"count"},gR={key:1,class:"unread-badge"},mR=["title","aria-label","onClick"],_R=["data-session-id","data-active","data-selected","onClick","onContextmenu","onPointerdown","onDragstart"],yR={key:1,class:"empty-hint","data-test":"search-empty"},bR={key:2,class:"completed-fold"},wR={width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor","aria-hidden":"true"},SR={key:0,d:"M1 3 L9 3 L5 8 Z"},CR={key:1,d:"M3 1 L7 5 L3 9 Z"},kR=["data-active","data-selected","onClick","onContextmenu","onPointerdown"],xR={class:"row-main"},RR={class:"row-top"},TR={key:0,class:"state-label","data-test":"state-label"},ER=["title"],PR={class:"cmd"},LR={key:0,class:"row-meta","data-test":"row-meta"},DR={class:"cwd"},IR={key:0,class:"kind","data-test":"row-kind"},MR=["title","aria-label","onClick"],Pr="__pinned__",AR=1e3,Pp=10,$R=$e({__name:"TaskGroupedList",props:{byHost:{},primaryStateForHost:{},completedSeen:{},groupBy:{default:"host"},byState:{default:()=>({})},activeSessionId:{default:null},localHostId:{default:""},localHost:{default:""},openSessionIds:{default:()=>[]},searchQuery:{default:""},paneLocationFor:{type:Function,default:()=>null},tabIndexById:{type:Function,default:()=>0},canDetachSession:{type:Function,default:()=>!1}},emits:["open","close","markSeen","merge-selected","close-selected","detach-session"],setup(e,{emit:t}){const n=yh(),i=W(()=>n.active.value.showLabel),s=e,a=t,{t:d}=Ot(),r=Rh(),o=Fl,c=xh(),h=W(()=>s.searchQuery.trim().toLocaleLowerCase()),u=W(()=>new Set(s.openSessionIds)),v=W(()=>s.groupBy==="state"?s.byState:s.byHost),m=W(()=>{const ne={};for(const[ue,he]of Object.entries(v.value))ne[ue]=he.filter(Ae=>!c.isPinned(Ae.session_id)&&pd(Ae,h.value));return ne}),b=W(()=>{if(s.groupBy==="state")return o.filter(he=>(m.value[he]??[]).length>0);const ne=Object.keys(v.value).sort().filter(he=>(m.value[he]??[]).length>0);if(!s.localHostId)return ne;const ue=ne.indexOf(s.localHostId);return ue<=0?ne:[s.localHostId,...ne.slice(0,ue),...ne.slice(ue+1)]}),g=F(!1),l=F(new Set);function f(ne){return h.value?!1:l.value.has(ne)}function p(ne){const ue=new Set(l.value);ue.has(ne)?ue.delete(ne):ue.add(ne),l.value=ue}const y=F(""),C=F(Date.now());let k=null;It(async()=>{k=window.setInterval(()=>{C.value=Date.now()},1e3);try{y.value=await _h()}catch{}}),Vt(()=>{k!==null&&window.clearInterval(k)});const E=W(()=>{const ne=[],ue=new Set,he=s.groupBy==="state"?s.byState??{}:s.byHost??{};for(const Ae of Object.values(he))for(const ce of Ae)ue.has(ce.session_id)||c.isPinned(ce.session_id)&&pd(ce,h.value)&&(ue.add(ce.session_id),ne.push(ce));return ne.sort(tc),ne}),I=W(()=>s.completedSeen.filter(ne=>pd(ne,h.value))),S=W(()=>E.value.length>0||b.value.length>0||I.value.length>0),P=W(()=>{const ne=[];if(!f(Pr))for(const ue of E.value)ne.push(ue.session_id);for(const ue of b.value)if(!f(ue))for(const he of m.value[ue]??[])ne.push(he.session_id);if(g.value)for(const ue of I.value)ne.push(ue.session_id);return ne});function A(ne,ue){if(z===ue.session_id){z="",ne.preventDefault();return}if(ne.shiftKey){r.selectRange(ue.session_id,P.value);return}if(ne.metaKey||ne.ctrlKey){r.toggle(ue.session_id);return}r.clear(),a("open",ue)}const L=F({open:!1,x:0,y:0,session:null});function x(ne,ue,he){L.value={open:!0,x:ne,y:ue,session:he}}function D(ne,ue){ne.preventDefault(),x(ne.clientX,ne.clientY,ue)}let M=null,B=null,z="";function Y(){M&&(clearTimeout(M),M=null),B=null}function U(ne,ue){ne.pointerType==="mouse"||ne.button!==0||(Y(),B={x:ne.clientX,y:ne.clientY,sessionId:ue.session_id},M=setTimeout(()=>{M=null,z=ue.session_id,x(ne.clientX,ne.clientY,ue)},AR))}function N(ne){if(!B)return;const ue=Math.abs(ne.clientX-B.x),he=Math.abs(ne.clientY-B.y);(ue>Pp||he>Pp)&&Y()}function V(){Y()}function j(ne,ue){b_(ue.session_id),ne.dataTransfer&&(ne.dataTransfer.setData(Ia,ue.session_id),ne.dataTransfer.effectAllowed="move")}function G(){uo()}Vt(Y);function te(){L.value={...L.value,open:!1,session:null}}const se=W(()=>{const ne=L.value.session;if(!ne)return[];const ue=r.size.value;if(ue>=2&&r.isSelected(ne.session_id)){const ce=Array.from(r.selectedIds.value).filter(Je=>u.value.has(Je)).length;return[{key:"merge",label:d("tasks.rowMenu.merge",{n:ue}),disabled:ue>4},{key:"close",label:d("tasks.rowMenu.closeSelected",{n:ce}),disabled:ce===0},{key:c.isPinned(ne.session_id)?"unpin":"pin",label:c.isPinned(ne.session_id)?d("tasks.pinned.menuUnpin"):d("tasks.pinned.menuPin")},{key:"details",label:d("tasks.rowMenu.details"),disabled:!0}]}const Ae=[{key:c.isPinned(ne.session_id)?"unpin":"pin",label:c.isPinned(ne.session_id)?d("tasks.pinned.menuUnpin"):d("tasks.pinned.menuPin")}];return Ae.push({key:"details",label:d("tasks.rowMenu.details")}),s.canDetachSession(ne.session_id)&&Ae.push({key:"detach",label:d("terminal.detachToTab")}),Ae}),oe=F({open:!1,x:0,y:0,session:null});function Fe(ne){const ue=L.value.session;ue&&(ne==="pin"||ne==="unpin"?c.toggle(ue.session_id):ne==="details"?oe.value={open:!0,x:L.value.x,y:L.value.y,session:ue}:ne==="merge"?a("merge-selected"):ne==="close"?a("close-selected"):ne==="detach"&&a("detach-session",ue.session_id))}function K(){oe.value={...oe.value,open:!1,session:null}}const Z=W(()=>tx(s.byHost,s.localHost??""));function J(ne){return nx(ne,v.value[ne],d("sessions.unknownHost"),Z.value.get(ne))}function ae(ne){return s.groupBy==="state"?De(ne):J(ne)}function Ie(ne){if(s.groupBy==="state")return ne;const ue=m.value[ne]??[];let he=ue[0];for(const Ae of ue)Ro(Ae.task_state)ue.unread).map(ue=>ue.session_id)}function xe(ne){a("markSeen",{ids:Le(ne)})}function Qe(){a("markSeen",{ids:s.completedSeen.map(ne=>ne.session_id)})}function De(ne){return bh(ne,d)}return(ne,ue)=>($(),O("div",J2,[E.value.length>0?($(),O(Me,{key:0},[_("div",{class:"group-header pinned-group","data-test":"pinned-group-header",role:"button",tabindex:"0","aria-expanded":!f(Pr),onClick:ue[0]||(ue[0]=he=>p(Pr)),onKeydown:[ue[1]||(ue[1]=jn(pt(he=>p(Pr),["prevent"]),["enter"])),ue[2]||(ue[2]=jn(pt(he=>p(Pr),["prevent"]),["space"]))]},[_("span",Q2,[($(),O("svg",eR,[f(Pr)?($(),O("path",tR)):($(),O("path",nR))]))]),ue[7]||(ue[7]=_("span",{class:"pin-icon","aria-hidden":"true"},[_("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true"},[_("path",{d:"M4 2 h8 v12 l-4 -3 l-4 3 z"})])],-1)),_("span",iR,T(w(d)("tasks.pinned.title")),1),_("span",sR,T(E.value.length),1)],40,Z2),f(Pr)?Q("",!0):($(!0),O(Me,{key:0},st(E.value,he=>($(),O("button",{key:he.session_id,class:nt(["task-row",{active:he.session_id===ne.activeSessionId,selected:w(r).isSelected(he.session_id),unread:he.unread===!0}]),style:Gt(de(he)),"data-test":"task-row","data-session-id":he.session_id,"data-active":he.session_id===ne.activeSessionId?"true":void 0,"data-selected":w(r).isSelected(he.session_id)?"true":void 0,onClick:Ae=>A(Ae,he),onContextmenu:Ae=>D(Ae,he),onPointerdown:Ae=>U(Ae,he),onPointermove:ue[3]||(ue[3]=Ae=>N(Ae)),onPointerup:V,onPointercancel:V,onPointerleave:V,draggable:"true",onDragstart:Ae=>j(Ae,he),onDragend:G},[Pe(wp,{session:he,"show-state-label":i.value,home:y.value,"show-close":u.value.has(he.session_id),"now-ms":C.value,onClose:Ae=>a("close",he)},null,8,["session","show-state-label","home","show-close","now-ms","onClose"])],46,rR))),128))],64)):Q("",!0),($(!0),O(Me,null,st(b.value,he=>($(),O(Me,{key:he},[(m.value[he]??[]).length>0?($(),O("section",{key:0,class:"host-group","data-test":`host-group-${he}`},[_("header",{class:"host-header","data-test":"host-header",role:"button",tabindex:"0","aria-expanded":!f(he),onClick:Ae=>p(he),onKeydown:[jn(pt(Ae=>p(he),["prevent"]),["enter"]),jn(pt(Ae=>p(he),["prevent"]),["space"])]},[_("span",lR,[($(),O("svg",cR,[f(he)?($(),O("path",dR)):($(),O("path",uR))]))]),_("span",hR,T(ae(he)),1),ne.groupBy==="host"&&ne.localHostId&&he===ne.localHostId?($(),O("span",fR,T(w(d)("sessions.thisMachine")),1)):Q("",!0),_("span",pR,[Pe(ks,{state:Ie(he),size:10},null,8,["state"]),_("span",vR,T((m.value[he]??[]).length),1)]),Le(he).length>0?($(),O("span",gR,T(w(d)("tasks.unreadBadge",{count:Le(he).length})),1)):Q("",!0),Le(he).length>0?($(),O("button",{key:2,class:"mark-all","data-test":"host-mark-all",title:w(d)("tasks.markAllRead"),"aria-label":w(d)("tasks.markAllRead"),onClick:pt(Ae=>xe(he),["stop"])},ue[8]||(ue[8]=[_("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("path",{d:"M3 8 l3 3 l7 -7"})],-1)]),8,mR)):Q("",!0)],40,aR),($(!0),O(Me,null,st(f(he)?[]:m.value[he],Ae=>($(),O("button",{key:Ae.session_id,class:nt(["task-row",{active:Ae.session_id===ne.activeSessionId,selected:w(r).isSelected(Ae.session_id),unread:Ae.unread===!0}]),style:Gt(de(Ae)),"data-test":"task-row","data-session-id":Ae.session_id,"data-active":Ae.session_id===ne.activeSessionId?"true":void 0,"data-selected":w(r).isSelected(Ae.session_id)?"true":void 0,onClick:ce=>A(ce,Ae),onContextmenu:ce=>D(ce,Ae),onPointerdown:ce=>U(ce,Ae),onPointermove:ue[4]||(ue[4]=ce=>N(ce)),onPointerup:V,onPointercancel:V,onPointerleave:V,draggable:"true",onDragstart:ce=>j(ce,Ae),onDragend:G},[Pe(wp,{session:Ae,"show-state-label":i.value,home:y.value,"show-close":u.value.has(Ae.session_id),"now-ms":C.value,onClose:ce=>a("close",Ae)},null,8,["session","show-state-label","home","show-close","now-ms","onClose"])],46,_R))),128))],8,oR)):Q("",!0)],64))),128)),h.value&&!S.value?($(),O("div",yR,T(w(d)("tasks.search.empty",{q:s.searchQuery})),1)):Q("",!0),I.value.length>0?($(),O("section",bR,[_("button",{class:"fold-toggle","data-test":"completed-fold-toggle",onClick:ue[5]||(ue[5]=he=>g.value=!g.value)},[($(),O("svg",wR,[g.value?($(),O("path",SR)):($(),O("path",CR))])),et(" "+T(w(d)("tasks.completedFold"))+" ("+T(I.value.length)+") ",1)]),g.value?($(),O(Me,{key:0},[($(!0),O(Me,null,st(I.value,he=>($(),O("div",{key:he.session_id,class:nt(["task-row dim",{active:he.session_id===ne.activeSessionId,selected:w(r).isSelected(he.session_id),unread:he.unread===!0}]),style:Gt(de(he)),"data-test":"completed-fold-row","data-active":he.session_id===ne.activeSessionId?"true":void 0,"data-selected":w(r).isSelected(he.session_id)?"true":void 0,onClick:Ae=>A(Ae,he),onContextmenu:Ae=>D(Ae,he),onPointerdown:Ae=>U(Ae,he),onPointermove:ue[6]||(ue[6]=Ae=>N(Ae)),onPointerup:V,onPointercancel:V,onPointerleave:V},[_("span",xR,[_("span",RR,[Pe(ks,{state:he.task_state??"idle",unread:he.unread===!0},null,8,["state","unread"]),i.value?($(),O("span",TR,T(De(he.task_state)),1)):Q("",!0),_("span",{class:"cmd-and-cwd",title:w(__)(he)},[_("span",PR,T(w(Jl)(he)),1)],8,ER)]),w(ec)(he.cwd,y.value)?($(),O("span",LR,[_("span",DR,T(w(ec)(he.cwd,y.value)),1)])):Q("",!0)]),_("span",{class:nt(["row-tail",{"time-only":he.type!=="ai"}]),"data-test":"row-tail"},[he.type==="ai"?($(),O("span",IR,T(w(qr)(he)),1)):Q("",!0),Pe(k_,{"last-output-at":he.last_output_at,"task-state":he.task_state,"now-ms":C.value},null,8,["last-output-at","task-state","now-ms"])],2),u.value.has(he.session_id)?($(),O("button",{key:0,class:"row-close completed-row-close","data-test":"row-close",title:w(d)("common.close"),"aria-label":w(d)("common.close"),onClick:pt(Ae=>a("close",he),["stop"])}," × ",8,MR)):Q("",!0)],46,kR))),128)),_("button",{class:"fold-mark-all","data-test":"fold-mark-all",onClick:Qe},T(w(d)("tasks.markAllRead")),1)],64)):Q("",!0)])):Q("",!0),Pe(x_,{open:L.value.open,x:L.value.x,y:L.value.y,items:se.value,onClose:te,onSelect:Fe},null,8,["open","x","y","items"]),Pe(Y2,{open:oe.value.open,x:oe.value.x,y:oe.value.y,session:oe.value.session,"pane-location":oe.value.session?ne.paneLocationFor(oe.value.session.session_id):null,"tab-index-by-id":ne.tabIndexById,onClose:K},null,8,["open","x","y","session","pane-location","tab-index-by-id"])]))}}),OR=kt($R,[["__scopeId","data-v-42b39ad3"]]),FR={class:"bulk-bar","data-test":"bulk-action-bar",role:"toolbar"},BR={class:"counter","data-test":"bulk-selected-count"},HR=["disabled","title"],NR=["disabled","title"],UR=["title"],zR=$e({__name:"BulkActionBar",props:{count:{},openCount:{},canMerge:{type:Boolean}},emits:["merge","close-selected","clear"],setup(e,{emit:t}){const n=e,i=t,{t:s}=Ot(),a=W(()=>n.count>4?s("tasks.bulk.mergeTooMany"):s("tasks.bulk.mergeTab")),d=W(()=>n.openCount===0?s("tasks.bulk.closeNoneOpen"):s("tasks.bulk.closeHint",{count:n.openCount}));function r(){n.canMerge&&i("merge")}function o(){n.openCount!==0&&i("close-selected")}function c(){i("clear")}return(h,u)=>($(),O("div",FR,[_("span",BR,T(w(s)("tasks.bulk.selectedCount",{count:h.count})),1),_("button",{class:"btn primary","data-test":"bulk-merge",type:"button",disabled:!h.canMerge,title:a.value,onClick:r},T(w(s)("tasks.bulk.mergeTab"))+" ("+T(h.count)+") ",9,HR),_("button",{class:"btn","data-test":"bulk-close",type:"button",disabled:h.openCount===0,title:d.value,onClick:o},T(w(s)("tasks.bulk.close",{count:h.openCount})),9,NR),_("button",{class:"btn ghost","data-test":"bulk-clear",type:"button",title:w(s)("tasks.bulk.cancel"),onClick:c},T(w(s)("tasks.bulk.cancel")),9,UR)]))}}),VR=kt(zR,[["__scopeId","data-v-c912fe83"]]);function KR(e){return e==="host"||e==="state"}const vd=f_({defaultValue:"host",storageKey:"taskGroupBy",load:()=>VC(),save:e=>KC(e),isValid:KR});function T_(){return vd.ensureLoaded(),{activeId:vd.activeId,setGroupBy:vd.set}}const WR={class:"task-sidebar-shell"},jR=["aria-label"],qR={key:1,class:"rail","data-test":"sidebar-rail"},YR=["title","aria-label"],GR={key:0,class:"rail-badge","data-test":"sidebar-rail-badge"},XR=["aria-label","onClick","onKeydown"],JR={key:2,class:"expanded"},ZR={class:"sidebar-header"},QR={key:0,class:"title"},eT=["title","aria-label"],tT=["placeholder","aria-label","onKeydown"],nT=["title"],iT=["title","aria-label"],sT={class:"list-wrap","data-test":"task-grouped-list"},rT={key:0},oT={key:1},aT=180,lT=480,cT=$e({__name:"TaskSidebar",props:{collapsed:{type:Boolean},byHost:{},primaryStateForHost:{},completedSeen:{},totalUnread:{},byStateGroups:{default:()=>({})},activeSessionId:{default:null},openSessionIds:{default:()=>[]},localHostId:{default:""},localHost:{default:""},paneLocationFor:{type:Function,default:()=>null},canDetachSession:{type:Function,default:()=>!1},tabIndexById:{type:Function,default:()=>0}},emits:["update:collapsed","open","close","markSeen","merge-selected","close-selected","detach-session"],setup(e,{expose:t,emit:n}){const{t:i}=Ot(),s=T_(),a=e,d=n,r=Rh(),o=W(()=>{const N=new Set(a.openSessionIds??[]);let V=0;for(const j of r.selectedIds.value)N.has(j)&&V++;return V}),c=W(()=>r.size.value>=1&&r.size.value<=4);function h(N){N.key==="Escape"&&r.size.value>0&&(N.preventDefault(),r.clear())}function u(N){if(r.size.value===0)return;const V=N.target;V&&(V.closest(".task-row, .host-header, .group-header, .bulk-bar, .session-row-menu, .session-details-popover, .resize-handle")||r.clear())}const v=F(240);let m=0,b=0,g=!1;const l=F(""),f=F(null),p=F(!1);async function y(){var N,V;p.value=!0,await hn(),(N=f.value)==null||N.focus(),(V=f.value)==null||V.select()}function C(){l.value===""&&(p.value=!1)}function k(){if(l.value!==""){l.value="";return}p.value=!1}async function E(){a.collapsed&&(d("update:collapsed",!1),await hn()),await y()}t({focusSearch:E}),It(async()=>{try{const N=await WC();N>0&&(v.value=I(N))}catch{}});function I(N){return Math.max(aT,Math.min(lT,N))}const S=F(!1),P=F(!1);function A(){const N=S.value;S.value=window.innerWidth<768,N&&!S.value&&(P.value=!1)}function L(N){N.key==="Escape"&&P.value&&(P.value=!1,N.preventDefault())}It(()=>{A(),window.addEventListener("resize",A),window.addEventListener("keydown",L)}),Vt(()=>{window.removeEventListener("resize",A),window.removeEventListener("keydown",L)});function x(N){if(!a.collapsed){g=!0,m=N.clientX,b=v.value;try{N.target.setPointerCapture(N.pointerId)}catch{}}}function D(N){g&&(v.value=I(b+(N.clientX-m)))}async function M(N){if(g){g=!1;try{N.target.releasePointerCapture(N.pointerId)}catch{}try{await jC(v.value)}catch{}}}const B=["waiting_input","failed","running","completed","idle","disconnected","closed"];function z(N){if(!N)return B.length;const V=B.indexOf(N);return V===-1?B.length:V}function Y(){const N=s.activeId.value==="state"?"host":"state";s.setGroupBy(N)}const U=W(()=>{const N=[];for(const V of Object.values(a.byHost))N.push(...V);return N.sort((V,j)=>z(V.task_state)-z(j.task_state)),N.slice(0,20)});return(N,V)=>($(),O("div",WR,[S.value?($(),O("button",{key:0,"data-test":"sidebar-hamburger",class:"sidebar-hamburger","aria-label":P.value?w(i)("tasks.sidebar.closeDrawer"):w(i)("tasks.sidebar.openDrawer"),onClick:V[0]||(V[0]=j=>P.value=!P.value)},V[14]||(V[14]=[_("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[_("line",{x1:"3",y1:"4.5",x2:"13",y2:"4.5"}),_("line",{x1:"3",y1:"8",x2:"13",y2:"8"}),_("line",{x1:"3",y1:"11.5",x2:"13",y2:"11.5"})],-1)]),8,jR)):Q("",!0),_("aside",{class:nt(["task-sidebar",{collapsed:N.collapsed,drawer:S.value,open:S.value&&P.value}]),style:Gt(N.collapsed?void 0:{width:v.value+"px"}),tabindex:"-1",onKeydown:h,onClickCapture:u},[N.collapsed?Q("",!0):($(),O("div",{key:0,class:"resize-handle","data-test":"sidebar-resize-handle",onPointerdown:x,onPointermove:D,onPointerup:M,onPointercancel:M},null,32)),N.collapsed?($(),O("div",qR,[_("button",{class:"expand-button",title:w(i)("tasks.sidebar.expand"),"aria-label":w(i)("tasks.sidebar.expand"),onClick:V[1]||(V[1]=j=>d("update:collapsed",!1))},V[15]||(V[15]=[_("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("polyline",{points:"3 2 7 6 3 10"}),_("polyline",{points:"6 2 10 6 6 10"})],-1)]),8,YR),N.totalUnread>0?($(),O("span",GR,T(N.totalUnread),1)):Q("",!0),($(!0),O(Me,null,st(U.value,j=>($(),O("span",{key:j.session_id,class:"rail-icon","data-test":"sidebar-rail-icon",role:"button",tabindex:"0","aria-label":j.current_command||j.title||j.session_id.slice(0,8),onClick:G=>d("open",j),onKeydown:[jn(pt(G=>d("open",j),["prevent"]),["enter"]),jn(pt(G=>d("open",j),["prevent"]),["space"])]},[Pe(ks,{state:j.task_state??"idle",unread:j.unread===!0,size:14},null,8,["state","unread"])],40,XR))),128))])):($(),O("div",JR,[_("header",ZR,[p.value||l.value?Q("",!0):($(),O("span",QR,T(w(i)("tasks.sidebar.title")),1)),p.value||l.value?ct(($(),O("input",{key:2,ref_key:"searchEl",ref:f,"onUpdate:modelValue":V[2]||(V[2]=j=>l.value=j),type:"search",class:"sidebar-search","data-test":"sidebar-search",placeholder:w(i)("tasks.sidebar.searchPlaceholder"),"aria-label":w(i)("tasks.sidebar.searchPlaceholder"),onKeydown:jn(pt(k,["prevent"]),["esc"]),onBlur:C},null,40,tT)),[[Et,l.value]]):($(),O("button",{key:1,class:"search-icon-btn","data-test":"sidebar-search-toggle",title:w(i)("tasks.sidebar.searchPlaceholder"),"aria-label":w(i)("tasks.sidebar.searchPlaceholder"),onClick:y},V[16]||(V[16]=[_("svg",{width:"14",height:"14",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false"},[_("circle",{cx:"7",cy:"7",r:"4.5",fill:"none",stroke:"currentColor","stroke-width":"1.5"}),_("line",{x1:"10.5",y1:"10.5",x2:"14",y2:"14",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)]),8,eT)),p.value||l.value?Q("",!0):($(),O("button",{key:3,class:"group-toggle","data-test":"group-toggle",title:w(i)("tasks.settings.groupBy"),onClick:Y},T(w(s).activeId.value==="state"?w(i)("tasks.settings.groupByState"):w(i)("tasks.settings.groupByHost")),9,nT)),_("button",{class:"collapse-button","data-test":"collapse-button",title:w(i)("tasks.sidebar.collapse"),"aria-label":w(i)("tasks.sidebar.collapse"),onClick:V[3]||(V[3]=j=>d("update:collapsed",!0))},V[17]||(V[17]=[_("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("polyline",{points:"9 2 5 6 9 10"}),_("polyline",{points:"6 2 2 6 6 10"})],-1)]),8,iT)]),_("div",sT,[Pe(OR,{"by-host":N.byHost,"primary-state-for-host":N.primaryStateForHost,"completed-seen":N.completedSeen,"group-by":w(s).activeId.value,"by-state":N.byStateGroups,"active-session-id":N.activeSessionId,"open-session-ids":N.openSessionIds,"local-host-id":N.localHostId,"local-host":N.localHost,"search-query":l.value,"pane-location-for":N.paneLocationFor,"can-detach-session":N.canDetachSession,"tab-index-by-id":N.tabIndexById,onOpen:V[4]||(V[4]=j=>d("open",j)),onClose:V[5]||(V[5]=j=>d("close",j)),onMarkSeen:V[6]||(V[6]=j=>d("markSeen",j)),onMergeSelected:V[7]||(V[7]=j=>d("merge-selected")),onCloseSelected:V[8]||(V[8]=j=>d("close-selected")),onDetachSession:V[9]||(V[9]=j=>d("detach-session",j))},null,8,["by-host","primary-state-for-host","completed-seen","group-by","by-state","active-session-id","open-session-ids","local-host-id","local-host","search-query","pane-location-for","can-detach-session","tab-index-by-id"])]),w(r).size.value>=1?($(),O("footer",rT,[Pe(VR,{count:w(r).size.value,"open-count":o.value,"can-merge":c.value,onMerge:V[10]||(V[10]=j=>d("merge-selected")),onCloseSelected:V[11]||(V[11]=j=>d("close-selected")),onClear:V[12]||(V[12]=j=>w(r).clear())},null,8,["count","open-count","can-merge"])])):N.totalUnread>0?($(),O("footer",oT,[_("button",{class:"mark-all","data-test":"sidebar-mark-all",onClick:V[13]||(V[13]=j=>d("markSeen",{all:!0}))},T(w(i)("tasks.markAllRead")),1)])):Q("",!0)]))],38)]))}}),dT=kt(cT,[["__scopeId","data-v-0741527d"]]);var E_={exports:{}};(function(e,t){(function(n,i){e.exports=i()})(self,()=>(()=>{var n={4567:function(d,r,o){var c=this&&this.__decorate||function(y,C,k,E){var I,S=arguments.length,P=S<3?C:E===null?E=Object.getOwnPropertyDescriptor(C,k):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(y,C,k,E);else for(var A=y.length-1;A>=0;A--)(I=y[A])&&(P=(S<3?I(P):S>3?I(C,k,P):I(C,k))||P);return S>3&&P&&Object.defineProperty(C,k,P),P},h=this&&this.__param||function(y,C){return function(k,E){C(k,E,y)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const u=o(9042),v=o(6114),m=o(9924),b=o(844),g=o(5596),l=o(4725),f=o(3656);let p=r.AccessibilityManager=class extends b.Disposable{constructor(y,C){super(),this._terminal=y,this._renderService=C,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let k=0;kthis._handleBoundaryFocus(k,0),this._bottomBoundaryFocusListener=k=>this._handleBoundaryFocus(k,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new m.TimeBasedDebouncer(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(k=>this._handleResize(k.rows))),this.register(this._terminal.onRender(k=>this._refreshRows(k.start,k.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(k=>this._handleChar(k))),this.register(this._terminal.onLineFeed(()=>this._handleChar(` +`))),this.register(this._terminal.onA11yTab(k=>this._handleTab(k))),this.register(this._terminal.onKey(k=>this._handleKey(k.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new g.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,f.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,b.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(y){for(let C=0;C0?this._charsToConsume.shift()!==y&&(this._charsToAnnounce+=y):this._charsToAnnounce+=y,y===` +`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)),v.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,v.isMac&&this._liveRegion.remove()}_handleKey(y){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(y)||this._charsToConsume.push(y)}_refreshRows(y,C){this._liveRegionDebouncer.refresh(y,C,this._terminal.rows)}_renderRows(y,C){const k=this._terminal.buffer,E=k.lines.length.toString();for(let I=y;I<=C;I++){const S=k.translateBufferLineToString(k.ydisp+I,!0),P=(k.ydisp+I+1).toString(),A=this._rowElements[I];A&&(S.length===0?A.innerText=" ":A.textContent=S,A.setAttribute("aria-posinset",P),A.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(y,C){const k=y.target,E=this._rowElements[C===0?1:this._rowElements.length-2];if(k.getAttribute("aria-posinset")===(C===0?"1":`${this._terminal.buffer.lines.length}`)||y.relatedTarget!==E)return;let I,S;if(C===0?(I=k,S=this._rowElements.pop(),this._rowContainer.removeChild(S)):(I=this._rowElements.shift(),S=k,this._rowContainer.removeChild(I)),I.removeEventListener("focus",this._topBoundaryFocusListener),S.removeEventListener("focus",this._bottomBoundaryFocusListener),C===0){const P=this._createAccessibilityTreeNode();this._rowElements.unshift(P),this._rowContainer.insertAdjacentElement("afterbegin",P)}else{const P=this._createAccessibilityTreeNode();this._rowElements.push(P),this._rowContainer.appendChild(P)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(C===0?-1:1),this._rowElements[C===0?1:this._rowElements.length-2].focus(),y.preventDefault(),y.stopImmediatePropagation()}_handleResize(y){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let C=this._rowContainer.children.length;Cy;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const y=document.createElement("div");return y.setAttribute("role","listitem"),y.tabIndex=-1,this._refreshRowDimensions(y),y}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let y=0;y{function o(v){return v.replace(/\r?\n/g,"\r")}function c(v,m){return m?"\x1B[200~"+v+"\x1B[201~":v}function h(v,m,b,g){v=c(v=o(v),b.decPrivateModes.bracketedPasteMode&&g.rawOptions.ignoreBracketedPasteMode!==!0),b.triggerDataEvent(v,!0),m.value=""}function u(v,m,b){const g=b.getBoundingClientRect(),l=v.clientX-g.left-10,f=v.clientY-g.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${l}px`,m.style.top=`${f}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=o,r.bracketTextForPaste=c,r.copyHandler=function(v,m){v.clipboardData&&v.clipboardData.setData("text/plain",m.selectionText),v.preventDefault()},r.handlePasteEvent=function(v,m,b,g){v.stopPropagation(),v.clipboardData&&h(v.clipboardData.getData("text/plain"),m,b,g)},r.paste=h,r.moveTextAreaUnderMouseCursor=u,r.rightClickHandler=function(v,m,b,g,l){u(v,m,b),l&&g.rightClickSelect(v),m.value=g.selectionText,m.select()}},7239:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const c=o(1505);r.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(h,u,v){this._css.set(h,u,v)}getCss(h,u){return this._css.get(h,u)}setColor(h,u,v){this._color.set(h,u,v)}getColor(h,u){return this._color.get(h,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(o,c,h,u){o.addEventListener(c,h,u);let v=!1;return{dispose:()=>{v||(v=!0,o.removeEventListener(c,h,u))}}}},6465:function(d,r,o){var c=this&&this.__decorate||function(l,f,p,y){var C,k=arguments.length,E=k<3?f:y===null?y=Object.getOwnPropertyDescriptor(f,p):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,f,p,y);else for(var I=l.length-1;I>=0;I--)(C=l[I])&&(E=(k<3?C(E):k>3?C(f,p,E):C(f,p))||E);return k>3&&E&&Object.defineProperty(f,p,E),E},h=this&&this.__param||function(l,f){return function(p,y){f(p,y,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier2=void 0;const u=o(3656),v=o(8460),m=o(844),b=o(2585);let g=r.Linkifier2=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(l){super(),this._bufferService=l,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new v.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new v.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(l){return this._linkProviders.push(l),{dispose:()=>{const f=this._linkProviders.indexOf(l);f!==-1&&this._linkProviders.splice(f,1)}}}attachToDom(l,f,p){this._element=l,this._mouseService=f,this._renderService=p,this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(l){if(this._lastMouseEvent=l,!this._element||!this._mouseService)return;const f=this._positionFromMouseEvent(l,this._element,this._mouseService);if(!f)return;this._isMouseOut=!1;const p=l.composedPath();for(let y=0;y{k==null||k.forEach(E=>{E.link.dispose&&E.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=l.y);let C=!1;for(const[k,E]of this._linkProviders.entries())f?!((y=this._activeProviderReplies)===null||y===void 0)&&y.get(k)&&(C=this._checkLinkProviderResult(k,l,C)):E.provideLinks(l.y,I=>{var S,P;if(this._isMouseOut)return;const A=I==null?void 0:I.map(L=>({link:L}));(S=this._activeProviderReplies)===null||S===void 0||S.set(k,A),C=this._checkLinkProviderResult(k,l,C),((P=this._activeProviderReplies)===null||P===void 0?void 0:P.size)===this._linkProviders.length&&this._removeIntersectingLinks(l.y,this._activeProviderReplies)})}_removeIntersectingLinks(l,f){const p=new Set;for(let y=0;yl?this._bufferService.cols:E.link.range.end.x;for(let P=I;P<=S;P++){if(p.has(P)){C.splice(k--,1);break}p.add(P)}}}}_checkLinkProviderResult(l,f,p){var y;if(!this._activeProviderReplies)return p;const C=this._activeProviderReplies.get(l);let k=!1;for(let E=0;Ethis._linkAtPosition(I.link,f));E&&(p=!0,this._handleNewLink(E))}if(this._activeProviderReplies.size===this._linkProviders.length&&!p)for(let E=0;Ethis._linkAtPosition(S.link,f));if(I){p=!0,this._handleNewLink(I);break}}return p}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(l){if(!this._element||!this._mouseService||!this._currentLink)return;const f=this._positionFromMouseEvent(l,this._element,this._mouseService);f&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,f)&&this._currentLink.link.activate(l,this._currentLink.link.text)}_clearCurrentLink(l,f){this._element&&this._currentLink&&this._lastMouseEvent&&(!l||!f||this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=f)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(l){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const f=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);f&&this._linkAtPosition(l.link,f)&&(this._currentLink=l,this._currentLink.state={decorations:{underline:l.link.decorations===void 0||l.link.decorations.underline,pointerCursor:l.link.decorations===void 0||l.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,l.link,this._lastMouseEvent),l.link.decorations={},Object.defineProperties(l.link.decorations,{pointerCursor:{get:()=>{var p,y;return(y=(p=this._currentLink)===null||p===void 0?void 0:p.state)===null||y===void 0?void 0:y.decorations.pointerCursor},set:p=>{var y,C;!((y=this._currentLink)===null||y===void 0)&&y.state&&this._currentLink.state.decorations.pointerCursor!==p&&(this._currentLink.state.decorations.pointerCursor=p,this._currentLink.state.isHovered&&((C=this._element)===null||C===void 0||C.classList.toggle("xterm-cursor-pointer",p)))}},underline:{get:()=>{var p,y;return(y=(p=this._currentLink)===null||p===void 0?void 0:p.state)===null||y===void 0?void 0:y.decorations.underline},set:p=>{var y,C,k;!((y=this._currentLink)===null||y===void 0)&&y.state&&((k=(C=this._currentLink)===null||C===void 0?void 0:C.state)===null||k===void 0?void 0:k.decorations.underline)!==p&&(this._currentLink.state.decorations.underline=p,this._currentLink.state.isHovered&&this._fireUnderlineEvent(l.link,p))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(p=>{if(!this._currentLink)return;const y=p.start===0?0:p.start+1+this._bufferService.buffer.ydisp,C=this._bufferService.buffer.ydisp+1+p.end;if(this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=C&&(this._clearCurrentLink(y,C),this._lastMouseEvent&&this._element)){const k=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);k&&this._askForLink(k,!1)}})))}_linkHover(l,f,p){var y;!((y=this._currentLink)===null||y===void 0)&&y.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!0),this._currentLink.state.decorations.pointerCursor&&l.classList.add("xterm-cursor-pointer")),f.hover&&f.hover(p,f.text)}_fireUnderlineEvent(l,f){const p=l.range,y=this._bufferService.buffer.ydisp,C=this._createLinkUnderlineEvent(p.start.x-1,p.start.y-y-1,p.end.x,p.end.y-y-1,void 0);(f?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(C)}_linkLeave(l,f,p){var y;!((y=this._currentLink)===null||y===void 0)&&y.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!1),this._currentLink.state.decorations.pointerCursor&&l.classList.remove("xterm-cursor-pointer")),f.leave&&f.leave(p,f.text)}_linkAtPosition(l,f){const p=l.range.start.y*this._bufferService.cols+l.range.start.x,y=l.range.end.y*this._bufferService.cols+l.range.end.x,C=f.y*this._bufferService.cols+f.x;return p<=C&&C<=y}_positionFromMouseEvent(l,f,p){const y=p.getCoords(l,f,this._bufferService.cols,this._bufferService.rows);if(y)return{x:y[0],y:y[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(l,f,p,y,C){return{x1:l,y1:f,x2:p,y2:y,cols:this._bufferService.cols,fg:C}}};r.Linkifier2=g=c([h(0,b.IBufferService)],g)},9042:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(d,r,o){var c=this&&this.__decorate||function(g,l,f,p){var y,C=arguments.length,k=C<3?l:p===null?p=Object.getOwnPropertyDescriptor(l,f):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(g,l,f,p);else for(var E=g.length-1;E>=0;E--)(y=g[E])&&(k=(C<3?y(k):C>3?y(l,f,k):y(l,f))||k);return C>3&&k&&Object.defineProperty(l,f,k),k},h=this&&this.__param||function(g,l){return function(f,p){l(f,p,g)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const u=o(511),v=o(2585);let m=r.OscLinkProvider=class{constructor(g,l,f){this._bufferService=g,this._optionsService=l,this._oscLinkService=f}provideLinks(g,l){var f;const p=this._bufferService.buffer.lines.get(g-1);if(!p)return void l(void 0);const y=[],C=this._optionsService.rawOptions.linkHandler,k=new u.CellData,E=p.getTrimmedLength();let I=-1,S=-1,P=!1;for(let A=0;AC?C.activate(M,B,x):b(0,B),hover:(M,B)=>{var z;return(z=C==null?void 0:C.hover)===null||z===void 0?void 0:z.call(C,M,B,x)},leave:(M,B)=>{var z;return(z=C==null?void 0:C.leave)===null||z===void 0?void 0:z.call(C,M,B,x)}})}P=!1,k.hasExtendedAttrs()&&k.extended.urlId?(S=A,I=k.extended.urlId):(S=-1,I=-1)}}l(y)}};function b(g,l){if(confirm(`Do you want to navigate to ${l}? + +WARNING: This link could potentially be dangerous`)){const f=window.open();if(f){try{f.opener=null}catch{}f.location.href=l}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=m=c([h(0,v.IBufferService),h(1,v.IOptionsService),h(2,v.IOscLinkService)],m)},6193:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(o,c){this._parentWindow=o,this._renderCallback=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(o,c,h){this._rowCount=h,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},5596:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ScreenDprMonitor=void 0;const c=o(844);class h extends c.Disposable{constructor(v){super(),this._parentWindow=v,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,c.toDisposable)(()=>{this.clearListener()}))}setListener(v){this._listener&&this.clearListener(),this._listener=v,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)===null||v===void 0||v.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._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}r.ScreenDprMonitor=h},3236:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const c=o(3614),h=o(3656),u=o(6465),v=o(9042),m=o(3730),b=o(1680),g=o(3107),l=o(5744),f=o(2950),p=o(1296),y=o(428),C=o(4269),k=o(5114),E=o(8934),I=o(3230),S=o(9312),P=o(4725),A=o(6731),L=o(8055),x=o(8969),D=o(8460),M=o(844),B=o(6114),z=o(8437),Y=o(2584),U=o(7399),N=o(5941),V=o(9074),j=o(2585),G=o(5435),te=o(4567),se=typeof window<"u"?window.document:null;class oe extends x.CoreTerminal{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}constructor(K={}){super(K),this.browser=B,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new M.MutableDisposable),this._onCursorMove=this.register(new D.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new D.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new D.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new D.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new D.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new D.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new D.EventEmitter),this._onBlur=this.register(new D.EventEmitter),this._onA11yCharEmitter=this.register(new D.EventEmitter),this._onA11yTabEmitter=this.register(new D.EventEmitter),this._onWillOpen=this.register(new D.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(u.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(V.DecorationService),this._instantiationService.setService(j.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((Z,J)=>this.refresh(Z,J))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(Z=>this._reportWindowsOptions(Z))),this.register(this._inputHandler.onColor(Z=>this._handleColorEvent(Z))),this.register((0,D.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,D.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(Z=>this._afterResize(Z.cols,Z.rows))),this.register((0,M.toDisposable)(()=>{var Z,J;this._customKeyEventHandler=void 0,(J=(Z=this.element)===null||Z===void 0?void 0:Z.parentNode)===null||J===void 0||J.removeChild(this.element)}))}_handleColorEvent(K){if(this._themeService)for(const Z of K){let J,ae="";switch(Z.index){case 256:J="foreground",ae="10";break;case 257:J="background",ae="11";break;case 258:J="cursor",ae="12";break;default:J="ansi",ae="4;"+Z.index}switch(Z.type){case 0:const Ie=L.color.toColorRGB(J==="ansi"?this._themeService.colors.ansi[Z.index]:this._themeService.colors[J]);this.coreService.triggerDataEvent(`${Y.C0.ESC}]${ae};${(0,N.toRgbString)(Ie)}${Y.C1_ESCAPED.ST}`);break;case 1:if(J==="ansi")this._themeService.modifyColors(de=>de.ansi[Z.index]=L.rgba.toColor(...Z.color));else{const de=J;this._themeService.modifyColors(Le=>Le[de]=L.rgba.toColor(...Z.color))}break;case 2:this._themeService.restoreColor(Z.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(K){K?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(te.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(K){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[I"),this.updateCursorStyle(K),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var K;return(K=this.textarea)===null||K===void 0?void 0:K.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const K=this.buffer.ybase+this.buffer.y,Z=this.buffer.lines.get(K);if(!Z)return;const J=Math.min(this.buffer.x,this.cols-1),ae=this._renderService.dimensions.css.cell.height,Ie=Z.getWidth(J),de=this._renderService.dimensions.css.cell.width*Ie,Le=this.buffer.y*this._renderService.dimensions.css.cell.height,xe=J*this._renderService.dimensions.css.cell.width;this.textarea.style.left=xe+"px",this.textarea.style.top=Le+"px",this.textarea.style.width=de+"px",this.textarea.style.height=ae+"px",this.textarea.style.lineHeight=ae+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,h.addDisposableDomListener)(this.element,"copy",Z=>{this.hasSelection()&&(0,c.copyHandler)(Z,this._selectionService)}));const K=Z=>(0,c.handlePasteEvent)(Z,this.textarea,this.coreService,this.optionsService);this.register((0,h.addDisposableDomListener)(this.textarea,"paste",K)),this.register((0,h.addDisposableDomListener)(this.element,"paste",K)),B.isFirefox?this.register((0,h.addDisposableDomListener)(this.element,"mousedown",Z=>{Z.button===2&&(0,c.rightClickHandler)(Z,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,h.addDisposableDomListener)(this.element,"contextmenu",Z=>{(0,c.rightClickHandler)(Z,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),B.isLinux&&this.register((0,h.addDisposableDomListener)(this.element,"auxclick",Z=>{Z.button===1&&(0,c.moveTextAreaUnderMouseCursor)(Z,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,h.addDisposableDomListener)(this.textarea,"keyup",K=>this._keyUp(K),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"keydown",K=>this._keyDown(K),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"keypress",K=>this._keyPress(K),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionupdate",K=>this._compositionHelper.compositionupdate(K))),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,h.addDisposableDomListener)(this.textarea,"input",K=>this._inputEvent(K),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(K){var Z;if(!K)throw new Error("Terminal requires a parent element.");K.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=K.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),K.appendChild(this.element);const J=se.createDocumentFragment();this._viewportElement=se.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),J.appendChild(this._viewportElement),this._viewportScrollArea=se.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=se.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=se.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),J.appendChild(this.screenElement),this.textarea=se.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel),B.isChromeOS||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._coreBrowserService=this._instantiationService.createInstance(k.CoreBrowserService,this.textarea,(Z=this._document.defaultView)!==null&&Z!==void 0?Z:window),this._instantiationService.setService(P.ICoreBrowserService,this._coreBrowserService),this.register((0,h.addDisposableDomListener)(this.textarea,"focus",ae=>this._handleTextAreaFocus(ae))),this.register((0,h.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(P.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(A.ThemeService),this._instantiationService.setService(P.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(P.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(I.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(P.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(ae=>this._onRender.fire(ae))),this.onResize(ae=>this._renderService.resize(ae.cols,ae.rows)),this._compositionView=se.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(f.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(J);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(E.MouseService),this._instantiationService.setService(P.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(b.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(ae=>this.scrollLines(ae.amount,ae.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),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.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(S.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(P.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(ae=>this.scrollLines(ae.amount,ae.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(ae=>this._renderService.handleSelectionChanged(ae.start,ae.end,ae.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(ae=>{this.textarea.value=ae,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(ae=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(g.BufferDecorationRenderer,this.screenElement)),this.register((0,h.addDisposableDomListener)(this.element,"mousedown",ae=>this._selectionService.handleMouseDown(ae))),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(te.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",ae=>this._handleScreenReaderModeOptionChange(ae))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",ae=>{!this._overviewRulerRenderer&&ae&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(p.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const K=this,Z=this.element;function J(de){const Le=K._mouseService.getMouseReportCoords(de,K.screenElement);if(!Le)return!1;let xe,Qe;switch(de.overrideType||de.type){case"mousemove":Qe=32,de.buttons===void 0?(xe=3,de.button!==void 0&&(xe=de.button<3?de.button:3)):xe=1&de.buttons?0:4&de.buttons?1:2&de.buttons?2:3;break;case"mouseup":Qe=0,xe=de.button<3?de.button:3;break;case"mousedown":Qe=1,xe=de.button<3?de.button:3;break;case"wheel":if(K.viewport.getLinesScrolled(de)===0)return!1;Qe=de.deltaY<0?0:1,xe=4;break;default:return!1}return!(Qe===void 0||xe===void 0||xe>4)&&K.coreMouseService.triggerMouseEvent({col:Le.col,row:Le.row,x:Le.x,y:Le.y,button:xe,action:Qe,ctrl:de.ctrlKey,alt:de.altKey,shift:de.shiftKey})}const ae={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Ie={mouseup:de=>(J(de),de.buttons||(this._document.removeEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.removeEventListener("mousemove",ae.mousedrag)),this.cancel(de)),wheel:de=>(J(de),this.cancel(de,!0)),mousedrag:de=>{de.buttons&&J(de)},mousemove:de=>{de.buttons||J(de)}};this.register(this.coreMouseService.onProtocolChange(de=>{de?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(de)),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()),8&de?ae.mousemove||(Z.addEventListener("mousemove",Ie.mousemove),ae.mousemove=Ie.mousemove):(Z.removeEventListener("mousemove",ae.mousemove),ae.mousemove=null),16&de?ae.wheel||(Z.addEventListener("wheel",Ie.wheel,{passive:!1}),ae.wheel=Ie.wheel):(Z.removeEventListener("wheel",ae.wheel),ae.wheel=null),2&de?ae.mouseup||(Z.addEventListener("mouseup",Ie.mouseup),ae.mouseup=Ie.mouseup):(this._document.removeEventListener("mouseup",ae.mouseup),Z.removeEventListener("mouseup",ae.mouseup),ae.mouseup=null),4&de?ae.mousedrag||(ae.mousedrag=Ie.mousedrag):(this._document.removeEventListener("mousemove",ae.mousedrag),ae.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,h.addDisposableDomListener)(Z,"mousedown",de=>{if(de.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(de))return J(de),ae.mouseup&&this._document.addEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.addEventListener("mousemove",ae.mousedrag),this.cancel(de)})),this.register((0,h.addDisposableDomListener)(Z,"wheel",de=>{if(!ae.wheel){if(!this.buffer.hasScrollback){const Le=this.viewport.getLinesScrolled(de);if(Le===0)return;const xe=Y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(de.deltaY<0?"A":"B");let Qe="";for(let De=0;De{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(de),this.cancel(de)},{passive:!0})),this.register((0,h.addDisposableDomListener)(Z,"touchmove",de=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(de)?void 0:this.cancel(de)},{passive:!1}))}refresh(K,Z){var J;(J=this._renderService)===null||J===void 0||J.refreshRows(K,Z)}updateCursorStyle(K){var Z;!((Z=this._selectionService)===null||Z===void 0)&&Z.shouldColumnSelect(K)?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(K,Z,J=0){var ae;J===1?(super.scrollLines(K,Z,J),this.refresh(0,this.rows-1)):(ae=this.viewport)===null||ae===void 0||ae.scrollLines(K)}paste(K){(0,c.paste)(K,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(K){this._customKeyEventHandler=K}registerLinkProvider(K){return this.linkifier2.registerLinkProvider(K)}registerCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const Z=this._characterJoinerService.register(K);return this.refresh(0,this.rows-1),Z}deregisterCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(K)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(K){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+K)}registerDecoration(K){return this._decorationService.registerDecoration(K)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(K,Z,J){this._selectionService.setSelection(K,Z,J)}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 K;(K=this._selectionService)===null||K===void 0||K.clearSelection()}selectAll(){var K;(K=this._selectionService)===null||K===void 0||K.selectAll()}selectLines(K,Z){var J;(J=this._selectionService)===null||J===void 0||J.selectLines(K,Z)}_keyDown(K){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;const Z=this.browser.isMac&&this.options.macOptionIsMeta&&K.altKey;if(!Z&&!this._compositionHelper.keydown(K))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;Z||K.key!=="Dead"&&K.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const J=(0,U.evaluateKeyboardEvent)(K,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(K),J.type===3||J.type===2){const ae=this.rows-1;return this.scrollLines(J.type===2?-ae:ae),this.cancel(K,!0)}return J.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,K)||(J.cancel&&this.cancel(K,!0),!J.key||!!(K.key&&!K.ctrlKey&&!K.altKey&&!K.metaKey&&K.key.length===1&&K.key.charCodeAt(0)>=65&&K.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(J.key!==Y.C0.ETX&&J.key!==Y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:J.key,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(J.key,!0),!this.optionsService.rawOptions.screenReaderMode||K.altKey||K.ctrlKey?this.cancel(K,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(K,Z){const J=K.isMac&&!this.options.macOptionIsMeta&&Z.altKey&&!Z.ctrlKey&&!Z.metaKey||K.isWindows&&Z.altKey&&Z.ctrlKey&&!Z.metaKey||K.isWindows&&Z.getModifierState("AltGraph");return Z.type==="keypress"?J:J&&(!Z.keyCode||Z.keyCode>47)}_keyUp(K){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1||(function(Z){return Z.keyCode===16||Z.keyCode===17||Z.keyCode===18}(K)||this.focus(),this.updateCursorStyle(K),this._keyPressHandled=!1)}_keyPress(K){let Z;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;if(this.cancel(K),K.charCode)Z=K.charCode;else if(K.which===null||K.which===void 0)Z=K.keyCode;else{if(K.which===0||K.charCode===0)return!1;Z=K.which}return!(!Z||(K.altKey||K.ctrlKey||K.metaKey)&&!this._isThirdLevelShift(this.browser,K)||(Z=String.fromCharCode(Z),this._onKey.fire({key:Z,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(Z,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(K){if(K.data&&K.inputType==="insertText"&&(!K.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const Z=K.data;return this.coreService.triggerDataEvent(Z,!0),this.cancel(K),!0}return!1}resize(K,Z){K!==this.cols||Z!==this.rows?super.resize(K,Z):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(K,Z){var J,ae;(J=this._charSizeService)===null||J===void 0||J.measure(),(ae=this.viewport)===null||ae===void 0||ae.syncScrollArea(!0)}clear(){var K;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 Z=1;Z{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(o,c=1e3){this._renderCallback=o,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,c,h){this._rowCount=h,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const v=u-this._lastRefreshMs,m=this._debounceThresholdMS-v;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},m)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c)}}},1680:function(d,r,o){var c=this&&this.__decorate||function(f,p,y,C){var k,E=arguments.length,I=E<3?p:C===null?C=Object.getOwnPropertyDescriptor(p,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(f,p,y,C);else for(var S=f.length-1;S>=0;S--)(k=f[S])&&(I=(E<3?k(I):E>3?k(p,y,I):k(p,y))||I);return E>3&&I&&Object.defineProperty(p,y,I),I},h=this&&this.__param||function(f,p){return function(y,C){p(y,C,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const u=o(3656),v=o(4725),m=o(8460),b=o(844),g=o(2585);let l=r.Viewport=class extends b.Disposable{constructor(f,p,y,C,k,E,I,S){super(),this._viewportElement=f,this._scrollArea=p,this._bufferService=y,this._optionsService=C,this._charSizeService=k,this._renderService=E,this._coreBrowserService=I,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(P=>this._activeBuffer=P.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(P=>this._renderDimensions=P)),this._handleThemeChange(S.colors),this.register(S.onChangeColors(P=>this._handleThemeChange(P))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(f){this._viewportElement.style.backgroundColor=f.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(f){if(f)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const p=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==p&&(this._lastRecordedBufferHeight=p,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const f=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==f&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=f),this._refreshAnimationFrame=null}syncScrollArea(f=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(f);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(f)}_handleScroll(f){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const p=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const f=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(f*(this._smoothScrollState.target-this._smoothScrollState.origin)),f<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(f,p){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(p<0&&this._viewportElement.scrollTop!==0||p>0&&y0&&(C=x),k=""}}return{bufferElements:E,cursorElement:C}}getLinesScrolled(f){if(f.deltaY===0||f.shiftKey)return 0;let p=this._applyScrollModifier(f.deltaY,f);return f.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(p/=this._currentRowHeight+0,this._wheelPartialScroll+=p,p=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):f.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(p*=this._bufferService.rows),p}_applyScrollModifier(f,p){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&p.altKey||y==="ctrl"&&p.ctrlKey||y==="shift"&&p.shiftKey?f*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:f*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(f){this._lastTouchY=f.touches[0].pageY}handleTouchMove(f){const p=this._lastTouchY-f.touches[0].pageY;return this._lastTouchY=f.touches[0].pageY,p!==0&&(this._viewportElement.scrollTop+=p,this._bubbleScroll(f,p))}};r.Viewport=l=c([h(2,g.IBufferService),h(3,g.IOptionsService),h(4,v.ICharSizeService),h(5,v.IRenderService),h(6,v.ICoreBrowserService),h(7,v.IThemeService)],l)},3107:function(d,r,o){var c=this&&this.__decorate||function(l,f,p,y){var C,k=arguments.length,E=k<3?f:y===null?y=Object.getOwnPropertyDescriptor(f,p):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,f,p,y);else for(var I=l.length-1;I>=0;I--)(C=l[I])&&(E=(k<3?C(E):k>3?C(f,p,E):C(f,p))||E);return k>3&&E&&Object.defineProperty(f,p,E),E},h=this&&this.__param||function(l,f){return function(p,y){f(p,y,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const u=o(3656),v=o(4725),m=o(844),b=o(2585);let g=r.BufferDecorationRenderer=class extends m.Disposable{constructor(l,f,p,y){super(),this._screenElement=l,this._bufferService=f,this._decorationService=p,this._renderService=y,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((0,u.addDisposableDomListener)(window,"resize",()=>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(C=>this._removeDecoration(C))),this.register((0,m.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const l of this._decorationService.decorations)this._renderDecoration(l);this._dimensionsChanged=!1}_renderDecoration(l){this._refreshStyle(l),this._dimensionsChanged&&this._refreshXPosition(l)}_createElement(l){var f,p;const y=document.createElement("div");y.classList.add("xterm-decoration"),y.classList.toggle("xterm-decoration-top-layer",((f=l==null?void 0:l.options)===null||f===void 0?void 0:f.layer)==="top"),y.style.width=`${Math.round((l.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,y.style.height=(l.options.height||1)*this._renderService.dimensions.css.cell.height+"px",y.style.top=(l.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",y.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const C=(p=l.options.x)!==null&&p!==void 0?p:0;return C&&C>this._bufferService.cols&&(y.style.display="none"),this._refreshXPosition(l,y),y}_refreshStyle(l){const f=l.marker.line-this._bufferService.buffers.active.ydisp;if(f<0||f>=this._bufferService.rows)l.element&&(l.element.style.display="none",l.onRenderEmitter.fire(l.element));else{let p=this._decorationElements.get(l);p||(p=this._createElement(l),l.element=p,this._decorationElements.set(l,p),this._container.appendChild(p),l.onDispose(()=>{this._decorationElements.delete(l),p.remove()})),p.style.top=f*this._renderService.dimensions.css.cell.height+"px",p.style.display=this._altBufferIsActive?"none":"block",l.onRenderEmitter.fire(p)}}_refreshXPosition(l,f=l.element){var p;if(!f)return;const y=(p=l.options.x)!==null&&p!==void 0?p:0;(l.options.anchor||"left")==="right"?f.style.right=y?y*this._renderService.dimensions.css.cell.width+"px":"":f.style.left=y?y*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(l){var f;(f=this._decorationElements.get(l))===null||f===void 0||f.remove(),this._decorationElements.delete(l),l.dispose()}};r.BufferDecorationRenderer=g=c([h(1,b.IBufferService),h(2,b.IDecorationService),h(3,v.IRenderService)],g)},5871:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.ColorZoneStore=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(o){if(o.options.overviewRulerOptions){for(const c of this._zones)if(c.color===o.options.overviewRulerOptions.color&&c.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,o.marker.line))return;if(this._lineAdjacentToZone(c,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(c,o.marker.line)}if(this._zonePoolIndex=o.startBufferLine&&c<=o.endBufferLine}_lineAdjacentToZone(o,c,h){return c>=o.startBufferLine-this._linePadding[h||"full"]&&c<=o.endBufferLine+this._linePadding[h||"full"]}_addLineToZone(o,c){o.startBufferLine=Math.min(o.startBufferLine,c),o.endBufferLine=Math.max(o.endBufferLine,c)}}},5744:function(d,r,o){var c=this&&this.__decorate||function(C,k,E,I){var S,P=arguments.length,A=P<3?k:I===null?I=Object.getOwnPropertyDescriptor(k,E):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(C,k,E,I);else for(var L=C.length-1;L>=0;L--)(S=C[L])&&(A=(P<3?S(A):P>3?S(k,E,A):S(k,E))||A);return P>3&&A&&Object.defineProperty(k,E,A),A},h=this&&this.__param||function(C,k){return function(E,I){k(E,I,C)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const u=o(5871),v=o(3656),m=o(4725),b=o(844),g=o(2585),l={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0};let y=r.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(C,k,E,I,S,P,A){var L;super(),this._viewportElement=C,this._screenElement=k,this._bufferService=E,this._decorationService=I,this._renderService=S,this._optionsService=P,this._coreBrowseService=A,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(L=this._viewportElement.parentElement)===null||L===void 0||L.insertBefore(this._canvas,this._viewportElement);const x=this._canvas.getContext("2d");if(!x)throw new Error("Ctx cannot be null");this._ctx=x,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)(()=>{var D;(D=this._canvas)===null||D===void 0||D.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){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())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register((0,v.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const C=Math.floor(this._canvas.width/3),k=Math.ceil(this._canvas.width/3);f.full=this._canvas.width,f.left=C,f.center=k,f.right=C,this._refreshDrawHeightConstants(),p.full=0,p.left=0,p.center=f.left,p.right=f.left+f.center}_refreshDrawHeightConstants(){l.full=Math.round(2*this._coreBrowseService.dpr);const C=this._canvas.height/this._bufferService.buffer.lines.length,k=Math.round(Math.max(Math.min(C,12),6)*this._coreBrowseService.dpr);l.left=k,l.center=k,l.right=k}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.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._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.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(const k of this._decorationService.decorations)this._colorZoneStore.addDecoration(k);this._ctx.lineWidth=1;const C=this._colorZoneStore.zones;for(const k of C)k.position!=="full"&&this._renderColorZone(k);for(const k of C)k.position==="full"&&this._renderColorZone(k);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(C){this._ctx.fillStyle=C.color,this._ctx.fillRect(p[C.position||"full"],Math.round((this._canvas.height-1)*(C.startBufferLine/this._bufferService.buffers.active.lines.length)-l[C.position||"full"]/2),f[C.position||"full"],Math.round((this._canvas.height-1)*((C.endBufferLine-C.startBufferLine)/this._bufferService.buffers.active.lines.length)+l[C.position||"full"]))}_queueRefresh(C,k){this._shouldUpdateDimensions=C||this._shouldUpdateDimensions,this._shouldUpdateAnchor=k||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};r.OverviewRulerRenderer=y=c([h(2,g.IBufferService),h(3,g.IDecorationService),h(4,m.IRenderService),h(5,g.IOptionsService),h(6,m.ICoreBrowserService)],y)},2950:function(d,r,o){var c=this&&this.__decorate||function(g,l,f,p){var y,C=arguments.length,k=C<3?l:p===null?p=Object.getOwnPropertyDescriptor(l,f):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(g,l,f,p);else for(var E=g.length-1;E>=0;E--)(y=g[E])&&(k=(C<3?y(k):C>3?y(l,f,k):y(l,f))||k);return C>3&&k&&Object.defineProperty(l,f,k),k},h=this&&this.__param||function(g,l){return function(f,p){l(f,p,g)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const u=o(4725),v=o(2585),m=o(2584);let b=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(g,l,f,p,y,C){this._textarea=g,this._compositionView=l,this._bufferService=f,this._optionsService=p,this._coreService=y,this._renderService=C,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(g){this._compositionView.textContent=g.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(g){if(this._isComposing||this._isSendingComposition){if(g.keyCode===229||g.keyCode===16||g.keyCode===17||g.keyCode===18)return!1;this._finalizeComposition(!1)}return g.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(g){if(this._compositionView.classList.remove("active"),this._isComposing=!1,g){const l={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let f;this._isSendingComposition=!1,l.start+=this._dataAlreadySent.length,f=this._isComposing?this._textarea.value.substring(l.start,l.end):this._textarea.value.substring(l.start),f.length>0&&this._coreService.triggerDataEvent(f,!0)}},0)}else{this._isSendingComposition=!1;const l=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(l,!0)}}_handleAnyTextareaChanges(){const g=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const l=this._textarea.value,f=l.replace(g,"");this._dataAlreadySent=f,l.length>g.length?this._coreService.triggerDataEvent(f,!0):l.lengththis.updateCompositionElements(!0),0)}}};r.CompositionHelper=b=c([h(2,v.IBufferService),h(3,v.IOptionsService),h(4,v.ICoreService),h(5,u.IRenderService)],b)},9806:(d,r)=>{function o(c,h,u){const v=u.getBoundingClientRect(),m=c.getComputedStyle(u),b=parseInt(m.getPropertyValue("padding-left")),g=parseInt(m.getPropertyValue("padding-top"));return[h.clientX-v.left-b,h.clientY-v.top-g]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=o,r.getCoords=function(c,h,u,v,m,b,g,l,f){if(!b)return;const p=o(c,h,u);return p?(p[0]=Math.ceil((p[0]+(f?g/2:0))/g),p[1]=Math.ceil(p[1]/l),p[0]=Math.min(Math.max(p[0],1),v+(f?1:0)),p[1]=Math.min(Math.max(p[1],1),m),p):void 0}},9504:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const c=o(2584);function h(l,f,p,y){const C=l-u(l,p),k=f-u(f,p),E=Math.abs(C-k)-function(I,S,P){let A=0;const L=I-u(I,P),x=S-u(S,P);for(let D=0;D=0&&lf?"A":"B"}function m(l,f,p,y,C,k){let E=l,I=f,S="";for(;E!==p||I!==y;)E+=C?1:-1,C&&E>k.cols-1?(S+=k.buffer.translateBufferLineToString(I,!1,l,E),E=0,l=0,I++):!C&&E<0&&(S+=k.buffer.translateBufferLineToString(I,!1,0,l+1),E=k.cols-1,l=E,I--);return S+k.buffer.translateBufferLineToString(I,!1,l,E)}function b(l,f){const p=f?"O":"[";return c.C0.ESC+p+l}function g(l,f){l=Math.floor(l);let p="";for(let y=0;y0?L-u(L,x):P;const B=L,z=function(Y,U,N,V,j,G){let te;return te=h(N,V,j,G).length>0?V-u(V,j):U,Y=N&&tel?"D":"C",g(Math.abs(C-l),b(E,y));E=k>f?"D":"C";const I=Math.abs(k-f);return g(function(S,P){return P.cols-S}(k>f?l:C,p)+(I-1)*p.cols+1+((k>f?C:l)-1),b(E,y))}},1296:function(d,r,o){var c=this&&this.__decorate||function(x,D,M,B){var z,Y=arguments.length,U=Y<3?D:B===null?B=Object.getOwnPropertyDescriptor(D,M):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(x,D,M,B);else for(var N=x.length-1;N>=0;N--)(z=x[N])&&(U=(Y<3?z(U):Y>3?z(D,M,U):z(D,M))||U);return Y>3&&U&&Object.defineProperty(D,M,U),U},h=this&&this.__param||function(x,D){return function(M,B){D(M,B,x)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const u=o(3787),v=o(2550),m=o(2223),b=o(6171),g=o(4725),l=o(8055),f=o(8460),p=o(844),y=o(2585),C="xterm-dom-renderer-owner-",k="xterm-rows",E="xterm-fg-",I="xterm-bg-",S="xterm-focus",P="xterm-selection";let A=1,L=r.DomRenderer=class extends p.Disposable{constructor(x,D,M,B,z,Y,U,N,V,j){super(),this._element=x,this._screenElement=D,this._viewportElement=M,this._linkifier2=B,this._charSizeService=Y,this._optionsService=U,this._bufferService=N,this._coreBrowserService=V,this._themeService=j,this._terminalClass=A++,this._rowElements=[],this.onRequestRedraw=this.register(new f.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(k),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add(P),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,b.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(G=>this._injectCss(G))),this._injectCss(this._themeService.colors),this._rowFactory=z.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(C+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(G=>this._handleLinkHover(G))),this.register(this._linkifier2.onHideLinkUnderline(G=>this._handleLinkLeave(G))),this.register((0,p.toDisposable)(()=>{this._element.classList.remove(C+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new v.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const x=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*x,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*x),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/x),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/x),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(const M of this._rowElements)M.style.width=`${this.dimensions.css.canvas.width}px`,M.style.height=`${this.dimensions.css.cell.height}px`,M.style.lineHeight=`${this.dimensions.css.cell.height}px`,M.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const D=`${this._terminalSelector} .${k} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=D,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(x){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let D=`${this._terminalSelector} .${k} { color: ${x.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;D+=`${this._terminalSelector} .${k} .xterm-dim { color: ${l.color.multiplyOpacity(x.foreground,.5).css};}`,D+=`${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;}`,D+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",D+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${x.cursor.css}; color: ${x.cursorAccent.css}; } 50% { background-color: inherit; color: ${x.cursor.css}; }}`,D+=`${this._terminalSelector} .${k}.${S} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${k}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block { background-color: ${x.cursor.css}; color: ${x.cursorAccent.css};}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${x.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${x.cursor.css} inset;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${x.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,D+=`${this._terminalSelector} .${P} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${P} div { position: absolute; background-color: ${x.selectionBackgroundOpaque.css};}${this._terminalSelector} .${P} div { position: absolute; background-color: ${x.selectionInactiveBackgroundOpaque.css};}`;for(const[M,B]of x.ansi.entries())D+=`${this._terminalSelector} .${E}${M} { color: ${B.css}; }${this._terminalSelector} .${E}${M}.xterm-dim { color: ${l.color.multiplyOpacity(B,.5).css}; }${this._terminalSelector} .${I}${M} { background-color: ${B.css}; }`;D+=`${this._terminalSelector} .${E}${m.INVERTED_DEFAULT_COLOR} { color: ${l.color.opaque(x.background).css}; }${this._terminalSelector} .${E}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${l.color.multiplyOpacity(l.color.opaque(x.background),.5).css}; }${this._terminalSelector} .${I}${m.INVERTED_DEFAULT_COLOR} { background-color: ${x.foreground.css}; }`,this._themeStyleElement.textContent=D}_setDefaultSpacing(){const x=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${x}px`,this._rowFactory.defaultSpacing=x}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(x,D){for(let M=this._rowElements.length;M<=D;M++){const B=document.createElement("div");this._rowContainer.appendChild(B),this._rowElements.push(B)}for(;this._rowElements.length>D;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(x,D){this._refreshRowElements(x,D),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(S)}handleFocus(){this._rowContainer.classList.add(S),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(x,D,M){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(x,D,M),this.renderRows(0,this._bufferService.rows-1),!x||!D)return;const B=x[1]-this._bufferService.buffer.ydisp,z=D[1]-this._bufferService.buffer.ydisp,Y=Math.max(B,0),U=Math.min(z,this._bufferService.rows-1);if(Y>=this._bufferService.rows||U<0)return;const N=document.createDocumentFragment();if(M){const V=x[0]>D[0];N.appendChild(this._createSelectionElement(Y,V?D[0]:x[0],V?x[0]:D[0],U-Y+1))}else{const V=B===Y?x[0]:0,j=Y===z?D[0]:this._bufferService.cols;N.appendChild(this._createSelectionElement(Y,V,j));const G=U-Y-1;if(N.appendChild(this._createSelectionElement(Y+1,0,this._bufferService.cols,G)),Y!==U){const te=z===U?D[0]:this._bufferService.cols;N.appendChild(this._createSelectionElement(U,0,te))}}this._selectionContainer.appendChild(N)}_createSelectionElement(x,D,M,B=1){const z=document.createElement("div");return z.style.height=B*this.dimensions.css.cell.height+"px",z.style.top=x*this.dimensions.css.cell.height+"px",z.style.left=D*this.dimensions.css.cell.width+"px",z.style.width=this.dimensions.css.cell.width*(M-D)+"px",z}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(const x of this._rowElements)x.replaceChildren()}renderRows(x,D){const M=this._bufferService.buffer,B=M.ybase+M.y,z=Math.min(M.x,this._bufferService.cols-1),Y=this._optionsService.rawOptions.cursorBlink,U=this._optionsService.rawOptions.cursorStyle,N=this._optionsService.rawOptions.cursorInactiveStyle;for(let V=x;V<=D;V++){const j=V+M.ydisp,G=this._rowElements[V],te=M.lines.get(j);if(!G||!te)break;G.replaceChildren(...this._rowFactory.createRow(te,j,j===B,U,N,z,Y,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${C}${this._terminalClass}`}_handleLinkHover(x){this._setCellUnderline(x.x1,x.x2,x.y1,x.y2,x.cols,!0)}_handleLinkLeave(x){this._setCellUnderline(x.x1,x.x2,x.y1,x.y2,x.cols,!1)}_setCellUnderline(x,D,M,B,z,Y){M<0&&(x=0),B<0&&(D=0);const U=this._bufferService.rows-1;M=Math.max(Math.min(M,U),0),B=Math.max(Math.min(B,U),0),z=Math.min(z,this._bufferService.cols);const N=this._bufferService.buffer,V=N.ybase+N.y,j=Math.min(N.x,z-1),G=this._optionsService.rawOptions.cursorBlink,te=this._optionsService.rawOptions.cursorStyle,se=this._optionsService.rawOptions.cursorInactiveStyle;for(let oe=M;oe<=B;++oe){const Fe=oe+N.ydisp,K=this._rowElements[oe],Z=N.lines.get(Fe);if(!K||!Z)break;K.replaceChildren(...this._rowFactory.createRow(Z,Fe,Fe===V,te,se,j,G,this.dimensions.css.cell.width,this._widthCache,Y?oe===M?x:0:-1,Y?(oe===B?D:z)-1:-1))}}};r.DomRenderer=L=c([h(4,y.IInstantiationService),h(5,g.ICharSizeService),h(6,y.IOptionsService),h(7,y.IBufferService),h(8,g.ICoreBrowserService),h(9,g.IThemeService)],L)},3787:function(d,r,o){var c=this&&this.__decorate||function(E,I,S,P){var A,L=arguments.length,x=L<3?I:P===null?P=Object.getOwnPropertyDescriptor(I,S):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(E,I,S,P);else for(var D=E.length-1;D>=0;D--)(A=E[D])&&(x=(L<3?A(x):L>3?A(I,S,x):A(I,S))||x);return L>3&&x&&Object.defineProperty(I,S,x),x},h=this&&this.__param||function(E,I){return function(S,P){I(S,P,E)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;const u=o(2223),v=o(643),m=o(511),b=o(2585),g=o(8055),l=o(4725),f=o(4269),p=o(6171),y=o(3734);let C=r.DomRendererRowFactory=class{constructor(E,I,S,P,A,L,x){this._document=E,this._characterJoinerService=I,this._optionsService=S,this._coreBrowserService=P,this._coreService=A,this._decorationService=L,this._themeService=x,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(E,I,S){this._selectionStart=E,this._selectionEnd=I,this._columnSelectMode=S}createRow(E,I,S,P,A,L,x,D,M,B,z){const Y=[],U=this._characterJoinerService.getJoinedCharacters(I),N=this._themeService.colors;let V,j=E.getNoBgTrimmedLength();S&&j0&&Le===U[0][0]){Qe=!0;const ot=U.shift();ne=new f.JoinedCellData(this._workCell,E.translateToString(!0,ot[0],ot[1]),ot[1]-ot[0]),De=ot[1]-1,xe=ne.getWidth()}const ue=this._isCellInSelection(Le,I),he=S&&Le===L,Ae=de&&Le>=B&&Le<=z;let ce=!1;this._decorationService.forEachDecorationAtCell(Le,I,void 0,ot=>{ce=!0});let Je=ne.getChars()||v.WHITESPACE_CELL_CHAR;if(Je===" "&&(ne.isUnderline()||ne.isOverline())&&(Je=" "),ae=xe*D-M.get(Je,ne.isBold(),ne.isItalic()),V){if(G&&(ue&&J||!ue&&!J&&ne.bg===se)&&(ue&&J&&N.selectionForeground||ne.fg===oe)&&ne.extended.ext===Fe&&Ae===K&&ae===Z&&!he&&!Qe&&!ce){te+=Je,G++;continue}G&&(V.textContent=te),V=this._document.createElement("span"),G=0,te=""}else V=this._document.createElement("span");if(se=ne.bg,oe=ne.fg,Fe=ne.extended.ext,K=Ae,Z=ae,J=ue,Qe&&L>=Le&&L<=De&&(L=Le),!this._coreService.isCursorHidden&&he){if(Ie.push("xterm-cursor"),this._coreBrowserService.isFocused)x&&Ie.push("xterm-cursor-blink"),Ie.push(P==="bar"?"xterm-cursor-bar":P==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(A)switch(A){case"outline":Ie.push("xterm-cursor-outline");break;case"block":Ie.push("xterm-cursor-block");break;case"bar":Ie.push("xterm-cursor-bar");break;case"underline":Ie.push("xterm-cursor-underline")}}if(ne.isBold()&&Ie.push("xterm-bold"),ne.isItalic()&&Ie.push("xterm-italic"),ne.isDim()&&Ie.push("xterm-dim"),te=ne.isInvisible()?v.WHITESPACE_CELL_CHAR:ne.getChars()||v.WHITESPACE_CELL_CHAR,ne.isUnderline()&&(Ie.push(`xterm-underline-${ne.extended.underlineStyle}`),te===" "&&(te=" "),!ne.isUnderlineColorDefault()))if(ne.isUnderlineColorRGB())V.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(ne.getUnderlineColor()).join(",")})`;else{let ot=ne.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ne.isBold()&&ot<8&&(ot+=8),V.style.textDecorationColor=N.ansi[ot].css}ne.isOverline()&&(Ie.push("xterm-overline"),te===" "&&(te=" ")),ne.isStrikethrough()&&Ie.push("xterm-strikethrough"),Ae&&(V.style.textDecoration="underline");let ye=ne.getFgColor(),_e=ne.getFgColorMode(),Ce=ne.getBgColor(),Be=ne.getBgColorMode();const Se=!!ne.isInverse();if(Se){const ot=ye;ye=Ce,Ce=ot;const Rt=_e;_e=Be,Be=Rt}let R,we,ht,Ne=!1;switch(this._decorationService.forEachDecorationAtCell(Le,I,void 0,ot=>{ot.options.layer!=="top"&&Ne||(ot.backgroundColorRGB&&(Be=50331648,Ce=ot.backgroundColorRGB.rgba>>8&16777215,R=ot.backgroundColorRGB),ot.foregroundColorRGB&&(_e=50331648,ye=ot.foregroundColorRGB.rgba>>8&16777215,we=ot.foregroundColorRGB),Ne=ot.options.layer==="top")}),!Ne&&ue&&(R=this._coreBrowserService.isFocused?N.selectionBackgroundOpaque:N.selectionInactiveBackgroundOpaque,Ce=R.rgba>>8&16777215,Be=50331648,Ne=!0,N.selectionForeground&&(_e=50331648,ye=N.selectionForeground.rgba>>8&16777215,we=N.selectionForeground)),Ne&&Ie.push("xterm-decoration-top"),Be){case 16777216:case 33554432:ht=N.ansi[Ce],Ie.push(`xterm-bg-${Ce}`);break;case 50331648:ht=g.rgba.toColor(Ce>>16,Ce>>8&255,255&Ce),this._addStyle(V,`background-color:#${k((Ce>>>0).toString(16),"0",6)}`);break;default:Se?(ht=N.foreground,Ie.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):ht=N.background}switch(R||ne.isDim()&&(R=g.color.multiplyOpacity(ht,.5)),_e){case 16777216:case 33554432:ne.isBold()&&ye<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ye+=8),this._applyMinimumContrast(V,ht,N.ansi[ye],ne,R,void 0)||Ie.push(`xterm-fg-${ye}`);break;case 50331648:const ot=g.rgba.toColor(ye>>16&255,ye>>8&255,255&ye);this._applyMinimumContrast(V,ht,ot,ne,R,we)||this._addStyle(V,`color:#${k(ye.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(V,ht,N.foreground,ne,R,void 0)||Se&&Ie.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}Ie.length&&(V.className=Ie.join(" "),Ie.length=0),he||Qe||ce?V.textContent=te:G++,ae!==this.defaultSpacing&&(V.style.letterSpacing=`${ae}px`),Y.push(V),Le=De}return V&&G&&(V.textContent=te),Y}_applyMinimumContrast(E,I,S,P,A,L){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,p.excludeFromContrastRatioDemands)(P.getCode()))return!1;const x=this._getContrastCache(P);let D;if(A||L||(D=x.getColor(I.rgba,S.rgba)),D===void 0){const M=this._optionsService.rawOptions.minimumContrastRatio/(P.isDim()?2:1);D=g.color.ensureContrastRatio(A||I,L||S,M),x.setColor((A||I).rgba,(L||S).rgba,D??null)}return!!D&&(this._addStyle(E,`color:${D.css}`),!0)}_getContrastCache(E){return E.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(E,I){E.setAttribute("style",`${E.getAttribute("style")||""}${I};`)}_isCellInSelection(E,I){const S=this._selectionStart,P=this._selectionEnd;return!(!S||!P)&&(this._columnSelectMode?S[0]<=P[0]?E>=S[0]&&I>=S[1]&&E=S[1]&&E>=P[0]&&I<=P[1]:I>S[1]&&I=S[0]&&E=S[0])}};function k(E,I,S){for(;E.length{Object.defineProperty(r,"__esModule",{value:!0}),r.WidthCache=void 0,r.WidthCache=class{constructor(o){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.createElement("div"),this._container.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const c=o.createElement("span"),h=o.createElement("span");h.style.fontWeight="bold";const u=o.createElement("span");u.style.fontStyle="italic";const v=o.createElement("span");v.style.fontWeight="bold",v.style.fontStyle="italic",this._measureElements=[c,h,u,v],this._container.appendChild(c),this._container.appendChild(h),this._container.appendChild(u),this._container.appendChild(v),o.body.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(o,c,h,u){o===this._font&&c===this._fontSize&&h===this._weight&&u===this._weightBold||(this._font=o,this._fontSize=c,this._weight=h,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${h}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${h}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(o,c,h){let u=0;if(!c&&!h&&o.length===1&&(u=o.charCodeAt(0))<256)return this._flat[u]!==-9999?this._flat[u]:this._flat[u]=this._measure(o,0);let v=o;c&&(v+="B"),h&&(v+="I");let m=this._holey.get(v);if(m===void 0){let b=0;c&&(b|=1),h&&(b|=2),m=this._measure(o,b),this._holey.set(v,m)}return m}_measure(o,c){const h=this._measureElements[c];return h.textContent=o.repeat(32),h.offsetWidth/32}}},2223:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const c=o(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(d,r)=>{function o(c){return 57508<=c&&c<=57558}Object.defineProperty(r,"__esModule",{value:!0}),r.createRenderDimensions=r.excludeFromContrastRatioDemands=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},r.isPowerlineGlyph=o,r.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},r.excludeFromContrastRatioDemands=function(c){return o(c)||function(h){return 9472<=h&&h<=9631}(c)},r.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(o){this._bufferService=o,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,c=this.selectionEnd;return!(!o||!c)&&(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(d,r,o){var c=this&&this.__decorate||function(l,f,p,y){var C,k=arguments.length,E=k<3?f:y===null?y=Object.getOwnPropertyDescriptor(f,p):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,f,p,y);else for(var I=l.length-1;I>=0;I--)(C=l[I])&&(E=(k<3?C(E):k>3?C(f,p,E):C(f,p))||E);return k>3&&E&&Object.defineProperty(f,p,E),E},h=this&&this.__param||function(l,f){return function(p,y){f(p,y,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const u=o(2585),v=o(8460),m=o(844);let b=r.CharSizeService=class extends m.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(l,f,p){super(),this._optionsService=p,this.width=0,this.height=0,this._onCharSizeChange=this.register(new v.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new g(l,f,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const l=this._measureStrategy.measure();l.width===this.width&&l.height===this.height||(this.width=l.width,this.height=l.height,this._onCharSizeChange.fire())}};r.CharSizeService=b=c([h(2,u.IOptionsService)],b);class g{constructor(f,p,y){this._document=f,this._parentElement=p,this._optionsService=y,this._result={width:0,height:0},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(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const f={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return f.width!==0&&f.height!==0&&(this._result.width=f.width/32,this._result.height=Math.ceil(f.height)),this._result}}},4269:function(d,r,o){var c=this&&this.__decorate||function(f,p,y,C){var k,E=arguments.length,I=E<3?p:C===null?C=Object.getOwnPropertyDescriptor(p,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(f,p,y,C);else for(var S=f.length-1;S>=0;S--)(k=f[S])&&(I=(E<3?k(I):E>3?k(p,y,I):k(p,y))||I);return E>3&&I&&Object.defineProperty(p,y,I),I},h=this&&this.__param||function(f,p){return function(y,C){p(y,C,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const u=o(3734),v=o(643),m=o(511),b=o(2585);class g extends u.AttributeData{constructor(p,y,C){super(),this.content=0,this.combinedData="",this.fg=p.fg,this.bg=p.bg,this.combinedData=y,this._width=C}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(p){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=g;let l=r.CharacterJoinerService=class P_{constructor(p){this._bufferService=p,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(p){const y={id:this._nextCharacterJoinerId++,handler:p};return this._characterJoiners.push(y),y.id}deregister(p){for(let y=0;y1){const x=this._getJoinedRanges(k,S,I,y,E);for(let D=0;D1){const L=this._getJoinedRanges(k,S,I,y,E);for(let x=0;x{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0,r.CoreBrowserService=class{constructor(o,c){this._textarea=o,this.window=c,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}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}}},8934:function(d,r,o){var c=this&&this.__decorate||function(b,g,l,f){var p,y=arguments.length,C=y<3?g:f===null?f=Object.getOwnPropertyDescriptor(g,l):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(b,g,l,f);else for(var k=b.length-1;k>=0;k--)(p=b[k])&&(C=(y<3?p(C):y>3?p(g,l,C):p(g,l))||C);return y>3&&C&&Object.defineProperty(g,l,C),C},h=this&&this.__param||function(b,g){return function(l,f){g(l,f,b)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const u=o(4725),v=o(9806);let m=r.MouseService=class{constructor(b,g){this._renderService=b,this._charSizeService=g}getCoords(b,g,l,f,p){return(0,v.getCoords)(window,b,g,l,f,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,p)}getMouseReportCoords(b,g){const l=(0,v.getCoordsRelativeToElement)(window,b,g);if(this._charSizeService.hasValidSize)return l[0]=Math.min(Math.max(l[0],0),this._renderService.dimensions.css.canvas.width-1),l[1]=Math.min(Math.max(l[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(l[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(l[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(l[0]),y:Math.floor(l[1])}}};r.MouseService=m=c([h(0,u.IRenderService),h(1,u.ICharSizeService)],m)},3230:function(d,r,o){var c=this&&this.__decorate||function(C,k,E,I){var S,P=arguments.length,A=P<3?k:I===null?I=Object.getOwnPropertyDescriptor(k,E):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(C,k,E,I);else for(var L=C.length-1;L>=0;L--)(S=C[L])&&(A=(P<3?S(A):P>3?S(k,E,A):S(k,E))||A);return P>3&&A&&Object.defineProperty(k,E,A),A},h=this&&this.__param||function(C,k){return function(E,I){k(E,I,C)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const u=o(3656),v=o(6193),m=o(5596),b=o(4725),g=o(8460),l=o(844),f=o(7226),p=o(2585);let y=r.RenderService=class extends l.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(C,k,E,I,S,P,A,L){if(super(),this._rowCount=C,this._charSizeService=I,this._renderer=this.register(new l.MutableDisposable),this._pausedResizeTask=new f.DebouncedIdleTask,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 g.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new g.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new g.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new g.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new v.RenderDebouncer(A.window,(x,D)=>this._renderRows(x,D)),this.register(this._renderDebouncer),this._screenDprMonitor=new m.ScreenDprMonitor(A.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(P.onResize(()=>this._fullRefresh())),this.register(P.buffers.onBufferActivate(()=>{var x;return(x=this._renderer.value)===null||x===void 0?void 0:x.clear()})),this.register(E.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(S.onDecorationRegistered(()=>this._fullRefresh())),this.register(S.onDecorationRemoved(()=>this._fullRefresh())),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(P.cols,P.rows),this._fullRefresh()})),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(P.buffer.y,P.buffer.y,!0))),this.register((0,u.addDisposableDomListener)(A.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(L.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in A.window){const x=new A.window.IntersectionObserver(D=>this._handleIntersectionChange(D[D.length-1]),{threshold:0});x.observe(k),this.register({dispose:()=>x.disconnect()})}}_handleIntersectionChange(C){this._isPaused=C.isIntersecting===void 0?C.intersectionRatio===0:!C.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(C,k,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(C,k,this._rowCount))}_renderRows(C,k){this._renderer.value&&(C=Math.min(C,this._rowCount-1),k=Math.min(k,this._rowCount-1),this._renderer.value.renderRows(C,k),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:C,end:k}),this._onRender.fire({start:C,end:k}),this._isNextRenderRedrawOnly=!0)}resize(C,k){this._rowCount=k,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(C){this._renderer.value=C,this._renderer.value.onRequestRedraw(k=>this.refreshRows(k.start,k.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(C){return this._renderDebouncer.addRefreshCallback(C)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var C,k;this._renderer.value&&((k=(C=this._renderer.value).clearTextureAtlas)===null||k===void 0||k.call(C),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(C,k){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(C,k)):this._renderer.value.handleResize(C,k),this._fullRefresh())}handleCharSizeChanged(){var C;(C=this._renderer.value)===null||C===void 0||C.handleCharSizeChanged()}handleBlur(){var C;(C=this._renderer.value)===null||C===void 0||C.handleBlur()}handleFocus(){var C;(C=this._renderer.value)===null||C===void 0||C.handleFocus()}handleSelectionChanged(C,k,E){var I;this._selectionState.start=C,this._selectionState.end=k,this._selectionState.columnSelectMode=E,(I=this._renderer.value)===null||I===void 0||I.handleSelectionChanged(C,k,E)}handleCursorMove(){var C;(C=this._renderer.value)===null||C===void 0||C.handleCursorMove()}clear(){var C;(C=this._renderer.value)===null||C===void 0||C.clear()}};r.RenderService=y=c([h(2,p.IOptionsService),h(3,b.ICharSizeService),h(4,p.IDecorationService),h(5,p.IBufferService),h(6,b.ICoreBrowserService),h(7,b.IThemeService)],y)},9312:function(d,r,o){var c=this&&this.__decorate||function(S,P,A,L){var x,D=arguments.length,M=D<3?P:L===null?L=Object.getOwnPropertyDescriptor(P,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(S,P,A,L);else for(var B=S.length-1;B>=0;B--)(x=S[B])&&(M=(D<3?x(M):D>3?x(P,A,M):x(P,A))||M);return D>3&&M&&Object.defineProperty(P,A,M),M},h=this&&this.__param||function(S,P){return function(A,L){P(A,L,S)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const u=o(9806),v=o(9504),m=o(456),b=o(4725),g=o(8460),l=o(844),f=o(6114),p=o(4841),y=o(511),C=o(2585),k=" ",E=new RegExp(k,"g");let I=r.SelectionService=class extends l.Disposable{constructor(S,P,A,L,x,D,M,B,z){super(),this._element=S,this._screenElement=P,this._linkifier=A,this._bufferService=L,this._coreService=x,this._mouseService=D,this._optionsService=M,this._renderService=B,this._coreBrowserService=z,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new g.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new g.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new g.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new g.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Y=>this._handleMouseMove(Y),this._mouseUpListener=Y=>this._handleMouseUp(Y),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(Y=>this._handleTrim(Y)),this.register(this._bufferService.buffers.onBufferActivate(Y=>this._handleBufferActivate(Y))),this.enable(),this._model=new m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,l.toDisposable)(()=>{this._removeMouseDownListeners()}))}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(){const S=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!(!S||!P||S[0]===P[0]&&S[1]===P[1])}get selectionText(){const S=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;if(!S||!P)return"";const A=this._bufferService.buffer,L=[];if(this._activeSelectionMode===3){if(S[0]===P[0])return"";const x=S[0]x.replace(E," ")).join(f.isWindows?`\r +`:` +`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(S){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),f.isLinux&&S&&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(S){const P=this._getMouseBufferCoords(S),A=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!!(A&&L&&P)&&this._areCoordsInSelection(P,A,L)}isCellInSelection(S,P){const A=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!A||!L)&&this._areCoordsInSelection([S,P],A,L)}_areCoordsInSelection(S,P,A){return S[1]>P[1]&&S[1]=P[0]&&S[0]=P[0]}_selectWordAtCursor(S,P){var A,L;const x=(L=(A=this._linkifier.currentLink)===null||A===void 0?void 0:A.link)===null||L===void 0?void 0:L.range;if(x)return this._model.selectionStart=[x.start.x-1,x.start.y-1],this._model.selectionStartLength=(0,p.getRangeLength)(x,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const D=this._getMouseBufferCoords(S);return!!D&&(this._selectWordAt(D,P),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(S,P){this._model.clearSelection(),S=Math.max(S,0),P=Math.min(P,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,S],this._model.selectionEnd=[this._bufferService.cols,P],this.refresh(),this._onSelectionChange.fire()}_handleTrim(S){this._model.handleTrim(S)&&this.refresh()}_getMouseBufferCoords(S){const P=this._mouseService.getCoords(S,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(P)return P[0]--,P[1]--,P[1]+=this._bufferService.buffer.ydisp,P}_getMouseEventScrollAmount(S){let P=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,S,this._screenElement)[1];const A=this._renderService.dimensions.css.canvas.height;return P>=0&&P<=A?0:(P>A&&(P-=A),P=Math.min(Math.max(P,-50),50),P/=50,P/Math.abs(P)+Math.round(14*P))}shouldForceSelection(S){return f.isMac?S.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:S.shiftKey}handleMouseDown(S){if(this._mouseDownTimeStamp=S.timeStamp,(S.button!==2||!this.hasSelection)&&S.button===0){if(!this._enabled){if(!this.shouldForceSelection(S))return;S.stopPropagation()}S.preventDefault(),this._dragScrollAmount=0,this._enabled&&S.shiftKey?this._handleIncrementalClick(S):S.detail===1?this._handleSingleClick(S):S.detail===2?this._handleDoubleClick(S):S.detail===3&&this._handleTripleClick(S),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(),50)}_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(S){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(S))}_handleSingleClick(S){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(S)?3:0,this._model.selectionStart=this._getMouseBufferCoords(S),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const P=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);P&&P.length!==this._model.selectionStart[0]&&P.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(S){this._selectWordAtCursor(S,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(S){const P=this._getMouseBufferCoords(S);P&&(this._activeSelectionMode=2,this._selectLineAt(P[1]))}shouldColumnSelect(S){return S.altKey&&!(f.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(S){if(S.stopImmediatePropagation(),!this._model.selectionStart)return;const P=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(S),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const A=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(S.ydisp+this._bufferService.rows,S.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=S.ydisp),this.refresh()}}_handleMouseUp(S){const P=S.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&P<500&&S.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const A=this._mouseService.getCoords(S,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(A&&A[0]!==void 0&&A[1]!==void 0){const L=(0,v.moveToCellSequence)(A[0]-1,A[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(L,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const S=this._model.finalSelectionStart,P=this._model.finalSelectionEnd,A=!(!S||!P||S[0]===P[0]&&S[1]===P[1]);A?S&&P&&(this._oldSelectionStart&&this._oldSelectionEnd&&S[0]===this._oldSelectionStart[0]&&S[1]===this._oldSelectionStart[1]&&P[0]===this._oldSelectionEnd[0]&&P[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(S,P,A)):this._oldHasSelection&&this._fireOnSelectionChange(S,P,A)}_fireOnSelectionChange(S,P,A){this._oldSelectionStart=S,this._oldSelectionEnd=P,this._oldHasSelection=A,this._onSelectionChange.fire()}_handleBufferActivate(S){this.clearSelection(),this._trimListener.dispose(),this._trimListener=S.activeBuffer.lines.onTrim(P=>this._handleTrim(P))}_convertViewportColToCharacterIndex(S,P){let A=P;for(let L=0;P>=L;L++){const x=S.loadCell(L,this._workCell).getChars().length;this._workCell.getWidth()===0?A--:x>1&&P!==L&&(A+=x-1)}return A}setSelection(S,P,A){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[S,P],this._model.selectionStartLength=A,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(S){this._isClickInSelection(S)||(this._selectWordAtCursor(S,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(S,P,A=!0,L=!0){if(S[0]>=this._bufferService.cols)return;const x=this._bufferService.buffer,D=x.lines.get(S[1]);if(!D)return;const M=x.translateBufferLineToString(S[1],!1);let B=this._convertViewportColToCharacterIndex(D,S[0]),z=B;const Y=S[0]-B;let U=0,N=0,V=0,j=0;if(M.charAt(B)===" "){for(;B>0&&M.charAt(B-1)===" ";)B--;for(;z1&&(j+=Fe-1,z+=Fe-1);se>0&&B>0&&!this._isCharWordSeparator(D.loadCell(se-1,this._workCell));){D.loadCell(se-1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===0?(U++,se--):K>1&&(V+=K-1,B-=K-1),B--,se--}for(;oe1&&(j+=K-1,z+=K-1),z++,oe++}}z++;let G=B+Y-U+V,te=Math.min(this._bufferService.cols,z-B+U+N-V-j);if(P||M.slice(B,z).trim()!==""){if(A&&G===0&&D.getCodePoint(0)!==32){const se=x.lines.get(S[1]-1);if(se&&D.isWrapped&&se.getCodePoint(this._bufferService.cols-1)!==32){const oe=this._getWordAt([this._bufferService.cols-1,S[1]-1],!1,!0,!1);if(oe){const Fe=this._bufferService.cols-oe.start;G-=Fe,te+=Fe}}}if(L&&G+te===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const se=x.lines.get(S[1]+1);if(se!=null&&se.isWrapped&&se.getCodePoint(0)!==32){const oe=this._getWordAt([0,S[1]+1],!1,!1,!0);oe&&(te+=oe.length)}}return{start:G,length:te}}}_selectWordAt(S,P){const A=this._getWordAt(S,P);if(A){for(;A.start<0;)A.start+=this._bufferService.cols,S[1]--;this._model.selectionStart=[A.start,S[1]],this._model.selectionStartLength=A.length}}_selectToWordAt(S){const P=this._getWordAt(S,!0);if(P){let A=S[1];for(;P.start<0;)P.start+=this._bufferService.cols,A--;if(!this._model.areSelectionValuesReversed())for(;P.start+P.length>this._bufferService.cols;)P.length-=this._bufferService.cols,A++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?P.start:P.start+P.length,A]}}_isCharWordSeparator(S){return S.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(S.getChars())>=0}_selectLineAt(S){const P=this._bufferService.buffer.getWrappedRangeForLine(S),A={start:{x:0,y:P.first},end:{x:this._bufferService.cols-1,y:P.last}};this._model.selectionStart=[0,P.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,p.getRangeLength)(A,this._bufferService.cols)}};r.SelectionService=I=c([h(3,C.IBufferService),h(4,C.ICoreService),h(5,b.IMouseService),h(6,C.IOptionsService),h(7,b.IRenderService),h(8,b.ICoreBrowserService)],I)},4725:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;const c=o(8343);r.ICharSizeService=(0,c.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),r.IMouseService=(0,c.createDecorator)("MouseService"),r.IRenderService=(0,c.createDecorator)("RenderService"),r.ISelectionService=(0,c.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,c.createDecorator)("ThemeService")},6731:function(d,r,o){var c=this&&this.__decorate||function(I,S,P,A){var L,x=arguments.length,D=x<3?S:A===null?A=Object.getOwnPropertyDescriptor(S,P):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(I,S,P,A);else for(var M=I.length-1;M>=0;M--)(L=I[M])&&(D=(x<3?L(D):x>3?L(S,P,D):L(S,P))||D);return x>3&&D&&Object.defineProperty(S,P,D),D},h=this&&this.__param||function(I,S){return function(P,A){S(P,A,I)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const u=o(7239),v=o(8055),m=o(8460),b=o(844),g=o(2585),l=v.css.toColor("#ffffff"),f=v.css.toColor("#000000"),p=v.css.toColor("#ffffff"),y=v.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const I=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],S=[0,95,135,175,215,255];for(let P=0;P<216;P++){const A=S[P/36%6|0],L=S[P/6%6|0],x=S[P%6];I.push({css:v.channels.toCss(A,L,x),rgba:v.channels.toRgba(A,L,x)})}for(let P=0;P<24;P++){const A=8+10*P;I.push({css:v.channels.toCss(A,A,A),rgba:v.channels.toRgba(A,A,A)})}return I})());let k=r.ThemeService=class extends b.Disposable{get colors(){return this._colors}constructor(I){super(),this._optionsService=I,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:l,background:f,cursor:p,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:v.color.blend(f,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:v.color.blend(f,C),ansi:r.DEFAULT_ANSI_COLORS.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)))}_setTheme(I={}){const S=this._colors;if(S.foreground=E(I.foreground,l),S.background=E(I.background,f),S.cursor=E(I.cursor,p),S.cursorAccent=E(I.cursorAccent,y),S.selectionBackgroundTransparent=E(I.selectionBackground,C),S.selectionBackgroundOpaque=v.color.blend(S.background,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundTransparent=E(I.selectionInactiveBackground,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundOpaque=v.color.blend(S.background,S.selectionInactiveBackgroundTransparent),S.selectionForeground=I.selectionForeground?E(I.selectionForeground,v.NULL_COLOR):void 0,S.selectionForeground===v.NULL_COLOR&&(S.selectionForeground=void 0),v.color.isOpaque(S.selectionBackgroundTransparent)&&(S.selectionBackgroundTransparent=v.color.opacity(S.selectionBackgroundTransparent,.3)),v.color.isOpaque(S.selectionInactiveBackgroundTransparent)&&(S.selectionInactiveBackgroundTransparent=v.color.opacity(S.selectionInactiveBackgroundTransparent,.3)),S.ansi=r.DEFAULT_ANSI_COLORS.slice(),S.ansi[0]=E(I.black,r.DEFAULT_ANSI_COLORS[0]),S.ansi[1]=E(I.red,r.DEFAULT_ANSI_COLORS[1]),S.ansi[2]=E(I.green,r.DEFAULT_ANSI_COLORS[2]),S.ansi[3]=E(I.yellow,r.DEFAULT_ANSI_COLORS[3]),S.ansi[4]=E(I.blue,r.DEFAULT_ANSI_COLORS[4]),S.ansi[5]=E(I.magenta,r.DEFAULT_ANSI_COLORS[5]),S.ansi[6]=E(I.cyan,r.DEFAULT_ANSI_COLORS[6]),S.ansi[7]=E(I.white,r.DEFAULT_ANSI_COLORS[7]),S.ansi[8]=E(I.brightBlack,r.DEFAULT_ANSI_COLORS[8]),S.ansi[9]=E(I.brightRed,r.DEFAULT_ANSI_COLORS[9]),S.ansi[10]=E(I.brightGreen,r.DEFAULT_ANSI_COLORS[10]),S.ansi[11]=E(I.brightYellow,r.DEFAULT_ANSI_COLORS[11]),S.ansi[12]=E(I.brightBlue,r.DEFAULT_ANSI_COLORS[12]),S.ansi[13]=E(I.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),S.ansi[14]=E(I.brightCyan,r.DEFAULT_ANSI_COLORS[14]),S.ansi[15]=E(I.brightWhite,r.DEFAULT_ANSI_COLORS[15]),I.extendedAnsi){const P=Math.min(S.ansi.length-16,I.extendedAnsi.length);for(let A=0;A{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const c=o(8460),h=o(844);class u extends h.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(m){if(this._maxLength===m)return;const b=new Array(m);for(let g=0;gthis._length)for(let b=this._length;b=m;l--)this._array[this._getCyclicIndex(l+g.length)]=this._array[this._getCyclicIndex(l)];for(let l=0;lthis._maxLength){const l=this._length+g.length-this._maxLength;this._startIndex+=l,this._length=this._maxLength,this.onTrimEmitter.fire(l)}else this._length+=g.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,b,g){if(!(b<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+g<0)throw new Error("Cannot shift elements in list beyond index 0");if(g>0){for(let f=b-1;f>=0;f--)this.set(m+f+g,this.get(m+f));const l=m+b+g-this._length;if(l>0)for(this._length+=l;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let l=0;l{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function o(c,h=5){if(typeof c!="object")return c;const u=Array.isArray(c)?[]:{};for(const v in c)u[v]=h<=1?c[v]:c[v]&&o(c[v],h-1);return u}},8055:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;const c=o(6114);let h=0,u=0,v=0,m=0;var b,g,l,f,p;function y(k){const E=k.toString(16);return E.length<2?"0"+E:E}function C(k,E){return k>>0}}(b||(r.channels=b={})),function(k){function E(I,S){return m=Math.round(255*S),[h,u,v]=p.toChannels(I.rgba),{css:b.toCss(h,u,v,m),rgba:b.toRgba(h,u,v,m)}}k.blend=function(I,S){if(m=(255&S.rgba)/255,m===1)return{css:S.css,rgba:S.rgba};const P=S.rgba>>24&255,A=S.rgba>>16&255,L=S.rgba>>8&255,x=I.rgba>>24&255,D=I.rgba>>16&255,M=I.rgba>>8&255;return h=x+Math.round((P-x)*m),u=D+Math.round((A-D)*m),v=M+Math.round((L-M)*m),{css:b.toCss(h,u,v),rgba:b.toRgba(h,u,v)}},k.isOpaque=function(I){return(255&I.rgba)==255},k.ensureContrastRatio=function(I,S,P){const A=p.ensureContrastRatio(I.rgba,S.rgba,P);if(A)return p.toColor(A>>24&255,A>>16&255,A>>8&255)},k.opaque=function(I){const S=(255|I.rgba)>>>0;return[h,u,v]=p.toChannels(S),{css:b.toCss(h,u,v),rgba:S}},k.opacity=E,k.multiplyOpacity=function(I,S){return m=255&I.rgba,E(I,m*S/255)},k.toColorRGB=function(I){return[I.rgba>>24&255,I.rgba>>16&255,I.rgba>>8&255]}}(g||(r.color=g={})),function(k){let E,I;if(!c.isNode){const S=document.createElement("canvas");S.width=1,S.height=1;const P=S.getContext("2d",{willReadFrequently:!0});P&&(E=P,E.globalCompositeOperation="copy",I=E.createLinearGradient(0,0,1,1))}k.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return h=parseInt(S.slice(1,2).repeat(2),16),u=parseInt(S.slice(2,3).repeat(2),16),v=parseInt(S.slice(3,4).repeat(2),16),p.toColor(h,u,v);case 5:return h=parseInt(S.slice(1,2).repeat(2),16),u=parseInt(S.slice(2,3).repeat(2),16),v=parseInt(S.slice(3,4).repeat(2),16),m=parseInt(S.slice(4,5).repeat(2),16),p.toColor(h,u,v,m);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const P=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(P)return h=parseInt(P[1]),u=parseInt(P[2]),v=parseInt(P[3]),m=Math.round(255*(P[5]===void 0?1:parseFloat(P[5]))),p.toColor(h,u,v,m);if(!E||!I)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=I,E.fillStyle=S,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[h,u,v,m]=E.getImageData(0,0,1,1).data,m!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(h,u,v,m),css:S}}}(l||(r.css=l={})),function(k){function E(I,S,P){const A=I/255,L=S/255,x=P/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))}k.relativeLuminance=function(I){return E(I>>16&255,I>>8&255,255&I)},k.relativeLuminance2=E}(f||(r.rgb=f={})),function(k){function E(S,P,A){const L=S>>24&255,x=S>>16&255,D=S>>8&255;let M=P>>24&255,B=P>>16&255,z=P>>8&255,Y=C(f.relativeLuminance2(M,B,z),f.relativeLuminance2(L,x,D));for(;Y0||B>0||z>0);)M-=Math.max(0,Math.ceil(.1*M)),B-=Math.max(0,Math.ceil(.1*B)),z-=Math.max(0,Math.ceil(.1*z)),Y=C(f.relativeLuminance2(M,B,z),f.relativeLuminance2(L,x,D));return(M<<24|B<<16|z<<8|255)>>>0}function I(S,P,A){const L=S>>24&255,x=S>>16&255,D=S>>8&255;let M=P>>24&255,B=P>>16&255,z=P>>8&255,Y=C(f.relativeLuminance2(M,B,z),f.relativeLuminance2(L,x,D));for(;Y>>0}k.ensureContrastRatio=function(S,P,A){const L=f.relativeLuminance(S>>8),x=f.relativeLuminance(P>>8);if(C(L,x)>8));if(zC(L,f.relativeLuminance(Y>>8))?B:Y}return B}const D=I(S,P,A),M=C(L,f.relativeLuminance(D>>8));if(MC(L,f.relativeLuminance(B>>8))?D:B}return D}},k.reduceLuminance=E,k.increaseLuminance=I,k.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]},k.toColor=function(S,P,A,L){return{css:b.toCss(S,P,A,L),rgba:b.toRgba(S,P,A,L)}}}(p||(r.rgba=p={})),r.toPaddedHex=y,r.contrastRatio=C},8969:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const c=o(844),h=o(2585),u=o(4348),v=o(7866),m=o(744),b=o(7302),g=o(6975),l=o(8460),f=o(1753),p=o(1480),y=o(7994),C=o(9282),k=o(5435),E=o(5981),I=o(2660);let S=!1;class P extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new l.EventEmitter),this._onScroll.event(L=>{var x;(x=this._onScrollApi)===null||x===void 0||x.fire(L.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(L){for(const x in L)this.optionsService.options[x]=L[x]}constructor(L){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new l.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new l.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new l.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new b.OptionsService(L)),this._instantiationService.setService(h.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(h.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(v.LogService)),this._instantiationService.setService(h.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(g.CoreService)),this._instantiationService.setService(h.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(f.CoreMouseService)),this._instantiationService.setService(h.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(p.UnicodeService)),this._instantiationService.setService(h.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(h.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(I.OscLinkService),this._instantiationService.setService(h.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new k.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,l.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,l.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,l.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,l.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(x=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(x=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new E.WriteBuffer((x,D)=>this._inputHandler.parse(x,D))),this.register((0,l.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(L,x){this._writeBuffer.write(L,x)}writeSync(L,x){this._logService.logLevel<=h.LogLevelEnum.WARN&&!S&&(this._logService.warn("writeSync is unreliable and will be removed soon."),S=!0),this._writeBuffer.writeSync(L,x)}resize(L,x){isNaN(L)||isNaN(x)||(L=Math.max(L,m.MINIMUM_COLS),x=Math.max(x,m.MINIMUM_ROWS),this._bufferService.resize(L,x))}scroll(L,x=!1){this._bufferService.scroll(L,x)}scrollLines(L,x,D){this._bufferService.scrollLines(L,x,D)}scrollPages(L){this.scrollLines(L*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(L){const x=L-this._bufferService.buffer.ydisp;x!==0&&this.scrollLines(x)}registerEscHandler(L,x){return this._inputHandler.registerEscHandler(L,x)}registerDcsHandler(L,x){return this._inputHandler.registerDcsHandler(L,x)}registerCsiHandler(L,x){return this._inputHandler.registerCsiHandler(L,x)}registerOscHandler(L,x){return this._inputHandler.registerOscHandler(L,x)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let L=!1;const x=this.optionsService.rawOptions.windowsPty;x&&x.buildNumber!==void 0&&x.buildNumber!==void 0?L=x.backend==="conpty"&&x.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(L=!0),L?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const L=[];L.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),L.push(this.registerCsiHandler({final:"H"},()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)(()=>{for(const x of L)x.dispose()})}}}r.CoreTerminal=P},8460:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;cc.fire(h))}},5435:function(d,r,o){var c=this&&this.__decorate||function(Y,U,N,V){var j,G=arguments.length,te=G<3?U:V===null?V=Object.getOwnPropertyDescriptor(U,N):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")te=Reflect.decorate(Y,U,N,V);else for(var se=Y.length-1;se>=0;se--)(j=Y[se])&&(te=(G<3?j(te):G>3?j(U,N,te):j(U,N))||te);return G>3&&te&&Object.defineProperty(U,N,te),te},h=this&&this.__param||function(Y,U){return function(N,V){U(N,V,Y)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const u=o(2584),v=o(7116),m=o(2015),b=o(844),g=o(482),l=o(8437),f=o(8460),p=o(643),y=o(511),C=o(3734),k=o(2585),E=o(6242),I=o(6351),S=o(5941),P={"(":0,")":1,"*":2,"+":3,"-":1,".":2},A=131072;function L(Y,U){if(Y>24)return U.setWinLines||!1;switch(Y){case 1:return!!U.restoreWin;case 2:return!!U.minimizeWin;case 3:return!!U.setWinPosition;case 4:return!!U.setWinSizePixels;case 5:return!!U.raiseWin;case 6:return!!U.lowerWin;case 7:return!!U.refreshWin;case 8:return!!U.setWinSizeChars;case 9:return!!U.maximizeWin;case 10:return!!U.fullscreenWin;case 11:return!!U.getWinState;case 13:return!!U.getWinPosition;case 14:return!!U.getWinSizePixels;case 15:return!!U.getScreenSizePixels;case 16:return!!U.getCellSizePixels;case 18:return!!U.getWinSizeChars;case 19:return!!U.getScreenSizeChars;case 20:return!!U.getIconTitle;case 21:return!!U.getWinTitle;case 22:return!!U.pushTitle;case 23:return!!U.popTitle;case 24:return!!U.setWinLines}return!1}var x;(function(Y){Y[Y.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Y[Y.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(x||(r.WindowsOptionsReportType=x={}));let D=0;class M extends b.Disposable{getAttrData(){return this._curAttrData}constructor(U,N,V,j,G,te,se,oe,Fe=new m.EscapeSequenceParser){super(),this._bufferService=U,this._charsetService=N,this._coreService=V,this._logService=j,this._optionsService=G,this._oscLinkService=te,this._coreMouseService=se,this._unicodeService=oe,this._parser=Fe,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new g.StringToUtf32,this._utf8Decoder=new g.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new f.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new f.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new f.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new f.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new f.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new f.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new f.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new f.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new f.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new f.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new f.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new f.EventEmitter),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 B(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(K=>this._activeBuffer=K.activeBuffer)),this._parser.setCsiHandlerFallback((K,Z)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(K),params:Z.toArray()})}),this._parser.setEscHandlerFallback(K=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(K)})}),this._parser.setExecuteHandlerFallback(K=>{this._logService.debug("Unknown EXECUTE code: ",{code:K})}),this._parser.setOscHandlerFallback((K,Z,J)=>{this._logService.debug("Unknown OSC code: ",{identifier:K,action:Z,data:J})}),this._parser.setDcsHandlerFallback((K,Z,J)=>{Z==="HOOK"&&(J=J.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(K),action:Z,payload:J})}),this._parser.setPrintHandler((K,Z,J)=>this.print(K,Z,J)),this._parser.registerCsiHandler({final:"@"},K=>this.insertChars(K)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},K=>this.scrollLeft(K)),this._parser.registerCsiHandler({final:"A"},K=>this.cursorUp(K)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},K=>this.scrollRight(K)),this._parser.registerCsiHandler({final:"B"},K=>this.cursorDown(K)),this._parser.registerCsiHandler({final:"C"},K=>this.cursorForward(K)),this._parser.registerCsiHandler({final:"D"},K=>this.cursorBackward(K)),this._parser.registerCsiHandler({final:"E"},K=>this.cursorNextLine(K)),this._parser.registerCsiHandler({final:"F"},K=>this.cursorPrecedingLine(K)),this._parser.registerCsiHandler({final:"G"},K=>this.cursorCharAbsolute(K)),this._parser.registerCsiHandler({final:"H"},K=>this.cursorPosition(K)),this._parser.registerCsiHandler({final:"I"},K=>this.cursorForwardTab(K)),this._parser.registerCsiHandler({final:"J"},K=>this.eraseInDisplay(K,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},K=>this.eraseInDisplay(K,!0)),this._parser.registerCsiHandler({final:"K"},K=>this.eraseInLine(K,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},K=>this.eraseInLine(K,!0)),this._parser.registerCsiHandler({final:"L"},K=>this.insertLines(K)),this._parser.registerCsiHandler({final:"M"},K=>this.deleteLines(K)),this._parser.registerCsiHandler({final:"P"},K=>this.deleteChars(K)),this._parser.registerCsiHandler({final:"S"},K=>this.scrollUp(K)),this._parser.registerCsiHandler({final:"T"},K=>this.scrollDown(K)),this._parser.registerCsiHandler({final:"X"},K=>this.eraseChars(K)),this._parser.registerCsiHandler({final:"Z"},K=>this.cursorBackwardTab(K)),this._parser.registerCsiHandler({final:"`"},K=>this.charPosAbsolute(K)),this._parser.registerCsiHandler({final:"a"},K=>this.hPositionRelative(K)),this._parser.registerCsiHandler({final:"b"},K=>this.repeatPrecedingCharacter(K)),this._parser.registerCsiHandler({final:"c"},K=>this.sendDeviceAttributesPrimary(K)),this._parser.registerCsiHandler({prefix:">",final:"c"},K=>this.sendDeviceAttributesSecondary(K)),this._parser.registerCsiHandler({final:"d"},K=>this.linePosAbsolute(K)),this._parser.registerCsiHandler({final:"e"},K=>this.vPositionRelative(K)),this._parser.registerCsiHandler({final:"f"},K=>this.hVPosition(K)),this._parser.registerCsiHandler({final:"g"},K=>this.tabClear(K)),this._parser.registerCsiHandler({final:"h"},K=>this.setMode(K)),this._parser.registerCsiHandler({prefix:"?",final:"h"},K=>this.setModePrivate(K)),this._parser.registerCsiHandler({final:"l"},K=>this.resetMode(K)),this._parser.registerCsiHandler({prefix:"?",final:"l"},K=>this.resetModePrivate(K)),this._parser.registerCsiHandler({final:"m"},K=>this.charAttributes(K)),this._parser.registerCsiHandler({final:"n"},K=>this.deviceStatus(K)),this._parser.registerCsiHandler({prefix:"?",final:"n"},K=>this.deviceStatusPrivate(K)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},K=>this.softReset(K)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},K=>this.setCursorStyle(K)),this._parser.registerCsiHandler({final:"r"},K=>this.setScrollRegion(K)),this._parser.registerCsiHandler({final:"s"},K=>this.saveCursor(K)),this._parser.registerCsiHandler({final:"t"},K=>this.windowOptions(K)),this._parser.registerCsiHandler({final:"u"},K=>this.restoreCursor(K)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},K=>this.insertColumns(K)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},K=>this.deleteColumns(K)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},K=>this.selectProtected(K)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},K=>this.requestMode(K,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},K=>this.requestMode(K,!1)),this._parser.setExecuteHandler(u.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(u.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(u.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(u.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(u.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(u.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(u.C1.IND,()=>this.index()),this._parser.setExecuteHandler(u.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(u.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new E.OscHandler(K=>(this.setTitle(K),this.setIconName(K),!0))),this._parser.registerOscHandler(1,new E.OscHandler(K=>this.setIconName(K))),this._parser.registerOscHandler(2,new E.OscHandler(K=>this.setTitle(K))),this._parser.registerOscHandler(4,new E.OscHandler(K=>this.setOrReportIndexedColor(K))),this._parser.registerOscHandler(8,new E.OscHandler(K=>this.setHyperlink(K))),this._parser.registerOscHandler(10,new E.OscHandler(K=>this.setOrReportFgColor(K))),this._parser.registerOscHandler(11,new E.OscHandler(K=>this.setOrReportBgColor(K))),this._parser.registerOscHandler(12,new E.OscHandler(K=>this.setOrReportCursorColor(K))),this._parser.registerOscHandler(104,new E.OscHandler(K=>this.restoreIndexedColor(K))),this._parser.registerOscHandler(110,new E.OscHandler(K=>this.restoreFgColor(K))),this._parser.registerOscHandler(111,new E.OscHandler(K=>this.restoreBgColor(K))),this._parser.registerOscHandler(112,new E.OscHandler(K=>this.restoreCursorColor(K))),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(const K in v.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:K},()=>this.selectCharset("("+K)),this._parser.registerEscHandler({intermediates:")",final:K},()=>this.selectCharset(")"+K)),this._parser.registerEscHandler({intermediates:"*",final:K},()=>this.selectCharset("*"+K)),this._parser.registerEscHandler({intermediates:"+",final:K},()=>this.selectCharset("+"+K)),this._parser.registerEscHandler({intermediates:"-",final:K},()=>this.selectCharset("-"+K)),this._parser.registerEscHandler({intermediates:".",final:K},()=>this.selectCharset("."+K)),this._parser.registerEscHandler({intermediates:"/",final:K},()=>this.selectCharset("/"+K));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(K=>(this._logService.error("Parsing error: ",K),K)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new I.DcsHandler((K,Z)=>this.requestStatusString(K,Z)))}_preserveStack(U,N,V,j){this._parseStack.paused=!0,this._parseStack.cursorStartX=U,this._parseStack.cursorStartY=N,this._parseStack.decodedLength=V,this._parseStack.position=j}_logSlowResolvingAsync(U){this._logService.logLevel<=k.LogLevelEnum.WARN&&Promise.race([U,new Promise((N,V)=>setTimeout(()=>V("#SLOW_TIMEOUT"),5e3))]).catch(N=>{if(N!=="#SLOW_TIMEOUT")throw N;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(U,N){let V,j=this._activeBuffer.x,G=this._activeBuffer.y,te=0;const se=this._parseStack.paused;if(se){if(V=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,N))return this._logSlowResolvingAsync(V),V;j=this._parseStack.cursorStartX,G=this._parseStack.cursorStartY,this._parseStack.paused=!1,U.length>A&&(te=this._parseStack.position+A)}if(this._logService.logLevel<=k.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof U=="string"?` "${U}"`:` "${Array.prototype.map.call(U,oe=>String.fromCharCode(oe)).join("")}"`),typeof U=="string"?U.split("").map(oe=>oe.charCodeAt(0)):U),this._parseBuffer.lengthA)for(let oe=te;oe0&&J.getWidth(this._activeBuffer.x-1)===2&&J.setCellFromCodePoint(this._activeBuffer.x-1,0,1,Z.fg,Z.bg,Z.extended);for(let ae=N;ae=oe){if(Fe){for(;this._activeBuffer.x=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=oe-1,G===2)continue}if(K&&(J.insertCells(this._activeBuffer.x,G,this._activeBuffer.getNullCell(Z),Z),J.getWidth(oe-1)===2&&J.setCellFromCodePoint(oe-1,p.NULL_CELL_CODE,p.NULL_CELL_WIDTH,Z.fg,Z.bg,Z.extended)),J.setCellFromCodePoint(this._activeBuffer.x++,j,G,Z.fg,Z.bg,Z.extended),G>0)for(;--G;)J.setCellFromCodePoint(this._activeBuffer.x++,0,0,Z.fg,Z.bg,Z.extended)}else J.getWidth(this._activeBuffer.x-1)?J.addCodepointToCell(this._activeBuffer.x-1,j):J.addCodepointToCell(this._activeBuffer.x-2,j)}V-N>0&&(J.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x0&&J.getWidth(this._activeBuffer.x)===0&&!J.hasContent(this._activeBuffer.x)&&J.setCellFromCodePoint(this._activeBuffer.x,0,1,Z.fg,Z.bg,Z.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(U,N){return U.final!=="t"||U.prefix||U.intermediates?this._parser.registerCsiHandler(U,N):this._parser.registerCsiHandler(U,V=>!L(V.params[0],this._optionsService.rawOptions.windowOptions)||N(V))}registerDcsHandler(U,N){return this._parser.registerDcsHandler(U,new I.DcsHandler(N))}registerEscHandler(U,N){return this._parser.registerEscHandler(U,N)}registerOscHandler(U,N){return this._parser.registerOscHandler(U,new E.OscHandler(N))}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 U;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&&(!((U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||U===void 0)&&U.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);N.hasWidth(this._activeBuffer.x)&&!N.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const U=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-U),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(U=this._bufferService.cols-1){this._activeBuffer.x=Math.min(U,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(U,N){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=U,this._activeBuffer.y=this._activeBuffer.scrollTop+N):(this._activeBuffer.x=U,this._activeBuffer.y=N),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(U,N){this._restrictCursor(),this._setCursor(this._activeBuffer.x+U,this._activeBuffer.y+N)}cursorUp(U){const N=this._activeBuffer.y-this._activeBuffer.scrollTop;return N>=0?this._moveCursor(0,-Math.min(N,U.params[0]||1)):this._moveCursor(0,-(U.params[0]||1)),!0}cursorDown(U){const N=this._activeBuffer.scrollBottom-this._activeBuffer.y;return N>=0?this._moveCursor(0,Math.min(N,U.params[0]||1)):this._moveCursor(0,U.params[0]||1),!0}cursorForward(U){return this._moveCursor(U.params[0]||1,0),!0}cursorBackward(U){return this._moveCursor(-(U.params[0]||1),0),!0}cursorNextLine(U){return this.cursorDown(U),this._activeBuffer.x=0,!0}cursorPrecedingLine(U){return this.cursorUp(U),this._activeBuffer.x=0,!0}cursorCharAbsolute(U){return this._setCursor((U.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(U){return this._setCursor(U.length>=2?(U.params[1]||1)-1:0,(U.params[0]||1)-1),!0}charPosAbsolute(U){return this._setCursor((U.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(U){return this._moveCursor(U.params[0]||1,0),!0}linePosAbsolute(U){return this._setCursor(this._activeBuffer.x,(U.params[0]||1)-1),!0}vPositionRelative(U){return this._moveCursor(0,U.params[0]||1),!0}hVPosition(U){return this.cursorPosition(U),!0}tabClear(U){const N=U.params[0];return N===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:N===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(U){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let N=U.params[0]||1;for(;N--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(U){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let N=U.params[0]||1;for(;N--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(U){const N=U.params[0];return N===1&&(this._curAttrData.bg|=536870912),N!==2&&N!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(U,N,V,j=!1,G=!1){const te=this._activeBuffer.lines.get(this._activeBuffer.ybase+U);te.replaceCells(N,V,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),G),j&&(te.isWrapped=!1)}_resetBufferLine(U,N=!1){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+U);V&&(V.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),N),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+U),V.isWrapped=!1)}eraseInDisplay(U,N=!1){let V;switch(this._restrictCursor(this._bufferService.cols),U.params[0]){case 0:for(V=this._activeBuffer.y,this._dirtyRowTracker.markDirty(V),this._eraseInBufferLine(V++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,N);V=this._bufferService.cols&&(this._activeBuffer.lines.get(V+1).isWrapped=!1);V--;)this._resetBufferLine(V,N);this._dirtyRowTracker.markDirty(0);break;case 2:for(V=this._bufferService.rows,this._dirtyRowTracker.markDirty(V-1);V--;)this._resetBufferLine(V,N);this._dirtyRowTracker.markDirty(0);break;case 3:const j=this._activeBuffer.lines.length-this._bufferService.rows;j>0&&(this._activeBuffer.lines.trimStart(j),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-j,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-j,0),this._onScroll.fire(0))}return!0}eraseInLine(U,N=!1){switch(this._restrictCursor(this._bufferService.cols),U.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,N);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,N);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,N)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(U){this._restrictCursor();let N=U.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.y0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(U){return U.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(U.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(U){return(this._optionsService.rawOptions.termName+"").indexOf(U)===0}setMode(U){for(let N=0;NLe?1:2,ae=U.params[0];return Ie=ae,de=N?ae===2?4:ae===4?J(te.modes.insertMode):ae===12?3:ae===20?J(Z.convertEol):0:ae===1?J(V.applicationCursorKeys):ae===3?Z.windowOptions.setWinLines?oe===80?2:oe===132?1:0:0:ae===6?J(V.origin):ae===7?J(V.wraparound):ae===8?3:ae===9?J(j==="X10"):ae===12?J(Z.cursorBlink):ae===25?J(!te.isCursorHidden):ae===45?J(V.reverseWraparound):ae===66?J(V.applicationKeypad):ae===67?4:ae===1e3?J(j==="VT200"):ae===1002?J(j==="DRAG"):ae===1003?J(j==="ANY"):ae===1004?J(V.sendFocus):ae===1005?4:ae===1006?J(G==="SGR"):ae===1015?4:ae===1016?J(G==="SGR_PIXELS"):ae===1048?1:ae===47||ae===1047||ae===1049?J(Fe===K):ae===2004?J(V.bracketedPasteMode):0,te.triggerDataEvent(`${u.C0.ESC}[${N?"":"?"}${Ie};${de}$y`),!0;var Ie,de}_updateAttrColor(U,N,V,j,G){return N===2?(U|=50331648,U&=-16777216,U|=C.AttributeData.fromColorRGB([V,j,G])):N===5&&(U&=-50331904,U|=33554432|255&V),U}_extractColor(U,N,V){const j=[0,0,-1,0,0,0];let G=0,te=0;do{if(j[te+G]=U.params[N+te],U.hasSubParams(N+te)){const se=U.getSubParams(N+te);let oe=0;do j[1]===5&&(G=1),j[te+oe+1+G]=se[oe];while(++oe=2||j[1]===2&&te+G>=5)break;j[1]&&(G=1)}while(++te+N5)&&(U=1),N.extended.underlineStyle=U,N.fg|=268435456,U===0&&(N.fg&=-268435457),N.updateExtended()}_processSGR0(U){U.fg=l.DEFAULT_ATTR_DATA.fg,U.bg=l.DEFAULT_ATTR_DATA.bg,U.extended=U.extended.clone(),U.extended.underlineStyle=0,U.extended.underlineColor&=-67108864,U.updateExtended()}charAttributes(U){if(U.length===1&&U.params[0]===0)return this._processSGR0(this._curAttrData),!0;const N=U.length;let V;const j=this._curAttrData;for(let G=0;G=30&&V<=37?(j.fg&=-50331904,j.fg|=16777216|V-30):V>=40&&V<=47?(j.bg&=-50331904,j.bg|=16777216|V-40):V>=90&&V<=97?(j.fg&=-50331904,j.fg|=16777224|V-90):V>=100&&V<=107?(j.bg&=-50331904,j.bg|=16777224|V-100):V===0?this._processSGR0(j):V===1?j.fg|=134217728:V===3?j.bg|=67108864:V===4?(j.fg|=268435456,this._processUnderline(U.hasSubParams(G)?U.getSubParams(G)[0]:1,j)):V===5?j.fg|=536870912:V===7?j.fg|=67108864:V===8?j.fg|=1073741824:V===9?j.fg|=2147483648:V===2?j.bg|=134217728:V===21?this._processUnderline(2,j):V===22?(j.fg&=-134217729,j.bg&=-134217729):V===23?j.bg&=-67108865:V===24?(j.fg&=-268435457,this._processUnderline(0,j)):V===25?j.fg&=-536870913:V===27?j.fg&=-67108865:V===28?j.fg&=-1073741825:V===29?j.fg&=2147483647:V===39?(j.fg&=-67108864,j.fg|=16777215&l.DEFAULT_ATTR_DATA.fg):V===49?(j.bg&=-67108864,j.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):V===38||V===48||V===58?G+=this._extractColor(U,G,j):V===53?j.bg|=1073741824:V===55?j.bg&=-1073741825:V===59?(j.extended=j.extended.clone(),j.extended.underlineColor=-1,j.updateExtended()):V===100?(j.fg&=-67108864,j.fg|=16777215&l.DEFAULT_ATTR_DATA.fg,j.bg&=-67108864,j.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",V);return!0}deviceStatus(U){switch(U.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const N=this._activeBuffer.y+1,V=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${N};${V}R`)}return!0}deviceStatusPrivate(U){if(U.params[0]===6){const N=this._activeBuffer.y+1,V=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${N};${V}R`)}return!0}softReset(U){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=l.DEFAULT_ATTR_DATA.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(U){const N=U.params[0]||1;switch(N){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const V=N%2==1;return this._optionsService.options.cursorBlink=V,!0}setScrollRegion(U){const N=U.params[0]||1;let V;return(U.length<2||(V=U.params[1])>this._bufferService.rows||V===0)&&(V=this._bufferService.rows),V>N&&(this._activeBuffer.scrollTop=N-1,this._activeBuffer.scrollBottom=V-1,this._setCursor(0,0)),!0}windowOptions(U){if(!L(U.params[0],this._optionsService.rawOptions.windowOptions))return!0;const N=U.length>1?U.params[1]:0;switch(U.params[0]){case 14:N!==2&&this._onRequestWindowsOptionsReport.fire(x.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(x.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:N!==0&&N!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),N!==0&&N!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:N!==0&&N!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),N!==0&&N!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(U){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(U){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(U){return this._windowTitle=U,this._onTitleChange.fire(U),!0}setIconName(U){return this._iconName=U,!0}setOrReportIndexedColor(U){const N=[],V=U.split(";");for(;V.length>1;){const j=V.shift(),G=V.shift();if(/^\d+$/.exec(j)){const te=parseInt(j);if(z(te))if(G==="?")N.push({type:0,index:te});else{const se=(0,S.parseColor)(G);se&&N.push({type:1,index:te,color:se})}}}return N.length&&this._onColor.fire(N),!0}setHyperlink(U){const N=U.split(";");return!(N.length<2)&&(N[1]?this._createHyperlink(N[0],N[1]):!N[0]&&this._finishHyperlink())}_createHyperlink(U,N){this._getCurrentLinkId()&&this._finishHyperlink();const V=U.split(":");let j;const G=V.findIndex(te=>te.startsWith("id="));return G!==-1&&(j=V[G].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:j,uri:N}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(U,N){const V=U.split(";");for(let j=0;j=this._specialColors.length);++j,++N)if(V[j]==="?")this._onColor.fire([{type:0,index:this._specialColors[N]}]);else{const G=(0,S.parseColor)(V[j]);G&&this._onColor.fire([{type:1,index:this._specialColors[N],color:G}])}return!0}setOrReportFgColor(U){return this._setOrReportSpecialColor(U,0)}setOrReportBgColor(U){return this._setOrReportSpecialColor(U,1)}setOrReportCursorColor(U){return this._setOrReportSpecialColor(U,2)}restoreIndexedColor(U){if(!U)return this._onColor.fire([{type:2}]),!0;const N=[],V=U.split(";");for(let j=0;j=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){const U=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,U,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=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(U){return this._charsetService.setgLevel(U),!0}screenAlignmentPattern(){const U=new y.CellData;U.content=4194373,U.fg=this._curAttrData.fg,U.bg=this._curAttrData.bg,this._setCursor(0,0);for(let N=0;N(this._coreService.triggerDataEvent(`${u.C0.ESC}${G}${u.C0.ESC}\\`),!0))(U==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:U==='"p'?'P1$r61;1"p':U==="r"?`P1$r${V.scrollTop+1};${V.scrollBottom+1}r`:U==="m"?"P1$r0m":U===" q"?`P1$r${{block:2,underline:4,bar:6}[j.cursorStyle]-(j.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(U,N){this._dirtyRowTracker.markRangeDirty(U,N)}}r.InputHandler=M;let B=class{constructor(Y){this._bufferService=Y,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Y){Ythis.end&&(this.end=Y)}markRangeDirty(Y,U){Y>U&&(D=Y,Y=U,U=D),Ythis.end&&(this.end=U)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function z(Y){return 0<=Y&&Y<256}B=c([h(0,k.IBufferService)],B)},844:(d,r)=>{function o(c){for(const h of c)h.dispose();c.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const h=this._disposables.indexOf(c);h!==-1&&this._disposables.splice(h,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var h;this._isDisposed||c===this._value||((h=this._value)===null||h===void 0||h.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)===null||c===void 0||c.dispose(),this._value=void 0}},r.toDisposable=function(c){return{dispose:c}},r.disposeArray=o,r.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},1505:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(h,u,v){this._data[h]||(this._data[h]={}),this._data[h][u]=v}get(h,u){return this._data[h]?this._data[h][u]:void 0}clear(){this._data={}}}r.TwoKeyMap=o,r.FourKeyMap=class{constructor(){this._data=new o}set(c,h,u,v,m){this._data.get(c,h)||this._data.set(c,h,new o),this._data.get(c,h).set(u,v,m)}get(c,h,u,v){var m;return(m=this._data.get(c,h))===null||m===void 0?void 0:m.get(u,v)}clear(){this._data.clear()}}},6114:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof navigator>"u";const o=r.isNode?"node":navigator.userAgent,c=r.isNode?"node":navigator.platform;r.isFirefox=o.includes("Firefox"),r.isLegacyEdge=o.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(o),r.getSafariVersion=function(){if(!r.isSafari)return 0;const h=o.match(/Version\/(\d+)/);return h===null||h.length<2?0:parseInt(h[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),r.isIpad=c==="iPad",r.isIphone=c==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),r.isLinux=c.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(o)},6106:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let o=0;r.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(o=this._search(this._getKey(c)),this._array.splice(o,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const h=this._getKey(c);if(h===void 0||(o=this._search(h),o===-1)||this._getKey(this._array[o])!==h)return!1;do if(this._array[o]===c)return this._array.splice(o,1),!0;while(++o=this._array.length)&&this._getKey(this._array[o])===c))do yield this._array[o];while(++o=this._array.length)&&this._getKey(this._array[o])===c))do h(this._array[o]);while(++o=h;){let v=h+u>>1;const m=this._getKey(this._array[v]);if(m>c)u=v-1;else{if(!(m0&&this._getKey(this._array[v-1])===c;)v--;return v}h=v+1}}return h}}},7226:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const c=o(6114);class h{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._if)return l-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(l-b))}ms`),void this._start();l=f}this.clear()}}class u extends h{_requestCallback(m){return setTimeout(()=>m(this._createDeadline(16)))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const b=Date.now()+m;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}r.PriorityTaskQueue=u,r.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends h{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:u,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},9282:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const c=o(643);r.updateWindowsModeWrappedState=function(h){const u=h.buffer.lines.get(h.buffer.ybase+h.buffer.y-1),v=u==null?void 0:u.get(h.cols-1),m=h.buffer.lines.get(h.buffer.ybase+h.buffer.y);m&&v&&(m.isWrapped=v[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&v[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new o;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}r.AttributeData=o;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}constructor(u=0,v=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=v}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=c},9092:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const c=o(6349),h=o(7226),u=o(3734),v=o(8437),m=o(4634),b=o(511),g=o(643),l=o(4863),f=o(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(p,y,C){this._hasScrollback=p,this._optionsService=y,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=f.DEFAULT_CHARSET,this.markers=[],this._nullCell=b.CellData.fromCharData([0,g.NULL_CELL_CHAR,g.NULL_CELL_WIDTH,g.NULL_CELL_CODE]),this._whitespaceCell=b.CellData.fromCharData([0,g.WHITESPACE_CELL_CHAR,g.WHITESPACE_CELL_WIDTH,g.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new h.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(p){return p?(this._nullCell.fg=p.fg,this._nullCell.bg=p.bg,this._nullCell.extended=p.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(p){return p?(this._whitespaceCell.fg=p.fg,this._whitespaceCell.bg=p.bg,this._whitespaceCell.extended=p.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(p,y){return new v.BufferLine(this._bufferService.cols,this.getNullCell(p),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const p=this.ybase+this.y-this.ydisp;return p>=0&&pr.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:y}fillViewportRows(p){if(this.lines.length===0){p===void 0&&(p=v.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(p))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(p,y){const C=this.getNullCell(v.DEFAULT_ATTR_DATA);let k=0;const E=this._getCorrectBufferLength(y);if(E>this.lines.maxLength&&(this.lines.maxLength=E),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+I+1?(this.ybase--,I++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(p,C)));else for(let S=this._rows;S>y;S--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(E0&&(this.lines.trimStart(S),this.ybase=Math.max(this.ybase-S,0),this.ydisp=Math.max(this.ydisp-S,0),this.savedY=Math.max(this.savedY-S,0)),this.lines.maxLength=E}this.x=Math.min(this.x,p-1),this.y=Math.min(this.y,y-1),I&&(this.y+=I),this.savedX=Math.min(this.savedX,p-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(p,y),this._cols>p))for(let I=0;I.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let p=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,p=!1);let y=0;for(;this._memoryCleanupPosition100)return!0;return p}get _isReflowEnabled(){const p=this._optionsService.rawOptions.windowsPty;return p&&p.buildNumber?this._hasScrollback&&p.backend==="conpty"&&p.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(p,y){this._cols!==p&&(p>this._cols?this._reflowLarger(p,y):this._reflowSmaller(p,y))}_reflowLarger(p,y){const C=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,p,this.ybase+this.y,this.getNullCell(v.DEFAULT_ATTR_DATA));if(C.length>0){const k=(0,m.reflowLargerCreateNewLayout)(this.lines,C);(0,m.reflowLargerApplyNewLayout)(this.lines,k.layout),this._reflowLargerAdjustViewport(p,y,k.countRemoved)}}_reflowLargerAdjustViewport(p,y,C){const k=this.getNullCell(v.DEFAULT_ATTR_DATA);let E=C;for(;E-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;I--){let S=this.lines.get(I);if(!S||!S.isWrapped&&S.getTrimmedLength()<=p)continue;const P=[S];for(;S.isWrapped&&I>0;)S=this.lines.get(--I),P.unshift(S);const A=this.ybase+this.y;if(A>=I&&A0&&(k.push({start:I+P.length+E,newLines:B}),E+=B.length),P.push(...B);let z=x.length-1,Y=x[z];Y===0&&(z--,Y=x[z]);let U=P.length-D-1,N=L;for(;U>=0;){const j=Math.min(N,Y);if(P[z]===void 0)break;if(P[z].copyCellsFrom(P[U],N-j,Y-j,j,!0),Y-=j,Y===0&&(z--,Y=x[z]),N-=j,N===0){U--;const G=Math.max(U,0);N=(0,m.getWrappedLineTrimmedLength)(P,G,this._cols)}}for(let j=0;j0;)this.ybase===0?this.y0){const I=[],S=[];for(let z=0;z=0;z--)if(x&&x.start>A+D){for(let Y=x.newLines.length-1;Y>=0;Y--)this.lines.set(z--,x.newLines[Y]);z++,I.push({index:A+1,amount:x.newLines.length}),D+=x.newLines.length,x=k[++L]}else this.lines.set(z,S[A--]);let M=0;for(let z=I.length-1;z>=0;z--)I[z].index+=M,this.lines.onInsertEmitter.fire(I[z]),M+=I[z].amount;const B=Math.max(0,P+E-this.lines.maxLength);B>0&&this.lines.onTrimEmitter.fire(B)}}translateBufferLineToString(p,y,C=0,k){const E=this.lines.get(p);return E?E.translateToString(y,C,k):""}getWrappedRangeForLine(p){let y=p,C=p;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;C+10;);return p>=this._cols?this._cols-1:p<0?0:p}nextStop(p){for(p==null&&(p=this.x);!this.tabs[++p]&&p=this._cols?this._cols-1:p<0?0:p}clearMarkers(p){this._isClearing=!0;for(let y=0;y{y.line-=C,y.line<0&&y.dispose()})),y.register(this.lines.onInsert(C=>{y.line>=C.index&&(y.line+=C.amount)})),y.register(this.lines.onDelete(C=>{y.line>=C.index&&y.lineC.index&&(y.line-=C.amount)})),y.register(y.onDispose(()=>this._removeMarker(y))),y}_removeMarker(p){this._isClearing||this.markers.splice(this.markers.indexOf(p),1)}}},8437:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const c=o(3734),h=o(511),u=o(643),v=o(482);r.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let m=0;class b{constructor(l,f,p=!1){this.isWrapped=p,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*l);const y=f||h.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let C=0;C>22,2097152&f?this._combined[l].charCodeAt(this._combined[l].length-1):p]}set(l,f){this._data[3*l+1]=f[u.CHAR_DATA_ATTR_INDEX],f[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[l]=f[1],this._data[3*l+0]=2097152|l|f[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*l+0]=f[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|f[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(l){return this._data[3*l+0]>>22}hasWidth(l){return 12582912&this._data[3*l+0]}getFg(l){return this._data[3*l+1]}getBg(l){return this._data[3*l+2]}hasContent(l){return 4194303&this._data[3*l+0]}getCodePoint(l){const f=this._data[3*l+0];return 2097152&f?this._combined[l].charCodeAt(this._combined[l].length-1):2097151&f}isCombined(l){return 2097152&this._data[3*l+0]}getString(l){const f=this._data[3*l+0];return 2097152&f?this._combined[l]:2097151&f?(0,v.stringFromCodePoint)(2097151&f):""}isProtected(l){return 536870912&this._data[3*l+2]}loadCell(l,f){return m=3*l,f.content=this._data[m+0],f.fg=this._data[m+1],f.bg=this._data[m+2],2097152&f.content&&(f.combinedData=this._combined[l]),268435456&f.bg&&(f.extended=this._extendedAttrs[l]),f}setCell(l,f){2097152&f.content&&(this._combined[l]=f.combinedData),268435456&f.bg&&(this._extendedAttrs[l]=f.extended),this._data[3*l+0]=f.content,this._data[3*l+1]=f.fg,this._data[3*l+2]=f.bg}setCellFromCodePoint(l,f,p,y,C,k){268435456&C&&(this._extendedAttrs[l]=k),this._data[3*l+0]=f|p<<22,this._data[3*l+1]=y,this._data[3*l+2]=C}addCodepointToCell(l,f){let p=this._data[3*l+0];2097152&p?this._combined[l]+=(0,v.stringFromCodePoint)(f):(2097151&p?(this._combined[l]=(0,v.stringFromCodePoint)(2097151&p)+(0,v.stringFromCodePoint)(f),p&=-2097152,p|=2097152):p=f|4194304,this._data[3*l+0]=p)}insertCells(l,f,p,y){if((l%=this.length)&&this.getWidth(l-1)===2&&this.setCellFromCodePoint(l-1,0,1,(y==null?void 0:y.fg)||0,(y==null?void 0:y.bg)||0,(y==null?void 0:y.extended)||new c.ExtendedAttrs),f=0;--k)this.setCell(l+f+k,this.loadCell(l+k,C));for(let k=0;kthis.length){if(this._data.buffer.byteLength>=4*p)this._data=new Uint32Array(this._data.buffer,0,p);else{const y=new Uint32Array(p);y.set(this._data),this._data=y}for(let y=this.length;y=l&&delete this._combined[E]}const C=Object.keys(this._extendedAttrs);for(let k=0;k=l&&delete this._extendedAttrs[E]}}return this.length=l,4*p*2=0;--l)if(4194303&this._data[3*l+0])return l+(this._data[3*l+0]>>22);return 0}getNoBgTrimmedLength(){for(let l=this.length-1;l>=0;--l)if(4194303&this._data[3*l+0]||50331648&this._data[3*l+2])return l+(this._data[3*l+0]>>22);return 0}copyCellsFrom(l,f,p,y,C){const k=l._data;if(C)for(let I=y-1;I>=0;I--){for(let S=0;S<3;S++)this._data[3*(p+I)+S]=k[3*(f+I)+S];268435456&k[3*(f+I)+2]&&(this._extendedAttrs[p+I]=l._extendedAttrs[f+I])}else for(let I=0;I=f&&(this._combined[S-f+p]=l._combined[S])}}translateToString(l=!1,f=0,p=this.length){l&&(p=Math.min(p,this.getTrimmedLength()));let y="";for(;f>22||1}return y}}r.BufferLine=b},4841:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(o,c){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return c*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(d,r)=>{function o(c,h,u){if(h===c.length-1)return c[h].getTrimmedLength();const v=!c[h].hasContent(u-1)&&c[h].getWidth(u-1)===1,m=c[h+1].getWidth(0)===2;return v&&m?u-1:u}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(c,h,u,v,m){const b=[];for(let g=0;g=g&&v0&&(S>y||p[S].getTrimmedLength()===0);S--)I++;I>0&&(b.push(g+p.length-I),b.push(I)),g+=p.length-1}return b},r.reflowLargerCreateNewLayout=function(c,h){const u=[];let v=0,m=h[v],b=0;for(let g=0;go(c,p,h)).reduce((f,p)=>f+p);let b=0,g=0,l=0;for(;lf&&(b-=f,g++);const p=c[g].getWidth(b-1)===2;p&&b--;const y=p?u-1:u;v.push(y),l+=y}return v},r.getWrappedLineTrimmedLength=o},5295:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const c=o(8460),h=o(844),u=o(9092);class v extends h.Disposable{constructor(b,g){super(),this._optionsService=b,this._bufferService=g,this._onBufferActivate=this.register(new c.EventEmitter),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 u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!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(b){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(b),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(b,g){this._normal.resize(b,g),this._alt.resize(b,g),this.setupTabStops(b)}setupTabStops(b){this._normal.setupTabStops(b),this._alt.setupTabStops(b)}}r.BufferSet=v},511:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const c=o(482),h=o(643),u=o(3734);class v extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const g=new v;return g.setFromCharData(b),g}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(b){this.fg=b[h.CHAR_DATA_ATTR_INDEX],this.bg=0;let g=!1;if(b[h.CHAR_DATA_CHAR_INDEX].length>2)g=!0;else if(b[h.CHAR_DATA_CHAR_INDEX].length===2){const l=b[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=l&&l<=56319){const f=b[h.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=f&&f<=57343?this.content=1024*(l-55296)+f-56320+65536|b[h.CHAR_DATA_WIDTH_INDEX]<<22:g=!0}else g=!0}else this.content=b[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[h.CHAR_DATA_WIDTH_INDEX]<<22;g&&(this.combinedData=b[h.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[h.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=v},643:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const c=o(8460),h=o(844);class u{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,h.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}r.Marker=u,u._nextId=1},7116:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.CHARSETS[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:"≥","{":"π","|":"≠","}":"£","~":"·"},r.CHARSETS.A={"#":"£"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},r.CHARSETS.C=r.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},r.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},r.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},r.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},r.CHARSETS.E=r.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},r.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},r.CHARSETS.H=r.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(d,r)=>{var o,c,h;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=` +`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""}(o||(r.C0=o={})),function(u){u.PAD="€",u.HOP="",u.BPH="‚",u.NBH="ƒ",u.IND="„",u.NEL="…",u.SSA="†",u.ESA="‡",u.HTS="ˆ",u.HTJ="‰",u.VTS="Š",u.PLD="‹",u.PLU="Œ",u.RI="",u.SS2="Ž",u.SS3="",u.DCS="",u.PU1="‘",u.PU2="’",u.STS="“",u.CCH="”",u.MW="•",u.SPA="–",u.EPA="—",u.SOS="˜",u.SGCI="™",u.SCI="š",u.CSI="›",u.ST="œ",u.OSC="",u.PM="ž",u.APC="Ÿ"}(c||(r.C1=c={})),function(u){u.ST=`${o.ESC}\\`}(h||(r.C1_ESCAPED=h={}))},7399:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const c=o(2584),h={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:["'",'"']};r.evaluateKeyboardEvent=function(u,v,m,b){const g={type:0,cancel:!1,key:void 0},l=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?g.key=v?c.C0.ESC+"OA":c.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?g.key=v?c.C0.ESC+"OD":c.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?g.key=v?c.C0.ESC+"OC":c.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(g.key=v?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:if(u.altKey){g.key=c.C0.ESC+c.C0.DEL;break}g.key=c.C0.DEL;break;case 9:if(u.shiftKey){g.key=c.C0.ESC+"[Z";break}g.key=c.C0.HT,g.cancel=!0;break;case 13:g.key=u.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,g.cancel=!0;break;case 27:g.key=c.C0.ESC,u.altKey&&(g.key=c.C0.ESC+c.C0.ESC),g.cancel=!0;break;case 37:if(u.metaKey)break;l?(g.key=c.C0.ESC+"[1;"+(l+1)+"D",g.key===c.C0.ESC+"[1;3D"&&(g.key=c.C0.ESC+(m?"b":"[1;5D"))):g.key=v?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(u.metaKey)break;l?(g.key=c.C0.ESC+"[1;"+(l+1)+"C",g.key===c.C0.ESC+"[1;3C"&&(g.key=c.C0.ESC+(m?"f":"[1;5C"))):g.key=v?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(u.metaKey)break;l?(g.key=c.C0.ESC+"[1;"+(l+1)+"A",m||g.key!==c.C0.ESC+"[1;3A"||(g.key=c.C0.ESC+"[1;5A")):g.key=v?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(u.metaKey)break;l?(g.key=c.C0.ESC+"[1;"+(l+1)+"B",m||g.key!==c.C0.ESC+"[1;3B"||(g.key=c.C0.ESC+"[1;5B")):g.key=v?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(g.key=c.C0.ESC+"[2~");break;case 46:g.key=l?c.C0.ESC+"[3;"+(l+1)+"~":c.C0.ESC+"[3~";break;case 36:g.key=l?c.C0.ESC+"[1;"+(l+1)+"H":v?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:g.key=l?c.C0.ESC+"[1;"+(l+1)+"F":v?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:u.shiftKey?g.type=2:u.ctrlKey?g.key=c.C0.ESC+"[5;"+(l+1)+"~":g.key=c.C0.ESC+"[5~";break;case 34:u.shiftKey?g.type=3:u.ctrlKey?g.key=c.C0.ESC+"[6;"+(l+1)+"~":g.key=c.C0.ESC+"[6~";break;case 112:g.key=l?c.C0.ESC+"[1;"+(l+1)+"P":c.C0.ESC+"OP";break;case 113:g.key=l?c.C0.ESC+"[1;"+(l+1)+"Q":c.C0.ESC+"OQ";break;case 114:g.key=l?c.C0.ESC+"[1;"+(l+1)+"R":c.C0.ESC+"OR";break;case 115:g.key=l?c.C0.ESC+"[1;"+(l+1)+"S":c.C0.ESC+"OS";break;case 116:g.key=l?c.C0.ESC+"[15;"+(l+1)+"~":c.C0.ESC+"[15~";break;case 117:g.key=l?c.C0.ESC+"[17;"+(l+1)+"~":c.C0.ESC+"[17~";break;case 118:g.key=l?c.C0.ESC+"[18;"+(l+1)+"~":c.C0.ESC+"[18~";break;case 119:g.key=l?c.C0.ESC+"[19;"+(l+1)+"~":c.C0.ESC+"[19~";break;case 120:g.key=l?c.C0.ESC+"[20;"+(l+1)+"~":c.C0.ESC+"[20~";break;case 121:g.key=l?c.C0.ESC+"[21;"+(l+1)+"~":c.C0.ESC+"[21~";break;case 122:g.key=l?c.C0.ESC+"[23;"+(l+1)+"~":c.C0.ESC+"[23~";break;case 123:g.key=l?c.C0.ESC+"[24;"+(l+1)+"~":c.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(m&&!b||!u.altKey||u.metaKey)!m||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?g.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(g.key=c.C0.US),u.key==="@"&&(g.key=c.C0.NUL)):u.keyCode===65&&(g.type=1);else{const f=h[u.keyCode],p=f==null?void 0:f[u.shiftKey?1:0];if(p)g.key=c.C0.ESC+p;else if(u.keyCode>=65&&u.keyCode<=90){const y=u.ctrlKey?u.keyCode-64:u.keyCode+32;let C=String.fromCharCode(y);u.shiftKey&&(C=C.toUpperCase()),g.key=c.C0.ESC+C}else if(u.keyCode===32)g.key=c.C0.ESC+(u.ctrlKey?c.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let y=u.code.slice(3,4);u.shiftKey||(y=y.toLowerCase()),g.key=c.C0.ESC+y,g.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?g.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?g.key=c.C0.NUL:u.keyCode>=51&&u.keyCode<=55?g.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?g.key=c.C0.DEL:u.keyCode===219?g.key=c.C0.ESC:u.keyCode===220?g.key=c.C0.FS:u.keyCode===221&&(g.key=c.C0.GS)}return g}},482:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},r.utf32ToString=function(o,c=0,h=o.length){let u="";for(let v=c;v65535?(m-=65536,u+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):u+=String.fromCharCode(m)}return u},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,c){const h=o.length;if(!h)return 0;let u=0,v=0;if(this._interim){const m=o.charCodeAt(v++);56320<=m&&m<=57343?c[u++]=1024*(this._interim-55296)+m-56320+65536:(c[u++]=this._interim,c[u++]=m),this._interim=0}for(let m=v;m=h)return this._interim=b,u;const g=o.charCodeAt(m);56320<=g&&g<=57343?c[u++]=1024*(b-55296)+g-56320+65536:(c[u++]=b,c[u++]=g)}else b!==65279&&(c[u++]=b)}return u}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,c){const h=o.length;if(!h)return 0;let u,v,m,b,g=0,l=0,f=0;if(this.interim[0]){let C=!1,k=this.interim[0];k&=(224&k)==192?31:(240&k)==224?15:7;let E,I=0;for(;(E=63&this.interim[++I])&&I<4;)k<<=6,k|=E;const S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,P=S-I;for(;f=h)return 0;if(E=o[f++],(192&E)!=128){f--,C=!0;break}this.interim[I++]=E,k<<=6,k|=63&E}C||(S===2?k<128?f--:c[g++]=k:S===3?k<2048||k>=55296&&k<=57343||k===65279||(c[g++]=k):k<65536||k>1114111||(c[g++]=k)),this.interim.fill(0)}const p=h-4;let y=f;for(;y=h)return this.interim[0]=u,g;if(v=o[y++],(192&v)!=128){y--;continue}if(l=(31&u)<<6|63&v,l<128){y--;continue}c[g++]=l}else if((240&u)==224){if(y>=h)return this.interim[0]=u,g;if(v=o[y++],(192&v)!=128){y--;continue}if(y>=h)return this.interim[0]=u,this.interim[1]=v,g;if(m=o[y++],(192&m)!=128){y--;continue}if(l=(15&u)<<12|(63&v)<<6|63&m,l<2048||l>=55296&&l<=57343||l===65279)continue;c[g++]=l}else if((248&u)==240){if(y>=h)return this.interim[0]=u,g;if(v=o[y++],(192&v)!=128){y--;continue}if(y>=h)return this.interim[0]=u,this.interim[1]=v,g;if(m=o[y++],(192&m)!=128){y--;continue}if(y>=h)return this.interim[0]=u,this.interim[1]=v,this.interim[2]=m,g;if(b=o[y++],(192&b)!=128){y--;continue}if(l=(7&u)<<18|(63&v)<<12|(63&m)<<6|63&b,l<65536||l>1114111)continue;c[g++]=l}}return g}}},225:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const o=[[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]],c=[[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]];let h;r.UnicodeV6=class{constructor(){if(this.version="6",!h){h=new Uint8Array(65536),h.fill(1),h[0]=0,h.fill(0,1,32),h.fill(0,127,160),h.fill(2,4352,4448),h[9001]=2,h[9002]=2,h.fill(2,11904,42192),h[12351]=1,h.fill(2,44032,55204),h.fill(2,63744,64256),h.fill(2,65040,65050),h.fill(2,65072,65136),h.fill(2,65280,65377),h.fill(2,65504,65511);for(let u=0;um[l][1])return!1;for(;l>=g;)if(b=g+l>>1,v>m[b][1])g=b+1;else{if(!(v=131072&&u<=196605||u>=196608&&u<=262141?2:1}}},5981:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const c=o(8460),h=o(844);class u extends h.Disposable{constructor(m){super(),this._action=m,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(m,b){if(b!==void 0&&this._syncCalls>b)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let g;for(this._isSyncWriting=!0;g=this._writeBuffer.shift();){this._action(g);const l=this._callbacks.shift();l&&l()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,b){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(b),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(b)}_innerWrite(m=0,b=!0){const g=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const l=this._writeBuffer[this._bufferOffset],f=this._action(l,b);if(f){const y=C=>Date.now()-g>=12?setTimeout(()=>this._innerWrite(0,C)):this._innerWrite(g,C);return void f.catch(C=>(queueMicrotask(()=>{throw C}),Promise.resolve(!1))).then(y)}const p=this._callbacks[this._bufferOffset];if(p&&p(),this._bufferOffset++,this._pendingData-=l.length,Date.now()-g>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(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()}}r.WriteBuffer=u},5941:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;const o=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,c=/^[\da-f]+$/;function h(u,v){const m=u.toString(16),b=m.length<2?"0"+m:m;switch(v){case 4:return m[0];case 8:return b;case 12:return(b+b).slice(0,3);default:return b+b}}r.parseColor=function(u){if(!u)return;let v=u.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const m=o.exec(v);if(m){const b=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/b*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/b*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/b*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),c.exec(v)&&[3,6,9,12].includes(v.length))){const m=v.length/3,b=[0,0,0];for(let g=0;g<3;++g){const l=parseInt(v.slice(m*g,m*g+m),16);b[g]=m===1?l<<4:m===2?l:m===3?l>>4:l>>8}return b}},r.toRgbString=function(u,v=16){const[m,b,g]=u;return`rgb:${h(m,v)}/${h(b,v)}/${h(g,v)}`}},5770:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const c=o(482),h=o(8742),u=o(5770),v=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(b,g){this._handlers[b]===void 0&&(this._handlers[b]=[]);const l=this._handlers[b];return l.push(g),{dispose:()=>{const f=l.indexOf(g);f!==-1&&l.splice(f,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}reset(){if(this._active.length)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(b,g){if(this.reset(),this._ident=b,this._active=this._handlers[b]||v,this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].hook(g);else this._handlerFb(this._ident,"HOOK",g)}put(b,g,l){if(this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].put(b,g,l);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(b,g,l))}unhook(b,g=!0){if(this._active.length){let l=!1,f=this._active.length-1,p=!1;if(this._stack.paused&&(f=this._stack.loopPosition-1,l=g,p=this._stack.fallThrough,this._stack.paused=!1),!p&&l===!1){for(;f>=0&&(l=this._active[f].unhook(b),l!==!0);f--)if(l instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!1,l;f--}for(;f>=0;f--)if(l=this._active[f].unhook(!1),l instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!0,l}else this._handlerFb(this._ident,"UNHOOK",b);this._active=v,this._ident=0}};const m=new h.Params;m.addParam(0),r.DcsHandler=class{constructor(b){this._handler=b,this._data="",this._params=m,this._hitLimit=!1}hook(b){this._params=b.length>1||b.params[0]?b.clone():m,this._data="",this._hitLimit=!1}put(b,g,l){this._hitLimit||(this._data+=(0,c.utf32ToString)(b,g,l),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(b){let g=!1;if(this._hitLimit)g=!1;else if(b&&(g=this._handler(this._data,this._params),g instanceof Promise))return g.then(l=>(this._params=m,this._data="",this._hitLimit=!1,l));return this._params=m,this._data="",this._hitLimit=!1,g}}},2015:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const c=o(844),h=o(8742),u=o(6242),v=o(6351);class m{constructor(f){this.table=new Uint8Array(f)}setDefault(f,p){this.table.fill(f<<4|p)}add(f,p,y,C){this.table[p<<8|f]=y<<4|C}addMany(f,p,y,C){for(let k=0;kS),p=(I,S)=>f.slice(I,S),y=p(32,127),C=p(0,24);C.push(25),C.push.apply(C,p(28,32));const k=p(0,14);let E;for(E in l.setDefault(1,0),l.addMany(y,0,2,0),k)l.addMany([24,26,153,154],E,3,0),l.addMany(p(128,144),E,3,0),l.addMany(p(144,152),E,3,0),l.add(156,E,0,0),l.add(27,E,11,1),l.add(157,E,4,8),l.addMany([152,158,159],E,0,7),l.add(155,E,11,3),l.add(144,E,11,9);return l.addMany(C,0,3,0),l.addMany(C,1,3,1),l.add(127,1,0,1),l.addMany(C,8,0,8),l.addMany(C,3,3,3),l.add(127,3,0,3),l.addMany(C,4,3,4),l.add(127,4,0,4),l.addMany(C,6,3,6),l.addMany(C,5,3,5),l.add(127,5,0,5),l.addMany(C,2,3,2),l.add(127,2,0,2),l.add(93,1,4,8),l.addMany(y,8,5,8),l.add(127,8,5,8),l.addMany([156,27,24,26,7],8,6,0),l.addMany(p(28,32),8,0,8),l.addMany([88,94,95],1,0,7),l.addMany(y,7,0,7),l.addMany(C,7,0,7),l.add(156,7,0,0),l.add(127,7,0,7),l.add(91,1,11,3),l.addMany(p(64,127),3,7,0),l.addMany(p(48,60),3,8,4),l.addMany([60,61,62,63],3,9,4),l.addMany(p(48,60),4,8,4),l.addMany(p(64,127),4,7,0),l.addMany([60,61,62,63],4,0,6),l.addMany(p(32,64),6,0,6),l.add(127,6,0,6),l.addMany(p(64,127),6,0,0),l.addMany(p(32,48),3,9,5),l.addMany(p(32,48),5,9,5),l.addMany(p(48,64),5,0,6),l.addMany(p(64,127),5,7,0),l.addMany(p(32,48),4,9,5),l.addMany(p(32,48),1,9,2),l.addMany(p(32,48),2,9,2),l.addMany(p(48,127),2,10,0),l.addMany(p(48,80),1,10,0),l.addMany(p(81,88),1,10,0),l.addMany([89,90,92],1,10,0),l.addMany(p(96,127),1,10,0),l.add(80,1,11,9),l.addMany(C,9,0,9),l.add(127,9,0,9),l.addMany(p(28,32),9,0,9),l.addMany(p(32,48),9,9,12),l.addMany(p(48,60),9,8,10),l.addMany([60,61,62,63],9,9,10),l.addMany(C,11,0,11),l.addMany(p(32,128),11,0,11),l.addMany(p(28,32),11,0,11),l.addMany(C,10,0,10),l.add(127,10,0,10),l.addMany(p(28,32),10,0,10),l.addMany(p(48,60),10,8,10),l.addMany([60,61,62,63],10,0,11),l.addMany(p(32,48),10,9,12),l.addMany(C,12,0,12),l.add(127,12,0,12),l.addMany(p(28,32),12,0,12),l.addMany(p(32,48),12,9,12),l.addMany(p(48,64),12,0,11),l.addMany(p(64,127),12,12,13),l.addMany(p(64,127),10,12,13),l.addMany(p(64,127),9,12,13),l.addMany(C,13,13,13),l.addMany(y,13,13,13),l.add(127,13,0,13),l.addMany([27,156,24,26],13,14,0),l.add(b,0,2,0),l.add(b,8,5,8),l.add(b,6,0,6),l.add(b,11,0,11),l.add(b,13,13,13),l}();class g extends c.Disposable{constructor(f=r.VT500_TRANSITION_TABLE){super(),this._transitions=f,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new h.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(p,y,C)=>{},this._executeHandlerFb=p=>{},this._csiHandlerFb=(p,y)=>{},this._escHandlerFb=p=>{},this._errorHandlerFb=p=>p,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(f,p=[64,126]){let y=0;if(f.prefix){if(f.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=f.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(f.intermediates){if(f.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let k=0;kE||E>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=E}}if(f.final.length!==1)throw new Error("final must be a single byte");const C=f.final.charCodeAt(0);if(p[0]>C||C>p[1])throw new Error(`final must be in range ${p[0]} .. ${p[1]}`);return y<<=8,y|=C,y}identToString(f){const p=[];for(;f;)p.push(String.fromCharCode(255&f)),f>>=8;return p.reverse().join("")}setPrintHandler(f){this._printHandler=f}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(f,p){const y=this._identifier(f,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const C=this._escHandlers[y];return C.push(p),{dispose:()=>{const k=C.indexOf(p);k!==-1&&C.splice(k,1)}}}clearEscHandler(f){this._escHandlers[this._identifier(f,[48,126])]&&delete this._escHandlers[this._identifier(f,[48,126])]}setEscHandlerFallback(f){this._escHandlerFb=f}setExecuteHandler(f,p){this._executeHandlers[f.charCodeAt(0)]=p}clearExecuteHandler(f){this._executeHandlers[f.charCodeAt(0)]&&delete this._executeHandlers[f.charCodeAt(0)]}setExecuteHandlerFallback(f){this._executeHandlerFb=f}registerCsiHandler(f,p){const y=this._identifier(f);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const C=this._csiHandlers[y];return C.push(p),{dispose:()=>{const k=C.indexOf(p);k!==-1&&C.splice(k,1)}}}clearCsiHandler(f){this._csiHandlers[this._identifier(f)]&&delete this._csiHandlers[this._identifier(f)]}setCsiHandlerFallback(f){this._csiHandlerFb=f}registerDcsHandler(f,p){return this._dcsParser.registerHandler(this._identifier(f),p)}clearDcsHandler(f){this._dcsParser.clearHandler(this._identifier(f))}setDcsHandlerFallback(f){this._dcsParser.setHandlerFallback(f)}registerOscHandler(f,p){return this._oscParser.registerHandler(f,p)}clearOscHandler(f){this._oscParser.clearHandler(f)}setOscHandlerFallback(f){this._oscParser.setHandlerFallback(f)}setErrorHandler(f){this._errorHandler=f}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.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(f,p,y,C,k){this._parseStack.state=f,this._parseStack.handlers=p,this._parseStack.handlerPos=y,this._parseStack.transition=C,this._parseStack.chunkPos=k}parse(f,p,y){let C,k=0,E=0,I=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,I=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const S=this._parseStack.handlers;let P=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&P>-1){for(;P>=0&&(C=S[P](this._params),C!==!0);P--)if(C instanceof Promise)return this._parseStack.handlerPos=P,C}this._parseStack.handlers=[];break;case 4:if(y===!1&&P>-1){for(;P>=0&&(C=S[P](),C!==!0);P--)if(C instanceof Promise)return this._parseStack.handlerPos=P,C}this._parseStack.handlers=[];break;case 6:if(k=f[this._parseStack.chunkPos],C=this._dcsParser.unhook(k!==24&&k!==26,y),C)return C;k===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(k=f[this._parseStack.chunkPos],C=this._oscParser.end(k!==24&&k!==26,y),C)return C;k===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,I=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let S=I;S>4){case 2:for(let D=S+1;;++D){if(D>=p||(k=f[D])<32||k>126&&k=p||(k=f[D])<32||k>126&&k=p||(k=f[D])<32||k>126&&k=p||(k=f[D])<32||k>126&&k=0&&(C=P[A](this._params),C!==!0);A--)if(C instanceof Promise)return this._preserveStack(3,P,A,E,S),C;A<0&&this._csiHandlerFb(this._collect<<8|k,this._params),this.precedingCodepoint=0;break;case 8:do switch(k){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(k-48)}while(++S47&&k<60);S--;break;case 9:this._collect<<=8,this._collect|=k;break;case 10:const L=this._escHandlers[this._collect<<8|k];let x=L?L.length-1:-1;for(;x>=0&&(C=L[x](),C!==!0);x--)if(C instanceof Promise)return this._preserveStack(4,L,x,E,S),C;x<0&&this._escHandlerFb(this._collect<<8|k),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|k,this._params);break;case 13:for(let D=S+1;;++D)if(D>=p||(k=f[D])===24||k===26||k===27||k>127&&k=p||(k=f[D])<32||k>127&&k{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const c=o(5770),h=o(482),u=[];r.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(v,m){this._handlers[v]===void 0&&(this._handlers[v]=[]);const b=this._handlers[v];return b.push(m),{dispose:()=>{const g=b.indexOf(m);g!==-1&&b.splice(g,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,m,b){if(this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].put(v,m,b);else this._handlerFb(this._id,"PUT",(0,h.utf32ToString)(v,m,b))}start(){this.reset(),this._state=1}put(v,m,b){if(this._state!==3){if(this._state===1)for(;m0&&this._put(v,m,b)}}end(v,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let b=!1,g=this._active.length-1,l=!1;if(this._stack.paused&&(g=this._stack.loopPosition-1,b=m,l=this._stack.fallThrough,this._stack.paused=!1),!l&&b===!1){for(;g>=0&&(b=this._active[g].end(v),b!==!0);g--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!1,b;g--}for(;g>=0;g--)if(b=this._active[g].end(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!0,b}else this._handlerFb(this._id,"END",v);this._active=u,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,m,b){this._hitLimit||(this._data+=(0,h.utf32ToString)(v,m,b),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let m=!1;if(this._hitLimit)m=!1;else if(v&&(m=this._handler(this._data),m instanceof Promise))return m.then(b=>(this._data="",this._hitLimit=!1,b));return this._data="",this._hitLimit=!1,m}}},8742:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const o=2147483647;class c{static fromArray(u){const v=new c;if(!u.length)return v;for(let m=Array.isArray(u[0])?1:0;m256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(v),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new c(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let v=0;v>8,b=255&this._subParamsIdx[v];b-m>0&&u.push(Array.prototype.slice.call(this._subParams,m,b))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>o?o:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>o?o:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const v=this._subParamsIdx[u]>>8,m=255&this._subParamsIdx[u];return m-v>0?this._subParams.subarray(v,m):null}getSubParamsAll(){const u={};for(let v=0;v>8,b=255&this._subParamsIdx[v];b-m>0&&(u[v]=this._subParams.slice(m,b))}return u}addDigit(u){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,b=m[v-1];m[v-1]=~b?Math.min(10*b+u,o):u}}r.Params=c},5741:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let o=this._addons.length-1;o>=0;o--)this._addons[o].instance.dispose()}loadAddon(o,c){const h={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(h),c.dispose=()=>this._wrappedAddonDispose(h),c.activate(o)}_wrappedAddonDispose(o){if(o.isDisposed)return;let c=-1;for(let h=0;h{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const c=o(3785),h=o(511);r.BufferApiView=class{constructor(u,v){this._buffer=u,this.type=v}init(u){return this._buffer=u,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(u){const v=this._buffer.lines.get(u);if(v)return new c.BufferLineApiView(v)}getNullCell(){return new h.CellData}}},3785:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;const c=o(511);r.BufferLineApiView=class{constructor(h){this._line=h}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(h,u){if(!(h<0||h>=this._line.length))return u?(this._line.loadCell(h,u),u):this._line.loadCell(h,new c.CellData)}translateToString(h,u,v){return this._line.translateToString(h,u,v)}}},8285:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const c=o(8771),h=o(8460),u=o(844);class v extends u.Disposable{constructor(b){super(),this._core=b,this._onBufferChange=this.register(new h.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(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)}}r.BufferNamespaceApi=v},7975:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(o){this._core=o}registerCsiHandler(o,c){return this._core.registerCsiHandler(o,h=>c(h.toArray()))}addCsiHandler(o,c){return this.registerCsiHandler(o,c)}registerDcsHandler(o,c){return this._core.registerDcsHandler(o,(h,u)=>c(h,u.toArray()))}addDcsHandler(o,c){return this.registerDcsHandler(o,c)}registerEscHandler(o,c){return this._core.registerEscHandler(o,c)}addEscHandler(o,c){return this.registerEscHandler(o,c)}registerOscHandler(o,c){return this._core.registerOscHandler(o,c)}addOscHandler(o,c){return this.registerOscHandler(o,c)}}},7090:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(o){this._core=o}register(o){this._core.unicodeService.register(o)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(o){this._core.unicodeService.activeVersion=o}}},744:function(d,r,o){var c=this&&this.__decorate||function(l,f,p,y){var C,k=arguments.length,E=k<3?f:y===null?y=Object.getOwnPropertyDescriptor(f,p):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,f,p,y);else for(var I=l.length-1;I>=0;I--)(C=l[I])&&(E=(k<3?C(E):k>3?C(f,p,E):C(f,p))||E);return k>3&&E&&Object.defineProperty(f,p,E),E},h=this&&this.__param||function(l,f){return function(p,y){f(p,y,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;const u=o(8460),v=o(844),m=o(5295),b=o(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let g=r.BufferService=class extends v.Disposable{get buffer(){return this.buffers.active}constructor(l){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(l.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(l.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(l,this))}resize(l,f){this.cols=l,this.rows=f,this.buffers.resize(l,f),this._onResize.fire({cols:l,rows:f})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(l,f=!1){const p=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===l.fg&&y.getBg(0)===l.bg||(y=p.getBlankLine(l,f),this._cachedBlankLine=y),y.isWrapped=f;const C=p.ybase+p.scrollTop,k=p.ybase+p.scrollBottom;if(p.scrollTop===0){const E=p.lines.isFull;k===p.lines.length-1?E?p.lines.recycle().copyFrom(y):p.lines.push(y.clone()):p.lines.splice(k+1,0,y.clone()),E?this.isUserScrolling&&(p.ydisp=Math.max(p.ydisp-1,0)):(p.ybase++,this.isUserScrolling||p.ydisp++)}else{const E=k-C+1;p.lines.shiftElements(C+1,E-1,-1),p.lines.set(k,y.clone())}this.isUserScrolling||(p.ydisp=p.ybase),this._onScroll.fire(p.ydisp)}scrollLines(l,f,p){const y=this.buffer;if(l<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else l+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const C=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+l,y.ybase),0),C!==y.ydisp&&(f||this._onScroll.fire(y.ydisp))}};r.BufferService=g=c([h(0,b.IOptionsService)],g)},7994:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(o){this.glevel=o,this.charset=this._charsets[o]}setgCharset(o,c){this._charsets[o]=c,this.glevel===o&&(this.charset=c)}}},1753:function(d,r,o){var c=this&&this.__decorate||function(y,C,k,E){var I,S=arguments.length,P=S<3?C:E===null?E=Object.getOwnPropertyDescriptor(C,k):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(y,C,k,E);else for(var A=y.length-1;A>=0;A--)(I=y[A])&&(P=(S<3?I(P):S>3?I(C,k,P):I(C,k))||P);return S>3&&P&&Object.defineProperty(C,k,P),P},h=this&&this.__param||function(y,C){return function(k,E){C(k,E,y)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const u=o(2585),v=o(8460),m=o(844),b={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function g(y,C){let k=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(k|=64,k|=y.action):(k|=3&y.button,4&y.button&&(k|=64),8&y.button&&(k|=128),y.action===32?k|=32:y.action!==0||C||(k|=3)),k}const l=String.fromCharCode,f={DEFAULT:y=>{const C=[g(y,!1)+32,y.col+32,y.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${l(C[0])}${l(C[1])}${l(C[2])}`},SGR:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${g(y,!0)};${y.col};${y.row}${C}`},SGR_PIXELS:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${g(y,!0)};${y.x};${y.y}${C}`}};let p=r.CoreMouseService=class extends m.Disposable{constructor(y,C){super(),this._bufferService=y,this._coreService=C,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const k of Object.keys(b))this.addProtocol(k,b[k]);for(const k of Object.keys(f))this.addEncoding(k,f[k]);this.reset()}addProtocol(y,C){this._protocols[y]=C}addEncoding(y,C){this._encodings[y]=C}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const C=this._encodings[this._activeEncoding](y);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,C,k){if(k){if(y.x!==C.x||y.y!==C.y)return!1}else if(y.col!==C.col||y.row!==C.row)return!1;return y.button===C.button&&y.action===C.action&&y.ctrl===C.ctrl&&y.alt===C.alt&&y.shift===C.shift}};r.CoreMouseService=p=c([h(0,u.IBufferService),h(1,u.ICoreService)],p)},6975:function(d,r,o){var c=this&&this.__decorate||function(p,y,C,k){var E,I=arguments.length,S=I<3?y:k===null?k=Object.getOwnPropertyDescriptor(y,C):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(p,y,C,k);else for(var P=p.length-1;P>=0;P--)(E=p[P])&&(S=(I<3?E(S):I>3?E(y,C,S):E(y,C))||S);return I>3&&S&&Object.defineProperty(y,C,S),S},h=this&&this.__param||function(p,y){return function(C,k){y(C,k,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const u=o(1439),v=o(8460),m=o(844),b=o(2585),g=Object.freeze({insertMode:!1}),l=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let f=r.CoreService=class extends m.Disposable{constructor(p,y,C){super(),this._bufferService=p,this._logService=y,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(g),this.decPrivateModes=(0,u.clone)(l)}reset(){this.modes=(0,u.clone)(g),this.decPrivateModes=(0,u.clone)(l)}triggerDataEvent(p,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${p}"`,()=>p.split("").map(k=>k.charCodeAt(0))),this._onData.fire(p)}triggerBinaryEvent(p){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${p}"`,()=>p.split("").map(y=>y.charCodeAt(0))),this._onBinary.fire(p))}};r.CoreService=f=c([h(0,b.IBufferService),h(1,b.ILogService),h(2,b.IOptionsService)],f)},9074:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const c=o(8055),h=o(8460),u=o(844),v=o(6106);let m=0,b=0;class g extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList(p=>p==null?void 0:p.marker.line),this._onDecorationRegistered=this.register(new h.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new h.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)(()=>this.reset()))}registerDecoration(p){if(p.marker.isDisposed)return;const y=new l(p);if(y){const C=y.marker.onDispose(()=>y.dispose());y.onDispose(()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),C.dispose())}),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const p of this._decorations.values())p.dispose();this._decorations.clear()}*getDecorationsAtCell(p,y,C){var k,E,I;let S=0,P=0;for(const A of this._decorations.getKeyIterator(y))S=(k=A.options.x)!==null&&k!==void 0?k:0,P=S+((E=A.options.width)!==null&&E!==void 0?E:1),p>=S&&p{var I,S,P;m=(I=E.options.x)!==null&&I!==void 0?I:0,b=m+((S=E.options.width)!==null&&S!==void 0?S:1),p>=m&&p{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const c=o(2585),h=o(8343);class u{constructor(...m){this._entries=new Map;for(const[b,g]of m)this.set(b,g)}set(m,b){const g=this._entries.get(m);return this._entries.set(m,b),g}forEach(m){for(const[b,g]of this._entries.entries())m(b,g)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}r.ServiceCollection=u,r.InstantiationService=class{constructor(){this._services=new u,this._services.set(c.IInstantiationService,this)}setService(v,m){this._services.set(v,m)}getService(v){return this._services.get(v)}createInstance(v,...m){const b=(0,h.getServiceDependencies)(v).sort((f,p)=>f.index-p.index),g=[];for(const f of b){const p=this._services.get(f.id);if(!p)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${f.id}.`);g.push(p)}const l=b.length>0?b[0].index:m.length;if(m.length!==l)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${l+1} conflicts with ${m.length} static arguments`);return new v(...m,...g)}}},7866:function(d,r,o){var c=this&&this.__decorate||function(l,f,p,y){var C,k=arguments.length,E=k<3?f:y===null?y=Object.getOwnPropertyDescriptor(f,p):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,f,p,y);else for(var I=l.length-1;I>=0;I--)(C=l[I])&&(E=(k<3?C(E):k>3?C(f,p,E):C(f,p))||E);return k>3&&E&&Object.defineProperty(f,p,E),E},h=this&&this.__param||function(l,f){return function(p,y){f(p,y,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const u=o(844),v=o(2585),m={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let b,g=r.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(l){super(),this._optionsService=l,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),b=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(l){for(let f=0;fJSON.stringify(E)).join(", ")})`);const k=y.apply(this,C);return b.trace(`GlyphRenderer#${y.name} return`,k),k}}},7302:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const c=o(8460),h=o(844),u=o(6114);r.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const v=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends h.Disposable{constructor(g){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const l=Object.assign({},r.DEFAULT_OPTIONS);for(const f in g)if(f in l)try{const p=g[f];l[f]=this._sanitizeAndValidateOption(f,p)}catch(p){console.error(p)}this.rawOptions=l,this.options=Object.assign({},l),this._setupOptions()}onSpecificOptionChange(g,l){return this.onOptionChange(f=>{f===g&&l(this.rawOptions[g])})}onMultipleOptionChange(g,l){return this.onOptionChange(f=>{g.indexOf(f)!==-1&&l()})}_setupOptions(){const g=f=>{if(!(f in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${f}"`);return this.rawOptions[f]},l=(f,p)=>{if(!(f in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${f}"`);p=this._sanitizeAndValidateOption(f,p),this.rawOptions[f]!==p&&(this.rawOptions[f]=p,this._onOptionChange.fire(f))};for(const f in this.rawOptions){const p={get:g.bind(this,f),set:l.bind(this,f)};Object.defineProperty(this.options,f,p)}}_sanitizeAndValidateOption(g,l){switch(g){case"cursorStyle":if(l||(l=r.DEFAULT_OPTIONS[g]),!function(f){return f==="block"||f==="underline"||f==="bar"}(l))throw new Error(`"${l}" is not a valid value for ${g}`);break;case"wordSeparator":l||(l=r.DEFAULT_OPTIONS[g]);break;case"fontWeight":case"fontWeightBold":if(typeof l=="number"&&1<=l&&l<=1e3)break;l=v.includes(l)?l:r.DEFAULT_OPTIONS[g];break;case"cursorWidth":l=Math.floor(l);case"lineHeight":case"tabStopWidth":if(l<1)throw new Error(`${g} cannot be less than 1, value: ${l}`);break;case"minimumContrastRatio":l=Math.max(1,Math.min(21,Math.round(10*l)/10));break;case"scrollback":if((l=Math.min(l,4294967295))<0)throw new Error(`${g} cannot be less than 0, value: ${l}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(l<=0)throw new Error(`${g} cannot be less than or equal to 0, value: ${l}`);break;case"rows":case"cols":if(!l&&l!==0)throw new Error(`${g} must be numeric, value: ${l}`);break;case"windowsPty":l=l??{}}return l}}r.OptionsService=m},2660:function(d,r,o){var c=this&&this.__decorate||function(m,b,g,l){var f,p=arguments.length,y=p<3?b:l===null?l=Object.getOwnPropertyDescriptor(b,g):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,b,g,l);else for(var C=m.length-1;C>=0;C--)(f=m[C])&&(y=(p<3?f(y):p>3?f(b,g,y):f(b,g))||y);return p>3&&y&&Object.defineProperty(b,g,y),y},h=this&&this.__param||function(m,b){return function(g,l){b(g,l,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const u=o(2585);let v=r.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const b=this._bufferService.buffer;if(m.id===void 0){const C=b.addMarker(b.ybase+b.y),k={data:m,id:this._nextId++,lines:[C]};return C.onDispose(()=>this._removeMarkerFromLink(k,C)),this._dataByLinkId.set(k.id,k),k.id}const g=m,l=this._getEntryIdKey(g),f=this._entriesWithId.get(l);if(f)return this.addLineToLink(f.id,b.ybase+b.y),f.id;const p=b.addMarker(b.ybase+b.y),y={id:this._nextId++,key:this._getEntryIdKey(g),data:g,lines:[p]};return p.onDispose(()=>this._removeMarkerFromLink(y,p)),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(m,b){const g=this._dataByLinkId.get(m);if(g&&g.lines.every(l=>l.line!==b)){const l=this._bufferService.buffer.addMarker(b);g.lines.push(l),l.onDispose(()=>this._removeMarkerFromLink(g,l))}}getLinkData(m){var b;return(b=this._dataByLinkId.get(m))===null||b===void 0?void 0:b.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,b){const g=m.lines.indexOf(b);g!==-1&&(m.lines.splice(g,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};r.OscLinkService=v=c([h(0,u.IBufferService)],v)},8343:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const o="di$target",c="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(h){return h[c]||[]},r.createDecorator=function(h){if(r.serviceRegistry.has(h))return r.serviceRegistry.get(h);const u=function(v,m,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(g,l,f){l[o]===l?l[c].push({id:g,index:f}):(l[c]=[{id:g,index:f}],l[o]=l)})(u,v,b)};return u.toString=()=>h,r.serviceRegistry.set(h,u),u}},2585:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const c=o(8343);var h;r.IBufferService=(0,c.createDecorator)("BufferService"),r.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),r.ICoreService=(0,c.createDecorator)("CoreService"),r.ICharsetService=(0,c.createDecorator)("CharsetService"),r.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(h||(r.LogLevelEnum=h={})),r.ILogService=(0,c.createDecorator)("LogService"),r.IOptionsService=(0,c.createDecorator)("OptionsService"),r.IOscLinkService=(0,c.createDecorator)("OscLinkService"),r.IUnicodeService=(0,c.createDecorator)("UnicodeService"),r.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const c=o(8460),h=o(225);r.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const u=new h.UnicodeV6;this.register(u),this._active=u.version,this._activeProvider=u}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(u){if(!this._providers[u])throw new Error(`unknown Unicode version "${u}"`);this._active=u,this._activeProvider=this._providers[u],this._onChange.fire(u)}register(u){this._providers[u.version]=u}wcwidth(u){return this._activeProvider.wcwidth(u)}getStringCellWidth(u){let v=0;const m=u.length;for(let b=0;b=m)return v+this.wcwidth(g);const l=u.charCodeAt(b);56320<=l&&l<=57343?g=1024*(g-55296)+l-56320+65536:v+=this.wcwidth(l)}v+=this.wcwidth(g)}return v}}}},i={};function s(d){var r=i[d];if(r!==void 0)return r.exports;var o=i[d]={exports:{}};return n[d].call(o.exports,o,o.exports,s),o.exports}var a={};return(()=>{var d=a;Object.defineProperty(d,"__esModule",{value:!0}),d.Terminal=void 0;const r=s(9042),o=s(3236),c=s(844),h=s(5741),u=s(8285),v=s(7975),m=s(7090),b=["cols","rows"];class g extends c.Disposable{constructor(f){super(),this._core=this.register(new o.Terminal(f)),this._addonManager=this.register(new h.AddonManager),this._publicOptions=Object.assign({},this._core.options);const p=C=>this._core.options[C],y=(C,k)=>{this._checkReadonlyOptions(C),this._core.options[C]=k};for(const C in this._core.options){const k={get:p.bind(this,C),set:y.bind(this,C)};Object.defineProperty(this._publicOptions,C,k)}}_checkReadonlyOptions(f){if(b.includes(f))throw new Error(`Option "${f}" 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 v.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.UnicodeApi(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 u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const f=this._core.coreService.decPrivateModes;let p="none";switch(this._core.coreMouseService.activeProtocol){case"X10":p="x10";break;case"VT200":p="vt200";break;case"DRAG":p="drag";break;case"ANY":p="any"}return{applicationCursorKeysMode:f.applicationCursorKeys,applicationKeypadMode:f.applicationKeypad,bracketedPasteMode:f.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:p,originMode:f.origin,reverseWraparoundMode:f.reverseWraparound,sendFocusMode:f.sendFocus,wraparoundMode:f.wraparound}}get options(){return this._publicOptions}set options(f){for(const p in f)this._publicOptions[p]=f[p]}blur(){this._core.blur()}focus(){this._core.focus()}resize(f,p){this._verifyIntegers(f,p),this._core.resize(f,p)}open(f){this._core.open(f)}attachCustomKeyEventHandler(f){this._core.attachCustomKeyEventHandler(f)}registerLinkProvider(f){return this._core.registerLinkProvider(f)}registerCharacterJoiner(f){return this._checkProposedApi(),this._core.registerCharacterJoiner(f)}deregisterCharacterJoiner(f){this._checkProposedApi(),this._core.deregisterCharacterJoiner(f)}registerMarker(f=0){return this._verifyIntegers(f),this._core.registerMarker(f)}registerDecoration(f){var p,y,C;return this._checkProposedApi(),this._verifyPositiveIntegers((p=f.x)!==null&&p!==void 0?p:0,(y=f.width)!==null&&y!==void 0?y:0,(C=f.height)!==null&&C!==void 0?C:0),this._core.registerDecoration(f)}hasSelection(){return this._core.hasSelection()}select(f,p,y){this._verifyIntegers(f,p,y),this._core.select(f,p,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(f,p){this._verifyIntegers(f,p),this._core.selectLines(f,p)}dispose(){super.dispose()}scrollLines(f){this._verifyIntegers(f),this._core.scrollLines(f)}scrollPages(f){this._verifyIntegers(f),this._core.scrollPages(f)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(f){this._verifyIntegers(f),this._core.scrollToLine(f)}clear(){this._core.clear()}write(f,p){this._core.write(f,p)}writeln(f,p){this._core.write(f),this._core.write(`\r +`,p)}paste(f){this._core.paste(f)}refresh(f,p){this._verifyIntegers(f,p),this._core.refresh(f,p)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(f){this._addonManager.loadAddon(this,f)}static get strings(){return r}_verifyIntegers(...f){for(const p of f)if(p===1/0||isNaN(p)||p%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...f){for(const p of f)if(p&&(p===1/0||isNaN(p)||p%1!=0||p<0))throw new Error("This API only accepts positive integers")}}d.Terminal=g})(),a})())})(E_);var L_=E_.exports,D_={exports:{}};(function(e,t){(function(n,i){e.exports=i()})(self,()=>(()=>{var n={};return(()=>{var i=n;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const a=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(a._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,a=s._renderService.dimensions;if(a.css.cell.width===0||a.css.cell.height===0)return;const d=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(r.getPropertyValue("height")),c=Math.max(0,parseInt(r.getPropertyValue("width"))),h=window.getComputedStyle(this._terminal.element),u=o-(parseInt(h.getPropertyValue("padding-top"))+parseInt(h.getPropertyValue("padding-bottom"))),v=c-(parseInt(h.getPropertyValue("padding-right"))+parseInt(h.getPropertyValue("padding-left")))-d;return{cols:Math.max(2,Math.floor(v/a.css.cell.width)),rows:Math.max(1,Math.floor(u/a.css.cell.height))}}}})(),n})())})(D_);var I_=D_.exports,M_={exports:{}};(function(e,t){(function(n,i){e.exports=i()})(self,()=>(()=>{var n={965:function(d,r,o){var c=this&&this.__decorate||function(I,S,P,A){var L,x=arguments.length,D=x<3?S:A===null?A=Object.getOwnPropertyDescriptor(S,P):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(I,S,P,A);else for(var M=I.length-1;M>=0;M--)(L=I[M])&&(D=(x<3?L(D):x>3?L(S,P,D):L(S,P))||D);return x>3&&D&&Object.defineProperty(S,P,D),D};Object.defineProperty(r,"__esModule",{value:!0}),r.GlyphRenderer=void 0;const h=o(374),u=o(509),v=o(855),m=o(859),b=o(776),g=o(381),l=11,f=l*Float32Array.BYTES_PER_ELEMENT;let p,y=0,C=0,k=0;class E extends m.Disposable{constructor(S,P,A){super(),this._terminal=S,this._gl=P,this._dimensions=A,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const L=this._gl;u.TextureAtlas.maxAtlasPages===void 0&&(u.TextureAtlas.maxAtlasPages=Math.min(32,(0,h.throwIfFalsy)(L.getParameter(L.MAX_TEXTURE_IMAGE_UNITS))),u.TextureAtlas.maxTextureSize=(0,h.throwIfFalsy)(L.getParameter(L.MAX_TEXTURE_SIZE))),this._program=(0,h.throwIfFalsy)((0,g.createProgram)(L,`#version 300 es +layout (location = 0) in vec2 a_unitquad; +layout (location = 1) in vec2 a_cellpos; +layout (location = 2) in vec2 a_offset; +layout (location = 3) in vec2 a_size; +layout (location = 4) in float a_texpage; +layout (location = 5) in vec2 a_texcoord; +layout (location = 6) in vec2 a_texsize; + +uniform mat4 u_projection; +uniform vec2 u_resolution; + +out vec2 v_texcoord; +flat out int v_texpage; + +void main() { + vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size); + gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0); + v_texpage = int(a_texpage); + v_texcoord = a_texcoord + a_unitquad * a_texsize; +}`,function(Y){let U="";for(let N=1;NL.deleteProgram(this._program))),this._projectionLocation=(0,h.throwIfFalsy)(L.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,h.throwIfFalsy)(L.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,h.throwIfFalsy)(L.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=L.createVertexArray(),L.bindVertexArray(this._vertexArrayObject);const x=new Float32Array([0,0,1,0,0,1,1,1]),D=L.createBuffer();this.register((0,m.toDisposable)(()=>L.deleteBuffer(D))),L.bindBuffer(L.ARRAY_BUFFER,D),L.bufferData(L.ARRAY_BUFFER,x,L.STATIC_DRAW),L.enableVertexAttribArray(0),L.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const M=new Uint8Array([0,1,2,3]),B=L.createBuffer();this.register((0,m.toDisposable)(()=>L.deleteBuffer(B))),L.bindBuffer(L.ELEMENT_ARRAY_BUFFER,B),L.bufferData(L.ELEMENT_ARRAY_BUFFER,M,L.STATIC_DRAW),this._attributesBuffer=(0,h.throwIfFalsy)(L.createBuffer()),this.register((0,m.toDisposable)(()=>L.deleteBuffer(this._attributesBuffer))),L.bindBuffer(L.ARRAY_BUFFER,this._attributesBuffer),L.enableVertexAttribArray(2),L.vertexAttribPointer(2,2,L.FLOAT,!1,f,0),L.vertexAttribDivisor(2,1),L.enableVertexAttribArray(3),L.vertexAttribPointer(3,2,L.FLOAT,!1,f,2*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(3,1),L.enableVertexAttribArray(4),L.vertexAttribPointer(4,1,L.FLOAT,!1,f,4*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(4,1),L.enableVertexAttribArray(5),L.vertexAttribPointer(5,2,L.FLOAT,!1,f,5*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(5,1),L.enableVertexAttribArray(6),L.vertexAttribPointer(6,2,L.FLOAT,!1,f,7*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(6,1),L.enableVertexAttribArray(1),L.vertexAttribPointer(1,2,L.FLOAT,!1,f,9*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(1,1),L.useProgram(this._program);const z=new Int32Array(u.TextureAtlas.maxAtlasPages);for(let Y=0;YL.deleteTexture(U.texture))),L.activeTexture(L.TEXTURE0+Y),L.bindTexture(L.TEXTURE_2D,U.texture),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_S,L.CLAMP_TO_EDGE),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_T,L.CLAMP_TO_EDGE),L.texImage2D(L.TEXTURE_2D,0,L.RGBA,1,1,0,L.RGBA,L.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[Y]=U}L.enable(L.BLEND),L.blendFunc(L.SRC_ALPHA,L.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(S,P,A,L,x,D,M,B){this._updateCell(this._vertices.attributes,S,P,A,L,x,D,M,B)}_updateCell(S,P,A,L,x,D,M,B,z){y=(A*this._terminal.cols+P)*l,L!==v.NULL_CELL_CODE&&L!==void 0?this._atlas&&(p=B&&B.length>1?this._atlas.getRasterizedGlyphCombinedChar(B,x,D,M,!1):this._atlas.getRasterizedGlyph(L,x,D,M,!1),C=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),x!==z&&p.offset.x>C?(k=p.offset.x-C,S[y]=-(p.offset.x-k)+this._dimensions.device.char.left,S[y+1]=-p.offset.y+this._dimensions.device.char.top,S[y+2]=(p.size.x-k)/this._dimensions.device.canvas.width,S[y+3]=p.size.y/this._dimensions.device.canvas.height,S[y+4]=p.texturePage,S[y+5]=p.texturePositionClipSpace.x+k/this._atlas.pages[p.texturePage].canvas.width,S[y+6]=p.texturePositionClipSpace.y,S[y+7]=p.sizeClipSpace.x-k/this._atlas.pages[p.texturePage].canvas.width,S[y+8]=p.sizeClipSpace.y):(S[y]=-p.offset.x+this._dimensions.device.char.left,S[y+1]=-p.offset.y+this._dimensions.device.char.top,S[y+2]=p.size.x/this._dimensions.device.canvas.width,S[y+3]=p.size.y/this._dimensions.device.canvas.height,S[y+4]=p.texturePage,S[y+5]=p.texturePositionClipSpace.x,S[y+6]=p.texturePositionClipSpace.y,S[y+7]=p.sizeClipSpace.x,S[y+8]=p.sizeClipSpace.y)):S.fill(0,y,y+l-1-2)}clear(){const S=this._terminal,P=S.cols*S.rows*l;this._vertices.count!==P?this._vertices.attributes=new Float32Array(P):this._vertices.attributes.fill(0);let A=0;for(;A{Object.defineProperty(r,"__esModule",{value:!0}),r.RectangleRenderer=void 0;const c=o(374),h=o(859),u=o(310),v=o(381),m=8*Float32Array.BYTES_PER_ELEMENT;class b{constructor(){this.attributes=new Float32Array(160),this.count=0}}let g=0,l=0,f=0,p=0,y=0,C=0,k=0;class E extends h.Disposable{constructor(S,P,A,L){super(),this._terminal=S,this._gl=P,this._dimensions=A,this._themeService=L,this._vertices=new b,this._verticesCursor=new b;const x=this._gl;this._program=(0,c.throwIfFalsy)((0,v.createProgram)(x,`#version 300 es +layout (location = 0) in vec2 a_position; +layout (location = 1) in vec2 a_size; +layout (location = 2) in vec4 a_color; +layout (location = 3) in vec2 a_unitquad; + +uniform mat4 u_projection; + +out vec4 v_color; + +void main() { + vec2 zeroToOne = a_position + (a_unitquad * a_size); + gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0); + v_color = a_color; +}`,`#version 300 es +precision lowp float; + +in vec4 v_color; + +out vec4 outColor; + +void main() { + outColor = v_color; +}`)),this.register((0,h.toDisposable)(()=>x.deleteProgram(this._program))),this._projectionLocation=(0,c.throwIfFalsy)(x.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=x.createVertexArray(),x.bindVertexArray(this._vertexArrayObject);const D=new Float32Array([0,0,1,0,0,1,1,1]),M=x.createBuffer();this.register((0,h.toDisposable)(()=>x.deleteBuffer(M))),x.bindBuffer(x.ARRAY_BUFFER,M),x.bufferData(x.ARRAY_BUFFER,D,x.STATIC_DRAW),x.enableVertexAttribArray(3),x.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const B=new Uint8Array([0,1,2,3]),z=x.createBuffer();this.register((0,h.toDisposable)(()=>x.deleteBuffer(z))),x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,z),x.bufferData(x.ELEMENT_ARRAY_BUFFER,B,x.STATIC_DRAW),this._attributesBuffer=(0,c.throwIfFalsy)(x.createBuffer()),this.register((0,h.toDisposable)(()=>x.deleteBuffer(this._attributesBuffer))),x.bindBuffer(x.ARRAY_BUFFER,this._attributesBuffer),x.enableVertexAttribArray(0),x.vertexAttribPointer(0,2,x.FLOAT,!1,m,0),x.vertexAttribDivisor(0,1),x.enableVertexAttribArray(1),x.vertexAttribPointer(1,2,x.FLOAT,!1,m,2*Float32Array.BYTES_PER_ELEMENT),x.vertexAttribDivisor(1,1),x.enableVertexAttribArray(2),x.vertexAttribPointer(2,4,x.FLOAT,!1,m,4*Float32Array.BYTES_PER_ELEMENT),x.vertexAttribDivisor(2,1),this._updateCachedColors(L.colors),this.register(this._themeService.onChangeColors(Y=>{this._updateCachedColors(Y),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(S){const P=this._gl;P.useProgram(this._program),P.bindVertexArray(this._vertexArrayObject),P.uniformMatrix4fv(this._projectionLocation,!1,v.PROJECTION_MATRIX),P.bindBuffer(P.ARRAY_BUFFER,this._attributesBuffer),P.bufferData(P.ARRAY_BUFFER,S.attributes,P.DYNAMIC_DRAW),P.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,P.UNSIGNED_BYTE,0,S.count)}handleResize(){this._updateViewportRectangle()}setDimensions(S){this._dimensions=S}_updateCachedColors(S){this._bgFloat=this._colorToFloat32Array(S.background),this._cursorFloat=this._colorToFloat32Array(S.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(S){const P=this._terminal,A=this._vertices;let L,x,D,M,B,z,Y,U,N,V,j,G=1;for(L=0;L>24&255)/255,y=(g>>16&255)/255,C=(g>>8&255)/255,k=1,this._addRectangle(S.attributes,P,l,f,(D-x)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,p,y,C,k)}_addRectangle(S,P,A,L,x,D,M,B,z,Y){S[P]=A/this._dimensions.device.canvas.width,S[P+1]=L/this._dimensions.device.canvas.height,S[P+2]=x/this._dimensions.device.canvas.width,S[P+3]=D/this._dimensions.device.canvas.height,S[P+4]=M,S[P+5]=B,S[P+6]=z,S[P+7]=Y}_addRectangleFloat(S,P,A,L,x,D,M){S[P]=A/this._dimensions.device.canvas.width,S[P+1]=L/this._dimensions.device.canvas.height,S[P+2]=x/this._dimensions.device.canvas.width,S[P+3]=D/this._dimensions.device.canvas.height,S[P+4]=M[0],S[P+5]=M[1],S[P+6]=M[2],S[P+7]=M[3]}_colorToFloat32Array(S){return new Float32Array([(S.rgba>>24&255)/255,(S.rgba>>16&255)/255,(S.rgba>>8&255)/255,(255&S.rgba)/255])}}r.RectangleRenderer=E},310:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderModel=r.COMBINED_CHAR_BIT_MASK=r.RENDER_MODEL_EXT_OFFSET=r.RENDER_MODEL_FG_OFFSET=r.RENDER_MODEL_BG_OFFSET=r.RENDER_MODEL_INDICIES_PER_CELL=void 0;const c=o(296);r.RENDER_MODEL_INDICIES_PER_CELL=4,r.RENDER_MODEL_BG_OFFSET=1,r.RENDER_MODEL_FG_OFFSET=2,r.RENDER_MODEL_EXT_OFFSET=3,r.COMBINED_CHAR_BIT_MASK=2147483648,r.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,c.createSelectionRenderModel)()}resize(h,u){const v=h*u*r.RENDER_MODEL_INDICIES_PER_CELL;v!==this.cells.length&&(this.cells=new Uint32Array(v),this.lineLengths=new Uint32Array(u))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:function(d,r,o){var c=this&&this.__decorate||function(D,M,B,z){var Y,U=arguments.length,N=U<3?M:z===null?z=Object.getOwnPropertyDescriptor(M,B):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(D,M,B,z);else for(var V=D.length-1;V>=0;V--)(Y=D[V])&&(N=(U<3?Y(N):U>3?Y(M,B,N):Y(M,B))||N);return U>3&&N&&Object.defineProperty(M,B,N),N};Object.defineProperty(r,"__esModule",{value:!0}),r.JoinedCellData=r.WebglRenderer=void 0;const h=o(820),u=o(274),v=o(627),m=o(457),b=o(56),g=o(374),l=o(345),f=o(859),p=o(147),y=o(782),C=o(855),k=o(776),E=o(965),I=o(742),S=o(310),P=o(733);class A extends f.Disposable{constructor(M,B,z,Y,U,N,V,j,G){super(),this._terminal=M,this._characterJoinerService=B,this._charSizeService=z,this._coreBrowserService=Y,this._coreService=U,this._decorationService=N,this._optionsService=V,this._themeService=j,this._cursorBlinkStateManager=new f.MutableDisposable,this._charAtlasDisposable=this.register(new f.MutableDisposable),this._model=new S.RenderModel,this._workCell=new y.CellData,this._rectangleRenderer=this.register(new f.MutableDisposable),this._glyphRenderer=this.register(new f.MutableDisposable),this._onChangeTextureAtlas=this.register(new l.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new l.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new l.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new l.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new l.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new u.CellColorResolver(this._terminal,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new P.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier2,this._coreBrowserService,V,this._themeService)],this.dimensions=(0,g.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(V.onOptionChange(()=>this._handleOptionsChanged())),this._canvas=document.createElement("canvas");const te={antialias:!1,depth:!1,preserveDrawingBuffer:G};if(this._gl=this._canvas.getContext("webgl2",te),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,h.addDisposableDomListener)(this._canvas,"webglcontextlost",se=>{console.log("webglcontextlost event received"),se.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(se)},3e3)})),this.register((0,h.addDisposableDomListener)(this._canvas,"webglcontextrestored",se=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,v.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this.register((0,b.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(se,oe)=>this._setCanvasDevicePixelDimensions(se,oe))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,f.toDisposable)(()=>{var se;for(const oe of this._renderLayers)oe.dispose();(se=this._canvas.parentElement)===null||se===void 0||se.removeChild(this._canvas),(0,v.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){var M;return(M=this._charAtlas)===null||M===void 0?void 0:M.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(M,B){var z,Y,U,N;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const V of this._renderLayers)V.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(z=this._rectangleRenderer.value)===null||z===void 0||z.setDimensions(this.dimensions),(Y=this._rectangleRenderer.value)===null||Y===void 0||Y.handleResize(),(U=this._glyphRenderer.value)===null||U===void 0||U.setDimensions(this.dimensions),(N=this._glyphRenderer.value)===null||N===void 0||N.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var M;for(const B of this._renderLayers)B.handleBlur(this._terminal);(M=this._cursorBlinkStateManager.value)===null||M===void 0||M.pause(),this._requestRedrawViewport()}handleFocus(){var M;for(const B of this._renderLayers)B.handleFocus(this._terminal);(M=this._cursorBlinkStateManager.value)===null||M===void 0||M.resume(),this._requestRedrawViewport()}handleSelectionChanged(M,B,z){for(const Y of this._renderLayers)Y.handleSelectionChanged(this._terminal,M,B,z);this._model.selection.update(this._terminal,M,B,z),this._requestRedrawViewport()}handleCursorMove(){var M;for(const B of this._renderLayers)B.handleCursorMove(this._terminal);(M=this._cursorBlinkStateManager.value)===null||M===void 0||M.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new I.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new E.GlyphRenderer(this._terminal,this._gl,this.dimensions),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var M;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const B=(0,v.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==B&&(this._onChangeTextureAtlas.fire(B.pages[0].canvas),this._charAtlasDisposable.value=(0,f.getDisposeArrayDisposable)([(0,l.forwardEvent)(B.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,l.forwardEvent)(B.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=B,this._charAtlas.warmUp(),(M=this._glyphRenderer.value)===null||M===void 0||M.setAtlas(this._charAtlas)}_clearModel(M){var B;this._model.clear(),M&&((B=this._glyphRenderer.value)===null||B===void 0||B.clear())}clearTextureAtlas(){var M;(M=this._charAtlas)===null||M===void 0||M.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var M;this._clearModel(!0);for(const B of this._renderLayers)B.reset(this._terminal);(M=this._cursorBlinkStateManager.value)===null||M===void 0||M.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(M){return-1}deregisterCharacterJoiner(M){return!1}renderRows(M,B){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const z of this._renderLayers)z.handleGridChanged(this._terminal,M,B);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(M,B),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new m.CursorBlinkStateManager(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(M,B){const z=this._core;let Y,U,N,V,j,G,te,se,oe,Fe,K,Z,J,ae=this._workCell;M=x(M,z.rows-1,0),B=x(B,z.rows-1,0);const Ie=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,de=Math.min(this._terminal.buffer.active.cursorX,z.cols-1);let Le=-1;const xe=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let Qe=!1;for(U=M;U<=B;U++)for(N=U+z.buffer.ydisp,V=z.buffer.lines.get(N),this._model.lineLengths[U]=0,j=this._characterJoinerService.getJoinedCharacters(N),Z=0;Z0&&Z===j[0][0]&&(G=!0,se=j.shift(),ae=new L(ae,V.translateToString(!0,se[0],se[1]),se[1]-se[0]),te=se[1]-1),oe=ae.getChars(),Fe=ae.getCode(),K=(U*z.cols+Z)*S.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(ae,Z,N),xe&&N===Ie&&(Z===de&&(this._model.cursor={x:de,y:this._terminal.buffer.active.cursorY,width:ae.getWidth(),style:this._coreBrowserService.isFocused?z.options.cursorStyle||"block":z.options.cursorInactiveStyle,cursorWidth:z.options.cursorWidth,dpr:this._devicePixelRatio},Le=de+ae.getWidth()-1),Z>=de&&Z<=Le&&(this._coreBrowserService.isFocused&&(z.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&z.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),Fe!==C.NULL_CELL_CODE&&(this._model.lineLengths[U]=Z+1),(this._model.cells[K]!==Fe||this._model.cells[K+S.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[K+S.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[K+S.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(Qe=!0,oe.length>1&&(Fe|=S.COMBINED_CHAR_BIT_MASK),this._model.cells[K]=Fe,this._model.cells[K+S.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[K+S.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[K+S.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,this._glyphRenderer.value.updateCell(Z,U,Fe,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,oe,Y),G))for(ae=this._workCell,Z++;Z{Object.defineProperty(r,"__esModule",{value:!0}),r.GLTexture=r.expandFloat32Array=r.createShader=r.createProgram=r.PROJECTION_MATRIX=void 0;const c=o(374);function h(u,v,m){const b=(0,c.throwIfFalsy)(u.createShader(v));if(u.shaderSource(b,m),u.compileShader(b),u.getShaderParameter(b,u.COMPILE_STATUS))return b;console.error(u.getShaderInfoLog(b)),u.deleteShader(b)}r.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),r.createProgram=function(u,v,m){const b=(0,c.throwIfFalsy)(u.createProgram());if(u.attachShader(b,(0,c.throwIfFalsy)(h(u,u.VERTEX_SHADER,v))),u.attachShader(b,(0,c.throwIfFalsy)(h(u,u.FRAGMENT_SHADER,m))),u.linkProgram(b),u.getProgramParameter(b,u.LINK_STATUS))return b;console.error(u.getProgramInfoLog(b)),u.deleteProgram(b)},r.createShader=h,r.expandFloat32Array=function(u,v){const m=Math.min(2*u.length,v),b=new Float32Array(m);for(let g=0;g{Object.defineProperty(r,"__esModule",{value:!0}),r.BaseRenderLayer=void 0;const c=o(627),h=o(237),u=o(374),v=o(859);class m extends v.Disposable{constructor(g,l,f,p,y,C,k,E){super(),this._container=l,this._alpha=y,this._coreBrowserService=C,this._optionsService=k,this._themeService=E,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add(`xterm-${f}-layer`),this._canvas.style.zIndex=p.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors(I=>{this._refreshCharAtlas(g,I),this.reset(g)})),this.register((0,v.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,u.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(g){}handleFocus(g){}handleCursorMove(g){}handleGridChanged(g,l,f){}handleSelectionChanged(g,l,f,p=!1){}_setTransparency(g,l){if(l===this._alpha)return;const f=this._canvas;this._alpha=l,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,f),this._refreshCharAtlas(g,this._themeService.colors),this.handleGridChanged(g,0,g.rows-1)}_refreshCharAtlas(g,l){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,c.acquireTextureAtlas)(g,this._optionsService.rawOptions,l,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(g,l){this._deviceCellWidth=l.device.cell.width,this._deviceCellHeight=l.device.cell.height,this._deviceCharWidth=l.device.char.width,this._deviceCharHeight=l.device.char.height,this._deviceCharLeft=l.device.char.left,this._deviceCharTop=l.device.char.top,this._canvas.width=l.device.canvas.width,this._canvas.height=l.device.canvas.height,this._canvas.style.width=`${l.css.canvas.width}px`,this._canvas.style.height=`${l.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(g,this._themeService.colors)}_fillBottomLineAtCells(g,l,f=1){this._ctx.fillRect(g*this._deviceCellWidth,(l+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,f*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(g,l,f,p){this._alpha?this._ctx.clearRect(g*this._deviceCellWidth,l*this._deviceCellHeight,f*this._deviceCellWidth,p*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(g*this._deviceCellWidth,l*this._deviceCellHeight,f*this._deviceCellWidth,p*this._deviceCellHeight))}_fillCharTrueColor(g,l,f,p){this._ctx.font=this._getFont(g,!1,!1),this._ctx.textBaseline=h.TEXT_BASELINE,this._clipCell(f,p,l.getWidth()),this._ctx.fillText(l.getChars(),f*this._deviceCellWidth+this._deviceCharLeft,p*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(g,l,f){this._ctx.beginPath(),this._ctx.rect(g*this._deviceCellWidth,l*this._deviceCellHeight,f*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(g,l,f){return`${f?"italic":""} ${l?g.options.fontWeightBold:g.options.fontWeight} ${g.options.fontSize*this._coreBrowserService.dpr}px ${g.options.fontFamily}`}}r.BaseRenderLayer=m},733:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkRenderLayer=void 0;const c=o(197),h=o(237),u=o(592);class v extends u.BaseRenderLayer{constructor(b,g,l,f,p,y,C){super(l,b,"link",g,!0,p,y,C),this.register(f.onShowLinkUnderline(k=>this._handleShowLinkUnderline(k))),this.register(f.onHideLinkUnderline(k=>this._handleHideLinkUnderline(k)))}resize(b,g){super.resize(b,g),this._state=void 0}reset(b){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const b=this._state.y2-this._state.y1-1;b>0&&this._clearCells(0,this._state.y1+1,this._state.cols,b),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(b){if(b.fg===h.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:b.fg!==void 0&&(0,c.is256Color)(b.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[b.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,b.y1===b.y2)this._fillBottomLineAtCells(b.x1,b.y1,b.x2-b.x1);else{this._fillBottomLineAtCells(b.x1,b.y1,b.cols-b.x1);for(let g=b.y1+1;g{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(o,c,h,u){o.addEventListener(c,h,u);let v=!1;return{dispose:()=>{v||(v=!0,o.removeEventListener(c,h,u))}}}},274:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellColorResolver=void 0;let o,c=0,h=0,u=!1,v=!1,m=!1;r.CellColorResolver=class{constructor(b,g,l,f,p){this._terminal=b,this._selectionRenderModel=g,this._decorationService=l,this._coreBrowserService=f,this._themeService=p,this.result={fg:0,bg:0,ext:0}}resolve(b,g,l){this.result.bg=b.bg,this.result.fg=b.fg,this.result.ext=268435456&b.bg?b.extended.ext:0,h=0,c=0,v=!1,u=!1,m=!1,o=this._themeService.colors,this._decorationService.forEachDecorationAtCell(g,l,"bottom",f=>{f.backgroundColorRGB&&(h=f.backgroundColorRGB.rgba>>8&16777215,v=!0),f.foregroundColorRGB&&(c=f.foregroundColorRGB.rgba>>8&16777215,u=!0)}),m=this._selectionRenderModel.isCellSelected(this._terminal,g,l),m&&(h=(this._coreBrowserService.isFocused?o.selectionBackgroundOpaque:o.selectionInactiveBackgroundOpaque).rgba>>8&16777215,v=!0,o.selectionForeground&&(c=o.selectionForeground.rgba>>8&16777215,u=!0)),this._decorationService.forEachDecorationAtCell(g,l,"top",f=>{f.backgroundColorRGB&&(h=f.backgroundColorRGB.rgba>>8&16777215,v=!0),f.foregroundColorRGB&&(c=f.foregroundColorRGB.rgba>>8&16777215,u=!0)}),v&&(h=m?-16777216&b.bg&-134217729|h|50331648:-16777216&b.bg|h|50331648),u&&(c=-16777216&b.fg&-67108865|c|50331648),67108864&this.result.fg&&(v&&!u&&(c=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&o.background.rgba>>8|50331648,u=!0),!v&&u&&(h=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&o.foreground.rgba>>8|50331648,v=!0)),o=void 0,this.result.bg=v?h:this.result.bg,this.result.fg=u?c:this.result.fg}}},627:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.removeTerminalFromCache=r.acquireTextureAtlas=void 0;const c=o(509),h=o(197),u=[];r.acquireTextureAtlas=function(v,m,b,g,l,f,p,y){const C=(0,h.generateConfig)(g,l,f,p,m,b,y);for(let I=0;I=0){if((0,h.configEquals)(S.config,C))return S.atlas;S.ownedBy.length===1?(S.atlas.dispose(),u.splice(I,1)):S.ownedBy.splice(P,1);break}}for(let I=0;I{Object.defineProperty(r,"__esModule",{value:!0}),r.is256Color=r.configEquals=r.generateConfig=void 0;const c=o(160);r.generateConfig=function(h,u,v,m,b,g,l){const f={foreground:g.foreground,background:g.background,cursor:c.NULL_COLOR,cursorAccent:c.NULL_COLOR,selectionForeground:c.NULL_COLOR,selectionBackgroundTransparent:c.NULL_COLOR,selectionBackgroundOpaque:c.NULL_COLOR,selectionInactiveBackgroundTransparent:c.NULL_COLOR,selectionInactiveBackgroundOpaque:c.NULL_COLOR,ansi:g.ansi.slice(),contrastCache:g.contrastCache,halfContrastCache:g.halfContrastCache};return{customGlyphs:b.customGlyphs,devicePixelRatio:l,letterSpacing:b.letterSpacing,lineHeight:b.lineHeight,deviceCellWidth:h,deviceCellHeight:u,deviceCharWidth:v,deviceCharHeight:m,fontFamily:b.fontFamily,fontSize:b.fontSize,fontWeight:b.fontWeight,fontWeightBold:b.fontWeightBold,allowTransparency:b.allowTransparency,drawBoldTextInBrightColors:b.drawBoldTextInBrightColors,minimumContrastRatio:b.minimumContrastRatio,colors:f}},r.configEquals=function(h,u){for(let v=0;v{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const c=o(399);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},457:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CursorBlinkStateManager=void 0,r.CursorBlinkStateManager=class{constructor(o,c){this._renderCallback=o,this._coreBrowserService=c,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(o=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const c=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,c>0)return void this._restartInterval(c)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const c=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(c)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},o)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tryDrawCustomChar=r.powerlineDefinitions=r.boxDrawingDefinitions=r.blockElementDefinitions=void 0;const c=o(374);r.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const h={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};r.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(g,l)=>`M0,${.5-l} L1,${.5-l} M0,${.5+l} L1,${.5+l}`},"║":{1:(g,l)=>`M${.5-g},0 L${.5-g},1 M${.5+g},0 L${.5+g},1`},"╒":{1:(g,l)=>`M.5,1 L.5,${.5-l} L1,${.5-l} M.5,${.5+l} L1,${.5+l}`},"╓":{1:(g,l)=>`M${.5-g},1 L${.5-g},.5 L1,.5 M${.5+g},.5 L${.5+g},1`},"╔":{1:(g,l)=>`M1,${.5-l} L${.5-g},${.5-l} L${.5-g},1 M1,${.5+l} L${.5+g},${.5+l} L${.5+g},1`},"╕":{1:(g,l)=>`M0,${.5-l} L.5,${.5-l} L.5,1 M0,${.5+l} L.5,${.5+l}`},"╖":{1:(g,l)=>`M${.5+g},1 L${.5+g},.5 L0,.5 M${.5-g},.5 L${.5-g},1`},"╗":{1:(g,l)=>`M0,${.5+l} L${.5-g},${.5+l} L${.5-g},1 M0,${.5-l} L${.5+g},${.5-l} L${.5+g},1`},"╘":{1:(g,l)=>`M.5,0 L.5,${.5+l} L1,${.5+l} M.5,${.5-l} L1,${.5-l}`},"╙":{1:(g,l)=>`M1,.5 L${.5-g},.5 L${.5-g},0 M${.5+g},.5 L${.5+g},0`},"╚":{1:(g,l)=>`M1,${.5-l} L${.5+g},${.5-l} L${.5+g},0 M1,${.5+l} L${.5-g},${.5+l} L${.5-g},0`},"╛":{1:(g,l)=>`M0,${.5+l} L.5,${.5+l} L.5,0 M0,${.5-l} L.5,${.5-l}`},"╜":{1:(g,l)=>`M0,.5 L${.5+g},.5 L${.5+g},0 M${.5-g},.5 L${.5-g},0`},"╝":{1:(g,l)=>`M0,${.5-l} L${.5-g},${.5-l} L${.5-g},0 M0,${.5+l} L${.5+g},${.5+l} L${.5+g},0`},"╞":{1:(g,l)=>`M.5,0 L.5,1 M.5,${.5-l} L1,${.5-l} M.5,${.5+l} L1,${.5+l}`},"╟":{1:(g,l)=>`M${.5-g},0 L${.5-g},1 M${.5+g},0 L${.5+g},1 M${.5+g},.5 L1,.5`},"╠":{1:(g,l)=>`M${.5-g},0 L${.5-g},1 M1,${.5+l} L${.5+g},${.5+l} L${.5+g},1 M1,${.5-l} L${.5+g},${.5-l} L${.5+g},0`},"╡":{1:(g,l)=>`M.5,0 L.5,1 M0,${.5-l} L.5,${.5-l} M0,${.5+l} L.5,${.5+l}`},"╢":{1:(g,l)=>`M0,.5 L${.5-g},.5 M${.5-g},0 L${.5-g},1 M${.5+g},0 L${.5+g},1`},"╣":{1:(g,l)=>`M${.5+g},0 L${.5+g},1 M0,${.5+l} L${.5-g},${.5+l} L${.5-g},1 M0,${.5-l} L${.5-g},${.5-l} L${.5-g},0`},"╤":{1:(g,l)=>`M0,${.5-l} L1,${.5-l} M0,${.5+l} L1,${.5+l} M.5,${.5+l} L.5,1`},"╥":{1:(g,l)=>`M0,.5 L1,.5 M${.5-g},.5 L${.5-g},1 M${.5+g},.5 L${.5+g},1`},"╦":{1:(g,l)=>`M0,${.5-l} L1,${.5-l} M0,${.5+l} L${.5-g},${.5+l} L${.5-g},1 M1,${.5+l} L${.5+g},${.5+l} L${.5+g},1`},"╧":{1:(g,l)=>`M.5,0 L.5,${.5-l} M0,${.5-l} L1,${.5-l} M0,${.5+l} L1,${.5+l}`},"╨":{1:(g,l)=>`M0,.5 L1,.5 M${.5-g},.5 L${.5-g},0 M${.5+g},.5 L${.5+g},0`},"╩":{1:(g,l)=>`M0,${.5+l} L1,${.5+l} M0,${.5-l} L${.5-g},${.5-l} L${.5-g},0 M1,${.5-l} L${.5+g},${.5-l} L${.5+g},0`},"╪":{1:(g,l)=>`M.5,0 L.5,1 M0,${.5-l} L1,${.5-l} M0,${.5+l} L1,${.5+l}`},"╫":{1:(g,l)=>`M0,.5 L1,.5 M${.5-g},0 L${.5-g},1 M${.5+g},0 L${.5+g},1`},"╬":{1:(g,l)=>`M0,${.5+l} L${.5-g},${.5+l} L${.5-g},1 M1,${.5+l} L${.5+g},${.5+l} L${.5+g},1 M0,${.5-l} L${.5-g},${.5-l} L${.5-g},0 M1,${.5-l} L${.5+g},${.5-l} L${.5+g},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 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1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(g,l)=>`M.5,1 L.5,${.5+l/.15*.5} C.5,${.5+l/.15*.5},.5,.5,1,.5`},"╮":{1:(g,l)=>`M.5,1 L.5,${.5+l/.15*.5} C.5,${.5+l/.15*.5},.5,.5,0,.5`},"╯":{1:(g,l)=>`M.5,0 L.5,${.5-l/.15*.5} C.5,${.5-l/.15*.5},.5,.5,0,.5`},"╰":{1:(g,l)=>`M.5,0 L.5,${.5-l/.15*.5} C.5,${.5-l/.15*.5},.5,.5,1,.5`}},r.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},r.powerlineDefinitions[""]=r.powerlineDefinitions[""],r.powerlineDefinitions[""]=r.powerlineDefinitions[""],r.tryDrawCustomChar=function(g,l,f,p,y,C,k,E){const I=r.blockElementDefinitions[l];if(I)return function(L,x,D,M,B,z){for(let Y=0;Y7&&parseInt(U.slice(7,9),16)||1;else{if(!U.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${U}" when drawing pattern glyph`);[oe,Fe,K,Z]=U.substring(5,U.length-1).split(",").map(J=>parseFloat(J))}for(let J=0;Jg.bezierCurveTo(l[0],l[1],l[2],l[3],l[4],l[5]),L:(g,l)=>g.lineTo(l[0],l[1]),M:(g,l)=>g.moveTo(l[0],l[1])};function b(g,l,f,p,y,C,k,E=0,I=0){const S=g.map(P=>parseFloat(P)||parseInt(P));if(S.length<2)throw new Error("Too few arguments for instruction");for(let P=0;P{Object.defineProperty(r,"__esModule",{value:!0}),r.observeDevicePixelDimensions=void 0;const c=o(859);r.observeDevicePixelDimensions=function(h,u,v){let m=new u.ResizeObserver(b=>{const g=b.find(p=>p.target===h);if(!g)return;if(!("devicePixelContentBoxSize"in g))return m==null||m.disconnect(),void(m=void 0);const l=g.devicePixelContentBoxSize[0].inlineSize,f=g.devicePixelContentBoxSize[0].blockSize;l>0&&f>0&&v(l,f)});try{m.observe(h,{box:["device-pixel-content-box"]})}catch{m.disconnect(),m=void 0}return(0,c.toDisposable)(()=>m==null?void 0:m.disconnect())}},374:(d,r)=>{function o(c){return 57508<=c&&c<=57558}Object.defineProperty(r,"__esModule",{value:!0}),r.createRenderDimensions=r.excludeFromContrastRatioDemands=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},r.isPowerlineGlyph=o,r.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},r.excludeFromContrastRatioDemands=function(c){return o(c)||function(h){return 9472<=h&&h<=9631}(c)},r.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},296:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSelectionRenderModel=void 0;class o{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(h,u,v,m=!1){if(this.selectionStart=u,this.selectionEnd=v,!u||!v||u[0]===v[0]&&u[1]===v[1])return void this.clear();const b=u[1]-h.buffer.active.viewportY,g=v[1]-h.buffer.active.viewportY,l=Math.max(b,0),f=Math.min(g,h.rows-1);l>=h.rows||f<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=b,this.viewportEndRow=g,this.viewportCappedStartRow=l,this.viewportCappedEndRow=f,this.startCol=u[0],this.endCol=v[0])}isCellSelected(h,u,v){return!!this.hasSelection&&(v-=h.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&v>=this.viewportCappedStartRow&&u=this.viewportCappedStartRow&&u>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v=this.startCol&&u=this.startCol)}}r.createSelectionRenderModel=function(){return new o}},509:function(d,r,o){var c=this&&this.__decorate||function(A,L,x,D){var M,B=arguments.length,z=B<3?L:D===null?D=Object.getOwnPropertyDescriptor(L,x):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(A,L,x,D);else for(var Y=A.length-1;Y>=0;Y--)(M=A[Y])&&(z=(B<3?M(z):B>3?M(L,x,z):M(L,x))||z);return B>3&&z&&Object.defineProperty(L,x,z),z};Object.defineProperty(r,"__esModule",{value:!0}),r.TextureAtlas=void 0;const h=o(237),u=o(860),v=o(374),m=o(160),b=o(345),g=o(485),l=o(385),f=o(147),p=o(855),y=o(776),C={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let k;class E{get pages(){return this._pages}constructor(L,x,D){this._document=L,this._config=x,this._unicodeService=D,this._didWarmUp=!1,this._cacheMap=new g.FourKeyMap,this._cacheMapCombined=new g.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new f.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new b.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new b.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=P(L,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,v.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const L of this.pages)L.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const L=new l.IdleTaskQueue;for(let x=33;x<126;x++)L.enqueue(()=>{if(!this._cacheMap.get(x,p.DEFAULT_COLOR,p.DEFAULT_COLOR,p.DEFAULT_EXT)){const D=this._drawToCache(x,p.DEFAULT_COLOR,p.DEFAULT_COLOR,p.DEFAULT_EXT);this._cacheMap.set(x,p.DEFAULT_COLOR,p.DEFAULT_COLOR,p.DEFAULT_EXT,D)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const L of this._pages)L.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(E.maxAtlasPages&&this._pages.length>=Math.max(4,E.maxAtlasPages)){const x=this._pages.filter(N=>2*N.canvas.width<=(E.maxTextureSize||4096)).sort((N,V)=>V.canvas.width!==N.canvas.width?V.canvas.width-N.canvas.width:V.percentageUsed-N.percentageUsed);let D=-1,M=0;for(let N=0;NN.glyphs[0].texturePage).sort((N,V)=>N>V?1:-1),Y=this.pages.length-B.length,U=this._mergePages(B,Y);U.version++;for(let N=z.length-1;N>=0;N--)this._deletePage(z[N]);this.pages.push(U),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(U.canvas)}const L=new I(this._document,this._textureSize);return this._pages.push(L),this._activePages.push(L),this._onAddTextureAtlasCanvas.fire(L.canvas),L}_mergePages(L,x){const D=2*L[0].canvas.width,M=new I(this._document,D,L);for(const[B,z]of L.entries()){const Y=B*z.canvas.width%D,U=Math.floor(B/2)*z.canvas.height;M.ctx.drawImage(z.canvas,Y,U);for(const V of z.glyphs)V.texturePage=x,V.sizeClipSpace.x=V.size.x/D,V.sizeClipSpace.y=V.size.y/D,V.texturePosition.x+=Y,V.texturePosition.y+=U,V.texturePositionClipSpace.x=V.texturePosition.x/D,V.texturePositionClipSpace.y=V.texturePosition.y/D;this._onRemoveTextureAtlasCanvas.fire(z.canvas);const N=this._activePages.indexOf(z);N!==-1&&this._activePages.splice(N,1)}return M}_deletePage(L){this._pages.splice(L,1);for(let x=L;x=this._config.colors.ansi.length)throw new Error("No color found for idx "+L);return this._config.colors.ansi[L]}_getBackgroundColor(L,x,D,M){if(this._config.allowTransparency)return m.NULL_COLOR;let B;switch(L){case 16777216:case 33554432:B=this._getColorFromAnsiIndex(x);break;case 50331648:const z=f.AttributeData.toColorRGB(x);B=m.rgba.toColor(z[0],z[1],z[2]);break;default:B=D?m.color.opaque(this._config.colors.foreground):this._config.colors.background}return B}_getForegroundColor(L,x,D,M,B,z,Y,U,N,V){const j=this._getMinimumContrastColor(L,x,D,M,B,z,!1,N,U,V);if(j)return j;let G;switch(B){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&N&&z<8&&(z+=8),G=this._getColorFromAnsiIndex(z);break;case 50331648:const te=f.AttributeData.toColorRGB(z);G=m.rgba.toColor(te[0],te[1],te[2]);break;default:G=Y?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(G=m.color.opaque(G)),U&&(G=m.color.multiplyOpacity(G,h.DIM_OPACITY)),G}_resolveBackgroundRgba(L,x,D){switch(L){case 16777216:case 33554432:return this._getColorFromAnsiIndex(x).rgba;case 50331648:return x<<8;default:return D?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(L,x,D,M){switch(L){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&M&&x<8&&(x+=8),this._getColorFromAnsiIndex(x).rgba;case 50331648:return x<<8;default:return D?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(L,x,D,M,B,z,Y,U,N,V){if(this._config.minimumContrastRatio===1||V)return;const j=this._getContrastCache(N),G=j.getColor(L,M);if(G!==void 0)return G||void 0;const te=this._resolveBackgroundRgba(x,D,Y),se=this._resolveForegroundRgba(B,z,Y,U),oe=m.rgba.ensureContrastRatio(te,se,this._config.minimumContrastRatio/(N?2:1));if(!oe)return void j.setColor(L,M,null);const Fe=m.rgba.toColor(oe>>24&255,oe>>16&255,oe>>8&255);return j.setColor(L,M,Fe),Fe}_getContrastCache(L){return L?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(L,x,D,M,B=!1){const z=typeof L=="number"?String.fromCharCode(L):L,Y=Math.min(this._config.deviceCellWidth*Math.max(z.length,2)+4,this._textureSize);this._tmpCanvas.width=12&&!this._config.allowTransparency&&z!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Ne=this._tmpCtx.measureText(z);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Ne&&Ne.actualBoundingBoxDescent>0){this._tmpCtx.save();const ot=new Path2D;ot.rect(Se,R-Math.ceil(Ce/2),this._config.deviceCellWidth*ue,ht-R+Math.ceil(Ce/2)),this._tmpCtx.clip(ot),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=ae.css,this._tmpCtx.strokeText(z,De,De+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(oe){const Ce=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Be=Ce%2==1?.5:0;this._tmpCtx.lineWidth=Ce,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(De,De+Be),this._tmpCtx.lineTo(De+this._config.deviceCharWidth*ue,De+Be),this._tmpCtx.stroke()}if(ne||this._tmpCtx.fillText(z,De,De+this._config.deviceCharHeight),z==="_"&&!this._config.allowTransparency){let Ce=S(this._tmpCtx.getImageData(De,De,this._config.deviceCellWidth,this._config.deviceCellHeight),ae,Qe,he);if(Ce)for(let Be=1;Be<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=ae.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(z,De,De+this._config.deviceCharHeight-Be),Ce=S(this._tmpCtx.getImageData(De,De,this._config.deviceCellWidth,this._config.deviceCellHeight),ae,Qe,he),Ce);Be++);}if(se){const Ce=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),Be=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=Ce,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(De,De+Math.floor(this._config.deviceCharHeight/2)-Be),this._tmpCtx.lineTo(De+this._config.deviceCharWidth*ue,De+Math.floor(this._config.deviceCharHeight/2)-Be),this._tmpCtx.stroke()}this._tmpCtx.restore();const Ae=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let ce;if(ce=this._config.allowTransparency?function(Ce){for(let Be=0;Be0)return!1;return!0}(Ae):S(Ae,ae,Qe,he),ce)return C;const Je=this._findGlyphBoundingBox(Ae,this._workBoundingBox,Y,xe,ne,De);let ye,_e;for(;;){if(this._activePages.length===0){const Ce=this._createNewPage();ye=Ce,_e=Ce.currentRow,_e.height=Je.size.y;break}ye=this._activePages[this._activePages.length-1],_e=ye.currentRow;for(const Ce of this._activePages)Je.size.y<=Ce.currentRow.height&&(ye=Ce,_e=Ce.currentRow);for(let Ce=this._activePages.length-1;Ce>=0;Ce--)for(const Be of this._activePages[Ce].fixedRows)Be.height<=_e.height&&Je.size.y<=Be.height&&(ye=this._activePages[Ce],_e=Be);if(_e.y+Je.size.y>=ye.canvas.height||_e.height>Je.size.y+2){let Ce=!1;if(ye.currentRow.y+ye.currentRow.height+Je.size.y>=ye.canvas.height){let Be;for(const Se of this._activePages)if(Se.currentRow.y+Se.currentRow.height+Je.size.y=E.maxAtlasPages&&_e.y+Je.size.y<=ye.canvas.height&&_e.height>=Je.size.y&&_e.x+Je.size.x<=ye.canvas.width)Ce=!0;else{const Se=this._createNewPage();ye=Se,_e=Se.currentRow,_e.height=Je.size.y,Ce=!0}}Ce||(ye.currentRow.height>0&&ye.fixedRows.push(ye.currentRow),_e={x:0,y:ye.currentRow.y+ye.currentRow.height,height:Je.size.y},ye.fixedRows.push(_e),ye.currentRow={x:0,y:_e.y+_e.height,height:0})}if(_e.x+Je.size.x<=ye.canvas.width)break;_e===ye.currentRow?(_e.x=0,_e.y+=_e.height,_e.height=0):ye.fixedRows.splice(ye.fixedRows.indexOf(_e),1)}return Je.texturePage=this._pages.indexOf(ye),Je.texturePosition.x=_e.x,Je.texturePosition.y=_e.y,Je.texturePositionClipSpace.x=_e.x/ye.canvas.width,Je.texturePositionClipSpace.y=_e.y/ye.canvas.height,Je.sizeClipSpace.x/=ye.canvas.width,Je.sizeClipSpace.y/=ye.canvas.height,_e.height=Math.max(_e.height,Je.size.y),_e.x+=Je.size.x,ye.ctx.putImageData(Ae,Je.texturePosition.x-this._workBoundingBox.left,Je.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Je.size.x,Je.size.y),ye.addGlyph(Je),ye.version++,Je}_findGlyphBoundingBox(L,x,D,M,B,z){x.top=0;const Y=M?this._config.deviceCellHeight:this._tmpCanvas.height,U=M?this._config.deviceCellWidth:D;let N=!1;for(let V=0;V=z;V--){for(let j=0;j=0;V--){for(let j=0;j>>24,B=L.rgba>>>16&255,z=L.rgba>>>8&255,Y=x.rgba>>>24,U=x.rgba>>>16&255,N=x.rgba>>>8&255,V=Math.floor((Math.abs(M-Y)+Math.abs(B-U)+Math.abs(z-N))/12);let j=!0;for(let G=0;G{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;const c=o(399);let h=0,u=0,v=0,m=0;var b,g,l,f,p;function y(k){const E=k.toString(16);return E.length<2?"0"+E:E}function C(k,E){return k>>0}}(b||(r.channels=b={})),function(k){function E(I,S){return m=Math.round(255*S),[h,u,v]=p.toChannels(I.rgba),{css:b.toCss(h,u,v,m),rgba:b.toRgba(h,u,v,m)}}k.blend=function(I,S){if(m=(255&S.rgba)/255,m===1)return{css:S.css,rgba:S.rgba};const P=S.rgba>>24&255,A=S.rgba>>16&255,L=S.rgba>>8&255,x=I.rgba>>24&255,D=I.rgba>>16&255,M=I.rgba>>8&255;return h=x+Math.round((P-x)*m),u=D+Math.round((A-D)*m),v=M+Math.round((L-M)*m),{css:b.toCss(h,u,v),rgba:b.toRgba(h,u,v)}},k.isOpaque=function(I){return(255&I.rgba)==255},k.ensureContrastRatio=function(I,S,P){const A=p.ensureContrastRatio(I.rgba,S.rgba,P);if(A)return p.toColor(A>>24&255,A>>16&255,A>>8&255)},k.opaque=function(I){const S=(255|I.rgba)>>>0;return[h,u,v]=p.toChannels(S),{css:b.toCss(h,u,v),rgba:S}},k.opacity=E,k.multiplyOpacity=function(I,S){return m=255&I.rgba,E(I,m*S/255)},k.toColorRGB=function(I){return[I.rgba>>24&255,I.rgba>>16&255,I.rgba>>8&255]}}(g||(r.color=g={})),function(k){let E,I;if(!c.isNode){const S=document.createElement("canvas");S.width=1,S.height=1;const P=S.getContext("2d",{willReadFrequently:!0});P&&(E=P,E.globalCompositeOperation="copy",I=E.createLinearGradient(0,0,1,1))}k.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return h=parseInt(S.slice(1,2).repeat(2),16),u=parseInt(S.slice(2,3).repeat(2),16),v=parseInt(S.slice(3,4).repeat(2),16),p.toColor(h,u,v);case 5:return h=parseInt(S.slice(1,2).repeat(2),16),u=parseInt(S.slice(2,3).repeat(2),16),v=parseInt(S.slice(3,4).repeat(2),16),m=parseInt(S.slice(4,5).repeat(2),16),p.toColor(h,u,v,m);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const P=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(P)return h=parseInt(P[1]),u=parseInt(P[2]),v=parseInt(P[3]),m=Math.round(255*(P[5]===void 0?1:parseFloat(P[5]))),p.toColor(h,u,v,m);if(!E||!I)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=I,E.fillStyle=S,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[h,u,v,m]=E.getImageData(0,0,1,1).data,m!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(h,u,v,m),css:S}}}(l||(r.css=l={})),function(k){function E(I,S,P){const A=I/255,L=S/255,x=P/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))}k.relativeLuminance=function(I){return E(I>>16&255,I>>8&255,255&I)},k.relativeLuminance2=E}(f||(r.rgb=f={})),function(k){function E(S,P,A){const L=S>>24&255,x=S>>16&255,D=S>>8&255;let M=P>>24&255,B=P>>16&255,z=P>>8&255,Y=C(f.relativeLuminance2(M,B,z),f.relativeLuminance2(L,x,D));for(;Y0||B>0||z>0);)M-=Math.max(0,Math.ceil(.1*M)),B-=Math.max(0,Math.ceil(.1*B)),z-=Math.max(0,Math.ceil(.1*z)),Y=C(f.relativeLuminance2(M,B,z),f.relativeLuminance2(L,x,D));return(M<<24|B<<16|z<<8|255)>>>0}function I(S,P,A){const L=S>>24&255,x=S>>16&255,D=S>>8&255;let M=P>>24&255,B=P>>16&255,z=P>>8&255,Y=C(f.relativeLuminance2(M,B,z),f.relativeLuminance2(L,x,D));for(;Y>>0}k.ensureContrastRatio=function(S,P,A){const L=f.relativeLuminance(S>>8),x=f.relativeLuminance(P>>8);if(C(L,x)>8));if(zC(L,f.relativeLuminance(Y>>8))?B:Y}return B}const D=I(S,P,A),M=C(L,f.relativeLuminance(D>>8));if(MC(L,f.relativeLuminance(B>>8))?D:B}return D}},k.reduceLuminance=E,k.increaseLuminance=I,k.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]},k.toColor=function(S,P,A,L){return{css:b.toCss(S,P,A,L),rgba:b.toRgba(S,P,A,L)}}}(p||(r.rgba=p={})),r.toPaddedHex=y,r.contrastRatio=C},345:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;cc.fire(h))}},859:(d,r)=>{function o(c){for(const h of c)h.dispose();c.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const h=this._disposables.indexOf(c);h!==-1&&this._disposables.splice(h,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var h;this._isDisposed||c===this._value||((h=this._value)===null||h===void 0||h.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)===null||c===void 0||c.dispose(),this._value=void 0}},r.toDisposable=function(c){return{dispose:c}},r.disposeArray=o,r.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},485:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(h,u,v){this._data[h]||(this._data[h]={}),this._data[h][u]=v}get(h,u){return this._data[h]?this._data[h][u]:void 0}clear(){this._data={}}}r.TwoKeyMap=o,r.FourKeyMap=class{constructor(){this._data=new o}set(c,h,u,v,m){this._data.get(c,h)||this._data.set(c,h,new o),this._data.get(c,h).set(u,v,m)}get(c,h,u,v){var m;return(m=this._data.get(c,h))===null||m===void 0?void 0:m.get(u,v)}clear(){this._data.clear()}}},399:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof navigator>"u";const o=r.isNode?"node":navigator.userAgent,c=r.isNode?"node":navigator.platform;r.isFirefox=o.includes("Firefox"),r.isLegacyEdge=o.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(o),r.getSafariVersion=function(){if(!r.isSafari)return 0;const h=o.match(/Version\/(\d+)/);return h===null||h.length<2?0:parseInt(h[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),r.isIpad=c==="iPad",r.isIphone=c==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),r.isLinux=c.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(o)},385:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const c=o(399);class h{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._if)return l-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(l-b))}ms`),void this._start();l=f}this.clear()}}class u extends h{_requestCallback(m){return setTimeout(()=>m(this._createDeadline(16)))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const b=Date.now()+m;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}r.PriorityTaskQueue=u,r.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends h{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:u,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},147:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new o;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}r.AttributeData=o;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}constructor(u=0,v=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=v}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=c},782:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const c=o(133),h=o(855),u=o(147);class v extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const g=new v;return g.setFromCharData(b),g}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(b){this.fg=b[h.CHAR_DATA_ATTR_INDEX],this.bg=0;let g=!1;if(b[h.CHAR_DATA_CHAR_INDEX].length>2)g=!0;else if(b[h.CHAR_DATA_CHAR_INDEX].length===2){const l=b[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=l&&l<=56319){const f=b[h.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=f&&f<=57343?this.content=1024*(l-55296)+f-56320+65536|b[h.CHAR_DATA_WIDTH_INDEX]<<22:g=!0}else g=!0}else this.content=b[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[h.CHAR_DATA_WIDTH_INDEX]<<22;g&&(this.combinedData=b[h.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[h.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=v},855:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},133:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},r.utf32ToString=function(o,c=0,h=o.length){let u="";for(let v=c;v65535?(m-=65536,u+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):u+=String.fromCharCode(m)}return u},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,c){const h=o.length;if(!h)return 0;let u=0,v=0;if(this._interim){const m=o.charCodeAt(v++);56320<=m&&m<=57343?c[u++]=1024*(this._interim-55296)+m-56320+65536:(c[u++]=this._interim,c[u++]=m),this._interim=0}for(let m=v;m=h)return this._interim=b,u;const g=o.charCodeAt(m);56320<=g&&g<=57343?c[u++]=1024*(b-55296)+g-56320+65536:(c[u++]=b,c[u++]=g)}else b!==65279&&(c[u++]=b)}return u}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,c){const h=o.length;if(!h)return 0;let u,v,m,b,g=0,l=0,f=0;if(this.interim[0]){let C=!1,k=this.interim[0];k&=(224&k)==192?31:(240&k)==224?15:7;let E,I=0;for(;(E=63&this.interim[++I])&&I<4;)k<<=6,k|=E;const S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,P=S-I;for(;f=h)return 0;if(E=o[f++],(192&E)!=128){f--,C=!0;break}this.interim[I++]=E,k<<=6,k|=63&E}C||(S===2?k<128?f--:c[g++]=k:S===3?k<2048||k>=55296&&k<=57343||k===65279||(c[g++]=k):k<65536||k>1114111||(c[g++]=k)),this.interim.fill(0)}const p=h-4;let y=f;for(;y=h)return this.interim[0]=u,g;if(v=o[y++],(192&v)!=128){y--;continue}if(l=(31&u)<<6|63&v,l<128){y--;continue}c[g++]=l}else if((240&u)==224){if(y>=h)return this.interim[0]=u,g;if(v=o[y++],(192&v)!=128){y--;continue}if(y>=h)return this.interim[0]=u,this.interim[1]=v,g;if(m=o[y++],(192&m)!=128){y--;continue}if(l=(15&u)<<12|(63&v)<<6|63&m,l<2048||l>=55296&&l<=57343||l===65279)continue;c[g++]=l}else if((248&u)==240){if(y>=h)return this.interim[0]=u,g;if(v=o[y++],(192&v)!=128){y--;continue}if(y>=h)return this.interim[0]=u,this.interim[1]=v,g;if(m=o[y++],(192&m)!=128){y--;continue}if(y>=h)return this.interim[0]=u,this.interim[1]=v,this.interim[2]=m,g;if(b=o[y++],(192&b)!=128){y--;continue}if(l=(7&u)<<18|(63&v)<<12|(63&m)<<6|63&b,l<65536||l>1114111)continue;c[g++]=l}}return g}}},776:function(d,r,o){var c=this&&this.__decorate||function(l,f,p,y){var C,k=arguments.length,E=k<3?f:y===null?y=Object.getOwnPropertyDescriptor(f,p):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,f,p,y);else for(var I=l.length-1;I>=0;I--)(C=l[I])&&(E=(k<3?C(E):k>3?C(f,p,E):C(f,p))||E);return k>3&&E&&Object.defineProperty(f,p,E),E},h=this&&this.__param||function(l,f){return function(p,y){f(p,y,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const u=o(859),v=o(97),m={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let b,g=r.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(l){super(),this._optionsService=l,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),b=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(l){for(let f=0;fJSON.stringify(E)).join(", ")})`);const k=y.apply(this,C);return b.trace(`GlyphRenderer#${y.name} return`,k),k}}},726:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const o="di$target",c="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(h){return h[c]||[]},r.createDecorator=function(h){if(r.serviceRegistry.has(h))return r.serviceRegistry.get(h);const u=function(v,m,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(g,l,f){l[o]===l?l[c].push({id:g,index:f}):(l[c]=[{id:g,index:f}],l[o]=l)})(u,v,b)};return u.toString=()=>h,r.serviceRegistry.set(h,u),u}},97:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const c=o(726);var h;r.IBufferService=(0,c.createDecorator)("BufferService"),r.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),r.ICoreService=(0,c.createDecorator)("CoreService"),r.ICharsetService=(0,c.createDecorator)("CharsetService"),r.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(h||(r.LogLevelEnum=h={})),r.ILogService=(0,c.createDecorator)("LogService"),r.IOptionsService=(0,c.createDecorator)("OptionsService"),r.IOscLinkService=(0,c.createDecorator)("OscLinkService"),r.IUnicodeService=(0,c.createDecorator)("UnicodeService"),r.IDecorationService=(0,c.createDecorator)("DecorationService")}},i={};function s(d){var r=i[d];if(r!==void 0)return r.exports;var o=i[d]={exports:{}};return n[d].call(o.exports,o,o.exports,s),o.exports}var a={};return(()=>{var d=a;Object.defineProperty(d,"__esModule",{value:!0}),d.WebglAddon=void 0;const r=s(345),o=s(859),c=s(399),h=s(666),u=s(776);class v extends o.Disposable{constructor(b){if(c.isSafari&&(0,c.getSafariVersion)()<16)throw new Error("Webgl2 is only supported on Safari 16 and above");super(),this._preserveDrawingBuffer=b,this._onChangeTextureAtlas=this.register(new r.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new r.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new r.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new r.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(b){const g=b._core;if(!b.element)return void this.register(g.onWillOpen(()=>this.activate(b)));this._terminal=b;const l=g.coreService,f=g.optionsService,p=g,y=p._renderService,C=p._characterJoinerService,k=p._charSizeService,E=p._coreBrowserService,I=p._decorationService,S=p._logService,P=p._themeService;(0,u.setTraceLogger)(S),this._renderer=this.register(new h.WebglRenderer(b,C,k,E,l,I,f,P,this._preserveDrawingBuffer)),this.register((0,r.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,r.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,r.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,r.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),y.setRenderer(this._renderer),this.register((0,o.toDisposable)(()=>{const A=this._terminal._core._renderService;A.setRenderer(this._terminal._core._createRenderer()),A.handleResize(b.cols,b.rows)}))}get textureAtlas(){var b;return(b=this._renderer)===null||b===void 0?void 0:b.textureAtlas}clearTextureAtlas(){var b;(b=this._renderer)===null||b===void 0||b.clearTextureAtlas()}}d.WebglAddon=v})(),a})())})(M_);var uT=M_.exports,A_={exports:{}};(function(e,t){(function(n,i){e.exports=i()})(self,()=>(()=>{var n={345:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;cc.fire(h))}},859:(d,r)=>{function o(c){for(const h of c)h.dispose();c.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const h=this._disposables.indexOf(c);h!==-1&&this._disposables.splice(h,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var h;this._isDisposed||c===this._value||((h=this._value)===null||h===void 0||h.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)===null||c===void 0||c.dispose(),this._value=void 0}},r.toDisposable=function(c){return{dispose:c}},r.disposeArray=o,r.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}}},i={};function s(d){var r=i[d];if(r!==void 0)return r.exports;var o=i[d]={exports:{}};return n[d](o,o.exports,s),o.exports}var a={};return(()=>{var d=a;Object.defineProperty(d,"__esModule",{value:!0}),d.SearchAddon=void 0;const r=s(345),o=s(859),c=" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?";class h extends o.Disposable{constructor(v){var m;super(),this._highlightedLines=new Set,this._highlightDecorations=[],this._selectedDecoration=this.register(new o.MutableDisposable),this._linesCacheTimeoutId=0,this._onDidChangeResults=this.register(new r.EventEmitter),this.onDidChangeResults=this._onDidChangeResults.event,this._highlightLimit=(m=v==null?void 0:v.highlightLimit)!==null&&m!==void 0?m:1e3}activate(v){this._terminal=v,this.register(this._terminal.onWriteParsed(()=>this._updateMatches())),this.register(this._terminal.onResize(()=>this._updateMatches())),this.register((0,o.toDisposable)(()=>this.clearDecorations()))}_updateMatches(){var v;this._highlightTimeout&&window.clearTimeout(this._highlightTimeout),this._cachedSearchTerm&&(!((v=this._lastSearchOptions)===null||v===void 0)&&v.decorations)&&(this._highlightTimeout=setTimeout(()=>{const m=this._cachedSearchTerm;this._cachedSearchTerm=void 0,this.findPrevious(m,Object.assign(Object.assign({},this._lastSearchOptions),{incremental:!0,noScroll:!0}))},200))}clearDecorations(v){this._selectedDecoration.clear(),(0,o.disposeArray)(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear(),v||(this._cachedSearchTerm=void 0)}findNext(v,m){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");this._lastSearchOptions=m,m!=null&&m.decorations&&(this._cachedSearchTerm!==void 0&&v===this._cachedSearchTerm||this._highlightAllMatches(v,m));const b=this._findNextAndSelect(v,m);return this._fireResults(m),this._cachedSearchTerm=v,b}_highlightAllMatches(v,m){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!v||v.length===0)return void this.clearDecorations();m=m||{},this.clearDecorations(!0);const b=[];let g,l=this._find(v,0,0,m);for(;l&&((g==null?void 0:g.row)!==l.row||(g==null?void 0:g.col)!==l.col)&&!(b.length>=this._highlightLimit);)g=l,b.push(g),l=this._find(v,g.col+g.term.length>=this._terminal.cols?g.row+1:g.row,g.col+g.term.length>=this._terminal.cols?0:g.col+1,m);for(const f of b){const p=this._createResultDecoration(f,m.decorations);p&&(this._highlightedLines.add(p.marker.line),this._highlightDecorations.push({decoration:p,match:f,dispose(){p.dispose()}}))}}_find(v,m,b,g){var l;if(!this._terminal||!v||v.length===0)return(l=this._terminal)===null||l===void 0||l.clearSelection(),void this.clearDecorations();if(b>this._terminal.cols)throw new Error(`Invalid col: ${b} to search in terminal of ${this._terminal.cols} cols`);let f;this._initLinesCache();const p={startRow:m,startCol:b};if(f=this._findInLine(v,p,g),!f)for(let y=m+1;y=0&&(y.startRow=k,C=this._findInLine(v,y,m,p),!C);k--);}if(!C&&l!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let k=this._terminal.buffer.active.baseY+this._terminal.rows-1;k>=l&&(y.startRow=k,C=this._findInLine(v,y,m,p),!C);k--);return this._selectResult(C,m==null?void 0:m.decorations,m==null?void 0:m.noScroll)}_initLinesCache(){const v=this._terminal;this._linesCache||(this._linesCache=new Array(v.buffer.active.length),this._cursorMoveListener=v.onCursorMove(()=>this._destroyLinesCache()),this._resizeListener=v.onResize(()=>this._destroyLinesCache())),window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=window.setTimeout(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._cursorMoveListener&&(this._cursorMoveListener.dispose(),this._cursorMoveListener=void 0),this._resizeListener&&(this._resizeListener.dispose(),this._resizeListener=void 0),this._linesCacheTimeoutId&&(window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=0)}_isWholeWord(v,m,b){return(v===0||c.includes(m[v-1]))&&(v+b.length===m.length||c.includes(m[v+b.length]))}_findInLine(v,m,b={},g=!1){var l;const f=this._terminal,p=m.startRow,y=m.startCol,C=f.buffer.active.getLine(p);if(C!=null&&C.isWrapped)return g?void(m.startCol+=f.cols):(m.startRow--,m.startCol+=f.cols,this._findInLine(v,m,b));let k=(l=this._linesCache)===null||l===void 0?void 0:l[p];k||(k=this._translateBufferLineToStringWithWrap(p,!0),this._linesCache&&(this._linesCache[p]=k));const[E,I]=k,S=this._bufferColsToStringOffset(p,y),P=b.caseSensitive?v:v.toLowerCase(),A=b.caseSensitive?E:E.toLowerCase();let L=-1;if(b.regex){const x=RegExp(P,"g");let D;if(g)for(;D=x.exec(A.slice(0,S));)L=x.lastIndex-D[0].length,v=D[0],x.lastIndex-=v.length-1;else D=x.exec(A.slice(S)),D&&D[0].length>0&&(L=S+(x.lastIndex-D[0].length),v=D[0])}else g?S-P.length>=0&&(L=A.lastIndexOf(P,S-P.length)):L=A.indexOf(P,S);if(L>=0){if(b.wholeWord&&!this._isWholeWord(L,A,v))return;let x=0;for(;x=I[x+1];)x++;let D=x;for(;D=I[D+1];)D++;const M=L-I[x],B=L+v.length-I[D],z=this._stringLengthToBufferSize(p+x,M);return{term:v,col:z,row:p+x,size:this._stringLengthToBufferSize(p+D,B)-z+f.cols*(D-x)}}}_stringLengthToBufferSize(v,m){const b=this._terminal.buffer.active.getLine(v);if(!b)return 0;for(let g=0;g1&&(m-=f.length-1);const p=b.getCell(g+1);p&&p.getWidth()===0&&m++}return m}_bufferColsToStringOffset(v,m){const b=this._terminal;let g=v,l=0,f=b.buffer.active.getLine(g);for(;m>0&&f;){for(let p=0;pthis._applyStyles(y,m.activeMatchBorder,!0))),p.push(f.onDispose(()=>(0,o.disposeArray)(p))),this._selectedDecoration.value={decoration:f,match:v,dispose(){f.dispose()}}}}}if(!b&&(v.row>=g.buffer.active.viewportY+g.rows||v.rowthis._applyStyles(p,m.matchBorder,!1))),f.push(l.onDispose(()=>(0,o.disposeArray)(f)))}return l}}d.SearchAddon=h})(),a})())})(A_);var hT=A_.exports;/*! Capacitor: https://capacitorjs.com/ - MIT License */var To;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(To||(To={}));class Bs extends Error{constructor(t,n,i){super(t),this.message=t,this.code=n,this.data=i}}const fT=e=>{var t,n;return e!=null&&e.androidBridge?"android":!((n=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||n===void 0)&&n.bridge?"ios":"web"},pT=e=>{const t=e.CapacitorCustomPlatform||null,n=e.Capacitor||{},i=n.Plugins=n.Plugins||{},s=()=>t!==null?t.name:fT(e),a=()=>s()!=="web",d=u=>{const v=c.get(u);return!!(v!=null&&v.platforms.has(s())||r(u))},r=u=>{var v;return(v=n.PluginHeaders)===null||v===void 0?void 0:v.find(m=>m.name===u)},o=u=>e.console.error(u),c=new Map,h=(u,v={})=>{const m=c.get(u);if(m)return console.warn(`Capacitor plugin "${u}" already registered. Cannot register plugins twice.`),m.proxy;const b=s(),g=r(u);let l;const f=async()=>(!l&&b in v?l=typeof v[b]=="function"?l=await v[b]():l=v[b]:t!==null&&!l&&"web"in v&&(l=typeof v.web=="function"?l=await v.web():l=v.web),l),p=(S,P)=>{var A,L;if(g){const x=g==null?void 0:g.methods.find(D=>P===D.name);if(x)return x.rtype==="promise"?D=>n.nativePromise(u,P.toString(),D):(D,M)=>n.nativeCallback(u,P.toString(),D,M);if(S)return(A=S[P])===null||A===void 0?void 0:A.bind(S)}else{if(S)return(L=S[P])===null||L===void 0?void 0:L.bind(S);throw new Bs(`"${u}" plugin is not implemented on ${b}`,To.Unimplemented)}},y=S=>{let P;const A=(...L)=>{const x=f().then(D=>{const M=p(D,S);if(M){const B=M(...L);return P=B==null?void 0:B.remove,B}else throw new Bs(`"${u}.${S}()" is not implemented on ${b}`,To.Unimplemented)});return S==="addListener"&&(x.remove=async()=>P()),x};return A.toString=()=>`${S.toString()}() { [capacitor code] }`,Object.defineProperty(A,"name",{value:S,writable:!1,configurable:!1}),A},C=y("addListener"),k=y("removeListener"),E=(S,P)=>{const A=C({eventName:S},P),L=async()=>{const D=await A;k({eventName:S,callbackId:D},P)},x=new Promise(D=>A.then(()=>D({remove:L})));return x.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await L()},x},I=new Proxy({},{get(S,P){switch(P){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return g?E:C;case"removeListener":return k;default:return y(P)}}});return i[u]=I,c.set(u,{name:u,proxy:I,platforms:new Set([...Object.keys(v),...g?[b]:[]])}),I};return n.convertFileSrc||(n.convertFileSrc=u=>u),n.getPlatform=s,n.handleError=o,n.isNativePlatform=a,n.isPluginAvailable=d,n.registerPlugin=h,n.Exception=Bs,n.DEBUG=!!n.DEBUG,n.isLoggingEnabled=!!n.isLoggingEnabled,n},vT=e=>e.Capacitor=pT(e),Cu=vT(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Ua=Cu.registerPlugin;class Ac{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,n){let i=!1;this.listeners[t]||(this.listeners[t]=[],i=!0),this.listeners[t].push(n);const a=this.windowListeners[t];a&&!a.registered&&this.addWindowListener(a),i&&this.sendRetainedArgumentsForEvent(t);const d=async()=>this.removeListener(t,n);return Promise.resolve({remove:d})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,n,i){const s=this.listeners[t];if(!s){if(i){let a=this.retainedEventArguments[t];a||(a=[]),a.push(n),this.retainedEventArguments[t]=a}return}s.forEach(a=>a(n))}hasListeners(t){var n;return!!(!((n=this.listeners[t])===null||n===void 0)&&n.length)}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:i=>{this.notifyListeners(n,i)}}}unimplemented(t="not implemented"){return new Cu.Exception(t,To.Unimplemented)}unavailable(t="not available"){return new Cu.Exception(t,To.Unavailable)}async removeListener(t,n){const i=this.listeners[t];if(!i)return;const s=i.indexOf(n);this.listeners[t].splice(s,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const n=this.retainedEventArguments[t];n&&(delete this.retainedEventArguments[t],n.forEach(i=>{this.notifyListeners(t,i)}))}}const Lp=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Dp=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class gT extends Ac{async getCookies(){const t=document.cookie,n={};return t.split(";").forEach(i=>{if(i.length<=0)return;let[s,a]=i.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");s=Dp(s).trim(),a=Dp(a).trim(),n[s]=a}),n}async setCookie(t){try{const n=Lp(t.key),i=Lp(t.value),s=t.expires?`; expires=${t.expires.replace("expires=","")}`:"",a=(t.path||"/").replace("path=",""),d=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${i||""}${s}; path=${a}; ${d};`}catch(n){return Promise.reject(n)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const n of t)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}Ua("CapacitorCookies",{web:()=>new gT});const mT=async e=>new Promise((t,n)=>{const i=new FileReader;i.onload=()=>{const s=i.result;t(s.indexOf(",")>=0?s.split(",")[1]:s)},i.onerror=s=>n(s),i.readAsDataURL(e)}),_T=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(s=>s.toLocaleLowerCase()).reduce((s,a,d)=>(s[a]=e[t[d]],s),{})},yT=(e,t=!0)=>e?Object.entries(e).reduce((i,s)=>{const[a,d]=s;let r,o;return Array.isArray(d)?(o="",d.forEach(c=>{r=t?encodeURIComponent(c):c,o+=`${a}=${r}&`}),o.slice(0,-1)):(r=t?encodeURIComponent(d):d,o=`${a}=${r}`),`${i}&${o}`},"").substr(1):null,bT=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),s=_T(e.headers)["content-type"]||"";if(typeof e.data=="string")n.body=e.data;else if(s.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[d,r]of Object.entries(e.data||{}))a.set(d,r);n.body=a.toString()}else if(s.includes("multipart/form-data")||e.data instanceof FormData){const a=new FormData;if(e.data instanceof FormData)e.data.forEach((r,o)=>{a.append(o,r)});else for(const r of Object.keys(e.data))a.append(r,e.data[r]);n.body=a;const d=new Headers(n.headers);d.delete("content-type"),n.headers=d}else(s.includes("application/json")||typeof e.data=="object")&&(n.body=JSON.stringify(e.data));return n};class wT extends Ac{async request(t){const n=bT(t,t.webFetchExtra),i=yT(t.params,t.shouldEncodeUrlParams),s=i?`${t.url}?${i}`:t.url,a=await fetch(s,n),d=a.headers.get("content-type")||"";let{responseType:r="text"}=a.ok?t:{};d.includes("application/json")&&(r="json");let o,c;switch(r){case"arraybuffer":case"blob":c=await a.blob(),o=await mT(c);break;case"json":o=await a.json();break;case"document":case"text":default:o=await a.text()}const h={};return a.headers.forEach((u,v)=>{h[v]=u}),{data:o,headers:h,status:a.status,url:a.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}Ua("CapacitorHttp",{web:()=>new wT});var Ip;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(Ip||(Ip={}));var Mp;(function(e){e.StatusBar="StatusBar",e.NavigationBar="NavigationBar"})(Mp||(Mp={}));class ST extends Ac{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}Ua("SystemBars",{web:()=>new ST});var Or;(function(e){e.Prompt="PROMPT",e.Camera="CAMERA",e.Photos="PHOTOS"})(Or||(Or={}));var ho;(function(e){e.Rear="REAR",e.Front="FRONT"})(ho||(ho={}));var ku;(function(e){e.Uri="uri",e.Base64="base64",e.DataUrl="dataUrl"})(ku||(ku={}));var nc;(function(e){e[e.Photo=0]="Photo",e[e.Video=1]="Video"})(nc||(nc={}));var Ca;(function(e){e[e.Photo=0]="Photo",e[e.Video=1]="Video",e[e.All=2]="All"})(Ca||(Ca={}));var Ap;(function(e){e[e.JPEG=0]="JPEG",e[e.PNG=1]="PNG"})(Ap||(Ap={}));var $p;(function(e){e.CameraPermissionDenied="OS-PLUG-CAMR-0003",e.GalleryPermissionDenied="OS-PLUG-CAMR-0005",e.NoCameraAvailable="OS-PLUG-CAMR-0007",e.TakePhotoCancelled="OS-PLUG-CAMR-0006",e.TakePhotoFailed="OS-PLUG-CAMR-0010",e.TakePhotoInvalidArguments="OS-PLUG-CAMR-0014",e.InvalidImageData="OS-PLUG-CAMR-0008",e.EditPhotoFailed="OS-PLUG-CAMR-0009",e.EditPhotoCancelled="OS-PLUG-CAMR-0013",e.EditPhotoEmptyUri="OS-PLUG-CAMR-0024",e.ImageNotFound="OS-PLUG-CAMR-0011",e.ProcessImageFailed="OS-PLUG-CAMR-0012",e.ChooseMediaFailed="OS-PLUG-CAMR-0018",e.ChooseMediaCancelled="OS-PLUG-CAMR-0020",e.MediaPathError="OS-PLUG-CAMR-0021",e.FetchImageFromUriFailed="OS-PLUG-CAMR-0028",e.RecordVideoFailed="OS-PLUG-CAMR-0016",e.RecordVideoCancelled="OS-PLUG-CAMR-0017",e.VideoNotFound="OS-PLUG-CAMR-0025",e.PlayVideoFailed="OS-PLUG-CAMR-0023",e.EncodeResultFailed="OS-PLUG-CAMR-0019",e.FileNotFound="OS-PLUG-CAMR-0027",e.InvalidArgument="OS-PLUG-CAMR-0031",e.GeneralError="OS-PLUG-CAMR-0026"})($p||($p={}));class CT extends Ac{async takePhoto(t){return new Promise(async(n,i)=>{t.webUseInput?this.takePhotoCameraInputExperience(t,n,i):this.takePhotoCameraExperience(t,n,i)})}async recordVideo(t){throw this.unimplemented("recordVideo is not implemented on Web.")}async playVideo(t){throw this.unimplemented("playVideo is not implemented on Web.")}async chooseFromGallery(t){return new Promise(async(n,i)=>{this.galleryInputExperience(t,n,i)})}async editPhoto(t){throw this.unimplemented("editPhoto is not implemented on Web.")}async editURIPhoto(t){throw this.unimplemented("editURIPhoto is not implemented on Web.")}async getPhoto(t){return new Promise(async(n,i)=>{if(t.webUseInput||t.source===Or.Photos)this.fileInputExperience(t,n,i);else if(t.source===Or.Prompt){let s=document.querySelector("pwa-action-sheet");s||(s=document.createElement("pwa-action-sheet"),document.body.appendChild(s)),s.header=t.promptLabelHeader||"Photo",s.cancelable=!1,s.options=[{title:t.promptLabelPhoto||"From Photos"},{title:t.promptLabelPicture||"Take Picture"}],s.addEventListener("onSelection",async a=>{a.detail===0?this.fileInputExperience(t,n,i):this.cameraExperience(t,n,i)})}else this.cameraExperience(t,n,i)})}async pickImages(t){return new Promise(async(n,i)=>{this.multipleFileInputExperience(n,i)})}async cameraExperience(t,n,i){await this._setupPWACameraModal(t.direction,s=>this._getCameraPhoto(s,t),()=>this.fileInputExperience(t,n,i),n,i)}fileInputExperience(t,n,i){let s=document.querySelector("#_capacitor-camera-input");const a=()=>{var d;(d=s.parentNode)===null||d===void 0||d.removeChild(s)};s||(s=document.createElement("input"),s.id="_capacitor-camera-input",s.type="file",s.hidden=!0,document.body.appendChild(s),s.addEventListener("change",d=>{const r=s.files[0];let o="jpeg";if(r.type==="image/png"?o="png":r.type==="image/gif"&&(o="gif"),t.resultType==="dataUrl"||t.resultType==="base64"){const c=new FileReader;c.addEventListener("load",()=>{if(t.resultType==="dataUrl")n({dataUrl:c.result,format:o});else if(t.resultType==="base64"){const h=c.result.split(",")[1];n({base64String:h,format:o})}a()}),c.readAsDataURL(r)}else n({webPath:URL.createObjectURL(r),format:o}),a()}),s.addEventListener("cancel",d=>{i(new Bs("User cancelled photos app")),a()})),s.accept="image/*",s.capture=!0,t.source===Or.Photos||t.source===Or.Prompt?s.removeAttribute("capture"):t.direction===ho.Front?s.capture="user":t.direction===ho.Rear&&(s.capture="environment"),s.click()}multipleFileInputExperience(t,n){let i=document.querySelector("#_capacitor-camera-input-multiple");const s=()=>{var a;(a=i.parentNode)===null||a===void 0||a.removeChild(i)};i||(i=document.createElement("input"),i.id="_capacitor-camera-input-multiple",i.type="file",i.hidden=!0,i.multiple=!0,document.body.appendChild(i),i.addEventListener("change",a=>{const d=[];for(let r=0;r{n(new Bs("User cancelled photos app")),s()})),i.accept="image/*",i.click()}_getCameraPhoto(t,n){return new Promise((i,s)=>{const a=new FileReader,d=this._getFileFormat(t);n.resultType==="uri"?i({webPath:URL.createObjectURL(t),format:d,saved:!1}):(a.readAsDataURL(t),a.onloadend=()=>{const r=a.result;n.resultType==="dataUrl"?i({dataUrl:r,format:d,saved:!1}):i({base64String:r.split(",")[1],format:d,saved:!1})},a.onerror=r=>{s(r)})})}async takePhotoCameraExperience(t,n,i){await this._setupPWACameraModal(t.cameraDirection,s=>{var a;return this._buildPhotoMediaResult(s,(a=t.includeMetadata)!==null&&a!==void 0?a:!1)},()=>this.takePhotoCameraInputExperience(t,n,i),n,i)}takePhotoCameraInputExperience(t,n,i){const s=this._createFileInput("_capacitor-camera-input-takephoto"),a=()=>{var d;(d=s.parentNode)===null||d===void 0||d.removeChild(s)};s.onchange=async d=>{var r;if(!this._validateFileInput(s,i,a))return;const o=s.files[0];n(await this._buildPhotoMediaResult(o,(r=t.includeMetadata)!==null&&r!==void 0?r:!1)),a()},s.oncancel=()=>{i(new Bs("User cancelled photos app")),a()},s.accept="image/*",t.cameraDirection===ho.Front?s.capture="user":s.capture="environment",s.click()}galleryInputExperience(t,n,i){var s,a;const d=this._createFileInput("_capacitor-camera-input-gallery");d.multiple=(s=t.allowMultipleSelection)!==null&&s!==void 0?s:!1;const r=()=>{var c;(c=d.parentNode)===null||c===void 0||c.removeChild(d)};d.onchange=async c=>{var h;if(!this._validateFileInput(d,i,r))return;const u=[];for(let v=0;v{i(new Bs("User cancelled photos app")),r()};const o=(a=t.mediaType)!==null&&a!==void 0?a:Ca.Photo;o===Ca.Photo?d.accept="image/*":o===Ca.Video?d.accept="video/*":d.accept="image/*,video/*",d.click()}_getFileFormat(t){return t.type==="image/png"?"png":t.type==="image/gif"?"gif":t.type.startsWith("video/")?t.type.split("/")[1]:t.type.startsWith("image/")?"jpeg":t.type.split("/")[1]||"jpeg"}async _buildPhotoMediaResult(t,n){const i=this._getFileFormat(t),s=await this._getBase64FromFile(t),a={type:nc.Photo,thumbnail:s,webPath:URL.createObjectURL(t),saved:!1};if(n){const d=await this._getImageResolution(t);a.metadata={format:i,resolution:d,size:t.size,creationDate:"lastModified"in t?new Date(t.lastModified).toISOString():new Date().toISOString()}}return a}_validateFileInput(t,n,i){if(!t.files||t.files.length===0){const s=t.multiple?"No files selected":"No file selected";return n(new Bs(s)),i(),!1}return!0}async _setupPWACameraModal(t,n,i,s,a){if(customElements.get("pwa-camera-modal")){const d=document.createElement("pwa-camera-modal");d.facingMode=t===ho.Front?"user":"environment",document.body.appendChild(d);try{await d.componentOnReady(),d.addEventListener("onPhoto",async r=>{const o=r.detail;o===null?a(new Bs("User cancelled photos app")):o instanceof Error?a(o):s(await n(o)),d.dismiss(),document.body.removeChild(d)}),d.present()}catch{i()}}else console.error("Unable to load PWA Element 'pwa-camera-modal'. See the docs: https://capacitorjs.com/docs/web/pwa-elements."),i()}_createFileInput(t){let n=document.querySelector(`#${t}`);return n||(n=document.createElement("input"),n.id=t,n.type="file",n.hidden=!0,document.body.appendChild(n)),n}async _getImageResolution(t){try{const n=await createImageBitmap(t),i=`${n.width}x${n.height}`;return n.close(),i}catch(n){console.warn("Failed to get image resolution:",n);return}}_getBase64FromFile(t){return new Promise((n,i)=>{const s=new FileReader;s.onloadend=()=>{const d=s.result.split(",")[1];n(d)},s.onerror=a=>{i(a)},s.readAsDataURL(t)})}_getVideoMetadata(t){return new Promise(n=>{const i=document.createElement("video");i.preload="metadata",i.muted=!0,i.onloadedmetadata=()=>{const s=Math.min(1,i.duration*.1);i.currentTime=s},i.onseeked=()=>{const s={resolution:`${i.videoWidth}x${i.videoHeight}`,duration:i.duration};try{const a=document.createElement("canvas");a.width=i.videoWidth,a.height=i.videoHeight;const d=a.getContext("2d");d&&(d.drawImage(i,0,0,a.width,a.height),s.thumbnail=a.toDataURL("image/jpeg",.8).split(",")[1])}catch(a){console.warn("Failed to generate video thumbnail:",a)}URL.revokeObjectURL(i.src),n(s)},i.onerror=()=>{URL.revokeObjectURL(i.src),n({})},i.src=URL.createObjectURL(t)})}async checkPermissions(){if(typeof navigator>"u"||!navigator.permissions)throw this.unavailable("Permissions API not available in this browser");try{return{camera:(await window.navigator.permissions.query({name:"camera"})).state,photos:"granted"}}catch{throw this.unavailable("Camera permissions are not available in this browser")}}async requestPermissions(){throw this.unimplemented("Not implemented on web.")}async pickLimitedLibraryPhotos(){throw this.unavailable("Not implemented on web.")}async getLimitedLibraryPhotos(){throw this.unavailable("Not implemented on web.")}}const kT=Ua("Camera",{web:()=>new CT});function gd(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function $_(e){return e.total_bytes<=0?0:Math.max(0,Math.min(100,Math.round(e.bytes/e.total_bytes*100)))}function xT(e){return e.total_bytes<=0?cn("terminal.loadingHistoryBytes",{bytes:gd(e.bytes)}):cn("terminal.loadingHistoryProgress",{pct:$_(e),bytes:gd(e.bytes),total:gd(e.total_bytes)})}function RT(){let e="idle",t=0;return{onProgress(n,i){if(n==="start"){t+=1,e="replaying";return}if(n==="chunk"){e="replaying";return}const s=t;e="draining";const a=()=>{t===s&&(e="idle")};i?i(a):a()},shouldForward:(n=!1)=>n||e==="idle"}}function TT(){var e;return typeof navigator>"u"?"other":(e=navigator.platform)!=null&&e.toLowerCase().includes("mac")?"mac":"other"}function ET(e){return e.code==="KeyC"||e.key.toLowerCase()==="c"}function Ma(e){if(typeof document>"u")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t),t.select();let n=!1;try{n=document.execCommand("copy")}finally{document.body.removeChild(t)}return n}function PT(e,t=TT()){return!ET(e)||e.altKey?!1:t==="mac"?e.metaKey&&!e.ctrlKey&&!e.shiftKey:e.ctrlKey&&e.shiftKey&&!e.metaKey}async function md(e,t=typeof navigator>"u"?void 0:navigator.clipboard,n=Ma){return xu(e.getSelection(),t,n)}async function xu(e,t=typeof navigator>"u"?void 0:navigator.clipboard,n=Ma){if(!e)return!1;if(t!=null&&t.writeText)try{return await t.writeText(e),!0}catch(i){try{if(n(e))return!0}catch{}throw i}return n(e)}const Op='Menlo, Monaco, Consolas, "Liberation Mono", "DejaVu Sans Mono", "PingFang SC", "Microsoft YaHei", "Noto Sans Mono CJK SC", monospace',LT=[{id:"",label:"System default"},{id:"SF Mono",label:"SF Mono"},{id:"JetBrains Mono",label:"JetBrains Mono"},{id:"Fira Code",label:"Fira Code"},{id:"Cascadia Code",label:"Cascadia Code"},{id:"Source Code Pro",label:"Source Code Pro"},{id:"IBM Plex Mono",label:"IBM Plex Mono"}];function Fp(e){const t=e.trim();return t?`${t.startsWith('"')?t:`"${t}"`}, ${Op}`:Op}const DT=3e3;function IT(e,t,n,i=DT){return!(n||e-t=n}function FT(e){const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),i=t%60;return`${n}m${i}s`}function O_(e){let t="";const n=[];for(let i=0;i=128&&s<=159?n.push(s):t+=e[i]}return{cleaned:t,dropped:n}}function Mr(e){switch(e){case"view":case"control":case"full":return e;default:return"full"}}function ic(e,t){return e==="attached"&&Mr(t)!=="view"}function BT(e){return!e.hasSelection||!e.isDriver?!1:ic(e.status,e.permission)}function HT(e,t,n,i,s=window.innerWidth,a=window.innerHeight){return{left:Math.min(Math.max(e,8),Math.max(8,s-n-8)),top:Math.min(Math.max(t,8),Math.max(8,a-i-8))}}function Hp(e){const{cleaned:t}=O_(e);if(!t)return null;const n=t.replace(/\r\n?|\n/g,"\r").replace(/\r+$/,"");return n?n+"\r":null}const _d=new Set,ka={emit(e,t){const n={id:crypto.randomUUID(),file:e,name:t||"clipboard-image"};for(const i of _d)try{i(n)}catch(s){Pt("paste","image bus handler threw",{error:xt(s)})}},on(e){return _d.add(e),()=>{_d.delete(e)}}};function NT(){var t;if(typeof navigator>"u")return"other";const e=((t=navigator.platform)==null?void 0:t.toLowerCase())??"";return e.includes("mac")?"mac":e.includes("linux")?"linux":"other"}function UT(e,t=NT()){return t!=="mac"&&t!=="linux"||!e.ctrlKey||e.metaKey||e.shiftKey||e.altKey?!1:e.code==="KeyV"||e.key.toLowerCase()==="v"}const zT={"clipboard has no text or image":"terminal.clipboardEmpty","clipboard image too large":"terminal.clipboardImageTooLarge","install xclip, wl-paste, or xsel to paste images":"terminal.clipboardImageToolsMissing"};function VT(e,t){const n=atob(e),i=Uint8Array.from(n,s=>s.charCodeAt(0));return new Blob([i],{type:t})}async function Np(e){if(!ic(e.status,e.remotePermission))return{ok:!1,reasonKey:"terminal.pasteSessionNotWritable"};const t=await(e.getPayload?e.getPayload():uk());if(t.kind==="text"&&t.text)return e.term.paste(t.text),{ok:!0,kind:"text"};if(t.kind==="image"&&t.content_type&&t.data_base64){if(Mr(e.remotePermission)==="control")return{ok:!1,reasonKey:"terminal.imagePasteRequiresFull"};const n=VT(t.data_base64,t.content_type),i=t.filename||"clipboard-image";return ka.emit(n,i),await e.conn.sendPasteImage(n,i),{ok:!0,kind:"image"}}if(t.reason){const n=zT[t.reason];return n?{ok:!1,reasonKey:n}:{ok:!1,reason:t.reason}}return{ok:!1,reasonKey:"terminal.clipboardEmpty"}}const yd=new Set,Ru={emit(e,t){const n={id:crypto.randomUUID(),name:e||"file",size:t};for(const i of yd)try{i(n)}catch(s){Pt("paste","file bus handler threw",{error:xt(s)})}},on(e){return yd.add(e),()=>{yd.delete(e)}}},KT=/^[A-Za-z0-9_@%+=:,./-]+$/;function WT(e){return e===""?"''":KT.test(e)?e:"'"+e.replace(/'/g,"'\\''")+"'"}const jT=10*1024*1024;async function qT(e){const t=e.maxBytes??jT,n=e.items.find(d=>d.kind==="file"&&d.type.startsWith("image/")),i=n??e.items.find(d=>d.kind==="file");if(!i)return"skipped";const s=i.getAsFile();if(!s)return"skipped";if(s.size>t)return Pt("paste","pasted file too large",{name:s.name,bytes:s.size}),"skipped";if(e.isLocalSession){const d=await e.getLocalPaths();if(d.length>0)return e.paste(d.map(WT).join(" ")),"path-injected"}if(n&&i===n)return await e.conn.sendPasteImage(s,s.name||"clipboard-image"),"image-sent";const a=s.name||"file";return e.onFileToast(a,s.size),await e.conn.sendPasteFile(s,a),"file-sent"}function YT(){return window.go.main.App.GetPasteboardFileURLs()}function GT(){return window.go.main.App.ReceivedFilesClearAll()}function XT(e){return window.go.main.App.ReceivedFilesClearSession(e)}function JT(e,t){return window.go.main.App.ReceivedFilesDelete(e,t)}function ZT(){return window.go.main.App.ReceivedFilesList()}function QT(){return window.go.main.App.ReceivedFilesOpenDir()}function eE(e){return window.go.main.App.TranslateOpenAIChat(e)}function sc(){var e;return typeof navigator>"u"?!1:((e=navigator.platform)==null?void 0:e.toLowerCase().includes("mac"))??!1}function Th(){return sc()?"Meta":"Control"}const tE="\x1B[I",nE="\x1B[O";function iE(e){return{handle(t){t===nE||t===tE||e.send(t)},dispose(){}}}function sE(e){return e.type!=="keydown"?!1:e.key==="Control"||e.key==="Meta"||e.key==="Alt"||e.key==="Shift"}function rE(e){e.attachCustomKeyEventHandler(t=>!sE(t))}const Up=/\b(https?|file):\/\/[^\s\x00-\x1f]+/g,zp=/(^|[\s(){}\[\]<>"'`])(~\/|\/)([^\s\x00-\x1f]*)/g,oE=new Set([".",",",";",":","!","?",'"',"'"]);function Vp(e){let t=e.length;for(;t>0;){const n=e[t-1];if(oE.has(n)){t--;continue}if(n===")"||n==="]"){const i=n===")"?"(":"[",s=Kp(e.slice(0,t-1),i),a=Kp(e.slice(0,t-1),n);if(s<=a){t--;continue}}break}return e.slice(0,t)}function Kp(e,t){let n=0;for(let i=0;ido.start)||t.push({start:d,end:r,text:a,kind:"path"})}return t.sort((i,s)=>i.start-s.start),t}function Wp(e,t){let n="";const i=[];let s=0;for(let a=0;aaE)return!1}return!0}function lE(e,t){const n=e.text;return e.kind==="http"||e.kind==="file"?n:n.startsWith("~/")||n==="~/"?t?`file://${t.replace(/\/+$/,"")}${n.slice(1)}`:null:`file://${n}`}function cE(e,t,n,i){let s="";const a=[],d=[];let r=0;for(let o=0;o0&&!c.isWrapped)break;r=o+1;for(let h=0;h[h.startCell,h.endCell]);let d=t;for(let h=0;hbl)||c.push({match:h,row:t,startCell:b,endCell:g})}u=m}}return[...s,...c].sort((h,u)=>h.startCell-u.startCell)}function dE(e,t,n,i){const s=[],a=Math.max(0,t-i+1);for(let d=a;d<=t;d++){const r=e.getLine(d);if(!r||r.isWrapped)continue;const o=Wp(r,n),c=/\((https?|file):\/\//g;let h;for(;(h=c.exec(o.text))!==null;){const u=h.index+1,v=jp(o.text,u),m=o.text.slice(u,v);if(!qp(m))for(const b of uE(o.text,h.index)){const g=[{row:d,mapped:o,start:u,end:v}];let l=m,f=!1;for(let k=d+1;k0&&!/\s/.test(I.text[b-1]))break;const S=jp(I.text,b),P=I.text.slice(b,S);if(g.push({row:k,mapped:I,start:b,end:S}),l+=P,qp(l)){f=!0;break}}if(!f)continue;const p=Eh(l).find(k=>k.start===0);if(!p||p.kind==="path"||p.end>=l.length)continue;const y=l.length-p.end,C=g[g.length-1];C.end-=y;for(const k of g)k.row!==t||k.end<=k.start||s.push({match:{...p,start:0,end:p.text.length},row:k.row,startCell:k.mapped.cellStart[k.start],endCell:k.mapped.cellStart[k.end]});break}}}return s}function jp(e,t){let n=t;for(;nn.start===0);return!!t&&t.end=0;a--)if(/\s/.test(e[a])){if(i++,i>=2){n=a+2;break}}else i=0,n=a;const s=[t];for(let a=t-1;a>=n;a--)!/\s/.test(e[a])&&(a===n||/\s/.test(e[a-1]))&&s.push(a);return s}const hE=50;function fE(e){const{term:t,isMac:n,openLink:i,onError:s}=e;let a=null;const d=h=>{a={x:h.clientX,y:h.clientY}},r=t.element;r==null||r.addEventListener("mousedown",d);const o={provideLinks(h,u){const v=t.buffer.active,m=B_(v,h-1,t.cols,hE);if(m.length===0){u(void 0);return}u(m.map(b=>pE(b.match,b.row+1,b.startCell+1,b.endCell,t,n,()=>a,i,s)))}};let c={dispose(){}};try{c=t.registerLinkProvider(o)}catch(h){Pt("term-link","registerLinkProvider failed",{error:xt(h)})}return{dispose(){r==null||r.removeEventListener("mousedown",d),c.dispose()}}}function pE(e,t,n,i,s,a,d,r,o){return{range:{start:{x:n,y:t},end:{x:i,y:t}},text:e.text,decorations:{underline:!0,pointerCursor:!0},activate:async c=>{if(F_(c,d())){c.preventDefault(),c.stopPropagation(),c.stopImmediatePropagation(),s.clearSelection();try{await r(e)}catch(h){Pt("term-link","openLink failed",{error:xt(h)}),o("terminal.link.openFailed")}}}}}const Yp=new WeakSet;function H_(e){var s,a,d,r;const t=(r=(d=(a=(s=e._core)==null?void 0:s._renderService)==null?void 0:a.dimensions)==null?void 0:d.css)==null?void 0:r.cell;if(t&&typeof t.width=="number"&&typeof t.height=="number"&&t.width>0&&t.height>0)return{width:t.width,height:t.height};Yp.has(e)||(Yp.add(e),Pt("term","terminalCellCoords: xterm renderer dimensions unavailable, using fontSize estimate. xterm internal API may have changed."));const n=e.options.fontSize??15,i=e.options.lineHeight??1;return{width:n*.6,height:n*i}}function bd(e,t,n,i,s=H_){const a=i.getBoundingClientRect();if(e=a.right||t=a.bottom)return null;const{width:d,height:r}=s(n);if(d<=0||r<=0)return null;const o=e-a.left,c=t-a.top+(i.scrollTop??0),h=Math.floor(o/d),u=Math.floor(c/r);return{col:h,row:u}}function vE(e,t){if(t<0)return{start:0,len:0};if(t>=e.length)return{start:e.length,len:0};const n=e[t];if(Ph(n))return{start:t,len:0};const i=gE(n);let s=t;for(;s>0&&Gp(e[s-1])===(i?"alnum":"punct");)s--;let a=t+1;for(;a?@[\\]^`{|}~".split(""));function gE(e){return!(Ph(e)||N_.has(e))}function Gp(e){return Ph(e)?"ws":N_.has(e)?"punct":"alnum"}async function mE(e,t,n){const i=[];for(const s of e)try{const a=s.getMenuItems(t,n);i.push(...a)}catch(a){Gi("plugin","context-menu getMenuItems threw",{error:xt(a)})}return i}const _E={id:"file-explorer",slot:"right-panel",titleKey:"plugins.fileExplorer.title",descriptionKey:"plugins.fileExplorer.description",load:()=>So(()=>import("./FileExplorer-BmPzqkbb.js").then(e=>e.d),__vite__mapDeps([0,1,2])),defaultEnabled:!1};function yE(e){return/[一-鿿]/.test(e)}function bE(e,t){return yE(e)&&t==="zh-CN"?"en":t}class Vi extends Error{constructor(t,n,i,s){super(n),this.code=t,this.httpStatus=i,this.providerBody=s,this.name="TranslateError"}}const wE=5,Lh=uh("translatePanel",()=>{const e=F(!1),t=F(""),n=F("zh-CN"),i=F(!1),s=F(null),a=F(null),d=F([]),r=Ng(null);let o=null;function c(l){r.value=l}function h(){e.value=!1}async function u(l){if(!r.value){e.value=!0,s.value={code:"unknown",message:cn("plugins.translate.notConfigured")};return}e.value=!0,t.value=l,n.value=bE(l,r.value.defaultTargetLang),b()}async function v(l){n.value=l,await b()}async function m(){await b()}async function b(){if(!r.value)return;s.value=null,a.value=null,i.value=!0,o==null||o.abort();const l=new AbortController;o=l;try{const f=await r.value.provider.translate(t.value,n.value,{signal:l.signal});if(l.signal.aborted)return;a.value=f,d.value=[{source:t.value,target:n.value,translated:f.translated,detectedSrcLang:f.detectedSrcLang,at:Date.now()},...d.value].slice(0,wE)}catch(f){if(f instanceof Vi&&f.code==="aborted")return;const p=f instanceof Vi?f.code:"unknown",y=f instanceof Error?f.message:String(f);s.value={code:p,message:y}}finally{o===l&&(i.value=!1)}}function g(l){t.value=l.source,n.value=l.target,a.value={translated:l.translated,detectedSrcLang:l.detectedSrcLang},s.value=null,e.value=!0}return{visible:e,source:t,targetLang:n,loading:i,error:s,result:a,history:d,configure:c,openWithSource:u,changeTarget:v,close:h,retry:m,restoreFromHistory:g}}),SE={getMenuItems(e,t){return!t||!t.trim()?[]:[{id:"translate-selection",label:cn("plugins.translate.selection"),onClick:()=>{Lh().openWithSource(t)}}]}},CE={id:"translate",slot:"context-menu",titleKey:"plugins.translate.title",descriptionKey:"plugins.translate.description",load:async()=>({default:SE}),defaultEnabled:!1},kE={getMenuItems:()=>[]},xE={id:"desk-widget",slot:"companion-window",titleKey:"plugins.deskWidget.title",descriptionKey:"plugins.deskWidget.description",load:async()=>({default:kE}),defaultEnabled:!1,desktopOnly:!0},U_=[_E,CE,xE];function z_(e){return U_.filter(t=>t.slot===e)}let Xp=null;const Yr=uh("pluginConfig",()=>{const e=F(null);async function t(){const a=fn();if(!a.pluginHost)throw new Error("plugin host unavailable");e.value=await a.pluginHost.getPluginConfig(),Xp||(Xp=a.events.on("plugin-config-changed",d=>{e.value=d}))}async function n(a){const d=fn();if(!d.pluginHost)throw new Error("plugin host unavailable");await d.pluginHost.setPluginConfig(a),e.value=a}function i(a){var d;return e.value?a==="file-explorer"?e.value.fileExplorer.enabled:a==="translate"?e.value.translate.enabled:a==="desk-widget"?((d=e.value.widget)==null?void 0:d.enabled)??!1:!1:!1}async function s(a,d){if(!e.value)return;const r=JSON.parse(JSON.stringify(e.value));a==="file-explorer"&&(r.fileExplorer.enabled=d),a==="translate"&&(r.translate.enabled=d),a==="desk-widget"&&r.widget&&(r.widget.enabled=d),await n(r)}return{cfg:e,load:t,save:n,isPluginEnabled:i,setEnabled:s}}),RE=[{id:"aux-up",label:"↑",seq:"\x1B[A"},{id:"aux-down",label:"↓",seq:"\x1B[B"},{id:"aux-left",label:"←",seq:"\x1B[D"},{id:"aux-right",label:"→",seq:"\x1B[C"},{id:"aux-enter",label:"enter",seq:"\r"},{id:"aux-esc",label:"esc",seq:"\x1B"},{id:"aux-tab",label:"tab",seq:" "},{id:"aux-ctrl-c",label:"⌃C",seq:""},{id:"aux-ctrl-d",label:"⌃D",seq:""}];async function TE(e){const t=await e.load();return t.length>0?t:RE}const EE=300,Bl=[];let Dh=!1;function PE(){try{const e=window.localStorage.getItem("atterm.debugTouch");return e==="1"||e==="true"}catch{return!1}}function LE(e){Dh=e}function ml(){return Dh}function wn(e,t={}){if(!Dh)return;const n={t:Date.now(),tag:e,data:t};Bl.push(n),Bl.length>EE&&Bl.shift();try{ss("touch-scroll",e,{data:JSON.stringify(t)})}catch{}}function DE(){try{window.__attermTouchDebug=()=>Bl.slice()}catch{}}const IE=Object.freeze([{id:"default-yes",label:"yes",text:"yes"},{id:"default-ok",label:"ok",text:"ok"},{id:"default-continue",label:"continue",text:"continue"},{id:"default-commit",label:"commit",text:"commit"},{id:"default-push",label:"push",text:"push"},{id:"default-release",label:"release",text:"release"},{id:"default-1",label:"1",text:"1"},{id:"default-2",label:"2",text:"2"},{id:"default-3",label:"3",text:"3"}]);async function V_(e){const t=await e.load();return t.length>0?t:IE}function ME(e){if(!e)return null;const t=e.split("+").map(d=>d.trim()).filter(Boolean);if(t.length<2)return null;let n=!1,i=!1,s=!1,a="";for(const d of t){const r=d.toLowerCase();r==="mod"||r==="cmd"||r==="meta"||r==="ctrl"||r==="control"?n=!0:r==="alt"||r==="option"?i=!0:r==="shift"?s=!0:a=d.toLowerCase()}return a?{mod:n,alt:i,shift:s,key:a}:null}function AE(e,t){const n=sc()?e.metaKey:e.ctrlKey;return t.mod!==n||t.alt!==e.altKey||t.shift!==e.shiftKey?!1:e.key.toLowerCase()===t.key}function $E(e){const{send:t,confirmRequired:n,focused:i,templatesBridge:s}=e,a=F([]),d=F(!1),r=F(null),o=W(()=>r.value!==null);function c(l){t(l.text),window.setTimeout(()=>t("\r"),16)}function h(l){if(!n.value){c(l);return}r.value=l}function u(){r.value=null}function v(){const l=r.value;r.value=null,l&&c(l)}function m(l){if(i())for(const f of a.value){const p=ME(f.hotkey||"");if(p&&AE(l,p)){l.preventDefault(),l.stopPropagation(),c(f);return}}}function b(l){const f=l.currentTarget;if(!f)return;const p=l.deltaY!==0?l.deltaY:l.deltaX;p!==0&&(f.scrollLeft+=p)}async function g(){const[l,f]=await Promise.all([V_(s),s.loadHidden()]);a.value=l,d.value=f}return{templates:a,templatesHidden:d,pendingTemplateConfirm:r,templateConfirmOpen:o,sendTemplate:c,requestTemplateSend:h,cancelTemplateSend:u,confirmTemplateSend:v,onTemplateHotkey:m,onTemplateBarWheel:b,reload:g}}const Hl=F(new Set);function OE(){return Hl}function Jp(e,t){if(!e)return;const n=Hl.value.has(e);if(t===n)return;const i=new Set(Hl.value);t?i.add(e):i.delete(e),Hl.value=i}const K_=uh("fileReveal",()=>{const e=F(null);function t(i){e.value=i}function n(){const i=e.value;return e.value=null,i}return{pending:e,request:t,consume:n}}),FE=["aria-label","aria-expanded","aria-activedescendant","disabled"],BE={class:"trigger-label"},HE={key:0,class:"menu","data-testid":"select-menu",role:"listbox"},NE=["id","aria-selected","onClick","onMouseenter"],UE={class:"option-label"},zE={key:0,class:"option-description"},VE=$e({__name:"SelectDropdown",props:{modelValue:{},options:{},disabled:{type:Boolean},ariaLabel:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=`select-dropdown-${Math.random().toString(36).slice(2,10)}`;function i(y){return`${n}-opt-${y}`}const s=e,a=t,d=F(!1),r=F(null),o=F(-1),c=W(()=>{const y=s.options.find(C=>C.value===s.modelValue);return y?y.label:""});function h(){return s.options.findIndex(y=>y.value===s.modelValue)}function u(){if(s.disabled)return;d.value=!0;const y=h();o.value=y>=0?y:0}function v(){d.value=!1,o.value=-1}function m(y){v(),y.value!==s.modelValue&&a("update:modelValue",y.value)}function b(y){if(s.options.length===0)return;const C=s.options.length,k=o.value<0?h():o.value,E=k<0?0:k;o.value=(E+y+C)%C}function g(){if(o.value<0)return;const y=s.options[o.value];y&&m(y)}function l(){s.disabled||(d.value?v():u())}function f(y){if(!s.disabled){if(y.key==="Escape"){d.value&&(y.preventDefault(),v());return}if(y.key==="ArrowDown"){y.preventDefault(),d.value?b(1):u();return}if(y.key==="ArrowUp"){y.preventDefault(),d.value?b(-1):u();return}if(y.key==="Home"&&d.value){y.preventDefault(),o.value=0;return}if(y.key==="End"&&d.value){y.preventDefault(),o.value=s.options.length-1;return}if(y.key==="Enter"&&d.value){y.preventDefault(),g();return}}}function p(y){if(!d.value)return;const C=y.target;r.value&&C&&r.value.contains(C)||v()}return wt(d,y=>{y?document.addEventListener("mousedown",p):document.removeEventListener("mousedown",p)}),Vt(()=>{document.removeEventListener("mousedown",p)}),(y,C)=>($(),O("div",{ref_key:"rootRef",ref:r,class:"select-dropdown"},[_("button",{type:"button",class:nt(["trigger",{"trigger-open":d.value}]),"data-testid":"select-trigger","aria-label":y.ariaLabel,"aria-haspopup":"listbox","aria-expanded":d.value?"true":"false","aria-activedescendant":d.value&&o.value>=0?i(o.value):void 0,disabled:y.disabled,onClick:l,onKeydown:f},[_("span",BE,T(c.value),1)],42,FE),d.value?($(),O("ul",HE,[($(!0),O(Me,null,st(y.options,(k,E)=>($(),O("li",{id:i(E),key:k.value,class:nt(["option",{"option-highlight":E===o.value,"option-selected":k.value===y.modelValue}]),"data-testid":"select-option",role:"option","aria-selected":k.value===y.modelValue?"true":"false",onClick:I=>m(k),onMouseenter:I=>o.value=E},[_("span",UE,T(k.label),1),k.description?($(),O("span",zE,T(k.description),1)):Q("",!0)],42,NE))),128))])):Q("",!0)],512))}}),qn=kt(VE,[["__scopeId","data-v-65a81c06"]]),KE={class:"sp-seg"},WE=["title"],jE={key:0,class:"sp-actions"},qE=["title","aria-label"],YE=["title","aria-label"],GE=["title","aria-label"],XE={key:1,class:"sp-menu",role:"menu"},JE=["onClick"],ZE={class:"sp-lbl"},QE=["title","onClick"],e5=["title","onClick"],t5=["title","onClick"],n5=$e({__name:"ServicePreviewSwitcher",props:{previews:{},activeId:{}},emits:["show-terminal","select","close","add","open-browser","copy"],setup(e,{emit:t}){const n=e,i=t,{t:s}=Ot(),a=F(!1),d=F(null),r=W(()=>n.previews.find(b=>b.id===n.activeId)??null),o=W(()=>n.activeId!==null&&r.value!==null);function c(){a.value=!a.value}function h(){a.value=!1}function u(b){i("select",b),h()}function v(){h(),i("add")}function m(b){var g,l;a.value&&!((l=(g=b.target)==null?void 0:g.closest)!=null&&l.call(g,".sp-switcher"))&&h()}return It(()=>document.addEventListener("click",m,!0)),Vt(()=>document.removeEventListener("click",m,!0)),(b,g)=>{var l,f,p,y,C;return $(),O("div",{ref_key:"rootRef",ref:d,class:"sp-switcher"},[_("div",KE,[_("button",{type:"button",class:nt({active:!o.value}),onClick:g[0]||(g[0]=k=>i("show-terminal"))},T(w(s)("terminal.preview.terminal")),3),_("button",{type:"button",class:nt(["sp-current",{active:o.value,reconnecting:(l=r.value)==null?void 0:l.reconnecting}]),title:(f=r.value)!=null&&f.reconnecting?w(s)("terminal.preview.reconnecting"):w(s)("terminal.preview.switch"),onClick:c},[_("span",{class:nt(["sp-dot",{reconnecting:(p=r.value)==null?void 0:p.reconnecting}])},null,2),et(" "+T(w(s)("terminal.preview.previewPort",{port:((y=r.value)==null?void 0:y.port)??((C=b.previews[0])==null?void 0:C.port)??""}))+" ",1),g[4]||(g[4]=_("span",{class:"sp-caret"},"▾",-1))],10,WE)]),o.value?($(),O("div",jE,[_("button",{type:"button",title:w(s)("terminal.preview.openInBrowser"),"aria-label":w(s)("terminal.preview.openInBrowser"),onClick:g[1]||(g[1]=k=>i("open-browser"))},g[5]||(g[5]=[_("span",{class:"sp-ico"},[_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),_("path",{d:"M8 12h8M12 8l4 4-4 4"})])],-1)]),8,qE),_("button",{type:"button",title:w(s)("terminal.preview.copyURL"),"aria-label":w(s)("terminal.preview.copyURL"),onClick:g[2]||(g[2]=k=>i("copy"))},g[6]||(g[6]=[_("span",{class:"sp-ico"},[_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),_("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})])],-1)]),8,YE),_("button",{type:"button",class:"close",title:w(s)("terminal.preview.closeThis"),"aria-label":w(s)("terminal.preview.closeThis"),onClick:g[3]||(g[3]=k=>r.value&&i("close",r.value.id))},"✕",8,GE)])):Q("",!0),a.value?($(),O("div",XE,[($(!0),O(Me,null,st(b.previews,k=>($(),O("button",{key:k.id,type:"button",class:nt(["sp-item",{active:k.id===b.activeId}]),onClick:E=>u(k.id)},[_("span",{class:nt(["sp-dot",{reconnecting:k.reconnecting}])},null,2),_("span",ZE,T(w(s)("terminal.preview.previewPort",{port:k.port})),1),_("span",{class:"sp-mini",title:w(s)("terminal.preview.openInBrowser"),onClick:pt(E=>{u(k.id),i("open-browser")},["stop"])},g[7]||(g[7]=[_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),_("path",{d:"M8 12h8M12 8l4 4-4 4"})],-1)]),8,QE),_("span",{class:"sp-mini",title:w(s)("terminal.preview.copyURL"),onClick:pt(E=>{u(k.id),i("copy")},["stop"])},g[8]||(g[8]=[_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),_("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})],-1)]),8,e5),_("span",{class:"sp-x",title:w(s)("terminal.preview.closeThis"),onClick:pt(E=>i("close",k.id),["stop"])},"✕",8,t5)],10,JE))),128)),g[9]||(g[9]=_("div",{class:"sp-sep"},null,-1)),_("button",{type:"button",class:"sp-item sp-add",onClick:v},"+ "+T(w(s)("terminal.preview.newPreview")),1)])):Q("",!0)],512)}}}),i5=kt(n5,[["__scopeId","data-v-c9d59669"]]),s5=["aria-label"],r5=["disabled"],o5=["disabled"],a5=["aria-label"],l5=$e({__name:"TerminalSelectionPopover",props:{visible:{type:Boolean},x:{},y:{},arrowDir:{},copying:{type:Boolean},sending:{type:Boolean}},emits:["copy","send","cancel"],setup(e){const t=e,{t:n}=Ot(),i=W(()=>{const s=`left: ${t.x}px;`;return t.arrowDir==="down"?`${s} bottom: ${t.y}px;`:`${s} top: ${t.y}px;`});return(s,a)=>s.visible?($(),O("div",{key:0,class:nt(["popover",[`arrow-${s.arrowDir}`]]),style:Gt(i.value),"data-testid":"selection-popover",role:"group","aria-label":w(n)("mobile.selection.copy")+" / "+w(n)("mobile.selection.send"),onPointerdown:a[3]||(a[3]=pt(()=>{},["stop"])),onPointerup:a[4]||(a[4]=pt(()=>{},["stop"])),onClick:a[5]||(a[5]=pt(()=>{},["stop"]))},[_("button",{type:"button",class:"btn",disabled:s.copying,"data-testid":"selection-popover-copy",onClick:a[0]||(a[0]=d=>s.$emit("copy"))},T(w(n)("mobile.selection.copy")),9,r5),_("button",{type:"button",class:"btn send",disabled:s.sending,"data-testid":"selection-popover-send",onClick:a[1]||(a[1]=d=>s.$emit("send"))},T(w(n)("mobile.selection.send")),9,o5),_("button",{type:"button",class:"btn cancel","aria-label":w(n)("mobile.selection.cancel"),"data-testid":"selection-popover-cancel",onClick:a[2]||(a[2]=d=>s.$emit("cancel"))},"x",8,a5)],46,s5)):Q("",!0)}}),c5=kt(l5,[["__scopeId","data-v-063a4cb7"]]),d5={key:0,class:"term-search","data-test":"terminal-search"},u5=["placeholder"],h5={class:"term-search-count","data-test":"terminal-search-count"},f5=["title","aria-label","disabled"],p5=["title","aria-label","disabled"],v5=["title","aria-label"],g5=$e({__name:"TerminalSearchBar",props:{open:{type:Boolean},focusSeq:{},resultIndex:{},resultCount:{}},emits:["find","close"],setup(e,{emit:t}){const n=e,i=t,{t:s}=Ot(),a=F(""),d=F(null);function r(){hn(()=>{var v,m;(v=d.value)==null||v.focus(),(m=d.value)==null||m.select()})}function o(){a.value&&i("find",a.value,"next",!0)}wt(()=>n.open,v=>{v&&(r(),o())}),wt(()=>n.focusSeq,()=>{n.open&&(r(),o())});function c(){i("find",a.value,"next",!0)}function h(v){i("find",a.value,v,!1)}function u(v){if(v.key==="Escape"){v.preventDefault(),i("close");return}v.key==="Enter"&&(v.preventDefault(),h(v.shiftKey?"prev":"next"))}return(v,m)=>v.open?($(),O("div",d5,[ct(_("input",{ref_key:"inputEl",ref:d,"onUpdate:modelValue":m[0]||(m[0]=b=>a.value=b),class:"term-search-input","data-test":"terminal-search-input",type:"text",spellcheck:"false",autocomplete:"off",placeholder:w(s)("terminal.search.placeholder"),onInput:c,onKeydown:u},null,40,u5),[[Et,a.value]]),_("span",h5,T(v.resultCount>0?v.resultIndex>=0?`${v.resultIndex+1}/${v.resultCount}`:`${v.resultCount}+`:a.value?w(s)("terminal.search.noResults"):""),1),_("button",{class:"term-search-btn","data-test":"terminal-search-prev",title:w(s)("terminal.search.prev"),"aria-label":w(s)("terminal.search.prev"),disabled:v.resultCount===0,onClick:m[1]||(m[1]=b=>h("prev"))},"↑",8,f5),_("button",{class:"term-search-btn","data-test":"terminal-search-next",title:w(s)("terminal.search.next"),"aria-label":w(s)("terminal.search.next"),disabled:v.resultCount===0,onClick:m[2]||(m[2]=b=>h("next"))},"↓",8,p5),_("button",{class:"term-search-btn","data-test":"terminal-search-close",title:w(s)("terminal.search.close"),"aria-label":w(s)("terminal.search.close"),onClick:m[3]||(m[3]=b=>i("close"))},"×",8,v5)])):Q("",!0)}}),m5=kt(g5,[["__scopeId","data-v-302a13f7"]]),_5=["src","title"],y5={key:0,class:"service-preview-reconnecting",role:"status"},b5={class:"service-preview-controls"},w5={class:"service-preview-mapping-row root-mapping"},S5=["aria-label","onKeydown"],C5=["onUpdate:modelValue","aria-label"],k5=["onUpdate:modelValue","aria-label"],x5=["title","aria-label","onClick"],R5={class:"service-preview-form-actions"},T5=["disabled"],E5=["disabled"],P5={class:"progress-track","aria-hidden":"true"},L5={key:1},D5={key:2,class:"warn"},I5={key:3,class:"dim"},M5={key:4,class:"bad"},A5=["title"],$5={key:4,class:"viewer-overlay","aria-live":"polite"},O5={class:"viewer-overlay-card"},F5={class:"viewer-overlay-title"},B5={key:0,class:"viewer-overlay-host"},H5={class:"viewer-overlay-hint"},N5=["disabled"],U5=["disabled"],z5=["disabled"],V5=["disabled"],K5=["disabled","onClick"],W5=["data-testid","title","onTouchend","onClick"],j5=["title"],q5=["data-testid","disabled","onTouchend","onPointerup"],Y5=["disabled"],G5=["disabled"],X5=["disabled"],J5={class:"template-confirm-copy"},Z5={class:"template-confirm-label"},Q5={class:"template-confirm-text"},eP=["placeholder"],tP=["disabled"],nP=500,Zp=8,Qp=4,ev=24,iP=3,sP=60,rP=800,oP=500,tv=800,aP=350,lP=900,Qs=10,cP=150,dP=150,uP=$e({__name:"TerminalView",props:{endpoint:{},directEndpoint:{},preferDirect:{type:Boolean},sessionId:{},active:{type:Boolean,default:!0},focused:{type:Boolean,default:!1},avoidTopRightBadge:{type:Boolean,default:!1},sessionLabel:{},expectedCols:{},expectedRows:{},remotePermission:{},theme:{},commandNotifyThresholdSec:{default:10},isLocalSession:{type:Boolean,default:!0},canDetach:{type:Boolean},resizeSuspended:{type:Boolean,default:!1},searchRequestSeq:{default:0},appearance:{default:()=>({fontHead:"",fontSize:13,lineHeight:1,cursorStyle:"block",cursorBlink:!0,scrollback:5e3})}},emits:["toast","detach"],setup(e,{emit:t}){const n=e,i=t,{t:s}=Ot(),a=F(null),d=F("connecting"),r=F(null),o=F({route:"relay"}),c=W(()=>{switch(o.value.route){case"connecting-direct":return s("terminal.route.connectingDirect");case"direct":return s("terminal.route.direct");default:return s("terminal.route.relay")}});function h(X){switch(X){case"account_key_unavailable":return s("terminal.route.fallback.accountKeyUnavailable");case"signal_endpoint_unavailable":return s("terminal.route.fallback.signalEndpointUnavailable");case"webrtc_unavailable":return s("terminal.route.fallback.webrtcUnavailable");case"timeout":return s("terminal.route.fallback.timeout");case"signaling_rejected":return s("terminal.route.fallback.signalingRejected");case"host_unavailable":return s("terminal.route.fallback.hostUnavailable");case"ice_failed":return s("terminal.route.fallback.iceFailed");case"authentication_failed":return s("terminal.route.fallback.authenticationFailed");case"backpressure":return s("terminal.route.fallback.backpressure");case"protocol_error":return s("terminal.route.fallback.protocolError");case"direct_disconnected":return s("terminal.route.fallback.directDisconnected");case"preference_disabled":return s("terminal.route.fallback.preferenceDisabled");default:return s("terminal.route.fallback.transportError")}}const u=W(()=>{const X=o.value,ie=[s("terminal.route.current",{route:c.value})];return X.iceState&&ie.push(s("terminal.route.iceState",{state:X.iceState})),X.candidateType&&ie.push(s("terminal.route.candidateType",{type:X.candidateType})),X.setupTimeMs!==void 0&&ie.push(s("terminal.route.setupTime",{ms:X.setupTimeMs})),X.fallbackReason&&ie.push(s("terminal.route.fallbackReason",{reason:h(X.fallbackReason)})),ie.join(` +`)}),v=F(!1),m=F(0),b=F(0),g=F(!1),l=F(!1),f=F(null),p=F(null),y=F(null),C=F(!1),k=F(""),E=F(n.isLocalSession??!0),I=F(null),S=F(null),P=F(null),A=F(null),L=F(""),x=F(""),D=F([]),M=F(!1),B=F(!1),z=F(!1),Y=W(()=>B.value||z.value),U=W(()=>!Y.value),N=F("idle"),V=F({visible:!1,x:0,y:0,arrowDir:"down",copying:!1,sending:!1}),j=fn(),G=j.system.setClipboardText?{writeText:X=>j.system.setClipboardText(X)}:void 0,te=K_(),se=F(!1),oe=F([]),Fe=F(null),K=W(()=>Fe.value!==null),Z=W(()=>oe.value.find(X=>X.id===Fe.value)??null);let J=null;wt(()=>oe.value.length>0,X=>Jp(n.sessionId,X));const ae=F(!1),Ie=F("3000"),de=F([]),Le=F("127.0.0.1"),xe=[{value:"127.0.0.1",label:"127.0.0.1 (IPv4)"},{value:"localhost",label:"localhost"},{value:"::1",label:"::1 (IPv6)"}],Qe=F(null),De=W(()=>`#service-preview-controls-${n.sessionId}`),ne=W(()=>`#session-route-indicator-${n.sessionId}`),ue=W(()=>`atterm.service-preview.${n.sessionId}`);function he(){var X;try{const ie=localStorage.getItem(ue.value);if(!ie)return;const ze=JSON.parse(ie);typeof ze.port=="string"&&(Ie.value=ze.port),(ze.host==="localhost"||ze.host==="127.0.0.1"||ze.host==="::1")&&(Le.value=ze.host),((X=j.servicePreview)==null?void 0:X.supportsMappings)!==!1&&Array.isArray(ze.mappings)&&(de.value=ze.mappings.filter(bt=>typeof bt.port=="string"&&typeof bt.pathPrefix=="string").slice(0,7).map(bt=>({port:bt.port,pathPrefix:bt.pathPrefix})))}catch{}}function Ae(){try{localStorage.setItem(ue.value,JSON.stringify({port:Ie.value,host:Le.value,mappings:de.value}))}catch{}}let ce=null,Je=null,ye=null,_e=null;const Ce=F(!1),Be=F(0),Se=F(-1),R=F(0);let we=null,ht=null,Ne=!0,ot=null;const Rt=RT(),at=zt("atterm:pluginInputSenders",null),gt=zt("atterm:pluginSessionConnections",null),re=zt("atterm:pluginContext",null),me=F([]),je=F(null);let it=null,dt=null,be="",Ve=null,Xe=null,pe=null,Ge=null,_t=null,Te=null,Ye=null,ft=null,Dt=0,Yt=0,jt=0,Xt=-1/0,Ln=0,On=0,rn=[],on=[],Cn=null,mn=!1;function Ut(){var X,ie;return{selMode:N.value,imeFocused:B.value,softKeyboardOpen:Y.value,softKeyboardOpening:z.value,keyboardWanted:M.value,userScrolledDuringKeyboardCycle:mn,scrollTop:(Ge==null?void 0:Ge.scrollTop)??null,scrollHeight:(Ge==null?void 0:Ge.scrollHeight)??null,clientHeight:(Ge==null?void 0:Ge.clientHeight)??null,activeEl:((X=document.activeElement)==null?void 0:X.className)||((ie=document.activeElement)==null?void 0:ie.tagName)||null}}const nn=[80,180,360,700],Ft=[60,180,360];let an=null,ln=null;function bi(){return Ne&&ce!==null&&a.value!==null}const hi=W(()=>ic(d.value,n.remotePermission)),fi=W(()=>BT({hasSelection:g.value,status:d.value,permission:n.remotePermission,isDriver:E.value})),ei=W(()=>d.value==="attached"&&E.value&&!n.resizeSuspended&&Mr(n.remotePermission)!=="view"),Ee=W(()=>!j.caps.wailsBindings&&!j.caps.localPty&&D.value.length>0),Ze=W(()=>E.value&&ic(d.value,n.remotePermission)),mt=W(()=>Ze.value&&Mr(n.remotePermission)==="full"),At=W(()=>!!(j.servicePreview&&!n.isLocalSession&&E.value&&d.value==="attached"&&Mr(n.remotePermission)==="full")),Zt=W(()=>{var X;return((X=j.servicePreview)==null?void 0:X.supportsMappings)!==!1}),Kt=W(()=>K.value?0:(cf.value?0:1)+(Ee.value?1:0)),Hn=W(()=>`${Kt.value*30}px`),Yn=W(()=>Ee.value?"30px":"0");function _n(){E.value&&(ce==null||ce.focus())}function ti(X){X.reconnectTimer!==null&&(window.clearTimeout(X.reconnectTimer),X.reconnectTimer=null),X.reconnecting=!1}async function Bi(X,ie){var qe;const ze=(qe=j.servicePreview)==null?void 0:qe.rebind;if(!ze)return;const bt=[500,1e3,2e3,4e3,8e3],Lt=oe.value.find(yt=>yt.id===X);if(Lt){Lt.reconnecting=!0;for(let yt=0;;yt++){const lt=oe.value.find(Wt=>Wt.id===X);if(!Ne||!lt||ie<0||ie>=lt.ports.length){lt&&ti(lt);return}if(!we||!At.value){await Hi(X);return}try{const Wt=await we.openService(lt.ports[ie],lt.host);if(!Ne||!oe.value.includes(lt)){we.closeService(Wt.serviceId),ti(lt);return}await ze({gatewayId:X,mappingIndex:ie,serviceId:Wt.serviceId,clientTicket:Wt.clientTicket,clientToHostKey:Wt.clientToHostKey,hostToClientKey:Wt.hostToClientKey}),lt.serviceIds[ie]=Wt.serviceId,ti(lt);return}catch(Wt){const oi=xt(Wt);if(oi.includes("preview_gone")||oi.includes("relay is not connected")){await Hi(X);return}const ts=bt[Math.min(yt,bt.length-1)];await new Promise(Qr=>{lt.reconnectTimer=window.setTimeout(Qr,ts)})}}}}async function Hi(X){var bt,Lt;const ie=oe.value.findIndex(qe=>qe.id===X);if(ie<0)return;const[ze]=oe.value.splice(ie,1);ti(ze),Fe.value===X&&(Fe.value=((bt=oe.value[0])==null?void 0:bt.id)??null);for(const qe of ze.serviceIds)we==null||we.closeService(qe);try{await((Lt=j.servicePreview)==null?void 0:Lt.stop(ze.id))}catch(qe){ss("service-preview","stop failed",{error:xt(qe)})}await hn(),K.value||es()}async function Ni(){const X=oe.value.slice();for(const ie of X)await Hi(ie.id)}function Ei(){if(!se.value){if(!j.servicePreview){i("toast",s("terminal.preview.desktopOnly"));return}if(d.value!=="attached"){i("toast",s("terminal.preview.requiresConnection"));return}if(!E.value){i("toast",s("terminal.preview.requiresDriver"));return}if(Mr(n.remotePermission)!=="full"){i("toast",s("terminal.preview.requiresFullPermission"));return}n.isLocalSession||(ae.value=!0,hn(()=>{var X,ie;(X=Qe.value)==null||X.focus(),(ie=Qe.value)==null||ie.select()}))}}function cs(X,ie){const ze=X.trim();if(ie)return ze===""||ze==="/"?"":null;if(!ze.startsWith("/")||ze.includes("?")||ze.includes("#"))return null;const bt=ze.replace(/\/+$/,""),Lt=bt.split("/");return bt===""||Lt.slice(1).some(qe=>qe===""||qe==="."||qe==="..")?null:bt}function ds(){ae.value=!1,_n()}function wr(X){(X==="localhost"||X==="127.0.0.1"||X==="::1")&&(Le.value=X)}async function Sr(){if(!At.value||!we||!j.servicePreview||se.value)return;const X=[{port:Ie.value.trim(),pathPrefix:""},...de.value.map(yt=>({port:yt.port.trim(),pathPrefix:yt.pathPrefix.trim()}))],ie=X.map(yt=>Number(yt.port));if(ie.some(yt=>!Number.isInteger(yt)||yt<1||yt>65535)){i("toast",s("terminal.preview.invalidPort")),hn(()=>{var yt;return(yt=Qe.value)==null?void 0:yt.select()});return}const ze=X.map((yt,lt)=>cs(yt.pathPrefix,lt===0));if(ze.some(yt=>yt===null)||new Set(ze).size!==ze.length){i("toast",s("terminal.preview.invalidPathPrefix"));return}const bt=ze;de.value.forEach((yt,lt)=>{yt.pathPrefix=bt[lt+1]});const Lt=oe.value.find(yt=>yt.port===ie[0]&&yt.host===Le.value);if(Lt){Fe.value=Lt.id,ae.value=!1;return}se.value=!0;const qe=[];try{for(const lt of ie){const Wt=await we.openService(lt,Le.value);if(qe.push(Wt),!Ne||!At.value)throw we.closeService(Wt.serviceId),new Error(s("terminal.preview.noLongerAllowed"))}const yt=await j.servicePreview.start({mappings:qe.map((lt,Wt)=>({serviceId:lt.serviceId,clientTicket:lt.clientTicket,clientToHostKey:lt.clientToHostKey,hostToClientKey:lt.hostToClientKey,port:ie[Wt],pathPrefix:bt[Wt]||void 0}))});if(Ae(),!Ne||!At.value){for(const lt of qe)we.closeService(lt.serviceId);throw await j.servicePreview.stop(yt.id),new Error(s("terminal.preview.noLongerAllowed"))}oe.value.push({id:yt.id,url:yt.url,port:ie[0],serviceIds:qe.map(lt=>lt.serviceId),ports:ie,prefixes:bt,host:Le.value,reconnecting:!1,reconnectTimer:null}),Fe.value=yt.id,ae.value=!1}catch(yt){for(const lt of qe)we==null||we.closeService(lt.serviceId);i("toast",s("terminal.preview.openFailed",{error:xt(yt)}))}finally{se.value=!1}}function Cr(X){oe.value.some(ie=>ie.id===X)&&(Fe.value=X)}function us(){Fe.value=null,hn(()=>es())}async function Wo(){var ie;const X=(ie=Z.value)==null?void 0:ie.url;if(X)try{await j.system.openExternalURL(X)}catch(ze){Pt("service-preview","open external browser failed",{error:xt(ze)}),i("toast",s("terminal.preview.browserOpenFailed"))}}async function jo(){var ie;const X=(ie=Z.value)==null?void 0:ie.url;if(X)try{if(!await xu(X,G))throw new Error("clipboard unavailable");i("toast",s("terminal.preview.urlCopied"))}catch(ze){Pt("service-preview","copy preview URL failed",{error:xt(ze)}),i("toast",s("terminal.preview.copyFailed"))}}function Ws(){(j.caps.wailsBindings||j.caps.localPty||M.value)&&_n()}function js(){ce&&(ce.options.disableStdin=!E.value),pe&&(pe.readOnly=!E.value,pe.tabIndex=E.value?0:-1,E.value||(wi(),z.value=!1,M.value=!1,document.activeElement===pe&&(pe.blur(),ce==null||ce.blur())))}function kr(){const X=ce==null?void 0:ce.buffer.active;return X?{viewportY:X.viewportY,atBottom:X.viewportY>=X.baseY}:null}function Gr(X){if(wn("applyScrollPosition:entry",{scrollPosition:X,...Ut()}),!!X&&!(!ce||!Ne)){if(mn){wn("applyScrollPosition:bailUserScrolled");return}X.atBottom?(wn("applyScrollPosition:scrollToBottom"),ce.scrollToBottom()):(wn("applyScrollPosition:scrollToLine",{line:X.viewportY}),ce.scrollToLine(X.viewportY))}}function Pi(){wn("onViewportUserScrollIntent",{...Ut()}),mn=!0,Ps(),Cn=null}function Es(X){var ie;wn("onTermTouchMoveForRestoreCancel",{touches:X.touches.length,y:(ie=X.touches[0])==null?void 0:ie.pageY,...Ut()}),Pi()}function Ps(){for(const X of on)window.clearTimeout(X);on=[]}function wi(){for(const X of rn)window.clearTimeout(X);rn=[]}function Xi(){Gr(Cn)}function Si(X){if(!X)return;Ps(),Cn=X;const ie=nn[nn.length-1];requestAnimationFrame(()=>{requestAnimationFrame(()=>{Xi()})});for(const ze of nn)on.push(window.setTimeout(()=>{Xi(),ze===ie&&(Cn=null,on=[])},ze))}function ni(){var ie,ze;const X=kr();wi(),z.value=!1,M.value=!1,pe==null||pe.blur(),ce==null||ce.blur(),(ze=(ie=j.system).hideSoftKeyboard)==null||ze.call(ie),mn=!1,Si(X)}function hs(){if(wn("scrollToBottomForKeyboardOpen:entry",{...Ut()}),!!ce){if(mn){wn("scrollToBottomForKeyboardOpen:bailUserScrolled");return}ce.scrollToBottom(),Si({viewportY:ce.buffer.active.baseY,atBottom:!0})}}function Ls(){E.value&&(mn=!1,M.value=!0,Ui(),hs(),_n())}function Ui(){wi(),z.value=!0;for(const X of Ft)rn.push(window.setTimeout(()=>{M.value&&(B.value||_n(),hs())},X));rn.push(window.setTimeout(()=>{z.value=!1,B.value||(M.value=!1),rn=[]},lP))}function En(){jt=Date.now()}function xr(X){if(!ln)return 0;const ie=X.clientX-ln.startX,ze=X.clientY-ln.startY;return ie*ie+ze*ze}function Ji(X){En();const ie=X.touches[0];ln=ie?{startX:ie.clientX,startY:ie.clientY,cancelled:!1,scrollTarget:null,startScrollLeft:0}:null}function Ds(X){if(Ji(X),!ln)return;const ie=X.currentTarget instanceof Element?X.currentTarget.closest(".aux-key-scroll"):null;ie instanceof HTMLElement&&(ln.scrollTarget=ie,ln.startScrollLeft=ie.scrollLeft)}function pi(X){if(!ln)return;const ie=X.touches[0];if(!ie)return;const ze=ln.scrollTarget;ze&&(ze.scrollLeft=ln.startScrollLeft+ln.startX-ie.clientX),xr(ie)>Qs*Qs&&(ln.cancelled=!0)}function ii(){ln=null}function qo(X){const ie=X.changedTouches[0],ze=ln!==null&&!ln.cancelled&&(!ie||xr(ie)<=Qs*Qs);return ln=null,ze}function vi(X,ie){En(),qo(X)&&(X.preventDefault(),Ln=Date.now()+tv,ie())}function Li(X){Date.now()Qs*Qs&&(an.cancelled=!0)}function Nt(X){X&&X.stopPropagation(),an=null}function qs(X){!an||an.pointerId!==X.pointerId||Nt(X)}function si(X){if(!an||an.pointerId!==X.pointerId)return!1;if(X.preventDefault(),X.stopPropagation(),Date.now()-Onyt.kind==="file"))return;X.preventDefault(),X.stopPropagation();const bt=ce,Lt=we;if(!(!bt||!Lt))try{await qT({items:ie,isLocalSession:n.isLocalSession??!0,conn:{sendPasteImage:(yt,lt)=>(ka.emit(yt,lt),Lt.sendPasteImage(yt,lt)),sendPasteFile:(yt,lt)=>Lt.sendPasteFile(yt,lt)},paste:yt=>bt.paste(yt),getLocalPaths:async()=>{try{return await YT()??[]}catch(yt){return Pt("term","GetPasteboardFileURLs failed",{error:xt(yt)}),[]}},onFileToast:(yt,lt)=>Ru.emit(yt,lt)})}catch(yt){Pt("term","paste dispatch failed",{error:xt(yt)})}}function Go(X){if(j.caps.wailsBindings||j.caps.localPty||X.inputType!=="insertText"||X.isComposing)return;const ie=X.data;if(!ie||!Ze.value)return;X.stopImmediatePropagation(),we==null||we.sendInput(ie);const ze=X.target;ze&&"value"in ze&&(ze.value="")}function Tr(X){if(wn("onImeFocus",{keyboardWanted:M.value,isDriver:E.value}),B.value=!0,E.value){M.value&&hs();return}const ie=X.target;ie==null||ie.blur(),ce==null||ce.blur()}function Ya(){if(wn("onImeBlur",{keyboardWanted:M.value}),B.value=!1,M.value&&Rr()){Ui();return}M.value&&z.value||(M.value=!1)}function Ga(X){return!(j.caps.wailsBindings||j.caps.localPty||X.pointerType==="mouse")}function jc(X){return j.caps.wailsBindings||j.caps.localPty?!1:X.touches.length>0}function Xa(X){return!(j.caps.wailsBindings||j.caps.localPty||!Y.value||X.pointerType==="mouse")}function qc(X){var bt,Lt;wn("onTermPointerDown:entry",{pointerType:X.pointerType,y:X.clientY,target:((bt=X.target)==null?void 0:bt.className)||((Lt=X.target)==null?void 0:Lt.tagName)||null,...Ut()});const ie=Xa(X),ze=Ga(X);if(wn("onTermPointerDown:decision",{shouldHideKeyboard:ie,shouldBlockFocus:ze}),(ie||ze)&&(Yt=Date.now()),B.value&&pe&&document.activeElement===pe){ie&&(X.preventDefault(),X.stopPropagation(),ni(),Xo(X));return}if(ie){X.preventDefault(),X.stopPropagation(),ni(),Xo(X);return}ze&&(X.preventDefault(),X.stopPropagation()),Xo(X)}function Ja(X){var ie,ze,bt;if(wn("onTermTouchStart:entry",{touches:X.touches.length,y:(ie=X.touches[0])==null?void 0:ie.pageY,target:((ze=X.target)==null?void 0:ze.className)||((bt=X.target)==null?void 0:bt.tagName)||null,...Ut()}),!jc(X)){wn("onTermTouchStart:earlyReturn:!shouldBlockTerminalTouchFocus");return}if(Yt=Date.now(),!Y.value){wn("onTermTouchStart:earlyReturn:!softKeyboardOpen");return}wn("onTermTouchStart:hideKeyboardBranch",{...Ut()}),X.preventDefault(),ni()}function Is(X){X.button===0&&(Ve={x:X.clientX,y:X.clientY}),!(j.caps.wailsBindings||j.caps.localPty)&&(Date.now()-Yt>rP||(X.preventDefault(),X.stopPropagation()))}function Za(X){X.stopPropagation()}function fs(){_t&&(clearTimeout(_t),_t=null)}function Yc(X){var bt,Lt;if(Ge&&document.contains(Ge))return Ge;const ie=X==null?void 0:X.target;return Ge=((bt=ie==null?void 0:ie.closest)==null?void 0:bt.call(ie,".xterm-viewport"))??((Lt=a.value)==null?void 0:Lt.querySelector(".xterm-viewport"))??null,Ge}function Zi(){if(ce){try{ce.clearSelection()}catch{}js()}Ge&&(Ge.style.touchAction="pan-y"),V.value.visible=!1,N.value="idle",fs(),Te=null,Ye=null,Gs()}function Gc(X){if(!ce||!Ge)return null;const{width:ie,height:ze}=H_(ce);if(!ie||!ze)return null;const bt=Ge.getBoundingClientRect(),Lt=Ge.scrollTop??0,qe=bt.left+X.start.x*ie,yt=bt.top+X.start.y*ze-Lt,lt=X.start.y===X.end.y?(X.end.x-X.start.x)*ie:bt.width,Wt=(X.end.y-X.start.y+1)*ze;return{x:qe,y:yt,width:lt,height:Wt}}function Ys(){var Lt;if(!ce)return;const X=(Lt=ce.getSelectionPosition)==null?void 0:Lt.call(ce);if(!X){V.value.visible=!1;return}const ie=Gc(X);if(!ie){V.value.visible=!1;return}const bt=ie.y-6-28>=8;V.value.arrowDir=bt?"down":"up",V.value.x=ie.x+ie.width/2,V.value.y=bt?window.innerHeight-ie.y+6:ie.y+ie.height+6,V.value.visible=!0}function Xo(X){if(wn("onSelectionPointerDown:entry",{pointerType:X.pointerType,isPrimary:X.isPrimary,y:X.clientY,...Ut()}),!Ze.value||!ce){wn("onSelectionPointerDown:earlyReturn");return}(N.value==="selecting"||N.value==="dragging")&&Zi();const ie=Yc(X);ie&&(Te={x:X.clientX,y:X.clientY},N.value="pressing",fs(),_t=setTimeout(()=>{var qe;if(_t=null,N.value!=="pressing"||!Te||!ce)return;const ze=bd(Te.x,Te.y,ce,ie);if(!ze){N.value="idle";return}let bt="";try{bt=((qe=ce.buffer.active.getLine(ze.row))==null?void 0:qe.translateToString(!0))??""}catch{bt=""}const Lt=vE(bt,ze.col);if(Lt.len===0){N.value="idle";return}try{ce.select(Lt.start,ze.row,Lt.len)}catch{N.value="idle";return}ce.options.disableStdin=!0,ie.style.touchAction="none",N.value="selecting",Ye={start:Lt.start,end:Lt.start+Lt.len-1,row:ze.row},Ys()},nP))}function Qa(X){if(ml()&&N.value!=="idle"&&wn("onSelectionPointerMove",{selMode:N.value,y:X.clientY}),N.value==="pressing"&&Te){const yt=X.clientX-Te.x,lt=X.clientY-Te.y;yt*yt+lt*lt>Zp*Zp&&(fs(),N.value="idle",Te=null);return}if(N.value!=="selecting"&&N.value!=="dragging"||!ce||!Ge||!Ye||!Te)return;if(N.value==="selecting"){const yt=X.clientX-Te.x,lt=X.clientY-Te.y;if(yt*yt+lt*lt{try{ce==null||ce.scrollLines(X*iP)}catch{}},sP))}function Gs(){ft&&(clearInterval(ft),ft=null),Dt=0}function Jo(X){var bt,Lt;if(Zc(X)&&ni(),uf.value){const qe=X.target;(bt=qe==null?void 0:qe.closest)!=null&&bt.call(qe,".template-confirm-panel, .template-bar")||ed()}if(N.value==="idle")return;const ie=X.target,ze=Ge??((Lt=a.value)==null?void 0:Lt.querySelector(".xterm-viewport"));ie&&(ze!=null&&ze.contains(ie))||ie&&typeof ie.closest=="function"&&ie.closest('[data-testid="selection-popover"]')||Zi()}function Jc(X){return X instanceof Element?!!X.closest(".template-bar, .aux-key-bar, .template-confirm-panel, .paste-confirm-panel"):!1}function Zc(X){return j.caps.wailsBindings||j.caps.localPty||!Y.value||X.pointerType==="mouse"?!1:!Jc(X.target)}async function Zo(){if(!ce||V.value.copying){Zi();return}V.value.copying=!0;let X=!1;try{X=await md(ce,G)}catch(ie){Pt("term","selection copy failed",{error:xt(ie)})}finally{V.value.copying=!1}i("toast",s(X?"mobile.selection.copied":"mobile.selection.copyFailed")),Zi()}function Qo(){if(!ce||!we||V.value.sending){Zi();return}V.value.sending=!0;try{const X=Hp(ce.getSelection());X&&we.sendInput(X)}finally{V.value.sending=!1,Zi()}}function Vn(){v.value=!1,me.value=[],je.value=null}async function il(X){if(!ce)return;const ie=HT(X.clientX,X.clientY,cP,dP,window.innerWidth,window.innerHeight),ze=ce.getSelection();if(g.value=!!ze,m.value=ie.left,b.value=ie.top,me.value=[],je.value=ee(X),v.value=!0,re){const bt=Yr(),Lt=[];for(const qe of z_("context-menu"))if(bt.isPluginEnabled(qe.id))try{const yt=await qe.load();Lt.push(yt.default)}catch(yt){Gi("term","failed to load context-menu plugin",{plugin:qe.id,error:xt(yt)})}me.value=await mE(Lt,re,ze)}}function sl(X){var ze;if(!v.value)return;const ie=X.target;ie instanceof Node&&((ze=f.value)!=null&&ze.contains(ie))||Vn()}function ea(X){X.key==="Escape"&&Vn()}function Qc(){const X=ce==null?void 0:ce.element;return(X==null?void 0:X.querySelector(".xterm-rows"))??(X==null?void 0:X.querySelector(".xterm-screen"))??a.value}function ee(X){var qe;if(!ce)return null;const ie=Qc();if(!ie)return null;const ze=bd(X.clientX,X.clientY,ce,ie);if(!ze)return null;const bt=ce.buffer.active.viewportY+ze.row;return((qe=B_(ce.buffer.active,bt,ce.cols,50).find(yt=>ze.col>=yt.startCell&&ze.col0&&ie>0&&(ce.cols!==X||ce.rows!==ie)&&ce.resize(X,ie)}function ta(){if(!ce||!a.value)return;const X=a.value.getBoundingClientRect();if(!(X.width<2||X.height<2)){Zr();try{ce.refresh(0,ce.rows-1)}catch{}}}function rl(){if(Vn(),!ce||!we)return;const X=Hp(ce.getSelection());X!==null&&we.sendInput(X)}function ol(){Vn(),ce&&ce.clear()}function na(){Vn(),!(!ce||!we||!ei.value)&&(we.sendResize(ce.cols,ce.rows),A.value={cols:ce.cols,rows:ce.rows},S.value=ce.cols,P.value=ce.rows)}function es(){if(!E.value||!Je||!a.value)return;const X=a.value.getBoundingClientRect();if(!(X.width<2||X.height<2)){try{Je.fit()}catch{}if(ce&&a.value){const ie=a.value.getBoundingClientRect();ce.rows{ce===ie&&ie.scrollToBottom(),X==null||X()})}async function qb(){var qe,yt;if(ce)return;ce=new L_.Terminal({fontFamily:Fp(n.appearance.fontHead),fontSize:n.appearance.fontSize,lineHeight:n.appearance.lineHeight,cursorStyle:n.appearance.cursorStyle,cursorBlink:n.appearance.cursorBlink,scrollback:n.appearance.scrollback,theme:n.theme,convertEol:!1,disableStdin:!E.value,allowProposedApi:!0}),_e={fontHead:n.appearance.fontHead,fontSize:n.appearance.fontSize,lineHeight:n.appearance.lineHeight},Je=new I_.FitAddon,ce.loadAddon(Je),ye=new hT.SearchAddon,ce.loadAddon(ye),ye.onDidChangeResults(({resultIndex:lt,resultCount:Wt})=>{Se.value=lt,R.value=Wt}),ce.open(a.value),rE(ce);let X=!0;try{X=await l_()}catch{X=!1}if(!bi())return;if(X)try{const lt=new uT.WebglAddon;lt.onContextLoss(()=>lt.dispose()),ce.loadAddon(lt)}catch(lt){Pt("term","WebGL renderer unavailable, falling back to DOM",{error:xt(lt)})}const ie=a.value;Xe=ie,ie.addEventListener("keydown",qa,{capture:!0}),ie.addEventListener("keydown",Ii,{capture:!0}),document.addEventListener("keydown",Di,{capture:!0}),ie.addEventListener("paste",Yo,{capture:!0}),ie.addEventListener("pointermove",Qa),ie.addEventListener("pointerup",el),ie.addEventListener("pointercancel",tl),Ge=((qe=ce.element)==null?void 0:qe.querySelector(".xterm-viewport"))??null;try{const lt=ce._core,Wt=lt==null?void 0:lt._viewport;Wt&&(Wt.handleTouchStart=()=>{},Wt.handleTouchMove=()=>!0)}catch(lt){Pt("term","disable xterm touch scroll failed",{error:xt(lt)})}if(LE(PE()),DE(),wn("ensureTerm:done",{debugEnabled:ml(),hasViewport:!!Ge,hasXterm:!!ce.element,xtermChildren:ce.element?Array.from(ce.element.children).map(lt=>lt.className):[],...Ut()}),ml()&&ce.element){const lt=ce.element;lt.addEventListener("touchstart",Wt=>{var ts;const oi=Wt;wn("observer:xterm.touchstart",{touches:oi.touches.length,y:(ts=oi.touches[0])==null?void 0:ts.pageY,defaultPrevented:oi.defaultPrevented})},{passive:!0,capture:!1}),lt.addEventListener("touchmove",Wt=>{var Qr;const oi=Wt,ts=(Ge==null?void 0:Ge.scrollTop)??null;wn("observer:xterm.touchmove:before",{touches:oi.touches.length,y:(Qr=oi.touches[0])==null?void 0:Qr.pageY,scrollTopBefore:ts,defaultPrevented:oi.defaultPrevented}),queueMicrotask(()=>{const bf=(Ge==null?void 0:Ge.scrollTop)??null;wn("observer:xterm.touchmove:after",{scrollTopAfter:bf,diff:(bf??0)-(ts??0)})})},{passive:!0,capture:!1}),lt.addEventListener("touchend",()=>wn("observer:xterm.touchend"),{passive:!0}),lt.addEventListener("touchcancel",()=>wn("observer:xterm.touchcancel"),{passive:!0})}Ge==null||Ge.addEventListener("touchmove",Za,{passive:!0}),Ge==null||Ge.addEventListener("scroll",nl),ml()&&Ge&&Ge.addEventListener("scroll",()=>{wn("viewport.scroll",{scrollTop:Ge==null?void 0:Ge.scrollTop,selMode:N.value})},{passive:!0}),Ge==null||Ge.addEventListener("wheel",Pi,{passive:!0}),ie.addEventListener("touchmove",Es,{passive:!0}),pe=((yt=ce.element)==null?void 0:yt.querySelector("textarea"))??null,js(),pe==null||pe.addEventListener("input",Go,{capture:!0}),pe==null||pe.addEventListener("focus",Tr),pe==null||pe.addEventListener("blur",Ya),es(),ot=iE({send:lt=>we==null?void 0:we.sendInput(lt)});let ze=!1;ce.attachCustomKeyEventHandler(lt=>(lt.type==="keydown"&&(ze=!0),!0)),ce.onData(lt=>{const Wt=ze;if(ze=!1,!Rt.shouldForward(Wt))return;const{cleaned:oi,dropped:ts}=O_(lt);ts.length>0&&Pt("term","dropped C1 control chars from terminal input",{droppedCodepoints:ts.map(Qr=>"U+"+Qr.toString(16).toUpperCase().padStart(4,"0")).join(","),originalLength:lt.length,cleanedLength:oi.length}),oi&&(ot==null||ot.handle(oi))}),ce.onResize(({cols:lt,rows:Wt})=>{E.value&&(n.resizeSuspended||(we==null||we.sendResize(lt,Wt),A.value={cols:lt,rows:Wt},S.value=lt,P.value=Wt))});let bt=0;ce.onBell(()=>{const lt=typeof document<"u"&&document.hasFocus();IT(Date.now(),bt,lt)&&(bt=Date.now(),vp("AT Term",s("terminal.bellNotification",{session:n.sessionLabel||"session"}),{session_id:n.sessionId,kind:"bell"}))});const Lt=new AT;try{ce.parser.registerOscHandler(133,lt=>{const Wt=Lt.onOsc133(lt,Date.now());if(!Wt)return!1;const oi=typeof document<"u"&&document.hasFocus();return OT(Wt,{focused:oi,thresholdSec:n.commandNotifyThresholdSec??10,isLocal:n.isLocalSession??!0})&&(vp("AT Term",s("terminal.commandFinishedNotification",{exitCode:Wt.exitCode,elapsed:FT(Wt.elapsedMs),session:n.sessionLabel||"session"}),{session_id:n.sessionId,kind:"command_finished"}),YC(n.sessionId,Wt.exitCode,Wt.elapsedMs,n.sessionLabel||"session")),!1})}catch(lt){Pt("term","OSC 133 handler registration failed",{error:xt(lt)})}try{be=await _h()}catch{be=""}bi()&&(dt=fE({term:ce,isMac:sc(),openLink:lt=>ke(lt),onError:lt=>i("toast",s(lt))}),it=new ResizeObserver(()=>{es(),Xi()}),it.observe(a.value))}const Yb={matchBackground:"#3a3f4b",matchBorder:"#5a6272",matchOverviewRuler:"#5a6272",activeMatchBackground:"#d19a66",activeMatchBorder:"#d19a66",activeMatchColorOverviewRuler:"#d19a66"};function Gb(X,ie,ze){if(!ye)return;if(!X){ye.clearDecorations(),Se.value=-1,R.value=0;return}const bt={incremental:ze,decorations:Yb};ie==="next"?ye.findNext(X,bt):ye.findPrevious(X,bt)}function Xb(){Ce.value=!1,ye==null||ye.clearDecorations(),Se.value=-1,R.value=0,_n()}wt(()=>n.searchRequestSeq,()=>{n.focused&&(Ce.value=!0,Be.value++)});function lf(){if(ce){if(we){we.attach();return}we=sh(new Fm(n.endpoint,n.sessionId,{onOutput:X=>ce==null?void 0:ce.write(X),onClose:X=>{ce==null||ce.write(`\r +\x1B[33m${s("terminal.sessionEndedBanner",{exitCode:X.exit_code})}\x1B[0m\r +`)},onStatus:X=>{d.value=X,X!=="attached"&&oe.value.length&&Ni()},onReplayProgress:X=>{r.value=X.phase==="end"?null:X,X.phase==="start"||X.phase==="chunk"?Rt.onProgress(X.phase):Rt.onProgress("end",ie=>jb(ie))},onRouteChange:X=>{o.value=X},onMeta:X=>{typeof(X==null?void 0:X.cols)=="number"&&(S.value=X.cols),typeof(X==null?void 0:X.rows)=="number"&&(P.value=X.rows),Zr()},onDriverChange:(X,ie,ze)=>{const bt=E.value;E.value=ie,L.value=ie?"":ze,js(),Zr(),ie&&(n.active||n.focused)&&hn(Ws),!ie&&(n.active||n.focused)&&hn(()=>{var Lt;return(Lt=I.value)==null?void 0:Lt.focus()}),!ie&&oe.value.length&&Ni(),bt!==ie&&i("toast",s(ie?"terminal.driverNow":"terminal.viewerNow"))}},{clientName:x.value,remote:!n.isLocalSession,preferDirect:n.preferDirect,directEndpoint:n.directEndpoint,directTransportFactory:j.directConnection.createTransport})),we.attach(),gt==null||gt.set(n.sessionId,we),ht=X=>we==null?void 0:we.sendInput(X),at==null||at.set(n.sessionId,ht),ce&&(n.expectedCols!==ce.cols||n.expectedRows!==ce.rows)&&(we.sendResize(ce.cols,ce.rows),A.value={cols:ce.cols,rows:ce.rows})}}const{templates:Jb,templatesHidden:cf,pendingTemplateConfirm:df,templateConfirmOpen:uf,requestTemplateSend:hf,cancelTemplateSend:ed,confirmTemplateSend:ff,onTemplateHotkey:pf,onTemplateBarWheel:al,reload:Zb}=$E({send:X=>we==null?void 0:we.sendInput(X),confirmRequired:W(()=>!(j.caps.wailsBindings||j.caps.localPty)),focused:()=>n.focused,templatesBridge:j.templates});function Qb(X,ie){si(ie)&&Ze.value&&(we==null||we.sendInput(X),M.value&&_n())}function e0(X,ie){vi(ie,()=>{Ze.value&&(On=Date.now(),we==null||we.sendInput(X),M.value&&_n())})}async function vf(){var X,ie;if(Ze.value){k.value="",C.value=!0;try{k.value=await(((ie=(X=navigator.clipboard)==null?void 0:X.readText)==null?void 0:ie.call(X))??Promise.resolve(""))}catch{k.value=""}}}function td(){C.value=!1,k.value=""}function gf(){!Ze.value||!k.value||(we==null||we.sendInput(k.value),td())}function mf(){var X;mt.value&&(p.value&&(p.value.value=""),(X=p.value)==null||X.click())}async function t0(X){var Lt;if(!mt.value)return;const ie=X.currentTarget,ze=(Lt=ie==null?void 0:ie.files)==null?void 0:Lt[0];if(!ze)return;const bt=ze.name||"file";try{await(we==null?void 0:we.sendPasteFile(ze,bt)),Ru.emit(bt,ze.size)}catch(qe){Pt("term","failed to send picked file",{error:xt(qe)}),i("toast",(qe==null?void 0:qe.message)??s("terminal.pasteFailed"))}finally{ie&&(ie.value="")}}function _f(){var X;if(mt.value){if(j.caps.capacitor){i0();return}y.value&&(y.value.value=""),(X=y.value)==null||X.click()}}function n0(X,ie,ze){const bt=atob(X),Lt=new Uint8Array(bt.length);for(let qe=0;qe{var X;if(he(),window.addEventListener("atterm:open-service-preview",yf),await qb(),!!Ne){try{const ie=await Jm();ie!=null&&ie.host&&(x.value=ie.host)}catch{}Ne&&(n.active&&lf(),ll(),ia=j.events.on("quickTemplates:changed",ll),sa=j.events.on("mobile:shortcutsChanged",ll),ra=j.events.on("prefs:changed",ll),(X=j.servicePreview)!=null&&X.rebind&&(J=j.events.on("service-preview:pipe-dead",ie=>{const ze=ie;!ze||!ze.gateway_id||!oe.value.some(bt=>bt.id===ze.gateway_id)||Bi(ze.gateway_id,typeof ze.mapping_index=="number"?ze.mapping_index:0)})),document.addEventListener("mousedown",sl),document.addEventListener("pointerdown",Jo,{capture:!0}),document.addEventListener("keydown",ea),document.addEventListener("keydown",pf,!0),requestAnimationFrame(()=>{Ne&&(es(),requestAnimationFrame(()=>{Ne&&ta()}))}))}}),Vt(()=>{Ne=!1,Ni(),it==null||it.disconnect(),it=null,wi(),z.value=!1,Ps(),Cn=null,ia==null||ia(),ia=null,sa==null||sa(),sa=null,ra==null||ra(),ra=null,J==null||J(),J=null,Jp(n.sessionId,!1),document.removeEventListener("mousedown",sl),document.removeEventListener("pointerdown",Jo,{capture:!0}),document.removeEventListener("keydown",ea),document.removeEventListener("keydown",pf,!0),window.removeEventListener("atterm:open-service-preview",yf),Xe==null||Xe.removeEventListener("keydown",qa,{capture:!0}),Xe==null||Xe.removeEventListener("keydown",Ii,{capture:!0}),document.removeEventListener("keydown",Di,{capture:!0}),Xe==null||Xe.removeEventListener("paste",Yo,{capture:!0}),Xe==null||Xe.removeEventListener("pointermove",Qa),Xe==null||Xe.removeEventListener("pointerup",el),Xe==null||Xe.removeEventListener("pointercancel",tl),Xe==null||Xe.removeEventListener("touchmove",Es),Xe=null,Ge==null||Ge.removeEventListener("touchmove",Za),Ge==null||Ge.removeEventListener("scroll",nl),Ge==null||Ge.removeEventListener("wheel",Pi),Ge=null,pe==null||pe.removeEventListener("input",Go,{capture:!0}),pe==null||pe.removeEventListener("focus",Tr),pe==null||pe.removeEventListener("blur",Ya),pe=null,(at==null?void 0:at.get(n.sessionId))===ht&&(at==null||at.delete(n.sessionId)),ht=null,(gt==null?void 0:gt.get(n.sessionId))===we&&(gt==null||gt.delete(n.sessionId)),ot==null||ot.dispose(),ot=null,Zi(),dt==null||dt.dispose(),dt=null,we==null||we.detach(),we=null;try{ce==null||ce.dispose()}catch(X){ss("term","xterm dispose race (safe to ignore)",{error:xt(X)})}ce=null,Je=null}),wt(()=>n.active,X=>{X?(we?we.attach():lf(),hn(()=>{Ws(),requestAnimationFrame(()=>{!Ne||!n.active||ta()})})):(we==null||we.suspend(),Vn())}),wt(()=>n.remotePermission,()=>{Mr(n.remotePermission)!=="full"&&oe.value.length&&Ni()}),wt(()=>n.preferDirect,X=>we==null?void 0:we.setPreferDirect(X??!1)),wt(()=>n.focused,X=>{X&&hn(()=>{Ws()})}),wt(()=>n.theme,X=>{ce&&(ce.options.theme=X)}),wt(()=>n.appearance,X=>Wb(X)),wt(d,X=>{X!=="attached"&&Vn()}),wt(()=>n.resizeSuspended,(X,ie)=>{ie&&!X&&hn(()=>{ce&&we&&(we.sendResize(ce.cols,ce.rows),A.value={cols:ce.cols,rows:ce.rows})})}),(X,ie)=>{var ze,bt,Lt;return $(),O("div",{class:nt(["term-view",{focused:X.focused}])},[ct(_("div",{ref_key:"termContainer",ref:a,class:"term",style:Gt({bottom:Hn.value}),onContextmenu:pt(il,["prevent"]),onMouseupCapture:St,onTouchstartCapture:Ja,onPointerdownCapture:qc,onMousedownCapture:Is},null,36),[[Ci,!K.value]]),($(!0),O(Me,null,st(oe.value,qe=>ct(($(),O("iframe",{key:qe.id,class:"service-preview-frame",src:qe.url,title:w(s)("terminal.preview.frameTitle",{port:qe.port}),sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-downloads",allow:"clipboard-read; clipboard-write"},null,8,_5)),[[Ci,Fe.value===qe.id]])),128)),(ze=Z.value)!=null&&ze.reconnecting?($(),O("div",y5,[ie[26]||(ie[26]=_("span",{class:"service-preview-reconnecting-spinner","aria-hidden":"true"},null,-1)),_("span",null,T(w(s)("terminal.preview.reconnecting")),1)])):Q("",!0),oe.value.length||ae.value?($(),Ct(ya,{key:1,to:De.value},[_("div",b5,[oe.value.length?($(),Ct(i5,{key:0,previews:oe.value,"active-id":Fe.value,onShowTerminal:us,onSelect:Cr,onClose:Hi,onAdd:Ei,onOpenBrowser:Wo,onCopy:jo},null,8,["previews","active-id"])):Q("",!0),ae.value&&At.value?($(),O("form",{key:1,class:nt(["service-preview-port-form",{"as-popover":oe.value.length>0}]),onSubmit:pt(Sr,["prevent"])},[Pe(qn,{class:"service-preview-host","model-value":Le.value,options:xe,"aria-label":w(s)("terminal.preview.targetHost"),"onUpdate:modelValue":wr},null,8,["model-value","aria-label"]),_("div",w5,[ct(_("input",{ref_key:"previewPortInput",ref:Qe,"onUpdate:modelValue":ie[0]||(ie[0]=qe=>Ie.value=qe),"data-testid":"service-preview-port",type:"text",inputmode:"numeric",pattern:"[0-9]*","aria-label":w(s)("terminal.preview.portPrompt"),onKeydown:jn(pt(ds,["prevent","stop"]),["esc"])},null,40,S5),[[Et,Ie.value]]),ie[27]||(ie[27]=_("span",{class:"service-preview-path"},"/",-1))]),($(!0),O(Me,null,st(de.value,(qe,yt)=>($(),O("div",{key:yt,class:"service-preview-mapping-row"},[ct(_("input",{"onUpdate:modelValue":lt=>qe.port=lt,type:"text",inputmode:"numeric",pattern:"[0-9]*","aria-label":w(s)("terminal.preview.additionalPort")},null,8,C5),[[Et,qe.port]]),ct(_("input",{"onUpdate:modelValue":lt=>qe.pathPrefix=lt,type:"text",placeholder:"/api","aria-label":w(s)("terminal.preview.pathPrefix")},null,8,k5),[[Et,qe.pathPrefix]]),_("button",{type:"button",class:"preview-action",title:w(s)("terminal.preview.removeMapping"),"aria-label":w(s)("terminal.preview.removeMapping"),onClick:lt=>de.value.splice(yt,1)},"×",8,x5)]))),128)),_("div",R5,[Zt.value&&de.value.length<7?($(),O("button",{key:0,type:"button",class:"preview-add-mapping",onClick:ie[1]||(ie[1]=qe=>de.value.push({port:"",pathPrefix:"/api"}))},"+ "+T(w(s)("terminal.preview.addMapping")),1)):Q("",!0),ie[28]||(ie[28]=_("span",{class:"service-preview-form-spacer"},null,-1)),_("button",{type:"submit",disabled:se.value},T(se.value?w(s)("terminal.preview.opening"):w(s)("terminal.preview.open")),9,T5),_("button",{type:"button",disabled:se.value,onClick:ds},T(w(s)("common.cancel")),9,E5)])],34)):Q("",!0)])],8,["to"])):Q("",!0),Pe(c5,{visible:V.value.visible,x:V.value.x,y:V.value.y,"arrow-dir":V.value.arrowDir,copying:V.value.copying,sending:V.value.sending,onCopy:Zo,onSend:Qo,onCancel:Zi},null,8,["visible","x","y","arrow-dir","copying","sending"]),X.active&&(d.value!=="attached"||r.value)?($(),O("div",{key:2,class:nt(["overlay",{"avoid-top-right-badge":X.avoidTopRightBadge}])},[r.value?($(),O(Me,{key:0},[_("span",null,T(w(xT)(r.value)),1),_("div",P5,[_("div",{class:"progress-fill",style:Gt({width:`${w($_)(r.value)}%`})},null,4)])],64)):d.value==="connecting"?($(),O("span",L5,T(w(s)("terminal.connecting")),1)):d.value==="reconnecting"?($(),O("span",D5,T(w(s)("terminal.reconnecting")),1)):d.value==="ended"?($(),O("span",I5,T(w(s)("terminal.ended")),1)):d.value==="error"?($(),O("span",M5,T(w(s)("terminal.connectionError")),1)):Q("",!0)],2)):Q("",!0),X.isLocalSession?Q("",!0):($(),Ct(ya,{key:3,defer:"",to:ne.value},[_("span",{class:nt(["session-route-indicator",`route-${o.value.route}`]),title:u.value,"data-testid":"session-route-indicator"},T(c.value),11,A5)],8,["to"])),Pe(m5,{open:Ce.value,"focus-seq":Be.value,"result-index":Se.value,"result-count":R.value,onFind:Gb,onClose:Xb},null,8,["open","focus-seq","result-index","result-count"]),E.value?Q("",!0):($(),O("div",$5,[_("div",O5,[_("div",F5,T(w(s)("terminal.remoteHasTakenControl")),1),L.value?($(),O("div",B5,T(w(s)("terminal.byHost",{host:L.value})),1)):Q("",!0),_("div",H5,T(w(s)("terminal.pressSpaceToTakeBack")),1),_("button",{ref_key:"takeControlBtnRef",ref:I,class:"viewer-overlay-btn","data-testid":"take-control",onClick:ri},T(w(s)("terminal.takeControl")),513)])])),($(),Ct(ya,{to:"body"},[v.value?($(),O("div",{key:0,ref_key:"menuRef",ref:f,class:"term-context-menu",style:Gt({left:`${m.value}px`,top:`${b.value}px`}),onMousedown:ie[3]||(ie[3]=pt(()=>{},["stop"])),onClick:ie[4]||(ie[4]=pt(()=>{},["stop"]))},[je.value?($(),O("button",{key:0,class:"term-context-item",onClick:fe},T(w(s)("terminal.contextMenu.openLink")),1)):Q("",!0),je.value?($(),O("button",{key:1,class:"term-context-item",onClick:$t},T(w(s)("terminal.contextMenu.copyLink")),1)):Q("",!0),_("button",{class:"term-context-item",disabled:!g.value,onClick:Qt},T(w(s)("common.copy")),9,N5),_("button",{class:"term-context-item",disabled:!hi.value||l.value,onClick:Qi},T(w(s)("common.paste")),9,U5),_("button",{class:"term-context-item",disabled:!fi.value,onClick:rl},T(w(s)("terminal.sendSelection")),9,z5),_("button",{class:"term-context-item",onClick:ol},T(w(s)("terminal.clearBuffer")),1),_("button",{class:"term-context-item",disabled:!ei.value,onClick:na},T(w(s)("terminal.resize")),9,V5),X.canDetach?($(),O("button",{key:2,class:"term-context-item","data-test":"term-detach",onClick:ie[2]||(ie[2]=qe=>{i("detach"),Vn()})},T(w(s)("terminal.detachToTab")),1)):Q("",!0),($(!0),O(Me,null,st(me.value,qe=>($(),O("button",{key:qe.id,class:"term-context-item",disabled:qe.disabled,onClick:yt=>{qe.onClick(),Vn()}},T(qe.label),9,K5))),128))],36)):Q("",!0)])),!w(cf)&&!K.value?($(),O("div",{key:5,class:"template-bar","data-testid":"template-bar",style:Gt({bottom:Yn.value}),onPointerdownCapture:En,onWheelPassive:ie[5]||(ie[5]=(...qe)=>w(al)&&w(al)(...qe))},[($(!0),O(Me,null,st(w(Jb),qe=>($(),O("button",{key:qe.id,class:"template-btn","data-testid":`template-btn-${qe.id}`,title:qe.hotkey||"",tabindex:"-1",onTouchstart:Ji,onTouchmove:pi,onTouchcancel:ii,onTouchend:yt=>vi(yt,()=>w(hf)(qe)),onPointerdown:En,onClick:yt=>Li(()=>w(hf)(qe))},T(qe.label),41,W5))),128))],36)):Q("",!0),Ee.value&&!K.value?($(),O("div",{key:6,class:"aux-key-bar","data-testid":"terminal-aux-key-bar",onPointerdownCapture:En},[_("input",{ref_key:"filePicker",ref:p,class:"file-picker-input","data-testid":"terminal-file-input",type:"file",onChange:t0},null,544),_("input",{ref_key:"imagePicker",ref:y,class:"file-picker-input","data-testid":"terminal-image-input",type:"file",accept:"image/*",onChange:s0},null,544),_("button",{type:"button",class:"aux-key-btn keyboard-toggle-btn","data-testid":"terminal-hide-keyboard",tabindex:"-1",title:U.value?"Show keyboard":"Hide keyboard",onTouchstart:pt(Ds,["prevent","stop"]),onTouchmove:pi,onTouchcancel:ii,onTouchend:ie[6]||(ie[6]=pt(qe=>vi(qe,le),["stop"])),onPointerdown:pt(En,["stop"]),onClick:ie[7]||(ie[7]=pt(qe=>Li(le),["prevent","stop"]))},T(U.value?"打开键盘 ⌃":"折叠键盘 ⌄"),41,j5),_("div",{class:"aux-key-scroll","data-testid":"terminal-aux-key-scroll",onWheelPassive:ie[14]||(ie[14]=(...qe)=>w(al)&&w(al)(...qe))},[($(!0),O(Me,null,st(D.value,qe=>($(),O("button",{key:qe.id,type:"button",class:"aux-key-btn","data-testid":`terminal-aux-key-${qe.id}`,disabled:!Ze.value,tabindex:"-1",onTouchstart:pt(Ds,["prevent"]),onTouchmove:pi,onTouchcancel:ii,onTouchend:yt=>e0(qe.seq,yt),onPointerdown:ge,onPointermove:Oe,onPointercancel:qs,onPointerup:yt=>Qb(qe.seq,yt)},T(qe.label),41,q5))),128)),_("button",{type:"button",class:"aux-key-btn","data-testid":"terminal-pick-image",disabled:!mt.value,onTouchstart:pt(Ds,["prevent"]),onTouchmove:pi,onTouchcancel:ii,onTouchend:ie[8]||(ie[8]=qe=>vi(qe,_f)),onPointerdown:En,onClick:ie[9]||(ie[9]=qe=>Li(_f))},T(w(s)("terminal.pickImage")),41,Y5),_("button",{type:"button",class:"aux-key-btn","data-testid":"terminal-paste-confirm-open",disabled:!Ze.value,onTouchstart:pt(Ds,["prevent"]),onTouchmove:pi,onTouchcancel:ii,onTouchend:ie[10]||(ie[10]=qe=>vi(qe,vf)),onPointerdown:En,onClick:ie[11]||(ie[11]=qe=>Li(vf))},T(w(s)("mobile.pasteClipboard")),41,G5),_("button",{type:"button",class:"aux-key-btn","data-testid":"terminal-pick-file",disabled:!mt.value,onTouchstart:pt(Ds,["prevent"]),onTouchmove:pi,onTouchcancel:ii,onTouchend:ie[12]||(ie[12]=qe=>vi(qe,mf)),onPointerdown:En,onClick:ie[13]||(ie[13]=qe=>Li(mf))},T(w(s)("terminal.pickFile")),41,X5)],32)],32)):Q("",!0),w(uf)?($(),O("div",{key:7,class:"template-confirm-panel","data-testid":"template-confirm-panel",onPointerdownCapture:En,onClick:ie[19]||(ie[19]=pt(()=>{},["stop"]))},[_("div",J5,[_("div",Z5,T((bt=w(df))==null?void 0:bt.label),1),_("div",Q5,T((Lt=w(df))==null?void 0:Lt.text),1)]),_("button",{type:"button",class:"template-confirm-btn","data-testid":"template-confirm-cancel",tabindex:"-1",onTouchstart:Ji,onTouchmove:pi,onTouchcancel:ii,onTouchend:ie[15]||(ie[15]=qe=>vi(qe,w(ed))),onPointerdown:En,onClick:ie[16]||(ie[16]=qe=>Li(w(ed)))},T(w(s)("common.cancel")),33),_("button",{type:"button",class:"template-confirm-btn primary","data-testid":"template-confirm-send",tabindex:"-1",onTouchstart:Ji,onTouchmove:pi,onTouchcancel:ii,onTouchend:ie[17]||(ie[17]=qe=>vi(qe,w(ff))),onPointerdown:En,onClick:ie[18]||(ie[18]=qe=>Li(w(ff)))},"发送",32)],32)):Q("",!0),C.value?($(),O("div",{key:8,class:"paste-confirm-panel","data-testid":"terminal-paste-confirm-panel",onPointerdownCapture:En,onClick:ie[25]||(ie[25]=pt(()=>{},["stop"]))},[ct(_("textarea",{"onUpdate:modelValue":ie[20]||(ie[20]=qe=>k.value=qe),class:"paste-confirm-input",placeholder:w(s)("mobile.pastePreview"),rows:"2"},null,8,eP),[[Et,k.value]]),_("button",{type:"button",class:"paste-confirm-btn","data-testid":"terminal-paste-cancel",tabindex:"-1",onTouchstart:Ji,onTouchmove:pi,onTouchcancel:ii,onTouchend:ie[21]||(ie[21]=qe=>vi(qe,td)),onPointerdown:En,onClick:ie[22]||(ie[22]=qe=>Li(td))},T(w(s)("common.cancel")),33),_("button",{type:"button",class:"paste-confirm-btn primary","data-testid":"terminal-paste-confirm",disabled:!Ze.value||!k.value,tabindex:"-1",onTouchstart:Ji,onTouchmove:pi,onTouchcancel:ii,onTouchend:ie[23]||(ie[23]=qe=>vi(qe,gf)),onPointerdown:En,onClick:ie[24]||(ie[24]=qe=>Li(gf))},T(w(s)("mobile.pasteConfirm")),41,tP)],32)):Q("",!0)],2)}}}),hP=kt(uP,[["__scopeId","data-v-3334b195"]]),Ih={single:1,vertical:2,horizontal:2,grid2x2:4},fP=Object.freeze({sessionId:null,remote:!1}),nv=.1,iv=.9,Ai=.5;function rc(e){return Number.isFinite(e)?eiv?iv:e:Ai}const Ar=()=>({...fP});function sv(e,t,n,i,s,a){if(e==="single")return{layout:i==="vertical"?"vertical":"horizontal",panes:[{...t[0]},Ar()],activePaneIdx:1,newPaneIdx:1,colRatio:s,rowRatio:a};if(e==="vertical"){const r=n===0?2:3;return{layout:"grid2x2",panes:[{...t[0]},{...t[1]},Ar(),Ar()],activePaneIdx:r,newPaneIdx:r,colRatio:s,rowRatio:a}}if(e==="horizontal"){const r=n===0?1:3;return{layout:"grid2x2",panes:[{...t[0]},Ar(),{...t[1]},Ar()],activePaneIdx:r,newPaneIdx:r,colRatio:s,rowRatio:a}}const d=t.findIndex(r=>r.sessionId===null);return d===-1?{layout:"grid2x2",panes:t.map(r=>({...r})),activePaneIdx:n,newPaneIdx:-1,noop:!0,colRatio:s,rowRatio:a}:{layout:"grid2x2",panes:t.map(r=>({...r})),activePaneIdx:d,newPaneIdx:d,colRatio:s,rowRatio:a}}function pP(e,t,n,i,s){if(e==="single")return{layout:"single",panes:t.map(o=>({...o})),activePaneIdx:0,closeTab:!0,colRatio:i,rowRatio:s};if(e==="vertical"||e==="horizontal")return{layout:"single",panes:[{...t[n===0?1:0]}],activePaneIdx:0,colRatio:i,rowRatio:s};const a=t.map((o,c)=>c===n?Ar():{...o}),d=a.map((o,c)=>o.sessionId!==null?c:-1).filter(o=>o>=0),r=d.length;return r>=3?{layout:"grid2x2",panes:a,activePaneIdx:d[0],colRatio:i,rowRatio:s}:r===2?vP(a,d,i,s):r===1?{layout:"single",panes:[{...a[d[0]]}],activePaneIdx:0,colRatio:i,rowRatio:s}:{layout:"single",panes:[Ar()],activePaneIdx:0,closeTab:!0,colRatio:i,rowRatio:s}}function vP(e,t,n,i){const[s,a]=t;return{layout:s===0&&a===2||s===1&&a===3?"horizontal":"vertical",panes:[{...e[s]},{...e[a]}],activePaneIdx:0,colRatio:n,rowRatio:i}}const gP={single:{0:{}},vertical:{0:{right:1},1:{left:0}},horizontal:{0:{down:1},1:{up:0}},grid2x2:{0:{right:1,down:2},1:{left:0,down:3},2:{up:0,right:3},3:{up:1,left:2}}};function mP(e,t,n){var s,a;const i=(a=(s=gP[e])==null?void 0:s[t])==null?void 0:a[n];return typeof i=="number"?i:null}function Lr(e,t){for(const n of e){const i=n.panes.findIndex(s=>s.sessionId===t);if(i>=0)return{tabId:n.id,paneIdx:i}}return null}const _P=["aria-orientation"],yP=$e({__name:"PaneSplitter",props:{orientation:{},ratio:{},containerRect:{type:Function}},emits:["update:ratio","commit","reset"],setup(e,{emit:t}){const n=e,i=t,s=F(null);let a=null,d=0,r=0,o="";function c(b){if(b.button!==0)return;const g=s.value;if(g){a=b.pointerId,r=n.ratio,d=n.orientation==="col"?b.clientX:b.clientY;try{g.setPointerCapture(b.pointerId)}catch{}typeof document<"u"&&(o=document.body.style.cursor,document.body.style.cursor=n.orientation==="col"?"col-resize":"row-resize"),b.preventDefault()}}function h(b){if(a!==b.pointerId)return;const g=n.containerRect();if(!g)return;const l=n.orientation==="col"?g.width:g.height;if(l<=0)return;const p=((n.orientation==="col"?b.clientX:b.clientY)-d)/l;i("update:ratio",rc(r+p))}function u(b){if(a!==b.pointerId)return;const g=s.value;try{g==null||g.releasePointerCapture(b.pointerId)}catch{}a=null,typeof document<"u"&&(document.body.style.cursor=o,o=""),i("commit")}function v(){i("reset")}Vt(()=>{if(a!==null&&s.value){try{s.value.releasePointerCapture(a)}catch{}typeof document<"u"&&(document.body.style.cursor=o)}});const m=W(()=>{const b=rc(n.ratio)*100;return n.orientation==="col"?{left:`calc(${b}% - 3px)`}:{top:`calc(${b}% - 3px)`}});return(b,g)=>($(),O("div",{ref_key:"rootEl",ref:s,class:nt(["pane-splitter",b.orientation]),style:Gt(m.value),role:"separator","aria-orientation":b.orientation==="col"?"vertical":"horizontal",onPointerdown:c,onPointermove:h,onPointerup:u,onPointercancel:u,onDblclick:v},null,46,_P))}}),rv=kt(yP,[["__scopeId","data-v-442ddd17"]]),bP=["onMousedown","onDragover","onDragleave","onDrop"],wP={class:"term-host"},SP={key:1,class:"empty"},CP={class:"cell-controls"},kP=["title"],xP=["id"],RP=["title"],TP=["title","aria-label","onClick"],EP={key:1,class:"who"},PP={key:2,class:"who dim"},LP={class:"sid"},DP=["id"],IP=["title","onDragstart"],MP=["title","onClick"],AP=$e({__name:"PaneGrid",props:{tab:{},endpointFor:{type:Function},directEndpoint:{},preferDirect:{type:Boolean},sessionInfoFor:{type:Function},viewerCountFor:{type:Function},active:{type:Boolean},terminalTheme:{},commandNotifyThresholdSec:{},searchRequestSeq:{},appearance:{},servicePreviewAvailable:{type:Boolean}},emits:["set-active-pane","close-pane","drop-session","detach-session","toast","update:col-ratio","update:row-ratio"],setup(e,{emit:t}){const n=e,i=t,{t:s}=Ot(),a=OE();wt(a,async()=>{var M;await hn(),(M=o.value)==null||M.querySelectorAll(".cell-controls").forEach(B=>{const z=B.style.display;B.style.display="none",B.offsetHeight,B.style.display=z})});const d={single:["a"],vertical:["a","b"],horizontal:["a","b"],grid2x2:["a","b","c","d"]},r=W(()=>d[n.tab.layout]),o=F(null),c=F(!1),h=F(null);function u(M,B){var z;Zl((z=M.dataTransfer)==null?void 0:z.types)&&(M.preventDefault(),M.dataTransfer&&(M.dataTransfer.dropEffect="move"),h.value=B)}function v(M,B){const z=M.relatedTarget;z&&M.currentTarget instanceof Node&&M.currentTarget.contains(z)||h.value===B&&(h.value=null)}function m(M,B){var Y,U;if(h.value=null,!Zl((Y=M.dataTransfer)==null?void 0:Y.types))return;M.preventDefault();const z=w_()||(((U=M.dataTransfer)==null?void 0:U.getData(Ia))??"");z&&i("drop-session",{paneIdx:B,sessionId:z})}function b(M,B){B.sessionId&&(b_(B.sessionId),M.dataTransfer&&(M.dataTransfer.setData(Ia,B.sessionId),M.dataTransfer.effectAllowed="move"))}function g(){uo()}function l(){var M;return((M=o.value)==null?void 0:M.getBoundingClientRect())??null}const f=W(()=>{const M=rc(n.tab.colRatio),B=rc(n.tab.rowRatio),z=M.toFixed(4),Y=(1-M).toFixed(4),U=B.toFixed(4),N=(1-B).toFixed(4);switch(n.tab.layout){case"single":return{};case"vertical":return{gridTemplate:`"a b" / ${z}fr ${Y}fr`};case"horizontal":return{gridTemplate:`"a" ${U}fr "b" ${N}fr / 1fr`};case"grid2x2":return{gridTemplate:`"a b" ${U}fr "c d" ${N}fr / ${z}fr ${Y}fr`}}return{}}),p=W(()=>n.tab.layout==="vertical"||n.tab.layout==="grid2x2"),y=W(()=>n.tab.layout==="horizontal"||n.tab.layout==="grid2x2");function C(M){i("update:col-ratio",M)}function k(M){i("update:row-ratio",M)}function E(){i("update:col-ratio",Ai)}function I(){i("update:row-ratio",Ai)}function S(){c.value=!0}function P(){c.value=!1}function A(M){M!==n.tab.activePaneIdx&&i("set-active-pane",M)}function L(M,B){return M.sessionId??`empty-${B}`}function x(M){if(!M)return"";const B=M.user||"",z=M.host||"";return B&&z?`${B}@${z}`:z||B||""}function D(M){M.sessionId&&window.dispatchEvent(new CustomEvent("atterm:open-service-preview",{detail:{sessionId:M.sessionId}}))}return(M,B)=>($(),O("div",{ref_key:"gridRoot",ref:o,class:nt(["pane-grid",M.tab.layout]),style:Gt(f.value)},[($(!0),O(Me,null,st(M.tab.panes,(z,Y)=>{var U,N,V,j,G,te;return $(),O("div",{key:L(z,Y),class:nt(["cell",{"drop-target":h.value===Y}]),style:Gt({gridArea:r.value[Y]}),"data-test":"pane-cell",onMousedown:se=>A(Y),onDragover:se=>u(se,Y),onDragleave:se=>v(se,Y),onDrop:se=>m(se,Y)},[_("div",wP,[z.sessionId&&M.endpointFor(z)?($(),Ct(hP,{key:0,endpoint:M.endpointFor(z),"direct-endpoint":z.remote?M.directEndpoint:null,"prefer-direct":z.remote&&M.preferDirect,"session-id":z.sessionId,active:M.active,focused:M.active&&Y===M.tab.activePaneIdx,"expected-cols":(U=M.sessionInfoFor(z))==null?void 0:U.cols,"expected-rows":(N=M.sessionInfoFor(z))==null?void 0:N.rows,"remote-permission":(V=M.sessionInfoFor(z))==null?void 0:V.remote_permission,"session-label":w(MT)(M.sessionInfoFor(z)),"avoid-top-right-badge":z.remote||(((j=M.viewerCountFor)==null?void 0:j.call(M,z.sessionId))??0)>0,theme:M.terminalTheme,"is-local-session":!z.remote,"command-notify-threshold-sec":M.commandNotifyThresholdSec,"resize-suspended":c.value,"search-request-seq":M.searchRequestSeq,"can-detach":M.tab.layout!=="single",appearance:M.appearance,onToast:B[0]||(B[0]=se=>i("toast",se)),onDetach:se=>z.sessionId&&i("detach-session",z.sessionId)},null,8,["endpoint","direct-endpoint","prefer-direct","session-id","active","focused","expected-cols","expected-rows","remote-permission","session-label","avoid-top-right-badge","theme","is-local-session","command-notify-threshold-sec","resize-suspended","search-request-seq","can-detach","appearance","onDetach"])):($(),O("div",SP,T(w(s)("terminal.emptyPaneHint")),1))]),_("div",CP,[z.sessionId&&!z.remote&&(((G=M.viewerCountFor)==null?void 0:G.call(M,z.sessionId))??0)>0?($(),O("div",{key:0,class:"viewers-badge",title:w(s)("terminal.remoteViewerWatching",{count:M.viewerCountFor(z.sessionId)})},[B[4]||(B[4]=_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("path",{d:"M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z"}),_("circle",{cx:"12",cy:"12",r:"3"})],-1)),_("span",null,T(M.viewerCountFor(z.sessionId)),1)],8,kP)):Q("",!0),z.sessionId&&z.remote&&M.servicePreviewAvailable?($(),O("span",{key:1,class:"service-preview-controls-slot",id:`service-preview-controls-${z.sessionId}`,"aria-live":"polite"},null,8,xP)):Q("",!0),z.sessionId&&z.remote?($(),O("div",{key:2,class:"remote-badge",title:((te=M.sessionInfoFor(z))!=null&&te.host_id?w(s)("sessions.hostIdTitle",{hostId:M.sessionInfoFor(z).host_id??""})+` +`:"")+w(s)("sessions.sessionTitle",{sessionId:z.sessionId})},[M.servicePreviewAvailable?($(),O("button",{key:0,type:"button",class:"remote-preview-trigger","data-testid":"remote-preview-trigger",title:w(s)("terminal.preview.open"),"aria-label":w(s)("terminal.preview.open"),onMousedown:B[1]||(B[1]=pt(()=>{},["stop"])),onClick:pt(se=>D(z),["stop"])},B[5]||(B[5]=[u0('',1)]),40,TP)):Q("",!0),x(M.sessionInfoFor(z))?($(),O("span",EP,T(x(M.sessionInfoFor(z))),1)):($(),O("span",PP,T(w(s)("terminal.remote")),1)),_("span",LP,T(z.sessionId.slice(0,8)),1),_("span",{class:"route-indicator-slot",id:`session-route-indicator-${z.sessionId}`,"aria-live":"polite"},null,8,DP)],8,RP)):Q("",!0),z.sessionId&&M.tab.layout!=="single"?($(),O("span",{key:3,class:"pane-grip","data-test":"pane-grip",draggable:"true",title:w(s)("terminal.dragPaneOut"),onMousedown:B[2]||(B[2]=pt(()=>{},["stop"])),onDragstart:se=>b(se,z),onDragend:g},"⠿",40,IP)):Q("",!0),M.tab.layout!=="single"?($(),O("button",{key:4,type:"button",class:"close-pane",title:w(s)("terminal.closePaneTitle"),onMousedown:B[3]||(B[3]=pt(()=>{},["stop"])),onClick:pt(se=>i("close-pane",Y),["stop"])},"×",40,MP)):Q("",!0)])],46,bP)}),128)),p.value?($(),Ct(rv,{key:0,orientation:"col",ratio:M.tab.colRatio,"container-rect":l,onPointerdown:S,"onUpdate:ratio":C,onCommit:P,onReset:E},null,8,["ratio"])):Q("",!0),y.value?($(),Ct(rv,{key:1,orientation:"row",ratio:M.tab.rowRatio,"container-rect":l,onPointerdown:S,"onUpdate:ratio":k,onCommit:P,onReset:I},null,8,["ratio"])):Q("",!0)],6))}}),$P=kt(AP,[["__scopeId","data-v-a336e107"]]);let oc=[];const W_=new WeakMap;function OP(){oc.forEach(e=>e(...W_.get(e))),oc=[]}function ac(e,...t){W_.set(e,t),!oc.includes(e)&&oc.push(e)===1&&requestAnimationFrame(OP)}function Ti(e,t){let{target:n}=e;for(;n;){if(n.dataset&&n.dataset[t]!==void 0)return!0;n=n.parentElement}return!1}function FP(e){const t=F(!!e.value);if(t.value)return nu(t);const n=wt(e,i=>{i&&(t.value=!0,n())});return nu(t)}function BP(){return Ug()!==null}const HP=typeof window<"u";let wo,xa;const NP=()=>{var e,t;wo=HP?(t=(e=document)===null||e===void 0?void 0:e.fonts)===null||t===void 0?void 0:t.ready:void 0,xa=!1,wo!==void 0?wo.then(()=>{xa=!0}):xa=!0};NP();function UP(e){if(xa)return;let t=!1;It(()=>{xa||wo==null||wo.then(()=>{t||e()})}),Vt(()=>{t=!0})}function Mh(e,t){return W(()=>{for(const n of t)if(e[n]!==void 0)return e[n];return e[t[t.length-1]]})}function Ah(e={},t){const n=_a({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:i,keyup:s}=e,a=o=>{switch(o.key){case"Control":n.ctrl=!0;break;case"Meta":n.command=!0,n.win=!0;break;case"Shift":n.shift=!0;break;case"Tab":n.tab=!0;break}i!==void 0&&Object.keys(i).forEach(c=>{if(c!==o.key)return;const h=i[c];if(typeof h=="function")h(o);else{const{stop:u=!1,prevent:v=!1}=h;u&&o.stopPropagation(),v&&o.preventDefault(),h.handler(o)}})},d=o=>{switch(o.key){case"Control":n.ctrl=!1;break;case"Meta":n.command=!1,n.win=!1;break;case"Shift":n.shift=!1;break;case"Tab":n.tab=!1;break}s!==void 0&&Object.keys(s).forEach(c=>{if(c!==o.key)return;const h=s[c];if(typeof h=="function")h(o);else{const{stop:u=!1,prevent:v=!1}=h;u&&o.stopPropagation(),v&&o.preventDefault(),h.handler(o)}})},r=()=>{(t===void 0||t.value)&&(zn("keydown",document,a),zn("keyup",document,d)),t!==void 0&&wt(t,o=>{o?(zn("keydown",document,a),zn("keyup",document,d)):(Fn("keydown",document,a),Fn("keyup",document,d))})};return BP()?(h0(r),Vt(()=>{(t===void 0||t.value)&&(Fn("keydown",document,a),Fn("keyup",document,d))})):r(),nu(n)}const $h=ui("n-internal-select-menu"),j_=ui("n-internal-select-menu-body"),Oh=ui("n-drawer-body"),Fh=ui("n-modal-body"),$c=ui("n-popover-body"),q_="__disabled__";function di(e){const t=zt(Fh,null),n=zt(Oh,null),i=zt($c,null),s=zt(j_,null),a=F();if(typeof document<"u"){a.value=document.fullscreenElement;const d=()=>{a.value=document.fullscreenElement};It(()=>{zn("fullscreenchange",document,d)}),Vt(()=>{Fn("fullscreenchange",document,d)})}return en(()=>{var d;const{to:r}=e;return r!==void 0?r===!1?q_:r===!0?a.value||"body":r:t!=null&&t.value?(d=t.value.$el)!==null&&d!==void 0?d:t.value:n!=null&&n.value?n.value:i!=null&&i.value?i.value:s!=null&&s.value?s.value:r??(a.value||"body")})}di.tdkey=q_;di.propTo={type:[String,Object,Boolean],default:void 0};function zP(e,t,n){const i=F(e.value);let s=null;return wt(e,a=>{s!==null&&window.clearTimeout(s),a===!0?n&&!n.value?i.value=!0:s=window.setTimeout(()=>{i.value=!0},t):i.value=!1}),i}function Tu(e,t,n="default"){const i=t[n];if(i===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);return i()}function Eu(e,t=!0,n=[]){return e.forEach(i=>{if(i!==null){if(typeof i!="object"){(typeof i=="string"||typeof i=="number")&&n.push(et(String(i)));return}if(Array.isArray(i)){Eu(i,t,n);return}if(i.type===Me){if(i.children===null)return;Array.isArray(i.children)&&Eu(i.children,t,n)}else i.type!==f0&&n.push(i)}}),n}function ov(e,t,n="default"){const i=t[n];if(i===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);const s=Eu(i());if(s.length===1)return s[0];throw new Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`)}let er=null;function Y_(){if(er===null&&(er=document.getElementById("v-binder-view-measurer"),er===null)){er=document.createElement("div"),er.id="v-binder-view-measurer";const{style:e}=er;e.position="fixed",e.left="0",e.right="0",e.top="0",e.bottom="0",e.pointerEvents="none",e.visibility="hidden",document.body.appendChild(er)}return er.getBoundingClientRect()}function VP(e,t){const n=Y_();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function wd(e){const t=e.getBoundingClientRect(),n=Y_();return{left:t.left-n.left,top:t.top-n.top,bottom:n.height+n.top-t.bottom,right:n.width+n.left-t.right,width:t.width,height:t.height}}function KP(e){return e.nodeType===9?null:e.parentNode}function G_(e){if(e===null)return null;const t=KP(e);if(t===null)return null;if(t.nodeType===9)return document;if(t.nodeType===1){const{overflow:n,overflowX:i,overflowY:s}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(n+s+i))return t}return G_(t)}const No=$e({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){var t;Rn("VBinder",(t=Ug())===null||t===void 0?void 0:t.proxy);const n=zt("VBinder",null),i=F(null),s=f=>{i.value=f,n&&e.syncTargetWithParent&&n.setTargetRef(f)};let a=[];const d=()=>{let f=i.value;for(;f=G_(f),f!==null;)a.push(f);for(const p of a)zn("scroll",p,u,!0)},r=()=>{for(const f of a)Fn("scroll",f,u,!0);a=[]},o=new Set,c=f=>{o.size===0&&d(),o.has(f)||o.add(f)},h=f=>{o.has(f)&&o.delete(f),o.size===0&&r()},u=()=>{ac(v)},v=()=>{o.forEach(f=>f())},m=new Set,b=f=>{m.size===0&&zn("resize",window,l),m.has(f)||m.add(f)},g=f=>{m.has(f)&&m.delete(f),m.size===0&&Fn("resize",window,l)},l=()=>{m.forEach(f=>f())};return Vt(()=>{Fn("resize",window,l),r()}),{targetRef:i,setTargetRef:s,addScrollListener:c,removeScrollListener:h,addResizeListener:b,removeResizeListener:g}},render(){return Tu("binder",this.$slots)}}),Uo=$e({name:"Target",setup(){const{setTargetRef:e,syncTarget:t}=zt("VBinder");return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){const{syncTarget:e,setTargetDirective:t}=this;return e?ct(ov("follower",this.$slots),[[t]]):ov("follower",this.$slots)}}),to="@@mmoContext",WP={mounted(e,{value:t}){e[to]={handler:void 0},typeof t=="function"&&(e[to].handler=t,zn("mousemoveoutside",e,t))},updated(e,{value:t}){const n=e[to];typeof t=="function"?n.handler?n.handler!==t&&(Fn("mousemoveoutside",e,n.handler),n.handler=t,zn("mousemoveoutside",e,t)):(e[to].handler=t,zn("mousemoveoutside",e,t)):n.handler&&(Fn("mousemoveoutside",e,n.handler),n.handler=void 0)},unmounted(e){const{handler:t}=e[to];t&&Fn("mousemoveoutside",e,t),e[to].handler=void 0}},no="@@coContext",Kr={mounted(e,{value:t,modifiers:n}){e[no]={handler:void 0},typeof t=="function"&&(e[no].handler=t,zn("clickoutside",e,t,{capture:n.capture}))},updated(e,{value:t,modifiers:n}){const i=e[no];typeof t=="function"?i.handler?i.handler!==t&&(Fn("clickoutside",e,i.handler,{capture:n.capture}),i.handler=t,zn("clickoutside",e,t,{capture:n.capture})):(e[no].handler=t,zn("clickoutside",e,t,{capture:n.capture})):i.handler&&(Fn("clickoutside",e,i.handler,{capture:n.capture}),i.handler=void 0)},unmounted(e,{modifiers:t}){const{handler:n}=e[no];n&&Fn("clickoutside",e,n,{capture:t.capture}),e[no].handler=void 0}};function jP(e,t){console.error(`[vdirs/${e}]: ${t}`)}class qP{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(t,n){const{elementZIndex:i}=this;if(n!==void 0){t.style.zIndex=`${n}`,i.delete(t);return}const{nextZIndex:s}=this;i.has(t)&&i.get(t)+1===this.nextZIndex||(t.style.zIndex=`${s}`,i.set(t,s),this.nextZIndex=s+1,this.squashState())}unregister(t,n){const{elementZIndex:i}=this;i.has(t)?i.delete(t):n===void 0&&jP("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:t}=this;t||(this.nextZIndex=2e3),this.nextZIndex-t>2500&&this.rearrange()}rearrange(){const t=Array.from(this.elementZIndex.entries());t.sort((n,i)=>n[1]-i[1]),this.nextZIndex=2e3,t.forEach(n=>{const i=n[0],s=this.nextZIndex++;`${s}`!==i.style.zIndex&&(i.style.zIndex=`${s}`)})}}const Sd=new qP,io="@@ziContext",X_={mounted(e,t){const{value:n={}}=t,{zIndex:i,enabled:s}=n;e[io]={enabled:!!s,initialized:!1},s&&(Sd.ensureZIndex(e,i),e[io].initialized=!0)},updated(e,t){const{value:n={}}=t,{zIndex:i,enabled:s}=n,a=e[io].enabled;s&&!a&&(Sd.ensureZIndex(e,i),e[io].initialized=!0),e[io].enabled=!!s},unmounted(e,t){if(!e[io].initialized)return;const{value:n={}}=t,{zIndex:i}=n;Sd.unregister(e,i)}},{c:cr}=p0(),Bh="vueuc-style";function av(e){return e&-e}class J_{constructor(t,n){this.l=t,this.min=n;const i=new Array(t+1);for(let s=0;ss)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let a=t*i;for(;t>0;)a+=n[t],t-=av(t);return a}getBound(t){let n=0,i=this.l;for(;i>n;){const s=Math.floor((n+i)/2),a=this.sum(s);if(a>t){i=s;continue}else if(a{const{to:t}=e;return t??"body"})}},render(){return this.showTeleport?this.disabled?Tu("lazy-teleport",this.$slots):H(ya,{disabled:this.disabled,to:this.mergedTo},Tu("lazy-teleport",this.$slots)):null}}),_l={top:"bottom",bottom:"top",left:"right",right:"left"},cv={start:"end",center:"center",end:"start"},Cd={top:"height",bottom:"height",left:"width",right:"width"},GP={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},XP={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},JP={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},dv={top:!0,bottom:!1,left:!0,right:!1},uv={top:"end",bottom:"start",left:"end",right:"start"};function ZP(e,t,n,i,s,a){if(!s||a)return{placement:e,top:0,left:0};const[d,r]=e.split("-");let o=r??"center",c={top:0,left:0};const h=(m,b,g)=>{let l=0,f=0;const p=n[m]-t[b]-t[m];return p>0&&i&&(g?f=dv[b]?p:-p:l=dv[b]?p:-p),{left:l,top:f}},u=d==="left"||d==="right";if(o!=="center"){const m=JP[e],b=_l[m],g=Cd[m];if(n[g]>t[g]){if(t[m]+t[g]t[b]&&(o=cv[r])}else{const m=d==="bottom"||d==="top"?"left":"top",b=_l[m],g=Cd[m],l=(n[g]-t[g])/2;(t[m]t[b]?(o=uv[m],c=h(g,m,u)):(o=uv[b],c=h(g,b,u)))}let v=d;return t[d] *",{pointerEvents:"all"})])]),zo=$e({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(e){const t=zt("VBinder"),n=en(()=>e.enabled!==void 0?e.enabled:e.show),i=F(null),s=F(null),a=()=>{const{syncTrigger:v}=e;v.includes("scroll")&&t.addScrollListener(o),v.includes("resize")&&t.addResizeListener(o)},d=()=>{t.removeScrollListener(o),t.removeResizeListener(o)};It(()=>{n.value&&(o(),a())});const r=rh();tL.mount({id:"vueuc/binder",head:!0,anchorMetaName:Bh,ssr:r}),Vt(()=>{d()}),UP(()=>{n.value&&o()});const o=()=>{if(!n.value)return;const v=i.value;if(v===null)return;const m=t.targetRef,{x:b,y:g,overlap:l}=e,f=b!==void 0&&g!==void 0?VP(b,g):wd(m);v.style.setProperty("--v-target-width",`${Math.round(f.width)}px`),v.style.setProperty("--v-target-height",`${Math.round(f.height)}px`);const{width:p,minWidth:y,placement:C,internalShift:k,flip:E}=e;v.setAttribute("v-placement",C),l?v.setAttribute("v-overlap",""):v.removeAttribute("v-overlap");const{style:I}=v;p==="target"?I.width=`${f.width}px`:p!==void 0?I.width=p:I.width="",y==="target"?I.minWidth=`${f.width}px`:y!==void 0?I.minWidth=y:I.minWidth="";const S=wd(v),P=wd(s.value),{left:A,top:L,placement:x}=ZP(C,f,S,k,E,l),D=QP(x,l),{left:M,top:B,transform:z}=eL(x,P,f,L,A,l);v.setAttribute("v-placement",x),v.style.setProperty("--v-offset-left",`${Math.round(A)}px`),v.style.setProperty("--v-offset-top",`${Math.round(L)}px`),v.style.transform=`translateX(${M}) translateY(${B}) ${z}`,v.style.setProperty("--v-transform-origin",D),v.style.transformOrigin=D};wt(n,v=>{v?(a(),c()):d()});const c=()=>{hn().then(o).catch(v=>console.error(v))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(v=>{wt(ut(e,v),o)}),["teleportDisabled"].forEach(v=>{wt(ut(e,v),c)}),wt(ut(e,"syncTrigger"),v=>{v.includes("resize")?t.addResizeListener(o):t.removeResizeListener(o),v.includes("scroll")?t.addScrollListener(o):t.removeScrollListener(o)});const h=Ba(),u=en(()=>{const{to:v}=e;if(v!==void 0)return v;h.value});return{VBinder:t,mergedEnabled:n,offsetContainerRef:s,followerRef:i,mergedTo:u,syncPosition:o}},render(){return H(YP,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var e,t;const n=H("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[H("div",{class:"v-binder-follower-content",ref:"followerRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))]);return this.zindexable?ct(n,[[X_,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});let yl;function nL(){return typeof document>"u"?!1:(yl===void 0&&("matchMedia"in window?yl=window.matchMedia("(pointer:coarse)").matches:yl=!1),yl)}let kd;function hv(){return typeof document>"u"?1:(kd===void 0&&(kd="chrome"in window?window.devicePixelRatio:1),kd)}const Z_="VVirtualListXScroll";function iL({columnsRef:e,renderColRef:t,renderItemWithColsRef:n}){const i=F(0),s=F(0),a=W(()=>{const c=e.value;if(c.length===0)return null;const h=new J_(c.length,0);return c.forEach((u,v)=>{h.add(v,u.width)}),h}),d=en(()=>{const c=a.value;return c!==null?Math.max(c.getBound(s.value)-1,0):0}),r=c=>{const h=a.value;return h!==null?h.sum(c):0},o=en(()=>{const c=a.value;return c!==null?Math.min(c.getBound(s.value+i.value)+1,e.value.length-1):0});return Rn(Z_,{startIndexRef:d,endIndexRef:o,columnsRef:e,renderColRef:t,renderItemWithColsRef:n,getLeft:r}),{listWidthRef:i,scrollLeftRef:s}}const fv=$e({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:e,endIndexRef:t,columnsRef:n,getLeft:i,renderColRef:s,renderItemWithColsRef:a}=zt(Z_);return{startIndex:e,endIndex:t,columns:n,renderCol:s,renderItemWithCols:a,getLeft:i}},render(){const{startIndex:e,endIndex:t,columns:n,renderCol:i,renderItemWithCols:s,getLeft:a,item:d}=this;if(s!=null)return s({itemIndex:this.index,startColIndex:e,endColIndex:t,allColumns:n,item:d,getLeft:a});if(i!=null){const r=[];for(let o=e;o<=t;++o){const c=n[o];r.push(i({column:c,left:a(o),item:d}))}return r}return null}}),sL=cr(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[cr("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[cr("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Eo=$e({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(e){const t=rh();sL.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Bh,ssr:t}),It(()=>{const{defaultScrollIndex:D,defaultScrollKey:M}=e;D!=null?l({index:D}):M!=null&&l({key:M})});let n=!1,i=!1;v0(()=>{if(n=!1,!i){i=!0;return}l({top:m.value,left:d.value})}),zg(()=>{n=!0,i||(i=!0)});const s=en(()=>{if(e.renderCol==null&&e.renderItemWithCols==null||e.columns.length===0)return;let D=0;return e.columns.forEach(M=>{D+=M.width}),D}),a=W(()=>{const D=new Map,{keyField:M}=e;return e.items.forEach((B,z)=>{D.set(B[M],z)}),D}),{scrollLeftRef:d,listWidthRef:r}=iL({columnsRef:ut(e,"columns"),renderColRef:ut(e,"renderCol"),renderItemWithColsRef:ut(e,"renderItemWithCols")}),o=F(null),c=F(void 0),h=new Map,u=W(()=>{const{items:D,itemSize:M,keyField:B}=e,z=new J_(D.length,M);return D.forEach((Y,U)=>{const N=Y[B],V=h.get(N);V!==void 0&&z.add(U,V)}),z}),v=F(0),m=F(0),b=en(()=>Math.max(u.value.getBound(m.value-vo(e.paddingTop))-1,0)),g=W(()=>{const{value:D}=c;if(D===void 0)return[];const{items:M,itemSize:B}=e,z=b.value,Y=Math.min(z+Math.ceil(D/B+1),M.length-1),U=[];for(let N=z;N<=Y;++N)U.push(M[N]);return U}),l=(D,M)=>{if(typeof D=="number"){C(D,M,"auto");return}const{left:B,top:z,index:Y,key:U,position:N,behavior:V,debounce:j=!0}=D;if(B!==void 0||z!==void 0)C(B,z,V);else if(Y!==void 0)y(Y,V,j);else if(U!==void 0){const G=a.value.get(U);G!==void 0&&y(G,V,j)}else N==="bottom"?C(0,Number.MAX_SAFE_INTEGER,V):N==="top"&&C(0,0,V)};let f,p=null;function y(D,M,B){const{value:z}=u,Y=z.sum(D)+vo(e.paddingTop);if(!B)o.value.scrollTo({left:0,top:Y,behavior:M});else{f=D,p!==null&&window.clearTimeout(p),p=window.setTimeout(()=>{f=void 0,p=null},16);const{scrollTop:U,offsetHeight:N}=o.value;if(Y>U){const V=z.get(D);Y+V<=U+N||o.value.scrollTo({left:0,top:Y+V-N,behavior:M})}else o.value.scrollTo({left:0,top:Y,behavior:M})}}function C(D,M,B){o.value.scrollTo({left:D,top:M,behavior:B})}function k(D,M){var B,z,Y;if(n||e.ignoreItemResize||x(M.target))return;const{value:U}=u,N=a.value.get(D),V=U.get(N),j=(Y=(z=(B=M.borderBoxSize)===null||B===void 0?void 0:B[0])===null||z===void 0?void 0:z.blockSize)!==null&&Y!==void 0?Y:M.contentRect.height;if(j===V)return;j-e.itemSize===0?h.delete(D):h.set(D,j-e.itemSize);const te=j-V;if(te===0)return;U.add(N,te);const se=o.value;if(se!=null){if(f===void 0){const oe=U.sum(N);se.scrollTop>oe&&se.scrollBy(0,te)}else if(Nse.scrollTop+se.offsetHeight&&se.scrollBy(0,te)}L()}v.value++}const E=!nL();let I=!1;function S(D){var M;(M=e.onScroll)===null||M===void 0||M.call(e,D),(!E||!I)&&L()}function P(D){var M;if((M=e.onWheel)===null||M===void 0||M.call(e,D),E){const B=o.value;if(B!=null){if(D.deltaX===0&&(B.scrollTop===0&&D.deltaY<=0||B.scrollTop+B.offsetHeight>=B.scrollHeight&&D.deltaY>=0))return;D.preventDefault(),B.scrollTop+=D.deltaY/hv(),B.scrollLeft+=D.deltaX/hv(),L(),I=!0,ac(()=>{I=!1})}}}function A(D){if(n||x(D.target))return;if(e.renderCol==null&&e.renderItemWithCols==null){if(D.contentRect.height===c.value)return}else if(D.contentRect.height===c.value&&D.contentRect.width===r.value)return;c.value=D.contentRect.height,r.value=D.contentRect.width;const{onResize:M}=e;M!==void 0&&M(D)}function L(){const{value:D}=o;D!=null&&(m.value=D.scrollTop,d.value=D.scrollLeft)}function x(D){let M=D;for(;M!==null;){if(M.style.display==="none")return!0;M=M.parentElement}return!1}return{listHeight:c,listStyle:{overflow:"auto"},keyToIndex:a,itemsStyle:W(()=>{const{itemResizable:D}=e,M=Wn(u.value.sum());return v.value,[e.itemsStyle,{boxSizing:"content-box",width:Wn(s.value),height:D?"":M,minHeight:D?M:"",paddingTop:Wn(e.paddingTop),paddingBottom:Wn(e.paddingBottom)}]}),visibleItemsStyle:W(()=>(v.value,{transform:`translateY(${Wn(u.value.sum(b.value))})`})),viewportItems:g,listElRef:o,itemsElRef:F(null),scrollTo:l,handleListResize:A,handleListScroll:S,handleListWheel:P,handleItemResize:k}},render(){const{itemResizable:e,keyField:t,keyToIndex:n,visibleItemsTag:i}=this;return H(iu,{onResize:this.handleListResize},{default:()=>{var s,a;return H("div",fr(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?H("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[H(i,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:d,renderItemWithCols:r}=this;return this.viewportItems.map(o=>{const c=o[t],h=n.get(c),u=d!=null?H(fv,{index:h,item:o}):void 0,v=r!=null?H(fv,{index:h,item:o}):void 0,m=this.$slots.default({item:o,renderedCols:u,renderedItemWithCols:v,index:h})[0];return e?H(iu,{key:c,onResize:b=>this.handleItemResize(c,b)},{default:()=>m}):(m.key=c,m)})}})]):(a=(s=this.$slots).empty)===null||a===void 0?void 0:a.call(s)])}})}}),Ms="v-hidden",rL=cr("[v-hidden]",{display:"none!important"}),pv=$e({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:t}){const n=F(null),i=F(null);function s(d){const{value:r}=n,{getCounter:o,getTail:c}=e;let h;if(o!==void 0?h=o():h=i.value,!r||!h)return;h.hasAttribute(Ms)&&h.removeAttribute(Ms);const{children:u}=r;if(d.showAllItemsBeforeCalculate)for(const y of u)y.hasAttribute(Ms)&&y.removeAttribute(Ms);const v=r.offsetWidth,m=[],b=t.tail?c==null?void 0:c():null;let g=b?b.offsetWidth:0,l=!1;const f=r.children.length-(t.tail?1:0);for(let y=0;yv){const{updateCounter:E}=e;for(let I=y;I>=0;--I){const S=f-1-I;E!==void 0?E(S):h.textContent=`${S}`;const P=h.offsetWidth;if(g-=m[I],g+P<=v||I===0){l=!0,y=I-1,b&&(y===-1?(b.style.maxWidth=`${v-P}px`,b.style.boxSizing="border-box"):b.style.maxWidth="");const{onUpdateCount:A}=e;A&&A(S);break}}}}const{onUpdateOverflow:p}=e;l?p!==void 0&&p(!0):(p!==void 0&&p(!1),h.setAttribute(Ms,""))}const a=rh();return rL.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Bh,ssr:a}),It(()=>s({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:i,sync:s}},render(){const{$slots:e}=this;return hn(()=>this.sync({showAllItemsBeforeCalculate:!1})),H("div",{class:"v-overflow",ref:"selfRef"},[Vg(e,"default"),e.counter?e.counter():H("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}});function Q_(e){return e instanceof HTMLElement}function ey(e){for(let t=0;t=0;t--){const n=e.childNodes[t];if(Q_(n)&&(ny(n)||ty(n)))return!0}return!1}function ny(e){if(!oL(e))return!1;try{e.focus({preventScroll:!0})}catch{}return document.activeElement===e}function oL(e){if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute("tabIndex")!==null)return!0;if(e.getAttribute("disabled"))return!1;switch(e.nodeName){case"A":return!!e.href&&e.rel!=="ignore";case"INPUT":return e.type!=="hidden"&&e.type!=="file";case"SELECT":case"TEXTAREA":return!0;default:return!1}}let ha=[];const aL=$e({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(e){const t=oh(),n=F(null),i=F(null);let s=!1,a=!1;const d=typeof document>"u"?null:document.activeElement;function r(){return ha[ha.length-1]===t}function o(l){var f;l.code==="Escape"&&r()&&((f=e.onEsc)===null||f===void 0||f.call(e,l))}It(()=>{wt(()=>e.active,l=>{l?(u(),zn("keydown",document,o)):(Fn("keydown",document,o),s&&v())},{immediate:!0})}),Vt(()=>{Fn("keydown",document,o),s&&v()});function c(l){if(!a&&r()){const f=h();if(f===null||f.contains(Nr(l)))return;m("first")}}function h(){const l=n.value;if(l===null)return null;let f=l;for(;f=f.nextSibling,!(f===null||f instanceof Element&&f.tagName==="DIV"););return f}function u(){var l;if(!e.disabled){if(ha.push(t),e.autoFocus){const{initialFocusTo:f}=e;f===void 0?m("first"):(l=lv(f))===null||l===void 0||l.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",c,!0)}}function v(){var l;if(e.disabled||(document.removeEventListener("focus",c,!0),ha=ha.filter(p=>p!==t),r()))return;const{finalFocusTo:f}=e;f!==void 0?(l=lv(f))===null||l===void 0||l.focus({preventScroll:!0}):e.returnFocusOnDeactivated&&d instanceof HTMLElement&&(a=!0,d.focus({preventScroll:!0}),a=!1)}function m(l){if(r()&&e.active){const f=n.value,p=i.value;if(f!==null&&p!==null){const y=h();if(y==null||y===p){a=!0,f.focus({preventScroll:!0}),a=!1;return}a=!0;const C=l==="first"?ey(y):ty(y);a=!1,C||(a=!0,f.focus({preventScroll:!0}),a=!1)}}}function b(l){if(a)return;const f=h();f!==null&&(l.relatedTarget!==null&&f.contains(l.relatedTarget)?m("last"):m("first"))}function g(l){a||(l.relatedTarget!==null&&l.relatedTarget===n.value?m("last"):m("first"))}return{focusableStartRef:n,focusableEndRef:i,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:b,handleEndFocus:g}},render(){const{default:e}=this.$slots;if(e===void 0)return null;if(this.disabled)return e();const{active:t,focusableStyle:n}=this;return H(Me,null,[H("div",{"aria-hidden":"true",tabindex:t?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),e(),H("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:t?"0":"-1",onFocus:this.handleEndFocus})])}});function iy(e,t){t&&(It(()=>{const{value:n}=e;n&&nd.registerHandler(n,t)}),wt(e,(n,i)=>{i&&nd.unregisterHandler(i)},{deep:!1}),Vt(()=>{const{value:n}=e;n&&nd.unregisterHandler(n)}))}function lL(e,t){if(!e)return;const n=document.createElement("a");n.href=e,t!==void 0&&(n.download=t),document.body.appendChild(n),n.click(),document.body.removeChild(n)}let xd;function cL(){return xd===void 0&&(xd=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),xd}const dL=new WeakSet;function Aa(e){dL.add(e)}function vv(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}function gv(e){switch(e){case"tiny":return"mini";case"small":return"tiny";case"medium":return"small";case"large":return"medium";case"huge":return"large"}throw new Error(`${e} has no smaller size.`)}function sy(e){return t=>{t?e.value=t.$el:e.value=null}}function mv(e,t="default",n=void 0){const i=e[t];if(!i)return Ur("getFirstSlotVNode",`slot[${t}] is empty`),null;const s=cm(i(n));return s.length===1?s[0]:(Ur("getFirstSlotVNode",`slot[${t}] should have exactly one child`),null)}function Oc(e,t=[],n){const i={};return t.forEach(s=>{i[s]=e[s]}),Object.assign(i,n)}function Ra(e){const t=e.filter(n=>n!==void 0);if(t.length!==0)return t.length===1?t[0]:n=>{e.forEach(i=>{i&&i(n)})}}var Pu=Sc(Cc,"WeakMap"),uL=g0(Object.keys,Object),hL=Object.prototype,fL=hL.hasOwnProperty;function pL(e){if(!m0(e))return uL(e);var t=[];for(var n in Object(e))fL.call(e,n)&&n!="constructor"&&t.push(n);return t}function Hh(e){return ah(e)?_0(e):pL(e)}function vL(e,t){for(var n=-1,i=t.length,s=e.length;++nr))return!1;var c=a.get(e),h=a.get(t);if(c&&h)return c==t&&h==e;var u=-1,v=!0,m=n&AL?new lc:void 0;for(a.set(e,t),a.set(t,e);++uH("svg",{width:"28px",height:"28px",viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},H("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},H("g",{"fill-rule":"nonzero"},H("path",{d:"M21.75,3 C23.5449254,3 25,4.45507456 25,6.25 L25,21.75 C25,23.5449254 23.5449254,25 21.75,25 L6.25,25 C4.45507456,25 3,23.5449254 3,21.75 L3,6.25 C3,4.45507456 4.45507456,3 6.25,3 L21.75,3 Z M23.5,9.503 L4.5,9.503 L4.5,21.75 C4.5,22.7164983 5.28350169,23.5 6.25,23.5 L21.75,23.5 C22.7164983,23.5 23.5,22.7164983 23.5,21.75 L23.5,9.503 Z M21.75,4.5 L6.25,4.5 C5.28350169,4.5 4.5,5.28350169 4.5,6.25 L4.5,8.003 L23.5,8.003 L23.5,6.25 C23.5,5.28350169 22.7164983,4.5 21.75,4.5 Z"}))))),TD=$e({name:"Empty",render(){return H("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},H("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),H("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}}),vr=$e({name:"FastBackward",render(){return H("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},H("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},H("g",{fill:"currentColor","fill-rule":"nonzero"},H("path",{d:"M8.73171,16.7949 C9.03264,17.0795 9.50733,17.0663 9.79196,16.7654 C10.0766,16.4644 10.0634,15.9897 9.76243,15.7051 L4.52339,10.75 L17.2471,10.75 C17.6613,10.75 17.9971,10.4142 17.9971,10 C17.9971,9.58579 17.6613,9.25 17.2471,9.25 L4.52112,9.25 L9.76243,4.29275 C10.0634,4.00812 10.0766,3.53343 9.79196,3.2325 C9.50733,2.93156 9.03264,2.91834 8.73171,3.20297 L2.31449,9.27241 C2.14819,9.4297 2.04819,9.62981 2.01448,9.8386 C2.00308,9.89058 1.99707,9.94459 1.99707,10 C1.99707,10.0576 2.00356,10.1137 2.01585,10.1675 C2.05084,10.3733 2.15039,10.5702 2.31449,10.7254 L8.73171,16.7949 Z"}))))}}),gr=$e({name:"FastForward",render(){return H("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},H("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},H("g",{fill:"currentColor","fill-rule":"nonzero"},H("path",{d:"M11.2654,3.20511 C10.9644,2.92049 10.4897,2.93371 10.2051,3.23464 C9.92049,3.53558 9.93371,4.01027 10.2346,4.29489 L15.4737,9.25 L2.75,9.25 C2.33579,9.25 2,9.58579 2,10.0000012 C2,10.4142 2.33579,10.75 2.75,10.75 L15.476,10.75 L10.2346,15.7073 C9.93371,15.9919 9.92049,16.4666 10.2051,16.7675 C10.4897,17.0684 10.9644,17.0817 11.2654,16.797 L17.6826,10.7276 C17.8489,10.5703 17.9489,10.3702 17.9826,10.1614 C17.994,10.1094 18,10.0554 18,10.0000012 C18,9.94241 17.9935,9.88633 17.9812,9.83246 C17.9462,9.62667 17.8467,9.42976 17.6826,9.27455 L11.2654,3.20511 Z"}))))}}),ED=$e({name:"Filter",render(){return H("svg",{viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},H("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},H("g",{"fill-rule":"nonzero"},H("path",{d:"M17,19 C17.5522847,19 18,19.4477153 18,20 C18,20.5522847 17.5522847,21 17,21 L11,21 C10.4477153,21 10,20.5522847 10,20 C10,19.4477153 10.4477153,19 11,19 L17,19 Z M21,13 C21.5522847,13 22,13.4477153 22,14 C22,14.5522847 21.5522847,15 21,15 L7,15 C6.44771525,15 6,14.5522847 6,14 C6,13.4477153 6.44771525,13 7,13 L21,13 Z M24,7 C24.5522847,7 25,7.44771525 25,8 C25,8.55228475 24.5522847,9 24,9 L4,9 C3.44771525,9 3,8.55228475 3,8 C3,7.44771525 3.44771525,7 4,7 L24,7 Z"}))))}}),mr=$e({name:"Forward",render(){return H("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},H("path",{d:"M7.73271 4.20694C8.03263 3.92125 8.50737 3.93279 8.79306 4.23271L13.7944 9.48318C14.0703 9.77285 14.0703 10.2281 13.7944 10.5178L8.79306 15.7682C8.50737 16.0681 8.03263 16.0797 7.73271 15.794C7.43279 15.5083 7.42125 15.0336 7.70694 14.7336L12.2155 10.0005L7.70694 5.26729C7.42125 4.96737 7.43279 4.49264 7.73271 4.20694Z",fill:"currentColor"}))}}),Lv=$e({name:"More",render(){return H("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},H("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},H("g",{fill:"currentColor","fill-rule":"nonzero"},H("path",{d:"M4,7 C4.55228,7 5,7.44772 5,8 C5,8.55229 4.55228,9 4,9 C3.44772,9 3,8.55229 3,8 C3,7.44772 3.44772,7 4,7 Z M8,7 C8.55229,7 9,7.44772 9,8 C9,8.55229 8.55229,9 8,9 C7.44772,9 7,8.55229 7,8 C7,7.44772 7.44772,7 8,7 Z M12,7 C12.5523,7 13,7.44772 13,8 C13,8.55229 12.5523,9 12,9 C11.4477,9 11,8.55229 11,8 C11,7.44772 11.4477,7 12,7 Z"}))))}}),PD=$e({name:"Remove",render(){return H("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},H("line",{x1:"400",y1:"256",x2:"112",y2:"256",style:` + fill: none; + stroke: currentColor; + stroke-linecap: round; + stroke-linejoin: round; + stroke-width: 32px; + `}))}}),LD=ch("time",()=>H("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},H("path",{d:"M256,64C150,64,64,150,64,256s86,192,192,192,192-86,192-192S362,64,256,64Z",style:` + fill: none; + stroke: currentColor; + stroke-miterlimit: 10; + stroke-width: 32px; + `}),H("polyline",{points:"256 128 256 272 352 272",style:` + fill: none; + stroke: currentColor; + stroke-linecap: round; + stroke-linejoin: round; + stroke-width: 32px; + `}))),DD=ch("to",()=>H("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},H("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},H("g",{fill:"currentColor","fill-rule":"nonzero"},H("path",{d:"M11.2654,3.20511 C10.9644,2.92049 10.4897,2.93371 10.2051,3.23464 C9.92049,3.53558 9.93371,4.01027 10.2346,4.29489 L15.4737,9.25 L2.75,9.25 C2.33579,9.25 2,9.58579 2,10.0000012 C2,10.4142 2.33579,10.75 2.75,10.75 L15.476,10.75 L10.2346,15.7073 C9.93371,15.9919 9.92049,16.4666 10.2051,16.7675 C10.4897,17.0684 10.9644,17.0817 11.2654,16.797 L17.6826,10.7276 C17.8489,10.5703 17.9489,10.3702 17.9826,10.1614 C17.994,10.1094 18,10.0554 18,10.0000012 C18,9.94241 17.9935,9.88633 17.9812,9.83246 C17.9462,9.62667 17.8467,9.42976 17.6826,9.27455 L11.2654,3.20511 Z"}))))),yr=$e({props:{onFocus:Function,onBlur:Function},setup(e){return()=>H("div",{style:"width: 0; height: 0",tabindex:0,onFocus:e.onFocus,onBlur:e.onBlur})}});function Dv(e){return Array.isArray(e)?e:[e]}const Mu={STOP:"STOP"};function cy(e,t){const n=t(e);e.children!==void 0&&n!==Mu.STOP&&e.children.forEach(i=>cy(i,t))}function ID(e,t={}){const{preserveGroup:n=!1}=t,i=[],s=n?d=>{d.isLeaf||(i.push(d.key),a(d.children))}:d=>{d.isLeaf||(d.isGroup||i.push(d.key),a(d.children))};function a(d){d.forEach(s)}return a(e),i}function MD(e,t){const{isLeaf:n}=e;return n!==void 0?n:!t(e)}function AD(e){return e.children}function $D(e){return e.key}function OD(){return!1}function FD(e,t){const{isLeaf:n}=e;return!(n===!1&&!Array.isArray(t(e)))}function BD(e){return e.disabled===!0}function HD(e,t){return e.isLeaf===!1&&!Array.isArray(t(e))}function Td(e){var t;return e==null?[]:Array.isArray(e)?e:(t=e.checkedKeys)!==null&&t!==void 0?t:[]}function Ed(e){var t;return e==null||Array.isArray(e)?[]:(t=e.indeterminateKeys)!==null&&t!==void 0?t:[]}function ND(e,t){const n=new Set(e);return t.forEach(i=>{n.has(i)||n.add(i)}),Array.from(n)}function UD(e,t){const n=new Set(e);return t.forEach(i=>{n.has(i)&&n.delete(i)}),Array.from(n)}function zD(e){return(e==null?void 0:e.type)==="group"}function VD(e){const t=new Map;return e.forEach((n,i)=>{t.set(n.key,i)}),n=>{var i;return(i=t.get(n))!==null&&i!==void 0?i:null}}class KD extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function WD(e,t,n,i){return cc(t.concat(e),n,i,!1)}function jD(e,t){const n=new Set;return e.forEach(i=>{const s=t.treeNodeMap.get(i);if(s!==void 0){let a=s.parent;for(;a!==null&&!(a.disabled||n.has(a.key));)n.add(a.key),a=a.parent}}),n}function qD(e,t,n,i){const s=cc(t,n,i,!1),a=cc(e,n,i,!0),d=jD(e,n),r=[];return s.forEach(o=>{(a.has(o)||d.has(o))&&r.push(o)}),r.forEach(o=>s.delete(o)),s}function Pd(e,t){const{checkedKeys:n,keysToCheck:i,keysToUncheck:s,indeterminateKeys:a,cascade:d,leafOnly:r,checkStrategy:o,allowNotLoaded:c}=e;if(!d)return i!==void 0?{checkedKeys:ND(n,i),indeterminateKeys:Array.from(a)}:s!==void 0?{checkedKeys:UD(n,s),indeterminateKeys:Array.from(a)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(a)};const{levelTreeNodeMap:h}=t;let u;s!==void 0?u=qD(s,n,t,c):i!==void 0?u=WD(i,n,t,c):u=cc(n,t,c,!1);const v=o==="parent",m=o==="child"||r,b=u,g=new Set,l=Math.max.apply(null,Array.from(h.keys()));for(let f=l;f>=0;f-=1){const p=f===0,y=h.get(f);for(const C of y){if(C.isLeaf)continue;const{key:k,shallowLoaded:E}=C;if(m&&E&&C.children.forEach(A=>{!A.disabled&&!A.isLeaf&&A.shallowLoaded&&b.has(A.key)&&b.delete(A.key)}),C.disabled||!E)continue;let I=!0,S=!1,P=!0;for(const A of C.children){const L=A.key;if(!A.disabled){if(P&&(P=!1),b.has(L))S=!0;else if(g.has(L)){S=!0,I=!1;break}else if(I=!1,S)break}}I&&!P?(v&&C.children.forEach(A=>{!A.disabled&&b.has(A.key)&&b.delete(A.key)}),b.add(k)):S&&g.add(k),p&&m&&b.has(k)&&b.delete(k)}}return{checkedKeys:Array.from(b),indeterminateKeys:Array.from(g)}}function cc(e,t,n,i){const{treeNodeMap:s,getChildren:a}=t,d=new Set,r=new Set(e);return e.forEach(o=>{const c=s.get(o);c!==void 0&&cy(c,h=>{if(h.disabled)return Mu.STOP;const{key:u}=h;if(!d.has(u)&&(d.add(u),r.add(u),HD(h.rawNode,a))){if(i)return Mu.STOP;if(!n)throw new KD}})}),r}function YD(e,{includeGroup:t=!1,includeSelf:n=!0},i){var s;const a=i.treeNodeMap;let d=e==null?null:(s=a.get(e))!==null&&s!==void 0?s:null;const r={keyPath:[],treeNodePath:[],treeNode:d};if(d!=null&&d.ignored)return r.treeNode=null,r;for(;d;)!d.ignored&&(t||!d.isGroup)&&r.treeNodePath.push(d),d=d.parent;return r.treeNodePath.reverse(),n||r.treeNodePath.pop(),r.keyPath=r.treeNodePath.map(o=>o.key),r}function GD(e){if(e.length===0)return null;const t=e[0];return t.isGroup||t.ignored||t.disabled?t.getNext():t}function XD(e,t){const n=e.siblings,i=n.length,{index:s}=e;return t?n[(s+1)%i]:s===n.length-1?null:n[s+1]}function Iv(e,t,{loop:n=!1,includeDisabled:i=!1}={}){const s=t==="prev"?JD:XD,a={reverse:t==="prev"};let d=!1,r=null;function o(c){if(c!==null){if(c===e){if(!d)d=!0;else if(!e.disabled&&!e.isGroup){r=e;return}}else if((!c.disabled||i)&&!c.ignored&&!c.isGroup){r=c;return}if(c.isGroup){const h=Uh(c,a);h!==null?r=h:o(s(c,n))}else{const h=s(c,!1);if(h!==null)o(h);else{const u=ZD(c);u!=null&&u.isGroup?o(s(u,n)):n&&o(s(c,!0))}}}}return o(e),r}function JD(e,t){const n=e.siblings,i=n.length,{index:s}=e;return t?n[(s-1+i)%i]:s===0?null:n[s-1]}function ZD(e){return e.parent}function Uh(e,t={}){const{reverse:n=!1}=t,{children:i}=e;if(i){const{length:s}=i,a=n?s-1:0,d=n?-1:s,r=n?-1:1;for(let o=a;o!==d;o+=r){const c=i[o];if(!c.disabled&&!c.ignored)if(c.isGroup){const h=Uh(c,t);if(h!==null)return h}else return c}}return null}const QD={getChild(){return this.ignored?null:Uh(this)},getParent(){const{parent:e}=this;return e!=null&&e.isGroup?e.getParent():e},getNext(e={}){return Iv(this,"next",e)},getPrev(e={}){return Iv(this,"prev",e)}};function eI(e,t){const n=t?new Set(t):void 0,i=[];function s(a){a.forEach(d=>{i.push(d),!(d.isLeaf||!d.children||d.ignored)&&(d.isGroup||n===void 0||n.has(d.key))&&s(d.children)})}return s(e),i}function tI(e,t){const n=e.key;for(;t;){if(t.key===n)return!0;t=t.parent}return!1}function dy(e,t,n,i,s,a=null,d=0){const r=[];return e.forEach((o,c)=>{var h;const u=Object.create(i);if(u.rawNode=o,u.siblings=r,u.level=d,u.index=c,u.isFirstChild=c===0,u.isLastChild=c+1===e.length,u.parent=a,!u.ignored){const v=s(o);Array.isArray(v)&&(u.children=dy(v,t,n,i,s,u,d+1))}r.push(u),t.set(u.key,u),n.has(d)||n.set(d,[]),(h=n.get(d))===null||h===void 0||h.push(u)}),r}function Fc(e,t={}){var n;const i=new Map,s=new Map,{getDisabled:a=BD,getIgnored:d=OD,getIsGroup:r=zD,getKey:o=$D}=t,c=(n=t.getChildren)!==null&&n!==void 0?n:AD,h=t.ignoreEmptyChildren?C=>{const k=c(C);return Array.isArray(k)?k.length?k:null:k}:c,u=Object.assign({get key(){return o(this.rawNode)},get disabled(){return a(this.rawNode)},get isGroup(){return r(this.rawNode)},get isLeaf(){return MD(this.rawNode,h)},get shallowLoaded(){return FD(this.rawNode,h)},get ignored(){return d(this.rawNode)},contains(C){return tI(this,C)}},QD),v=dy(e,i,s,u,h);function m(C){if(C==null)return null;const k=i.get(C);return k&&!k.isGroup&&!k.ignored?k:null}function b(C){if(C==null)return null;const k=i.get(C);return k&&!k.ignored?k:null}function g(C,k){const E=b(C);return E?E.getPrev(k):null}function l(C,k){const E=b(C);return E?E.getNext(k):null}function f(C){const k=b(C);return k?k.getParent():null}function p(C){const k=b(C);return k?k.getChild():null}const y={treeNodes:v,treeNodeMap:i,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:h,getFlattenedNodes(C){return eI(v,C)},getNode:m,getPrev:g,getNext:l,getParent:f,getChild:p,getFirstAvailableNode(){return GD(v)},getPath(C,k={}){return YD(C,k,y)},getCheckedKeys(C,k={}){const{cascade:E=!0,leafOnly:I=!1,checkStrategy:S="all",allowNotLoaded:P=!1}=k;return Pd({checkedKeys:Td(C),indeterminateKeys:Ed(C),cascade:E,leafOnly:I,checkStrategy:S,allowNotLoaded:P},y)},check(C,k,E={}){const{cascade:I=!0,leafOnly:S=!1,checkStrategy:P="all",allowNotLoaded:A=!1}=E;return Pd({checkedKeys:Td(k),indeterminateKeys:Ed(k),keysToCheck:C==null?[]:Dv(C),cascade:I,leafOnly:S,checkStrategy:P,allowNotLoaded:A},y)},uncheck(C,k,E={}){const{cascade:I=!0,leafOnly:S=!1,checkStrategy:P="all",allowNotLoaded:A=!1}=E;return Pd({checkedKeys:Td(k),indeterminateKeys:Ed(k),keysToUncheck:C==null?[]:Dv(C),cascade:I,leafOnly:S,checkStrategy:P,allowNotLoaded:A},y)},getNonLeafKeys(C={}){return ID(v,C)}};return y}const nI=Re("empty",` + display: flex; + flex-direction: column; + align-items: center; + font-size: var(--n-font-size); +`,[tt("icon",` + width: var(--n-icon-size); + height: var(--n-icon-size); + font-size: var(--n-icon-size); + line-height: var(--n-icon-size); + color: var(--n-icon-color); + transition: + color .3s var(--n-bezier); + `,[Ke("+",[tt("description",` + margin-top: 8px; + `)])]),tt("description",` + transition: color .3s var(--n-bezier); + color: var(--n-text-color); + `),tt("extra",` + text-align: center; + transition: color .3s var(--n-bezier); + margin-top: 12px; + color: var(--n-extra-text-color); + `)]),iI=Object.assign(Object.assign({},Ht.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),uy=$e({name:"Empty",props:iI,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedComponentPropsRef:i}=bn(e),s=Ht("Empty","-empty",nI,D0,e,t),{localeRef:a}=rs("Empty"),d=W(()=>{var h,u,v;return(h=e.description)!==null&&h!==void 0?h:(v=(u=i==null?void 0:i.value)===null||u===void 0?void 0:u.Empty)===null||v===void 0?void 0:v.description}),r=W(()=>{var h,u;return((u=(h=i==null?void 0:i.value)===null||h===void 0?void 0:h.Empty)===null||u===void 0?void 0:u.renderIcon)||(()=>H(TD,null))}),o=W(()=>{const{size:h}=e,{common:{cubicBezierEaseInOut:u},self:{[Mt("iconSize",h)]:v,[Mt("fontSize",h)]:m,textColor:b,iconColor:g,extraTextColor:l}}=s.value;return{"--n-icon-size":v,"--n-font-size":m,"--n-bezier":u,"--n-text-color":b,"--n-icon-color":g,"--n-extra-text-color":l}}),c=n?Bn("empty",W(()=>{let h="";const{size:u}=e;return h+=u[0],h}),o,e):void 0;return{mergedClsPrefix:t,mergedRenderIcon:r,localizedDescription:W(()=>d.value||a.value.description),cssVars:n?void 0:o,themeClass:c==null?void 0:c.themeClass,onRender:c==null?void 0:c.onRender}},render(){const{$slots:e,mergedClsPrefix:t,onRender:n}=this;return n==null||n(),H("div",{class:[`${t}-empty`,this.themeClass],style:this.cssVars},this.showIcon?H("div",{class:`${t}-empty__icon`},e.icon?e.icon():H(Un,{clsPrefix:t},{default:this.mergedRenderIcon})):null,this.showDescription?H("div",{class:`${t}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?H("div",{class:`${t}-empty__extra`},e.extra()):null)}}),Mv=$e({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:e,renderOptionRef:t,labelFieldRef:n,nodePropsRef:i}=zt($h);return{labelField:n,nodeProps:i,renderLabel:e,renderOption:t}},render(){const{clsPrefix:e,renderLabel:t,renderOption:n,nodeProps:i,tmNode:{rawNode:s}}=this,a=i==null?void 0:i(s),d=t?t(s,!1):Cs(s[this.labelField],s,!1),r=H("div",Object.assign({},a,{class:[`${e}-base-select-group-header`,a==null?void 0:a.class]}),d);return s.render?s.render({node:r,option:s}):n?n({node:r,option:s,selected:!1}):r}});function sI(e,t){return H(xi,{name:"fade-in-scale-up-transition"},{default:()=>e?H(Un,{clsPrefix:t,class:`${t}-base-select-option__check`},{default:()=>H(RD)}):null})}const Av=$e({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(e){const{valueRef:t,pendingTmNodeRef:n,multipleRef:i,valueSetRef:s,renderLabelRef:a,renderOptionRef:d,labelFieldRef:r,valueFieldRef:o,showCheckmarkRef:c,nodePropsRef:h,handleOptionClick:u,handleOptionMouseEnter:v}=zt($h),m=en(()=>{const{value:f}=n;return f?e.tmNode.key===f.key:!1});function b(f){const{tmNode:p}=e;p.disabled||u(f,p)}function g(f){const{tmNode:p}=e;p.disabled||v(f,p)}function l(f){const{tmNode:p}=e,{value:y}=m;p.disabled||y||v(f,p)}return{multiple:i,isGrouped:en(()=>{const{tmNode:f}=e,{parent:p}=f;return p&&p.rawNode.type==="group"}),showCheckmark:c,nodeProps:h,isPending:m,isSelected:en(()=>{const{value:f}=t,{value:p}=i;if(f===null)return!1;const y=e.tmNode.rawNode[o.value];if(p){const{value:C}=s;return C.has(y)}else return f===y}),labelField:r,renderLabel:a,renderOption:d,handleMouseMove:l,handleMouseEnter:g,handleClick:b}},render(){const{clsPrefix:e,tmNode:{rawNode:t},isSelected:n,isPending:i,isGrouped:s,showCheckmark:a,nodeProps:d,renderOption:r,renderLabel:o,handleClick:c,handleMouseEnter:h,handleMouseMove:u}=this,v=sI(n,e),m=o?[o(t,n),a&&v]:[Cs(t[this.labelField],t,n),a&&v],b=d==null?void 0:d(t),g=H("div",Object.assign({},b,{class:[`${e}-base-select-option`,t.class,b==null?void 0:b.class,{[`${e}-base-select-option--disabled`]:t.disabled,[`${e}-base-select-option--selected`]:n,[`${e}-base-select-option--grouped`]:s,[`${e}-base-select-option--pending`]:i,[`${e}-base-select-option--show-checkmark`]:a}],style:[(b==null?void 0:b.style)||"",t.style||""],onClick:Ra([c,b==null?void 0:b.onClick]),onMouseenter:Ra([h,b==null?void 0:b.onMouseenter]),onMousemove:Ra([u,b==null?void 0:b.onMousemove])}),H("div",{class:`${e}-base-select-option__content`},m));return t.render?t.render({node:g,option:t,selected:n}):r?r({node:g,option:t,selected:n}):g}}),{cubicBezierEaseIn:$v,cubicBezierEaseOut:Ov}=I0;function Vo({transformOrigin:e="inherit",duration:t=".2s",enterScale:n=".9",originalTransform:i="",originalTransition:s=""}={}){return[Ke("&.fade-in-scale-up-transition-leave-active",{transformOrigin:e,transition:`opacity ${t} ${$v}, transform ${t} ${$v} ${s&&`,${s}`}`}),Ke("&.fade-in-scale-up-transition-enter-active",{transformOrigin:e,transition:`opacity ${t} ${Ov}, transform ${t} ${Ov} ${s&&`,${s}`}`}),Ke("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${i} scale(${n})`}),Ke("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${i} scale(1)`})]}const rI=Re("base-select-menu",` + line-height: 1.5; + outline: none; + z-index: 0; + position: relative; + border-radius: var(--n-border-radius); + transition: + background-color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier); + background-color: var(--n-color); +`,[Re("scrollbar",` + max-height: var(--n-height); + `),Re("virtual-list",` + max-height: var(--n-height); + `),Re("base-select-option",` + min-height: var(--n-option-height); + font-size: var(--n-option-font-size); + display: flex; + align-items: center; + `,[tt("content",` + z-index: 1; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + `)]),Re("base-select-group-header",` + min-height: var(--n-option-height); + font-size: .93em; + display: flex; + align-items: center; + `),Re("base-select-menu-option-wrapper",` + position: relative; + width: 100%; + `),tt("loading, empty",` + display: flex; + padding: 12px 32px; + flex: 1; + justify-content: center; + `),tt("loading",` + color: var(--n-loading-color); + font-size: var(--n-loading-size); + `),tt("header",` + padding: 8px var(--n-option-padding-left); + font-size: var(--n-option-font-size); + transition: + color .3s var(--n-bezier), + border-color .3s var(--n-bezier); + border-bottom: 1px solid var(--n-action-divider-color); + color: var(--n-action-text-color); + `),tt("action",` + padding: 8px var(--n-option-padding-left); + font-size: var(--n-option-font-size); + transition: + color .3s var(--n-bezier), + border-color .3s var(--n-bezier); + border-top: 1px solid var(--n-action-divider-color); + color: var(--n-action-text-color); + `),Re("base-select-group-header",` + position: relative; + cursor: default; + padding: var(--n-option-padding); + color: var(--n-group-header-text-color); + `),Re("base-select-option",` + cursor: pointer; + position: relative; + padding: var(--n-option-padding); + transition: + color .3s var(--n-bezier), + opacity .3s var(--n-bezier); + box-sizing: border-box; + color: var(--n-option-text-color); + opacity: 1; + `,[We("show-checkmark",` + padding-right: calc(var(--n-option-padding-right) + 20px); + `),Ke("&::before",` + content: ""; + position: absolute; + left: 4px; + right: 4px; + top: 0; + bottom: 0; + border-radius: var(--n-border-radius); + transition: background-color .3s var(--n-bezier); + `),Ke("&:active",` + color: var(--n-option-text-color-pressed); + `),We("grouped",` + padding-left: calc(var(--n-option-padding-left) * 1.5); + `),We("pending",[Ke("&::before",` + background-color: var(--n-option-color-pending); + `)]),We("selected",` + color: var(--n-option-text-color-active); + `,[Ke("&::before",` + background-color: var(--n-option-color-active); + `),We("pending",[Ke("&::before",` + background-color: var(--n-option-color-active-pending); + `)])]),We("disabled",` + cursor: not-allowed; + `,[xn("selected",` + color: var(--n-option-text-color-disabled); + `),We("selected",` + opacity: var(--n-option-opacity-disabled); + `)]),tt("check",` + font-size: 16px; + position: absolute; + right: calc(var(--n-option-padding-right) - 4px); + top: calc(50% - 7px); + color: var(--n-option-check-color); + transition: color .3s var(--n-bezier); + `,[Vo({enterScale:"0.5"})])])]),hy=$e({name:"InternalSelectMenu",props:Object.assign(Object.assign({},Ht.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=bn(e),i=Rs("InternalSelectMenu",n,t),s=Ht("InternalSelectMenu","-internal-select-menu",rI,M0,e,ut(e,"clsPrefix")),a=F(null),d=F(null),r=F(null),o=W(()=>e.treeMate.getFlattenedNodes()),c=W(()=>VD(o.value)),h=F(null);function u(){const{treeMate:G}=e;let te=null;const{value:se}=e;se===null?te=G.getFirstAvailableNode():(e.multiple?te=G.getNode((se||[])[(se||[]).length-1]):te=G.getNode(se),(!te||te.disabled)&&(te=G.getFirstAvailableNode())),M(te||null)}function v(){const{value:G}=h;G&&!e.treeMate.getNode(G.key)&&(h.value=null)}let m;wt(()=>e.show,G=>{G?m=wt(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?u():v(),hn(B)):v()},{immediate:!0}):m==null||m()},{immediate:!0}),Vt(()=>{m==null||m()});const b=W(()=>vo(s.value.self[Mt("optionHeight",e.size)])),g=W(()=>go(s.value.self[Mt("padding",e.size)])),l=W(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),f=W(()=>{const G=o.value;return G&&G.length===0});function p(G){const{onToggle:te}=e;te&&te(G)}function y(G){const{onScroll:te}=e;te&&te(G)}function C(G){var te;(te=r.value)===null||te===void 0||te.sync(),y(G)}function k(){var G;(G=r.value)===null||G===void 0||G.sync()}function E(){const{value:G}=h;return G||null}function I(G,te){te.disabled||M(te,!1)}function S(G,te){te.disabled||p(te)}function P(G){var te;Ti(G,"action")||(te=e.onKeyup)===null||te===void 0||te.call(e,G)}function A(G){var te;Ti(G,"action")||(te=e.onKeydown)===null||te===void 0||te.call(e,G)}function L(G){var te;(te=e.onMousedown)===null||te===void 0||te.call(e,G),!e.focusable&&G.preventDefault()}function x(){const{value:G}=h;G&&M(G.getNext({loop:!0}),!0)}function D(){const{value:G}=h;G&&M(G.getPrev({loop:!0}),!0)}function M(G,te=!1){h.value=G,te&&B()}function B(){var G,te;const se=h.value;if(!se)return;const oe=c.value(se.key);oe!==null&&(e.virtualScroll?(G=d.value)===null||G===void 0||G.scrollTo({index:oe}):(te=r.value)===null||te===void 0||te.scrollTo({index:oe,elSize:b.value}))}function z(G){var te,se;!((te=a.value)===null||te===void 0)&&te.contains(G.target)&&((se=e.onFocus)===null||se===void 0||se.call(e,G))}function Y(G){var te,se;!((te=a.value)===null||te===void 0)&&te.contains(G.relatedTarget)||(se=e.onBlur)===null||se===void 0||se.call(e,G)}Rn($h,{handleOptionMouseEnter:I,handleOptionClick:S,valueSetRef:l,pendingTmNodeRef:h,nodePropsRef:ut(e,"nodeProps"),showCheckmarkRef:ut(e,"showCheckmark"),multipleRef:ut(e,"multiple"),valueRef:ut(e,"value"),renderLabelRef:ut(e,"renderLabel"),renderOptionRef:ut(e,"renderOption"),labelFieldRef:ut(e,"labelField"),valueFieldRef:ut(e,"valueField")}),Rn(j_,a),It(()=>{const{value:G}=r;G&&G.sync()});const U=W(()=>{const{size:G}=e,{common:{cubicBezierEaseInOut:te},self:{height:se,borderRadius:oe,color:Fe,groupHeaderTextColor:K,actionDividerColor:Z,optionTextColorPressed:J,optionTextColor:ae,optionTextColorDisabled:Ie,optionTextColorActive:de,optionOpacityDisabled:Le,optionCheckColor:xe,actionTextColor:Qe,optionColorPending:De,optionColorActive:ne,loadingColor:ue,loadingSize:he,optionColorActivePending:Ae,[Mt("optionFontSize",G)]:ce,[Mt("optionHeight",G)]:Je,[Mt("optionPadding",G)]:ye}}=s.value;return{"--n-height":se,"--n-action-divider-color":Z,"--n-action-text-color":Qe,"--n-bezier":te,"--n-border-radius":oe,"--n-color":Fe,"--n-option-font-size":ce,"--n-group-header-text-color":K,"--n-option-check-color":xe,"--n-option-color-pending":De,"--n-option-color-active":ne,"--n-option-color-active-pending":Ae,"--n-option-height":Je,"--n-option-opacity-disabled":Le,"--n-option-text-color":ae,"--n-option-text-color-active":de,"--n-option-text-color-disabled":Ie,"--n-option-text-color-pressed":J,"--n-option-padding":ye,"--n-option-padding-left":go(ye,"left"),"--n-option-padding-right":go(ye,"right"),"--n-loading-color":ue,"--n-loading-size":he}}),{inlineThemeDisabled:N}=e,V=N?Bn("internal-select-menu",W(()=>e.size[0]),U,e):void 0,j={selfRef:a,next:x,prev:D,getPendingTmNode:E};return iy(a,e.onResize),Object.assign({mergedTheme:s,mergedClsPrefix:t,rtlEnabled:i,virtualListRef:d,scrollbarRef:r,itemSize:b,padding:g,flattenedNodes:o,empty:f,virtualListContainer(){const{value:G}=d;return G==null?void 0:G.listElRef},virtualListContent(){const{value:G}=d;return G==null?void 0:G.itemsElRef},doScroll:y,handleFocusin:z,handleFocusout:Y,handleKeyUp:P,handleKeyDown:A,handleMouseDown:L,handleVirtualListResize:k,handleVirtualListScroll:C,cssVars:N?void 0:U,themeClass:V==null?void 0:V.themeClass,onRender:V==null?void 0:V.onRender},j)},render(){const{$slots:e,virtualScroll:t,clsPrefix:n,mergedTheme:i,themeClass:s,onRender:a}=this;return a==null||a(),H("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${n}-base-select-menu`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,s,this.multiple&&`${n}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},qi(e.header,d=>d&&H("div",{class:`${n}-base-select-menu__header`,"data-header":!0,key:"header"},d)),this.loading?H("div",{class:`${n}-base-select-menu__loading`},H(kc,{clsPrefix:n,strokeWidth:20})):this.empty?H("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},Jt(e.empty,()=>[H(uy,{theme:i.peers.Empty,themeOverrides:i.peerOverrides.Empty,size:this.size})])):H($i,{ref:"scrollbarRef",theme:i.peers.Scrollbar,themeOverrides:i.peerOverrides.Scrollbar,scrollable:this.scrollable,container:t?this.virtualListContainer:void 0,content:t?this.virtualListContent:void 0,onScroll:t?void 0:this.doScroll},{default:()=>t?H(Eo,{ref:"virtualListRef",class:`${n}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:d})=>d.isGroup?H(Mv,{key:d.key,clsPrefix:n,tmNode:d}):d.ignored?null:H(Av,{clsPrefix:n,key:d.key,tmNode:d})}):H("div",{class:`${n}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(d=>d.isGroup?H(Mv,{key:d.key,clsPrefix:n,tmNode:d}):H(Av,{clsPrefix:n,key:d.key,tmNode:d})))}),qi(e.action,d=>d&&[H("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},d),H(yr,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),Ld={top:"bottom",bottom:"top",left:"right",right:"left"},Nn="var(--n-arrow-height) * 1.414",oI=Ke([Re("popover",` + transition: + box-shadow .3s var(--n-bezier), + background-color .3s var(--n-bezier), + color .3s var(--n-bezier); + position: relative; + font-size: var(--n-font-size); + color: var(--n-text-color); + box-shadow: var(--n-box-shadow); + word-break: break-word; + `,[Ke(">",[Re("scrollbar",` + height: inherit; + max-height: inherit; + `)]),xn("raw",` + background-color: var(--n-color); + border-radius: var(--n-border-radius); + `,[xn("scrollable",[xn("show-header-or-footer","padding: var(--n-padding);")])]),tt("header",` + padding: var(--n-padding); + border-bottom: 1px solid var(--n-divider-color); + transition: border-color .3s var(--n-bezier); + `),tt("footer",` + padding: var(--n-padding); + border-top: 1px solid var(--n-divider-color); + transition: border-color .3s var(--n-bezier); + `),We("scrollable, show-header-or-footer",[tt("content",` + padding: var(--n-padding); + `)])]),Re("popover-shared",` + transform-origin: inherit; + `,[Re("popover-arrow-wrapper",` + position: absolute; + overflow: hidden; + pointer-events: none; + `,[Re("popover-arrow",` + transition: background-color .3s var(--n-bezier); + position: absolute; + display: block; + width: calc(${Nn}); + height: calc(${Nn}); + box-shadow: 0 0 8px 0 rgba(0, 0, 0, .12); + transform: rotate(45deg); + background-color: var(--n-color); + pointer-events: all; + `)]),Ke("&.popover-transition-enter-from, &.popover-transition-leave-to",` + opacity: 0; + transform: scale(.85); + `),Ke("&.popover-transition-enter-to, &.popover-transition-leave-from",` + transform: scale(1); + opacity: 1; + `),Ke("&.popover-transition-enter-active",` + transition: + box-shadow .3s var(--n-bezier), + background-color .3s var(--n-bezier), + color .3s var(--n-bezier), + opacity .15s var(--n-bezier-ease-out), + transform .15s var(--n-bezier-ease-out); + `),Ke("&.popover-transition-leave-active",` + transition: + box-shadow .3s var(--n-bezier), + background-color .3s var(--n-bezier), + color .3s var(--n-bezier), + opacity .15s var(--n-bezier-ease-in), + transform .15s var(--n-bezier-ease-in); + `)]),zi("top-start",` + top: calc(${Nn} / -2); + left: calc(${As("top-start")} - var(--v-offset-left)); + `),zi("top",` + top: calc(${Nn} / -2); + transform: translateX(calc(${Nn} / -2)) rotate(45deg); + left: 50%; + `),zi("top-end",` + top: calc(${Nn} / -2); + right: calc(${As("top-end")} + var(--v-offset-left)); + `),zi("bottom-start",` + bottom: calc(${Nn} / -2); + left: calc(${As("bottom-start")} - var(--v-offset-left)); + `),zi("bottom",` + bottom: calc(${Nn} / -2); + transform: translateX(calc(${Nn} / -2)) rotate(45deg); + left: 50%; + `),zi("bottom-end",` + bottom: calc(${Nn} / -2); + right: calc(${As("bottom-end")} + var(--v-offset-left)); + `),zi("left-start",` + left: calc(${Nn} / -2); + top: calc(${As("left-start")} - var(--v-offset-top)); + `),zi("left",` + left: calc(${Nn} / -2); + transform: translateY(calc(${Nn} / -2)) rotate(45deg); + top: 50%; + `),zi("left-end",` + left: calc(${Nn} / -2); + bottom: calc(${As("left-end")} + var(--v-offset-top)); + `),zi("right-start",` + right: calc(${Nn} / -2); + top: calc(${As("right-start")} - var(--v-offset-top)); + `),zi("right",` + right: calc(${Nn} / -2); + transform: translateY(calc(${Nn} / -2)) rotate(45deg); + top: 50%; + `),zi("right-end",` + right: calc(${Nn} / -2); + bottom: calc(${As("right-end")} + var(--v-offset-top)); + `),...CD({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(e,t)=>{const n=["right","left"].includes(t),i=n?"width":"height";return e.map(s=>{const a=s.split("-")[1]==="end",r=`calc((${`var(--v-target-${i}, 0px)`} - ${Nn}) / 2)`,o=As(s);return Ke(`[v-placement="${s}"] >`,[Re("popover-shared",[We("center-arrow",[Re("popover-arrow",`${t}: calc(max(${r}, ${o}) ${a?"+":"-"} var(--v-offset-${n?"left":"top"}));`)])])])})})]);function As(e){return["top","bottom"].includes(e.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function zi(e,t){const n=e.split("-")[0],i=["top","bottom"].includes(n)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return Ke(`[v-placement="${e}"] >`,[Re("popover-shared",` + margin-${Ld[n]}: var(--n-space); + `,[We("show-arrow",` + margin-${Ld[n]}: var(--n-space-arrow); + `),We("overlap",` + margin: 0; + `),A0("popover-arrow-wrapper",` + right: 0; + left: 0; + top: 0; + bottom: 0; + ${n}: 100%; + ${Ld[n]}: auto; + ${i} + `,[Re("popover-arrow",t)])])])}const fy=Object.assign(Object.assign({},Ht.props),{to:di.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number});function py({arrowClass:e,arrowStyle:t,arrowWrapperClass:n,arrowWrapperStyle:i,clsPrefix:s}){return H("div",{key:"__popover-arrow__",style:i,class:[`${s}-popover-arrow-wrapper`,n]},H("div",{class:[`${s}-popover-arrow`,e],style:t}))}const aI=$e({name:"PopoverBody",inheritAttrs:!1,props:fy,setup(e,{slots:t,attrs:n}){const{namespaceRef:i,mergedClsPrefixRef:s,inlineThemeDisabled:a}=bn(e),d=Ht("Popover","-popover",oI,$0,e,s),r=F(null),o=zt("NPopover"),c=F(null),h=F(e.show),u=F(!1);Yi(()=>{const{show:I}=e;I&&!cL()&&!e.internalDeactivateImmediately&&(u.value=!0)});const v=W(()=>{const{trigger:I,onClickoutside:S}=e,P=[],{positionManuallyRef:{value:A}}=o;return A||(I==="click"&&!S&&P.push([Kr,C,void 0,{capture:!0}]),I==="hover"&&P.push([WP,y])),S&&P.push([Kr,C,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&u.value)&&P.push([Ci,e.show]),P}),m=W(()=>{const{common:{cubicBezierEaseInOut:I,cubicBezierEaseIn:S,cubicBezierEaseOut:P},self:{space:A,spaceArrow:L,padding:x,fontSize:D,textColor:M,dividerColor:B,color:z,boxShadow:Y,borderRadius:U,arrowHeight:N,arrowOffset:V,arrowOffsetVertical:j}}=d.value;return{"--n-box-shadow":Y,"--n-bezier":I,"--n-bezier-ease-in":S,"--n-bezier-ease-out":P,"--n-font-size":D,"--n-text-color":M,"--n-color":z,"--n-divider-color":B,"--n-border-radius":U,"--n-arrow-height":N,"--n-arrow-offset":V,"--n-arrow-offset-vertical":j,"--n-padding":x,"--n-space":A,"--n-space-arrow":L}}),b=W(()=>{const I=e.width==="trigger"?void 0:ci(e.width),S=[];I&&S.push({width:I});const{maxWidth:P,minWidth:A}=e;return P&&S.push({maxWidth:ci(P)}),A&&S.push({maxWidth:ci(A)}),a||S.push(m.value),S}),g=a?Bn("popover",void 0,m,e):void 0;o.setBodyInstance({syncPosition:l}),Vt(()=>{o.setBodyInstance(null)}),wt(ut(e,"show"),I=>{e.animated||(I?h.value=!0:h.value=!1)});function l(){var I;(I=r.value)===null||I===void 0||I.syncPosition()}function f(I){e.trigger==="hover"&&e.keepAliveOnHover&&e.show&&o.handleMouseEnter(I)}function p(I){e.trigger==="hover"&&e.keepAliveOnHover&&o.handleMouseLeave(I)}function y(I){e.trigger==="hover"&&!k().contains(Nr(I))&&o.handleMouseMoveOutside(I)}function C(I){(e.trigger==="click"&&!k().contains(Nr(I))||e.onClickoutside)&&o.handleClickOutside(I)}function k(){return o.getTriggerElement()}Rn($c,c),Rn(Oh,null),Rn(Fh,null);function E(){if(g==null||g.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&u.value))return null;let S;const P=o.internalRenderBodyRef.value,{value:A}=s;if(P)S=P([`${A}-popover-shared`,g==null?void 0:g.themeClass.value,e.overlap&&`${A}-popover-shared--overlap`,e.showArrow&&`${A}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${A}-popover-shared--center-arrow`],c,b.value,f,p);else{const{value:L}=o.extraClassRef,{internalTrapFocus:x}=e,D=!xf(t.header)||!xf(t.footer),M=()=>{var B,z;const Y=D?H(Me,null,qi(t.header,V=>V?H("div",{class:[`${A}-popover__header`,e.headerClass],style:e.headerStyle},V):null),qi(t.default,V=>V?H("div",{class:[`${A}-popover__content`,e.contentClass],style:e.contentStyle},t):null),qi(t.footer,V=>V?H("div",{class:[`${A}-popover__footer`,e.footerClass],style:e.footerStyle},V):null)):e.scrollable?(B=t.default)===null||B===void 0?void 0:B.call(t):H("div",{class:[`${A}-popover__content`,e.contentClass],style:e.contentStyle},t),U=e.scrollable?H(jg,{contentClass:D?void 0:`${A}-popover__content ${(z=e.contentClass)!==null&&z!==void 0?z:""}`,contentStyle:D?void 0:e.contentStyle},{default:()=>Y}):Y,N=e.showArrow?py({arrowClass:e.arrowClass,arrowStyle:e.arrowStyle,arrowWrapperClass:e.arrowWrapperClass,arrowWrapperStyle:e.arrowWrapperStyle,clsPrefix:A}):null;return[U,N]};S=H("div",fr({class:[`${A}-popover`,`${A}-popover-shared`,g==null?void 0:g.themeClass.value,L.map(B=>`${A}-${B}`),{[`${A}-popover--scrollable`]:e.scrollable,[`${A}-popover--show-header-or-footer`]:D,[`${A}-popover--raw`]:e.raw,[`${A}-popover-shared--overlap`]:e.overlap,[`${A}-popover-shared--show-arrow`]:e.showArrow,[`${A}-popover-shared--center-arrow`]:e.arrowPointToCenter}],ref:c,style:b.value,onKeydown:o.handleKeydown,onMouseenter:f,onMouseleave:p},n),x?H(aL,{active:e.show,autoFocus:!0},{default:M}):M())}return ct(S,v.value)}return{displayed:u,namespace:i,isMounted:o.isMountedRef,zIndex:o.zIndexRef,followerRef:r,adjustedTo:di(e),followerEnabled:h,renderContentNode:E}},render(){return H(zo,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===di.tdkey},{default:()=>this.animated?H(xi,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var e;(e=this.internalOnAfterLeave)===null||e===void 0||e.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}}),lI=Object.keys(fy),cI={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function dI(e,t,n){cI[t].forEach(i=>{e.props?e.props=Object.assign({},e.props):e.props={};const s=e.props[i],a=n[i];s?e.props[i]=(...d)=>{s(...d),a(...d)}:e.props[i]=a})}const Wr={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:di.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},uI=Object.assign(Object.assign(Object.assign({},Ht.props),Wr),{internalOnAfterLeave:Function,internalRenderBody:Function}),Ko=$e({name:"Popover",inheritAttrs:!1,props:uI,__popover__:!0,setup(e){const t=Ba(),n=F(null),i=W(()=>e.show),s=F(e.defaultShow),a=Qn(i,s),d=en(()=>e.disabled?!1:a.value),r=()=>{if(e.disabled)return!0;const{getDisabled:B}=e;return!!(B!=null&&B())},o=()=>r()?!1:a.value,c=Mh(e,["arrow","showArrow"]),h=W(()=>e.overlap?!1:c.value);let u=null;const v=F(null),m=F(null),b=en(()=>e.x!==void 0&&e.y!==void 0);function g(B){const{"onUpdate:show":z,onUpdateShow:Y,onShow:U,onHide:N}=e;s.value=B,z&&rt(z,B),Y&&rt(Y,B),B&&U&&rt(U,!0),B&&N&&rt(N,!1)}function l(){u&&u.syncPosition()}function f(){const{value:B}=v;B&&(window.clearTimeout(B),v.value=null)}function p(){const{value:B}=m;B&&(window.clearTimeout(B),m.value=null)}function y(){const B=r();if(e.trigger==="focus"&&!B){if(o())return;g(!0)}}function C(){const B=r();if(e.trigger==="focus"&&!B){if(!o())return;g(!1)}}function k(){const B=r();if(e.trigger==="hover"&&!B){if(p(),v.value!==null||o())return;const z=()=>{g(!0),v.value=null},{delay:Y}=e;Y===0?z():v.value=window.setTimeout(z,Y)}}function E(){const B=r();if(e.trigger==="hover"&&!B){if(f(),m.value!==null||!o())return;const z=()=>{g(!1),m.value=null},{duration:Y}=e;Y===0?z():m.value=window.setTimeout(z,Y)}}function I(){E()}function S(B){var z;o()&&(e.trigger==="click"&&(f(),p(),g(!1)),(z=e.onClickoutside)===null||z===void 0||z.call(e,B))}function P(){if(e.trigger==="click"&&!r()){f(),p();const B=!o();g(B)}}function A(B){e.internalTrapFocus&&B.key==="Escape"&&(f(),p(),g(!1))}function L(B){s.value=B}function x(){var B;return(B=n.value)===null||B===void 0?void 0:B.targetRef}function D(B){u=B}return Rn("NPopover",{getTriggerElement:x,handleKeydown:A,handleMouseEnter:k,handleMouseLeave:E,handleClickOutside:S,handleMouseMoveOutside:I,setBodyInstance:D,positionManuallyRef:b,isMountedRef:t,zIndexRef:ut(e,"zIndex"),extraClassRef:ut(e,"internalExtraClass"),internalRenderBodyRef:ut(e,"internalRenderBody")}),Yi(()=>{a.value&&r()&&g(!1)}),{binderInstRef:n,positionManually:b,mergedShowConsideringDisabledProp:d,uncontrolledShow:s,mergedShowArrow:h,getMergedShow:o,setShow:L,handleClick:P,handleMouseEnter:k,handleMouseLeave:E,handleFocus:y,handleBlur:C,syncPosition:l}},render(){var e;const{positionManually:t,$slots:n}=this;let i,s=!1;if(!t&&(n.activator?i=mv(n,"activator"):i=mv(n,"trigger"),i)){i=O0(i),i=i.type===F0?H("span",[i]):i;const a={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((e=i.type)===null||e===void 0)&&e.__popover__)s=!0,i.props||(i.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),i.props.internalSyncTargetWithParent=!0,i.props.internalInheritedEventHandlers?i.props.internalInheritedEventHandlers=[a,...i.props.internalInheritedEventHandlers]:i.props.internalInheritedEventHandlers=[a];else{const{internalInheritedEventHandlers:d}=this,r=[a,...d],o={onBlur:c=>{r.forEach(h=>{h.onBlur(c)})},onFocus:c=>{r.forEach(h=>{h.onFocus(c)})},onClick:c=>{r.forEach(h=>{h.onClick(c)})},onMouseenter:c=>{r.forEach(h=>{h.onMouseenter(c)})},onMouseleave:c=>{r.forEach(h=>{h.onMouseleave(c)})}};dI(i,d?"nested":t?"manual":this.trigger,o)}}return H(No,{ref:"binderInstRef",syncTarget:!s,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const a=this.getMergedShow();return[this.internalTrapFocus&&a?ct(H("div",{style:{position:"fixed",top:0,right:0,bottom:0,left:0}}),[[X_,{enabled:a,zIndex:this.zIndex}]]):null,t?null:H(Uo,null,{default:()=>i}),H(aI,Oc(this.$props,lI,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:a})),{default:()=>{var d,r;return(r=(d=this.$slots).default)===null||r===void 0?void 0:r.call(d)},header:()=>{var d,r;return(r=(d=this.$slots).header)===null||r===void 0?void 0:r.call(d)},footer:()=>{var d,r;return(r=(d=this.$slots).footer)===null||r===void 0?void 0:r.call(d)}})]}})}});function hI(e){const{textColor2:t,primaryColorHover:n,primaryColorPressed:i,primaryColor:s,infoColor:a,successColor:d,warningColor:r,errorColor:o,baseColor:c,borderColor:h,opacityDisabled:u,tagColor:v,closeIconColor:m,closeIconColorHover:b,closeIconColorPressed:g,borderRadiusSmall:l,fontSizeMini:f,fontSizeTiny:p,fontSizeSmall:y,fontSizeMedium:C,heightMini:k,heightTiny:E,heightSmall:I,heightMedium:S,closeColorHover:P,closeColorPressed:A,buttonColor2Hover:L,buttonColor2Pressed:x,fontWeightStrong:D}=e;return Object.assign(Object.assign({},B0),{closeBorderRadius:l,heightTiny:k,heightSmall:E,heightMedium:I,heightLarge:S,borderRadius:l,opacityDisabled:u,fontSizeTiny:f,fontSizeSmall:p,fontSizeMedium:y,fontSizeLarge:C,fontWeightStrong:D,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:c,colorCheckable:"#0000",colorHoverCheckable:L,colorPressedCheckable:x,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:i,border:`1px solid ${h}`,textColor:t,color:v,colorBordered:"rgb(250, 250, 252)",closeIconColor:m,closeIconColorHover:b,closeIconColorPressed:g,closeColorHover:P,closeColorPressed:A,borderPrimary:`1px solid ${kn(s,{alpha:.3})}`,textColorPrimary:s,colorPrimary:kn(s,{alpha:.12}),colorBorderedPrimary:kn(s,{alpha:.1}),closeIconColorPrimary:s,closeIconColorHoverPrimary:s,closeIconColorPressedPrimary:s,closeColorHoverPrimary:kn(s,{alpha:.12}),closeColorPressedPrimary:kn(s,{alpha:.18}),borderInfo:`1px solid ${kn(a,{alpha:.3})}`,textColorInfo:a,colorInfo:kn(a,{alpha:.12}),colorBorderedInfo:kn(a,{alpha:.1}),closeIconColorInfo:a,closeIconColorHoverInfo:a,closeIconColorPressedInfo:a,closeColorHoverInfo:kn(a,{alpha:.12}),closeColorPressedInfo:kn(a,{alpha:.18}),borderSuccess:`1px solid ${kn(d,{alpha:.3})}`,textColorSuccess:d,colorSuccess:kn(d,{alpha:.12}),colorBorderedSuccess:kn(d,{alpha:.1}),closeIconColorSuccess:d,closeIconColorHoverSuccess:d,closeIconColorPressedSuccess:d,closeColorHoverSuccess:kn(d,{alpha:.12}),closeColorPressedSuccess:kn(d,{alpha:.18}),borderWarning:`1px solid ${kn(r,{alpha:.35})}`,textColorWarning:r,colorWarning:kn(r,{alpha:.15}),colorBorderedWarning:kn(r,{alpha:.12}),closeIconColorWarning:r,closeIconColorHoverWarning:r,closeIconColorPressedWarning:r,closeColorHoverWarning:kn(r,{alpha:.12}),closeColorPressedWarning:kn(r,{alpha:.18}),borderError:`1px solid ${kn(o,{alpha:.23})}`,textColorError:o,colorError:kn(o,{alpha:.1}),colorBorderedError:kn(o,{alpha:.08}),closeIconColorError:o,closeIconColorHoverError:o,closeIconColorPressedError:o,closeColorHoverError:kn(o,{alpha:.12}),closeColorPressedError:kn(o,{alpha:.18})})}const fI={common:qg,self:hI},pI={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},vI=Re("tag",` + --n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left); + white-space: nowrap; + position: relative; + box-sizing: border-box; + cursor: default; + display: inline-flex; + align-items: center; + flex-wrap: nowrap; + padding: var(--n-padding); + border-radius: var(--n-border-radius); + color: var(--n-text-color); + background-color: var(--n-color); + transition: + border-color .3s var(--n-bezier), + background-color .3s var(--n-bezier), + color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier), + opacity .3s var(--n-bezier); + line-height: 1; + height: var(--n-height); + font-size: var(--n-font-size); +`,[We("strong",` + font-weight: var(--n-font-weight-strong); + `),tt("border",` + pointer-events: none; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + border-radius: inherit; + border: var(--n-border); + transition: border-color .3s var(--n-bezier); + `),tt("icon",` + display: flex; + margin: 0 4px 0 0; + color: var(--n-text-color); + transition: color .3s var(--n-bezier); + font-size: var(--n-avatar-size-override); + `),tt("avatar",` + display: flex; + margin: 0 6px 0 0; + `),tt("close",` + margin: var(--n-close-margin); + transition: + background-color .3s var(--n-bezier), + color .3s var(--n-bezier); + `),We("round",` + padding: 0 calc(var(--n-height) / 3); + border-radius: calc(var(--n-height) / 2); + `,[tt("icon",` + margin: 0 4px 0 calc((var(--n-height) - 8px) / -2); + `),tt("avatar",` + margin: 0 6px 0 calc((var(--n-height) - 8px) / -2); + `),We("closable",` + padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3); + `)]),We("icon, avatar",[We("round",` + padding: 0 calc(var(--n-height) / 3) 0 calc(var(--n-height) / 2); + `)]),We("disabled",` + cursor: not-allowed !important; + opacity: var(--n-opacity-disabled); + `),We("checkable",` + cursor: pointer; + box-shadow: none; + color: var(--n-text-color-checkable); + background-color: var(--n-color-checkable); + `,[xn("disabled",[Ke("&:hover","background-color: var(--n-color-hover-checkable);",[xn("checked","color: var(--n-text-color-hover-checkable);")]),Ke("&:active","background-color: var(--n-color-pressed-checkable);",[xn("checked","color: var(--n-text-color-pressed-checkable);")])]),We("checked",` + color: var(--n-text-color-checked); + background-color: var(--n-color-checked); + `,[xn("disabled",[Ke("&:hover","background-color: var(--n-color-checked-hover);"),Ke("&:active","background-color: var(--n-color-checked-pressed);")])])])]),gI=Object.assign(Object.assign(Object.assign({},Ht.props),pI),{bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function}),mI=ui("n-tag"),Hr=$e({name:"Tag",props:gI,setup(e){const t=F(null),{mergedBorderedRef:n,mergedClsPrefixRef:i,inlineThemeDisabled:s,mergedRtlRef:a}=bn(e),d=Ht("Tag","-tag",vI,fI,e,i);Rn(mI,{roundRef:ut(e,"round")});function r(){if(!e.disabled&&e.checkable){const{checked:m,onCheckedChange:b,onUpdateChecked:g,"onUpdate:checked":l}=e;g&&g(!m),l&&l(!m),b&&b(!m)}}function o(m){if(e.triggerClickOnClose||m.stopPropagation(),!e.disabled){const{onClose:b}=e;b&&rt(b,m)}}const c={setTextContent(m){const{value:b}=t;b&&(b.textContent=m)}},h=Rs("Tag",a,i),u=W(()=>{const{type:m,size:b,color:{color:g,textColor:l}={}}=e,{common:{cubicBezierEaseInOut:f},self:{padding:p,closeMargin:y,borderRadius:C,opacityDisabled:k,textColorCheckable:E,textColorHoverCheckable:I,textColorPressedCheckable:S,textColorChecked:P,colorCheckable:A,colorHoverCheckable:L,colorPressedCheckable:x,colorChecked:D,colorCheckedHover:M,colorCheckedPressed:B,closeBorderRadius:z,fontWeightStrong:Y,[Mt("colorBordered",m)]:U,[Mt("closeSize",b)]:N,[Mt("closeIconSize",b)]:V,[Mt("fontSize",b)]:j,[Mt("height",b)]:G,[Mt("color",m)]:te,[Mt("textColor",m)]:se,[Mt("border",m)]:oe,[Mt("closeIconColor",m)]:Fe,[Mt("closeIconColorHover",m)]:K,[Mt("closeIconColorPressed",m)]:Z,[Mt("closeColorHover",m)]:J,[Mt("closeColorPressed",m)]:ae}}=d.value,Ie=go(y);return{"--n-font-weight-strong":Y,"--n-avatar-size-override":`calc(${G} - 8px)`,"--n-bezier":f,"--n-border-radius":C,"--n-border":oe,"--n-close-icon-size":V,"--n-close-color-pressed":ae,"--n-close-color-hover":J,"--n-close-border-radius":z,"--n-close-icon-color":Fe,"--n-close-icon-color-hover":K,"--n-close-icon-color-pressed":Z,"--n-close-icon-color-disabled":Fe,"--n-close-margin-top":Ie.top,"--n-close-margin-right":Ie.right,"--n-close-margin-bottom":Ie.bottom,"--n-close-margin-left":Ie.left,"--n-close-size":N,"--n-color":g||(n.value?U:te),"--n-color-checkable":A,"--n-color-checked":D,"--n-color-checked-hover":M,"--n-color-checked-pressed":B,"--n-color-hover-checkable":L,"--n-color-pressed-checkable":x,"--n-font-size":j,"--n-height":G,"--n-opacity-disabled":k,"--n-padding":p,"--n-text-color":l||se,"--n-text-color-checkable":E,"--n-text-color-checked":P,"--n-text-color-hover-checkable":I,"--n-text-color-pressed-checkable":S}}),v=s?Bn("tag",W(()=>{let m="";const{type:b,size:g,color:{color:l,textColor:f}={}}=e;return m+=b[0],m+=g[0],l&&(m+=`a${Rf(l)}`),f&&(m+=`b${Rf(f)}`),n.value&&(m+="c"),m}),u,e):void 0;return Object.assign(Object.assign({},c),{rtlEnabled:h,mergedClsPrefix:i,contentRef:t,mergedBordered:n,handleClick:r,handleCloseClick:o,cssVars:s?void 0:u,themeClass:v==null?void 0:v.themeClass,onRender:v==null?void 0:v.onRender})},render(){var e,t;const{mergedClsPrefix:n,rtlEnabled:i,closable:s,color:{borderColor:a}={},round:d,onRender:r,$slots:o}=this;r==null||r();const c=qi(o.avatar,u=>u&&H("div",{class:`${n}-tag__avatar`},u)),h=qi(o.icon,u=>u&&H("div",{class:`${n}-tag__icon`},u));return H("div",{class:[`${n}-tag`,this.themeClass,{[`${n}-tag--rtl`]:i,[`${n}-tag--strong`]:this.strong,[`${n}-tag--disabled`]:this.disabled,[`${n}-tag--checkable`]:this.checkable,[`${n}-tag--checked`]:this.checkable&&this.checked,[`${n}-tag--round`]:d,[`${n}-tag--avatar`]:c,[`${n}-tag--icon`]:h,[`${n}-tag--closable`]:s}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},h||c,H("span",{class:`${n}-tag__content`,ref:"contentRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)),!this.checkable&&s?H(H0,{clsPrefix:n,class:`${n}-tag__close`,disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:d,isButtonTag:this.internalCloseIsButtonTag,absolute:!0}):null,!this.checkable&&this.mergedBordered?H("div",{class:`${n}-tag__border`,style:{borderColor:a}}):null)}}),_I=Ke([Re("base-selection",` + --n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left); + --n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left); + position: relative; + z-index: auto; + box-shadow: none; + width: 100%; + max-width: 100%; + display: inline-block; + vertical-align: bottom; + border-radius: var(--n-border-radius); + min-height: var(--n-height); + line-height: 1.5; + font-size: var(--n-font-size); + `,[Re("base-loading",` + color: var(--n-loading-color); + `),Re("base-selection-tags","min-height: var(--n-height);"),tt("border, state-border",` + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + pointer-events: none; + border: var(--n-border); + border-radius: inherit; + transition: + box-shadow .3s var(--n-bezier), + border-color .3s var(--n-bezier); + `),tt("state-border",` + z-index: 1; + border-color: #0000; + `),Re("base-suffix",` + cursor: pointer; + position: absolute; + top: 50%; + transform: translateY(-50%); + right: 10px; + `,[tt("arrow",` + font-size: var(--n-arrow-size); + color: var(--n-arrow-color); + transition: color .3s var(--n-bezier); + `)]),Re("base-selection-overlay",` + display: flex; + align-items: center; + white-space: nowrap; + pointer-events: none; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + padding: var(--n-padding-single); + transition: color .3s var(--n-bezier); + `,[tt("wrapper",` + flex-basis: 0; + flex-grow: 1; + overflow: hidden; + text-overflow: ellipsis; + `)]),Re("base-selection-placeholder",` + color: var(--n-placeholder-color); + `,[tt("inner",` + max-width: 100%; + overflow: hidden; + `)]),Re("base-selection-tags",` + cursor: pointer; + outline: none; + box-sizing: border-box; + position: relative; + z-index: auto; + display: flex; + padding: var(--n-padding-multiple); + flex-wrap: wrap; + align-items: center; + width: 100%; + vertical-align: bottom; + background-color: var(--n-color); + border-radius: inherit; + transition: + color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier), + background-color .3s var(--n-bezier); + `),Re("base-selection-label",` + height: var(--n-height); + display: inline-flex; + width: 100%; + vertical-align: bottom; + cursor: pointer; + outline: none; + z-index: auto; + box-sizing: border-box; + position: relative; + transition: + color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier), + background-color .3s var(--n-bezier); + border-radius: inherit; + background-color: var(--n-color); + align-items: center; + `,[Re("base-selection-input",` + font-size: inherit; + line-height: inherit; + outline: none; + cursor: pointer; + box-sizing: border-box; + border:none; + width: 100%; + padding: var(--n-padding-single); + background-color: #0000; + color: var(--n-text-color); + transition: color .3s var(--n-bezier); + caret-color: var(--n-caret-color); + `,[tt("content",` + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + `)]),tt("render-label",` + color: var(--n-text-color); + `)]),xn("disabled",[Ke("&:hover",[tt("state-border",` + box-shadow: var(--n-box-shadow-hover); + border: var(--n-border-hover); + `)]),We("focus",[tt("state-border",` + box-shadow: var(--n-box-shadow-focus); + border: var(--n-border-focus); + `)]),We("active",[tt("state-border",` + box-shadow: var(--n-box-shadow-active); + border: var(--n-border-active); + `),Re("base-selection-label","background-color: var(--n-color-active);"),Re("base-selection-tags","background-color: var(--n-color-active);")])]),We("disabled","cursor: not-allowed;",[tt("arrow",` + color: var(--n-arrow-color-disabled); + `),Re("base-selection-label",` + cursor: not-allowed; + background-color: var(--n-color-disabled); + `,[Re("base-selection-input",` + cursor: not-allowed; + color: var(--n-text-color-disabled); + `),tt("render-label",` + color: var(--n-text-color-disabled); + `)]),Re("base-selection-tags",` + cursor: not-allowed; + background-color: var(--n-color-disabled); + `),Re("base-selection-placeholder",` + cursor: not-allowed; + color: var(--n-placeholder-color-disabled); + `)]),Re("base-selection-input-tag",` + height: calc(var(--n-height) - 6px); + line-height: calc(var(--n-height) - 6px); + outline: none; + display: none; + position: relative; + margin-bottom: 3px; + max-width: 100%; + vertical-align: bottom; + `,[tt("input",` + font-size: inherit; + font-family: inherit; + min-width: 1px; + padding: 0; + background-color: #0000; + outline: none; + border: none; + max-width: 100%; + overflow: hidden; + width: 1em; + line-height: inherit; + cursor: pointer; + color: var(--n-text-color); + caret-color: var(--n-caret-color); + `),tt("mirror",` + position: absolute; + left: 0; + top: 0; + white-space: pre; + visibility: hidden; + user-select: none; + -webkit-user-select: none; + opacity: 0; + `)]),["warning","error"].map(e=>We(`${e}-status`,[tt("state-border",`border: var(--n-border-${e});`),xn("disabled",[Ke("&:hover",[tt("state-border",` + box-shadow: var(--n-box-shadow-hover-${e}); + border: var(--n-border-hover-${e}); + `)]),We("active",[tt("state-border",` + box-shadow: var(--n-box-shadow-active-${e}); + border: var(--n-border-active-${e}); + `),Re("base-selection-label",`background-color: var(--n-color-active-${e});`),Re("base-selection-tags",`background-color: var(--n-color-active-${e});`)]),We("focus",[tt("state-border",` + box-shadow: var(--n-box-shadow-focus-${e}); + border: var(--n-border-focus-${e}); + `)])])]))]),Re("base-selection-popover",` + margin-bottom: -3px; + display: flex; + flex-wrap: wrap; + margin-right: -8px; + `),Re("base-selection-tag-wrapper",` + max-width: 100%; + display: inline-flex; + padding: 0 7px 3px 0; + `,[Ke("&:last-child","padding-right: 0;"),Re("tag",` + font-size: 14px; + max-width: 100%; + `,[tt("content",` + line-height: 1.25; + text-overflow: ellipsis; + overflow: hidden; + `)])])]),yI=$e({name:"InternalSelection",props:Object.assign(Object.assign({},Ht.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=bn(e),i=Rs("InternalSelection",n,t),s=F(null),a=F(null),d=F(null),r=F(null),o=F(null),c=F(null),h=F(null),u=F(null),v=F(null),m=F(null),b=F(!1),g=F(!1),l=F(!1),f=Ht("InternalSelection","-internal-selection",_I,z0,e,ut(e,"clsPrefix")),p=W(()=>e.clearable&&!e.disabled&&(l.value||e.active)),y=W(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):Cs(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),C=W(()=>{const _e=e.selectedOption;if(_e)return _e[e.labelField]}),k=W(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function E(){var _e;const{value:Ce}=s;if(Ce){const{value:Be}=a;Be&&(Be.style.width=`${Ce.offsetWidth}px`,e.maxTagCount!=="responsive"&&((_e=v.value)===null||_e===void 0||_e.sync({showAllItemsBeforeCalculate:!1})))}}function I(){const{value:_e}=m;_e&&(_e.style.display="none")}function S(){const{value:_e}=m;_e&&(_e.style.display="inline-block")}wt(ut(e,"active"),_e=>{_e||I()}),wt(ut(e,"pattern"),()=>{e.multiple&&hn(E)});function P(_e){const{onFocus:Ce}=e;Ce&&Ce(_e)}function A(_e){const{onBlur:Ce}=e;Ce&&Ce(_e)}function L(_e){const{onDeleteOption:Ce}=e;Ce&&Ce(_e)}function x(_e){const{onClear:Ce}=e;Ce&&Ce(_e)}function D(_e){const{onPatternInput:Ce}=e;Ce&&Ce(_e)}function M(_e){var Ce;(!_e.relatedTarget||!(!((Ce=d.value)===null||Ce===void 0)&&Ce.contains(_e.relatedTarget)))&&P(_e)}function B(_e){var Ce;!((Ce=d.value)===null||Ce===void 0)&&Ce.contains(_e.relatedTarget)||A(_e)}function z(_e){x(_e)}function Y(){l.value=!0}function U(){l.value=!1}function N(_e){!e.active||!e.filterable||_e.target!==a.value&&_e.preventDefault()}function V(_e){L(_e)}const j=F(!1);function G(_e){if(_e.key==="Backspace"&&!j.value&&!e.pattern.length){const{selectedOptions:Ce}=e;Ce!=null&&Ce.length&&V(Ce[Ce.length-1])}}let te=null;function se(_e){const{value:Ce}=s;if(Ce){const Be=_e.target.value;Ce.textContent=Be,E()}e.ignoreComposition&&j.value?te=_e:D(_e)}function oe(){j.value=!0}function Fe(){j.value=!1,e.ignoreComposition&&D(te),te=null}function K(_e){var Ce;g.value=!0,(Ce=e.onPatternFocus)===null||Ce===void 0||Ce.call(e,_e)}function Z(_e){var Ce;g.value=!1,(Ce=e.onPatternBlur)===null||Ce===void 0||Ce.call(e,_e)}function J(){var _e,Ce;if(e.filterable)g.value=!1,(_e=c.value)===null||_e===void 0||_e.blur(),(Ce=a.value)===null||Ce===void 0||Ce.blur();else if(e.multiple){const{value:Be}=r;Be==null||Be.blur()}else{const{value:Be}=o;Be==null||Be.blur()}}function ae(){var _e,Ce,Be;e.filterable?(g.value=!1,(_e=c.value)===null||_e===void 0||_e.focus()):e.multiple?(Ce=r.value)===null||Ce===void 0||Ce.focus():(Be=o.value)===null||Be===void 0||Be.focus()}function Ie(){const{value:_e}=a;_e&&(S(),_e.focus())}function de(){const{value:_e}=a;_e&&_e.blur()}function Le(_e){const{value:Ce}=h;Ce&&Ce.setTextContent(`+${_e}`)}function xe(){const{value:_e}=u;return _e}function Qe(){return a.value}let De=null;function ne(){De!==null&&window.clearTimeout(De)}function ue(){e.active||(ne(),De=window.setTimeout(()=>{k.value&&(b.value=!0)},100))}function he(){ne()}function Ae(_e){_e||(ne(),b.value=!1)}wt(k,_e=>{_e||(b.value=!1)}),It(()=>{Yi(()=>{const _e=c.value;_e&&(e.disabled?_e.removeAttribute("tabindex"):_e.tabIndex=g.value?-1:0)})}),iy(d,e.onResize);const{inlineThemeDisabled:ce}=e,Je=W(()=>{const{size:_e}=e,{common:{cubicBezierEaseInOut:Ce},self:{fontWeight:Be,borderRadius:Se,color:R,placeholderColor:we,textColor:ht,paddingSingle:Ne,paddingMultiple:ot,caretColor:Rt,colorDisabled:at,textColorDisabled:gt,placeholderColorDisabled:re,colorActive:me,boxShadowFocus:je,boxShadowActive:it,boxShadowHover:dt,border:be,borderFocus:Ve,borderHover:Xe,borderActive:pe,arrowColor:Ge,arrowColorDisabled:_t,loadingColor:Te,colorActiveWarning:Ye,boxShadowFocusWarning:ft,boxShadowActiveWarning:Dt,boxShadowHoverWarning:Yt,borderWarning:jt,borderFocusWarning:Xt,borderHoverWarning:Ln,borderActiveWarning:On,colorActiveError:rn,boxShadowFocusError:on,boxShadowActiveError:Cn,boxShadowHoverError:mn,borderError:Ut,borderFocusError:nn,borderHoverError:Ft,borderActiveError:an,clearColor:ln,clearColorHover:bi,clearColorPressed:hi,clearSize:fi,arrowSize:ei,[Mt("height",_e)]:Ee,[Mt("fontSize",_e)]:Ze}}=f.value,mt=go(Ne),At=go(ot);return{"--n-bezier":Ce,"--n-border":be,"--n-border-active":pe,"--n-border-focus":Ve,"--n-border-hover":Xe,"--n-border-radius":Se,"--n-box-shadow-active":it,"--n-box-shadow-focus":je,"--n-box-shadow-hover":dt,"--n-caret-color":Rt,"--n-color":R,"--n-color-active":me,"--n-color-disabled":at,"--n-font-size":Ze,"--n-height":Ee,"--n-padding-single-top":mt.top,"--n-padding-multiple-top":At.top,"--n-padding-single-right":mt.right,"--n-padding-multiple-right":At.right,"--n-padding-single-left":mt.left,"--n-padding-multiple-left":At.left,"--n-padding-single-bottom":mt.bottom,"--n-padding-multiple-bottom":At.bottom,"--n-placeholder-color":we,"--n-placeholder-color-disabled":re,"--n-text-color":ht,"--n-text-color-disabled":gt,"--n-arrow-color":Ge,"--n-arrow-color-disabled":_t,"--n-loading-color":Te,"--n-color-active-warning":Ye,"--n-box-shadow-focus-warning":ft,"--n-box-shadow-active-warning":Dt,"--n-box-shadow-hover-warning":Yt,"--n-border-warning":jt,"--n-border-focus-warning":Xt,"--n-border-hover-warning":Ln,"--n-border-active-warning":On,"--n-color-active-error":rn,"--n-box-shadow-focus-error":on,"--n-box-shadow-active-error":Cn,"--n-box-shadow-hover-error":mn,"--n-border-error":Ut,"--n-border-focus-error":nn,"--n-border-hover-error":Ft,"--n-border-active-error":an,"--n-clear-size":fi,"--n-clear-color":ln,"--n-clear-color-hover":bi,"--n-clear-color-pressed":hi,"--n-arrow-size":ei,"--n-font-weight":Be}}),ye=ce?Bn("internal-selection",W(()=>e.size[0]),Je,e):void 0;return{mergedTheme:f,mergedClearable:p,mergedClsPrefix:t,rtlEnabled:i,patternInputFocused:g,filterablePlaceholder:y,label:C,selected:k,showTagsPanel:b,isComposing:j,counterRef:h,counterWrapperRef:u,patternInputMirrorRef:s,patternInputRef:a,selfRef:d,multipleElRef:r,singleElRef:o,patternInputWrapperRef:c,overflowRef:v,inputTagElRef:m,handleMouseDown:N,handleFocusin:M,handleClear:z,handleMouseEnter:Y,handleMouseLeave:U,handleDeleteOption:V,handlePatternKeyDown:G,handlePatternInputInput:se,handlePatternInputBlur:Z,handlePatternInputFocus:K,handleMouseEnterCounter:ue,handleMouseLeaveCounter:he,handleFocusout:B,handleCompositionEnd:Fe,handleCompositionStart:oe,onPopoverUpdateShow:Ae,focus:ae,focusInput:Ie,blur:J,blurInput:de,updateCounter:Le,getCounter:xe,getTail:Qe,renderLabel:e.renderLabel,cssVars:ce?void 0:Je,themeClass:ye==null?void 0:ye.themeClass,onRender:ye==null?void 0:ye.onRender}},render(){const{status:e,multiple:t,size:n,disabled:i,filterable:s,maxTagCount:a,bordered:d,clsPrefix:r,ellipsisTagPopoverProps:o,onRender:c,renderTag:h,renderLabel:u}=this;c==null||c();const v=a==="responsive",m=typeof a=="number",b=v||m,g=H(N0,null,{default:()=>H(U0,{clsPrefix:r,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var f,p;return(p=(f=this.$slots).arrow)===null||p===void 0?void 0:p.call(f)}})});let l;if(t){const{labelField:f}=this,p=D=>H("div",{class:`${r}-base-selection-tag-wrapper`,key:D.value},h?h({option:D,handleClose:()=>{this.handleDeleteOption(D)}}):H(Hr,{size:n,closable:!D.disabled,disabled:i,onClose:()=>{this.handleDeleteOption(D)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>u?u(D,!0):Cs(D[f],D,!0)})),y=()=>(m?this.selectedOptions.slice(0,a):this.selectedOptions).map(p),C=s?H("div",{class:`${r}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},H("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:i,value:this.pattern,autofocus:this.autofocus,class:`${r}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),H("span",{ref:"patternInputMirrorRef",class:`${r}-base-selection-input-tag__mirror`},this.pattern)):null,k=v?()=>H("div",{class:`${r}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},H(Hr,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:i})):void 0;let E;if(m){const D=this.selectedOptions.length-a;D>0&&(E=H("div",{class:`${r}-base-selection-tag-wrapper`,key:"__counter__"},H(Hr,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:i},{default:()=>`+${D}`})))}const I=v?s?H(pv,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:y,counter:k,tail:()=>C}):H(pv,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:y,counter:k}):m&&E?y().concat(E):y(),S=b?()=>H("div",{class:`${r}-base-selection-popover`},v?y():this.selectedOptions.map(p)):void 0,P=b?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},o):null,L=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?H("div",{class:`${r}-base-selection-placeholder ${r}-base-selection-overlay`},H("div",{class:`${r}-base-selection-placeholder__inner`},this.placeholder)):null,x=s?H("div",{ref:"patternInputWrapperRef",class:`${r}-base-selection-tags`},I,v?null:C,g):H("div",{ref:"multipleElRef",class:`${r}-base-selection-tags`,tabindex:i?void 0:0},I,g);l=H(Me,null,b?H(Ko,Object.assign({},P,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>x,default:S}):x,L)}else if(s){const f=this.pattern||this.isComposing,p=this.active?!f:!this.selected,y=this.active?!1:this.selected;l=H("div",{ref:"patternInputWrapperRef",class:`${r}-base-selection-label`,title:this.patternInputFocused?void 0:vv(this.label)},H("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${r}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:i,disabled:i,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),y?H("div",{class:`${r}-base-selection-label__render-label ${r}-base-selection-overlay`,key:"input"},H("div",{class:`${r}-base-selection-overlay__wrapper`},h?h({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):Cs(this.label,this.selectedOption,!0))):null,p?H("div",{class:`${r}-base-selection-placeholder ${r}-base-selection-overlay`,key:"placeholder"},H("div",{class:`${r}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,g)}else l=H("div",{ref:"singleElRef",class:`${r}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?H("div",{class:`${r}-base-selection-input`,title:vv(this.label),key:"input"},H("div",{class:`${r}-base-selection-input__content`},h?h({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):Cs(this.label,this.selectedOption,!0))):H("div",{class:`${r}-base-selection-placeholder ${r}-base-selection-overlay`,key:"placeholder"},H("div",{class:`${r}-base-selection-placeholder__inner`},this.placeholder)),g);return H("div",{ref:"selfRef",class:[`${r}-base-selection`,this.rtlEnabled&&`${r}-base-selection--rtl`,this.themeClass,e&&`${r}-base-selection--${e}-status`,{[`${r}-base-selection--active`]:this.active,[`${r}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${r}-base-selection--disabled`]:this.disabled,[`${r}-base-selection--multiple`]:this.multiple,[`${r}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},l,d?H("div",{class:`${r}-base-selection__border`}):null,d?H("div",{class:`${r}-base-selection__state-border`}):null)}});function dc(e){return e.type==="group"}function vy(e){return e.type==="ignored"}function Dd(e,t){try{return!!(1+t.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function gy(e,t){return{getIsGroup:dc,getIgnored:vy,getKey(i){return dc(i)?i.name||i.key||"key-required":i[e]},getChildren(i){return i[t]}}}function bI(e,t,n,i){if(!t)return e;function s(a){if(!Array.isArray(a))return[];const d=[];for(const r of a)if(dc(r)){const o=s(r[i]);o.length&&d.push(Object.assign({},r,{[i]:o}))}else{if(vy(r))continue;t(n,r)&&d.push(r)}return d}return s(e)}function wI(e,t,n){const i=new Map;return e.forEach(s=>{dc(s)?s[n].forEach(a=>{i.set(a[t],a)}):i.set(s[t],s)}),i}function vn(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function fo(e,t){const n=Bt(e);return isNaN(t)?vn(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Jn(e,t){const n=Bt(e);if(isNaN(t))return vn(e,NaN);if(!t)return n;const i=n.getDate(),s=vn(e,n.getTime());s.setMonth(n.getMonth()+t+1,0);const a=s.getDate();return i>=a?s:(n.setFullYear(s.getFullYear(),s.getMonth(),i),n)}const my=6048e5,SI=864e5,CI=6e4,kI=36e5,xI=1e3;function Po(e){return Ks(e,{weekStartsOn:1})}function _y(e){const t=Bt(e),n=t.getFullYear(),i=vn(e,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const s=Po(i),a=vn(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const d=Po(a);return t.getTime()>=s.getTime()?n+1:t.getTime()>=d.getTime()?n:n-1}function Lo(e){const t=Bt(e);return t.setHours(0,0,0,0),t}function uc(e){const t=Bt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function RI(e,t){const n=Lo(e),i=Lo(t),s=+n-uc(n),a=+i-uc(i);return Math.round((s-a)/SI)}function TI(e){const t=_y(e),n=vn(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Po(n)}function EI(e,t){const n=t*3;return Jn(e,n)}function Au(e,t){return Jn(e,t*12)}function PI(e,t){const n=Lo(e),i=Lo(t);return+n==+i}function LI(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ji(e){if(!LI(e)&&typeof e!="number")return!1;const t=Bt(e);return!isNaN(Number(t))}function DI(e){const t=Bt(e);return Math.trunc(t.getMonth()/3)+1}function II(e){const t=Bt(e);return t.setSeconds(0,0),t}function $a(e){const t=Bt(e),n=t.getMonth(),i=n-n%3;return t.setMonth(i,1),t.setHours(0,0,0,0),t}function Os(e){const t=Bt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function za(e){const t=Bt(e),n=vn(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function MI(e){const t=Bt(e);return RI(t,za(t))+1}function yy(e){const t=Bt(e),n=+Po(t)-+TI(t);return Math.round(n/my)+1}function zh(e,t){var h,u,v,m;const n=Bt(e),i=n.getFullYear(),s=Ha(),a=(t==null?void 0:t.firstWeekContainsDate)??((u=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:u.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(v=s.locale)==null?void 0:v.options)==null?void 0:m.firstWeekContainsDate)??1,d=vn(e,0);d.setFullYear(i+1,0,a),d.setHours(0,0,0,0);const r=Ks(d,t),o=vn(e,0);o.setFullYear(i,0,a),o.setHours(0,0,0,0);const c=Ks(o,t);return n.getTime()>=r.getTime()?i+1:n.getTime()>=c.getTime()?i:i-1}function AI(e,t){var r,o,c,h;const n=Ha(),i=(t==null?void 0:t.firstWeekContainsDate)??((o=(r=t==null?void 0:t.locale)==null?void 0:r.options)==null?void 0:o.firstWeekContainsDate)??n.firstWeekContainsDate??((h=(c=n.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,s=zh(e,t),a=vn(e,0);return a.setFullYear(s,0,i),a.setHours(0,0,0,0),Ks(a,t)}function by(e,t){const n=Bt(e),i=+Ks(n,t)-+AI(n,t);return Math.round(i/my)+1}function dn(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const tr={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return dn(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):dn(n+1,2)},d(e,t){return dn(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return dn(e.getHours()%12||12,t.length)},H(e,t){return dn(e.getHours(),t.length)},m(e,t){return dn(e.getMinutes(),t.length)},s(e,t){return dn(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return dn(s,t.length)}},so={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Fv={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return tr.y(e,t)},Y:function(e,t,n,i){const s=zh(e,i),a=s>0?s:1-s;if(t==="YY"){const d=a%100;return dn(d,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):dn(a,t.length)},R:function(e,t){const n=_y(e);return dn(n,t.length)},u:function(e,t){const n=e.getFullYear();return dn(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return dn(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return dn(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return tr.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return dn(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const s=by(e,i);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):dn(s,t.length)},I:function(e,t,n){const i=yy(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):dn(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):tr.d(e,t)},D:function(e,t,n){const i=MI(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):dn(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const s=e.getDay(),a=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return dn(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const s=e.getDay(),a=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return dn(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return dn(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let s;switch(i===12?s=so.noon:i===0?s=so.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let s;switch(i>=17?s=so.evening:i>=12?s=so.afternoon:i>=4?s=so.morning:s=so.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return tr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):tr.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):dn(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):dn(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):tr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):tr.s(e,t)},S:function(e,t){return tr.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Hv(i);case"XXXX":case"XX":return Ir(i);case"XXXXX":case"XXX":default:return Ir(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return Hv(i);case"xxxx":case"xx":return Ir(i);case"xxxxx":case"xxx":default:return Ir(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Bv(i,":");case"OOOO":default:return"GMT"+Ir(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Bv(i,":");case"zzzz":default:return"GMT"+Ir(i,":")}},t:function(e,t,n){const i=Math.trunc(e.getTime()/1e3);return dn(i,t.length)},T:function(e,t,n){const i=e.getTime();return dn(i,t.length)}};function Bv(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.trunc(i/60),a=i%60;return a===0?n+String(s):n+String(s)+t+dn(a,2)}function Hv(e,t){return e%60===0?(e>0?"-":"+")+dn(Math.abs(e)/60,2):Ir(e,t)}function Ir(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=dn(Math.trunc(i/60),2),a=dn(i%60,2);return n+s+t+a}const Nv=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},wy=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},$I=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return Nv(e,t);let a;switch(i){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",Nv(i,t)).replace("{{time}}",wy(s,t))},$u={p:wy,P:$I},OI=/^D+$/,FI=/^Y+$/,BI=["D","DD","YY","YYYY"];function Sy(e){return OI.test(e)}function Cy(e){return FI.test(e)}function Ou(e,t,n){const i=HI(e,t,n);if(console.warn(i),BI.includes(e))throw new RangeError(i)}function HI(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const NI=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,UI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,zI=/^'([^]*?)'?$/,VI=/''/g,KI=/[a-zA-Z]/;function un(e,t,n){var h,u,v,m,b,g,l,f;const i=Ha(),s=(n==null?void 0:n.locale)??i.locale??Yg,a=(n==null?void 0:n.firstWeekContainsDate)??((u=(h=n==null?void 0:n.locale)==null?void 0:h.options)==null?void 0:u.firstWeekContainsDate)??i.firstWeekContainsDate??((m=(v=i.locale)==null?void 0:v.options)==null?void 0:m.firstWeekContainsDate)??1,d=(n==null?void 0:n.weekStartsOn)??((g=(b=n==null?void 0:n.locale)==null?void 0:b.options)==null?void 0:g.weekStartsOn)??i.weekStartsOn??((f=(l=i.locale)==null?void 0:l.options)==null?void 0:f.weekStartsOn)??0,r=Bt(e);if(!ji(r))throw new RangeError("Invalid time value");let o=t.match(UI).map(p=>{const y=p[0];if(y==="p"||y==="P"){const C=$u[y];return C(p,s.formatLong)}return p}).join("").match(NI).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const y=p[0];if(y==="'")return{isToken:!1,value:WI(p)};if(Fv[y])return{isToken:!0,value:p};if(y.match(KI))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:p}});s.localize.preprocessor&&(o=s.localize.preprocessor(r,o));const c={firstWeekContainsDate:a,weekStartsOn:d,locale:s};return o.map(p=>{if(!p.isToken)return p.value;const y=p.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Cy(y)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Sy(y))&&Ou(y,t,String(e));const C=Fv[y[0]];return C(r,y,s.localize,c)}).join("")}function WI(e){const t=e.match(zI);return t?t[1].replace(VI,"'"):e}function Ki(e){return Bt(e).getDate()}function jI(e){return Bt(e).getDay()}function qI(e){const t=Bt(e),n=t.getFullYear(),i=t.getMonth(),s=vn(e,0);return s.setFullYear(n,i+1,0),s.setHours(0,0,0,0),s.getDate()}function ky(){return Object.assign({},Ha())}function or(e){return Bt(e).getHours()}function YI(e){let n=Bt(e).getDay();return n===0&&(n=7),n}function GI(e){return Bt(e).getMilliseconds()}function hc(e){return Bt(e).getMinutes()}function Sn(e){return Bt(e).getMonth()}function fc(e){return Bt(e).getSeconds()}function vt(e){return Bt(e).getTime()}function Tn(e){return Bt(e).getFullYear()}function XI(e,t){const n=t instanceof Date?vn(t,0):new t(0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}const JI=10;class xy{constructor(){q(this,"subPriority",0)}validate(t,n){return!0}}class ZI extends xy{constructor(t,n,i,s,a){super(),this.value=t,this.validateValue=n,this.setValue=i,this.priority=s,a&&(this.subPriority=a)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,i){return this.setValue(t,n,this.value,i)}}class QI extends xy{constructor(){super(...arguments);q(this,"priority",JI);q(this,"subPriority",-1)}set(n,i){return i.timestampIsSet?n:vn(n,XI(n,Date))}}class sn{run(t,n,i,s){const a=this.parse(t,n,i,s);return a?{setter:new ZI(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(t,n,i){return!0}}class eM extends sn{constructor(){super(...arguments);q(this,"priority",140);q(this,"incompatibleTokens",["R","u","t","T"])}parse(n,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(n,{width:"abbreviated"})||s.era(n,{width:"narrow"});case"GGGGG":return s.era(n,{width:"narrow"});case"GGGG":default:return s.era(n,{width:"wide"})||s.era(n,{width:"abbreviated"})||s.era(n,{width:"narrow"})}}set(n,i,s){return i.era=s,n.setFullYear(s,0,1),n.setHours(0,0,0,0),n}}const An={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},bs={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function $n(e,t){return e&&{value:t(e.value),rest:e.rest}}function Pn(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function ws(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const i=n[1]==="+"?1:-1,s=n[2]?parseInt(n[2],10):0,a=n[3]?parseInt(n[3],10):0,d=n[5]?parseInt(n[5],10):0;return{value:i*(s*kI+a*CI+d*xI),rest:t.slice(n[0].length)}}function Ry(e){return Pn(An.anyDigitsSigned,e)}function In(e,t){switch(e){case 1:return Pn(An.singleDigit,t);case 2:return Pn(An.twoDigits,t);case 3:return Pn(An.threeDigits,t);case 4:return Pn(An.fourDigits,t);default:return Pn(new RegExp("^\\d{1,"+e+"}"),t)}}function pc(e,t){switch(e){case 1:return Pn(An.singleDigitSigned,t);case 2:return Pn(An.twoDigitsSigned,t);case 3:return Pn(An.threeDigitsSigned,t);case 4:return Pn(An.fourDigitsSigned,t);default:return Pn(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Vh(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Ty(e,t){const n=t>0,i=n?t:1-t;let s;if(i<=50)s=e||100;else{const a=i+50,d=Math.trunc(a/100)*100,r=e>=a%100;s=e+d-(r?100:0)}return n?s:1-s}function Ey(e){return e%400===0||e%4===0&&e%100!==0}class tM extends sn{constructor(){super(...arguments);q(this,"priority",130);q(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(n,i,s){const a=d=>({year:d,isTwoDigitYear:i==="yy"});switch(i){case"y":return $n(In(4,n),a);case"yo":return $n(s.ordinalNumber(n,{unit:"year"}),a);default:return $n(In(i.length,n),a)}}validate(n,i){return i.isTwoDigitYear||i.year>0}set(n,i,s){const a=n.getFullYear();if(s.isTwoDigitYear){const r=Ty(s.year,a);return n.setFullYear(r,0,1),n.setHours(0,0,0,0),n}const d=!("era"in i)||i.era===1?s.year:1-s.year;return n.setFullYear(d,0,1),n.setHours(0,0,0,0),n}}class nM extends sn{constructor(){super(...arguments);q(this,"priority",130);q(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(n,i,s){const a=d=>({year:d,isTwoDigitYear:i==="YY"});switch(i){case"Y":return $n(In(4,n),a);case"Yo":return $n(s.ordinalNumber(n,{unit:"year"}),a);default:return $n(In(i.length,n),a)}}validate(n,i){return i.isTwoDigitYear||i.year>0}set(n,i,s,a){const d=zh(n,a);if(s.isTwoDigitYear){const o=Ty(s.year,d);return n.setFullYear(o,0,a.firstWeekContainsDate),n.setHours(0,0,0,0),Ks(n,a)}const r=!("era"in i)||i.era===1?s.year:1-s.year;return n.setFullYear(r,0,a.firstWeekContainsDate),n.setHours(0,0,0,0),Ks(n,a)}}class iM extends sn{constructor(){super(...arguments);q(this,"priority",130);q(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,i){return pc(i==="R"?4:i.length,n)}set(n,i,s){const a=vn(n,0);return a.setFullYear(s,0,4),a.setHours(0,0,0,0),Po(a)}}class sM extends sn{constructor(){super(...arguments);q(this,"priority",130);q(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,i){return pc(i==="u"?4:i.length,n)}set(n,i,s){return n.setFullYear(s,0,1),n.setHours(0,0,0,0),n}}class rM extends sn{constructor(){super(...arguments);q(this,"priority",120);q(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,i,s){switch(i){case"Q":case"QQ":return In(i.length,n);case"Qo":return s.ordinalNumber(n,{unit:"quarter"});case"QQQ":return s.quarter(n,{width:"abbreviated",context:"formatting"})||s.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(n,{width:"wide",context:"formatting"})||s.quarter(n,{width:"abbreviated",context:"formatting"})||s.quarter(n,{width:"narrow",context:"formatting"})}}validate(n,i){return i>=1&&i<=4}set(n,i,s){return n.setMonth((s-1)*3,1),n.setHours(0,0,0,0),n}}class oM extends sn{constructor(){super(...arguments);q(this,"priority",120);q(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,i,s){switch(i){case"q":case"qq":return In(i.length,n);case"qo":return s.ordinalNumber(n,{unit:"quarter"});case"qqq":return s.quarter(n,{width:"abbreviated",context:"standalone"})||s.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(n,{width:"wide",context:"standalone"})||s.quarter(n,{width:"abbreviated",context:"standalone"})||s.quarter(n,{width:"narrow",context:"standalone"})}}validate(n,i){return i>=1&&i<=4}set(n,i,s){return n.setMonth((s-1)*3,1),n.setHours(0,0,0,0),n}}class aM extends sn{constructor(){super(...arguments);q(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);q(this,"priority",110)}parse(n,i,s){const a=d=>d-1;switch(i){case"M":return $n(Pn(An.month,n),a);case"MM":return $n(In(2,n),a);case"Mo":return $n(s.ordinalNumber(n,{unit:"month"}),a);case"MMM":return s.month(n,{width:"abbreviated",context:"formatting"})||s.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(n,{width:"wide",context:"formatting"})||s.month(n,{width:"abbreviated",context:"formatting"})||s.month(n,{width:"narrow",context:"formatting"})}}validate(n,i){return i>=0&&i<=11}set(n,i,s){return n.setMonth(s,1),n.setHours(0,0,0,0),n}}class lM extends sn{constructor(){super(...arguments);q(this,"priority",110);q(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(n,i,s){const a=d=>d-1;switch(i){case"L":return $n(Pn(An.month,n),a);case"LL":return $n(In(2,n),a);case"Lo":return $n(s.ordinalNumber(n,{unit:"month"}),a);case"LLL":return s.month(n,{width:"abbreviated",context:"standalone"})||s.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(n,{width:"wide",context:"standalone"})||s.month(n,{width:"abbreviated",context:"standalone"})||s.month(n,{width:"narrow",context:"standalone"})}}validate(n,i){return i>=0&&i<=11}set(n,i,s){return n.setMonth(s,1),n.setHours(0,0,0,0),n}}function cM(e,t,n){const i=Bt(e),s=by(i,n)-t;return i.setDate(i.getDate()-s*7),i}class dM extends sn{constructor(){super(...arguments);q(this,"priority",100);q(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,i,s){switch(i){case"w":return Pn(An.week,n);case"wo":return s.ordinalNumber(n,{unit:"week"});default:return In(i.length,n)}}validate(n,i){return i>=1&&i<=53}set(n,i,s,a){return Ks(cM(n,s,a),a)}}function uM(e,t){const n=Bt(e),i=yy(n)-t;return n.setDate(n.getDate()-i*7),n}class hM extends sn{constructor(){super(...arguments);q(this,"priority",100);q(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(n,i,s){switch(i){case"I":return Pn(An.week,n);case"Io":return s.ordinalNumber(n,{unit:"week"});default:return In(i.length,n)}}validate(n,i){return i>=1&&i<=53}set(n,i,s){return Po(uM(n,s))}}const fM=[31,28,31,30,31,30,31,31,30,31,30,31],pM=[31,29,31,30,31,30,31,31,30,31,30,31];class vM extends sn{constructor(){super(...arguments);q(this,"priority",90);q(this,"subPriority",1);q(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,i,s){switch(i){case"d":return Pn(An.date,n);case"do":return s.ordinalNumber(n,{unit:"date"});default:return In(i.length,n)}}validate(n,i){const s=n.getFullYear(),a=Ey(s),d=n.getMonth();return a?i>=1&&i<=pM[d]:i>=1&&i<=fM[d]}set(n,i,s){return n.setDate(s),n.setHours(0,0,0,0),n}}class gM extends sn{constructor(){super(...arguments);q(this,"priority",90);q(this,"subpriority",1);q(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(n,i,s){switch(i){case"D":case"DD":return Pn(An.dayOfYear,n);case"Do":return s.ordinalNumber(n,{unit:"date"});default:return In(i.length,n)}}validate(n,i){const s=n.getFullYear();return Ey(s)?i>=1&&i<=366:i>=1&&i<=365}set(n,i,s){return n.setMonth(0,s),n.setHours(0,0,0,0),n}}function Kh(e,t,n){var u,v,m,b;const i=Ha(),s=(n==null?void 0:n.weekStartsOn)??((v=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:v.weekStartsOn)??i.weekStartsOn??((b=(m=i.locale)==null?void 0:m.options)==null?void 0:b.weekStartsOn)??0,a=Bt(e),d=a.getDay(),o=(t%7+7)%7,c=7-s,h=t<0||t>6?t-(d+c)%7:(o+c)%7-(d+c)%7;return fo(a,h)}class mM extends sn{constructor(){super(...arguments);q(this,"priority",90);q(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(n,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(n,{width:"abbreviated",context:"formatting"})||s.day(n,{width:"short",context:"formatting"})||s.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(n,{width:"short",context:"formatting"})||s.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(n,{width:"wide",context:"formatting"})||s.day(n,{width:"abbreviated",context:"formatting"})||s.day(n,{width:"short",context:"formatting"})||s.day(n,{width:"narrow",context:"formatting"})}}validate(n,i){return i>=0&&i<=6}set(n,i,s,a){return n=Kh(n,s,a),n.setHours(0,0,0,0),n}}class _M extends sn{constructor(){super(...arguments);q(this,"priority",90);q(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,i,s,a){const d=r=>{const o=Math.floor((r-1)/7)*7;return(r+a.weekStartsOn+6)%7+o};switch(i){case"e":case"ee":return $n(In(i.length,n),d);case"eo":return $n(s.ordinalNumber(n,{unit:"day"}),d);case"eee":return s.day(n,{width:"abbreviated",context:"formatting"})||s.day(n,{width:"short",context:"formatting"})||s.day(n,{width:"narrow",context:"formatting"});case"eeeee":return s.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(n,{width:"short",context:"formatting"})||s.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(n,{width:"wide",context:"formatting"})||s.day(n,{width:"abbreviated",context:"formatting"})||s.day(n,{width:"short",context:"formatting"})||s.day(n,{width:"narrow",context:"formatting"})}}validate(n,i){return i>=0&&i<=6}set(n,i,s,a){return n=Kh(n,s,a),n.setHours(0,0,0,0),n}}class yM extends sn{constructor(){super(...arguments);q(this,"priority",90);q(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,i,s,a){const d=r=>{const o=Math.floor((r-1)/7)*7;return(r+a.weekStartsOn+6)%7+o};switch(i){case"c":case"cc":return $n(In(i.length,n),d);case"co":return $n(s.ordinalNumber(n,{unit:"day"}),d);case"ccc":return s.day(n,{width:"abbreviated",context:"standalone"})||s.day(n,{width:"short",context:"standalone"})||s.day(n,{width:"narrow",context:"standalone"});case"ccccc":return s.day(n,{width:"narrow",context:"standalone"});case"cccccc":return s.day(n,{width:"short",context:"standalone"})||s.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(n,{width:"wide",context:"standalone"})||s.day(n,{width:"abbreviated",context:"standalone"})||s.day(n,{width:"short",context:"standalone"})||s.day(n,{width:"narrow",context:"standalone"})}}validate(n,i){return i>=0&&i<=6}set(n,i,s,a){return n=Kh(n,s,a),n.setHours(0,0,0,0),n}}function bM(e,t){const n=Bt(e),i=YI(n),s=t-i;return fo(n,s)}class wM extends sn{constructor(){super(...arguments);q(this,"priority",90);q(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(n,i,s){const a=d=>d===0?7:d;switch(i){case"i":case"ii":return In(i.length,n);case"io":return s.ordinalNumber(n,{unit:"day"});case"iii":return $n(s.day(n,{width:"abbreviated",context:"formatting"})||s.day(n,{width:"short",context:"formatting"})||s.day(n,{width:"narrow",context:"formatting"}),a);case"iiiii":return $n(s.day(n,{width:"narrow",context:"formatting"}),a);case"iiiiii":return $n(s.day(n,{width:"short",context:"formatting"})||s.day(n,{width:"narrow",context:"formatting"}),a);case"iiii":default:return $n(s.day(n,{width:"wide",context:"formatting"})||s.day(n,{width:"abbreviated",context:"formatting"})||s.day(n,{width:"short",context:"formatting"})||s.day(n,{width:"narrow",context:"formatting"}),a)}}validate(n,i){return i>=1&&i<=7}set(n,i,s){return n=bM(n,s),n.setHours(0,0,0,0),n}}class SM extends sn{constructor(){super(...arguments);q(this,"priority",80);q(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(n,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(n,{width:"abbreviated",context:"formatting"})||s.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(n,{width:"wide",context:"formatting"})||s.dayPeriod(n,{width:"abbreviated",context:"formatting"})||s.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,i,s){return n.setHours(Vh(s),0,0,0),n}}class CM extends sn{constructor(){super(...arguments);q(this,"priority",80);q(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(n,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(n,{width:"abbreviated",context:"formatting"})||s.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(n,{width:"wide",context:"formatting"})||s.dayPeriod(n,{width:"abbreviated",context:"formatting"})||s.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,i,s){return n.setHours(Vh(s),0,0,0),n}}class kM extends sn{constructor(){super(...arguments);q(this,"priority",80);q(this,"incompatibleTokens",["a","b","t","T"])}parse(n,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(n,{width:"abbreviated",context:"formatting"})||s.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(n,{width:"wide",context:"formatting"})||s.dayPeriod(n,{width:"abbreviated",context:"formatting"})||s.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,i,s){return n.setHours(Vh(s),0,0,0),n}}class xM extends sn{constructor(){super(...arguments);q(this,"priority",70);q(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,i,s){switch(i){case"h":return Pn(An.hour12h,n);case"ho":return s.ordinalNumber(n,{unit:"hour"});default:return In(i.length,n)}}validate(n,i){return i>=1&&i<=12}set(n,i,s){const a=n.getHours()>=12;return a&&s<12?n.setHours(s+12,0,0,0):!a&&s===12?n.setHours(0,0,0,0):n.setHours(s,0,0,0),n}}class RM extends sn{constructor(){super(...arguments);q(this,"priority",70);q(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,i,s){switch(i){case"H":return Pn(An.hour23h,n);case"Ho":return s.ordinalNumber(n,{unit:"hour"});default:return In(i.length,n)}}validate(n,i){return i>=0&&i<=23}set(n,i,s){return n.setHours(s,0,0,0),n}}class TM extends sn{constructor(){super(...arguments);q(this,"priority",70);q(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,i,s){switch(i){case"K":return Pn(An.hour11h,n);case"Ko":return s.ordinalNumber(n,{unit:"hour"});default:return In(i.length,n)}}validate(n,i){return i>=0&&i<=11}set(n,i,s){return n.getHours()>=12&&s<12?n.setHours(s+12,0,0,0):n.setHours(s,0,0,0),n}}class EM extends sn{constructor(){super(...arguments);q(this,"priority",70);q(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,i,s){switch(i){case"k":return Pn(An.hour24h,n);case"ko":return s.ordinalNumber(n,{unit:"hour"});default:return In(i.length,n)}}validate(n,i){return i>=1&&i<=24}set(n,i,s){const a=s<=24?s%24:s;return n.setHours(a,0,0,0),n}}class PM extends sn{constructor(){super(...arguments);q(this,"priority",60);q(this,"incompatibleTokens",["t","T"])}parse(n,i,s){switch(i){case"m":return Pn(An.minute,n);case"mo":return s.ordinalNumber(n,{unit:"minute"});default:return In(i.length,n)}}validate(n,i){return i>=0&&i<=59}set(n,i,s){return n.setMinutes(s,0,0),n}}class LM extends sn{constructor(){super(...arguments);q(this,"priority",50);q(this,"incompatibleTokens",["t","T"])}parse(n,i,s){switch(i){case"s":return Pn(An.second,n);case"so":return s.ordinalNumber(n,{unit:"second"});default:return In(i.length,n)}}validate(n,i){return i>=0&&i<=59}set(n,i,s){return n.setSeconds(s,0),n}}class DM extends sn{constructor(){super(...arguments);q(this,"priority",30);q(this,"incompatibleTokens",["t","T"])}parse(n,i){const s=a=>Math.trunc(a*Math.pow(10,-i.length+3));return $n(In(i.length,n),s)}set(n,i,s){return n.setMilliseconds(s),n}}class IM extends sn{constructor(){super(...arguments);q(this,"priority",10);q(this,"incompatibleTokens",["t","T","x"])}parse(n,i){switch(i){case"X":return ws(bs.basicOptionalMinutes,n);case"XX":return ws(bs.basic,n);case"XXXX":return ws(bs.basicOptionalSeconds,n);case"XXXXX":return ws(bs.extendedOptionalSeconds,n);case"XXX":default:return ws(bs.extended,n)}}set(n,i,s){return i.timestampIsSet?n:vn(n,n.getTime()-uc(n)-s)}}class MM extends sn{constructor(){super(...arguments);q(this,"priority",10);q(this,"incompatibleTokens",["t","T","X"])}parse(n,i){switch(i){case"x":return ws(bs.basicOptionalMinutes,n);case"xx":return ws(bs.basic,n);case"xxxx":return ws(bs.basicOptionalSeconds,n);case"xxxxx":return ws(bs.extendedOptionalSeconds,n);case"xxx":default:return ws(bs.extended,n)}}set(n,i,s){return i.timestampIsSet?n:vn(n,n.getTime()-uc(n)-s)}}class AM extends sn{constructor(){super(...arguments);q(this,"priority",40);q(this,"incompatibleTokens","*")}parse(n){return Ry(n)}set(n,i,s){return[vn(n,s*1e3),{timestampIsSet:!0}]}}class $M extends sn{constructor(){super(...arguments);q(this,"priority",20);q(this,"incompatibleTokens","*")}parse(n){return Ry(n)}set(n,i,s){return[vn(n,s),{timestampIsSet:!0}]}}const OM={G:new eM,y:new tM,Y:new nM,R:new iM,u:new sM,Q:new rM,q:new oM,M:new aM,L:new lM,w:new dM,I:new hM,d:new vM,D:new gM,E:new mM,e:new _M,c:new yM,i:new wM,a:new SM,b:new CM,B:new kM,h:new xM,H:new RM,K:new TM,k:new EM,m:new PM,s:new LM,S:new DM,X:new IM,x:new MM,t:new AM,T:new $M},FM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,BM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,HM=/^'([^]*?)'?$/,NM=/''/g,UM=/\S/,zM=/[a-zA-Z]/;function VM(e,t,n,i){var g,l,f,p,y,C,k,E;const s=ky(),a=(i==null?void 0:i.locale)??s.locale??Yg,d=(i==null?void 0:i.firstWeekContainsDate)??((l=(g=i==null?void 0:i.locale)==null?void 0:g.options)==null?void 0:l.firstWeekContainsDate)??s.firstWeekContainsDate??((p=(f=s.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,r=(i==null?void 0:i.weekStartsOn)??((C=(y=i==null?void 0:i.locale)==null?void 0:y.options)==null?void 0:C.weekStartsOn)??s.weekStartsOn??((E=(k=s.locale)==null?void 0:k.options)==null?void 0:E.weekStartsOn)??0;if(t==="")return e===""?Bt(n):vn(n,NaN);const o={firstWeekContainsDate:d,weekStartsOn:r,locale:a},c=[new QI],h=t.match(BM).map(I=>{const S=I[0];if(S in $u){const P=$u[S];return P(I,a.formatLong)}return I}).join("").match(FM),u=[];for(let I of h){!(i!=null&&i.useAdditionalWeekYearTokens)&&Cy(I)&&Ou(I,t,e),!(i!=null&&i.useAdditionalDayOfYearTokens)&&Sy(I)&&Ou(I,t,e);const S=I[0],P=OM[S];if(P){const{incompatibleTokens:A}=P;if(Array.isArray(A)){const x=u.find(D=>A.includes(D.token)||D.token===S);if(x)throw new RangeError(`The format string mustn't contain \`${x.fullToken}\` and \`${I}\` at the same time`)}else if(P.incompatibleTokens==="*"&&u.length>0)throw new RangeError(`The format string mustn't contain \`${I}\` and any other token at the same time`);u.push({token:S,fullToken:I});const L=P.run(e,I,a.match,o);if(!L)return vn(n,NaN);c.push(L.setter),e=L.rest}else{if(S.match(zM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");if(I==="''"?I="'":S==="'"&&(I=KM(I)),e.indexOf(I)===0)e=e.slice(I.length);else return vn(n,NaN)}}if(e.length>0&&UM.test(e))return vn(n,NaN);const v=c.map(I=>I.priority).sort((I,S)=>S-I).filter((I,S,P)=>P.indexOf(I)===S).map(I=>c.filter(S=>S.priority===I).sort((S,P)=>P.subPriority-S.subPriority)).map(I=>I[0]);let m=Bt(n);if(isNaN(m.getTime()))return vn(n,NaN);const b={};for(const I of v){if(!I.validate(m,o))return vn(n,NaN);const S=I.set(m,b,o);Array.isArray(S)?(m=S[0],Object.assign(b,S[1])):m=S}return vn(n,m)}function KM(e){return e.match(HM)[1].replace(NM,"'")}function WM(e){const t=Bt(e);return t.setMinutes(0,0,0),t}function Va(e,t){const n=Bt(e),i=Bt(t);return n.getFullYear()===i.getFullYear()&&n.getMonth()===i.getMonth()}function Py(e,t){const n=$a(e),i=$a(t);return+n==+i}function Wh(e){const t=Bt(e);return t.setMilliseconds(0),t}function Ly(e,t){const n=Bt(e),i=Bt(t);return n.getFullYear()===i.getFullYear()}function jh(e,t){const n=Bt(e),i=n.getFullYear(),s=n.getDate(),a=vn(e,0);a.setFullYear(i,t,15),a.setHours(0,0,0,0);const d=qI(a);return n.setMonth(t,Math.min(s,d)),n}function Zn(e,t){let n=Bt(e);return isNaN(+n)?vn(e,NaN):(t.year!=null&&n.setFullYear(t.year),t.month!=null&&(n=jh(n,t.month)),t.date!=null&&n.setDate(t.date),t.hours!=null&&n.setHours(t.hours),t.minutes!=null&&n.setMinutes(t.minutes),t.seconds!=null&&n.setSeconds(t.seconds),t.milliseconds!=null&&n.setMilliseconds(t.milliseconds),n)}function Dr(e,t){const n=Bt(e);return n.setHours(t),n}function Id(e,t){const n=Bt(e);return n.setMinutes(t),n}function jM(e,t){const n=Bt(e),i=Math.trunc(n.getMonth()/3)+1,s=t-i;return jh(n,n.getMonth()+s*3)}function Md(e,t){const n=Bt(e);return n.setSeconds(t),n}function Fu(e,t){const n=Bt(e);return isNaN(+n)?vn(e,NaN):(n.setFullYear(t),n)}const qM={date:PI,month:Va,year:Ly,quarter:Py};function YM(e){return(t,n)=>{const i=(e+1)%7;return V0(t,n,{weekStartsOn:i})}}function mi(e,t,n,i=0){return(n==="week"?YM(i):qM[n])(e,t)}function Ad(e,t,n,i,s,a){return s==="date"?GM(e,t,n,i):XM(e,t,n,i,a)}function GM(e,t,n,i){let s=!1,a=!1,d=!1;Array.isArray(n)&&(n[0]e.value),r=Qn(d,a),o=W(()=>{var u;return((u=r.value)===null||u===void 0?void 0:u.length)||0}),c=W(()=>Array.isArray(r.value)?new Set(r.value):new Set);function h(u,v){const{nTriggerFormInput:m,nTriggerFormChange:b}=n,{onChange:g,"onUpdate:value":l,onUpdateValue:f}=e;if(Array.isArray(r.value)){const p=Array.from(r.value),y=p.findIndex(C=>C===v);u?~y||(p.push(v),f&&rt(f,p,{actionType:"check",value:v}),l&&rt(l,p,{actionType:"check",value:v}),m(),b(),a.value=p,g&&rt(g,p)):~y&&(p.splice(y,1),f&&rt(f,p,{actionType:"uncheck",value:v}),l&&rt(l,p,{actionType:"uncheck",value:v}),g&&rt(g,p),a.value=p,m(),b())}else u?(f&&rt(f,[v],{actionType:"check",value:v}),l&&rt(l,[v],{actionType:"check",value:v}),g&&rt(g,[v]),a.value=[v],m(),b()):(f&&rt(f,[],{actionType:"uncheck",value:v}),l&&rt(l,[],{actionType:"uncheck",value:v}),g&&rt(g,[]),a.value=[],m(),b())}return Rn(Ay,{checkedCountRef:o,maxRef:ut(e,"max"),minRef:ut(e,"min"),valueSetRef:c,disabledRef:s,mergedSizeRef:i,toggleCheckbox:h}),{mergedClsPrefix:t}},render(){return H("div",{class:`${this.mergedClsPrefix}-checkbox-group`,role:"group"},this.$slots)}}),nA=()=>H("svg",{viewBox:"0 0 64 64",class:"check-icon"},H("path",{d:"M50.42,16.76L22.34,39.45l-8.1-11.46c-1.12-1.58-3.3-1.96-4.88-0.84c-1.58,1.12-1.95,3.3-0.84,4.88l10.26,14.51 c0.56,0.79,1.42,1.31,2.38,1.45c0.16,0.02,0.32,0.03,0.48,0.03c0.8,0,1.57-0.27,2.2-0.78l30.99-25.03c1.5-1.21,1.74-3.42,0.52-4.92 C54.13,15.78,51.93,15.55,50.42,16.76z"})),iA=()=>H("svg",{viewBox:"0 0 100 100",class:"line-icon"},H("path",{d:"M80.2,55.5H21.4c-2.8,0-5.1-2.5-5.1-5.5l0,0c0-3,2.3-5.5,5.1-5.5h58.7c2.8,0,5.1,2.5,5.1,5.5l0,0C85.2,53.1,82.9,55.5,80.2,55.5z"})),sA=Ke([Re("checkbox",` + font-size: var(--n-font-size); + outline: none; + cursor: pointer; + display: inline-flex; + flex-wrap: nowrap; + align-items: flex-start; + word-break: break-word; + line-height: var(--n-size); + --n-merged-color-table: var(--n-color-table); + `,[We("show-label","line-height: var(--n-label-line-height);"),Ke("&:hover",[Re("checkbox-box",[tt("border","border: var(--n-border-checked);")])]),Ke("&:focus:not(:active)",[Re("checkbox-box",[tt("border",` + border: var(--n-border-focus); + box-shadow: var(--n-box-shadow-focus); + `)])]),We("inside-table",[Re("checkbox-box",` + background-color: var(--n-merged-color-table); + `)]),We("checked",[Re("checkbox-box",` + background-color: var(--n-color-checked); + `,[Re("checkbox-icon",[Ke(".check-icon",` + opacity: 1; + transform: scale(1); + `)])])]),We("indeterminate",[Re("checkbox-box",[Re("checkbox-icon",[Ke(".check-icon",` + opacity: 0; + transform: scale(.5); + `),Ke(".line-icon",` + opacity: 1; + transform: scale(1); + `)])])]),We("checked, indeterminate",[Ke("&:focus:not(:active)",[Re("checkbox-box",[tt("border",` + border: var(--n-border-checked); + box-shadow: var(--n-box-shadow-focus); + `)])]),Re("checkbox-box",` + background-color: var(--n-color-checked); + border-left: 0; + border-top: 0; + `,[tt("border",{border:"var(--n-border-checked)"})])]),We("disabled",{cursor:"not-allowed"},[We("checked",[Re("checkbox-box",` + background-color: var(--n-color-disabled-checked); + `,[tt("border",{border:"var(--n-border-disabled-checked)"}),Re("checkbox-icon",[Ke(".check-icon, .line-icon",{fill:"var(--n-check-mark-color-disabled-checked)"})])])]),Re("checkbox-box",` + background-color: var(--n-color-disabled); + `,[tt("border",` + border: var(--n-border-disabled); + `),Re("checkbox-icon",[Ke(".check-icon, .line-icon",` + fill: var(--n-check-mark-color-disabled); + `)])]),tt("label",` + color: var(--n-text-color-disabled); + `)]),Re("checkbox-box-wrapper",` + position: relative; + width: var(--n-size); + flex-shrink: 0; + flex-grow: 0; + user-select: none; + -webkit-user-select: none; + `),Re("checkbox-box",` + position: absolute; + left: 0; + top: 50%; + transform: translateY(-50%); + height: var(--n-size); + width: var(--n-size); + display: inline-block; + box-sizing: border-box; + border-radius: var(--n-border-radius); + background-color: var(--n-color); + transition: background-color 0.3s var(--n-bezier); + `,[tt("border",` + transition: + border-color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier); + border-radius: inherit; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + border: var(--n-border); + `),Re("checkbox-icon",` + display: flex; + align-items: center; + justify-content: center; + position: absolute; + left: 1px; + right: 1px; + top: 1px; + bottom: 1px; + `,[Ke(".check-icon, .line-icon",` + width: 100%; + fill: var(--n-check-mark-color); + opacity: 0; + transform: scale(0.5); + transform-origin: center; + transition: + fill 0.3s var(--n-bezier), + transform 0.3s var(--n-bezier), + opacity 0.3s var(--n-bezier), + border-color 0.3s var(--n-bezier); + `),oo({left:"1px",top:"1px"})])]),tt("label",` + color: var(--n-text-color); + transition: color .3s var(--n-bezier); + user-select: none; + -webkit-user-select: none; + padding: var(--n-label-padding); + font-weight: var(--n-label-font-weight); + `,[Ke("&:empty",{display:"none"})])]),Gg(Re("checkbox",` + --n-merged-color-table: var(--n-color-table-modal); + `)),Xg(Re("checkbox",` + --n-merged-color-table: var(--n-color-table-popover); + `))]),rA=Object.assign(Object.assign({},Ht.props),{size:String,checked:{type:[Boolean,String,Number],default:void 0},defaultChecked:{type:[Boolean,String,Number],default:!1},value:[String,Number],disabled:{type:Boolean,default:void 0},indeterminate:Boolean,label:String,focusable:{type:Boolean,default:!0},checkedValue:{type:[Boolean,String,Number],default:!0},uncheckedValue:{type:[Boolean,String,Number],default:!1},"onUpdate:checked":[Function,Array],onUpdateChecked:[Function,Array],privateInsideTable:Boolean,onChange:[Function,Array]}),qh=$e({name:"Checkbox",props:rA,setup(e){const t=zt(Ay,null),n=F(null),{mergedClsPrefixRef:i,inlineThemeDisabled:s,mergedRtlRef:a}=bn(e),d=F(e.defaultChecked),r=ut(e,"checked"),o=Qn(r,d),c=en(()=>{if(t){const E=t.valueSetRef.value;return E&&e.value!==void 0?E.has(e.value):!1}else return o.value===e.checkedValue}),h=_r(e,{mergedSize(E){const{size:I}=e;if(I!==void 0)return I;if(t){const{value:S}=t.mergedSizeRef;if(S!==void 0)return S}if(E){const{mergedSize:S}=E;if(S!==void 0)return S.value}return"medium"},mergedDisabled(E){const{disabled:I}=e;if(I!==void 0)return I;if(t){if(t.disabledRef.value)return!0;const{maxRef:{value:S},checkedCountRef:P}=t;if(S!==void 0&&P.value>=S&&!c.value)return!0;const{minRef:{value:A}}=t;if(A!==void 0&&P.value<=A&&c.value)return!0}return E?E.disabled.value:!1}}),{mergedDisabledRef:u,mergedSizeRef:v}=h,m=Ht("Checkbox","-checkbox",sA,K0,e,i);function b(E){if(t&&e.value!==void 0)t.toggleCheckbox(!c.value,e.value);else{const{onChange:I,"onUpdate:checked":S,onUpdateChecked:P}=e,{nTriggerFormInput:A,nTriggerFormChange:L}=h,x=c.value?e.uncheckedValue:e.checkedValue;S&&rt(S,x,E),P&&rt(P,x,E),I&&rt(I,x,E),A(),L(),d.value=x}}function g(E){u.value||b(E)}function l(E){if(!u.value)switch(E.key){case" ":case"Enter":b(E)}}function f(E){switch(E.key){case" ":E.preventDefault()}}const p={focus:()=>{var E;(E=n.value)===null||E===void 0||E.focus()},blur:()=>{var E;(E=n.value)===null||E===void 0||E.blur()}},y=Rs("Checkbox",a,i),C=W(()=>{const{value:E}=v,{common:{cubicBezierEaseInOut:I},self:{borderRadius:S,color:P,colorChecked:A,colorDisabled:L,colorTableHeader:x,colorTableHeaderModal:D,colorTableHeaderPopover:M,checkMarkColor:B,checkMarkColorDisabled:z,border:Y,borderFocus:U,borderDisabled:N,borderChecked:V,boxShadowFocus:j,textColor:G,textColorDisabled:te,checkMarkColorDisabledChecked:se,colorDisabledChecked:oe,borderDisabledChecked:Fe,labelPadding:K,labelLineHeight:Z,labelFontWeight:J,[Mt("fontSize",E)]:ae,[Mt("size",E)]:Ie}}=m.value;return{"--n-label-line-height":Z,"--n-label-font-weight":J,"--n-size":Ie,"--n-bezier":I,"--n-border-radius":S,"--n-border":Y,"--n-border-checked":V,"--n-border-focus":U,"--n-border-disabled":N,"--n-border-disabled-checked":Fe,"--n-box-shadow-focus":j,"--n-color":P,"--n-color-checked":A,"--n-color-table":x,"--n-color-table-modal":D,"--n-color-table-popover":M,"--n-color-disabled":L,"--n-color-disabled-checked":oe,"--n-text-color":G,"--n-text-color-disabled":te,"--n-check-mark-color":B,"--n-check-mark-color-disabled":z,"--n-check-mark-color-disabled-checked":se,"--n-font-size":ae,"--n-label-padding":K}}),k=s?Bn("checkbox",W(()=>v.value[0]),C,e):void 0;return Object.assign(h,p,{rtlEnabled:y,selfRef:n,mergedClsPrefix:i,mergedDisabled:u,renderedChecked:c,mergedTheme:m,labelId:oh(),handleClick:g,handleKeyUp:l,handleKeyDown:f,cssVars:s?void 0:C,themeClass:k==null?void 0:k.themeClass,onRender:k==null?void 0:k.onRender})},render(){var e;const{$slots:t,renderedChecked:n,mergedDisabled:i,indeterminate:s,privateInsideTable:a,cssVars:d,labelId:r,label:o,mergedClsPrefix:c,focusable:h,handleKeyUp:u,handleKeyDown:v,handleClick:m}=this;(e=this.onRender)===null||e===void 0||e.call(this);const b=qi(t.default,g=>o||g?H("span",{class:`${c}-checkbox__label`,id:r},o||g):null);return H("div",{ref:"selfRef",class:[`${c}-checkbox`,this.themeClass,this.rtlEnabled&&`${c}-checkbox--rtl`,n&&`${c}-checkbox--checked`,i&&`${c}-checkbox--disabled`,s&&`${c}-checkbox--indeterminate`,a&&`${c}-checkbox--inside-table`,b&&`${c}-checkbox--show-label`],tabindex:i||!h?void 0:0,role:"checkbox","aria-checked":s?"mixed":n,"aria-labelledby":r,style:d,onKeyup:u,onKeydown:v,onClick:m,onMousedown:()=>{zn("selectstart",window,g=>{g.preventDefault()},{once:!0})}},H("div",{class:`${c}-checkbox-box-wrapper`}," ",H("div",{class:`${c}-checkbox-box`},H(Jg,null,{default:()=>this.indeterminate?H("div",{key:"indeterminate",class:`${c}-checkbox-icon`},iA()):H("div",{key:"check",class:`${c}-checkbox-icon`},nA())}),H("div",{class:`${c}-checkbox-box__border`}))),b)}}),$y=ui("n-popselect"),oA=Re("popselect-menu",` + box-shadow: var(--n-menu-box-shadow); +`),Yh={multiple:Boolean,value:{type:[String,Number,Array],default:null},cancelable:Boolean,options:{type:Array,default:()=>[]},size:{type:String,default:"medium"},scrollable:Boolean,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onMouseenter:Function,onMouseleave:Function,renderLabel:Function,showCheckmark:{type:Boolean,default:void 0},nodeProps:Function,virtualScroll:Boolean,onChange:[Function,Array]},Uv=Qg(Yh),aA=$e({name:"PopselectPanel",props:Yh,setup(e){const t=zt($y),{mergedClsPrefixRef:n,inlineThemeDisabled:i}=bn(e),s=Ht("Popselect","-pop-select",oA,Zg,t.props,n),a=W(()=>Fc(e.options,gy("value","children")));function d(v,m){const{onUpdateValue:b,"onUpdate:value":g,onChange:l}=e;b&&rt(b,v,m),g&&rt(g,v,m),l&&rt(l,v,m)}function r(v){c(v.key)}function o(v){!Ti(v,"action")&&!Ti(v,"empty")&&!Ti(v,"header")&&v.preventDefault()}function c(v){const{value:{getNode:m}}=a;if(e.multiple)if(Array.isArray(e.value)){const b=[],g=[];let l=!0;e.value.forEach(f=>{if(f===v){l=!1;return}const p=m(f);p&&(b.push(p.key),g.push(p.rawNode))}),l&&(b.push(v),g.push(m(v).rawNode)),d(b,g)}else{const b=m(v);b&&d([v],[b.rawNode])}else if(e.value===v&&e.cancelable)d(null,null);else{const b=m(v);b&&d(v,b.rawNode);const{"onUpdate:show":g,onUpdateShow:l}=t.props;g&&rt(g,!1),l&&rt(l,!1),t.setShow(!1)}hn(()=>{t.syncPosition()})}wt(ut(e,"options"),()=>{hn(()=>{t.syncPosition()})});const h=W(()=>{const{self:{menuBoxShadow:v}}=s.value;return{"--n-menu-box-shadow":v}}),u=i?Bn("select",void 0,h,t.props):void 0;return{mergedTheme:t.mergedThemeRef,mergedClsPrefix:n,treeMate:a,handleToggle:r,handleMenuMousedown:o,cssVars:i?void 0:h,themeClass:u==null?void 0:u.themeClass,onRender:u==null?void 0:u.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),H(hy,{clsPrefix:this.mergedClsPrefix,focusable:!0,nodeProps:this.nodeProps,class:[`${this.mergedClsPrefix}-popselect-menu`,this.themeClass],style:this.cssVars,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,multiple:this.multiple,treeMate:this.treeMate,size:this.size,value:this.value,virtualScroll:this.virtualScroll,scrollable:this.scrollable,renderLabel:this.renderLabel,onToggle:this.handleToggle,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseenter,onMousedown:this.handleMenuMousedown,showCheckmark:this.showCheckmark},{header:()=>{var t,n;return((n=(t=this.$slots).header)===null||n===void 0?void 0:n.call(t))||[]},action:()=>{var t,n;return((n=(t=this.$slots).action)===null||n===void 0?void 0:n.call(t))||[]},empty:()=>{var t,n;return((n=(t=this.$slots).empty)===null||n===void 0?void 0:n.call(t))||[]}})}}),lA=Object.assign(Object.assign(Object.assign(Object.assign({},Ht.props),dh(Wr,["showArrow","arrow"])),{placement:Object.assign(Object.assign({},Wr.placement),{default:"bottom"}),trigger:{type:String,default:"hover"}}),Yh),cA=$e({name:"Popselect",props:lA,inheritAttrs:!1,__popover__:!0,setup(e){const{mergedClsPrefixRef:t}=bn(e),n=Ht("Popselect","-popselect",void 0,Zg,e,t),i=F(null);function s(){var r;(r=i.value)===null||r===void 0||r.syncPosition()}function a(r){var o;(o=i.value)===null||o===void 0||o.setShow(r)}return Rn($y,{props:e,mergedThemeRef:n,syncPosition:s,setShow:a}),Object.assign(Object.assign({},{syncPosition:s,setShow:a}),{popoverInstRef:i,mergedTheme:n})},render(){const{mergedTheme:e}=this,t={theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:{padding:"0"},ref:"popoverInstRef",internalRenderBody:(n,i,s,a,d)=>{const{$attrs:r}=this;return H(aA,Object.assign({},r,{class:[r.class,n],style:[r.style,...s]},Oc(this.$props,Uv),{ref:sy(i),onMouseenter:Ra([a,r.onMouseenter]),onMouseleave:Ra([d,r.onMouseleave])}),{header:()=>{var o,c;return(c=(o=this.$slots).header)===null||c===void 0?void 0:c.call(o)},action:()=>{var o,c;return(c=(o=this.$slots).action)===null||c===void 0?void 0:c.call(o)},empty:()=>{var o,c;return(c=(o=this.$slots).empty)===null||c===void 0?void 0:c.call(o)}})}};return H(Ko,Object.assign({},dh(this.$props,Uv),t,{internalDeactivateImmediately:!0}),{trigger:()=>{var n,i;return(i=(n=this.$slots).default)===null||i===void 0?void 0:i.call(n)}})}}),dA=Ke([Re("select",` + z-index: auto; + outline: none; + width: 100%; + position: relative; + font-weight: var(--n-font-weight); + `),Re("select-menu",` + margin: 4px 0; + box-shadow: var(--n-menu-box-shadow); + `,[Vo({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),uA=Object.assign(Object.assign({},Ht.props),{to:di.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),Oy=$e({name:"Select",props:uA,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:n,namespaceRef:i,inlineThemeDisabled:s}=bn(e),a=Ht("Select","-select",dA,W0,e,t),d=F(e.defaultValue),r=ut(e,"value"),o=Qn(r,d),c=F(!1),h=F(""),u=Mh(e,["items","options"]),v=F([]),m=F([]),b=W(()=>m.value.concat(v.value).concat(u.value)),g=W(()=>{const{filter:re}=e;if(re)return re;const{labelField:me,valueField:je}=e;return(it,dt)=>{if(!dt)return!1;const be=dt[me];if(typeof be=="string")return Dd(it,be);const Ve=dt[je];return typeof Ve=="string"?Dd(it,Ve):typeof Ve=="number"?Dd(it,String(Ve)):!1}}),l=W(()=>{if(e.remote)return u.value;{const{value:re}=b,{value:me}=h;return!me.length||!e.filterable?re:bI(re,g.value,me,e.childrenField)}}),f=W(()=>{const{valueField:re,childrenField:me}=e,je=gy(re,me);return Fc(l.value,je)}),p=W(()=>wI(b.value,e.valueField,e.childrenField)),y=F(!1),C=Qn(ut(e,"show"),y),k=F(null),E=F(null),I=F(null),{localeRef:S}=rs("Select"),P=W(()=>{var re;return(re=e.placeholder)!==null&&re!==void 0?re:S.value.placeholder}),A=[],L=F(new Map),x=W(()=>{const{fallbackOption:re}=e;if(re===void 0){const{labelField:me,valueField:je}=e;return it=>({[me]:String(it),[je]:it})}return re===!1?!1:me=>Object.assign(re(me),{value:me})});function D(re){const me=e.remote,{value:je}=L,{value:it}=p,{value:dt}=x,be=[];return re.forEach(Ve=>{if(it.has(Ve))be.push(it.get(Ve));else if(me&&je.has(Ve))be.push(je.get(Ve));else if(dt){const Xe=dt(Ve);Xe&&be.push(Xe)}}),be}const M=W(()=>{if(e.multiple){const{value:re}=o;return Array.isArray(re)?D(re):[]}return null}),B=W(()=>{const{value:re}=o;return!e.multiple&&!Array.isArray(re)?re===null?null:D([re])[0]||null:null}),z=_r(e),{mergedSizeRef:Y,mergedDisabledRef:U,mergedStatusRef:N}=z;function V(re,me){const{onChange:je,"onUpdate:value":it,onUpdateValue:dt}=e,{nTriggerFormChange:be,nTriggerFormInput:Ve}=z;je&&rt(je,re,me),dt&&rt(dt,re,me),it&&rt(it,re,me),d.value=re,be(),Ve()}function j(re){const{onBlur:me}=e,{nTriggerFormBlur:je}=z;me&&rt(me,re),je()}function G(){const{onClear:re}=e;re&&rt(re)}function te(re){const{onFocus:me,showOnFocus:je}=e,{nTriggerFormFocus:it}=z;me&&rt(me,re),it(),je&&Z()}function se(re){const{onSearch:me}=e;me&&rt(me,re)}function oe(re){const{onScroll:me}=e;me&&rt(me,re)}function Fe(){var re;const{remote:me,multiple:je}=e;if(me){const{value:it}=L;if(je){const{valueField:dt}=e;(re=M.value)===null||re===void 0||re.forEach(be=>{it.set(be[dt],be)})}else{const dt=B.value;dt&&it.set(dt[e.valueField],dt)}}}function K(re){const{onUpdateShow:me,"onUpdate:show":je}=e;me&&rt(me,re),je&&rt(je,re),y.value=re}function Z(){U.value||(K(!0),y.value=!0,e.filterable&&Ne())}function J(){K(!1)}function ae(){h.value="",m.value=A}const Ie=F(!1);function de(){e.filterable&&(Ie.value=!0)}function Le(){e.filterable&&(Ie.value=!1,C.value||ae())}function xe(){U.value||(C.value?e.filterable?Ne():J():Z())}function Qe(re){var me,je;!((je=(me=I.value)===null||me===void 0?void 0:me.selfRef)===null||je===void 0)&&je.contains(re.relatedTarget)||(c.value=!1,j(re),J())}function De(re){te(re),c.value=!0}function ne(){c.value=!0}function ue(re){var me;!((me=k.value)===null||me===void 0)&&me.$el.contains(re.relatedTarget)||(c.value=!1,j(re),J())}function he(){var re;(re=k.value)===null||re===void 0||re.focus(),J()}function Ae(re){var me;C.value&&(!((me=k.value)===null||me===void 0)&&me.$el.contains(Nr(re))||J())}function ce(re){if(!Array.isArray(re))return[];if(x.value)return Array.from(re);{const{remote:me}=e,{value:je}=p;if(me){const{value:it}=L;return re.filter(dt=>je.has(dt)||it.has(dt))}else return re.filter(it=>je.has(it))}}function Je(re){ye(re.rawNode)}function ye(re){if(U.value)return;const{tag:me,remote:je,clearFilterAfterSelect:it,valueField:dt}=e;if(me&&!je){const{value:be}=m,Ve=be[0]||null;if(Ve){const Xe=v.value;Xe.length?Xe.push(Ve):v.value=[Ve],m.value=A}}if(je&&L.value.set(re[dt],re),e.multiple){const be=ce(o.value),Ve=be.findIndex(Xe=>Xe===re[dt]);if(~Ve){if(be.splice(Ve,1),me&&!je){const Xe=_e(re[dt]);~Xe&&(v.value.splice(Xe,1),it&&(h.value=""))}}else be.push(re[dt]),it&&(h.value="");V(be,D(be))}else{if(me&&!je){const be=_e(re[dt]);~be?v.value=[v.value[be]]:v.value=A}ht(),J(),V(re[dt],re)}}function _e(re){return v.value.findIndex(je=>je[e.valueField]===re)}function Ce(re){C.value||Z();const{value:me}=re.target;h.value=me;const{tag:je,remote:it}=e;if(se(me),je&&!it){if(!me){m.value=A;return}const{onCreate:dt}=e,be=dt?dt(me):{[e.labelField]:me,[e.valueField]:me},{valueField:Ve,labelField:Xe}=e;u.value.some(pe=>pe[Ve]===be[Ve]||pe[Xe]===be[Xe])||v.value.some(pe=>pe[Ve]===be[Ve]||pe[Xe]===be[Xe])?m.value=A:m.value=[be]}}function Be(re){re.stopPropagation();const{multiple:me}=e;!me&&e.filterable&&J(),G(),me?V([],[]):V(null,null)}function Se(re){!Ti(re,"action")&&!Ti(re,"empty")&&!Ti(re,"header")&&re.preventDefault()}function R(re){oe(re)}function we(re){var me,je,it,dt,be;if(!e.keyboard){re.preventDefault();return}switch(re.key){case" ":if(e.filterable)break;re.preventDefault();case"Enter":if(!(!((me=k.value)===null||me===void 0)&&me.isComposing)){if(C.value){const Ve=(je=I.value)===null||je===void 0?void 0:je.getPendingTmNode();Ve?Je(Ve):e.filterable||(J(),ht())}else if(Z(),e.tag&&Ie.value){const Ve=m.value[0];if(Ve){const Xe=Ve[e.valueField],{value:pe}=o;e.multiple&&Array.isArray(pe)&&pe.includes(Xe)||ye(Ve)}}}re.preventDefault();break;case"ArrowUp":if(re.preventDefault(),e.loading)return;C.value&&((it=I.value)===null||it===void 0||it.prev());break;case"ArrowDown":if(re.preventDefault(),e.loading)return;C.value?(dt=I.value)===null||dt===void 0||dt.next():Z();break;case"Escape":C.value&&(Aa(re),J()),(be=k.value)===null||be===void 0||be.focus();break}}function ht(){var re;(re=k.value)===null||re===void 0||re.focus()}function Ne(){var re;(re=k.value)===null||re===void 0||re.focusInput()}function ot(){var re;C.value&&((re=E.value)===null||re===void 0||re.syncPosition())}Fe(),wt(ut(e,"options"),Fe);const Rt={focus:()=>{var re;(re=k.value)===null||re===void 0||re.focus()},focusInput:()=>{var re;(re=k.value)===null||re===void 0||re.focusInput()},blur:()=>{var re;(re=k.value)===null||re===void 0||re.blur()},blurInput:()=>{var re;(re=k.value)===null||re===void 0||re.blurInput()}},at=W(()=>{const{self:{menuBoxShadow:re}}=a.value;return{"--n-menu-box-shadow":re}}),gt=s?Bn("select",void 0,at,e):void 0;return Object.assign(Object.assign({},Rt),{mergedStatus:N,mergedClsPrefix:t,mergedBordered:n,namespace:i,treeMate:f,isMounted:Ba(),triggerRef:k,menuRef:I,pattern:h,uncontrolledShow:y,mergedShow:C,adjustedTo:di(e),uncontrolledValue:d,mergedValue:o,followerRef:E,localizedPlaceholder:P,selectedOption:B,selectedOptions:M,mergedSize:Y,mergedDisabled:U,focused:c,activeWithoutMenuOpen:Ie,inlineThemeDisabled:s,onTriggerInputFocus:de,onTriggerInputBlur:Le,handleTriggerOrMenuResize:ot,handleMenuFocus:ne,handleMenuBlur:ue,handleMenuTabOut:he,handleTriggerClick:xe,handleToggle:Je,handleDeleteOption:ye,handlePatternInput:Ce,handleClear:Be,handleTriggerBlur:Qe,handleTriggerFocus:De,handleKeydown:we,handleMenuAfterLeave:ae,handleMenuClickOutside:Ae,handleMenuScroll:R,handleMenuKeydown:we,handleMenuMousedown:Se,mergedTheme:a,cssVars:s?void 0:at,themeClass:gt==null?void 0:gt.themeClass,onRender:gt==null?void 0:gt.onRender})},render(){return H("div",{class:`${this.mergedClsPrefix}-select`},H(No,null,{default:()=>[H(Uo,null,{default:()=>H(yI,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var e,t;return[(t=(e=this.$slots).arrow)===null||t===void 0?void 0:t.call(e)]}})}),H(zo,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===di.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>H(xi,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var e,t,n;return this.mergedShow||this.displayDirective==="show"?((e=this.onRender)===null||e===void 0||e.call(this),ct(H(hy,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(t=this.menuProps)===null||t===void 0?void 0:t.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var i,s;return[(s=(i=this.$slots).empty)===null||s===void 0?void 0:s.call(i)]},header:()=>{var i,s;return[(s=(i=this.$slots).header)===null||s===void 0?void 0:s.call(i)]},action:()=>{var i,s;return[(s=(i=this.$slots).action)===null||s===void 0?void 0:s.call(i)]}}),this.displayDirective==="show"?[[Ci,this.mergedShow],[Kr,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[Kr,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),zv=` + background: var(--n-item-color-hover); + color: var(--n-item-text-color-hover); + border: var(--n-item-border-hover); +`,Vv=[We("button",` + background: var(--n-button-color-hover); + border: var(--n-button-border-hover); + color: var(--n-button-icon-color-hover); + `)],hA=Re("pagination",` + display: flex; + vertical-align: middle; + font-size: var(--n-item-font-size); + flex-wrap: nowrap; +`,[Re("pagination-prefix",` + display: flex; + align-items: center; + margin: var(--n-prefix-margin); + `),Re("pagination-suffix",` + display: flex; + align-items: center; + margin: var(--n-suffix-margin); + `),Ke("> *:not(:first-child)",` + margin: var(--n-item-margin); + `),Re("select",` + width: var(--n-select-width); + `),Ke("&.transition-disabled",[Re("pagination-item","transition: none!important;")]),Re("pagination-quick-jumper",` + white-space: nowrap; + display: flex; + color: var(--n-jumper-text-color); + transition: color .3s var(--n-bezier); + align-items: center; + font-size: var(--n-jumper-font-size); + `,[Re("input",` + margin: var(--n-input-margin); + width: var(--n-input-width); + `)]),Re("pagination-item",` + position: relative; + cursor: pointer; + user-select: none; + -webkit-user-select: none; + display: flex; + align-items: center; + justify-content: center; + box-sizing: border-box; + min-width: var(--n-item-size); + height: var(--n-item-size); + padding: var(--n-item-padding); + background-color: var(--n-item-color); + color: var(--n-item-text-color); + border-radius: var(--n-item-border-radius); + border: var(--n-item-border); + fill: var(--n-button-icon-color); + transition: + color .3s var(--n-bezier), + border-color .3s var(--n-bezier), + background-color .3s var(--n-bezier), + fill .3s var(--n-bezier); + `,[We("button",` + background: var(--n-button-color); + color: var(--n-button-icon-color); + border: var(--n-button-border); + padding: 0; + `,[Re("base-icon",` + font-size: var(--n-button-icon-size); + `)]),xn("disabled",[We("hover",zv,Vv),Ke("&:hover",zv,Vv),Ke("&:active",` + background: var(--n-item-color-pressed); + color: var(--n-item-text-color-pressed); + border: var(--n-item-border-pressed); + `,[We("button",` + background: var(--n-button-color-pressed); + border: var(--n-button-border-pressed); + color: var(--n-button-icon-color-pressed); + `)]),We("active",` + background: var(--n-item-color-active); + color: var(--n-item-text-color-active); + border: var(--n-item-border-active); + `,[Ke("&:hover",` + background: var(--n-item-color-active-hover); + `)])]),We("disabled",` + cursor: not-allowed; + color: var(--n-item-text-color-disabled); + `,[We("active, button",` + background-color: var(--n-item-color-disabled); + border: var(--n-item-border-disabled); + `)])]),We("disabled",` + cursor: not-allowed; + `,[Re("pagination-quick-jumper",` + color: var(--n-jumper-text-color-disabled); + `)]),We("simple",` + display: flex; + align-items: center; + flex-wrap: nowrap; + `,[Re("pagination-quick-jumper",[Re("input",` + margin: 0; + `)])])]);function Fy(e){var t;if(!e)return 10;const{defaultPageSize:n}=e;if(n!==void 0)return n;const i=(t=e.pageSizes)===null||t===void 0?void 0:t[0];return typeof i=="number"?i:(i==null?void 0:i.value)||10}function fA(e,t,n,i){let s=!1,a=!1,d=1,r=t;if(t===1)return{hasFastBackward:!1,hasFastForward:!1,fastForwardTo:r,fastBackwardTo:d,items:[{type:"page",label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1}]};if(t===2)return{hasFastBackward:!1,hasFastForward:!1,fastForwardTo:r,fastBackwardTo:d,items:[{type:"page",label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1},{type:"page",label:2,active:e===2,mayBeFastBackward:!0,mayBeFastForward:!1}]};const o=1,c=t;let h=e,u=e;const v=(n-5)/2;u+=Math.ceil(v),u=Math.min(Math.max(u,o+n-3),c-2),h-=Math.floor(v),h=Math.max(Math.min(h,c-n+3),o+2);let m=!1,b=!1;h>o+2&&(m=!0),u=o+1&&g.push({type:"page",label:o+1,mayBeFastBackward:!0,mayBeFastForward:!1,active:e===o+1});for(let l=h;l<=u;++l)g.push({type:"page",label:l,mayBeFastBackward:!1,mayBeFastForward:!1,active:e===l});return b?(a=!0,r=u+1,g.push({type:"fast-forward",active:!1,label:void 0,options:i?Kv(u+1,c-1):null})):u===c-2&&g[g.length-1].label!==c-1&&g.push({type:"page",mayBeFastForward:!0,mayBeFastBackward:!1,label:c-1,active:e===c-1}),g[g.length-1].label!==c&&g.push({type:"page",mayBeFastForward:!1,mayBeFastBackward:!1,label:c,active:e===c}),{hasFastBackward:s,hasFastForward:a,fastBackwardTo:d,fastForwardTo:r,items:g}}function Kv(e,t){const n=[];for(let i=e;i<=t;++i)n.push({label:`${i}`,value:i});return n}const pA=Object.assign(Object.assign({},Ht.props),{simple:Boolean,page:Number,defaultPage:{type:Number,default:1},itemCount:Number,pageCount:Number,defaultPageCount:{type:Number,default:1},showSizePicker:Boolean,pageSize:Number,defaultPageSize:Number,pageSizes:{type:Array,default(){return[10]}},showQuickJumper:Boolean,size:{type:String,default:"medium"},disabled:Boolean,pageSlot:{type:Number,default:9},selectProps:Object,prev:Function,next:Function,goto:Function,prefix:Function,suffix:Function,label:Function,displayOrder:{type:Array,default:["pages","size-picker","quick-jumper"]},to:di.propTo,showQuickJumpDropdown:{type:Boolean,default:!0},"onUpdate:page":[Function,Array],onUpdatePage:[Function,Array],"onUpdate:pageSize":[Function,Array],onUpdatePageSize:[Function,Array],onPageSizeChange:[Function,Array],onChange:[Function,Array]}),vA=$e({name:"Pagination",props:pA,setup(e){const{mergedComponentPropsRef:t,mergedClsPrefixRef:n,inlineThemeDisabled:i,mergedRtlRef:s}=bn(e),a=Ht("Pagination","-pagination",hA,j0,e,n),{localeRef:d}=rs("Pagination"),r=F(null),o=F(e.defaultPage),c=F(Fy(e)),h=Qn(ut(e,"page"),o),u=Qn(ut(e,"pageSize"),c),v=W(()=>{const{itemCount:J}=e;if(J!==void 0)return Math.max(1,Math.ceil(J/u.value));const{pageCount:ae}=e;return ae!==void 0?Math.max(ae,1):1}),m=F("");Yi(()=>{e.simple,m.value=String(h.value)});const b=F(!1),g=F(!1),l=F(!1),f=F(!1),p=()=>{e.disabled||(b.value=!0,B())},y=()=>{e.disabled||(b.value=!1,B())},C=()=>{g.value=!0,B()},k=()=>{g.value=!1,B()},E=J=>{z(J)},I=W(()=>fA(h.value,v.value,e.pageSlot,e.showQuickJumpDropdown));Yi(()=>{I.value.hasFastBackward?I.value.hasFastForward||(b.value=!1,l.value=!1):(g.value=!1,f.value=!1)});const S=W(()=>{const J=d.value.selectionSuffix;return e.pageSizes.map(ae=>typeof ae=="number"?{label:`${ae} / ${J}`,value:ae}:ae)}),P=W(()=>{var J,ae;return((ae=(J=t==null?void 0:t.value)===null||J===void 0?void 0:J.Pagination)===null||ae===void 0?void 0:ae.inputSize)||gv(e.size)}),A=W(()=>{var J,ae;return((ae=(J=t==null?void 0:t.value)===null||J===void 0?void 0:J.Pagination)===null||ae===void 0?void 0:ae.selectSize)||gv(e.size)}),L=W(()=>(h.value-1)*u.value),x=W(()=>{const J=h.value*u.value-1,{itemCount:ae}=e;return ae!==void 0&&J>ae-1?ae-1:J}),D=W(()=>{const{itemCount:J}=e;return J!==void 0?J:(e.pageCount||1)*u.value}),M=Rs("Pagination",s,n);function B(){hn(()=>{var J;const{value:ae}=r;ae&&(ae.classList.add("transition-disabled"),(J=r.value)===null||J===void 0||J.offsetWidth,ae.classList.remove("transition-disabled"))})}function z(J){if(J===h.value)return;const{"onUpdate:page":ae,onUpdatePage:Ie,onChange:de,simple:Le}=e;ae&&rt(ae,J),Ie&&rt(Ie,J),de&&rt(de,J),o.value=J,Le&&(m.value=String(J))}function Y(J){if(J===u.value)return;const{"onUpdate:pageSize":ae,onUpdatePageSize:Ie,onPageSizeChange:de}=e;ae&&rt(ae,J),Ie&&rt(Ie,J),de&&rt(de,J),c.value=J,v.value{h.value,u.value,B()});const K=W(()=>{const{size:J}=e,{self:{buttonBorder:ae,buttonBorderHover:Ie,buttonBorderPressed:de,buttonIconColor:Le,buttonIconColorHover:xe,buttonIconColorPressed:Qe,itemTextColor:De,itemTextColorHover:ne,itemTextColorPressed:ue,itemTextColorActive:he,itemTextColorDisabled:Ae,itemColor:ce,itemColorHover:Je,itemColorPressed:ye,itemColorActive:_e,itemColorActiveHover:Ce,itemColorDisabled:Be,itemBorder:Se,itemBorderHover:R,itemBorderPressed:we,itemBorderActive:ht,itemBorderDisabled:Ne,itemBorderRadius:ot,jumperTextColor:Rt,jumperTextColorDisabled:at,buttonColor:gt,buttonColorHover:re,buttonColorPressed:me,[Mt("itemPadding",J)]:je,[Mt("itemMargin",J)]:it,[Mt("inputWidth",J)]:dt,[Mt("selectWidth",J)]:be,[Mt("inputMargin",J)]:Ve,[Mt("selectMargin",J)]:Xe,[Mt("jumperFontSize",J)]:pe,[Mt("prefixMargin",J)]:Ge,[Mt("suffixMargin",J)]:_t,[Mt("itemSize",J)]:Te,[Mt("buttonIconSize",J)]:Ye,[Mt("itemFontSize",J)]:ft,[`${Mt("itemMargin",J)}Rtl`]:Dt,[`${Mt("inputMargin",J)}Rtl`]:Yt},common:{cubicBezierEaseInOut:jt}}=a.value;return{"--n-prefix-margin":Ge,"--n-suffix-margin":_t,"--n-item-font-size":ft,"--n-select-width":be,"--n-select-margin":Xe,"--n-input-width":dt,"--n-input-margin":Ve,"--n-input-margin-rtl":Yt,"--n-item-size":Te,"--n-item-text-color":De,"--n-item-text-color-disabled":Ae,"--n-item-text-color-hover":ne,"--n-item-text-color-active":he,"--n-item-text-color-pressed":ue,"--n-item-color":ce,"--n-item-color-hover":Je,"--n-item-color-disabled":Be,"--n-item-color-active":_e,"--n-item-color-active-hover":Ce,"--n-item-color-pressed":ye,"--n-item-border":Se,"--n-item-border-hover":R,"--n-item-border-disabled":Ne,"--n-item-border-active":ht,"--n-item-border-pressed":we,"--n-item-padding":je,"--n-item-border-radius":ot,"--n-bezier":jt,"--n-jumper-font-size":pe,"--n-jumper-text-color":Rt,"--n-jumper-text-color-disabled":at,"--n-item-margin":it,"--n-item-margin-rtl":Dt,"--n-button-icon-size":Ye,"--n-button-icon-color":Le,"--n-button-icon-color-hover":xe,"--n-button-icon-color-pressed":Qe,"--n-button-color-hover":re,"--n-button-color":gt,"--n-button-color-pressed":me,"--n-button-border":ae,"--n-button-border-hover":Ie,"--n-button-border-pressed":de}}),Z=i?Bn("pagination",W(()=>{let J="";const{size:ae}=e;return J+=ae[0],J}),K,e):void 0;return{rtlEnabled:M,mergedClsPrefix:n,locale:d,selfRef:r,mergedPage:h,pageItems:W(()=>I.value.items),mergedItemCount:D,jumperValue:m,pageSizeOptions:S,mergedPageSize:u,inputSize:P,selectSize:A,mergedTheme:a,mergedPageCount:v,startIndex:L,endIndex:x,showFastForwardMenu:l,showFastBackwardMenu:f,fastForwardActive:b,fastBackwardActive:g,handleMenuSelect:E,handleFastForwardMouseenter:p,handleFastForwardMouseleave:y,handleFastBackwardMouseenter:C,handleFastBackwardMouseleave:k,handleJumperInput:Fe,handleBackwardClick:N,handleForwardClick:U,handlePageItemClick:oe,handleSizePickerChange:G,handleQuickJumperChange:se,cssVars:i?void 0:K,themeClass:Z==null?void 0:Z.themeClass,onRender:Z==null?void 0:Z.onRender}},render(){const{$slots:e,mergedClsPrefix:t,disabled:n,cssVars:i,mergedPage:s,mergedPageCount:a,pageItems:d,showSizePicker:r,showQuickJumper:o,mergedTheme:c,locale:h,inputSize:u,selectSize:v,mergedPageSize:m,pageSizeOptions:b,jumperValue:g,simple:l,prev:f,next:p,prefix:y,suffix:C,label:k,goto:E,handleJumperInput:I,handleSizePickerChange:S,handleBackwardClick:P,handlePageItemClick:A,handleForwardClick:L,handleQuickJumperChange:x,onRender:D}=this;D==null||D();const M=e.prefix||y,B=e.suffix||C,z=f||e.prev,Y=p||e.next,U=k||e.label;return H("div",{ref:"selfRef",class:[`${t}-pagination`,this.themeClass,this.rtlEnabled&&`${t}-pagination--rtl`,n&&`${t}-pagination--disabled`,l&&`${t}-pagination--simple`],style:i},M?H("div",{class:`${t}-pagination-prefix`},M({page:s,pageSize:m,pageCount:a,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount})):null,this.displayOrder.map(N=>{switch(N){case"pages":return H(Me,null,H("div",{class:[`${t}-pagination-item`,!z&&`${t}-pagination-item--button`,(s<=1||s>a||n)&&`${t}-pagination-item--disabled`],onClick:P},z?z({page:s,pageSize:m,pageCount:a,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount}):H(Un,{clsPrefix:t},{default:()=>this.rtlEnabled?H(mr,null):H(pr,null)})),l?H(Me,null,H("div",{class:`${t}-pagination-quick-jumper`},H(Oi,{value:g,onUpdateValue:I,size:u,placeholder:"",disabled:n,theme:c.peers.Input,themeOverrides:c.peerOverrides.Input,onChange:x}))," /"," ",a):d.map((V,j)=>{let G,te,se;const{type:oe}=V;switch(oe){case"page":const K=V.label;U?G=U({type:"page",node:K,active:V.active}):G=K;break;case"fast-forward":const Z=this.fastForwardActive?H(Un,{clsPrefix:t},{default:()=>this.rtlEnabled?H(vr,null):H(gr,null)}):H(Un,{clsPrefix:t},{default:()=>H(Lv,null)});U?G=U({type:"fast-forward",node:Z,active:this.fastForwardActive||this.showFastForwardMenu}):G=Z,te=this.handleFastForwardMouseenter,se=this.handleFastForwardMouseleave;break;case"fast-backward":const J=this.fastBackwardActive?H(Un,{clsPrefix:t},{default:()=>this.rtlEnabled?H(gr,null):H(vr,null)}):H(Un,{clsPrefix:t},{default:()=>H(Lv,null)});U?G=U({type:"fast-backward",node:J,active:this.fastBackwardActive||this.showFastBackwardMenu}):G=J,te=this.handleFastBackwardMouseenter,se=this.handleFastBackwardMouseleave;break}const Fe=H("div",{key:j,class:[`${t}-pagination-item`,V.active&&`${t}-pagination-item--active`,oe!=="page"&&(oe==="fast-backward"&&this.showFastBackwardMenu||oe==="fast-forward"&&this.showFastForwardMenu)&&`${t}-pagination-item--hover`,n&&`${t}-pagination-item--disabled`,oe==="page"&&`${t}-pagination-item--clickable`],onClick:()=>{A(V)},onMouseenter:te,onMouseleave:se},G);if(oe==="page"&&!V.mayBeFastBackward&&!V.mayBeFastForward)return Fe;{const K=V.type==="page"?V.mayBeFastBackward?"fast-backward":"fast-forward":V.type;return V.type!=="page"&&!V.options?Fe:H(cA,{to:this.to,key:K,disabled:n,trigger:"hover",virtualScroll:!0,style:{width:"60px"},theme:c.peers.Popselect,themeOverrides:c.peerOverrides.Popselect,builtinThemeOverrides:{peers:{InternalSelectMenu:{height:"calc(var(--n-option-height) * 4.6)"}}},nodeProps:()=>({style:{justifyContent:"center"}}),show:oe==="page"?!1:oe==="fast-backward"?this.showFastBackwardMenu:this.showFastForwardMenu,onUpdateShow:Z=>{oe!=="page"&&(Z?oe==="fast-backward"?this.showFastBackwardMenu=Z:this.showFastForwardMenu=Z:(this.showFastBackwardMenu=!1,this.showFastForwardMenu=!1))},options:V.type!=="page"&&V.options?V.options:[],onUpdateValue:this.handleMenuSelect,scrollable:!0,showCheckmark:!1},{default:()=>Fe})}}),H("div",{class:[`${t}-pagination-item`,!Y&&`${t}-pagination-item--button`,{[`${t}-pagination-item--disabled`]:s<1||s>=a||n}],onClick:L},Y?Y({page:s,pageSize:m,pageCount:a,itemCount:this.mergedItemCount,startIndex:this.startIndex,endIndex:this.endIndex}):H(Un,{clsPrefix:t},{default:()=>this.rtlEnabled?H(pr,null):H(mr,null)})));case"size-picker":return!l&&r?H(Oy,Object.assign({consistentMenuWidth:!1,placeholder:"",showCheckmark:!1,to:this.to},this.selectProps,{size:v,options:b,value:m,disabled:n,theme:c.peers.Select,themeOverrides:c.peerOverrides.Select,onUpdateValue:S})):null;case"quick-jumper":return!l&&o?H("div",{class:`${t}-pagination-quick-jumper`},E?E():Jt(this.$slots.goto,()=>[h.goto]),H(Oi,{value:g,onUpdateValue:I,size:u,placeholder:"",disabled:n,theme:c.peers.Input,themeOverrides:c.peerOverrides.Input,onChange:x})):null;default:return null}}),B?H("div",{class:`${t}-pagination-suffix`},B({page:s,pageSize:m,pageCount:a,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount})):null)}}),gA=Object.assign(Object.assign({},Ht.props),{onUnstableColumnResize:Function,pagination:{type:[Object,Boolean],default:!1},paginateSinglePage:{type:Boolean,default:!0},minHeight:[Number,String],maxHeight:[Number,String],columns:{type:Array,default:()=>[]},rowClassName:[String,Function],rowProps:Function,rowKey:Function,summary:[Function],data:{type:Array,default:()=>[]},loading:Boolean,bordered:{type:Boolean,default:void 0},bottomBordered:{type:Boolean,default:void 0},striped:Boolean,scrollX:[Number,String],defaultCheckedRowKeys:{type:Array,default:()=>[]},checkedRowKeys:Array,singleLine:{type:Boolean,default:!0},singleColumn:Boolean,size:{type:String,default:"medium"},remote:Boolean,defaultExpandedRowKeys:{type:Array,default:[]},defaultExpandAll:Boolean,expandedRowKeys:Array,stickyExpandedRows:Boolean,virtualScroll:Boolean,virtualScrollX:Boolean,virtualScrollHeader:Boolean,headerHeight:{type:Number,default:28},heightForRow:Function,minRowHeight:{type:Number,default:28},tableLayout:{type:String,default:"auto"},allowCheckingNotLoaded:Boolean,cascade:{type:Boolean,default:!0},childrenKey:{type:String,default:"children"},indent:{type:Number,default:16},flexHeight:Boolean,summaryPlacement:{type:String,default:"bottom"},paginationBehaviorOnFilter:{type:String,default:"current"},filterIconPopoverProps:Object,scrollbarProps:Object,renderCell:Function,renderExpandIcon:Function,spinProps:{type:Object,default:{}},getCsvCell:Function,getCsvHeader:Function,onLoad:Function,"onUpdate:page":[Function,Array],onUpdatePage:[Function,Array],"onUpdate:pageSize":[Function,Array],onUpdatePageSize:[Function,Array],"onUpdate:sorter":[Function,Array],onUpdateSorter:[Function,Array],"onUpdate:filters":[Function,Array],onUpdateFilters:[Function,Array],"onUpdate:checkedRowKeys":[Function,Array],onUpdateCheckedRowKeys:[Function,Array],"onUpdate:expandedRowKeys":[Function,Array],onUpdateExpandedRowKeys:[Function,Array],onScroll:Function,onPageChange:[Function,Array],onPageSizeChange:[Function,Array],onSorterChange:[Function,Array],onFiltersChange:[Function,Array],onCheckedRowKeysChange:[Function,Array]}),ls=ui("n-data-table"),By=40,Hy=40;function Wv(e){if(e.type==="selection")return e.width===void 0?By:vo(e.width);if(e.type==="expand")return e.width===void 0?Hy:vo(e.width);if(!("children"in e))return typeof e.width=="string"?vo(e.width):e.width}function mA(e){var t,n;if(e.type==="selection")return ci((t=e.width)!==null&&t!==void 0?t:By);if(e.type==="expand")return ci((n=e.width)!==null&&n!==void 0?n:Hy);if(!("children"in e))return ci(e.width)}function ns(e){return e.type==="selection"?"__n_selection__":e.type==="expand"?"__n_expand__":e.key}function jv(e){return e&&(typeof e=="object"?Object.assign({},e):e)}function _A(e){return e==="ascend"?1:e==="descend"?-1:0}function yA(e,t,n){return n!==void 0&&(e=Math.min(e,typeof n=="number"?n:Number.parseFloat(n))),t!==void 0&&(e=Math.max(e,typeof t=="number"?t:Number.parseFloat(t))),e}function bA(e,t){if(t!==void 0)return{width:t,minWidth:t,maxWidth:t};const n=mA(e),{minWidth:i,maxWidth:s}=e;return{width:n,minWidth:ci(i)||n,maxWidth:ci(s)}}function wA(e,t,n){return typeof n=="function"?n(e,t):n||""}function $d(e){return e.filterOptionValues!==void 0||e.filterOptionValue===void 0&&e.defaultFilterOptionValues!==void 0}function Od(e){return"children"in e?!1:!!e.sorter}function Ny(e){return"children"in e&&e.children.length?!1:!!e.resizable}function qv(e){return"children"in e?!1:!!e.filter&&(!!e.filterOptions||!!e.renderFilterMenu)}function Yv(e){if(e){if(e==="descend")return"ascend"}else return"descend";return!1}function SA(e,t){return e.sorter===void 0?null:t===null||t.columnKey!==e.key?{columnKey:e.key,sorter:e.sorter,order:Yv(!1)}:Object.assign(Object.assign({},t),{order:Yv(t.order)})}function Uy(e,t){return t.find(n=>n.columnKey===e.key&&n.order)!==void 0}function CA(e){return typeof e=="string"?e.replace(/,/g,"\\,"):e==null?"":`${e}`.replace(/,/g,"\\,")}function kA(e,t,n,i){const s=e.filter(r=>r.type!=="expand"&&r.type!=="selection"&&r.allowExport!==!1),a=s.map(r=>i?i(r):r.title).join(","),d=t.map(r=>s.map(o=>n?n(r[o.key],r,o):CA(r[o.key])).join(","));return[a,...d].join(` +`)}const xA=$e({name:"DataTableBodyCheckbox",props:{rowKey:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!0},onUpdateChecked:{type:Function,required:!0}},setup(e){const{mergedCheckedRowKeySetRef:t,mergedInderminateRowKeySetRef:n}=zt(ls);return()=>{const{rowKey:i}=e;return H(qh,{privateInsideTable:!0,disabled:e.disabled,indeterminate:n.value.has(i),checked:t.value.has(i),onUpdateChecked:e.onUpdateChecked})}}}),RA=Re("radio",` + line-height: var(--n-label-line-height); + outline: none; + position: relative; + user-select: none; + -webkit-user-select: none; + display: inline-flex; + align-items: flex-start; + flex-wrap: nowrap; + font-size: var(--n-font-size); + word-break: break-word; +`,[We("checked",[tt("dot",` + background-color: var(--n-color-active); + `)]),tt("dot-wrapper",` + position: relative; + flex-shrink: 0; + flex-grow: 0; + width: var(--n-radio-size); + `),Re("radio-input",` + position: absolute; + border: 0; + border-radius: inherit; + left: 0; + right: 0; + top: 0; + bottom: 0; + opacity: 0; + z-index: 1; + cursor: pointer; + `),tt("dot",` + position: absolute; + top: 50%; + left: 0; + transform: translateY(-50%); + height: var(--n-radio-size); + width: var(--n-radio-size); + background: var(--n-color); + box-shadow: var(--n-box-shadow); + border-radius: 50%; + transition: + background-color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier); + `,[Ke("&::before",` + content: ""; + opacity: 0; + position: absolute; + left: 4px; + top: 4px; + height: calc(100% - 8px); + width: calc(100% - 8px); + border-radius: 50%; + transform: scale(.8); + background: var(--n-dot-color-active); + transition: + opacity .3s var(--n-bezier), + background-color .3s var(--n-bezier), + transform .3s var(--n-bezier); + `),We("checked",{boxShadow:"var(--n-box-shadow-active)"},[Ke("&::before",` + opacity: 1; + transform: scale(1); + `)])]),tt("label",` + color: var(--n-text-color); + padding: var(--n-label-padding); + font-weight: var(--n-label-font-weight); + display: inline-block; + transition: color .3s var(--n-bezier); + `),xn("disabled",` + cursor: pointer; + `,[Ke("&:hover",[tt("dot",{boxShadow:"var(--n-box-shadow-hover)"})]),We("focus",[Ke("&:not(:active)",[tt("dot",{boxShadow:"var(--n-box-shadow-focus)"})])])]),We("disabled",` + cursor: not-allowed; + `,[tt("dot",{boxShadow:"var(--n-box-shadow-disabled)",backgroundColor:"var(--n-color-disabled)"},[Ke("&::before",{backgroundColor:"var(--n-dot-color-disabled)"}),We("checked",` + opacity: 1; + `)]),tt("label",{color:"var(--n-text-color-disabled)"}),Re("radio-input",` + cursor: not-allowed; + `)])]),TA={name:String,value:{type:[String,Number,Boolean],default:"on"},checked:{type:Boolean,default:void 0},defaultChecked:Boolean,disabled:{type:Boolean,default:void 0},label:String,size:String,onUpdateChecked:[Function,Array],"onUpdate:checked":[Function,Array],checkedValue:{type:Boolean,default:void 0}},zy=ui("n-radio-group");function EA(e){const t=zt(zy,null),n=_r(e,{mergedSize(p){const{size:y}=e;if(y!==void 0)return y;if(t){const{mergedSizeRef:{value:C}}=t;if(C!==void 0)return C}return p?p.mergedSize.value:"medium"},mergedDisabled(p){return!!(e.disabled||t!=null&&t.disabledRef.value||p!=null&&p.disabled.value)}}),{mergedSizeRef:i,mergedDisabledRef:s}=n,a=F(null),d=F(null),r=F(e.defaultChecked),o=ut(e,"checked"),c=Qn(o,r),h=en(()=>t?t.valueRef.value===e.value:c.value),u=en(()=>{const{name:p}=e;if(p!==void 0)return p;if(t)return t.nameRef.value}),v=F(!1);function m(){if(t){const{doUpdateValue:p}=t,{value:y}=e;rt(p,y)}else{const{onUpdateChecked:p,"onUpdate:checked":y}=e,{nTriggerFormInput:C,nTriggerFormChange:k}=n;p&&rt(p,!0),y&&rt(y,!0),C(),k(),r.value=!0}}function b(){s.value||h.value||m()}function g(){b(),a.value&&(a.value.checked=h.value)}function l(){v.value=!1}function f(){v.value=!0}return{mergedClsPrefix:t?t.mergedClsPrefixRef:bn(e).mergedClsPrefixRef,inputRef:a,labelRef:d,mergedName:u,mergedDisabled:s,renderSafeChecked:h,focus:v,mergedSize:i,handleRadioInputChange:g,handleRadioInputBlur:l,handleRadioInputFocus:f}}const PA=Object.assign(Object.assign({},Ht.props),TA),Vy=$e({name:"Radio",props:PA,setup(e){const t=EA(e),n=Ht("Radio","-radio",RA,em,e,t.mergedClsPrefix),i=W(()=>{const{mergedSize:{value:c}}=t,{common:{cubicBezierEaseInOut:h},self:{boxShadow:u,boxShadowActive:v,boxShadowDisabled:m,boxShadowFocus:b,boxShadowHover:g,color:l,colorDisabled:f,colorActive:p,textColor:y,textColorDisabled:C,dotColorActive:k,dotColorDisabled:E,labelPadding:I,labelLineHeight:S,labelFontWeight:P,[Mt("fontSize",c)]:A,[Mt("radioSize",c)]:L}}=n.value;return{"--n-bezier":h,"--n-label-line-height":S,"--n-label-font-weight":P,"--n-box-shadow":u,"--n-box-shadow-active":v,"--n-box-shadow-disabled":m,"--n-box-shadow-focus":b,"--n-box-shadow-hover":g,"--n-color":l,"--n-color-active":p,"--n-color-disabled":f,"--n-dot-color-active":k,"--n-dot-color-disabled":E,"--n-font-size":A,"--n-radio-size":L,"--n-text-color":y,"--n-text-color-disabled":C,"--n-label-padding":I}}),{inlineThemeDisabled:s,mergedClsPrefixRef:a,mergedRtlRef:d}=bn(e),r=Rs("Radio",d,a),o=s?Bn("radio",W(()=>t.mergedSize.value[0]),i,e):void 0;return Object.assign(t,{rtlEnabled:r,cssVars:s?void 0:i,themeClass:o==null?void 0:o.themeClass,onRender:o==null?void 0:o.onRender})},render(){const{$slots:e,mergedClsPrefix:t,onRender:n,label:i}=this;return n==null||n(),H("label",{class:[`${t}-radio`,this.themeClass,this.rtlEnabled&&`${t}-radio--rtl`,this.mergedDisabled&&`${t}-radio--disabled`,this.renderSafeChecked&&`${t}-radio--checked`,this.focus&&`${t}-radio--focus`],style:this.cssVars},H("input",{ref:"inputRef",type:"radio",class:`${t}-radio-input`,value:this.value,name:this.mergedName,checked:this.renderSafeChecked,disabled:this.mergedDisabled,onChange:this.handleRadioInputChange,onFocus:this.handleRadioInputFocus,onBlur:this.handleRadioInputBlur}),H("div",{class:`${t}-radio__dot-wrapper`}," ",H("div",{class:[`${t}-radio__dot`,this.renderSafeChecked&&`${t}-radio__dot--checked`]})),qi(e.default,s=>!s&&!i?null:H("div",{ref:"labelRef",class:`${t}-radio__label`},s||i)))}}),LA=Re("radio-group",` + display: inline-block; + font-size: var(--n-font-size); +`,[tt("splitor",` + display: inline-block; + vertical-align: bottom; + width: 1px; + transition: + background-color .3s var(--n-bezier), + opacity .3s var(--n-bezier); + background: var(--n-button-border-color); + `,[We("checked",{backgroundColor:"var(--n-button-border-color-active)"}),We("disabled",{opacity:"var(--n-opacity-disabled)"})]),We("button-group",` + white-space: nowrap; + height: var(--n-height); + line-height: var(--n-height); + `,[Re("radio-button",{height:"var(--n-height)",lineHeight:"var(--n-height)"}),tt("splitor",{height:"var(--n-height)"})]),Re("radio-button",` + vertical-align: bottom; + outline: none; + position: relative; + user-select: none; + -webkit-user-select: none; + display: inline-block; + box-sizing: border-box; + padding-left: 14px; + padding-right: 14px; + white-space: nowrap; + transition: + background-color .3s var(--n-bezier), + opacity .3s var(--n-bezier), + border-color .3s var(--n-bezier), + color .3s var(--n-bezier); + background: var(--n-button-color); + color: var(--n-button-text-color); + border-top: 1px solid var(--n-button-border-color); + border-bottom: 1px solid var(--n-button-border-color); + `,[Re("radio-input",` + pointer-events: none; + position: absolute; + border: 0; + border-radius: inherit; + left: 0; + right: 0; + top: 0; + bottom: 0; + opacity: 0; + z-index: 1; + `),tt("state-border",` + z-index: 1; + pointer-events: none; + position: absolute; + box-shadow: var(--n-button-box-shadow); + transition: box-shadow .3s var(--n-bezier); + left: -1px; + bottom: -1px; + right: -1px; + top: -1px; + `),Ke("&:first-child",` + border-top-left-radius: var(--n-button-border-radius); + border-bottom-left-radius: var(--n-button-border-radius); + border-left: 1px solid var(--n-button-border-color); + `,[tt("state-border",` + border-top-left-radius: var(--n-button-border-radius); + border-bottom-left-radius: var(--n-button-border-radius); + `)]),Ke("&:last-child",` + border-top-right-radius: var(--n-button-border-radius); + border-bottom-right-radius: var(--n-button-border-radius); + border-right: 1px solid var(--n-button-border-color); + `,[tt("state-border",` + border-top-right-radius: var(--n-button-border-radius); + border-bottom-right-radius: var(--n-button-border-radius); + `)]),xn("disabled",` + cursor: pointer; + `,[Ke("&:hover",[tt("state-border",` + transition: box-shadow .3s var(--n-bezier); + box-shadow: var(--n-button-box-shadow-hover); + `),xn("checked",{color:"var(--n-button-text-color-hover)"})]),We("focus",[Ke("&:not(:active)",[tt("state-border",{boxShadow:"var(--n-button-box-shadow-focus)"})])])]),We("checked",` + background: var(--n-button-color-active); + color: var(--n-button-text-color-active); + border-color: var(--n-button-border-color-active); + `),We("disabled",` + cursor: not-allowed; + opacity: var(--n-opacity-disabled); + `)])]);function DA(e,t,n){var i;const s=[];let a=!1;for(let d=0;d{const{value:k}=n,{common:{cubicBezierEaseInOut:E},self:{buttonBorderColor:I,buttonBorderColorActive:S,buttonBorderRadius:P,buttonBoxShadow:A,buttonBoxShadowFocus:L,buttonBoxShadowHover:x,buttonColor:D,buttonColorActive:M,buttonTextColor:B,buttonTextColorActive:z,buttonTextColorHover:Y,opacityDisabled:U,[Mt("buttonHeight",k)]:N,[Mt("fontSize",k)]:V}}=u.value;return{"--n-font-size":V,"--n-bezier":E,"--n-button-border-color":I,"--n-button-border-color-active":S,"--n-button-border-radius":P,"--n-button-box-shadow":A,"--n-button-box-shadow-focus":L,"--n-button-box-shadow-hover":x,"--n-button-color":D,"--n-button-color-active":M,"--n-button-text-color":B,"--n-button-text-color-hover":Y,"--n-button-text-color-active":z,"--n-height":N,"--n-opacity-disabled":U}}),C=c?Bn("radio-group",W(()=>n.value[0]),y,e):void 0;return{selfElRef:t,rtlEnabled:p,mergedClsPrefix:o,mergedValue:b,handleFocusout:f,handleFocusin:l,cssVars:c?void 0:y,themeClass:C==null?void 0:C.themeClass,onRender:C==null?void 0:C.onRender}},render(){var e;const{mergedValue:t,mergedClsPrefix:n,handleFocusin:i,handleFocusout:s}=this,{children:a,isButtonGroup:d}=DA(cm(Rw(this)),t,n);return(e=this.onRender)===null||e===void 0||e.call(this),H("div",{onFocusin:i,onFocusout:s,ref:"selfElRef",class:[`${n}-radio-group`,this.rtlEnabled&&`${n}-radio-group--rtl`,this.themeClass,d&&`${n}-radio-group--button-group`],style:this.cssVars},a)}}),AA=$e({name:"DataTableBodyRadio",props:{rowKey:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!0},onUpdateChecked:{type:Function,required:!0}},setup(e){const{mergedCheckedRowKeySetRef:t,componentId:n}=zt(ls);return()=>{const{rowKey:i}=e;return H(Vy,{name:n,disabled:e.disabled,checked:t.value.has(i),onUpdateChecked:e.onUpdateChecked})}}}),$A=Object.assign(Object.assign({},Wr),Ht.props),OA=$e({name:"Tooltip",props:$A,__popover__:!0,setup(e){const{mergedClsPrefixRef:t}=bn(e),n=Ht("Tooltip","-tooltip",void 0,q0,e,t),i=F(null);return Object.assign(Object.assign({},{syncPosition(){i.value.syncPosition()},setShow(a){i.value.setShow(a)}}),{popoverRef:i,mergedTheme:n,popoverThemeOverrides:W(()=>n.value.self)})},render(){const{mergedTheme:e,internalExtraClass:t}=this;return H(Ko,Object.assign(Object.assign({},this.$props),{theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:this.popoverThemeOverrides,internalExtraClass:t.concat("tooltip"),ref:"popoverRef"}),this.$slots)}}),Ky=Re("ellipsis",{overflow:"hidden"},[xn("line-clamp",` + white-space: nowrap; + display: inline-block; + vertical-align: bottom; + max-width: 100%; + `),We("line-clamp",` + display: -webkit-inline-box; + -webkit-box-orient: vertical; + `),We("cursor-pointer",` + cursor: pointer; + `)]);function zu(e){return`${e}-ellipsis--line-clamp`}function Vu(e,t){return`${e}-ellipsis--cursor-${t}`}const Wy=Object.assign(Object.assign({},Ht.props),{expandTrigger:String,lineClamp:[Number,String],tooltip:{type:[Boolean,Object],default:!0}}),Gh=$e({name:"Ellipsis",inheritAttrs:!1,props:Wy,setup(e,{slots:t,attrs:n}){const i=tm(),s=Ht("Ellipsis","-ellipsis",Ky,Y0,e,i),a=F(null),d=F(null),r=F(null),o=F(!1),c=W(()=>{const{lineClamp:l}=e,{value:f}=o;return l!==void 0?{textOverflow:"","-webkit-line-clamp":f?"":l}:{textOverflow:f?"":"ellipsis","-webkit-line-clamp":""}});function h(){let l=!1;const{value:f}=o;if(f)return!0;const{value:p}=a;if(p){const{lineClamp:y}=e;if(m(p),y!==void 0)l=p.scrollHeight<=p.offsetHeight;else{const{value:C}=d;C&&(l=C.getBoundingClientRect().width<=p.getBoundingClientRect().width)}b(p,l)}return l}const u=W(()=>e.expandTrigger==="click"?()=>{var l;const{value:f}=o;f&&((l=r.value)===null||l===void 0||l.setShow(!1)),o.value=!f}:void 0);zg(()=>{var l;e.tooltip&&((l=r.value)===null||l===void 0||l.setShow(!1))});const v=()=>H("span",Object.assign({},fr(n,{class:[`${i.value}-ellipsis`,e.lineClamp!==void 0?zu(i.value):void 0,e.expandTrigger==="click"?Vu(i.value,"pointer"):void 0],style:c.value}),{ref:"triggerRef",onClick:u.value,onMouseenter:e.expandTrigger==="click"?h:void 0}),e.lineClamp?t:H("span",{ref:"triggerInnerRef"},t));function m(l){if(!l)return;const f=c.value,p=zu(i.value);e.lineClamp!==void 0?g(l,p,"add"):g(l,p,"remove");for(const y in f)l.style[y]!==f[y]&&(l.style[y]=f[y])}function b(l,f){const p=Vu(i.value,"pointer");e.expandTrigger==="click"&&!f?g(l,p,"add"):g(l,p,"remove")}function g(l,f,p){p==="add"?l.classList.contains(f)||l.classList.add(f):l.classList.contains(f)&&l.classList.remove(f)}return{mergedTheme:s,triggerRef:a,triggerInnerRef:d,tooltipRef:r,handleClick:u,renderTrigger:v,getTooltipDisabled:h}},render(){var e;const{tooltip:t,renderTrigger:n,$slots:i}=this;if(t){const{mergedTheme:s}=this;return H(OA,Object.assign({ref:"tooltipRef",placement:"top"},t,{getDisabled:this.getTooltipDisabled,theme:s.peers.Tooltip,themeOverrides:s.peerOverrides.Tooltip}),{trigger:n,default:(e=i.tooltip)!==null&&e!==void 0?e:i.default})}else return n()}}),FA=$e({name:"PerformantEllipsis",props:Wy,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){const i=F(!1),s=tm();return G0("-ellipsis",Ky,s),{mouseEntered:i,renderTrigger:()=>{const{lineClamp:d}=e,r=s.value;return H("span",Object.assign({},fr(t,{class:[`${r}-ellipsis`,d!==void 0?zu(r):void 0,e.expandTrigger==="click"?Vu(r,"pointer"):void 0],style:d===void 0?{textOverflow:"ellipsis"}:{"-webkit-line-clamp":d}}),{onMouseenter:()=>{i.value=!0}}),d?n:H("span",null,n))}}},render(){return this.mouseEntered?H(Gh,fr({},this.$attrs,this.$props),this.$slots):this.renderTrigger()}}),BA=$e({name:"DataTableCell",props:{clsPrefix:{type:String,required:!0},row:{type:Object,required:!0},index:{type:Number,required:!0},column:{type:Object,required:!0},isSummary:Boolean,mergedTheme:{type:Object,required:!0},renderCell:Function},render(){var e;const{isSummary:t,column:n,row:i,renderCell:s}=this;let a;const{render:d,key:r,ellipsis:o}=n;if(d&&!t?a=d(i,this.index):t?a=(e=i[r])===null||e===void 0?void 0:e.value:a=s?s(ru(i,r),i,n):ru(i,r),o)if(typeof o=="object"){const{mergedTheme:c}=this;return n.ellipsisComponent==="performant-ellipsis"?H(FA,Object.assign({},o,{theme:c.peers.Ellipsis,themeOverrides:c.peerOverrides.Ellipsis}),{default:()=>a}):H(Gh,Object.assign({},o,{theme:c.peers.Ellipsis,themeOverrides:c.peerOverrides.Ellipsis}),{default:()=>a})}else return H("span",{class:`${this.clsPrefix}-data-table-td__ellipsis`},a);return a}}),Gv=$e({name:"DataTableExpandTrigger",props:{clsPrefix:{type:String,required:!0},expanded:Boolean,loading:Boolean,onClick:{type:Function,required:!0},renderExpandIcon:{type:Function},rowData:{type:Object,required:!0}},render(){const{clsPrefix:e}=this;return H("div",{class:[`${e}-data-table-expand-trigger`,this.expanded&&`${e}-data-table-expand-trigger--expanded`],onClick:this.onClick,onMousedown:t=>{t.preventDefault()}},H(Jg,null,{default:()=>this.loading?H(kc,{key:"loading",clsPrefix:this.clsPrefix,radius:85,strokeWidth:15,scale:.88}):this.renderExpandIcon?this.renderExpandIcon({expanded:this.expanded,rowData:this.rowData}):H(Un,{clsPrefix:e,key:"base-icon"},{default:()=>H(ly,null)})}))}}),HA=$e({name:"DataTableFilterMenu",props:{column:{type:Object,required:!0},radioGroupName:{type:String,required:!0},multiple:{type:Boolean,required:!0},value:{type:[Array,String,Number],default:null},options:{type:Array,required:!0},onConfirm:{type:Function,required:!0},onClear:{type:Function,required:!0},onChange:{type:Function,required:!0}},setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=bn(e),i=Rs("DataTable",n,t),{mergedClsPrefixRef:s,mergedThemeRef:a,localeRef:d}=zt(ls),r=F(e.value),o=W(()=>{const{value:b}=r;return Array.isArray(b)?b:null}),c=W(()=>{const{value:b}=r;return $d(e.column)?Array.isArray(b)&&b.length&&b[0]||null:Array.isArray(b)?null:b});function h(b){e.onChange(b)}function u(b){e.multiple&&Array.isArray(b)?r.value=b:$d(e.column)&&!Array.isArray(b)?r.value=[b]:r.value=b}function v(){h(r.value),e.onConfirm()}function m(){e.multiple||$d(e.column)?h([]):h(null),e.onClear()}return{mergedClsPrefix:s,rtlEnabled:i,mergedTheme:a,locale:d,checkboxGroupValue:o,radioGroupValue:c,handleChange:u,handleConfirmClick:v,handleClearClick:m}},render(){const{mergedTheme:e,locale:t,mergedClsPrefix:n}=this;return H("div",{class:[`${n}-data-table-filter-menu`,this.rtlEnabled&&`${n}-data-table-filter-menu--rtl`]},H($i,null,{default:()=>{const{checkboxGroupValue:i,handleChange:s}=this;return this.multiple?H(tA,{value:i,class:`${n}-data-table-filter-menu__group`,onUpdateValue:s},{default:()=>this.options.map(a=>H(qh,{key:a.value,theme:e.peers.Checkbox,themeOverrides:e.peerOverrides.Checkbox,value:a.value},{default:()=>a.label}))}):H(MA,{name:this.radioGroupName,class:`${n}-data-table-filter-menu__group`,value:this.radioGroupValue,onUpdateValue:this.handleChange},{default:()=>this.options.map(a=>H(Vy,{key:a.value,value:a.value,theme:e.peers.Radio,themeOverrides:e.peerOverrides.Radio},{default:()=>a.label}))})}}),H("div",{class:`${n}-data-table-filter-menu__action`},H(yn,{size:"tiny",theme:e.peers.Button,themeOverrides:e.peerOverrides.Button,onClick:this.handleClearClick},{default:()=>t.clear}),H(yn,{theme:e.peers.Button,themeOverrides:e.peerOverrides.Button,type:"primary",size:"tiny",onClick:this.handleConfirmClick},{default:()=>t.confirm})))}}),NA=$e({name:"DataTableRenderFilter",props:{render:{type:Function,required:!0},active:{type:Boolean,default:!1},show:{type:Boolean,default:!1}},render(){const{render:e,active:t,show:n}=this;return e({active:t,show:n})}});function UA(e,t,n){const i=Object.assign({},e);return i[t]=n,i}const zA=$e({name:"DataTableFilterButton",props:{column:{type:Object,required:!0},options:{type:Array,default:()=>[]}},setup(e){const{mergedComponentPropsRef:t}=bn(),{mergedThemeRef:n,mergedClsPrefixRef:i,mergedFilterStateRef:s,filterMenuCssVarsRef:a,paginationBehaviorOnFilterRef:d,doUpdatePage:r,doUpdateFilters:o,filterIconPopoverPropsRef:c}=zt(ls),h=F(!1),u=s,v=W(()=>e.column.filterMultiple!==!1),m=W(()=>{const y=u.value[e.column.key];if(y===void 0){const{value:C}=v;return C?[]:null}return y}),b=W(()=>{const{value:y}=m;return Array.isArray(y)?y.length>0:y!==null}),g=W(()=>{var y,C;return((C=(y=t==null?void 0:t.value)===null||y===void 0?void 0:y.DataTable)===null||C===void 0?void 0:C.renderFilter)||e.column.renderFilter});function l(y){const C=UA(u.value,e.column.key,y);o(C,e.column),d.value==="first"&&r(1)}function f(){h.value=!1}function p(){h.value=!1}return{mergedTheme:n,mergedClsPrefix:i,active:b,showPopover:h,mergedRenderFilter:g,filterIconPopoverProps:c,filterMultiple:v,mergedFilterValue:m,filterMenuCssVars:a,handleFilterChange:l,handleFilterMenuConfirm:p,handleFilterMenuCancel:f}},render(){const{mergedTheme:e,mergedClsPrefix:t,handleFilterMenuCancel:n,filterIconPopoverProps:i}=this;return H(Ko,Object.assign({show:this.showPopover,onUpdateShow:s=>this.showPopover=s,trigger:"click",theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,placement:"bottom"},i,{style:{padding:0}}),{trigger:()=>{const{mergedRenderFilter:s}=this;if(s)return H(NA,{"data-data-table-filter":!0,render:s,active:this.active,show:this.showPopover});const{renderFilterIcon:a}=this.column;return H("div",{"data-data-table-filter":!0,class:[`${t}-data-table-filter`,{[`${t}-data-table-filter--active`]:this.active,[`${t}-data-table-filter--show`]:this.showPopover}]},a?a({active:this.active,show:this.showPopover}):H(Un,{clsPrefix:t},{default:()=>H(ED,null)}))},default:()=>{const{renderFilterMenu:s}=this.column;return s?s({hide:n}):H(HA,{style:this.filterMenuCssVars,radioGroupName:String(this.column.key),multiple:this.filterMultiple,value:this.mergedFilterValue,options:this.options,column:this.column,onChange:this.handleFilterChange,onClear:this.handleFilterMenuCancel,onConfirm:this.handleFilterMenuConfirm})}})}}),VA=$e({name:"ColumnResizeButton",props:{onResizeStart:Function,onResize:Function,onResizeEnd:Function},setup(e){const{mergedClsPrefixRef:t}=zt(ls),n=F(!1);let i=0;function s(o){return o.clientX}function a(o){var c;o.preventDefault();const h=n.value;i=s(o),n.value=!0,h||(zn("mousemove",window,d),zn("mouseup",window,r),(c=e.onResizeStart)===null||c===void 0||c.call(e))}function d(o){var c;(c=e.onResize)===null||c===void 0||c.call(e,s(o)-i)}function r(){var o;n.value=!1,(o=e.onResizeEnd)===null||o===void 0||o.call(e),Fn("mousemove",window,d),Fn("mouseup",window,r)}return Vt(()=>{Fn("mousemove",window,d),Fn("mouseup",window,r)}),{mergedClsPrefix:t,active:n,handleMousedown:a}},render(){const{mergedClsPrefix:e}=this;return H("span",{"data-data-table-resizable":!0,class:[`${e}-data-table-resize-button`,this.active&&`${e}-data-table-resize-button--active`],onMousedown:this.handleMousedown})}}),KA=$e({name:"DataTableRenderSorter",props:{render:{type:Function,required:!0},order:{type:[String,Boolean],default:!1}},render(){const{render:e,order:t}=this;return e({order:t})}}),WA=$e({name:"SortIcon",props:{column:{type:Object,required:!0}},setup(e){const{mergedComponentPropsRef:t}=bn(),{mergedSortStateRef:n,mergedClsPrefixRef:i}=zt(ls),s=W(()=>n.value.find(o=>o.columnKey===e.column.key)),a=W(()=>s.value!==void 0),d=W(()=>{const{value:o}=s;return o&&a.value?o.order:!1}),r=W(()=>{var o,c;return((c=(o=t==null?void 0:t.value)===null||o===void 0?void 0:o.DataTable)===null||c===void 0?void 0:c.renderSorter)||e.column.renderSorter});return{mergedClsPrefix:i,active:a,mergedSortOrder:d,mergedRenderSorter:r}},render(){const{mergedRenderSorter:e,mergedSortOrder:t,mergedClsPrefix:n}=this,{renderSorterIcon:i}=this.column;return e?H(KA,{render:e,order:t}):H("span",{class:[`${n}-data-table-sorter`,t==="ascend"&&`${n}-data-table-sorter--asc`,t==="descend"&&`${n}-data-table-sorter--desc`]},i?i({order:t}):H(Un,{clsPrefix:n},{default:()=>H(xD,null)}))}}),Xh=ui("n-dropdown-menu"),Bc=ui("n-dropdown"),Xv=ui("n-dropdown-option"),jy=$e({name:"DropdownDivider",props:{clsPrefix:{type:String,required:!0}},render(){return H("div",{class:`${this.clsPrefix}-dropdown-divider`})}}),jA=$e({name:"DropdownGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{showIconRef:e,hasSubmenuRef:t}=zt(Xh),{renderLabelRef:n,labelFieldRef:i,nodePropsRef:s,renderOptionRef:a}=zt(Bc);return{labelField:i,showIcon:e,hasSubmenu:t,renderLabel:n,nodeProps:s,renderOption:a}},render(){var e;const{clsPrefix:t,hasSubmenu:n,showIcon:i,nodeProps:s,renderLabel:a,renderOption:d}=this,{rawNode:r}=this.tmNode,o=H("div",Object.assign({class:`${t}-dropdown-option`},s==null?void 0:s(r)),H("div",{class:`${t}-dropdown-option-body ${t}-dropdown-option-body--group`},H("div",{"data-dropdown-option":!0,class:[`${t}-dropdown-option-body__prefix`,i&&`${t}-dropdown-option-body__prefix--show-icon`]},Cs(r.icon)),H("div",{class:`${t}-dropdown-option-body__label`,"data-dropdown-option":!0},a?a(r):Cs((e=r.title)!==null&&e!==void 0?e:r[this.labelField])),H("div",{class:[`${t}-dropdown-option-body__suffix`,n&&`${t}-dropdown-option-body__suffix--has-submenu`],"data-dropdown-option":!0})));return d?d({node:o,option:r}):o}}),qA=Re("icon",` + height: 1em; + width: 1em; + line-height: 1em; + text-align: center; + display: inline-block; + position: relative; + fill: currentColor; + transform: translateZ(0); +`,[We("color-transition",{transition:"color .3s var(--n-bezier)"}),We("depth",{color:"var(--n-color)"},[Ke("svg",{opacity:"var(--n-opacity)",transition:"opacity .3s var(--n-bezier)"})]),Ke("svg",{height:"1em",width:"1em"})]),YA=Object.assign(Object.assign({},Ht.props),{depth:[String,Number],size:[Number,String],color:String,component:[Object,Function]}),GA=$e({_n_icon__:!0,name:"Icon",inheritAttrs:!1,props:YA,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n}=bn(e),i=Ht("Icon","-icon",qA,X0,e,t),s=W(()=>{const{depth:d}=e,{common:{cubicBezierEaseInOut:r},self:o}=i.value;if(d!==void 0){const{color:c,[`opacity${d}Depth`]:h}=o;return{"--n-bezier":r,"--n-color":c,"--n-opacity":h}}return{"--n-bezier":r,"--n-color":"","--n-opacity":""}}),a=n?Bn("icon",W(()=>`${e.depth||"d"}`),s,e):void 0;return{mergedClsPrefix:t,mergedStyle:W(()=>{const{size:d,color:r}=e;return{fontSize:ci(d),color:r}}),cssVars:n?void 0:s,themeClass:a==null?void 0:a.themeClass,onRender:a==null?void 0:a.onRender}},render(){var e;const{$parent:t,depth:n,mergedClsPrefix:i,component:s,onRender:a,themeClass:d}=this;return!((e=t==null?void 0:t.$options)===null||e===void 0)&&e._n_icon__&&Ur("icon","don't wrap `n-icon` inside `n-icon`"),a==null||a(),H("i",fr(this.$attrs,{role:"img",class:[`${i}-icon`,d,{[`${i}-icon--depth`]:n,[`${i}-icon--color-transition`]:n!==void 0}],style:[this.cssVars,this.mergedStyle]}),s?H(s):this.$slots)}});function Ku(e,t){return e.type==="submenu"||e.type===void 0&&e[t]!==void 0}function XA(e){return e.type==="group"}function qy(e){return e.type==="divider"}function JA(e){return e.type==="render"}const Yy=$e({name:"DropdownOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null},placement:{type:String,default:"right-start"},props:Object,scrollable:Boolean},setup(e){const t=zt(Bc),{hoverKeyRef:n,keyboardKeyRef:i,lastToggledSubmenuKeyRef:s,pendingKeyPathRef:a,activeKeyPathRef:d,animatedRef:r,mergedShowRef:o,renderLabelRef:c,renderIconRef:h,labelFieldRef:u,childrenFieldRef:v,renderOptionRef:m,nodePropsRef:b,menuPropsRef:g}=t,l=zt(Xv,null),f=zt(Xh),p=zt($c),y=W(()=>e.tmNode.rawNode),C=W(()=>{const{value:Y}=v;return Ku(e.tmNode.rawNode,Y)}),k=W(()=>{const{disabled:Y}=e.tmNode;return Y}),E=W(()=>{if(!C.value)return!1;const{key:Y,disabled:U}=e.tmNode;if(U)return!1;const{value:N}=n,{value:V}=i,{value:j}=s,{value:G}=a;return N!==null?G.includes(Y):V!==null?G.includes(Y)&&G[G.length-1]!==Y:j!==null?G.includes(Y):!1}),I=W(()=>i.value===null&&!r.value),S=zP(E,300,I),P=W(()=>!!(l!=null&&l.enteringSubmenuRef.value)),A=F(!1);Rn(Xv,{enteringSubmenuRef:A});function L(){A.value=!0}function x(){A.value=!1}function D(){const{parentKey:Y,tmNode:U}=e;U.disabled||o.value&&(s.value=Y,i.value=null,n.value=U.key)}function M(){const{tmNode:Y}=e;Y.disabled||o.value&&n.value!==Y.key&&D()}function B(Y){if(e.tmNode.disabled||!o.value)return;const{relatedTarget:U}=Y;U&&!Ti({target:U},"dropdownOption")&&!Ti({target:U},"scrollbarRail")&&(n.value=null)}function z(){const{value:Y}=C,{tmNode:U}=e;o.value&&!Y&&!U.disabled&&(t.doSelect(U.key,U.rawNode),t.doUpdateShow(!1))}return{labelField:u,renderLabel:c,renderIcon:h,siblingHasIcon:f.showIconRef,siblingHasSubmenu:f.hasSubmenuRef,menuProps:g,popoverBody:p,animated:r,mergedShowSubmenu:W(()=>S.value&&!P.value),rawNode:y,hasSubmenu:C,pending:en(()=>{const{value:Y}=a,{key:U}=e.tmNode;return Y.includes(U)}),childActive:en(()=>{const{value:Y}=d,{key:U}=e.tmNode,N=Y.findIndex(V=>U===V);return N===-1?!1:N{const{value:Y}=d,{key:U}=e.tmNode,N=Y.findIndex(V=>U===V);return N===-1?!1:N===Y.length-1}),mergedDisabled:k,renderOption:m,nodeProps:b,handleClick:z,handleMouseMove:M,handleMouseEnter:D,handleMouseLeave:B,handleSubmenuBeforeEnter:L,handleSubmenuAfterEnter:x}},render(){var e,t;const{animated:n,rawNode:i,mergedShowSubmenu:s,clsPrefix:a,siblingHasIcon:d,siblingHasSubmenu:r,renderLabel:o,renderIcon:c,renderOption:h,nodeProps:u,props:v,scrollable:m}=this;let b=null;if(s){const p=(e=this.menuProps)===null||e===void 0?void 0:e.call(this,i,i.children);b=H(Gy,Object.assign({},p,{clsPrefix:a,scrollable:this.scrollable,tmNodes:this.tmNode.children,parentKey:this.tmNode.key}))}const g={class:[`${a}-dropdown-option-body`,this.pending&&`${a}-dropdown-option-body--pending`,this.active&&`${a}-dropdown-option-body--active`,this.childActive&&`${a}-dropdown-option-body--child-active`,this.mergedDisabled&&`${a}-dropdown-option-body--disabled`],onMousemove:this.handleMouseMove,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onClick:this.handleClick},l=u==null?void 0:u(i),f=H("div",Object.assign({class:[`${a}-dropdown-option`,l==null?void 0:l.class],"data-dropdown-option":!0},l),H("div",fr(g,v),[H("div",{class:[`${a}-dropdown-option-body__prefix`,d&&`${a}-dropdown-option-body__prefix--show-icon`]},[c?c(i):Cs(i.icon)]),H("div",{"data-dropdown-option":!0,class:`${a}-dropdown-option-body__label`},o?o(i):Cs((t=i[this.labelField])!==null&&t!==void 0?t:i.title)),H("div",{"data-dropdown-option":!0,class:[`${a}-dropdown-option-body__suffix`,r&&`${a}-dropdown-option-body__suffix--has-submenu`]},this.hasSubmenu?H(GA,null,{default:()=>H(ly,null)}):null)]),this.hasSubmenu?H(No,null,{default:()=>[H(Uo,null,{default:()=>H("div",{class:`${a}-dropdown-offset-container`},H(zo,{show:this.mergedShowSubmenu,placement:this.placement,to:m&&this.popoverBody||void 0,teleportDisabled:!m},{default:()=>H("div",{class:`${a}-dropdown-menu-wrapper`},n?H(xi,{onBeforeEnter:this.handleSubmenuBeforeEnter,onAfterEnter:this.handleSubmenuAfterEnter,name:"fade-in-scale-up-transition",appear:!0},{default:()=>b}):b)}))})]}):null);return h?h({node:f,option:i}):f}}),ZA=$e({name:"NDropdownGroup",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null}},render(){const{tmNode:e,parentKey:t,clsPrefix:n}=this,{children:i}=e;return H(Me,null,H(jA,{clsPrefix:n,tmNode:e,key:e.key}),i==null?void 0:i.map(s=>{const{rawNode:a}=s;return a.show===!1?null:qy(a)?H(jy,{clsPrefix:n,key:s.key}):s.isGroup?(Ur("dropdown","`group` node is not allowed to be put in `group` node."),null):H(Yy,{clsPrefix:n,tmNode:s,parentKey:t,key:s.key})}))}}),QA=$e({name:"DropdownRenderOption",props:{tmNode:{type:Object,required:!0}},render(){const{rawNode:{render:e,props:t}}=this.tmNode;return H("div",t,[e==null?void 0:e()])}}),Gy=$e({name:"DropdownMenu",props:{scrollable:Boolean,showArrow:Boolean,arrowStyle:[String,Object],clsPrefix:{type:String,required:!0},tmNodes:{type:Array,default:()=>[]},parentKey:{type:[String,Number],default:null}},setup(e){const{renderIconRef:t,childrenFieldRef:n}=zt(Bc);Rn(Xh,{showIconRef:W(()=>{const s=t.value;return e.tmNodes.some(a=>{var d;if(a.isGroup)return(d=a.children)===null||d===void 0?void 0:d.some(({rawNode:o})=>s?s(o):o.icon);const{rawNode:r}=a;return s?s(r):r.icon})}),hasSubmenuRef:W(()=>{const{value:s}=n;return e.tmNodes.some(a=>{var d;if(a.isGroup)return(d=a.children)===null||d===void 0?void 0:d.some(({rawNode:o})=>Ku(o,s));const{rawNode:r}=a;return Ku(r,s)})})});const i=F(null);return Rn(Fh,null),Rn(Oh,null),Rn($c,i),{bodyRef:i}},render(){const{parentKey:e,clsPrefix:t,scrollable:n}=this,i=this.tmNodes.map(s=>{const{rawNode:a}=s;return a.show===!1?null:JA(a)?H(QA,{tmNode:s,key:s.key}):qy(a)?H(jy,{clsPrefix:t,key:s.key}):XA(a)?H(ZA,{clsPrefix:t,tmNode:s,parentKey:e,key:s.key}):H(Yy,{clsPrefix:t,tmNode:s,parentKey:e,key:s.key,props:a.props,scrollable:n})});return H("div",{class:[`${t}-dropdown-menu`,n&&`${t}-dropdown-menu--scrollable`],ref:"bodyRef"},n?H(jg,{contentClass:`${t}-dropdown-menu__content`},{default:()=>i}):i,this.showArrow?py({clsPrefix:t,arrowStyle:this.arrowStyle,arrowClass:void 0,arrowWrapperClass:void 0,arrowWrapperStyle:void 0}):null)}}),e3=Re("dropdown-menu",` + transform-origin: var(--v-transform-origin); + background-color: var(--n-color); + border-radius: var(--n-border-radius); + box-shadow: var(--n-box-shadow); + position: relative; + transition: + background-color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier); +`,[Vo(),Re("dropdown-option",` + position: relative; + `,[Ke("a",` + text-decoration: none; + color: inherit; + outline: none; + `,[Ke("&::before",` + content: ""; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + `)]),Re("dropdown-option-body",` + display: flex; + cursor: pointer; + position: relative; + height: var(--n-option-height); + line-height: var(--n-option-height); + font-size: var(--n-font-size); + color: var(--n-option-text-color); + transition: color .3s var(--n-bezier); + `,[Ke("&::before",` + content: ""; + position: absolute; + top: 0; + bottom: 0; + left: 4px; + right: 4px; + transition: background-color .3s var(--n-bezier); + border-radius: var(--n-border-radius); + `),xn("disabled",[We("pending",` + color: var(--n-option-text-color-hover); + `,[tt("prefix, suffix",` + color: var(--n-option-text-color-hover); + `),Ke("&::before","background-color: var(--n-option-color-hover);")]),We("active",` + color: var(--n-option-text-color-active); + `,[tt("prefix, suffix",` + color: var(--n-option-text-color-active); + `),Ke("&::before","background-color: var(--n-option-color-active);")]),We("child-active",` + color: var(--n-option-text-color-child-active); + `,[tt("prefix, suffix",` + color: var(--n-option-text-color-child-active); + `)])]),We("disabled",` + cursor: not-allowed; + opacity: var(--n-option-opacity-disabled); + `),We("group",` + font-size: calc(var(--n-font-size) - 1px); + color: var(--n-group-header-text-color); + `,[tt("prefix",` + width: calc(var(--n-option-prefix-width) / 2); + `,[We("show-icon",` + width: calc(var(--n-option-icon-prefix-width) / 2); + `)])]),tt("prefix",` + width: var(--n-option-prefix-width); + display: flex; + justify-content: center; + align-items: center; + color: var(--n-prefix-color); + transition: color .3s var(--n-bezier); + z-index: 1; + `,[We("show-icon",` + width: var(--n-option-icon-prefix-width); + `),Re("icon",` + font-size: var(--n-option-icon-size); + `)]),tt("label",` + white-space: nowrap; + flex: 1; + z-index: 1; + `),tt("suffix",` + box-sizing: border-box; + flex-grow: 0; + flex-shrink: 0; + display: flex; + justify-content: flex-end; + align-items: center; + min-width: var(--n-option-suffix-width); + padding: 0 8px; + transition: color .3s var(--n-bezier); + color: var(--n-suffix-color); + z-index: 1; + `,[We("has-submenu",` + width: var(--n-option-icon-suffix-width); + `),Re("icon",` + font-size: var(--n-option-icon-size); + `)]),Re("dropdown-menu","pointer-events: all;")]),Re("dropdown-offset-container",` + pointer-events: none; + position: absolute; + left: 0; + right: 0; + top: -4px; + bottom: -4px; + `)]),Re("dropdown-divider",` + transition: background-color .3s var(--n-bezier); + background-color: var(--n-divider-color); + height: 1px; + margin: 4px 0; + `),Re("dropdown-menu-wrapper",` + transform-origin: var(--v-transform-origin); + width: fit-content; + `),Ke(">",[Re("scrollbar",` + height: inherit; + max-height: inherit; + `)]),xn("scrollable",` + padding: var(--n-padding); + `),We("scrollable",[tt("content",` + padding: var(--n-padding); + `)])]),t3={animated:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},size:{type:String,default:"medium"},inverted:Boolean,placement:{type:String,default:"bottom"},onSelect:[Function,Array],options:{type:Array,default:()=>[]},menuProps:Function,showArrow:Boolean,renderLabel:Function,renderIcon:Function,renderOption:Function,nodeProps:Function,labelField:{type:String,default:"label"},keyField:{type:String,default:"key"},childrenField:{type:String,default:"children"},value:[String,Number]},n3=Object.keys(Wr),i3=Object.assign(Object.assign(Object.assign({},Wr),t3),Ht.props),s3=$e({name:"Dropdown",inheritAttrs:!1,props:i3,setup(e){const t=F(!1),n=Qn(ut(e,"show"),t),i=W(()=>{const{keyField:x,childrenField:D}=e;return Fc(e.options,{getKey(M){return M[x]},getDisabled(M){return M.disabled===!0},getIgnored(M){return M.type==="divider"||M.type==="render"},getChildren(M){return M[D]}})}),s=W(()=>i.value.treeNodes),a=F(null),d=F(null),r=F(null),o=W(()=>{var x,D,M;return(M=(D=(x=a.value)!==null&&x!==void 0?x:d.value)!==null&&D!==void 0?D:r.value)!==null&&M!==void 0?M:null}),c=W(()=>i.value.getPath(o.value).keyPath),h=W(()=>i.value.getPath(e.value).keyPath),u=en(()=>e.keyboard&&n.value);Ah({keydown:{ArrowUp:{prevent:!0,handler:k},ArrowRight:{prevent:!0,handler:C},ArrowDown:{prevent:!0,handler:E},ArrowLeft:{prevent:!0,handler:y},Enter:{prevent:!0,handler:I},Escape:p}},u);const{mergedClsPrefixRef:v,inlineThemeDisabled:m}=bn(e),b=Ht("Dropdown","-dropdown",e3,J0,e,v);Rn(Bc,{labelFieldRef:ut(e,"labelField"),childrenFieldRef:ut(e,"childrenField"),renderLabelRef:ut(e,"renderLabel"),renderIconRef:ut(e,"renderIcon"),hoverKeyRef:a,keyboardKeyRef:d,lastToggledSubmenuKeyRef:r,pendingKeyPathRef:c,activeKeyPathRef:h,animatedRef:ut(e,"animated"),mergedShowRef:n,nodePropsRef:ut(e,"nodeProps"),renderOptionRef:ut(e,"renderOption"),menuPropsRef:ut(e,"menuProps"),doSelect:g,doUpdateShow:l}),wt(n,x=>{!e.animated&&!x&&f()});function g(x,D){const{onSelect:M}=e;M&&rt(M,x,D)}function l(x){const{"onUpdate:show":D,onUpdateShow:M}=e;D&&rt(D,x),M&&rt(M,x),t.value=x}function f(){a.value=null,d.value=null,r.value=null}function p(){l(!1)}function y(){P("left")}function C(){P("right")}function k(){P("up")}function E(){P("down")}function I(){const x=S();x!=null&&x.isLeaf&&n.value&&(g(x.key,x.rawNode),l(!1))}function S(){var x;const{value:D}=i,{value:M}=o;return!D||M===null?null:(x=D.getNode(M))!==null&&x!==void 0?x:null}function P(x){const{value:D}=o,{value:{getFirstAvailableNode:M}}=i;let B=null;if(D===null){const z=M();z!==null&&(B=z.key)}else{const z=S();if(z){let Y;switch(x){case"down":Y=z.getNext();break;case"up":Y=z.getPrev();break;case"right":Y=z.getChild();break;case"left":Y=z.getParent();break}Y&&(B=Y.key)}}B!==null&&(a.value=null,d.value=B)}const A=W(()=>{const{size:x,inverted:D}=e,{common:{cubicBezierEaseInOut:M},self:B}=b.value,{padding:z,dividerColor:Y,borderRadius:U,optionOpacityDisabled:N,[Mt("optionIconSuffixWidth",x)]:V,[Mt("optionSuffixWidth",x)]:j,[Mt("optionIconPrefixWidth",x)]:G,[Mt("optionPrefixWidth",x)]:te,[Mt("fontSize",x)]:se,[Mt("optionHeight",x)]:oe,[Mt("optionIconSize",x)]:Fe}=B,K={"--n-bezier":M,"--n-font-size":se,"--n-padding":z,"--n-border-radius":U,"--n-option-height":oe,"--n-option-prefix-width":te,"--n-option-icon-prefix-width":G,"--n-option-suffix-width":j,"--n-option-icon-suffix-width":V,"--n-option-icon-size":Fe,"--n-divider-color":Y,"--n-option-opacity-disabled":N};return D?(K["--n-color"]=B.colorInverted,K["--n-option-color-hover"]=B.optionColorHoverInverted,K["--n-option-color-active"]=B.optionColorActiveInverted,K["--n-option-text-color"]=B.optionTextColorInverted,K["--n-option-text-color-hover"]=B.optionTextColorHoverInverted,K["--n-option-text-color-active"]=B.optionTextColorActiveInverted,K["--n-option-text-color-child-active"]=B.optionTextColorChildActiveInverted,K["--n-prefix-color"]=B.prefixColorInverted,K["--n-suffix-color"]=B.suffixColorInverted,K["--n-group-header-text-color"]=B.groupHeaderTextColorInverted):(K["--n-color"]=B.color,K["--n-option-color-hover"]=B.optionColorHover,K["--n-option-color-active"]=B.optionColorActive,K["--n-option-text-color"]=B.optionTextColor,K["--n-option-text-color-hover"]=B.optionTextColorHover,K["--n-option-text-color-active"]=B.optionTextColorActive,K["--n-option-text-color-child-active"]=B.optionTextColorChildActive,K["--n-prefix-color"]=B.prefixColor,K["--n-suffix-color"]=B.suffixColor,K["--n-group-header-text-color"]=B.groupHeaderTextColor),K}),L=m?Bn("dropdown",W(()=>`${e.size[0]}${e.inverted?"i":""}`),A,e):void 0;return{mergedClsPrefix:v,mergedTheme:b,tmNodes:s,mergedShow:n,handleAfterLeave:()=>{e.animated&&f()},doUpdateShow:l,cssVars:m?void 0:A,themeClass:L==null?void 0:L.themeClass,onRender:L==null?void 0:L.onRender}},render(){const e=(i,s,a,d,r)=>{var o;const{mergedClsPrefix:c,menuProps:h}=this;(o=this.onRender)===null||o===void 0||o.call(this);const u=(h==null?void 0:h(void 0,this.tmNodes.map(m=>m.rawNode)))||{},v={ref:sy(s),class:[i,`${c}-dropdown`,this.themeClass],clsPrefix:c,tmNodes:this.tmNodes,style:[...a,this.cssVars],showArrow:this.showArrow,arrowStyle:this.arrowStyle,scrollable:this.scrollable,onMouseenter:d,onMouseleave:r};return H(Gy,fr(this.$attrs,v,u))},{mergedTheme:t}=this,n={show:this.mergedShow,theme:t.peers.Popover,themeOverrides:t.peerOverrides.Popover,internalOnAfterLeave:this.handleAfterLeave,internalRenderBody:e,onUpdateShow:this.doUpdateShow,"onUpdate:show":void 0};return H(Ko,Object.assign({},Oc(this.$props,n3),n),{trigger:()=>{var i,s;return(s=(i=this.$slots).default)===null||s===void 0?void 0:s.call(i)}})}}),Xy="_n_all__",Jy="_n_none__";function r3(e,t,n,i){return e?s=>{for(const a of e)switch(s){case Xy:n(!0);return;case Jy:i(!0);return;default:if(typeof a=="object"&&a.key===s){a.onSelect(t.value);return}}}:()=>{}}function o3(e,t){return e?e.map(n=>{switch(n){case"all":return{label:t.checkTableAll,key:Xy};case"none":return{label:t.uncheckTableAll,key:Jy};default:return n}}):[]}const a3=$e({name:"DataTableSelectionMenu",props:{clsPrefix:{type:String,required:!0}},setup(e){const{props:t,localeRef:n,checkOptionsRef:i,rawPaginatedDataRef:s,doCheckAll:a,doUncheckAll:d}=zt(ls),r=W(()=>r3(i.value,s,a,d)),o=W(()=>o3(i.value,n.value));return()=>{var c,h,u,v;const{clsPrefix:m}=e;return H(s3,{theme:(h=(c=t.theme)===null||c===void 0?void 0:c.peers)===null||h===void 0?void 0:h.Dropdown,themeOverrides:(v=(u=t.themeOverrides)===null||u===void 0?void 0:u.peers)===null||v===void 0?void 0:v.Dropdown,options:o.value,onSelect:r.value},{default:()=>H(Un,{clsPrefix:m,class:`${m}-data-table-check-extra`},{default:()=>H(Z0,null)})})}}});function Fd(e){return typeof e.title=="function"?e.title(e):e.title}const l3=$e({props:{clsPrefix:{type:String,required:!0},id:{type:String,required:!0},cols:{type:Array,required:!0},width:String},render(){const{clsPrefix:e,id:t,cols:n,width:i}=this;return H("table",{style:{tableLayout:"fixed",width:i},class:`${e}-data-table-table`},H("colgroup",null,n.map(s=>H("col",{key:s.key,style:s.style}))),H("thead",{"data-n-id":t,class:`${e}-data-table-thead`},this.$slots))}}),Zy=$e({name:"DataTableHeader",props:{discrete:{type:Boolean,default:!0}},setup(){const{mergedClsPrefixRef:e,scrollXRef:t,fixedColumnLeftMapRef:n,fixedColumnRightMapRef:i,mergedCurrentPageRef:s,allRowsCheckedRef:a,someRowsCheckedRef:d,rowsRef:r,colsRef:o,mergedThemeRef:c,checkOptionsRef:h,mergedSortStateRef:u,componentId:v,mergedTableLayoutRef:m,headerCheckboxDisabledRef:b,virtualScrollHeaderRef:g,headerHeightRef:l,onUnstableColumnResize:f,doUpdateResizableWidth:p,handleTableHeaderScroll:y,deriveNextSorter:C,doUncheckAll:k,doCheckAll:E}=zt(ls),I=F(),S=F({});function P(B){const z=S.value[B];return z==null?void 0:z.getBoundingClientRect().width}function A(){a.value?k():E()}function L(B,z){if(Ti(B,"dataTableFilter")||Ti(B,"dataTableResizable")||!Od(z))return;const Y=u.value.find(N=>N.columnKey===z.key)||null,U=SA(z,Y);C(U)}const x=new Map;function D(B){x.set(B.key,P(B.key))}function M(B,z){const Y=x.get(B.key);if(Y===void 0)return;const U=Y+z,N=yA(U,B.minWidth,B.maxWidth);f(U,N,B,P),p(B,N)}return{cellElsRef:S,componentId:v,mergedSortState:u,mergedClsPrefix:e,scrollX:t,fixedColumnLeftMap:n,fixedColumnRightMap:i,currentPage:s,allRowsChecked:a,someRowsChecked:d,rows:r,cols:o,mergedTheme:c,checkOptions:h,mergedTableLayout:m,headerCheckboxDisabled:b,headerHeight:l,virtualScrollHeader:g,virtualListRef:I,handleCheckboxUpdateChecked:A,handleColHeaderClick:L,handleTableHeaderScroll:y,handleColumnResizeStart:D,handleColumnResize:M}},render(){const{cellElsRef:e,mergedClsPrefix:t,fixedColumnLeftMap:n,fixedColumnRightMap:i,currentPage:s,allRowsChecked:a,someRowsChecked:d,rows:r,cols:o,mergedTheme:c,checkOptions:h,componentId:u,discrete:v,mergedTableLayout:m,headerCheckboxDisabled:b,mergedSortState:g,virtualScrollHeader:l,handleColHeaderClick:f,handleCheckboxUpdateChecked:p,handleColumnResizeStart:y,handleColumnResize:C}=this,k=(P,A,L)=>P.map(({column:x,colIndex:D,colSpan:M,rowSpan:B,isLast:z})=>{var Y,U;const N=ns(x),{ellipsis:V}=x,j=()=>x.type==="selection"?x.multiple!==!1?H(Me,null,H(qh,{key:s,privateInsideTable:!0,checked:a,indeterminate:d,disabled:b,onUpdateChecked:p}),h?H(a3,{clsPrefix:t}):null):null:H(Me,null,H("div",{class:`${t}-data-table-th__title-wrapper`},H("div",{class:`${t}-data-table-th__title`},V===!0||V&&!V.tooltip?H("div",{class:`${t}-data-table-th__ellipsis`},Fd(x)):V&&typeof V=="object"?H(Gh,Object.assign({},V,{theme:c.peers.Ellipsis,themeOverrides:c.peerOverrides.Ellipsis}),{default:()=>Fd(x)}):Fd(x)),Od(x)?H(WA,{column:x}):null),qv(x)?H(zA,{column:x,options:x.filterOptions}):null,Ny(x)?H(VA,{onResizeStart:()=>{y(x)},onResize:oe=>{C(x,oe)}}):null),G=N in n,te=N in i,se=A&&!x.fixed?"div":"th";return H(se,{ref:oe=>e[N]=oe,key:N,style:[A&&!x.fixed?{position:"absolute",left:Wn(A(D)),top:0,bottom:0}:{left:Wn((Y=n[N])===null||Y===void 0?void 0:Y.start),right:Wn((U=i[N])===null||U===void 0?void 0:U.start)},{width:Wn(x.width),textAlign:x.titleAlign||x.align,height:L}],colspan:M,rowspan:B,"data-col-key":N,class:[`${t}-data-table-th`,(G||te)&&`${t}-data-table-th--fixed-${G?"left":"right"}`,{[`${t}-data-table-th--sorting`]:Uy(x,g),[`${t}-data-table-th--filterable`]:qv(x),[`${t}-data-table-th--sortable`]:Od(x),[`${t}-data-table-th--selection`]:x.type==="selection",[`${t}-data-table-th--last`]:z},x.className],onClick:x.type!=="selection"&&x.type!=="expand"&&!("children"in x)?oe=>{f(oe,x)}:void 0},j())});if(l){const{headerHeight:P}=this;let A=0,L=0;return o.forEach(x=>{x.column.fixed==="left"?A++:x.column.fixed==="right"&&L++}),H(Eo,{ref:"virtualListRef",class:`${t}-data-table-base-table-header`,style:{height:Wn(P)},onScroll:this.handleTableHeaderScroll,columns:o,itemSize:P,showScrollbar:!1,items:[{}],itemResizable:!1,visibleItemsTag:l3,visibleItemsProps:{clsPrefix:t,id:u,cols:o,width:ci(this.scrollX)},renderItemWithCols:({startColIndex:x,endColIndex:D,getLeft:M})=>{const B=o.map((Y,U)=>({column:Y.column,isLast:U===o.length-1,colIndex:Y.index,colSpan:1,rowSpan:1})).filter(({column:Y},U)=>!!(x<=U&&U<=D||Y.fixed)),z=k(B,M,Wn(P));return z.splice(A,0,H("th",{colspan:o.length-A-L,style:{pointerEvents:"none",visibility:"hidden",height:0}})),H("tr",{style:{position:"relative"}},z)}},{default:({renderedItemWithCols:x})=>x})}const E=H("thead",{class:`${t}-data-table-thead`,"data-n-id":u},r.map(P=>H("tr",{class:`${t}-data-table-tr`},k(P,null,void 0))));if(!v)return E;const{handleTableHeaderScroll:I,scrollX:S}=this;return H("div",{class:`${t}-data-table-base-table-header`,onScroll:I},H("table",{class:`${t}-data-table-table`,style:{minWidth:ci(S),tableLayout:m}},H("colgroup",null,o.map(P=>H("col",{key:P.key,style:P.style}))),E))}});function c3(e,t){const n=[];function i(s,a){s.forEach(d=>{d.children&&t.has(d.key)?(n.push({tmNode:d,striped:!1,key:d.key,index:a}),i(d.children,a)):n.push({key:d.key,tmNode:d,striped:!1,index:a})})}return e.forEach(s=>{n.push(s);const{children:a}=s.tmNode;a&&t.has(s.key)&&i(a,s.index)}),n}const d3=$e({props:{clsPrefix:{type:String,required:!0},id:{type:String,required:!0},cols:{type:Array,required:!0},onMouseenter:Function,onMouseleave:Function},render(){const{clsPrefix:e,id:t,cols:n,onMouseenter:i,onMouseleave:s}=this;return H("table",{style:{tableLayout:"fixed"},class:`${e}-data-table-table`,onMouseenter:i,onMouseleave:s},H("colgroup",null,n.map(a=>H("col",{key:a.key,style:a.style}))),H("tbody",{"data-n-id":t,class:`${e}-data-table-tbody`},this.$slots))}}),u3=$e({name:"DataTableBody",props:{onResize:Function,showHeader:Boolean,flexHeight:Boolean,bodyStyle:Object},setup(e){const{slots:t,bodyWidthRef:n,mergedExpandedRowKeysRef:i,mergedClsPrefixRef:s,mergedThemeRef:a,scrollXRef:d,colsRef:r,paginatedDataRef:o,rawPaginatedDataRef:c,fixedColumnLeftMapRef:h,fixedColumnRightMapRef:u,mergedCurrentPageRef:v,rowClassNameRef:m,leftActiveFixedColKeyRef:b,leftActiveFixedChildrenColKeysRef:g,rightActiveFixedColKeyRef:l,rightActiveFixedChildrenColKeysRef:f,renderExpandRef:p,hoverKeyRef:y,summaryRef:C,mergedSortStateRef:k,virtualScrollRef:E,virtualScrollXRef:I,heightForRowRef:S,minRowHeightRef:P,componentId:A,mergedTableLayoutRef:L,childTriggerColIndexRef:x,indentRef:D,rowPropsRef:M,maxHeightRef:B,stripedRef:z,loadingRef:Y,onLoadRef:U,loadingKeySetRef:N,expandableRef:V,stickyExpandedRowsRef:j,renderExpandIconRef:G,summaryPlacementRef:te,treeMateRef:se,scrollbarPropsRef:oe,setHeaderScrollLeft:Fe,doUpdateExpandedRowKeys:K,handleTableBodyScroll:Z,doCheck:J,doUncheck:ae,renderCell:Ie}=zt(ls),de=zt(Q0),Le=F(null),xe=F(null),Qe=F(null),De=en(()=>o.value.length===0),ne=en(()=>e.showHeader||!De.value),ue=en(()=>e.showHeader||De.value);let he="";const Ae=W(()=>new Set(i.value));function ce(at){var gt;return(gt=se.value.getNode(at))===null||gt===void 0?void 0:gt.rawNode}function Je(at,gt,re){const me=ce(at.key);if(!me){Ur("data-table",`fail to get row data with key ${at.key}`);return}if(re){const je=o.value.findIndex(it=>it.key===he);if(je!==-1){const it=o.value.findIndex(Xe=>Xe.key===at.key),dt=Math.min(je,it),be=Math.max(je,it),Ve=[];o.value.slice(dt,be+1).forEach(Xe=>{Xe.disabled||Ve.push(Xe.key)}),gt?J(Ve,!1,me):ae(Ve,me),he=at.key;return}}gt?J(at.key,!1,me):ae(at.key,me),he=at.key}function ye(at){const gt=ce(at.key);if(!gt){Ur("data-table",`fail to get row data with key ${at.key}`);return}J(at.key,!0,gt)}function _e(){if(!ne.value){const{value:gt}=Qe;return gt||null}if(E.value)return Se();const{value:at}=Le;return at?at.containerRef:null}function Ce(at,gt){var re;if(N.value.has(at))return;const{value:me}=i,je=me.indexOf(at),it=Array.from(me);~je?(it.splice(je,1),K(it)):gt&&!gt.isLeaf&&!gt.shallowLoaded?(N.value.add(at),(re=U.value)===null||re===void 0||re.call(U,gt.rawNode).then(()=>{const{value:dt}=i,be=Array.from(dt);~be.indexOf(at)||be.push(at),K(be)}).finally(()=>{N.value.delete(at)})):(it.push(at),K(it))}function Be(){y.value=null}function Se(){const{value:at}=xe;return(at==null?void 0:at.listElRef)||null}function R(){const{value:at}=xe;return(at==null?void 0:at.itemsElRef)||null}function we(at){var gt;Z(at),(gt=Le.value)===null||gt===void 0||gt.sync()}function ht(at){var gt;const{onResize:re}=e;re&&re(at),(gt=Le.value)===null||gt===void 0||gt.sync()}const Ne={getScrollContainer:_e,scrollTo(at,gt){var re,me;E.value?(re=xe.value)===null||re===void 0||re.scrollTo(at,gt):(me=Le.value)===null||me===void 0||me.scrollTo(at,gt)}},ot=Ke([({props:at})=>{const gt=me=>me===null?null:Ke(`[data-n-id="${at.componentId}"] [data-col-key="${me}"]::after`,{boxShadow:"var(--n-box-shadow-after)"}),re=me=>me===null?null:Ke(`[data-n-id="${at.componentId}"] [data-col-key="${me}"]::before`,{boxShadow:"var(--n-box-shadow-before)"});return Ke([gt(at.leftActiveFixedColKey),re(at.rightActiveFixedColKey),at.leftActiveFixedChildrenColKeys.map(me=>gt(me)),at.rightActiveFixedChildrenColKeys.map(me=>re(me))])}]);let Rt=!1;return Yi(()=>{const{value:at}=b,{value:gt}=g,{value:re}=l,{value:me}=f;if(!Rt&&at===null&&re===null)return;const je={leftActiveFixedColKey:at,leftActiveFixedChildrenColKeys:gt,rightActiveFixedColKey:re,rightActiveFixedChildrenColKeys:me,componentId:A};ot.mount({id:`n-${A}`,force:!0,props:je,anchorMetaName:ew,parent:de==null?void 0:de.styleMountTarget}),Rt=!0}),xc(()=>{ot.unmount({id:`n-${A}`,parent:de==null?void 0:de.styleMountTarget})}),Object.assign({bodyWidth:n,summaryPlacement:te,dataTableSlots:t,componentId:A,scrollbarInstRef:Le,virtualListRef:xe,emptyElRef:Qe,summary:C,mergedClsPrefix:s,mergedTheme:a,scrollX:d,cols:r,loading:Y,bodyShowHeaderOnly:ue,shouldDisplaySomeTablePart:ne,empty:De,paginatedDataAndInfo:W(()=>{const{value:at}=z;let gt=!1;return{data:o.value.map(at?(me,je)=>(me.isLeaf||(gt=!0),{tmNode:me,key:me.key,striped:je%2===1,index:je}):(me,je)=>(me.isLeaf||(gt=!0),{tmNode:me,key:me.key,striped:!1,index:je})),hasChildren:gt}}),rawPaginatedData:c,fixedColumnLeftMap:h,fixedColumnRightMap:u,currentPage:v,rowClassName:m,renderExpand:p,mergedExpandedRowKeySet:Ae,hoverKey:y,mergedSortState:k,virtualScroll:E,virtualScrollX:I,heightForRow:S,minRowHeight:P,mergedTableLayout:L,childTriggerColIndex:x,indent:D,rowProps:M,maxHeight:B,loadingKeySet:N,expandable:V,stickyExpandedRows:j,renderExpandIcon:G,scrollbarProps:oe,setHeaderScrollLeft:Fe,handleVirtualListScroll:we,handleVirtualListResize:ht,handleMouseleaveTable:Be,virtualListContainer:Se,virtualListContent:R,handleTableBodyScroll:Z,handleCheckboxUpdateChecked:Je,handleRadioUpdateChecked:ye,handleUpdateExpanded:Ce,renderCell:Ie},Ne)},render(){const{mergedTheme:e,scrollX:t,mergedClsPrefix:n,virtualScroll:i,maxHeight:s,mergedTableLayout:a,flexHeight:d,loadingKeySet:r,onResize:o,setHeaderScrollLeft:c}=this,h=t!==void 0||s!==void 0||d,u=!h&&a==="auto",v=t!==void 0||u,m={minWidth:ci(t)||"100%"};t&&(m.width="100%");const b=H($i,Object.assign({},this.scrollbarProps,{ref:"scrollbarInstRef",scrollable:h||u,class:`${n}-data-table-base-table-body`,style:this.empty?void 0:this.bodyStyle,theme:e.peers.Scrollbar,themeOverrides:e.peerOverrides.Scrollbar,contentStyle:m,container:i?this.virtualListContainer:void 0,content:i?this.virtualListContent:void 0,horizontalRailStyle:{zIndex:3},verticalRailStyle:{zIndex:3},xScrollable:v,onScroll:i?void 0:this.handleTableBodyScroll,internalOnUpdateScrollLeft:c,onResize:o}),{default:()=>{const g={},l={},{cols:f,paginatedDataAndInfo:p,mergedTheme:y,fixedColumnLeftMap:C,fixedColumnRightMap:k,currentPage:E,rowClassName:I,mergedSortState:S,mergedExpandedRowKeySet:P,stickyExpandedRows:A,componentId:L,childTriggerColIndex:x,expandable:D,rowProps:M,handleMouseleaveTable:B,renderExpand:z,summary:Y,handleCheckboxUpdateChecked:U,handleRadioUpdateChecked:N,handleUpdateExpanded:V,heightForRow:j,minRowHeight:G,virtualScrollX:te}=this,{length:se}=f;let oe;const{data:Fe,hasChildren:K}=p,Z=K?c3(Fe,P):Fe;if(Y){const he=Y(this.rawPaginatedData);if(Array.isArray(he)){const Ae=he.map((ce,Je)=>({isSummaryRow:!0,key:`__n_summary__${Je}`,tmNode:{rawNode:ce,disabled:!0},index:-1}));oe=this.summaryPlacement==="top"?[...Ae,...Z]:[...Z,...Ae]}else{const Ae={isSummaryRow:!0,key:"__n_summary__",tmNode:{rawNode:he,disabled:!0},index:-1};oe=this.summaryPlacement==="top"?[Ae,...Z]:[...Z,Ae]}}else oe=Z;const J=K?{width:Wn(this.indent)}:void 0,ae=[];oe.forEach(he=>{z&&P.has(he.key)&&(!D||D(he.tmNode.rawNode))?ae.push(he,{isExpandedRow:!0,key:`${he.key}-expand`,tmNode:he.tmNode,index:he.index}):ae.push(he)});const{length:Ie}=ae,de={};Fe.forEach(({tmNode:he},Ae)=>{de[Ae]=he.key});const Le=A?this.bodyWidth:null,xe=Le===null?void 0:`${Le}px`,Qe=this.virtualScrollX?"div":"td";let De=0,ne=0;te&&f.forEach(he=>{he.column.fixed==="left"?De++:he.column.fixed==="right"&&ne++});const ue=({rowInfo:he,displayedRowIndex:Ae,isVirtual:ce,isVirtualX:Je,startColIndex:ye,endColIndex:_e,getLeft:Ce})=>{const{index:Be}=he;if("isExpandedRow"in he){const{tmNode:{key:it,rawNode:dt}}=he;return H("tr",{class:`${n}-data-table-tr ${n}-data-table-tr--expanded`,key:`${it}__expand`},H("td",{class:[`${n}-data-table-td`,`${n}-data-table-td--last-col`,Ae+1===Ie&&`${n}-data-table-td--last-row`],colspan:se},A?H("div",{class:`${n}-data-table-expand`,style:{width:xe}},z(dt,Be)):z(dt,Be)))}const Se="isSummaryRow"in he,R=!Se&&he.striped,{tmNode:we,key:ht}=he,{rawNode:Ne}=we,ot=P.has(ht),Rt=M?M(Ne,Be):void 0,at=typeof I=="string"?I:wA(Ne,Be,I),gt=Je?f.filter((it,dt)=>!!(ye<=dt&&dt<=_e||it.column.fixed)):f,re=Je?Wn((j==null?void 0:j(Ne,Be))||G):void 0,me=gt.map(it=>{var dt,be,Ve,Xe,pe;const Ge=it.index;if(Ae in g){const Ut=g[Ae],nn=Ut.indexOf(Ge);if(~nn)return Ut.splice(nn,1),null}const{column:_t}=it,Te=ns(it),{rowSpan:Ye,colSpan:ft}=_t,Dt=Se?((dt=he.tmNode.rawNode[Te])===null||dt===void 0?void 0:dt.colSpan)||1:ft?ft(Ne,Be):1,Yt=Se?((be=he.tmNode.rawNode[Te])===null||be===void 0?void 0:be.rowSpan)||1:Ye?Ye(Ne,Be):1,jt=Ge+Dt===se,Xt=Ae+Yt===Ie,Ln=Yt>1;if(Ln&&(l[Ae]={[Ge]:[]}),Dt>1||Ln)for(let Ut=Ae;Ut{V(ht,he.tmNode)}})]:null,_t.type==="selection"?Se?null:_t.multiple===!1?H(AA,{key:E,rowKey:ht,disabled:he.tmNode.disabled,onUpdateChecked:()=>{N(he.tmNode)}}):H(xA,{key:E,rowKey:ht,disabled:he.tmNode.disabled,onUpdateChecked:(Ut,nn)=>{U(he.tmNode,Ut,nn.shiftKey)}}):_t.type==="expand"?Se?null:!_t.expandable||!((pe=_t.expandable)===null||pe===void 0)&&pe.call(_t,Ne)?H(Gv,{clsPrefix:n,rowData:Ne,expanded:ot,renderExpandIcon:this.renderExpandIcon,onClick:()=>{V(ht,null)}}):null:H(BA,{clsPrefix:n,index:Be,row:Ne,column:_t,isSummary:Se,mergedTheme:y,renderCell:this.renderCell}))});return Je&&De&&ne&&me.splice(De,0,H("td",{colspan:f.length-De-ne,style:{pointerEvents:"none",visibility:"hidden",height:0}})),H("tr",Object.assign({},Rt,{onMouseenter:it=>{var dt;this.hoverKey=ht,(dt=Rt==null?void 0:Rt.onMouseenter)===null||dt===void 0||dt.call(Rt,it)},key:ht,class:[`${n}-data-table-tr`,Se&&`${n}-data-table-tr--summary`,R&&`${n}-data-table-tr--striped`,ot&&`${n}-data-table-tr--expanded`,at,Rt==null?void 0:Rt.class],style:[Rt==null?void 0:Rt.style,Je&&{height:re}]}),me)};return i?H(Eo,{ref:"virtualListRef",items:ae,itemSize:this.minRowHeight,visibleItemsTag:d3,visibleItemsProps:{clsPrefix:n,id:L,cols:f,onMouseleave:B},showScrollbar:!1,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemsStyle:m,itemResizable:!te,columns:f,renderItemWithCols:te?({itemIndex:he,item:Ae,startColIndex:ce,endColIndex:Je,getLeft:ye})=>ue({displayedRowIndex:he,isVirtual:!0,isVirtualX:!0,rowInfo:Ae,startColIndex:ce,endColIndex:Je,getLeft:ye}):void 0},{default:({item:he,index:Ae,renderedItemWithCols:ce})=>ce||ue({rowInfo:he,displayedRowIndex:Ae,isVirtual:!0,isVirtualX:!1,startColIndex:0,endColIndex:0,getLeft(Je){return 0}})}):H("table",{class:`${n}-data-table-table`,onMouseleave:B,style:{tableLayout:this.mergedTableLayout}},H("colgroup",null,f.map(he=>H("col",{key:he.key,style:he.style}))),this.showHeader?H(Zy,{discrete:!1}):null,this.empty?null:H("tbody",{"data-n-id":L,class:`${n}-data-table-tbody`},ae.map((he,Ae)=>ue({rowInfo:he,displayedRowIndex:Ae,isVirtual:!1,isVirtualX:!1,startColIndex:-1,endColIndex:-1,getLeft(ce){return-1}}))))}});if(this.empty){const g=()=>H("div",{class:[`${n}-data-table-empty`,this.loading&&`${n}-data-table-empty--hide`],style:this.bodyStyle,ref:"emptyElRef"},Jt(this.dataTableSlots.empty,()=>[H(uy,{theme:this.mergedTheme.peers.Empty,themeOverrides:this.mergedTheme.peerOverrides.Empty})]));return this.shouldDisplaySomeTablePart?H(Me,null,b,g()):H(iu,{onResize:this.onResize},{default:g})}return b}}),h3=$e({name:"MainTable",setup(){const{mergedClsPrefixRef:e,rightFixedColumnsRef:t,leftFixedColumnsRef:n,bodyWidthRef:i,maxHeightRef:s,minHeightRef:a,flexHeightRef:d,virtualScrollHeaderRef:r,syncScrollState:o}=zt(ls),c=F(null),h=F(null),u=F(null),v=F(!(n.value.length||t.value.length)),m=W(()=>({maxHeight:ci(s.value),minHeight:ci(a.value)}));function b(p){i.value=p.contentRect.width,o(),v.value||(v.value=!0)}function g(){var p;const{value:y}=c;return y?r.value?((p=y.virtualListRef)===null||p===void 0?void 0:p.listElRef)||null:y.$el:null}function l(){const{value:p}=h;return p?p.getScrollContainer():null}const f={getBodyElement:l,getHeaderElement:g,scrollTo(p,y){var C;(C=h.value)===null||C===void 0||C.scrollTo(p,y)}};return Yi(()=>{const{value:p}=u;if(!p)return;const y=`${e.value}-data-table-base-table--transition-disabled`;v.value?setTimeout(()=>{p.classList.remove(y)},0):p.classList.add(y)}),Object.assign({maxHeight:s,mergedClsPrefix:e,selfElRef:u,headerInstRef:c,bodyInstRef:h,bodyStyle:m,flexHeight:d,handleBodyResize:b},f)},render(){const{mergedClsPrefix:e,maxHeight:t,flexHeight:n}=this,i=t===void 0&&!n;return H("div",{class:`${e}-data-table-base-table`,ref:"selfElRef"},i?null:H(Zy,{ref:"headerInstRef"}),H(u3,{ref:"bodyInstRef",bodyStyle:this.bodyStyle,showHeader:i,flexHeight:n,onResize:this.handleBodyResize}))}}),Jv=p3(),f3=Ke([Re("data-table",` + width: 100%; + font-size: var(--n-font-size); + display: flex; + flex-direction: column; + position: relative; + --n-merged-th-color: var(--n-th-color); + --n-merged-td-color: var(--n-td-color); + --n-merged-border-color: var(--n-border-color); + --n-merged-th-color-sorting: var(--n-th-color-sorting); + --n-merged-td-color-hover: var(--n-td-color-hover); + --n-merged-td-color-sorting: var(--n-td-color-sorting); + --n-merged-td-color-striped: var(--n-td-color-striped); + `,[Re("data-table-wrapper",` + flex-grow: 1; + display: flex; + flex-direction: column; + `),We("flex-height",[Ke(">",[Re("data-table-wrapper",[Ke(">",[Re("data-table-base-table",` + display: flex; + flex-direction: column; + flex-grow: 1; + `,[Ke(">",[Re("data-table-base-table-body","flex-basis: 0;",[Ke("&:last-child","flex-grow: 1;")])])])])])])]),Ke(">",[Re("data-table-loading-wrapper",` + color: var(--n-loading-color); + font-size: var(--n-loading-size); + position: absolute; + left: 50%; + top: 50%; + transform: translateX(-50%) translateY(-50%); + transition: color .3s var(--n-bezier); + display: flex; + align-items: center; + justify-content: center; + `,[Vo({originalTransform:"translateX(-50%) translateY(-50%)"})])]),Re("data-table-expand-placeholder",` + margin-right: 8px; + display: inline-block; + width: 16px; + height: 1px; + `),Re("data-table-indent",` + display: inline-block; + height: 1px; + `),Re("data-table-expand-trigger",` + display: inline-flex; + margin-right: 8px; + cursor: pointer; + font-size: 16px; + vertical-align: -0.2em; + position: relative; + width: 16px; + height: 16px; + color: var(--n-td-text-color); + transition: color .3s var(--n-bezier); + `,[We("expanded",[Re("icon","transform: rotate(90deg);",[oo({originalTransform:"rotate(90deg)"})]),Re("base-icon","transform: rotate(90deg);",[oo({originalTransform:"rotate(90deg)"})])]),Re("base-loading",` + color: var(--n-loading-color); + transition: color .3s var(--n-bezier); + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + `,[oo()]),Re("icon",` + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + `,[oo()]),Re("base-icon",` + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + `,[oo()])]),Re("data-table-thead",` + transition: background-color .3s var(--n-bezier); + background-color: var(--n-merged-th-color); + `),Re("data-table-tr",` + position: relative; + box-sizing: border-box; + background-clip: padding-box; + transition: background-color .3s var(--n-bezier); + `,[Re("data-table-expand",` + position: sticky; + left: 0; + overflow: hidden; + margin: calc(var(--n-th-padding) * -1); + padding: var(--n-th-padding); + box-sizing: border-box; + `),We("striped","background-color: var(--n-merged-td-color-striped);",[Re("data-table-td","background-color: var(--n-merged-td-color-striped);")]),xn("summary",[Ke("&:hover","background-color: var(--n-merged-td-color-hover);",[Ke(">",[Re("data-table-td","background-color: var(--n-merged-td-color-hover);")])])])]),Re("data-table-th",` + padding: var(--n-th-padding); + position: relative; + text-align: start; + box-sizing: border-box; + background-color: var(--n-merged-th-color); + border-color: var(--n-merged-border-color); + border-bottom: 1px solid var(--n-merged-border-color); + color: var(--n-th-text-color); + transition: + border-color .3s var(--n-bezier), + color .3s var(--n-bezier), + background-color .3s var(--n-bezier); + font-weight: var(--n-th-font-weight); + `,[We("filterable",` + padding-right: 36px; + `,[We("sortable",` + padding-right: calc(var(--n-th-padding) + 36px); + `)]),Jv,We("selection",` + padding: 0; + text-align: center; + line-height: 0; + z-index: 3; + `),tt("title-wrapper",` + display: flex; + align-items: center; + flex-wrap: nowrap; + max-width: 100%; + `,[tt("title",` + flex: 1; + min-width: 0; + `)]),tt("ellipsis",` + display: inline-block; + vertical-align: bottom; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + max-width: 100%; + `),We("hover",` + background-color: var(--n-merged-th-color-hover); + `),We("sorting",` + background-color: var(--n-merged-th-color-sorting); + `),We("sortable",` + cursor: pointer; + `,[tt("ellipsis",` + max-width: calc(100% - 18px); + `),Ke("&:hover",` + background-color: var(--n-merged-th-color-hover); + `)]),Re("data-table-sorter",` + height: var(--n-sorter-size); + width: var(--n-sorter-size); + margin-left: 4px; + position: relative; + display: inline-flex; + align-items: center; + justify-content: center; + vertical-align: -0.2em; + color: var(--n-th-icon-color); + transition: color .3s var(--n-bezier); + `,[Re("base-icon","transition: transform .3s var(--n-bezier)"),We("desc",[Re("base-icon",` + transform: rotate(0deg); + `)]),We("asc",[Re("base-icon",` + transform: rotate(-180deg); + `)]),We("asc, desc",` + color: var(--n-th-icon-color-active); + `)]),Re("data-table-resize-button",` + width: var(--n-resizable-container-size); + position: absolute; + top: 0; + right: calc(var(--n-resizable-container-size) / 2); + bottom: 0; + cursor: col-resize; + user-select: none; + `,[Ke("&::after",` + width: var(--n-resizable-size); + height: 50%; + position: absolute; + top: 50%; + left: calc(var(--n-resizable-container-size) / 2); + bottom: 0; + background-color: var(--n-merged-border-color); + transform: translateY(-50%); + transition: background-color .3s var(--n-bezier); + z-index: 1; + content: ''; + `),We("active",[Ke("&::after",` + background-color: var(--n-th-icon-color-active); + `)]),Ke("&:hover::after",` + background-color: var(--n-th-icon-color-active); + `)]),Re("data-table-filter",` + position: absolute; + z-index: auto; + right: 0; + width: 36px; + top: 0; + bottom: 0; + cursor: pointer; + display: flex; + justify-content: center; + align-items: center; + transition: + background-color .3s var(--n-bezier), + color .3s var(--n-bezier); + font-size: var(--n-filter-size); + color: var(--n-th-icon-color); + `,[Ke("&:hover",` + background-color: var(--n-th-button-color-hover); + `),We("show",` + background-color: var(--n-th-button-color-hover); + `),We("active",` + background-color: var(--n-th-button-color-hover); + color: var(--n-th-icon-color-active); + `)])]),Re("data-table-td",` + padding: var(--n-td-padding); + text-align: start; + box-sizing: border-box; + border: none; + background-color: var(--n-merged-td-color); + color: var(--n-td-text-color); + border-bottom: 1px solid var(--n-merged-border-color); + transition: + box-shadow .3s var(--n-bezier), + background-color .3s var(--n-bezier), + border-color .3s var(--n-bezier), + color .3s var(--n-bezier); + `,[We("expand",[Re("data-table-expand-trigger",` + margin-right: 0; + `)]),We("last-row",` + border-bottom: 0 solid var(--n-merged-border-color); + `,[Ke("&::after",` + bottom: 0 !important; + `),Ke("&::before",` + bottom: 0 !important; + `)]),We("summary",` + background-color: var(--n-merged-th-color); + `),We("hover",` + background-color: var(--n-merged-td-color-hover); + `),We("sorting",` + background-color: var(--n-merged-td-color-sorting); + `),tt("ellipsis",` + display: inline-block; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + max-width: 100%; + vertical-align: bottom; + max-width: calc(100% - var(--indent-offset, -1.5) * 16px - 24px); + `),We("selection, expand",` + text-align: center; + padding: 0; + line-height: 0; + `),Jv]),Re("data-table-empty",` + box-sizing: border-box; + padding: var(--n-empty-padding); + flex-grow: 1; + flex-shrink: 0; + opacity: 1; + display: flex; + align-items: center; + justify-content: center; + transition: opacity .3s var(--n-bezier); + `,[We("hide",` + opacity: 0; + `)]),tt("pagination",` + margin: var(--n-pagination-margin); + display: flex; + justify-content: flex-end; + `),Re("data-table-wrapper",` + position: relative; + opacity: 1; + transition: opacity .3s var(--n-bezier), border-color .3s var(--n-bezier); + border-top-left-radius: var(--n-border-radius); + border-top-right-radius: var(--n-border-radius); + line-height: var(--n-line-height); + `),We("loading",[Re("data-table-wrapper",` + opacity: var(--n-opacity-loading); + pointer-events: none; + `)]),We("single-column",[Re("data-table-td",` + border-bottom: 0 solid var(--n-merged-border-color); + `,[Ke("&::after, &::before",` + bottom: 0 !important; + `)])]),xn("single-line",[Re("data-table-th",` + border-right: 1px solid var(--n-merged-border-color); + `,[We("last",` + border-right: 0 solid var(--n-merged-border-color); + `)]),Re("data-table-td",` + border-right: 1px solid var(--n-merged-border-color); + `,[We("last-col",` + border-right: 0 solid var(--n-merged-border-color); + `)])]),We("bordered",[Re("data-table-wrapper",` + border: 1px solid var(--n-merged-border-color); + border-bottom-left-radius: var(--n-border-radius); + border-bottom-right-radius: var(--n-border-radius); + overflow: hidden; + `)]),Re("data-table-base-table",[We("transition-disabled",[Re("data-table-th",[Ke("&::after, &::before","transition: none;")]),Re("data-table-td",[Ke("&::after, &::before","transition: none;")])])]),We("bottom-bordered",[Re("data-table-td",[We("last-row",` + border-bottom: 1px solid var(--n-merged-border-color); + `)])]),Re("data-table-table",` + font-variant-numeric: tabular-nums; + width: 100%; + word-break: break-word; + transition: background-color .3s var(--n-bezier); + border-collapse: separate; + border-spacing: 0; + background-color: var(--n-merged-td-color); + `),Re("data-table-base-table-header",` + border-top-left-radius: calc(var(--n-border-radius) - 1px); + border-top-right-radius: calc(var(--n-border-radius) - 1px); + z-index: 3; + overflow: scroll; + flex-shrink: 0; + transition: border-color .3s var(--n-bezier); + scrollbar-width: none; + `,[Ke("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",` + display: none; + width: 0; + height: 0; + `)]),Re("data-table-check-extra",` + transition: color .3s var(--n-bezier); + color: var(--n-th-icon-color); + position: absolute; + font-size: 14px; + right: -4px; + top: 50%; + transform: translateY(-50%); + z-index: 1; + `)]),Re("data-table-filter-menu",[Re("scrollbar",` + max-height: 240px; + `),tt("group",` + display: flex; + flex-direction: column; + padding: 12px 12px 0 12px; + `,[Re("checkbox",` + margin-bottom: 12px; + margin-right: 0; + `),Re("radio",` + margin-bottom: 12px; + margin-right: 0; + `)]),tt("action",` + padding: var(--n-action-padding); + display: flex; + flex-wrap: nowrap; + justify-content: space-evenly; + border-top: 1px solid var(--n-action-divider-color); + `,[Re("button",[Ke("&:not(:last-child)",` + margin: var(--n-action-button-margin); + `),Ke("&:last-child",` + margin-right: 0; + `)])]),Re("divider",` + margin: 0 !important; + `)]),Gg(Re("data-table",` + --n-merged-th-color: var(--n-th-color-modal); + --n-merged-td-color: var(--n-td-color-modal); + --n-merged-border-color: var(--n-border-color-modal); + --n-merged-th-color-hover: var(--n-th-color-hover-modal); + --n-merged-td-color-hover: var(--n-td-color-hover-modal); + --n-merged-th-color-sorting: var(--n-th-color-hover-modal); + --n-merged-td-color-sorting: var(--n-td-color-hover-modal); + --n-merged-td-color-striped: var(--n-td-color-striped-modal); + `)),Xg(Re("data-table",` + --n-merged-th-color: var(--n-th-color-popover); + --n-merged-td-color: var(--n-td-color-popover); + --n-merged-border-color: var(--n-border-color-popover); + --n-merged-th-color-hover: var(--n-th-color-hover-popover); + --n-merged-td-color-hover: var(--n-td-color-hover-popover); + --n-merged-th-color-sorting: var(--n-th-color-hover-popover); + --n-merged-td-color-sorting: var(--n-td-color-hover-popover); + --n-merged-td-color-striped: var(--n-td-color-striped-popover); + `))]);function p3(){return[We("fixed-left",` + left: 0; + position: sticky; + z-index: 2; + `,[Ke("&::after",` + pointer-events: none; + content: ""; + width: 36px; + display: inline-block; + position: absolute; + top: 0; + bottom: -1px; + transition: box-shadow .2s var(--n-bezier); + right: -36px; + `)]),We("fixed-right",` + right: 0; + position: sticky; + z-index: 1; + `,[Ke("&::before",` + pointer-events: none; + content: ""; + width: 36px; + display: inline-block; + position: absolute; + top: 0; + bottom: -1px; + transition: box-shadow .2s var(--n-bezier); + left: -36px; + `)])]}function v3(e,t){const{paginatedDataRef:n,treeMateRef:i,selectionColumnRef:s}=t,a=F(e.defaultCheckedRowKeys),d=W(()=>{var k;const{checkedRowKeys:E}=e,I=E===void 0?a.value:E;return((k=s.value)===null||k===void 0?void 0:k.multiple)===!1?{checkedKeys:I.slice(0,1),indeterminateKeys:[]}:i.value.getCheckedKeys(I,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded})}),r=W(()=>d.value.checkedKeys),o=W(()=>d.value.indeterminateKeys),c=W(()=>new Set(r.value)),h=W(()=>new Set(o.value)),u=W(()=>{const{value:k}=c;return n.value.reduce((E,I)=>{const{key:S,disabled:P}=I;return E+(!P&&k.has(S)?1:0)},0)}),v=W(()=>n.value.filter(k=>k.disabled).length),m=W(()=>{const{length:k}=n.value,{value:E}=h;return u.value>0&&u.valueE.has(I.key))}),b=W(()=>{const{length:k}=n.value;return u.value!==0&&u.value===k-v.value}),g=W(()=>n.value.length===0);function l(k,E,I){const{"onUpdate:checkedRowKeys":S,onUpdateCheckedRowKeys:P,onCheckedRowKeysChange:A}=e,L=[],{value:{getNode:x}}=i;k.forEach(D=>{var M;const B=(M=x(D))===null||M===void 0?void 0:M.rawNode;L.push(B)}),S&&rt(S,k,L,{row:E,action:I}),P&&rt(P,k,L,{row:E,action:I}),A&&rt(A,k,L,{row:E,action:I}),a.value=k}function f(k,E=!1,I){if(!e.loading){if(E){l(Array.isArray(k)?k.slice(0,1):[k],I,"check");return}l(i.value.check(k,r.value,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,I,"check")}}function p(k,E){e.loading||l(i.value.uncheck(k,r.value,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,E,"uncheck")}function y(k=!1){const{value:E}=s;if(!E||e.loading)return;const I=[];(k?i.value.treeNodes:n.value).forEach(S=>{S.disabled||I.push(S.key)}),l(i.value.check(I,r.value,{cascade:!0,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,void 0,"checkAll")}function C(k=!1){const{value:E}=s;if(!E||e.loading)return;const I=[];(k?i.value.treeNodes:n.value).forEach(S=>{S.disabled||I.push(S.key)}),l(i.value.uncheck(I,r.value,{cascade:!0,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,void 0,"uncheckAll")}return{mergedCheckedRowKeySetRef:c,mergedCheckedRowKeysRef:r,mergedInderminateRowKeySetRef:h,someRowsCheckedRef:m,allRowsCheckedRef:b,headerCheckboxDisabledRef:g,doUpdateCheckedRowKeys:l,doCheckAll:y,doUncheckAll:C,doCheck:f,doUncheck:p}}function g3(e,t){const n=en(()=>{for(const c of e.columns)if(c.type==="expand")return c.renderExpand}),i=en(()=>{let c;for(const h of e.columns)if(h.type==="expand"){c=h.expandable;break}return c}),s=F(e.defaultExpandAll?n!=null&&n.value?(()=>{const c=[];return t.value.treeNodes.forEach(h=>{var u;!((u=i.value)===null||u===void 0)&&u.call(i,h.rawNode)&&c.push(h.key)}),c})():t.value.getNonLeafKeys():e.defaultExpandedRowKeys),a=ut(e,"expandedRowKeys"),d=ut(e,"stickyExpandedRows"),r=Qn(a,s);function o(c){const{onUpdateExpandedRowKeys:h,"onUpdate:expandedRowKeys":u}=e;h&&rt(h,c),u&&rt(u,c),s.value=c}return{stickyExpandedRowsRef:d,mergedExpandedRowKeysRef:r,renderExpandRef:n,expandableRef:i,doUpdateExpandedRowKeys:o}}function m3(e,t){const n=[],i=[],s=[],a=new WeakMap;let d=-1,r=0,o=!1;function c(v,m){m>d&&(n[m]=[],d=m),v.forEach((b,g)=>{if("children"in b)c(b.children,m+1);else{const l="key"in b?b.key:void 0;i.push({key:ns(b),style:bA(b,l!==void 0?ci(t(l)):void 0),column:b,index:g,width:b.width===void 0?128:Number(b.width)}),r+=1,o||(o=!!b.ellipsis),s.push(b)}})}c(e,0);let h=0;function u(v,m){let b=0;v.forEach(g=>{var l;if("children"in g){const f=h,p={column:g,colIndex:h,colSpan:0,rowSpan:1,isLast:!1};u(g.children,m+1),g.children.forEach(y=>{var C,k;p.colSpan+=(k=(C=a.get(y))===null||C===void 0?void 0:C.colSpan)!==null&&k!==void 0?k:0}),f+p.colSpan===r&&(p.isLast=!0),a.set(g,p),n[m].push(p)}else{if(h1&&(b=h+f);const p=h+f===r,y={column:g,colSpan:f,colIndex:h,rowSpan:d-m+1,isLast:p};a.set(g,y),n[m].push(y),h+=1}})}return u(e,0),{hasEllipsis:o,rows:n,cols:i,dataRelatedCols:s}}function _3(e,t){const n=W(()=>m3(e.columns,t));return{rowsRef:W(()=>n.value.rows),colsRef:W(()=>n.value.cols),hasEllipsisRef:W(()=>n.value.hasEllipsis),dataRelatedColsRef:W(()=>n.value.dataRelatedCols)}}function y3(){const e=F({});function t(s){return e.value[s]}function n(s,a){Ny(s)&&"key"in s&&(e.value[s.key]=a)}function i(){e.value={}}return{getResizableWidth:t,doUpdateResizableWidth:n,clearResizableWidth:i}}function b3(e,{mainTableInstRef:t,mergedCurrentPageRef:n,bodyWidthRef:i}){let s=0;const a=F(),d=F(null),r=F([]),o=F(null),c=F([]),h=W(()=>ci(e.scrollX)),u=W(()=>e.columns.filter(P=>P.fixed==="left")),v=W(()=>e.columns.filter(P=>P.fixed==="right")),m=W(()=>{const P={};let A=0;function L(x){x.forEach(D=>{const M={start:A,end:0};P[ns(D)]=M,"children"in D?(L(D.children),M.end=A):(A+=Wv(D)||0,M.end=A)})}return L(u.value),P}),b=W(()=>{const P={};let A=0;function L(x){for(let D=x.length-1;D>=0;--D){const M=x[D],B={start:A,end:0};P[ns(M)]=B,"children"in M?(L(M.children),B.end=A):(A+=Wv(M)||0,B.end=A)}}return L(v.value),P});function g(){var P,A;const{value:L}=u;let x=0;const{value:D}=m;let M=null;for(let B=0;B(((P=D[z])===null||P===void 0?void 0:P.start)||0)-x)M=z,x=((A=D[z])===null||A===void 0?void 0:A.end)||0;else break}d.value=M}function l(){r.value=[];let P=e.columns.find(A=>ns(A)===d.value);for(;P&&"children"in P;){const A=P.children.length;if(A===0)break;const L=P.children[A-1];r.value.push(ns(L)),P=L}}function f(){var P,A;const{value:L}=v,x=Number(e.scrollX),{value:D}=i;if(D===null)return;let M=0,B=null;const{value:z}=b;for(let Y=L.length-1;Y>=0;--Y){const U=ns(L[Y]);if(Math.round(s+(((P=z[U])===null||P===void 0?void 0:P.start)||0)+D-M)ns(A)===o.value);for(;P&&"children"in P&&P.children.length;){const A=P.children[0];c.value.push(ns(A)),P=A}}function y(){const P=t.value?t.value.getHeaderElement():null,A=t.value?t.value.getBodyElement():null;return{header:P,body:A}}function C(){const{body:P}=y();P&&(P.scrollTop=0)}function k(){a.value!=="body"?ac(I):a.value=void 0}function E(P){var A;(A=e.onScroll)===null||A===void 0||A.call(e,P),a.value!=="head"?ac(I):a.value=void 0}function I(){const{header:P,body:A}=y();if(!A)return;const{value:L}=i;if(L!==null){if(e.maxHeight||e.flexHeight){if(!P)return;const x=s-P.scrollLeft;a.value=x!==0?"head":"body",a.value==="head"?(s=P.scrollLeft,A.scrollLeft=s):(s=A.scrollLeft,P.scrollLeft=s)}else s=A.scrollLeft;g(),l(),f(),p()}}function S(P){const{header:A}=y();A&&(A.scrollLeft=P,I())}return wt(n,()=>{C()}),{styleScrollXRef:h,fixedColumnLeftMapRef:m,fixedColumnRightMapRef:b,leftFixedColumnsRef:u,rightFixedColumnsRef:v,leftActiveFixedColKeyRef:d,leftActiveFixedChildrenColKeysRef:r,rightActiveFixedColKeyRef:o,rightActiveFixedChildrenColKeysRef:c,syncScrollState:I,handleTableBodyScroll:E,handleTableHeaderScroll:k,setHeaderScrollLeft:S}}function wl(e){return typeof e=="object"&&typeof e.multiple=="number"?e.multiple:!1}function w3(e,t){return t&&(e===void 0||e==="default"||typeof e=="object"&&e.compare==="default")?S3(t):typeof e=="function"?e:e&&typeof e=="object"&&e.compare&&e.compare!=="default"?e.compare:!1}function S3(e){return(t,n)=>{const i=t[e],s=n[e];return i==null?s==null?0:-1:s==null?1:typeof i=="number"&&typeof s=="number"?i-s:typeof i=="string"&&typeof s=="string"?i.localeCompare(s):0}}function C3(e,{dataRelatedColsRef:t,filteredDataRef:n}){const i=[];t.value.forEach(m=>{var b;m.sorter!==void 0&&v(i,{columnKey:m.key,sorter:m.sorter,order:(b=m.defaultSortOrder)!==null&&b!==void 0?b:!1})});const s=F(i),a=W(()=>{const m=t.value.filter(l=>l.type!=="selection"&&l.sorter!==void 0&&(l.sortOrder==="ascend"||l.sortOrder==="descend"||l.sortOrder===!1)),b=m.filter(l=>l.sortOrder!==!1);if(b.length)return b.map(l=>({columnKey:l.key,order:l.sortOrder,sorter:l.sorter}));if(m.length)return[];const{value:g}=s;return Array.isArray(g)?g:g?[g]:[]}),d=W(()=>{const m=a.value.slice().sort((b,g)=>{const l=wl(b.sorter)||0;return(wl(g.sorter)||0)-l});return m.length?n.value.slice().sort((g,l)=>{let f=0;return m.some(p=>{const{columnKey:y,sorter:C,order:k}=p,E=w3(C,y);return E&&k&&(f=E(g.rawNode,l.rawNode),f!==0)?(f=f*_A(k),!0):!1}),f}):n.value});function r(m){let b=a.value.slice();return m&&wl(m.sorter)!==!1?(b=b.filter(g=>wl(g.sorter)!==!1),v(b,m),b):m||null}function o(m){const b=r(m);c(b)}function c(m){const{"onUpdate:sorter":b,onUpdateSorter:g,onSorterChange:l}=e;b&&rt(b,m),g&&rt(g,m),l&&rt(l,m),s.value=m}function h(m,b="ascend"){if(!m)u();else{const g=t.value.find(f=>f.type!=="selection"&&f.type!=="expand"&&f.key===m);if(!(g!=null&&g.sorter))return;const l=g.sorter;o({columnKey:m,sorter:l,order:b})}}function u(){c(null)}function v(m,b){const g=m.findIndex(l=>(b==null?void 0:b.columnKey)&&l.columnKey===b.columnKey);g!==void 0&&g>=0?m[g]=b:m.push(b)}return{clearSorter:u,sort:h,sortedDataRef:d,mergedSortStateRef:a,deriveNextSorter:o}}function k3(e,{dataRelatedColsRef:t}){const n=W(()=>{const j=G=>{for(let te=0;te{const{childrenKey:j}=e;return Fc(e.data,{ignoreEmptyChildren:!0,getKey:e.rowKey,getChildren:G=>G[j],getDisabled:G=>{var te,se;return!!(!((se=(te=n.value)===null||te===void 0?void 0:te.disabled)===null||se===void 0)&&se.call(te,G))}})}),s=en(()=>{const{columns:j}=e,{length:G}=j;let te=null;for(let se=0;se{const j=t.value.filter(se=>se.filterOptionValues!==void 0||se.filterOptionValue!==void 0),G={};return j.forEach(se=>{var oe;se.type==="selection"||se.type==="expand"||(se.filterOptionValues===void 0?G[se.key]=(oe=se.filterOptionValue)!==null&&oe!==void 0?oe:null:G[se.key]=se.filterOptionValues)}),Object.assign(jv(a.value),G)}),h=W(()=>{const j=c.value,{columns:G}=e;function te(Fe){return(K,Z)=>!!~String(Z[Fe]).indexOf(String(K))}const{value:{treeNodes:se}}=i,oe=[];return G.forEach(Fe=>{Fe.type==="selection"||Fe.type==="expand"||"children"in Fe||oe.push([Fe.key,Fe])}),se?se.filter(Fe=>{const{rawNode:K}=Fe;for(const[Z,J]of oe){let ae=j[Z];if(ae==null||(Array.isArray(ae)||(ae=[ae]),!ae.length))continue;const Ie=J.filter==="default"?te(Z):J.filter;if(J&&typeof Ie=="function")if(J.filterMode==="and"){if(ae.some(de=>!Ie(de,K)))return!1}else{if(ae.some(de=>Ie(de,K)))continue;return!1}}return!0}):[]}),{sortedDataRef:u,deriveNextSorter:v,mergedSortStateRef:m,sort:b,clearSorter:g}=C3(e,{dataRelatedColsRef:t,filteredDataRef:h});t.value.forEach(j=>{var G;if(j.filter){const te=j.defaultFilterOptionValues;j.filterMultiple?a.value[j.key]=te||[]:te!==void 0?a.value[j.key]=te===null?[]:te:a.value[j.key]=(G=j.defaultFilterOptionValue)!==null&&G!==void 0?G:null}});const l=W(()=>{const{pagination:j}=e;if(j!==!1)return j.page}),f=W(()=>{const{pagination:j}=e;if(j!==!1)return j.pageSize}),p=Qn(l,r),y=Qn(f,o),C=en(()=>{const j=p.value;return e.remote?j:Math.max(1,Math.min(Math.ceil(h.value.length/y.value),j))}),k=W(()=>{const{pagination:j}=e;if(j){const{pageCount:G}=j;if(G!==void 0)return G}}),E=W(()=>{if(e.remote)return i.value.treeNodes;if(!e.pagination)return u.value;const j=y.value,G=(C.value-1)*j;return u.value.slice(G,G+j)}),I=W(()=>E.value.map(j=>j.rawNode));function S(j){const{pagination:G}=e;if(G){const{onChange:te,"onUpdate:page":se,onUpdatePage:oe}=G;te&&rt(te,j),oe&&rt(oe,j),se&&rt(se,j),x(j)}}function P(j){const{pagination:G}=e;if(G){const{onPageSizeChange:te,"onUpdate:pageSize":se,onUpdatePageSize:oe}=G;te&&rt(te,j),oe&&rt(oe,j),se&&rt(se,j),D(j)}}const A=W(()=>{if(e.remote){const{pagination:j}=e;if(j){const{itemCount:G}=j;if(G!==void 0)return G}return}return h.value.length}),L=W(()=>Object.assign(Object.assign({},e.pagination),{onChange:void 0,onUpdatePage:void 0,onUpdatePageSize:void 0,onPageSizeChange:void 0,"onUpdate:page":S,"onUpdate:pageSize":P,page:C.value,pageSize:y.value,pageCount:A.value===void 0?k.value:void 0,itemCount:A.value}));function x(j){const{"onUpdate:page":G,onPageChange:te,onUpdatePage:se}=e;se&&rt(se,j),G&&rt(G,j),te&&rt(te,j),r.value=j}function D(j){const{"onUpdate:pageSize":G,onPageSizeChange:te,onUpdatePageSize:se}=e;te&&rt(te,j),se&&rt(se,j),G&&rt(G,j),o.value=j}function M(j,G){const{onUpdateFilters:te,"onUpdate:filters":se,onFiltersChange:oe}=e;te&&rt(te,j,G),se&&rt(se,j,G),oe&&rt(oe,j,G),a.value=j}function B(j,G,te,se){var oe;(oe=e.onUnstableColumnResize)===null||oe===void 0||oe.call(e,j,G,te,se)}function z(j){x(j)}function Y(){U()}function U(){N({})}function N(j){V(j)}function V(j){j?j&&(a.value=jv(j)):a.value={}}return{treeMateRef:i,mergedCurrentPageRef:C,mergedPaginationRef:L,paginatedDataRef:E,rawPaginatedDataRef:I,mergedFilterStateRef:c,mergedSortStateRef:m,hoverKeyRef:F(null),selectionColumnRef:n,childTriggerColIndexRef:s,doUpdateFilters:M,deriveNextSorter:v,doUpdatePageSize:D,doUpdatePage:x,onUnstableColumnResize:B,filter:V,filters:N,clearFilter:Y,clearFilters:U,clearSorter:g,page:z,sort:b}}const Qy=$e({name:"DataTable",alias:["AdvancedTable"],props:gA,setup(e,{slots:t}){const{mergedBorderedRef:n,mergedClsPrefixRef:i,inlineThemeDisabled:s,mergedRtlRef:a}=bn(e),d=Rs("DataTable",a,i),r=W(()=>{const{bottomBordered:re}=e;return n.value?!1:re!==void 0?re:!0}),o=Ht("DataTable","-data-table",f3,nw,e,i),c=F(null),h=F(null),{getResizableWidth:u,clearResizableWidth:v,doUpdateResizableWidth:m}=y3(),{rowsRef:b,colsRef:g,dataRelatedColsRef:l,hasEllipsisRef:f}=_3(e,u),{treeMateRef:p,mergedCurrentPageRef:y,paginatedDataRef:C,rawPaginatedDataRef:k,selectionColumnRef:E,hoverKeyRef:I,mergedPaginationRef:S,mergedFilterStateRef:P,mergedSortStateRef:A,childTriggerColIndexRef:L,doUpdatePage:x,doUpdateFilters:D,onUnstableColumnResize:M,deriveNextSorter:B,filter:z,filters:Y,clearFilter:U,clearFilters:N,clearSorter:V,page:j,sort:G}=k3(e,{dataRelatedColsRef:l}),te=re=>{const{fileName:me="data.csv",keepOriginalData:je=!1}=re||{},it=je?e.data:k.value,dt=kA(e.columns,it,e.getCsvCell,e.getCsvHeader),be=new Blob([dt],{type:"text/csv;charset=utf-8"}),Ve=URL.createObjectURL(be);lL(Ve,me.endsWith(".csv")?me:`${me}.csv`),URL.revokeObjectURL(Ve)},{doCheckAll:se,doUncheckAll:oe,doCheck:Fe,doUncheck:K,headerCheckboxDisabledRef:Z,someRowsCheckedRef:J,allRowsCheckedRef:ae,mergedCheckedRowKeySetRef:Ie,mergedInderminateRowKeySetRef:de}=v3(e,{selectionColumnRef:E,treeMateRef:p,paginatedDataRef:C}),{stickyExpandedRowsRef:Le,mergedExpandedRowKeysRef:xe,renderExpandRef:Qe,expandableRef:De,doUpdateExpandedRowKeys:ne}=g3(e,p),{handleTableBodyScroll:ue,handleTableHeaderScroll:he,syncScrollState:Ae,setHeaderScrollLeft:ce,leftActiveFixedColKeyRef:Je,leftActiveFixedChildrenColKeysRef:ye,rightActiveFixedColKeyRef:_e,rightActiveFixedChildrenColKeysRef:Ce,leftFixedColumnsRef:Be,rightFixedColumnsRef:Se,fixedColumnLeftMapRef:R,fixedColumnRightMapRef:we}=b3(e,{bodyWidthRef:c,mainTableInstRef:h,mergedCurrentPageRef:y}),{localeRef:ht}=rs("DataTable"),Ne=W(()=>e.virtualScroll||e.flexHeight||e.maxHeight!==void 0||f.value?"fixed":e.tableLayout);Rn(ls,{props:e,treeMateRef:p,renderExpandIconRef:ut(e,"renderExpandIcon"),loadingKeySetRef:F(new Set),slots:t,indentRef:ut(e,"indent"),childTriggerColIndexRef:L,bodyWidthRef:c,componentId:oh(),hoverKeyRef:I,mergedClsPrefixRef:i,mergedThemeRef:o,scrollXRef:W(()=>e.scrollX),rowsRef:b,colsRef:g,paginatedDataRef:C,leftActiveFixedColKeyRef:Je,leftActiveFixedChildrenColKeysRef:ye,rightActiveFixedColKeyRef:_e,rightActiveFixedChildrenColKeysRef:Ce,leftFixedColumnsRef:Be,rightFixedColumnsRef:Se,fixedColumnLeftMapRef:R,fixedColumnRightMapRef:we,mergedCurrentPageRef:y,someRowsCheckedRef:J,allRowsCheckedRef:ae,mergedSortStateRef:A,mergedFilterStateRef:P,loadingRef:ut(e,"loading"),rowClassNameRef:ut(e,"rowClassName"),mergedCheckedRowKeySetRef:Ie,mergedExpandedRowKeysRef:xe,mergedInderminateRowKeySetRef:de,localeRef:ht,expandableRef:De,stickyExpandedRowsRef:Le,rowKeyRef:ut(e,"rowKey"),renderExpandRef:Qe,summaryRef:ut(e,"summary"),virtualScrollRef:ut(e,"virtualScroll"),virtualScrollXRef:ut(e,"virtualScrollX"),heightForRowRef:ut(e,"heightForRow"),minRowHeightRef:ut(e,"minRowHeight"),virtualScrollHeaderRef:ut(e,"virtualScrollHeader"),headerHeightRef:ut(e,"headerHeight"),rowPropsRef:ut(e,"rowProps"),stripedRef:ut(e,"striped"),checkOptionsRef:W(()=>{const{value:re}=E;return re==null?void 0:re.options}),rawPaginatedDataRef:k,filterMenuCssVarsRef:W(()=>{const{self:{actionDividerColor:re,actionPadding:me,actionButtonMargin:je}}=o.value;return{"--n-action-padding":me,"--n-action-button-margin":je,"--n-action-divider-color":re}}),onLoadRef:ut(e,"onLoad"),mergedTableLayoutRef:Ne,maxHeightRef:ut(e,"maxHeight"),minHeightRef:ut(e,"minHeight"),flexHeightRef:ut(e,"flexHeight"),headerCheckboxDisabledRef:Z,paginationBehaviorOnFilterRef:ut(e,"paginationBehaviorOnFilter"),summaryPlacementRef:ut(e,"summaryPlacement"),filterIconPopoverPropsRef:ut(e,"filterIconPopoverProps"),scrollbarPropsRef:ut(e,"scrollbarProps"),syncScrollState:Ae,doUpdatePage:x,doUpdateFilters:D,getResizableWidth:u,onUnstableColumnResize:M,clearResizableWidth:v,doUpdateResizableWidth:m,deriveNextSorter:B,doCheck:Fe,doUncheck:K,doCheckAll:se,doUncheckAll:oe,doUpdateExpandedRowKeys:ne,handleTableHeaderScroll:he,handleTableBodyScroll:ue,setHeaderScrollLeft:ce,renderCell:ut(e,"renderCell")});const ot={filter:z,filters:Y,clearFilters:N,clearSorter:V,page:j,sort:G,clearFilter:U,downloadCsv:te,scrollTo:(re,me)=>{var je;(je=h.value)===null||je===void 0||je.scrollTo(re,me)}},Rt=W(()=>{const{size:re}=e,{common:{cubicBezierEaseInOut:me},self:{borderColor:je,tdColorHover:it,tdColorSorting:dt,tdColorSortingModal:be,tdColorSortingPopover:Ve,thColorSorting:Xe,thColorSortingModal:pe,thColorSortingPopover:Ge,thColor:_t,thColorHover:Te,tdColor:Ye,tdTextColor:ft,thTextColor:Dt,thFontWeight:Yt,thButtonColorHover:jt,thIconColor:Xt,thIconColorActive:Ln,filterSize:On,borderRadius:rn,lineHeight:on,tdColorModal:Cn,thColorModal:mn,borderColorModal:Ut,thColorHoverModal:nn,tdColorHoverModal:Ft,borderColorPopover:an,thColorPopover:ln,tdColorPopover:bi,tdColorHoverPopover:hi,thColorHoverPopover:fi,paginationMargin:ei,emptyPadding:Ee,boxShadowAfter:Ze,boxShadowBefore:mt,sorterSize:At,resizableContainerSize:Zt,resizableSize:Kt,loadingColor:Hn,loadingSize:Yn,opacityLoading:_n,tdColorStriped:ti,tdColorStripedModal:Bi,tdColorStripedPopover:Hi,[Mt("fontSize",re)]:Ni,[Mt("thPadding",re)]:Ei,[Mt("tdPadding",re)]:cs}}=o.value;return{"--n-font-size":Ni,"--n-th-padding":Ei,"--n-td-padding":cs,"--n-bezier":me,"--n-border-radius":rn,"--n-line-height":on,"--n-border-color":je,"--n-border-color-modal":Ut,"--n-border-color-popover":an,"--n-th-color":_t,"--n-th-color-hover":Te,"--n-th-color-modal":mn,"--n-th-color-hover-modal":nn,"--n-th-color-popover":ln,"--n-th-color-hover-popover":fi,"--n-td-color":Ye,"--n-td-color-hover":it,"--n-td-color-modal":Cn,"--n-td-color-hover-modal":Ft,"--n-td-color-popover":bi,"--n-td-color-hover-popover":hi,"--n-th-text-color":Dt,"--n-td-text-color":ft,"--n-th-font-weight":Yt,"--n-th-button-color-hover":jt,"--n-th-icon-color":Xt,"--n-th-icon-color-active":Ln,"--n-filter-size":On,"--n-pagination-margin":ei,"--n-empty-padding":Ee,"--n-box-shadow-before":mt,"--n-box-shadow-after":Ze,"--n-sorter-size":At,"--n-resizable-container-size":Zt,"--n-resizable-size":Kt,"--n-loading-size":Yn,"--n-loading-color":Hn,"--n-opacity-loading":_n,"--n-td-color-striped":ti,"--n-td-color-striped-modal":Bi,"--n-td-color-striped-popover":Hi,"n-td-color-sorting":dt,"n-td-color-sorting-modal":be,"n-td-color-sorting-popover":Ve,"n-th-color-sorting":Xe,"n-th-color-sorting-modal":pe,"n-th-color-sorting-popover":Ge}}),at=s?Bn("data-table",W(()=>e.size[0]),Rt,e):void 0,gt=W(()=>{if(!e.pagination)return!1;if(e.paginateSinglePage)return!0;const re=S.value,{pageCount:me}=re;return me!==void 0?me>1:re.itemCount&&re.pageSize&&re.itemCount>re.pageSize});return Object.assign({mainTableInstRef:h,mergedClsPrefix:i,rtlEnabled:d,mergedTheme:o,paginatedData:C,mergedBordered:n,mergedBottomBordered:r,mergedPagination:S,mergedShowPagination:gt,cssVars:s?void 0:Rt,themeClass:at==null?void 0:at.themeClass,onRender:at==null?void 0:at.onRender},ot)},render(){const{mergedClsPrefix:e,themeClass:t,onRender:n,$slots:i,spinProps:s}=this;return n==null||n(),H("div",{class:[`${e}-data-table`,this.rtlEnabled&&`${e}-data-table--rtl`,t,{[`${e}-data-table--bordered`]:this.mergedBordered,[`${e}-data-table--bottom-bordered`]:this.mergedBottomBordered,[`${e}-data-table--single-line`]:this.singleLine,[`${e}-data-table--single-column`]:this.singleColumn,[`${e}-data-table--loading`]:this.loading,[`${e}-data-table--flex-height`]:this.flexHeight}],style:this.cssVars},H("div",{class:`${e}-data-table-wrapper`},H(h3,{ref:"mainTableInstRef"})),this.mergedShowPagination?H("div",{class:`${e}-data-table__pagination`},H(vA,Object.assign({theme:this.mergedTheme.peers.Pagination,themeOverrides:this.mergedTheme.peerOverrides.Pagination,disabled:this.loading},this.mergedPagination))):null,H(xi,{name:"fade-in-scale-up-transition"},{default:()=>this.loading?H("div",{class:`${e}-data-table-loading-wrapper`},Jt(i.loading,()=>[H(kc,Object.assign({clsPrefix:e,strokeWidth:20},s))])):null}))}}),Hc=ui("n-date-picker"),jr=40,x3="HH:mm:ss",eb={active:Boolean,dateFormat:String,calendarDayFormat:String,calendarHeaderYearFormat:String,calendarHeaderMonthFormat:String,calendarHeaderMonthYearSeparator:{type:String,required:!0},calendarHeaderMonthBeforeYear:{type:Boolean,default:void 0},timerPickerFormat:{type:String,value:x3},value:{type:[Array,Number],default:null},shortcuts:Object,defaultTime:[Number,String,Array],inputReadonly:Boolean,onClear:Function,onConfirm:Function,onClose:Function,onTabOut:Function,onKeydown:Function,actions:Array,onUpdateValue:{type:Function,required:!0},themeClass:String,onRender:Function,panel:Boolean,onNextMonth:Function,onPrevMonth:Function,onNextYear:Function,onPrevYear:Function};function tb(e){const{dateLocaleRef:t,timePickerSizeRef:n,timePickerPropsRef:i,localeRef:s,mergedClsPrefixRef:a,mergedThemeRef:d}=zt(Hc),r=W(()=>({locale:t.value.locale})),o=F(null),c=Ah();function h(){const{onClear:x}=e;x&&x()}function u(){const{onConfirm:x,value:D}=e;x&&x(D)}function v(x,D){const{onUpdateValue:M}=e;M(x,D)}function m(x=!1){const{onClose:D}=e;D&&D(x)}function b(){const{onTabOut:x}=e;x&&x()}function g(){v(null,!0),m(!0),h()}function l(){b()}function f(){(e.active||e.panel)&&hn(()=>{const{value:x}=o;if(!x)return;const D=x.querySelectorAll("[data-n-date]");D.forEach(M=>{M.classList.add("transition-disabled")}),x.offsetWidth,D.forEach(M=>{M.classList.remove("transition-disabled")})})}function p(x){x.key==="Tab"&&x.target===o.value&&c.shift&&(x.preventDefault(),b())}function y(x){const{value:D}=o;c.tab&&x.target===D&&(D!=null&&D.contains(x.relatedTarget))&&b()}let C=null,k=!1;function E(){C=e.value,k=!0}function I(){k=!1}function S(){k&&(v(C,!1),k=!1)}function P(x){return typeof x=="function"?x():x}const A=F(!1);function L(){A.value=!A.value}return{mergedTheme:d,mergedClsPrefix:a,dateFnsOptions:r,timePickerSize:n,timePickerProps:i,selfRef:o,locale:s,doConfirm:u,doClose:m,doUpdateValue:v,doTabOut:b,handleClearClick:g,handleFocusDetectorFocus:l,disableTransitionOneTick:f,handlePanelKeyDown:p,handlePanelFocus:y,cachePendingValue:E,clearPendingValue:I,restorePendingValue:S,getShortcutValue:P,handleShortcutMouseleave:S,showMonthYearPanel:A,handleOpenQuickSelectMonthPanel:L}}const Jh=Object.assign(Object.assign({},eb),{defaultCalendarStartTime:Number,actions:{type:Array,default:()=>["now","clear","confirm"]}});function Zh(e,t){var n;const i=tb(e),{isValueInvalidRef:s,isDateDisabledRef:a,isDateInvalidRef:d,isTimeInvalidRef:r,isDateTimeInvalidRef:o,isHourDisabledRef:c,isMinuteDisabledRef:h,isSecondDisabledRef:u,localeRef:v,firstDayOfWeekRef:m,datePickerSlots:b,yearFormatRef:g,monthFormatRef:l,quarterFormatRef:f,yearRangeRef:p}=zt(Hc),y={isValueInvalid:s,isDateDisabled:a,isDateInvalid:d,isTimeInvalid:r,isDateTimeInvalid:o,isHourDisabled:c,isMinuteDisabled:h,isSecondDisabled:u},C=W(()=>e.dateFormat||v.value.dateFormat),k=W(()=>e.calendarDayFormat||v.value.dayFormat),E=F(e.value===null||Array.isArray(e.value)?"":un(e.value,C.value)),I=F(e.value===null||Array.isArray(e.value)?(n=e.defaultCalendarStartTime)!==null&&n!==void 0?n:Date.now():e.value),S=F(null),P=F(null),A=F(null),L=F(Date.now()),x=W(()=>{var Se;return Bu(I.value,e.value,L.value,(Se=m.value)!==null&&Se!==void 0?Se:v.value.firstDayOfWeek,!1,t==="week")}),D=W(()=>{const{value:Se}=e;return Hu(I.value,Array.isArray(Se)?null:Se,L.value,{monthFormat:l.value})}),M=W(()=>{const{value:Se}=e;return Uu(Array.isArray(Se)?null:Se,L.value,{yearFormat:g.value},p)}),B=W(()=>{const{value:Se}=e;return Nu(I.value,Array.isArray(Se)?null:Se,L.value,{quarterFormat:f.value})}),z=W(()=>x.value.slice(0,7).map(Se=>{const{ts:R}=Se;return un(R,k.value,i.dateFnsOptions.value)})),Y=W(()=>un(I.value,e.calendarHeaderMonthFormat||v.value.monthFormat,i.dateFnsOptions.value)),U=W(()=>un(I.value,e.calendarHeaderYearFormat||v.value.yearFormat,i.dateFnsOptions.value)),N=W(()=>{var Se;return(Se=e.calendarHeaderMonthBeforeYear)!==null&&Se!==void 0?Se:v.value.monthBeforeYear});wt(I,(Se,R)=>{(t==="date"||t==="datetime")&&(Va(Se,R)||i.disableTransitionOneTick())}),wt(W(()=>e.value),Se=>{Se!==null&&!Array.isArray(Se)?(E.value=un(Se,C.value,i.dateFnsOptions.value),I.value=Se):E.value=""});function V(Se){var R;if(t==="datetime")return vt(Wh(Se));if(t==="month")return vt(Os(Se));if(t==="year")return vt(za(Se));if(t==="quarter")return vt($a(Se));if(t==="week"){const we=(((R=m.value)!==null&&R!==void 0?R:v.value.firstDayOfWeek)+1)%7;return vt(Ks(Se,{weekStartsOn:we}))}return vt(Lo(Se))}function j(Se,R){const{isDateDisabled:{value:we}}=y;return we?we(Se,R):!1}function G(Se){const R=ki(Se,C.value,new Date,i.dateFnsOptions.value);if(ji(R)){if(e.value===null)i.doUpdateValue(vt(V(Date.now())),e.panel);else if(!Array.isArray(e.value)){const we=Zn(e.value,{year:Tn(R),month:Sn(R),date:Ki(R)});i.doUpdateValue(vt(V(vt(we))),e.panel)}}else E.value=Se}function te(){const Se=ki(E.value,C.value,new Date,i.dateFnsOptions.value);if(ji(Se)){if(e.value===null)i.doUpdateValue(vt(V(Date.now())),!1);else if(!Array.isArray(e.value)){const R=Zn(e.value,{year:Tn(Se),month:Sn(Se),date:Ki(Se)});i.doUpdateValue(vt(V(vt(R))),!1)}}else de()}function se(){i.doUpdateValue(null,!0),E.value="",i.doClose(!0),i.handleClearClick()}function oe(){i.doUpdateValue(vt(V(Date.now())),!0);const Se=Date.now();I.value=Se,i.doClose(!0),e.panel&&(t==="month"||t==="quarter"||t==="year")&&(i.disableTransitionOneTick(),Ce(Se))}const Fe=F(null);function K(Se){Se.type==="date"&&t==="week"&&(Fe.value=V(vt(Se.ts)))}function Z(Se){return Se.type==="date"&&t==="week"?V(vt(Se.ts))===Fe.value:!1}function J(Se){if(j(Se.ts,Se.type==="date"?{type:"date",year:Se.dateObject.year,month:Se.dateObject.month,date:Se.dateObject.date}:Se.type==="month"?{type:"month",year:Se.dateObject.year,month:Se.dateObject.month}:Se.type==="year"?{type:"year",year:Se.dateObject.year}:{type:"quarter",year:Se.dateObject.year,quarter:Se.dateObject.quarter}))return;let R;if(e.value!==null&&!Array.isArray(e.value)?R=e.value:R=Date.now(),t==="datetime"&&e.defaultTime!==null&&!Array.isArray(e.defaultTime)){const we=Nl(e.defaultTime);we&&(R=vt(Zn(R,we)))}switch(R=vt(Se.type==="quarter"&&Se.dateObject.quarter?jM(Fu(R,Se.dateObject.year),Se.dateObject.quarter):Zn(R,Se.dateObject)),i.doUpdateValue(V(R),e.panel||t==="date"||t==="week"||t==="year"),t){case"date":case"week":i.doClose();break;case"year":e.panel&&i.disableTransitionOneTick(),i.doClose();break;case"month":i.disableTransitionOneTick(),Ce(R);break;case"quarter":i.disableTransitionOneTick(),Ce(R);break}}function ae(Se,R){let we;e.value!==null&&!Array.isArray(e.value)?we=e.value:we=Date.now(),we=vt(Se.type==="month"?jh(we,Se.dateObject.month):Fu(we,Se.dateObject.year)),R(we),Ce(we)}function Ie(Se){I.value=Se}function de(Se){if(e.value===null||Array.isArray(e.value)){E.value="";return}Se===void 0&&(Se=e.value),E.value=un(Se,C.value,i.dateFnsOptions.value)}function Le(){y.isDateInvalid.value||y.isTimeInvalid.value||(i.doConfirm(),xe())}function xe(){e.active&&i.doClose()}function Qe(){var Se;I.value=vt(Au(I.value,1)),(Se=e.onNextYear)===null||Se===void 0||Se.call(e)}function De(){var Se;I.value=vt(Au(I.value,-1)),(Se=e.onPrevYear)===null||Se===void 0||Se.call(e)}function ne(){var Se;I.value=vt(Jn(I.value,1)),(Se=e.onNextMonth)===null||Se===void 0||Se.call(e)}function ue(){var Se;I.value=vt(Jn(I.value,-1)),(Se=e.onPrevMonth)===null||Se===void 0||Se.call(e)}function he(){const{value:Se}=S;return(Se==null?void 0:Se.listElRef)||null}function Ae(){const{value:Se}=S;return(Se==null?void 0:Se.itemsElRef)||null}function ce(){var Se;(Se=P.value)===null||Se===void 0||Se.sync()}function Je(Se){Se!==null&&i.doUpdateValue(Se,e.panel)}function ye(Se){i.cachePendingValue();const R=i.getShortcutValue(Se);typeof R=="number"&&i.doUpdateValue(R,!1)}function _e(Se){const R=i.getShortcutValue(Se);typeof R=="number"&&(i.doUpdateValue(R,e.panel),i.clearPendingValue(),Le())}function Ce(Se){const{value:R}=e;if(A.value){const we=Sn(Se===void 0?R===null?Date.now():R:Se);A.value.scrollTo({top:we*jr})}if(S.value){const we=Tn(Se===void 0?R===null?Date.now():R:Se)-p.value[0];S.value.scrollTo({top:we*jr})}}const Be={monthScrollbarRef:A,yearScrollbarRef:P,yearVlRef:S};return Object.assign(Object.assign(Object.assign(Object.assign({dateArray:x,monthArray:D,yearArray:M,quarterArray:B,calendarYear:U,calendarMonth:Y,weekdays:z,calendarMonthBeforeYear:N,mergedIsDateDisabled:j,nextYear:Qe,prevYear:De,nextMonth:ne,prevMonth:ue,handleNowClick:oe,handleConfirmClick:Le,handleSingleShortcutMouseenter:ye,handleSingleShortcutClick:_e},y),i),Be),{handleDateClick:J,handleDateInputBlur:te,handleDateInput:G,handleDateMouseEnter:K,isWeekHovered:Z,handleTimePickerChange:Je,clearSelectedDateTime:se,virtualListContainer:he,virtualListContent:Ae,handleVirtualListScroll:ce,timePickerSize:i.timePickerSize,dateInputValue:E,datePickerSlots:b,handleQuickMonthClick:ae,justifyColumnsScrollState:Ce,calendarValue:I,onUpdateCalendarValue:Ie})}const nb=$e({name:"MonthPanel",props:Object.assign(Object.assign({},Jh),{type:{type:String,required:!0},useAsQuickJump:Boolean}),setup(e){const t=Zh(e,e.type),{dateLocaleRef:n}=rs("DatePicker"),i=d=>{switch(d.type){case"year":return Iy(d.dateObject.year,d.yearFormat,n.value.locale);case"month":return Dy(d.dateObject.month,d.monthFormat,n.value.locale);case"quarter":return My(d.dateObject.quarter,d.quarterFormat,n.value.locale)}},{useAsQuickJump:s}=e,a=(d,r,o)=>{const{mergedIsDateDisabled:c,handleDateClick:h,handleQuickMonthClick:u}=t;return H("div",{"data-n-date":!0,key:r,class:[`${o}-date-panel-month-calendar__picker-col-item`,d.isCurrent&&`${o}-date-panel-month-calendar__picker-col-item--current`,d.selected&&`${o}-date-panel-month-calendar__picker-col-item--selected`,!s&&c(d.ts,d.type==="year"?{type:"year",year:d.dateObject.year}:d.type==="month"?{type:"month",year:d.dateObject.year,month:d.dateObject.month}:d.type==="quarter"?{type:"month",year:d.dateObject.year,month:d.dateObject.quarter}:null)&&`${o}-date-panel-month-calendar__picker-col-item--disabled`],onClick:()=>{s?u(d,v=>{e.onUpdateValue(v,!1)}):h(d)}},i(d))};return It(()=>{t.justifyColumnsScrollState()}),Object.assign(Object.assign({},t),{renderItem:a})},render(){const{mergedClsPrefix:e,mergedTheme:t,shortcuts:n,actions:i,renderItem:s,type:a,onRender:d}=this;return d==null||d(),H("div",{ref:"selfRef",tabindex:0,class:[`${e}-date-panel`,`${e}-date-panel--month`,!this.panel&&`${e}-date-panel--shadow`,this.themeClass],onFocus:this.handlePanelFocus,onKeydown:this.handlePanelKeyDown},H("div",{class:`${e}-date-panel-month-calendar`},H($i,{ref:"yearScrollbarRef",class:`${e}-date-panel-month-calendar__picker-col`,theme:t.peers.Scrollbar,themeOverrides:t.peerOverrides.Scrollbar,container:this.virtualListContainer,content:this.virtualListContent,horizontalRailStyle:{zIndex:1},verticalRailStyle:{zIndex:1}},{default:()=>H(Eo,{ref:"yearVlRef",items:this.yearArray,itemSize:jr,showScrollbar:!1,keyField:"ts",onScroll:this.handleVirtualListScroll,paddingBottom:4},{default:({item:r,index:o})=>s(r,o,e)})}),a==="month"||a==="quarter"?H("div",{class:`${e}-date-panel-month-calendar__picker-col`},H($i,{ref:"monthScrollbarRef",theme:t.peers.Scrollbar,themeOverrides:t.peerOverrides.Scrollbar},{default:()=>[(a==="month"?this.monthArray:this.quarterArray).map((r,o)=>s(r,o,e)),H("div",{class:`${e}-date-panel-${a}-calendar__padding`})]})):null),this.datePickerSlots.footer?H("div",{class:`${e}-date-panel-footer`},{default:this.datePickerSlots.footer}):null,i!=null&&i.length||n?H("div",{class:`${e}-date-panel-actions`},H("div",{class:`${e}-date-panel-actions__prefix`},n&&Object.keys(n).map(r=>{const o=n[r];return Array.isArray(o)?null:H(xs,{size:"tiny",onMouseenter:()=>{this.handleSingleShortcutMouseenter(o)},onClick:()=>{this.handleSingleShortcutClick(o)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>r})})),H("div",{class:`${e}-date-panel-actions__suffix`},i!=null&&i.includes("clear")?Ri(this.$slots.now,{onClear:this.handleClearClick,text:this.locale.clear},()=>[H(yn,{theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,size:"tiny",onClick:this.handleClearClick},{default:()=>this.locale.clear})]):null,i!=null&&i.includes("now")?Ri(this.$slots.now,{onNow:this.handleNowClick,text:this.locale.now},()=>[H(yn,{theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,size:"tiny",onClick:this.handleNowClick},{default:()=>this.locale.now})]):null,i!=null&&i.includes("confirm")?Ri(this.$slots.confirm,{onConfirm:this.handleConfirmClick,disabled:this.isDateInvalid,text:this.locale.confirm},()=>[H(yn,{theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,size:"tiny",type:"primary",disabled:this.isDateInvalid,onClick:this.handleConfirmClick},{default:()=>this.locale.confirm})]):null)):null,H(yr,{onFocus:this.handleFocusDetectorFocus}))}}),Do=$e({props:{mergedClsPrefix:{type:String,required:!0},value:Number,monthBeforeYear:{type:Boolean,required:!0},monthYearSeparator:{type:String,required:!0},calendarMonth:{type:String,required:!0},calendarYear:{type:String,required:!0},onUpdateValue:{type:Function,required:!0}},setup(){const e=F(null),t=F(null),n=F(!1);function i(a){var d;n.value&&!(!((d=e.value)===null||d===void 0)&&d.contains(Nr(a)))&&(n.value=!1)}function s(){n.value=!n.value}return{show:n,triggerRef:e,monthPanelRef:t,handleHeaderClick:s,handleClickOutside:i}},render(){const{handleClickOutside:e,mergedClsPrefix:t}=this;return H("div",{class:`${t}-date-panel-month__month-year`,ref:"triggerRef"},H(No,null,{default:()=>[H(Uo,null,{default:()=>H("div",{class:[`${t}-date-panel-month__text`,this.show&&`${t}-date-panel-month__text--active`],onClick:this.handleHeaderClick},this.monthBeforeYear?[this.calendarMonth,this.monthYearSeparator,this.calendarYear]:[this.calendarYear,this.monthYearSeparator,this.calendarMonth])}),H(zo,{show:this.show,teleportDisabled:!0},{default:()=>H(xi,{name:"fade-in-scale-up-transition",appear:!0},{default:()=>this.show?ct(H(nb,{ref:"monthPanelRef",onUpdateValue:this.onUpdateValue,actions:[],calendarHeaderMonthYearSeparator:this.monthYearSeparator,type:"month",key:"month",useAsQuickJump:!0,value:this.value}),[[Kr,e,void 0,{capture:!0}]]):null})})]}))}}),R3=$e({name:"DatePanel",props:Object.assign(Object.assign({},Jh),{type:{type:String,required:!0}}),setup(e){return Zh(e,e.type)},render(){var e,t,n;const{mergedClsPrefix:i,mergedTheme:s,shortcuts:a,onRender:d,$slots:r,type:o}=this;return d==null||d(),H("div",{ref:"selfRef",tabindex:0,class:[`${i}-date-panel`,`${i}-date-panel--${o}`,!this.panel&&`${i}-date-panel--shadow`,this.themeClass],onFocus:this.handlePanelFocus,onKeydown:this.handlePanelKeyDown},H("div",{class:`${i}-date-panel-calendar`},H("div",{class:`${i}-date-panel-month`},H("div",{class:`${i}-date-panel-month__fast-prev`,onClick:this.prevYear},Jt(r["prev-year"],()=>[H(vr,null)])),H("div",{class:`${i}-date-panel-month__prev`,onClick:this.prevMonth},Jt(r["prev-month"],()=>[H(pr,null)])),H(Do,{monthYearSeparator:this.calendarHeaderMonthYearSeparator,monthBeforeYear:this.calendarMonthBeforeYear,value:this.calendarValue,onUpdateValue:this.onUpdateCalendarValue,mergedClsPrefix:i,calendarMonth:this.calendarMonth,calendarYear:this.calendarYear}),H("div",{class:`${i}-date-panel-month__next`,onClick:this.nextMonth},Jt(r["next-month"],()=>[H(mr,null)])),H("div",{class:`${i}-date-panel-month__fast-next`,onClick:this.nextYear},Jt(r["next-year"],()=>[H(gr,null)]))),H("div",{class:`${i}-date-panel-weekdays`},this.weekdays.map(c=>H("div",{key:c,class:`${i}-date-panel-weekdays__day`},c))),H("div",{class:`${i}-date-panel-dates`},this.dateArray.map((c,h)=>H("div",{"data-n-date":!0,key:h,class:[`${i}-date-panel-date`,{[`${i}-date-panel-date--current`]:c.isCurrentDate,[`${i}-date-panel-date--selected`]:c.selected,[`${i}-date-panel-date--excluded`]:!c.inCurrentMonth,[`${i}-date-panel-date--disabled`]:this.mergedIsDateDisabled(c.ts,{type:"date",year:c.dateObject.year,month:c.dateObject.month,date:c.dateObject.date}),[`${i}-date-panel-date--week-hovered`]:this.isWeekHovered(c),[`${i}-date-panel-date--week-selected`]:c.inSelectedWeek}],onClick:()=>{this.handleDateClick(c)},onMouseenter:()=>{this.handleDateMouseEnter(c)}},H("div",{class:`${i}-date-panel-date__trigger`}),c.dateObject.date,c.isCurrentDate?H("div",{class:`${i}-date-panel-date__sup`}):null)))),this.datePickerSlots.footer?H("div",{class:`${i}-date-panel-footer`},this.datePickerSlots.footer()):null,!((e=this.actions)===null||e===void 0)&&e.length||a?H("div",{class:`${i}-date-panel-actions`},H("div",{class:`${i}-date-panel-actions__prefix`},a&&Object.keys(a).map(c=>{const h=a[c];return Array.isArray(h)?null:H(xs,{size:"tiny",onMouseenter:()=>{this.handleSingleShortcutMouseenter(h)},onClick:()=>{this.handleSingleShortcutClick(h)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>c})})),H("div",{class:`${i}-date-panel-actions__suffix`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?Ri(this.$slots.clear,{onClear:this.handleClearClick,text:this.locale.clear},()=>[H(yn,{theme:s.peers.Button,themeOverrides:s.peerOverrides.Button,size:"tiny",onClick:this.handleClearClick},{default:()=>this.locale.clear})]):null,!((n=this.actions)===null||n===void 0)&&n.includes("now")?Ri(this.$slots.now,{onNow:this.handleNowClick,text:this.locale.now},()=>[H(yn,{theme:s.peers.Button,themeOverrides:s.peerOverrides.Button,size:"tiny",onClick:this.handleNowClick},{default:()=>this.locale.now})]):null)):null,H(yr,{onFocus:this.handleFocusDetectorFocus}))}}),Qh=Object.assign(Object.assign({},eb),{defaultCalendarStartTime:Number,defaultCalendarEndTime:Number,bindCalendarMonths:Boolean,actions:{type:Array,default:()=>["clear","confirm"]}});function ef(e,t){var n,i;const{isDateDisabledRef:s,isStartHourDisabledRef:a,isEndHourDisabledRef:d,isStartMinuteDisabledRef:r,isEndMinuteDisabledRef:o,isStartSecondDisabledRef:c,isEndSecondDisabledRef:h,isStartDateInvalidRef:u,isEndDateInvalidRef:v,isStartTimeInvalidRef:m,isEndTimeInvalidRef:b,isStartValueInvalidRef:g,isEndValueInvalidRef:l,isRangeInvalidRef:f,localeRef:p,rangesRef:y,closeOnSelectRef:C,updateValueOnCloseRef:k,firstDayOfWeekRef:E,datePickerSlots:I,monthFormatRef:S,yearFormatRef:P,quarterFormatRef:A,yearRangeRef:L}=zt(Hc),x={isDateDisabled:s,isStartHourDisabled:a,isEndHourDisabled:d,isStartMinuteDisabled:r,isEndMinuteDisabled:o,isStartSecondDisabled:c,isEndSecondDisabled:h,isStartDateInvalid:u,isEndDateInvalid:v,isStartTimeInvalid:m,isEndTimeInvalid:b,isStartValueInvalid:g,isEndValueInvalid:l,isRangeInvalid:f},D=tb(e),M=F(null),B=F(null),z=F(null),Y=F(null),U=F(null),N=F(null),V=F(null),j=F(null),{value:G}=e,te=(n=e.defaultCalendarStartTime)!==null&&n!==void 0?n:Array.isArray(G)&&typeof G[0]=="number"?G[0]:Date.now(),se=F(te),oe=F((i=e.defaultCalendarEndTime)!==null&&i!==void 0?i:Array.isArray(G)&&typeof G[1]=="number"?G[1]:vt(Jn(te,1)));ot(!0);const Fe=F(Date.now()),K=F(!1),Z=F(0),J=W(()=>e.dateFormat||p.value.dateFormat),ae=W(()=>e.calendarDayFormat||p.value.dayFormat),Ie=F(Array.isArray(G)?un(G[0],J.value,D.dateFnsOptions.value):""),de=F(Array.isArray(G)?un(G[1],J.value,D.dateFnsOptions.value):""),Le=W(()=>K.value?"end":"start"),xe=W(()=>{var Ee;return Bu(se.value,e.value,Fe.value,(Ee=E.value)!==null&&Ee!==void 0?Ee:p.value.firstDayOfWeek)}),Qe=W(()=>{var Ee;return Bu(oe.value,e.value,Fe.value,(Ee=E.value)!==null&&Ee!==void 0?Ee:p.value.firstDayOfWeek)}),De=W(()=>xe.value.slice(0,7).map(Ee=>{const{ts:Ze}=Ee;return un(Ze,ae.value,D.dateFnsOptions.value)})),ne=W(()=>un(se.value,e.calendarHeaderMonthFormat||p.value.monthFormat,D.dateFnsOptions.value)),ue=W(()=>un(oe.value,e.calendarHeaderMonthFormat||p.value.monthFormat,D.dateFnsOptions.value)),he=W(()=>un(se.value,e.calendarHeaderYearFormat||p.value.yearFormat,D.dateFnsOptions.value)),Ae=W(()=>un(oe.value,e.calendarHeaderYearFormat||p.value.yearFormat,D.dateFnsOptions.value)),ce=W(()=>{const{value:Ee}=e;return Array.isArray(Ee)?Ee[0]:null}),Je=W(()=>{const{value:Ee}=e;return Array.isArray(Ee)?Ee[1]:null}),ye=W(()=>{const{shortcuts:Ee}=e;return Ee||y.value}),_e=W(()=>Uu(ro(e.value,"start"),Fe.value,{yearFormat:P.value},L)),Ce=W(()=>Uu(ro(e.value,"end"),Fe.value,{yearFormat:P.value},L)),Be=W(()=>{const Ee=ro(e.value,"start");return Nu(Ee??Date.now(),Ee,Fe.value,{quarterFormat:A.value})}),Se=W(()=>{const Ee=ro(e.value,"end");return Nu(Ee??Date.now(),Ee,Fe.value,{quarterFormat:A.value})}),R=W(()=>{const Ee=ro(e.value,"start");return Hu(Ee??Date.now(),Ee,Fe.value,{monthFormat:S.value})}),we=W(()=>{const Ee=ro(e.value,"end");return Hu(Ee??Date.now(),Ee,Fe.value,{monthFormat:S.value})}),ht=W(()=>{var Ee;return(Ee=e.calendarHeaderMonthBeforeYear)!==null&&Ee!==void 0?Ee:p.value.monthBeforeYear});wt(W(()=>e.value),Ee=>{if(Ee!==null&&Array.isArray(Ee)){const[Ze,mt]=Ee;Ie.value=un(Ze,J.value,D.dateFnsOptions.value),de.value=un(mt,J.value,D.dateFnsOptions.value),K.value||pe(Ee)}else Ie.value="",de.value=""});function Ne(Ee,Ze){(t==="daterange"||t==="datetimerange")&&(Tn(Ee)!==Tn(Ze)||Sn(Ee)!==Sn(Ze))&&D.disableTransitionOneTick()}wt(se,Ne),wt(oe,Ne);function ot(Ee){const Ze=Os(se.value),mt=Os(oe.value);(e.bindCalendarMonths||Ze>=mt)&&(Ee?oe.value=vt(Jn(Ze,1)):se.value=vt(Jn(mt,-1)))}function Rt(){se.value=vt(Jn(se.value,12)),ot(!0)}function at(){se.value=vt(Jn(se.value,-12)),ot(!0)}function gt(){se.value=vt(Jn(se.value,1)),ot(!0)}function re(){se.value=vt(Jn(se.value,-1)),ot(!0)}function me(){oe.value=vt(Jn(oe.value,12)),ot(!1)}function je(){oe.value=vt(Jn(oe.value,-12)),ot(!1)}function it(){oe.value=vt(Jn(oe.value,1)),ot(!1)}function dt(){oe.value=vt(Jn(oe.value,-1)),ot(!1)}function be(Ee){se.value=Ee,ot(!0)}function Ve(Ee){oe.value=Ee,ot(!1)}function Xe(Ee){const Ze=s.value;if(!Ze)return!1;if(!Array.isArray(e.value)||Le.value==="start")return Ze(Ee,"start",null);{const{value:mt}=Z;return Ee=Z.value?Yt(Z.value,Ee.ts,"wipPreview"):Yt(Ee.ts,Z.value,"wipPreview")}}function Te(){f.value||(D.doConfirm(),Ye())}function Ye(){K.value=!1,e.active&&D.doClose()}function ft(Ee){typeof Ee!="number"&&(Ee=vt(Ee)),e.value===null?D.doUpdateValue([Ee,Ee],e.panel):Array.isArray(e.value)&&D.doUpdateValue([Ee,Math.max(e.value[1],Ee)],e.panel)}function Dt(Ee){typeof Ee!="number"&&(Ee=vt(Ee)),e.value===null?D.doUpdateValue([Ee,Ee],e.panel):Array.isArray(e.value)&&D.doUpdateValue([Math.min(e.value[0],Ee),Ee],e.panel)}function Yt(Ee,Ze,mt){if(typeof Ee!="number"&&(Ee=vt(Ee)),mt!=="shortcutPreview"){let At,Zt;if(t==="datetimerange"){const{defaultTime:Kt}=e;Array.isArray(Kt)?(At=Nl(Kt[0]),Zt=Nl(Kt[1])):(At=Nl(Kt),Zt=At)}At&&(Ee=vt(Zn(Ee,At))),Zt&&(Ze=vt(Zn(Ze,Zt)))}D.doUpdateValue([Ee,Ze],e.panel&&mt==="done")}function jt(Ee){return vt(t==="datetimerange"?Wh(Ee):t==="monthrange"?Os(Ee):Lo(Ee))}function Xt(Ee){const Ze=ki(Ee,J.value,new Date,D.dateFnsOptions.value);if(ji(Ze))if(e.value){if(Array.isArray(e.value)){const mt=Zn(e.value[0],{year:Tn(Ze),month:Sn(Ze),date:Ki(Ze)});ft(jt(vt(mt)))}}else{const mt=Zn(new Date,{year:Tn(Ze),month:Sn(Ze),date:Ki(Ze)});ft(jt(vt(mt)))}else Ie.value=Ee}function Ln(Ee){const Ze=ki(Ee,J.value,new Date,D.dateFnsOptions.value);if(ji(Ze)){if(e.value===null){const mt=Zn(new Date,{year:Tn(Ze),month:Sn(Ze),date:Ki(Ze)});Dt(jt(vt(mt)))}else if(Array.isArray(e.value)){const mt=Zn(e.value[1],{year:Tn(Ze),month:Sn(Ze),date:Ki(Ze)});Dt(jt(vt(mt)))}}else de.value=Ee}function On(){const Ee=ki(Ie.value,J.value,new Date,D.dateFnsOptions.value),{value:Ze}=e;if(ji(Ee)){if(Ze===null){const mt=Zn(new Date,{year:Tn(Ee),month:Sn(Ee),date:Ki(Ee)});ft(jt(vt(mt)))}else if(Array.isArray(Ze)){const mt=Zn(Ze[0],{year:Tn(Ee),month:Sn(Ee),date:Ki(Ee)});ft(jt(vt(mt)))}}else on()}function rn(){const Ee=ki(de.value,J.value,new Date,D.dateFnsOptions.value),{value:Ze}=e;if(ji(Ee)){if(Ze===null){const mt=Zn(new Date,{year:Tn(Ee),month:Sn(Ee),date:Ki(Ee)});Dt(jt(vt(mt)))}else if(Array.isArray(Ze)){const mt=Zn(Ze[1],{year:Tn(Ee),month:Sn(Ee),date:Ki(Ee)});Dt(jt(vt(mt)))}}else on()}function on(Ee){const{value:Ze}=e;if(Ze===null||!Array.isArray(Ze)){Ie.value="",de.value="";return}Ee===void 0&&(Ee=Ze),Ie.value=un(Ee[0],J.value,D.dateFnsOptions.value),de.value=un(Ee[1],J.value,D.dateFnsOptions.value)}function Cn(Ee){Ee!==null&&ft(Ee)}function mn(Ee){Ee!==null&&Dt(Ee)}function Ut(Ee){D.cachePendingValue();const Ze=D.getShortcutValue(Ee);Array.isArray(Ze)&&Yt(Ze[0],Ze[1],"shortcutPreview")}function nn(Ee){const Ze=D.getShortcutValue(Ee);Array.isArray(Ze)&&(Yt(Ze[0],Ze[1],"done"),D.clearPendingValue(),Te())}function Ft(Ee,Ze){const mt=Ee===void 0?e.value:Ee;if(Ee===void 0||Ze==="start"){if(V.value){const At=Array.isArray(mt)?Sn(mt[0]):Sn(Date.now());V.value.scrollTo({debounce:!1,index:At,elSize:jr})}if(U.value){const At=(Array.isArray(mt)?Tn(mt[0]):Tn(Date.now()))-L.value[0];U.value.scrollTo({index:At,debounce:!1})}}if(Ee===void 0||Ze==="end"){if(j.value){const At=Array.isArray(mt)?Sn(mt[1]):Sn(Date.now());j.value.scrollTo({debounce:!1,index:At,elSize:jr})}if(N.value){const At=(Array.isArray(mt)?Tn(mt[1]):Tn(Date.now()))-L.value[0];N.value.scrollTo({index:At,debounce:!1})}}}function an(Ee,Ze){const{value:mt}=e,At=!Array.isArray(mt),Zt=Ee.type==="year"&&t!=="yearrange"?At?Zn(Ee.ts,{month:Sn(t==="quarterrange"?$a(new Date):new Date)}).valueOf():Zn(Ee.ts,{month:Sn(t==="quarterrange"?$a(mt[Ze==="start"?0:1]):mt[Ze==="start"?0:1])}).valueOf():Ee.ts;if(At){const Yn=jt(Zt),_n=[Yn,Yn];D.doUpdateValue(_n,e.panel),Ft(_n,"start"),Ft(_n,"end"),D.disableTransitionOneTick();return}const Kt=[mt[0],mt[1]];let Hn=!1;switch(Ze==="start"?(Kt[0]=jt(Zt),Kt[0]>Kt[1]&&(Kt[1]=Kt[0],Hn=!0)):(Kt[1]=jt(Zt),Kt[0]>Kt[1]&&(Kt[0]=Kt[1],Hn=!0)),D.doUpdateValue(Kt,e.panel),t){case"monthrange":case"quarterrange":D.disableTransitionOneTick(),Hn?(Ft(Kt,"start"),Ft(Kt,"end")):Ft(Kt,Ze);break;case"yearrange":D.disableTransitionOneTick(),Ft(Kt,"start"),Ft(Kt,"end")}}function ln(){var Ee;(Ee=z.value)===null||Ee===void 0||Ee.sync()}function bi(){var Ee;(Ee=Y.value)===null||Ee===void 0||Ee.sync()}function hi(Ee){var Ze,mt;return Ee==="start"?((Ze=U.value)===null||Ze===void 0?void 0:Ze.listElRef)||null:((mt=N.value)===null||mt===void 0?void 0:mt.listElRef)||null}function fi(Ee){var Ze,mt;return Ee==="start"?((Ze=U.value)===null||Ze===void 0?void 0:Ze.itemsElRef)||null:((mt=N.value)===null||mt===void 0?void 0:mt.itemsElRef)||null}const ei={startYearVlRef:U,endYearVlRef:N,startMonthScrollbarRef:V,endMonthScrollbarRef:j,startYearScrollbarRef:z,endYearScrollbarRef:Y};return Object.assign(Object.assign(Object.assign(Object.assign({startDatesElRef:M,endDatesElRef:B,handleDateClick:Ge,handleColItemClick:an,handleDateMouseEnter:_t,handleConfirmClick:Te,startCalendarPrevYear:at,startCalendarPrevMonth:re,startCalendarNextYear:Rt,startCalendarNextMonth:gt,endCalendarPrevYear:je,endCalendarPrevMonth:dt,endCalendarNextMonth:it,endCalendarNextYear:me,mergedIsDateDisabled:Xe,changeStartEndTime:Yt,ranges:y,calendarMonthBeforeYear:ht,startCalendarMonth:ne,startCalendarYear:he,endCalendarMonth:ue,endCalendarYear:Ae,weekdays:De,startDateArray:xe,endDateArray:Qe,startYearArray:_e,startMonthArray:R,startQuarterArray:Be,endYearArray:Ce,endMonthArray:we,endQuarterArray:Se,isSelecting:K,handleRangeShortcutMouseenter:Ut,handleRangeShortcutClick:nn},D),x),ei),{startDateDisplayString:Ie,endDateInput:de,timePickerSize:D.timePickerSize,startTimeValue:ce,endTimeValue:Je,datePickerSlots:I,shortcuts:ye,startCalendarDateTime:se,endCalendarDateTime:oe,justifyColumnsScrollState:Ft,handleFocusDetectorFocus:D.handleFocusDetectorFocus,handleStartTimePickerChange:Cn,handleEndTimePickerChange:mn,handleStartDateInput:Xt,handleStartDateInputBlur:On,handleEndDateInput:Ln,handleEndDateInputBlur:rn,handleStartYearVlScroll:ln,handleEndYearVlScroll:bi,virtualListContainer:hi,virtualListContent:fi,onUpdateStartCalendarValue:be,onUpdateEndCalendarValue:Ve})}const T3=$e({name:"DateRangePanel",props:Qh,setup(e){return ef(e,"daterange")},render(){var e,t,n;const{mergedClsPrefix:i,mergedTheme:s,shortcuts:a,onRender:d,$slots:r}=this;return d==null||d(),H("div",{ref:"selfRef",tabindex:0,class:[`${i}-date-panel`,`${i}-date-panel--daterange`,!this.panel&&`${i}-date-panel--shadow`,this.themeClass],onKeydown:this.handlePanelKeyDown,onFocus:this.handlePanelFocus},H("div",{ref:"startDatesElRef",class:`${i}-date-panel-calendar ${i}-date-panel-calendar--start`},H("div",{class:`${i}-date-panel-month`},H("div",{class:`${i}-date-panel-month__fast-prev`,onClick:this.startCalendarPrevYear},Jt(r["prev-year"],()=>[H(vr,null)])),H("div",{class:`${i}-date-panel-month__prev`,onClick:this.startCalendarPrevMonth},Jt(r["prev-month"],()=>[H(pr,null)])),H(Do,{monthYearSeparator:this.calendarHeaderMonthYearSeparator,monthBeforeYear:this.calendarMonthBeforeYear,value:this.startCalendarDateTime,onUpdateValue:this.onUpdateStartCalendarValue,mergedClsPrefix:i,calendarMonth:this.startCalendarMonth,calendarYear:this.startCalendarYear}),H("div",{class:`${i}-date-panel-month__next`,onClick:this.startCalendarNextMonth},Jt(r["next-month"],()=>[H(mr,null)])),H("div",{class:`${i}-date-panel-month__fast-next`,onClick:this.startCalendarNextYear},Jt(r["next-year"],()=>[H(gr,null)]))),H("div",{class:`${i}-date-panel-weekdays`},this.weekdays.map(o=>H("div",{key:o,class:`${i}-date-panel-weekdays__day`},o))),H("div",{class:`${i}-date-panel__divider`}),H("div",{class:`${i}-date-panel-dates`},this.startDateArray.map((o,c)=>H("div",{"data-n-date":!0,key:c,class:[`${i}-date-panel-date`,{[`${i}-date-panel-date--excluded`]:!o.inCurrentMonth,[`${i}-date-panel-date--current`]:o.isCurrentDate,[`${i}-date-panel-date--selected`]:o.selected,[`${i}-date-panel-date--covered`]:o.inSpan,[`${i}-date-panel-date--start`]:o.startOfSpan,[`${i}-date-panel-date--end`]:o.endOfSpan,[`${i}-date-panel-date--disabled`]:this.mergedIsDateDisabled(o.ts)}],onClick:()=>{this.handleDateClick(o)},onMouseenter:()=>{this.handleDateMouseEnter(o)}},H("div",{class:`${i}-date-panel-date__trigger`}),o.dateObject.date,o.isCurrentDate?H("div",{class:`${i}-date-panel-date__sup`}):null)))),H("div",{class:`${i}-date-panel__vertical-divider`}),H("div",{ref:"endDatesElRef",class:`${i}-date-panel-calendar ${i}-date-panel-calendar--end`},H("div",{class:`${i}-date-panel-month`},H("div",{class:`${i}-date-panel-month__fast-prev`,onClick:this.endCalendarPrevYear},Jt(r["prev-year"],()=>[H(vr,null)])),H("div",{class:`${i}-date-panel-month__prev`,onClick:this.endCalendarPrevMonth},Jt(r["prev-month"],()=>[H(pr,null)])),H(Do,{monthYearSeparator:this.calendarHeaderMonthYearSeparator,monthBeforeYear:this.calendarMonthBeforeYear,value:this.endCalendarDateTime,onUpdateValue:this.onUpdateEndCalendarValue,mergedClsPrefix:i,calendarMonth:this.endCalendarMonth,calendarYear:this.endCalendarYear}),H("div",{class:`${i}-date-panel-month__next`,onClick:this.endCalendarNextMonth},Jt(r["next-month"],()=>[H(mr,null)])),H("div",{class:`${i}-date-panel-month__fast-next`,onClick:this.endCalendarNextYear},Jt(r["next-year"],()=>[H(gr,null)]))),H("div",{class:`${i}-date-panel-weekdays`},this.weekdays.map(o=>H("div",{key:o,class:`${i}-date-panel-weekdays__day`},o))),H("div",{class:`${i}-date-panel__divider`}),H("div",{class:`${i}-date-panel-dates`},this.endDateArray.map((o,c)=>H("div",{"data-n-date":!0,key:c,class:[`${i}-date-panel-date`,{[`${i}-date-panel-date--excluded`]:!o.inCurrentMonth,[`${i}-date-panel-date--current`]:o.isCurrentDate,[`${i}-date-panel-date--selected`]:o.selected,[`${i}-date-panel-date--covered`]:o.inSpan,[`${i}-date-panel-date--start`]:o.startOfSpan,[`${i}-date-panel-date--end`]:o.endOfSpan,[`${i}-date-panel-date--disabled`]:this.mergedIsDateDisabled(o.ts)}],onClick:()=>{this.handleDateClick(o)},onMouseenter:()=>{this.handleDateMouseEnter(o)}},H("div",{class:`${i}-date-panel-date__trigger`}),o.dateObject.date,o.isCurrentDate?H("div",{class:`${i}-date-panel-date__sup`}):null)))),this.datePickerSlots.footer?H("div",{class:`${i}-date-panel-footer`},this.datePickerSlots.footer()):null,!((e=this.actions)===null||e===void 0)&&e.length||a?H("div",{class:`${i}-date-panel-actions`},H("div",{class:`${i}-date-panel-actions__prefix`},a&&Object.keys(a).map(o=>{const c=a[o];return Array.isArray(c)||typeof c=="function"?H(xs,{size:"tiny",onMouseenter:()=>{this.handleRangeShortcutMouseenter(c)},onClick:()=>{this.handleRangeShortcutClick(c)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>o}):null})),H("div",{class:`${i}-date-panel-actions__suffix`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?Ri(r.clear,{onClear:this.handleClearClick,text:this.locale.clear},()=>[H(yn,{theme:s.peers.Button,themeOverrides:s.peerOverrides.Button,size:"tiny",onClick:this.handleClearClick},{default:()=>this.locale.clear})]):null,!((n=this.actions)===null||n===void 0)&&n.includes("confirm")?Ri(r.confirm,{onConfirm:this.handleConfirmClick,disabled:this.isRangeInvalid||this.isSelecting,text:this.locale.confirm},()=>[H(yn,{theme:s.peers.Button,themeOverrides:s.peerOverrides.Button,size:"tiny",type:"primary",disabled:this.isRangeInvalid||this.isSelecting,onClick:this.handleConfirmClick},{default:()=>this.locale.confirm})]):null)):null,H(yr,{onFocus:this.handleFocusDetectorFocus}))}});function Zv(e,t,n){const i=ky(),s=L3(e,n.timeZone,n.locale??i.locale);return"formatToParts"in s?E3(s,t):P3(s,t)}function E3(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function P3(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function L3(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function D3(e,t){const n=O3(t);return"formatToParts"in n?M3(n,e):A3(n,e)}const I3={year:0,month:1,day:2,hour:3,minute:4,second:5};function M3(e,t){try{const n=e.formatToParts(t),i=[];for(let s=0;s=0?a:1e3+a,i-s}function H3(e,t,n){let s=e.getTime()-t;const a=Wu(new Date(s),n);if(t===a)return t;s-=a-t;const d=Wu(new Date(s),n);return a===d?a:Math.max(a,d)}function tg(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const ng={};function N3(e){if(ng[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),ng[e]=!0,!0}catch{return!1}}const U3=60*1e3,z3={X:function(e,t,n){const i=Nd(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return ig(i);case"XXXX":case"XX":return lo(i);case"XXXXX":case"XXX":default:return lo(i,":")}},x:function(e,t,n){const i=Nd(n.timeZone,e);switch(t){case"x":return ig(i);case"xxxx":case"xx":return lo(i);case"xxxxx":case"xxx":default:return lo(i,":")}},O:function(e,t,n){const i=Nd(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+V3(i,":");case"OOOO":default:return"GMT"+lo(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Zv("short",e,n);case"zzzz":default:return Zv("long",e,n)}}};function Nd(e,t){const n=e?tf(e,t,!0)/U3:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function vc(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length0?"-":"+",i=Math.abs(e),s=vc(Math.floor(i/60),2),a=vc(Math.floor(i%60),2);return n+s+t+a}function ig(e,t){return e%60===0?(e>0?"-":"+")+vc(Math.abs(e)/60,2):lo(e,t)}function V3(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.floor(i/60),a=i%60;return a===0?n+String(s):n+String(s)+t+vc(a,2)}function sg(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const K3=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ud=36e5,rg=6e4,W3=2,_i={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:K3};function sb(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?W3:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=j3(e),{year:s,restDateString:a}=q3(i.date,n),d=Y3(a,s);if(d===null||isNaN(d.getTime()))return new Date(NaN);if(d){const r=d.getTime();let o=0,c;if(i.time&&(o=G3(i.time),o===null||isNaN(o)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=tf(i.timeZone||t.timeZone,new Date(r+o)),isNaN(c))return new Date(NaN)}else c=sg(new Date(r+o)),c=sg(new Date(r+o+c));return new Date(r+o+c)}else return new Date(NaN)}function j3(e){const t={};let n=_i.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=_i.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const s=_i.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function q3(e,t){if(e){const n=_i.YYY[t],i=_i.YYYYY[t];let s=_i.YYYY.exec(e)||i.exec(e);if(s){const a=s[1];return{year:parseInt(a,10),restDateString:e.slice(a.length)}}if(s=_i.YY.exec(e)||n.exec(e),s){const a=s[1];return{year:parseInt(a,10)*100,restDateString:e.slice(a.length)}}}return{year:null}}function Y3(e,t){if(t===null)return null;let n,i,s;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let a=_i.MM.exec(e);if(a)return n=new Date(0),i=parseInt(a[1],10)-1,ag(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(a=_i.DDD.exec(e),a){n=new Date(0);const d=parseInt(a[1],10);return Z3(t,d)?(n.setUTCFullYear(t,0,d),n):new Date(NaN)}if(a=_i.MMDD.exec(e),a){n=new Date(0),i=parseInt(a[1],10)-1;const d=parseInt(a[2],10);return ag(t,i,d)?(n.setUTCFullYear(t,i,d),n):new Date(NaN)}if(a=_i.Www.exec(e),a)return s=parseInt(a[1],10)-1,lg(s)?og(t,s):new Date(NaN);if(a=_i.WwwD.exec(e),a){s=parseInt(a[1],10)-1;const d=parseInt(a[2],10)-1;return lg(s,d)?og(t,s,d):new Date(NaN)}return null}function G3(e){let t,n,i=_i.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),zd(t)?t%24*Ud:NaN;if(i=_i.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),zd(t,n)?t%24*Ud+n*rg:NaN;if(i=_i.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return zd(t,n,s)?t%24*Ud+n*rg+s*1e3:NaN}return null}function og(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const s=i.getUTCDay()||7,a=t*7+n+1-s;return i.setUTCDate(i.getUTCDate()+a),i}const X3=[31,28,31,30,31,30,31,31,30,31,30,31],J3=[31,29,31,30,31,30,31,31,30,31,30,31];function rb(e){return e%400===0||e%4===0&&e%100!==0}function ag(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=rb(e);if(i&&n>J3[t]||!i&&n>X3[t])return!1}return!0}function Z3(e,t){if(t<1)return!1;const n=rb(e);return!(n&&t>366||!n&&t>365)}function lg(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function zd(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const Q3=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function e$(e,t,n={}){t=String(t);const i=t.match(Q3);if(i){const s=sb(n.originalDate||e,n);t=i.reduce(function(a,d){if(d[0]==="'")return a;const r=a.indexOf(d),o=a[r-1]==="'",c=a.replace(d,"'"+z3[d[0]](s,d,n)+"'");return o?c.substring(0,r-1)+c.substring(r+1):c},t)}return un(e,t,n)}function t$(e,t,n){e=sb(e,n);const i=tf(t,e,!0),s=new Date(e.getTime()-i),a=new Date(0);return a.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),a.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),a}function n$(e,t,n,i){return i={...i,timeZone:t,originalDate:e},e$(t$(e,t,{timeZone:i.timeZone}),n,i)}const ob=ui("n-time-picker"),Sl=$e({name:"TimePickerPanelCol",props:{clsPrefix:{type:String,required:!0},data:{type:Array,required:!0},activeValue:{type:[Number,String],default:null},onItemClick:Function},render(){const{activeValue:e,onItemClick:t,clsPrefix:n}=this;return this.data.map(i=>{const{label:s,disabled:a,value:d}=i,r=e===d;return H("div",{key:s,"data-active":r?"":null,class:[`${n}-time-picker-col__item`,r&&`${n}-time-picker-col__item--active`,a&&`${n}-time-picker-col__item--disabled`],onClick:t&&!a?()=>{t(d)}:void 0},s)})}}),ga={amHours:["00","01","02","03","04","05","06","07","08","09","10","11"],pmHours:["12","01","02","03","04","05","06","07","08","09","10","11"],hours:["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"],minutes:["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"],seconds:["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"],period:["AM","PM"]};function Vd(e){return`00${e}`.slice(-2)}function ma(e,t,n){return Array.isArray(t)?(n==="am"?t.filter(i=>i<12):n==="pm"?t.filter(i=>i>=12).map(i=>i===12?12:i-12):t).map(i=>Vd(i)):typeof t=="number"?n==="am"?e.filter(i=>{const s=Number(i);return s<12&&s%t===0}):n==="pm"?e.filter(i=>{const s=Number(i);return s>=12&&s%t===0}).map(i=>{const s=Number(i);return Vd(s===12?12:s-12)}):e.filter(i=>Number(i)%t===0):n==="am"?e.filter(i=>Number(i)<12):n==="pm"?e.map(i=>Number(i)).filter(i=>Number(i)>=12).map(i=>Vd(i===12?12:i-12)):e}function Cl(e,t,n){return n?typeof n=="number"?e%n===0:n.includes(e):!0}function i$(e,t,n){const i=ma(ga[t],n).map(Number);let s,a;for(let d=0;de){a=r;break}s=r}return s===void 0?(a||nm("time-picker","Please set 'hours' or 'minutes' or 'seconds' props"),a):a===void 0||a-e>e-s?s:a}function s$(e){return or(e)<12?"am":"pm"}const r$={actions:{type:Array,default:()=>["now","confirm"]},showHour:{type:Boolean,default:!0},showMinute:{type:Boolean,default:!0},showSecond:{type:Boolean,default:!0},showPeriod:{type:Boolean,default:!0},isHourInvalid:Boolean,isMinuteInvalid:Boolean,isSecondInvalid:Boolean,isAmPmInvalid:Boolean,isValueInvalid:Boolean,hourValue:{type:Number,default:null},minuteValue:{type:Number,default:null},secondValue:{type:Number,default:null},amPmValue:{type:String,default:null},isHourDisabled:Function,isMinuteDisabled:Function,isSecondDisabled:Function,onHourClick:{type:Function,required:!0},onMinuteClick:{type:Function,required:!0},onSecondClick:{type:Function,required:!0},onAmPmClick:{type:Function,required:!0},onNowClick:Function,clearText:String,nowText:String,confirmText:String,transitionDisabled:Boolean,onClearClick:Function,onConfirmClick:Function,onFocusin:Function,onFocusout:Function,onFocusDetectorFocus:Function,onKeydown:Function,hours:[Number,Array],minutes:[Number,Array],seconds:[Number,Array],use12Hours:Boolean},o$=$e({name:"TimePickerPanel",props:r$,setup(e){const{mergedThemeRef:t,mergedClsPrefixRef:n}=zt(ob),i=W(()=>{const{isHourDisabled:r,hours:o,use12Hours:c,amPmValue:h}=e;if(c){const u=h??s$(Date.now());return ma(ga.hours,o,u).map(v=>{const m=Number(v),b=u==="pm"&&m!==12?m+12:m;return{label:v,value:b,disabled:r?r(b):!1}})}else return ma(ga.hours,o).map(u=>({label:u,value:Number(u),disabled:r?r(Number(u)):!1}))}),s=W(()=>{const{isMinuteDisabled:r,minutes:o}=e;return ma(ga.minutes,o).map(c=>({label:c,value:Number(c),disabled:r?r(Number(c),e.hourValue):!1}))}),a=W(()=>{const{isSecondDisabled:r,seconds:o}=e;return ma(ga.seconds,o).map(c=>({label:c,value:Number(c),disabled:r?r(Number(c),e.minuteValue,e.hourValue):!1}))}),d=W(()=>{const{isHourDisabled:r}=e;let o=!0,c=!0;for(let h=0;h<12;++h)if(!(r!=null&&r(h))){o=!1;break}for(let h=12;h<24;++h)if(!(r!=null&&r(h))){c=!1;break}return[{label:"AM",value:"am",disabled:o},{label:"PM",value:"pm",disabled:c}]});return{mergedTheme:t,mergedClsPrefix:n,hours:i,minutes:s,seconds:a,amPm:d,hourScrollRef:F(null),minuteScrollRef:F(null),secondScrollRef:F(null),amPmScrollRef:F(null)}},render(){var e,t,n,i;const{mergedClsPrefix:s,mergedTheme:a}=this;return H("div",{tabindex:0,class:`${s}-time-picker-panel`,onFocusin:this.onFocusin,onFocusout:this.onFocusout,onKeydown:this.onKeydown},H("div",{class:`${s}-time-picker-cols`},this.showHour?H("div",{class:[`${s}-time-picker-col`,this.isHourInvalid&&`${s}-time-picker-col--invalid`,this.transitionDisabled&&`${s}-time-picker-col--transition-disabled`]},H($i,{ref:"hourScrollRef",theme:a.peers.Scrollbar,themeOverrides:a.peerOverrides.Scrollbar},{default:()=>[H(Sl,{clsPrefix:s,data:this.hours,activeValue:this.hourValue,onItemClick:this.onHourClick}),H("div",{class:`${s}-time-picker-col__padding`})]})):null,this.showMinute?H("div",{class:[`${s}-time-picker-col`,this.transitionDisabled&&`${s}-time-picker-col--transition-disabled`,this.isMinuteInvalid&&`${s}-time-picker-col--invalid`]},H($i,{ref:"minuteScrollRef",theme:a.peers.Scrollbar,themeOverrides:a.peerOverrides.Scrollbar},{default:()=>[H(Sl,{clsPrefix:s,data:this.minutes,activeValue:this.minuteValue,onItemClick:this.onMinuteClick}),H("div",{class:`${s}-time-picker-col__padding`})]})):null,this.showSecond?H("div",{class:[`${s}-time-picker-col`,this.isSecondInvalid&&`${s}-time-picker-col--invalid`,this.transitionDisabled&&`${s}-time-picker-col--transition-disabled`]},H($i,{ref:"secondScrollRef",theme:a.peers.Scrollbar,themeOverrides:a.peerOverrides.Scrollbar},{default:()=>[H(Sl,{clsPrefix:s,data:this.seconds,activeValue:this.secondValue,onItemClick:this.onSecondClick}),H("div",{class:`${s}-time-picker-col__padding`})]})):null,this.use12Hours?H("div",{class:[`${s}-time-picker-col`,this.isAmPmInvalid&&`${s}-time-picker-col--invalid`,this.transitionDisabled&&`${s}-time-picker-col--transition-disabled`]},H($i,{ref:"amPmScrollRef",theme:a.peers.Scrollbar,themeOverrides:a.peerOverrides.Scrollbar},{default:()=>[H(Sl,{clsPrefix:s,data:this.amPm,activeValue:this.amPmValue,onItemClick:this.onAmPmClick}),H("div",{class:`${s}-time-picker-col__padding`})]})):null),!((e=this.actions)===null||e===void 0)&&e.length?H("div",{class:`${s}-time-picker-actions`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?H(yn,{theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,size:"tiny",onClick:this.onClearClick},{default:()=>this.clearText}):null,!((n=this.actions)===null||n===void 0)&&n.includes("now")?H(yn,{size:"tiny",theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,onClick:this.onNowClick},{default:()=>this.nowText}):null,!((i=this.actions)===null||i===void 0)&&i.includes("confirm")?H(yn,{size:"tiny",type:"primary",class:`${s}-time-picker-actions__confirm`,theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,disabled:this.isValueInvalid,onClick:this.onConfirmClick},{default:()=>this.confirmText}):null):null,H(yr,{onFocus:this.onFocusDetectorFocus}))}}),a$=Ke([Re("time-picker",` + z-index: auto; + position: relative; + `,[Re("time-picker-icon",` + color: var(--n-icon-color-override); + transition: color .3s var(--n-bezier); + `),We("disabled",[Re("time-picker-icon",` + color: var(--n-icon-color-disabled-override); + `)])]),Re("time-picker-panel",` + transition: + box-shadow .3s var(--n-bezier), + background-color .3s var(--n-bezier); + outline: none; + font-size: var(--n-item-font-size); + border-radius: var(--n-border-radius); + margin: 4px 0; + min-width: 104px; + overflow: hidden; + background-color: var(--n-panel-color); + box-shadow: var(--n-panel-box-shadow); + `,[Vo(),Re("time-picker-actions",` + padding: var(--n-panel-action-padding); + align-items: center; + display: flex; + justify-content: space-evenly; + `),Re("time-picker-cols",` + height: calc(var(--n-item-height) * 6); + display: flex; + position: relative; + transition: border-color .3s var(--n-bezier); + border-bottom: 1px solid var(--n-panel-divider-color); + `),Re("time-picker-col",` + flex-grow: 1; + min-width: var(--n-item-width); + height: calc(var(--n-item-height) * 6); + flex-direction: column; + transition: box-shadow .3s var(--n-bezier); + `,[We("transition-disabled",[tt("item","transition: none;",[Ke("&::before","transition: none;")])]),tt("padding",` + height: calc(var(--n-item-height) * 5); + `),Ke("&:first-child","min-width: calc(var(--n-item-width) + 4px);",[tt("item",[Ke("&::before","left: 4px;")])]),tt("item",` + cursor: pointer; + height: var(--n-item-height); + display: flex; + align-items: center; + justify-content: center; + transition: + color .3s var(--n-bezier), + background-color .3s var(--n-bezier), + opacity .3s var(--n-bezier), + text-decoration-color .3s var(--n-bezier); + background: #0000; + text-decoration-color: #0000; + color: var(--n-item-text-color); + z-index: 0; + box-sizing: border-box; + padding-top: 4px; + position: relative; + `,[Ke("&::before",` + content: ""; + transition: background-color .3s var(--n-bezier); + z-index: -1; + position: absolute; + left: 0; + right: 4px; + top: 4px; + bottom: 0; + border-radius: var(--n-item-border-radius); + `),xn("disabled",[Ke("&:hover::before",` + background-color: var(--n-item-color-hover); + `)]),We("active",` + color: var(--n-item-text-color-active); + `,[Ke("&::before",` + background-color: var(--n-item-color-hover); + `)]),We("disabled",` + opacity: var(--n-item-opacity-disabled); + cursor: not-allowed; + `)]),We("invalid",[tt("item",[We("active",` + text-decoration: line-through; + text-decoration-color: var(--n-item-text-color-active); + `)])])])])]);function Kd(e,t){return e===void 0?!0:Array.isArray(e)?e.every(n=>n>=0&&n<=t):e>=0&&e<=t}const l$=Object.assign(Object.assign({},Ht.props),{to:di.propTo,bordered:{type:Boolean,default:void 0},actions:Array,defaultValue:{type:Number,default:null},defaultFormattedValue:String,placeholder:String,placement:{type:String,default:"bottom-start"},value:Number,format:{type:String,default:"HH:mm:ss"},valueFormat:String,formattedValue:String,isHourDisabled:Function,size:String,isMinuteDisabled:Function,isSecondDisabled:Function,inputReadonly:Boolean,clearable:Boolean,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onUpdateFormattedValue:[Function,Array],"onUpdate:formattedValue":[Function,Array],onBlur:[Function,Array],onConfirm:[Function,Array],onClear:Function,onFocus:[Function,Array],timeZone:String,showIcon:{type:Boolean,default:!0},disabled:{type:Boolean,default:void 0},show:{type:Boolean,default:void 0},hours:{type:[Number,Array],validator:e=>Kd(e,23)},minutes:{type:[Number,Array],validator:e=>Kd(e,59)},seconds:{type:[Number,Array],validator:e=>Kd(e,59)},use12Hours:Boolean,stateful:{type:Boolean,default:!0},onChange:[Function,Array]}),ju=$e({name:"TimePicker",props:l$,setup(e){const{mergedBorderedRef:t,mergedClsPrefixRef:n,namespaceRef:i,inlineThemeDisabled:s}=bn(e),{localeRef:a,dateLocaleRef:d}=rs("TimePicker"),r=_r(e),{mergedSizeRef:o,mergedDisabledRef:c,mergedStatusRef:h}=r,u=Ht("TimePicker","-time-picker",a$,iw,e,n),v=Ah(),m=F(null),b=F(null),g=W(()=>({locale:d.value.locale}));function l(Te){return Te===null?null:ki(Te,e.valueFormat||e.format,new Date,g.value).getTime()}const{defaultValue:f,defaultFormattedValue:p}=e,y=F(p!==void 0?l(p):f),C=W(()=>{const{formattedValue:Te}=e;if(Te!==void 0)return l(Te);const{value:Ye}=e;return Ye!==void 0?Ye:y.value}),k=W(()=>{const{timeZone:Te}=e;return Te?(Ye,ft,Dt)=>n$(Ye,Te,ft,Dt):(Ye,ft,Dt)=>un(Ye,ft,Dt)}),E=F("");wt(()=>e.timeZone,()=>{const Te=C.value;E.value=Te===null?"":k.value(Te,e.format,g.value)},{immediate:!0});const I=F(!1),S=ut(e,"show"),P=Qn(S,I),A=F(C.value),L=F(!1),x=W(()=>a.value.clear),D=W(()=>a.value.now),M=W(()=>e.placeholder!==void 0?e.placeholder:a.value.placeholder),B=W(()=>a.value.negativeText),z=W(()=>a.value.positiveText),Y=W(()=>/H|h|K|k/.test(e.format)),U=W(()=>e.format.includes("m")),N=W(()=>e.format.includes("s")),V=W(()=>{const{value:Te}=C;return Te===null?null:Number(k.value(Te,"HH",g.value))}),j=W(()=>{const{value:Te}=C;return Te===null?null:Number(k.value(Te,"mm",g.value))}),G=W(()=>{const{value:Te}=C;return Te===null?null:Number(k.value(Te,"ss",g.value))}),te=W(()=>{const{isHourDisabled:Te}=e;return V.value===null?!1:Cl(V.value,"hours",e.hours)?Te?Te(V.value):!1:!0}),se=W(()=>{const{value:Te}=j,{value:Ye}=V;if(Te===null||Ye===null)return!1;if(!Cl(Te,"minutes",e.minutes))return!0;const{isMinuteDisabled:ft}=e;return ft?ft(Te,Ye):!1}),oe=W(()=>{const{value:Te}=j,{value:Ye}=V,{value:ft}=G;if(ft===null||Te===null||Ye===null)return!1;if(!Cl(ft,"seconds",e.seconds))return!0;const{isSecondDisabled:Dt}=e;return Dt?Dt(ft,Te,Ye):!1}),Fe=W(()=>te.value||se.value||oe.value),K=W(()=>e.format.length+4),Z=W(()=>{const{value:Te}=C;return Te===null?null:or(Te)<12?"am":"pm"});function J(Te,Ye){const{onUpdateFormattedValue:ft,"onUpdate:formattedValue":Dt}=e;ft&&rt(ft,Te,Ye),Dt&&rt(Dt,Te,Ye)}function ae(Te){return Te===null?null:k.value(Te,e.valueFormat||e.format)}function Ie(Te){const{onUpdateValue:Ye,"onUpdate:value":ft,onChange:Dt}=e,{nTriggerFormChange:Yt,nTriggerFormInput:jt}=r,Xt=ae(Te);Ye&&rt(Ye,Te,Xt),ft&&rt(ft,Te,Xt),Dt&&rt(Dt,Te,Xt),J(Xt,Te),y.value=Te,Yt(),jt()}function de(Te){const{onFocus:Ye}=e,{nTriggerFormFocus:ft}=r;Ye&&rt(Ye,Te),ft()}function Le(Te){const{onBlur:Ye}=e,{nTriggerFormBlur:ft}=r;Ye&&rt(Ye,Te),ft()}function xe(){const{onConfirm:Te}=e;Te&&rt(Te,C.value,ae(C.value))}function Qe(Te){var Ye;Te.stopPropagation(),Ie(null),Be(null),(Ye=e.onClear)===null||Ye===void 0||Ye.call(e)}function De(){re({returnFocus:!0})}function ne(){Ie(null),Be(null),re({returnFocus:!0})}function ue(Te){Te.key==="Escape"&&P.value&&Aa(Te)}function he(Te){var Ye;switch(Te.key){case"Escape":P.value&&(Aa(Te),re({returnFocus:!0}));break;case"Tab":v.shift&&Te.target===((Ye=b.value)===null||Ye===void 0?void 0:Ye.$el)&&(Te.preventDefault(),re({returnFocus:!0}));break}}function Ae(){L.value=!0,hn(()=>{L.value=!1})}function ce(Te){c.value||Ti(Te,"clear")||P.value||at()}function Je(Te){typeof Te!="string"&&(C.value===null?Ie(vt(Dr(WM(new Date),Te))):Ie(vt(Dr(C.value,Te))))}function ye(Te){typeof Te!="string"&&(C.value===null?Ie(vt(Id(II(new Date),Te))):Ie(vt(Id(C.value,Te))))}function _e(Te){typeof Te!="string"&&(C.value===null?Ie(vt(Md(Wh(new Date),Te))):Ie(vt(Md(C.value,Te))))}function Ce(Te){const{value:Ye}=C;if(Ye===null){const ft=new Date,Dt=or(ft);Te==="pm"&&Dt<12?Ie(vt(Dr(ft,Dt+12))):Te==="am"&&Dt>=12&&Ie(vt(Dr(ft,Dt-12))),Ie(vt(ft))}else{const ft=or(Ye);Te==="pm"&&ft<12?Ie(vt(Dr(Ye,ft+12))):Te==="am"&&ft>=12&&Ie(vt(Dr(Ye,ft-12)))}}function Be(Te){Te===void 0&&(Te=C.value),Te===null?E.value="":E.value=k.value(Te,e.format,g.value)}function Se(Te){Rt(Te)||de(Te)}function R(Te){var Ye;if(!Rt(Te))if(P.value){const ft=(Ye=b.value)===null||Ye===void 0?void 0:Ye.$el;ft!=null&&ft.contains(Te.relatedTarget)||(Be(),Le(Te),re({returnFocus:!1}))}else Be(),Le(Te)}function we(){c.value||P.value||at()}function ht(){c.value||(Be(),re({returnFocus:!1}))}function Ne(){if(!b.value)return;const{hourScrollRef:Te,minuteScrollRef:Ye,secondScrollRef:ft,amPmScrollRef:Dt}=b.value;[Te,Ye,ft,Dt].forEach(Yt=>{var jt;if(!Yt)return;const Xt=(jt=Yt.contentRef)===null||jt===void 0?void 0:jt.querySelector("[data-active]");Xt&&Yt.scrollTo({top:Xt.offsetTop})})}function ot(Te){I.value=Te;const{onUpdateShow:Ye,"onUpdate:show":ft}=e;Ye&&rt(Ye,Te),ft&&rt(ft,Te)}function Rt(Te){var Ye,ft,Dt;return!!(!((ft=(Ye=m.value)===null||Ye===void 0?void 0:Ye.wrapperElRef)===null||ft===void 0)&&ft.contains(Te.relatedTarget)||!((Dt=b.value)===null||Dt===void 0)&&Dt.$el.contains(Te.relatedTarget))}function at(){A.value=C.value,ot(!0),hn(Ne)}function gt(Te){var Ye,ft;P.value&&!(!((ft=(Ye=m.value)===null||Ye===void 0?void 0:Ye.wrapperElRef)===null||ft===void 0)&&ft.contains(Nr(Te)))&&re({returnFocus:!1})}function re({returnFocus:Te}){var Ye;P.value&&(ot(!1),Te&&((Ye=m.value)===null||Ye===void 0||Ye.focus()))}function me(Te){if(Te===""){Ie(null);return}const Ye=ki(Te,e.format,new Date,g.value);if(E.value=Te,ji(Ye)){const{value:ft}=C;if(ft!==null){const Dt=Zn(ft,{hours:or(Ye),minutes:hc(Ye),seconds:fc(Ye),milliseconds:GI(Ye)});Ie(vt(Dt))}else Ie(vt(Ye))}}function je(){Ie(A.value),ot(!1)}function it(){const Te=new Date,Ye={hours:or,minutes:hc,seconds:fc},[ft,Dt,Yt]=["hours","minutes","seconds"].map(Xt=>!e[Xt]||Cl(Ye[Xt](Te),Xt,e[Xt])?Ye[Xt](Te):i$(Ye[Xt](Te),Xt,e[Xt])),jt=Md(Id(Dr(C.value?C.value:vt(Te),ft),Dt),Yt);Ie(vt(jt))}function dt(){Be(),xe(),re({returnFocus:!0})}function be(Te){Rt(Te)||(Be(),Le(Te),re({returnFocus:!1}))}wt(C,Te=>{Be(Te),Ae(),hn(Ne)}),wt(P,()=>{Fe.value&&Ie(A.value)}),Rn(ob,{mergedThemeRef:u,mergedClsPrefixRef:n});const Ve={focus:()=>{var Te;(Te=m.value)===null||Te===void 0||Te.focus()},blur:()=>{var Te;(Te=m.value)===null||Te===void 0||Te.blur()}},Xe=W(()=>{const{common:{cubicBezierEaseInOut:Te},self:{iconColor:Ye,iconColorDisabled:ft}}=u.value;return{"--n-icon-color-override":Ye,"--n-icon-color-disabled-override":ft,"--n-bezier":Te}}),pe=s?Bn("time-picker-trigger",void 0,Xe,e):void 0,Ge=W(()=>{const{self:{panelColor:Te,itemTextColor:Ye,itemTextColorActive:ft,itemColorHover:Dt,panelDividerColor:Yt,panelBoxShadow:jt,itemOpacityDisabled:Xt,borderRadius:Ln,itemFontSize:On,itemWidth:rn,itemHeight:on,panelActionPadding:Cn,itemBorderRadius:mn},common:{cubicBezierEaseInOut:Ut}}=u.value;return{"--n-bezier":Ut,"--n-border-radius":Ln,"--n-item-color-hover":Dt,"--n-item-font-size":On,"--n-item-height":on,"--n-item-opacity-disabled":Xt,"--n-item-text-color":Ye,"--n-item-text-color-active":ft,"--n-item-width":rn,"--n-panel-action-padding":Cn,"--n-panel-box-shadow":jt,"--n-panel-color":Te,"--n-panel-divider-color":Yt,"--n-item-border-radius":mn}}),_t=s?Bn("time-picker",void 0,Ge,e):void 0;return{focus:Ve.focus,blur:Ve.blur,mergedStatus:h,mergedBordered:t,mergedClsPrefix:n,namespace:i,uncontrolledValue:y,mergedValue:C,isMounted:Ba(),inputInstRef:m,panelInstRef:b,adjustedTo:di(e),mergedShow:P,localizedClear:x,localizedNow:D,localizedPlaceholder:M,localizedNegativeText:B,localizedPositiveText:z,hourInFormat:Y,minuteInFormat:U,secondInFormat:N,mergedAttrSize:K,displayTimeString:E,mergedSize:o,mergedDisabled:c,isValueInvalid:Fe,isHourInvalid:te,isMinuteInvalid:se,isSecondInvalid:oe,transitionDisabled:L,hourValue:V,minuteValue:j,secondValue:G,amPmValue:Z,handleInputKeydown:ue,handleTimeInputFocus:Se,handleTimeInputBlur:R,handleNowClick:it,handleConfirmClick:dt,handleTimeInputUpdateValue:me,handleMenuFocusOut:be,handleCancelClick:je,handleClickOutside:gt,handleTimeInputActivate:we,handleTimeInputDeactivate:ht,handleHourClick:Je,handleMinuteClick:ye,handleSecondClick:_e,handleAmPmClick:Ce,handleTimeInputClear:Qe,handleFocusDetectorFocus:De,handleMenuKeydown:he,handleTriggerClick:ce,mergedTheme:u,triggerCssVars:s?void 0:Xe,triggerThemeClass:pe==null?void 0:pe.themeClass,triggerOnRender:pe==null?void 0:pe.onRender,cssVars:s?void 0:Ge,themeClass:_t==null?void 0:_t.themeClass,onRender:_t==null?void 0:_t.onRender,clearSelectedValue:ne}},render(){const{mergedClsPrefix:e,$slots:t,triggerOnRender:n}=this;return n==null||n(),H("div",{class:[`${e}-time-picker`,this.triggerThemeClass],style:this.triggerCssVars},H(No,null,{default:()=>[H(Uo,null,{default:()=>H(Oi,{ref:"inputInstRef",status:this.mergedStatus,value:this.displayTimeString,bordered:this.mergedBordered,passivelyActivated:!0,attrSize:this.mergedAttrSize,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,stateful:this.stateful,size:this.mergedSize,placeholder:this.localizedPlaceholder,clearable:this.clearable,disabled:this.mergedDisabled,textDecoration:this.isValueInvalid?"line-through":void 0,onFocus:this.handleTimeInputFocus,onBlur:this.handleTimeInputBlur,onActivate:this.handleTimeInputActivate,onDeactivate:this.handleTimeInputDeactivate,onUpdateValue:this.handleTimeInputUpdateValue,onClear:this.handleTimeInputClear,internalDeactivateOnEnter:!0,internalForceFocus:this.mergedShow,readonly:this.inputReadonly||this.mergedDisabled,onClick:this.handleTriggerClick,onKeydown:this.handleInputKeydown},this.showIcon?{[this.clearable?"clear-icon-placeholder":"suffix"]:()=>H(Un,{clsPrefix:e,class:`${e}-time-picker-icon`},{default:()=>t.icon?t.icon():H(LD,null)})}:null)}),H(zo,{teleportDisabled:this.adjustedTo===di.tdkey,show:this.mergedShow,to:this.adjustedTo,containerClass:this.namespace,placement:this.placement},{default:()=>H(xi,{name:"fade-in-scale-up-transition",appear:this.isMounted},{default:()=>{var i;return this.mergedShow?((i=this.onRender)===null||i===void 0||i.call(this),ct(H(o$,{ref:"panelInstRef",actions:this.actions,class:this.themeClass,style:this.cssVars,seconds:this.seconds,minutes:this.minutes,hours:this.hours,transitionDisabled:this.transitionDisabled,hourValue:this.hourValue,showHour:this.hourInFormat,isHourInvalid:this.isHourInvalid,isHourDisabled:this.isHourDisabled,minuteValue:this.minuteValue,showMinute:this.minuteInFormat,isMinuteInvalid:this.isMinuteInvalid,isMinuteDisabled:this.isMinuteDisabled,secondValue:this.secondValue,amPmValue:this.amPmValue,showSecond:this.secondInFormat,isSecondInvalid:this.isSecondInvalid,isSecondDisabled:this.isSecondDisabled,isValueInvalid:this.isValueInvalid,clearText:this.localizedClear,nowText:this.localizedNow,confirmText:this.localizedPositiveText,use12Hours:this.use12Hours,onFocusout:this.handleMenuFocusOut,onKeydown:this.handleMenuKeydown,onHourClick:this.handleHourClick,onMinuteClick:this.handleMinuteClick,onSecondClick:this.handleSecondClick,onAmPmClick:this.handleAmPmClick,onNowClick:this.handleNowClick,onConfirmClick:this.handleConfirmClick,onClearClick:this.clearSelectedValue,onFocusDetectorFocus:this.handleFocusDetectorFocus}),[[Kr,this.handleClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),c$=$e({name:"DateTimePanel",props:Jh,setup(e){return Zh(e,"datetime")},render(){var e,t,n,i;const{mergedClsPrefix:s,mergedTheme:a,shortcuts:d,timePickerProps:r,onRender:o,$slots:c}=this;return o==null||o(),H("div",{ref:"selfRef",tabindex:0,class:[`${s}-date-panel`,`${s}-date-panel--datetime`,!this.panel&&`${s}-date-panel--shadow`,this.themeClass],onKeydown:this.handlePanelKeyDown,onFocus:this.handlePanelFocus},H("div",{class:`${s}-date-panel-header`},H(Oi,{value:this.dateInputValue,theme:a.peers.Input,themeOverrides:a.peerOverrides.Input,stateful:!1,size:this.timePickerSize,readonly:this.inputReadonly,class:`${s}-date-panel-date-input`,textDecoration:this.isDateInvalid?"line-through":"",placeholder:this.locale.selectDate,onBlur:this.handleDateInputBlur,onUpdateValue:this.handleDateInput}),H(ju,Object.assign({size:this.timePickerSize,placeholder:this.locale.selectTime,format:this.timerPickerFormat},Array.isArray(r)?void 0:r,{showIcon:!1,to:!1,theme:a.peers.TimePicker,themeOverrides:a.peerOverrides.TimePicker,value:Array.isArray(this.value)?null:this.value,isHourDisabled:this.isHourDisabled,isMinuteDisabled:this.isMinuteDisabled,isSecondDisabled:this.isSecondDisabled,onUpdateValue:this.handleTimePickerChange,stateful:!1}))),H("div",{class:`${s}-date-panel-calendar`},H("div",{class:`${s}-date-panel-month`},H("div",{class:`${s}-date-panel-month__fast-prev`,onClick:this.prevYear},Jt(c["prev-year"],()=>[H(vr,null)])),H("div",{class:`${s}-date-panel-month__prev`,onClick:this.prevMonth},Jt(c["prev-month"],()=>[H(pr,null)])),H(Do,{monthYearSeparator:this.calendarHeaderMonthYearSeparator,monthBeforeYear:this.calendarMonthBeforeYear,value:this.calendarValue,onUpdateValue:this.onUpdateCalendarValue,mergedClsPrefix:s,calendarMonth:this.calendarMonth,calendarYear:this.calendarYear}),H("div",{class:`${s}-date-panel-month__next`,onClick:this.nextMonth},Jt(c["next-month"],()=>[H(mr,null)])),H("div",{class:`${s}-date-panel-month__fast-next`,onClick:this.nextYear},Jt(c["next-year"],()=>[H(gr,null)]))),H("div",{class:`${s}-date-panel-weekdays`},this.weekdays.map(h=>H("div",{key:h,class:`${s}-date-panel-weekdays__day`},h))),H("div",{class:`${s}-date-panel-dates`},this.dateArray.map((h,u)=>H("div",{"data-n-date":!0,key:u,class:[`${s}-date-panel-date`,{[`${s}-date-panel-date--current`]:h.isCurrentDate,[`${s}-date-panel-date--selected`]:h.selected,[`${s}-date-panel-date--excluded`]:!h.inCurrentMonth,[`${s}-date-panel-date--disabled`]:this.mergedIsDateDisabled(h.ts,{type:"date",year:h.dateObject.year,month:h.dateObject.month,date:h.dateObject.date})}],onClick:()=>{this.handleDateClick(h)}},H("div",{class:`${s}-date-panel-date__trigger`}),h.dateObject.date,h.isCurrentDate?H("div",{class:`${s}-date-panel-date__sup`}):null)))),this.datePickerSlots.footer?H("div",{class:`${s}-date-panel-footer`},this.datePickerSlots.footer()):null,!((e=this.actions)===null||e===void 0)&&e.length||d?H("div",{class:`${s}-date-panel-actions`},H("div",{class:`${s}-date-panel-actions__prefix`},d&&Object.keys(d).map(h=>{const u=d[h];return Array.isArray(u)?null:H(xs,{size:"tiny",onMouseenter:()=>{this.handleSingleShortcutMouseenter(u)},onClick:()=>{this.handleSingleShortcutClick(u)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>h})})),H("div",{class:`${s}-date-panel-actions__suffix`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?Ri(this.$slots.clear,{onClear:this.clearSelectedDateTime,text:this.locale.clear},()=>[H(yn,{theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,size:"tiny",onClick:this.clearSelectedDateTime},{default:()=>this.locale.clear})]):null,!((n=this.actions)===null||n===void 0)&&n.includes("now")?Ri(c.now,{onNow:this.handleNowClick,text:this.locale.now},()=>[H(yn,{theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,size:"tiny",onClick:this.handleNowClick},{default:()=>this.locale.now})]):null,!((i=this.actions)===null||i===void 0)&&i.includes("confirm")?Ri(c.confirm,{onConfirm:this.handleConfirmClick,disabled:this.isDateInvalid,text:this.locale.confirm},()=>[H(yn,{theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,size:"tiny",type:"primary",disabled:this.isDateInvalid,onClick:this.handleConfirmClick},{default:()=>this.locale.confirm})]):null)):null,H(yr,{onFocus:this.handleFocusDetectorFocus}))}}),d$=$e({name:"DateTimeRangePanel",props:Qh,setup(e){return ef(e,"datetimerange")},render(){var e,t,n;const{mergedClsPrefix:i,mergedTheme:s,shortcuts:a,timePickerProps:d,onRender:r,$slots:o}=this;return r==null||r(),H("div",{ref:"selfRef",tabindex:0,class:[`${i}-date-panel`,`${i}-date-panel--datetimerange`,!this.panel&&`${i}-date-panel--shadow`,this.themeClass],onKeydown:this.handlePanelKeyDown,onFocus:this.handlePanelFocus},H("div",{class:`${i}-date-panel-header`},H(Oi,{value:this.startDateDisplayString,theme:s.peers.Input,themeOverrides:s.peerOverrides.Input,size:this.timePickerSize,stateful:!1,readonly:this.inputReadonly,class:`${i}-date-panel-date-input`,textDecoration:this.isStartValueInvalid?"line-through":"",placeholder:this.locale.selectDate,onBlur:this.handleStartDateInputBlur,onUpdateValue:this.handleStartDateInput}),H(ju,Object.assign({placeholder:this.locale.selectTime,format:this.timerPickerFormat,size:this.timePickerSize},Array.isArray(d)?d[0]:d,{value:this.startTimeValue,to:!1,showIcon:!1,disabled:this.isSelecting,theme:s.peers.TimePicker,themeOverrides:s.peerOverrides.TimePicker,stateful:!1,isHourDisabled:this.isStartHourDisabled,isMinuteDisabled:this.isStartMinuteDisabled,isSecondDisabled:this.isStartSecondDisabled,onUpdateValue:this.handleStartTimePickerChange})),H(Oi,{value:this.endDateInput,theme:s.peers.Input,themeOverrides:s.peerOverrides.Input,stateful:!1,size:this.timePickerSize,readonly:this.inputReadonly,class:`${i}-date-panel-date-input`,textDecoration:this.isEndValueInvalid?"line-through":"",placeholder:this.locale.selectDate,onBlur:this.handleEndDateInputBlur,onUpdateValue:this.handleEndDateInput}),H(ju,Object.assign({placeholder:this.locale.selectTime,format:this.timerPickerFormat,size:this.timePickerSize},Array.isArray(d)?d[1]:d,{disabled:this.isSelecting,showIcon:!1,theme:s.peers.TimePicker,themeOverrides:s.peerOverrides.TimePicker,to:!1,stateful:!1,value:this.endTimeValue,isHourDisabled:this.isEndHourDisabled,isMinuteDisabled:this.isEndMinuteDisabled,isSecondDisabled:this.isEndSecondDisabled,onUpdateValue:this.handleEndTimePickerChange}))),H("div",{ref:"startDatesElRef",class:`${i}-date-panel-calendar ${i}-date-panel-calendar--start`},H("div",{class:`${i}-date-panel-month`},H("div",{class:`${i}-date-panel-month__fast-prev`,onClick:this.startCalendarPrevYear},Jt(o["prev-year"],()=>[H(vr,null)])),H("div",{class:`${i}-date-panel-month__prev`,onClick:this.startCalendarPrevMonth},Jt(o["prev-month"],()=>[H(pr,null)])),H(Do,{monthYearSeparator:this.calendarHeaderMonthYearSeparator,monthBeforeYear:this.calendarMonthBeforeYear,value:this.startCalendarDateTime,onUpdateValue:this.onUpdateStartCalendarValue,mergedClsPrefix:i,calendarMonth:this.startCalendarMonth,calendarYear:this.startCalendarYear}),H("div",{class:`${i}-date-panel-month__next`,onClick:this.startCalendarNextMonth},Jt(o["next-month"],()=>[H(mr,null)])),H("div",{class:`${i}-date-panel-month__fast-next`,onClick:this.startCalendarNextYear},Jt(o["next-year"],()=>[H(gr,null)]))),H("div",{class:`${i}-date-panel-weekdays`},this.weekdays.map(c=>H("div",{key:c,class:`${i}-date-panel-weekdays__day`},c))),H("div",{class:`${i}-date-panel__divider`}),H("div",{class:`${i}-date-panel-dates`},this.startDateArray.map((c,h)=>{const u=this.mergedIsDateDisabled(c.ts);return H("div",{"data-n-date":!0,key:h,class:[`${i}-date-panel-date`,{[`${i}-date-panel-date--excluded`]:!c.inCurrentMonth,[`${i}-date-panel-date--current`]:c.isCurrentDate,[`${i}-date-panel-date--selected`]:c.selected,[`${i}-date-panel-date--covered`]:c.inSpan,[`${i}-date-panel-date--start`]:c.startOfSpan,[`${i}-date-panel-date--end`]:c.endOfSpan,[`${i}-date-panel-date--disabled`]:u}],onClick:u?void 0:()=>{this.handleDateClick(c)},onMouseenter:u?void 0:()=>{this.handleDateMouseEnter(c)}},H("div",{class:`${i}-date-panel-date__trigger`}),c.dateObject.date,c.isCurrentDate?H("div",{class:`${i}-date-panel-date__sup`}):null)}))),H("div",{class:`${i}-date-panel__vertical-divider`}),H("div",{ref:"endDatesElRef",class:`${i}-date-panel-calendar ${i}-date-panel-calendar--end`},H("div",{class:`${i}-date-panel-month`},H("div",{class:`${i}-date-panel-month__fast-prev`,onClick:this.endCalendarPrevYear},Jt(o["prev-year"],()=>[H(vr,null)])),H("div",{class:`${i}-date-panel-month__prev`,onClick:this.endCalendarPrevMonth},Jt(o["prev-month"],()=>[H(pr,null)])),H(Do,{monthBeforeYear:this.calendarMonthBeforeYear,value:this.endCalendarDateTime,onUpdateValue:this.onUpdateEndCalendarValue,mergedClsPrefix:i,monthYearSeparator:this.calendarHeaderMonthYearSeparator,calendarMonth:this.endCalendarMonth,calendarYear:this.endCalendarYear}),H("div",{class:`${i}-date-panel-month__next`,onClick:this.endCalendarNextMonth},Jt(o["next-month"],()=>[H(mr,null)])),H("div",{class:`${i}-date-panel-month__fast-next`,onClick:this.endCalendarNextYear},Jt(o["next-year"],()=>[H(gr,null)]))),H("div",{class:`${i}-date-panel-weekdays`},this.weekdays.map(c=>H("div",{key:c,class:`${i}-date-panel-weekdays__day`},c))),H("div",{class:`${i}-date-panel__divider`}),H("div",{class:`${i}-date-panel-dates`},this.endDateArray.map((c,h)=>{const u=this.mergedIsDateDisabled(c.ts);return H("div",{"data-n-date":!0,key:h,class:[`${i}-date-panel-date`,{[`${i}-date-panel-date--excluded`]:!c.inCurrentMonth,[`${i}-date-panel-date--current`]:c.isCurrentDate,[`${i}-date-panel-date--selected`]:c.selected,[`${i}-date-panel-date--covered`]:c.inSpan,[`${i}-date-panel-date--start`]:c.startOfSpan,[`${i}-date-panel-date--end`]:c.endOfSpan,[`${i}-date-panel-date--disabled`]:u}],onClick:u?void 0:()=>{this.handleDateClick(c)},onMouseenter:u?void 0:()=>{this.handleDateMouseEnter(c)}},H("div",{class:`${i}-date-panel-date__trigger`}),c.dateObject.date,c.isCurrentDate?H("div",{class:`${i}-date-panel-date__sup`}):null)}))),this.datePickerSlots.footer?H("div",{class:`${i}-date-panel-footer`},this.datePickerSlots.footer()):null,!((e=this.actions)===null||e===void 0)&&e.length||a?H("div",{class:`${i}-date-panel-actions`},H("div",{class:`${i}-date-panel-actions__prefix`},a&&Object.keys(a).map(c=>{const h=a[c];return Array.isArray(h)||typeof h=="function"?H(xs,{size:"tiny",onMouseenter:()=>{this.handleRangeShortcutMouseenter(h)},onClick:()=>{this.handleRangeShortcutClick(h)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>c}):null})),H("div",{class:`${i}-date-panel-actions__suffix`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?Ri(o.clear,{onClear:this.handleClearClick,text:this.locale.clear},()=>[H(yn,{theme:s.peers.Button,themeOverrides:s.peerOverrides.Button,size:"tiny",onClick:this.handleClearClick},{default:()=>this.locale.clear})]):null,!((n=this.actions)===null||n===void 0)&&n.includes("confirm")?Ri(o.confirm,{onConfirm:this.handleConfirmClick,disabled:this.isRangeInvalid||this.isSelecting,text:this.locale.confirm},()=>[H(yn,{theme:s.peers.Button,themeOverrides:s.peerOverrides.Button,size:"tiny",type:"primary",disabled:this.isRangeInvalid||this.isSelecting,onClick:this.handleConfirmClick},{default:()=>this.locale.confirm})]):null)):null,H(yr,{onFocus:this.handleFocusDetectorFocus}))}}),u$=$e({name:"MonthRangePanel",props:Object.assign(Object.assign({},Qh),{type:{type:String,required:!0}}),setup(e){const t=ef(e,e.type),{dateLocaleRef:n}=rs("DatePicker"),i=(s,a,d,r)=>{const{handleColItemClick:o}=t;return H("div",{"data-n-date":!0,key:a,class:[`${d}-date-panel-month-calendar__picker-col-item`,s.isCurrent&&`${d}-date-panel-month-calendar__picker-col-item--current`,s.selected&&`${d}-date-panel-month-calendar__picker-col-item--selected`,!1],onClick:()=>{o(s,r)}},s.type==="month"?Dy(s.dateObject.month,s.monthFormat,n.value.locale):s.type==="quarter"?My(s.dateObject.quarter,s.quarterFormat,n.value.locale):Iy(s.dateObject.year,s.yearFormat,n.value.locale))};return It(()=>{t.justifyColumnsScrollState()}),Object.assign(Object.assign({},t),{renderItem:i})},render(){var e,t,n;const{mergedClsPrefix:i,mergedTheme:s,shortcuts:a,type:d,renderItem:r,onRender:o}=this;return o==null||o(),H("div",{ref:"selfRef",tabindex:0,class:[`${i}-date-panel`,`${i}-date-panel--daterange`,!this.panel&&`${i}-date-panel--shadow`,this.themeClass],onKeydown:this.handlePanelKeyDown,onFocus:this.handlePanelFocus},H("div",{ref:"startDatesElRef",class:`${i}-date-panel-calendar ${i}-date-panel-calendar--start`},H("div",{class:`${i}-date-panel-month-calendar`},H($i,{ref:"startYearScrollbarRef",class:`${i}-date-panel-month-calendar__picker-col`,theme:s.peers.Scrollbar,themeOverrides:s.peerOverrides.Scrollbar,container:()=>this.virtualListContainer("start"),content:()=>this.virtualListContent("start"),horizontalRailStyle:{zIndex:1},verticalRailStyle:{zIndex:1}},{default:()=>H(Eo,{ref:"startYearVlRef",items:this.startYearArray,itemSize:jr,showScrollbar:!1,keyField:"ts",onScroll:this.handleStartYearVlScroll,paddingBottom:4},{default:({item:c,index:h})=>r(c,h,i,"start")})}),d==="monthrange"||d==="quarterrange"?H("div",{class:`${i}-date-panel-month-calendar__picker-col`},H($i,{ref:"startMonthScrollbarRef",theme:s.peers.Scrollbar,themeOverrides:s.peerOverrides.Scrollbar},{default:()=>[(d==="monthrange"?this.startMonthArray:this.startQuarterArray).map((c,h)=>r(c,h,i,"start")),d==="monthrange"&&H("div",{class:`${i}-date-panel-month-calendar__padding`})]})):null)),H("div",{class:`${i}-date-panel__vertical-divider`}),H("div",{ref:"endDatesElRef",class:`${i}-date-panel-calendar ${i}-date-panel-calendar--end`},H("div",{class:`${i}-date-panel-month-calendar`},H($i,{ref:"endYearScrollbarRef",class:`${i}-date-panel-month-calendar__picker-col`,theme:s.peers.Scrollbar,themeOverrides:s.peerOverrides.Scrollbar,container:()=>this.virtualListContainer("end"),content:()=>this.virtualListContent("end"),horizontalRailStyle:{zIndex:1},verticalRailStyle:{zIndex:1}},{default:()=>H(Eo,{ref:"endYearVlRef",items:this.endYearArray,itemSize:jr,showScrollbar:!1,keyField:"ts",onScroll:this.handleEndYearVlScroll,paddingBottom:4},{default:({item:c,index:h})=>r(c,h,i,"end")})}),d==="monthrange"||d==="quarterrange"?H("div",{class:`${i}-date-panel-month-calendar__picker-col`},H($i,{ref:"endMonthScrollbarRef",theme:s.peers.Scrollbar,themeOverrides:s.peerOverrides.Scrollbar},{default:()=>[(d==="monthrange"?this.endMonthArray:this.endQuarterArray).map((c,h)=>r(c,h,i,"end")),d==="monthrange"&&H("div",{class:`${i}-date-panel-month-calendar__padding`})]})):null)),this.datePickerSlots.footer?H("div",{class:`${i}-date-panel-footer`},Vg(this.datePickerSlots,"footer")):null,!((e=this.actions)===null||e===void 0)&&e.length||a?H("div",{class:`${i}-date-panel-actions`},H("div",{class:`${i}-date-panel-actions__prefix`},a&&Object.keys(a).map(c=>{const h=a[c];return Array.isArray(h)||typeof h=="function"?H(xs,{size:"tiny",onMouseenter:()=>{this.handleRangeShortcutMouseenter(h)},onClick:()=>{this.handleRangeShortcutClick(h)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>c}):null})),H("div",{class:`${i}-date-panel-actions__suffix`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?Ri(this.$slots.clear,{onClear:this.handleClearClick,text:this.locale.clear},()=>[H(xs,{theme:s.peers.Button,themeOverrides:s.peerOverrides.Button,size:"tiny",onClick:this.handleClearClick},{default:()=>this.locale.clear})]):null,!((n=this.actions)===null||n===void 0)&&n.includes("confirm")?Ri(this.$slots.confirm,{disabled:this.isRangeInvalid,onConfirm:this.handleConfirmClick,text:this.locale.confirm},()=>[H(xs,{theme:s.peers.Button,themeOverrides:s.peerOverrides.Button,size:"tiny",type:"primary",disabled:this.isRangeInvalid,onClick:this.handleConfirmClick},{default:()=>this.locale.confirm})]):null)):null,H(yr,{onFocus:this.handleFocusDetectorFocus}))}}),h$=Object.assign(Object.assign({},Ht.props),{to:di.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,updateValueOnClose:Boolean,calendarDayFormat:String,calendarHeaderYearFormat:String,calendarHeaderMonthFormat:String,calendarHeaderMonthYearSeparator:{type:String,default:" "},calendarHeaderMonthBeforeYear:{type:Boolean,default:void 0},defaultValue:[Number,Array],defaultFormattedValue:[String,Array],defaultTime:[Number,String,Array],disabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom-start"},value:[Number,Array],formattedValue:[String,Array],size:String,type:{type:String,default:"date"},valueFormat:String,separator:String,placeholder:String,startPlaceholder:String,endPlaceholder:String,format:String,dateFormat:String,timerPickerFormat:String,actions:Array,shortcuts:Object,isDateDisabled:Function,isTimeDisabled:Function,show:{type:Boolean,default:void 0},panel:Boolean,ranges:Object,firstDayOfWeek:Number,inputReadonly:Boolean,closeOnSelect:Boolean,status:String,timePickerProps:[Object,Array],onClear:Function,onConfirm:Function,defaultCalendarStartTime:Number,defaultCalendarEndTime:Number,bindCalendarMonths:Boolean,monthFormat:{type:String,default:"M"},yearFormat:{type:String,default:"y"},quarterFormat:{type:String,default:"'Q'Q"},yearRange:{type:Array,default:()=>[1901,2100]},"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],"onUpdate:formattedValue":[Function,Array],onUpdateFormattedValue:[Function,Array],"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onNextMonth:Function,onPrevMonth:Function,onNextYear:Function,onPrevYear:Function,onChange:[Function,Array]}),f$=Ke([Re("date-picker",` + position: relative; + z-index: auto; + `,[Re("date-picker-icon",` + color: var(--n-icon-color-override); + transition: color .3s var(--n-bezier); + `),Re("icon",` + color: var(--n-icon-color-override); + transition: color .3s var(--n-bezier); + `),We("disabled",[Re("date-picker-icon",` + color: var(--n-icon-color-disabled-override); + `),Re("icon",` + color: var(--n-icon-color-disabled-override); + `)])]),Re("date-panel",` + width: fit-content; + outline: none; + margin: 4px 0; + display: grid; + grid-template-columns: 0fr; + border-radius: var(--n-panel-border-radius); + background-color: var(--n-panel-color); + color: var(--n-panel-text-color); + user-select: none; + `,[Vo(),We("shadow",` + box-shadow: var(--n-panel-box-shadow); + `),Re("date-panel-calendar",{padding:"var(--n-calendar-left-padding)",display:"grid",gridTemplateColumns:"1fr",gridArea:"left-calendar"},[We("end",{padding:"var(--n-calendar-right-padding)",gridArea:"right-calendar"})]),Re("date-panel-month-calendar",{display:"flex",gridArea:"left-calendar"},[tt("picker-col",` + min-width: var(--n-scroll-item-width); + height: calc(var(--n-scroll-item-height) * 6); + user-select: none; + -webkit-user-select: none; + `,[Ke("&:first-child",` + min-width: calc(var(--n-scroll-item-width) + 4px); + `,[tt("picker-col-item",[Ke("&::before","left: 4px;")])]),tt("padding",` + height: calc(var(--n-scroll-item-height) * 5) + `)]),tt("picker-col-item",` + z-index: 0; + cursor: pointer; + height: var(--n-scroll-item-height); + box-sizing: border-box; + padding-top: 4px; + display: flex; + align-items: center; + justify-content: center; + position: relative; + transition: + color .3s var(--n-bezier), + background-color .3s var(--n-bezier); + background: #0000; + color: var(--n-item-text-color); + `,[Ke("&::before",` + z-index: -1; + content: ""; + position: absolute; + left: 0; + right: 4px; + top: 4px; + bottom: 0; + border-radius: var(--n-scroll-item-border-radius); + transition: + background-color .3s var(--n-bezier); + `),xn("disabled",[Ke("&:hover::before",` + background-color: var(--n-item-color-hover); + `),We("selected",` + color: var(--n-item-color-active); + `,[Ke("&::before","background-color: var(--n-item-color-hover);")])]),We("disabled",` + color: var(--n-item-text-color-disabled); + cursor: not-allowed; + `,[We("selected",[Ke("&::before",` + background-color: var(--n-item-color-disabled); + `)])])])]),We("date",{gridTemplateAreas:` + "left-calendar" + "footer" + "action" + `}),We("week",{gridTemplateAreas:` + "left-calendar" + "footer" + "action" + `}),We("daterange",{gridTemplateAreas:` + "left-calendar divider right-calendar" + "footer footer footer" + "action action action" + `}),We("datetime",{gridTemplateAreas:` + "header" + "left-calendar" + "footer" + "action" + `}),We("datetimerange",{gridTemplateAreas:` + "header header header" + "left-calendar divider right-calendar" + "footer footer footer" + "action action action" + `}),We("month",{gridTemplateAreas:` + "left-calendar" + "footer" + "action" + `}),Re("date-panel-footer",{gridArea:"footer"}),Re("date-panel-actions",{gridArea:"action"}),Re("date-panel-header",{gridArea:"header"}),Re("date-panel-header",` + box-sizing: border-box; + width: 100%; + align-items: center; + padding: var(--n-panel-header-padding); + display: flex; + justify-content: space-between; + border-bottom: 1px solid var(--n-panel-header-divider-color); + `,[Ke(">",[Ke("*:not(:last-child)",{marginRight:"10px"}),Ke("*",{flex:1,width:0}),Re("time-picker",{zIndex:1})])]),Re("date-panel-month",` + box-sizing: border-box; + display: grid; + grid-template-columns: var(--n-calendar-title-grid-template-columns); + align-items: center; + justify-items: center; + padding: var(--n-calendar-title-padding); + height: var(--n-calendar-title-height); + `,[tt("prev, next, fast-prev, fast-next",` + line-height: 0; + cursor: pointer; + width: var(--n-arrow-size); + height: var(--n-arrow-size); + color: var(--n-arrow-color); + `),tt("month-year",` + user-select: none; + -webkit-user-select: none; + flex-grow: 1; + position: relative; + `,[tt("text",` + font-size: var(--n-calendar-title-font-size); + line-height: var(--n-calendar-title-font-size); + font-weight: var(--n-calendar-title-font-weight); + padding: 6px 8px; + text-align: center; + color: var(--n-calendar-title-text-color); + cursor: pointer; + transition: background-color .3s var(--n-bezier); + border-radius: var(--n-panel-border-radius); + `,[We("active",` + background-color: var(--n-calendar-title-color-hover); + `),Ke("&:hover",` + background-color: var(--n-calendar-title-color-hover); + `)])])]),Re("date-panel-weekdays",` + display: grid; + margin: auto; + grid-template-columns: repeat(7, var(--n-item-cell-width)); + grid-template-rows: repeat(1, var(--n-item-cell-height)); + align-items: center; + justify-items: center; + margin-bottom: 4px; + border-bottom: 1px solid var(--n-calendar-days-divider-color); + `,[tt("day",` + white-space: nowrap; + user-select: none; + -webkit-user-select: none; + line-height: 15px; + width: var(--n-item-size); + text-align: center; + font-size: var(--n-calendar-days-font-size); + color: var(--n-item-text-color); + display: flex; + align-items: center; + justify-content: center; + `)]),Re("date-panel-dates",` + margin: auto; + display: grid; + grid-template-columns: repeat(7, var(--n-item-cell-width)); + grid-template-rows: repeat(6, var(--n-item-cell-height)); + align-items: center; + justify-items: center; + flex-wrap: wrap; + `,[Re("date-panel-date",` + user-select: none; + -webkit-user-select: none; + position: relative; + width: var(--n-item-size); + height: var(--n-item-size); + line-height: var(--n-item-size); + text-align: center; + font-size: var(--n-item-font-size); + border-radius: var(--n-item-border-radius); + z-index: 0; + cursor: pointer; + transition: + background-color .2s var(--n-bezier), + color .2s var(--n-bezier); + `,[tt("trigger",` + position: absolute; + left: calc(var(--n-item-size) / 2 - var(--n-item-cell-width) / 2); + top: calc(var(--n-item-size) / 2 - var(--n-item-cell-height) / 2); + width: var(--n-item-cell-width); + height: var(--n-item-cell-height); + `),We("current",[tt("sup",` + position: absolute; + top: 2px; + right: 2px; + content: ""; + height: 4px; + width: 4px; + border-radius: 2px; + background-color: var(--n-item-color-active); + transition: + background-color .2s var(--n-bezier); + `)]),Ke("&::after",` + content: ""; + z-index: -1; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + border-radius: inherit; + transition: background-color .3s var(--n-bezier); + `),We("covered, start, end",[xn("excluded",[Ke("&::before",` + content: ""; + z-index: -2; + position: absolute; + left: calc((var(--n-item-size) - var(--n-item-cell-width)) / 2); + right: calc((var(--n-item-size) - var(--n-item-cell-width)) / 2); + top: 0; + bottom: 0; + background-color: var(--n-item-color-included); + `),Ke("&:nth-child(7n + 1)::before",{borderTopLeftRadius:"var(--n-item-border-radius)",borderBottomLeftRadius:"var(--n-item-border-radius)"}),Ke("&:nth-child(7n + 7)::before",{borderTopRightRadius:"var(--n-item-border-radius)",borderBottomRightRadius:"var(--n-item-border-radius)"})])]),We("selected",{color:"var(--n-item-text-color-active)"},[Ke("&::after",{backgroundColor:"var(--n-item-color-active)"}),We("start",[Ke("&::before",{left:"50%"})]),We("end",[Ke("&::before",{right:"50%"})]),tt("sup",{backgroundColor:"var(--n-panel-color)"})]),We("excluded",{color:"var(--n-item-text-color-disabled)"},[We("selected",[Ke("&::after",{backgroundColor:"var(--n-item-color-disabled)"})])]),We("disabled",{cursor:"not-allowed",color:"var(--n-item-text-color-disabled)"},[We("covered",[Ke("&::before",{backgroundColor:"var(--n-item-color-disabled)"})]),We("selected",[Ke("&::before",{backgroundColor:"var(--n-item-color-disabled)"}),Ke("&::after",{backgroundColor:"var(--n-item-color-disabled)"})])]),We("week-hovered",[Ke("&::before",` + background-color: var(--n-item-color-included); + `),Ke("&:nth-child(7n + 1)::before",` + border-top-left-radius: var(--n-item-border-radius); + border-bottom-left-radius: var(--n-item-border-radius); + `),Ke("&:nth-child(7n + 7)::before",` + border-top-right-radius: var(--n-item-border-radius); + border-bottom-right-radius: var(--n-item-border-radius); + `)]),We("week-selected",` + color: var(--n-item-text-color-active) + `,[Ke("&::before",` + background-color: var(--n-item-color-active); + `),Ke("&:nth-child(7n + 1)::before",` + border-top-left-radius: var(--n-item-border-radius); + border-bottom-left-radius: var(--n-item-border-radius); + `),Ke("&:nth-child(7n + 7)::before",` + border-top-right-radius: var(--n-item-border-radius); + border-bottom-right-radius: var(--n-item-border-radius); + `)])])]),xn("week",[Re("date-panel-dates",[Re("date-panel-date",[xn("disabled",[xn("selected",[Ke("&:hover",` + background-color: var(--n-item-color-hover); + `)])])])])]),We("week",[Re("date-panel-dates",[Re("date-panel-date",[Ke("&::before",` + content: ""; + z-index: -2; + position: absolute; + left: calc((var(--n-item-size) - var(--n-item-cell-width)) / 2); + right: calc((var(--n-item-size) - var(--n-item-cell-width)) / 2); + top: 0; + bottom: 0; + transition: background-color .3s var(--n-bezier); + `)])])]),tt("vertical-divider",` + grid-area: divider; + height: 100%; + width: 1px; + background-color: var(--n-calendar-divider-color); + `),Re("date-panel-footer",` + border-top: 1px solid var(--n-panel-action-divider-color); + padding: var(--n-panel-extra-footer-padding); + `),Re("date-panel-actions",` + flex: 1; + padding: var(--n-panel-action-padding); + display: flex; + align-items: center; + justify-content: space-between; + border-top: 1px solid var(--n-panel-action-divider-color); + `,[tt("prefix, suffix",` + display: flex; + margin-bottom: -8px; + `),tt("suffix",` + align-self: flex-end; + `),tt("prefix",` + flex-wrap: wrap; + `),Re("button",` + margin-bottom: 8px; + `,[Ke("&:not(:last-child)",` + margin-right: 8px; + `)])])]),Ke("[data-n-date].transition-disabled",{transition:"none !important"},[Ke("&::before, &::after",{transition:"none !important"})])]);function p$(e,t){const n=W(()=>{const{isTimeDisabled:h}=e,{value:u}=t;if(!(u===null||Array.isArray(u)))return h==null?void 0:h(u)}),i=W(()=>{var h;return(h=n.value)===null||h===void 0?void 0:h.isHourDisabled}),s=W(()=>{var h;return(h=n.value)===null||h===void 0?void 0:h.isMinuteDisabled}),a=W(()=>{var h;return(h=n.value)===null||h===void 0?void 0:h.isSecondDisabled}),d=W(()=>{const{type:h,isDateDisabled:u}=e,{value:v}=t;return v===null||Array.isArray(v)||!["date","datetime"].includes(h)||!u?!1:u(v,{type:"input"})}),r=W(()=>{const{type:h}=e,{value:u}=t;if(u===null||h==="datetime"||Array.isArray(u))return!1;const v=new Date(u),m=v.getHours(),b=v.getMinutes(),g=v.getMinutes();return(i.value?i.value(m):!1)||(s.value?s.value(b,m):!1)||(a.value?a.value(g,b,m):!1)}),o=W(()=>d.value||r.value);return{isValueInvalidRef:W(()=>{const{type:h}=e;return h==="date"?d.value:h==="datetime"?o.value:!1}),isDateInvalidRef:d,isTimeInvalidRef:r,isDateTimeInvalidRef:o,isHourDisabledRef:i,isMinuteDisabledRef:s,isSecondDisabledRef:a}}function v$(e,t){const n=W(()=>{const{isTimeDisabled:u}=e,{value:v}=t;return!Array.isArray(v)||!u?[void 0,void 0]:[u==null?void 0:u(v[0],"start",v),u==null?void 0:u(v[1],"end",v)]}),i={isStartHourDisabledRef:W(()=>{var u;return(u=n.value[0])===null||u===void 0?void 0:u.isHourDisabled}),isEndHourDisabledRef:W(()=>{var u;return(u=n.value[1])===null||u===void 0?void 0:u.isHourDisabled}),isStartMinuteDisabledRef:W(()=>{var u;return(u=n.value[0])===null||u===void 0?void 0:u.isMinuteDisabled}),isEndMinuteDisabledRef:W(()=>{var u;return(u=n.value[1])===null||u===void 0?void 0:u.isMinuteDisabled}),isStartSecondDisabledRef:W(()=>{var u;return(u=n.value[0])===null||u===void 0?void 0:u.isSecondDisabled}),isEndSecondDisabledRef:W(()=>{var u;return(u=n.value[1])===null||u===void 0?void 0:u.isSecondDisabled})},s=W(()=>{const{type:u,isDateDisabled:v}=e,{value:m}=t;return m===null||!Array.isArray(m)||!["daterange","datetimerange"].includes(u)||!v?!1:v(m[0],"start",m)}),a=W(()=>{const{type:u,isDateDisabled:v}=e,{value:m}=t;return m===null||!Array.isArray(m)||!["daterange","datetimerange"].includes(u)||!v?!1:v(m[1],"end",m)}),d=W(()=>{const{type:u}=e,{value:v}=t;if(v===null||!Array.isArray(v)||u!=="datetimerange")return!1;const m=or(v[0]),b=hc(v[0]),g=fc(v[0]),{isStartHourDisabledRef:l,isStartMinuteDisabledRef:f,isStartSecondDisabledRef:p}=i;return(l.value?l.value(m):!1)||(f.value?f.value(b,m):!1)||(p.value?p.value(g,b,m):!1)}),r=W(()=>{const{type:u}=e,{value:v}=t;if(v===null||!Array.isArray(v)||u!=="datetimerange")return!1;const m=or(v[1]),b=hc(v[1]),g=fc(v[1]),{isEndHourDisabledRef:l,isEndMinuteDisabledRef:f,isEndSecondDisabledRef:p}=i;return(l.value?l.value(m):!1)||(f.value?f.value(b,m):!1)||(p.value?p.value(g,b,m):!1)}),o=W(()=>s.value||d.value),c=W(()=>a.value||r.value),h=W(()=>o.value||c.value);return Object.assign(Object.assign({},i),{isStartDateInvalidRef:s,isEndDateInvalidRef:a,isStartTimeInvalidRef:d,isEndTimeInvalidRef:r,isStartValueInvalidRef:o,isEndValueInvalidRef:c,isRangeInvalidRef:h})}const g$=$e({name:"DatePicker",props:h$,setup(e,{slots:t}){var n;const{localeRef:i,dateLocaleRef:s}=rs("DatePicker"),a=_r(e),{mergedSizeRef:d,mergedDisabledRef:r,mergedStatusRef:o}=a,{mergedComponentPropsRef:c,mergedClsPrefixRef:h,mergedBorderedRef:u,namespaceRef:v,inlineThemeDisabled:m}=bn(e),b=F(null),g=F(null),l=F(null),f=F(!1),p=ut(e,"show"),y=Qn(p,f),C=W(()=>({locale:s.value.locale,useAdditionalWeekYearTokens:!0})),k=W(()=>{const{format:be}=e;if(be)return be;switch(e.type){case"date":case"daterange":return i.value.dateFormat;case"datetime":case"datetimerange":return i.value.dateTimeFormat;case"year":case"yearrange":return i.value.yearTypeFormat;case"month":case"monthrange":return i.value.monthTypeFormat;case"quarter":case"quarterrange":return i.value.quarterFormat;case"week":return i.value.weekFormat}}),E=W(()=>{var be;return(be=e.valueFormat)!==null&&be!==void 0?be:k.value});function I(be){if(be===null)return null;const{value:Ve}=E,{value:Xe}=C;return Array.isArray(be)?[ki(be[0],Ve,new Date,Xe).getTime(),ki(be[1],Ve,new Date,Xe).getTime()]:ki(be,Ve,new Date,Xe).getTime()}const{defaultFormattedValue:S,defaultValue:P}=e,A=F((n=S!==void 0?I(S):P)!==null&&n!==void 0?n:null),L=W(()=>{const{formattedValue:be}=e;return be!==void 0?I(be):e.value}),x=Qn(L,A),D=F(null);Yi(()=>{D.value=x.value});const M=F(""),B=F(""),z=F(""),Y=Ht("DatePicker","-date-picker",f$,sw,e,h),U=W(()=>{var be,Ve;return((Ve=(be=c==null?void 0:c.value)===null||be===void 0?void 0:be.DatePicker)===null||Ve===void 0?void 0:Ve.timePickerSize)||"small"}),N=W(()=>["daterange","datetimerange","monthrange","quarterrange","yearrange"].includes(e.type)),V=W(()=>{const{placeholder:be}=e;if(be===void 0){const{type:Ve}=e;switch(Ve){case"date":return i.value.datePlaceholder;case"datetime":return i.value.datetimePlaceholder;case"month":return i.value.monthPlaceholder;case"year":return i.value.yearPlaceholder;case"quarter":return i.value.quarterPlaceholder;case"week":return i.value.weekPlaceholder;default:return""}}else return be}),j=W(()=>e.startPlaceholder===void 0?e.type==="daterange"?i.value.startDatePlaceholder:e.type==="datetimerange"?i.value.startDatetimePlaceholder:e.type==="monthrange"?i.value.startMonthPlaceholder:"":e.startPlaceholder),G=W(()=>e.endPlaceholder===void 0?e.type==="daterange"?i.value.endDatePlaceholder:e.type==="datetimerange"?i.value.endDatetimePlaceholder:e.type==="monthrange"?i.value.endMonthPlaceholder:"":e.endPlaceholder),te=W(()=>{const{actions:be,type:Ve,clearable:Xe}=e;if(be===null)return[];if(be!==void 0)return be;const pe=Xe?["clear"]:[];switch(Ve){case"date":case"week":return pe.push("now"),pe;case"datetime":return pe.push("now","confirm"),pe;case"daterange":return pe.push("confirm"),pe;case"datetimerange":return pe.push("confirm"),pe;case"month":return pe.push("now","confirm"),pe;case"year":return pe.push("now"),pe;case"quarter":return pe.push("now","confirm"),pe;case"monthrange":case"yearrange":case"quarterrange":return pe.push("confirm"),pe;default:{Ur("date-picker","The type is wrong, n-date-picker's type only supports `date`, `datetime`, `daterange` and `datetimerange`.");break}}});function se(be){if(be===null)return null;if(Array.isArray(be)){const{value:Ve}=E,{value:Xe}=C;return[un(be[0],Ve,Xe),un(be[1],Ve,C.value)]}else return un(be,E.value,C.value)}function oe(be){D.value=be}function Fe(be,Ve){const{"onUpdate:formattedValue":Xe,onUpdateFormattedValue:pe}=e;Xe&&rt(Xe,be,Ve),pe&&rt(pe,be,Ve)}function K(be,Ve){const{"onUpdate:value":Xe,onUpdateValue:pe,onChange:Ge}=e,{nTriggerFormChange:_t,nTriggerFormInput:Te}=a,Ye=se(be);Ve.doConfirm&&J(be,Ye),pe&&rt(pe,be,Ye),Xe&&rt(Xe,be,Ye),Ge&&rt(Ge,be,Ye),A.value=be,Fe(Ye,be),_t(),Te()}function Z(){const{onClear:be}=e;be==null||be()}function J(be,Ve){const{onConfirm:Xe}=e;Xe&&Xe(be,Ve)}function ae(be){const{onFocus:Ve}=e,{nTriggerFormFocus:Xe}=a;Ve&&rt(Ve,be),Xe()}function Ie(be){const{onBlur:Ve}=e,{nTriggerFormBlur:Xe}=a;Ve&&rt(Ve,be),Xe()}function de(be){const{"onUpdate:show":Ve,onUpdateShow:Xe}=e;Ve&&rt(Ve,be),Xe&&rt(Xe,be),f.value=be}function Le(be){be.key==="Escape"&&y.value&&(Aa(be),Rt({returnFocus:!0}))}function xe(be){be.key==="Escape"&&y.value&&Aa(be)}function Qe(){var be;de(!1),(be=l.value)===null||be===void 0||be.deactivate(),Z()}function De(){var be;(be=l.value)===null||be===void 0||be.deactivate(),Z()}function ne(){Rt({returnFocus:!0})}function ue(be){var Ve;y.value&&!(!((Ve=g.value)===null||Ve===void 0)&&Ve.contains(Nr(be)))&&Rt({returnFocus:!1})}function he(be){Rt({returnFocus:!0,disableUpdateOnClose:be})}function Ae(be,Ve){Ve?K(be,{doConfirm:!1}):oe(be)}function ce(){const be=D.value;K(Array.isArray(be)?[be[0],be[1]]:be,{doConfirm:!0})}function Je(){const{value:be}=D;N.value?(Array.isArray(be)||be===null)&&_e(be):Array.isArray(be)||ye(be)}function ye(be){be===null?M.value="":M.value=un(be,k.value,C.value)}function _e(be){if(be===null)B.value="",z.value="";else{const Ve=C.value;B.value=un(be[0],k.value,Ve),z.value=un(be[1],k.value,Ve)}}function Ce(){y.value||ot()}function Be(be){var Ve;!((Ve=b.value)===null||Ve===void 0)&&Ve.$el.contains(be.relatedTarget)||(Ie(be),Je(),Rt({returnFocus:!1}))}function Se(){r.value||(Je(),Rt({returnFocus:!1}))}function R(be){if(be===""){K(null,{doConfirm:!1}),D.value=null,M.value="";return}const Ve=ki(be,k.value,new Date,C.value);ji(Ve)?(K(vt(Ve),{doConfirm:!1}),Je()):M.value=be}function we(be,{source:Ve}){if(be[0]===""&&be[1]===""){K(null,{doConfirm:!1}),D.value=null,B.value="",z.value="";return}const[Xe,pe]=be,Ge=ki(Xe,k.value,new Date,C.value),_t=ki(pe,k.value,new Date,C.value);if(ji(Ge)&&ji(_t)){let Te=vt(Ge),Ye=vt(_t);_t{Je()}),Je(),wt(y,be=>{be||(D.value=x.value)});const at=p$(e,D),gt=v$(e,D);Rn(Hc,Object.assign(Object.assign(Object.assign({mergedClsPrefixRef:h,mergedThemeRef:Y,timePickerSizeRef:U,localeRef:i,dateLocaleRef:s,firstDayOfWeekRef:ut(e,"firstDayOfWeek"),isDateDisabledRef:ut(e,"isDateDisabled"),rangesRef:ut(e,"ranges"),timePickerPropsRef:ut(e,"timePickerProps"),closeOnSelectRef:ut(e,"closeOnSelect"),updateValueOnCloseRef:ut(e,"updateValueOnClose"),monthFormatRef:ut(e,"monthFormat"),yearFormatRef:ut(e,"yearFormat"),quarterFormatRef:ut(e,"quarterFormat"),yearRangeRef:ut(e,"yearRange")},at),gt),{datePickerSlots:t}));const re={focus:()=>{var be;(be=l.value)===null||be===void 0||be.focus()},blur:()=>{var be;(be=l.value)===null||be===void 0||be.blur()}},me=W(()=>{const{common:{cubicBezierEaseInOut:be},self:{iconColor:Ve,iconColorDisabled:Xe}}=Y.value;return{"--n-bezier":be,"--n-icon-color-override":Ve,"--n-icon-color-disabled-override":Xe}}),je=m?Bn("date-picker-trigger",void 0,me,e):void 0,it=W(()=>{const{type:be}=e,{common:{cubicBezierEaseInOut:Ve},self:{calendarTitleFontSize:Xe,calendarDaysFontSize:pe,itemFontSize:Ge,itemTextColor:_t,itemColorDisabled:Te,itemColorIncluded:Ye,itemColorHover:ft,itemColorActive:Dt,itemBorderRadius:Yt,itemTextColorDisabled:jt,itemTextColorActive:Xt,panelColor:Ln,panelTextColor:On,arrowColor:rn,calendarTitleTextColor:on,panelActionDividerColor:Cn,panelHeaderDividerColor:mn,calendarDaysDividerColor:Ut,panelBoxShadow:nn,panelBorderRadius:Ft,calendarTitleFontWeight:an,panelExtraFooterPadding:ln,panelActionPadding:bi,itemSize:hi,itemCellWidth:fi,itemCellHeight:ei,scrollItemWidth:Ee,scrollItemHeight:Ze,calendarTitlePadding:mt,calendarTitleHeight:At,calendarDaysHeight:Zt,calendarDaysTextColor:Kt,arrowSize:Hn,panelHeaderPadding:Yn,calendarDividerColor:_n,calendarTitleGridTempateColumns:ti,iconColor:Bi,iconColorDisabled:Hi,scrollItemBorderRadius:Ni,calendarTitleColorHover:Ei,[Mt("calendarLeftPadding",be)]:cs,[Mt("calendarRightPadding",be)]:ds}}=Y.value;return{"--n-bezier":Ve,"--n-panel-border-radius":Ft,"--n-panel-color":Ln,"--n-panel-box-shadow":nn,"--n-panel-text-color":On,"--n-panel-header-padding":Yn,"--n-panel-header-divider-color":mn,"--n-calendar-left-padding":cs,"--n-calendar-right-padding":ds,"--n-calendar-title-color-hover":Ei,"--n-calendar-title-height":At,"--n-calendar-title-padding":mt,"--n-calendar-title-font-size":Xe,"--n-calendar-title-font-weight":an,"--n-calendar-title-text-color":on,"--n-calendar-title-grid-template-columns":ti,"--n-calendar-days-height":Zt,"--n-calendar-days-divider-color":Ut,"--n-calendar-days-font-size":pe,"--n-calendar-days-text-color":Kt,"--n-calendar-divider-color":_n,"--n-panel-action-padding":bi,"--n-panel-extra-footer-padding":ln,"--n-panel-action-divider-color":Cn,"--n-item-font-size":Ge,"--n-item-border-radius":Yt,"--n-item-size":hi,"--n-item-cell-width":fi,"--n-item-cell-height":ei,"--n-item-text-color":_t,"--n-item-color-included":Ye,"--n-item-color-disabled":Te,"--n-item-color-hover":ft,"--n-item-color-active":Dt,"--n-item-text-color-disabled":jt,"--n-item-text-color-active":Xt,"--n-scroll-item-width":Ee,"--n-scroll-item-height":Ze,"--n-scroll-item-border-radius":Ni,"--n-arrow-size":Hn,"--n-arrow-color":rn,"--n-icon-color":Bi,"--n-icon-color-disabled":Hi}}),dt=m?Bn("date-picker",W(()=>e.type),it,e):void 0;return Object.assign(Object.assign({},re),{mergedStatus:o,mergedClsPrefix:h,mergedBordered:u,namespace:v,uncontrolledValue:A,pendingValue:D,panelInstRef:b,triggerElRef:g,inputInstRef:l,isMounted:Ba(),displayTime:M,displayStartTime:B,displayEndTime:z,mergedShow:y,adjustedTo:di(e),isRange:N,localizedStartPlaceholder:j,localizedEndPlaceholder:G,mergedSize:d,mergedDisabled:r,localizedPlacehoder:V,isValueInvalid:at.isValueInvalidRef,isStartValueInvalid:gt.isStartValueInvalidRef,isEndValueInvalid:gt.isEndValueInvalidRef,handleInputKeydown:xe,handleClickOutside:ue,handleKeydown:Le,handleClear:Qe,handlePanelClear:De,handleTriggerClick:ht,handleInputActivate:Ce,handleInputDeactivate:Se,handleInputFocus:Ne,handleInputBlur:Be,handlePanelTabOut:ne,handlePanelClose:he,handleRangeUpdateValue:we,handleSingleUpdateValue:R,handlePanelUpdateValue:Ae,handlePanelConfirm:ce,mergedTheme:Y,actions:te,triggerCssVars:m?void 0:me,triggerThemeClass:je==null?void 0:je.themeClass,triggerOnRender:je==null?void 0:je.onRender,cssVars:m?void 0:it,themeClass:dt==null?void 0:dt.themeClass,onRender:dt==null?void 0:dt.onRender,onNextMonth:e.onNextMonth,onPrevMonth:e.onPrevMonth,onNextYear:e.onNextYear,onPrevYear:e.onPrevYear})},render(){const{clearable:e,triggerOnRender:t,mergedClsPrefix:n,$slots:i}=this,s={onUpdateValue:this.handlePanelUpdateValue,onTabOut:this.handlePanelTabOut,onClose:this.handlePanelClose,onClear:this.handlePanelClear,onKeydown:this.handleKeydown,onConfirm:this.handlePanelConfirm,ref:"panelInstRef",value:this.pendingValue,active:this.mergedShow,actions:this.actions,shortcuts:this.shortcuts,style:this.cssVars,defaultTime:this.defaultTime,themeClass:this.themeClass,panel:this.panel,inputReadonly:this.inputReadonly||this.mergedDisabled,onRender:this.onRender,onNextMonth:this.onNextMonth,onPrevMonth:this.onPrevMonth,onNextYear:this.onNextYear,onPrevYear:this.onPrevYear,timerPickerFormat:this.timerPickerFormat,dateFormat:this.dateFormat,calendarDayFormat:this.calendarDayFormat,calendarHeaderYearFormat:this.calendarHeaderYearFormat,calendarHeaderMonthFormat:this.calendarHeaderMonthFormat,calendarHeaderMonthYearSeparator:this.calendarHeaderMonthYearSeparator,calendarHeaderMonthBeforeYear:this.calendarHeaderMonthBeforeYear},a=()=>{const{type:r}=this;return r==="datetime"?H(c$,Object.assign({},s,{defaultCalendarStartTime:this.defaultCalendarStartTime}),i):r==="daterange"?H(T3,Object.assign({},s,{defaultCalendarStartTime:this.defaultCalendarStartTime,defaultCalendarEndTime:this.defaultCalendarEndTime,bindCalendarMonths:this.bindCalendarMonths}),i):r==="datetimerange"?H(d$,Object.assign({},s,{defaultCalendarStartTime:this.defaultCalendarStartTime,defaultCalendarEndTime:this.defaultCalendarEndTime,bindCalendarMonths:this.bindCalendarMonths}),i):r==="month"||r==="year"||r==="quarter"?H(nb,Object.assign({},s,{type:r,key:r})):r==="monthrange"||r==="yearrange"||r==="quarterrange"?H(u$,Object.assign({},s,{type:r})):H(R3,Object.assign({},s,{type:r,defaultCalendarStartTime:this.defaultCalendarStartTime}),i)};if(this.panel)return a();t==null||t();const d={bordered:this.mergedBordered,size:this.mergedSize,passivelyActivated:!0,disabled:this.mergedDisabled,readonly:this.inputReadonly||this.mergedDisabled,clearable:e,onClear:this.handleClear,onClick:this.handleTriggerClick,onKeydown:this.handleInputKeydown,onActivate:this.handleInputActivate,onDeactivate:this.handleInputDeactivate,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur};return H("div",{ref:"triggerElRef",class:[`${n}-date-picker`,this.mergedDisabled&&`${n}-date-picker--disabled`,this.isRange&&`${n}-date-picker--range`,this.triggerThemeClass],style:this.triggerCssVars,onKeydown:this.handleKeydown},H(No,null,{default:()=>[H(Uo,null,{default:()=>this.isRange?H(Oi,Object.assign({ref:"inputInstRef",status:this.mergedStatus,value:[this.displayStartTime,this.displayEndTime],placeholder:[this.localizedStartPlaceholder,this.localizedEndPlaceholder],textDecoration:[this.isStartValueInvalid?"line-through":"",this.isEndValueInvalid?"line-through":""],pair:!0,onUpdateValue:this.handleRangeUpdateValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,internalForceFocus:this.mergedShow,internalDeactivateOnEnter:!0},d),{separator:()=>this.separator===void 0?Jt(i.separator,()=>[H(Un,{clsPrefix:n,class:`${n}-date-picker-icon`},{default:()=>H(DD,null)})]):this.separator,[e?"clear-icon-placeholder":"suffix"]:()=>Jt(i["date-icon"],()=>[H(Un,{clsPrefix:n,class:`${n}-date-picker-icon`},{default:()=>H(Pv,null)})])}):H(Oi,Object.assign({ref:"inputInstRef",status:this.mergedStatus,value:this.displayTime,placeholder:this.localizedPlacehoder,textDecoration:this.isValueInvalid&&!this.isRange?"line-through":"",onUpdateValue:this.handleSingleUpdateValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,internalForceFocus:this.mergedShow,internalDeactivateOnEnter:!0},d),{[e?"clear-icon-placeholder":"suffix"]:()=>H(Un,{clsPrefix:n,class:`${n}-date-picker-icon`},{default:()=>Jt(i["date-icon"],()=>[H(Pv,null)])})})}),H(zo,{show:this.mergedShow,containerClass:this.namespace,to:this.adjustedTo,teleportDisabled:this.adjustedTo===di.tdkey,placement:this.placement},{default:()=>H(xi,{name:"fade-in-scale-up-transition",appear:this.isMounted},{default:()=>this.mergedShow?ct(a(),[[Kr,this.handleClickOutside,void 0,{capture:!0}]]):null})})]}))}});function Ka(){const e=zt(rw,null);return e===null&&nm("use-message","No outer founded. See prerequisite in https://www.naiveui.com/en-US/os-theme/components/message for more details. If you want to use `useMessage` outside setup, please check https://www.naiveui.com/zh-CN/os-theme/components/message#Q-&-A."),e}function m$(e){const{textColorDisabled:t}=e;return{iconColorDisabled:t}}const _$=ow({name:"InputNumber",common:qg,peers:{Button:lw,Input:aw},self:m$}),y$=Ke([Re("input-number-suffix",` + display: inline-block; + margin-right: 10px; + `),Re("input-number-prefix",` + display: inline-block; + margin-left: 10px; + `)]);function b$(e){return e==null||typeof e=="string"&&e.trim()===""?null:Number(e)}function w$(e){return e.includes(".")&&(/^(-)?\d+.*(\.|0)$/.test(e)||/^-?\d*$/.test(e))||e==="-"||e==="-0"}function Wd(e){return e==null?!0:!Number.isNaN(e)}function cg(e,t){return typeof e!="number"?"":t===void 0?String(e):e.toFixed(t)}function jd(e){if(e===null)return null;if(typeof e=="number")return e;{const t=Number(e);return Number.isNaN(t)?null:t}}const dg=800,ug=100,S$=Object.assign(Object.assign({},Ht.props),{autofocus:Boolean,loading:{type:Boolean,default:void 0},placeholder:String,defaultValue:{type:Number,default:null},value:Number,step:{type:[Number,String],default:1},min:[Number,String],max:[Number,String],size:String,disabled:{type:Boolean,default:void 0},validator:Function,bordered:{type:Boolean,default:void 0},showButton:{type:Boolean,default:!0},buttonPlacement:{type:String,default:"right"},inputProps:Object,readonly:Boolean,clearable:Boolean,keyboard:{type:Object,default:{}},updateValueOnInput:{type:Boolean,default:!0},round:{type:Boolean,default:void 0},parse:Function,format:Function,precision:Number,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onChange:[Function,Array]}),qu=$e({name:"InputNumber",props:S$,setup(e){const{mergedBorderedRef:t,mergedClsPrefixRef:n,mergedRtlRef:i}=bn(e),s=Ht("InputNumber","-input-number",y$,_$,e,n),{localeRef:a}=rs("InputNumber"),d=_r(e),{mergedSizeRef:r,mergedDisabledRef:o,mergedStatusRef:c}=d,h=F(null),u=F(null),v=F(null),m=F(e.defaultValue),b=ut(e,"value"),g=Qn(b,m),l=F(""),f=ne=>{const ue=String(ne).split(".")[1];return ue?ue.length:0},p=ne=>{const ue=[e.min,e.max,e.step,ne].map(he=>he===void 0?0:f(he));return Math.max(...ue)},y=en(()=>{const{placeholder:ne}=e;return ne!==void 0?ne:a.value.placeholder}),C=en(()=>{const ne=jd(e.step);return ne!==null?ne===0?1:Math.abs(ne):1}),k=en(()=>{const ne=jd(e.min);return ne!==null?ne:null}),E=en(()=>{const ne=jd(e.max);return ne!==null?ne:null}),I=()=>{const{value:ne}=g;if(Wd(ne)){const{format:ue,precision:he}=e;ue?l.value=ue(ne):ne===null||he===void 0||f(ne)>he?l.value=cg(ne,void 0):l.value=cg(ne,he)}else l.value=String(ne)};I();const S=ne=>{const{value:ue}=g;if(ne===ue){I();return}const{"onUpdate:value":he,onUpdateValue:Ae,onChange:ce}=e,{nTriggerFormInput:Je,nTriggerFormChange:ye}=d;ce&&rt(ce,ne),Ae&&rt(Ae,ne),he&&rt(he,ne),m.value=ne,Je(),ye()},P=({offset:ne,doUpdateIfValid:ue,fixPrecision:he,isInputing:Ae})=>{const{value:ce}=l;if(Ae&&w$(ce))return!1;const Je=(e.parse||b$)(ce);if(Je===null)return ue&&S(null),null;if(Wd(Je)){const ye=f(Je),{precision:_e}=e;if(_e!==void 0&&_eBe){if(!ue||Ae)return!1;Ce=Be}if(Se!==null&&CeP({offset:0,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})===!1),L=en(()=>{const{value:ne}=g;if(e.validator&&ne===null)return!1;const{value:ue}=C;return P({offset:-ue,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1}),x=en(()=>{const{value:ne}=g;if(e.validator&&ne===null)return!1;const{value:ue}=C;return P({offset:+ue,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1});function D(ne){const{onFocus:ue}=e,{nTriggerFormFocus:he}=d;ue&&rt(ue,ne),he()}function M(ne){var ue,he;if(ne.target===((ue=h.value)===null||ue===void 0?void 0:ue.wrapperElRef))return;const Ae=P({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0});if(Ae!==!1){const ye=(he=h.value)===null||he===void 0?void 0:he.inputElRef;ye&&(ye.value=String(Ae||"")),g.value===Ae&&I()}else I();const{onBlur:ce}=e,{nTriggerFormBlur:Je}=d;ce&&rt(ce,ne),Je(),hn(()=>{I()})}function B(ne){const{onClear:ue}=e;ue&&rt(ue,ne)}function z(){const{value:ne}=x;if(!ne){Z();return}const{value:ue}=g;if(ue===null)e.validator||S(V());else{const{value:he}=C;P({offset:he,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}function Y(){const{value:ne}=L;if(!ne){Fe();return}const{value:ue}=g;if(ue===null)e.validator||S(V());else{const{value:he}=C;P({offset:-he,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}const U=D,N=M;function V(){if(e.validator)return null;const{value:ne}=k,{value:ue}=E;return ne!==null?Math.max(0,ne):ue!==null?Math.min(0,ue):0}function j(ne){B(ne),S(null)}function G(ne){var ue,he,Ae;!((ue=v.value)===null||ue===void 0)&&ue.$el.contains(ne.target)&&ne.preventDefault(),!((he=u.value)===null||he===void 0)&&he.$el.contains(ne.target)&&ne.preventDefault(),(Ae=h.value)===null||Ae===void 0||Ae.activate()}let te=null,se=null,oe=null;function Fe(){oe&&(window.clearTimeout(oe),oe=null),te&&(window.clearInterval(te),te=null)}let K=null;function Z(){K&&(window.clearTimeout(K),K=null),se&&(window.clearInterval(se),se=null)}function J(){Fe(),oe=window.setTimeout(()=>{te=window.setInterval(()=>{Y()},ug)},dg),zn("mouseup",document,Fe,{once:!0})}function ae(){Z(),K=window.setTimeout(()=>{se=window.setInterval(()=>{z()},ug)},dg),zn("mouseup",document,Z,{once:!0})}const Ie=()=>{se||z()},de=()=>{te||Y()};function Le(ne){var ue,he;if(ne.key==="Enter"){if(ne.target===((ue=h.value)===null||ue===void 0?void 0:ue.wrapperElRef))return;P({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&((he=h.value)===null||he===void 0||he.deactivate())}else if(ne.key==="ArrowUp"){if(!x.value||e.keyboard.ArrowUp===!1)return;ne.preventDefault(),P({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&z()}else if(ne.key==="ArrowDown"){if(!L.value||e.keyboard.ArrowDown===!1)return;ne.preventDefault(),P({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&Y()}}function xe(ne){l.value=ne,e.updateValueOnInput&&!e.format&&!e.parse&&e.precision===void 0&&P({offset:0,doUpdateIfValid:!0,isInputing:!0,fixPrecision:!1})}wt(g,()=>{I()});const Qe={focus:()=>{var ne;return(ne=h.value)===null||ne===void 0?void 0:ne.focus()},blur:()=>{var ne;return(ne=h.value)===null||ne===void 0?void 0:ne.blur()},select:()=>{var ne;return(ne=h.value)===null||ne===void 0?void 0:ne.select()}},De=Rs("InputNumber",i,n);return Object.assign(Object.assign({},Qe),{rtlEnabled:De,inputInstRef:h,minusButtonInstRef:u,addButtonInstRef:v,mergedClsPrefix:n,mergedBordered:t,uncontrolledValue:m,mergedValue:g,mergedPlaceholder:y,displayedValueInvalid:A,mergedSize:r,mergedDisabled:o,displayedValue:l,addable:x,minusable:L,mergedStatus:c,handleFocus:U,handleBlur:N,handleClear:j,handleMouseDown:G,handleAddClick:Ie,handleMinusClick:de,handleAddMousedown:ae,handleMinusMousedown:J,handleKeyDown:Le,handleUpdateDisplayedValue:xe,mergedTheme:s,inputThemeOverrides:{paddingSmall:"0 8px 0 10px",paddingMedium:"0 8px 0 12px",paddingLarge:"0 8px 0 14px"},buttonThemeOverrides:W(()=>{const{self:{iconColorDisabled:ne}}=s.value,[ue,he,Ae,ce]=cw(ne);return{textColorTextDisabled:`rgb(${ue}, ${he}, ${Ae})`,opacityDisabled:`${ce}`}})})},render(){const{mergedClsPrefix:e,$slots:t}=this,n=()=>H(xs,{text:!0,disabled:!this.minusable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleMinusClick,onMousedown:this.handleMinusMousedown,ref:"minusButtonInstRef"},{icon:()=>Jt(t["minus-icon"],()=>[H(Un,{clsPrefix:e},{default:()=>H(PD,null)})])}),i=()=>H(xs,{text:!0,disabled:!this.addable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleAddClick,onMousedown:this.handleAddMousedown,ref:"addButtonInstRef"},{icon:()=>Jt(t["add-icon"],()=>[H(Un,{clsPrefix:e},{default:()=>H(kD,null)})])});return H("div",{class:[`${e}-input-number`,this.rtlEnabled&&`${e}-input-number--rtl`]},H(Oi,{ref:"inputInstRef",autofocus:this.autofocus,status:this.mergedStatus,bordered:this.mergedBordered,loading:this.loading,value:this.displayedValue,onUpdateValue:this.handleUpdateDisplayedValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,builtinThemeOverrides:this.inputThemeOverrides,size:this.mergedSize,placeholder:this.mergedPlaceholder,disabled:this.mergedDisabled,readonly:this.readonly,round:this.round,textDecoration:this.displayedValueInvalid?"line-through":void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onClear:this.handleClear,clearable:this.clearable,inputProps:this.inputProps,internalLoadingBeforeSuffix:!0},{prefix:()=>{var s;return this.showButton&&this.buttonPlacement==="both"?[n(),qi(t.prefix,a=>a?H("span",{class:`${e}-input-number-prefix`},a):null)]:(s=t.prefix)===null||s===void 0?void 0:s.call(t)},suffix:()=>{var s;return this.showButton?[qi(t.suffix,a=>a?H("span",{class:`${e}-input-number-suffix`},a):null),this.buttonPlacement==="right"?n():null,i()]:(s=t.suffix)===null||s===void 0?void 0:s.call(t)}}))}}),ab=ui("n-popconfirm"),lb={positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},onPositiveClick:{type:Function,required:!0},onNegativeClick:{type:Function,required:!0}},hg=Qg(lb),C$=$e({name:"NPopconfirmPanel",props:lb,setup(e){const{localeRef:t}=rs("Popconfirm"),{inlineThemeDisabled:n}=bn(),{mergedClsPrefixRef:i,mergedThemeRef:s,props:a}=zt(ab),d=W(()=>{const{common:{cubicBezierEaseInOut:o},self:{fontSize:c,iconSize:h,iconColor:u}}=s.value;return{"--n-bezier":o,"--n-font-size":c,"--n-icon-size":h,"--n-icon-color":u}}),r=n?Bn("popconfirm-panel",void 0,d,a):void 0;return Object.assign(Object.assign({},rs("Popconfirm")),{mergedClsPrefix:i,cssVars:n?void 0:d,localizedPositiveText:W(()=>e.positiveText||t.value.positiveText),localizedNegativeText:W(()=>e.negativeText||t.value.negativeText),positiveButtonProps:ut(a,"positiveButtonProps"),negativeButtonProps:ut(a,"negativeButtonProps"),handlePositiveClick(o){e.onPositiveClick(o)},handleNegativeClick(o){e.onNegativeClick(o)},themeClass:r==null?void 0:r.themeClass,onRender:r==null?void 0:r.onRender})},render(){var e;const{mergedClsPrefix:t,showIcon:n,$slots:i}=this,s=Jt(i.action,()=>this.negativeText===null&&this.positiveText===null?[]:[this.negativeText!==null&&H(yn,Object.assign({size:"small",onClick:this.handleNegativeClick},this.negativeButtonProps),{default:()=>this.localizedNegativeText}),this.positiveText!==null&&H(yn,Object.assign({size:"small",type:"primary",onClick:this.handlePositiveClick},this.positiveButtonProps),{default:()=>this.localizedPositiveText})]);return(e=this.onRender)===null||e===void 0||e.call(this),H("div",{class:[`${t}-popconfirm__panel`,this.themeClass],style:this.cssVars},qi(i.default,a=>n||a?H("div",{class:`${t}-popconfirm__body`},n?H("div",{class:`${t}-popconfirm__icon`},Jt(i.icon,()=>[H(Un,{clsPrefix:t},{default:()=>H(dw,null)})])):null,a):null),s?H("div",{class:[`${t}-popconfirm__action`]},s):null)}}),k$=Re("popconfirm",[tt("body",` + font-size: var(--n-font-size); + display: flex; + align-items: center; + flex-wrap: nowrap; + position: relative; + `,[tt("icon",` + display: flex; + font-size: var(--n-icon-size); + color: var(--n-icon-color); + transition: color .3s var(--n-bezier); + margin: 0 8px 0 0; + `)]),tt("action",` + display: flex; + justify-content: flex-end; + `,[Ke("&:not(:first-child)","margin-top: 8px"),Re("button",[Ke("&:not(:last-child)","margin-right: 8px;")])])]),x$=Object.assign(Object.assign(Object.assign({},Ht.props),Wr),{positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},trigger:{type:String,default:"click"},positiveButtonProps:Object,negativeButtonProps:Object,onPositiveClick:Function,onNegativeClick:Function}),kl=$e({name:"Popconfirm",props:x$,__popover__:!0,setup(e){const{mergedClsPrefixRef:t}=bn(),n=Ht("Popconfirm","-popconfirm",k$,uw,e,t),i=F(null);function s(r){var o;if(!(!((o=i.value)===null||o===void 0)&&o.getMergedShow()))return;const{onPositiveClick:c,"onUpdate:show":h}=e;Promise.resolve(c?c(r):!0).then(u=>{var v;u!==!1&&((v=i.value)===null||v===void 0||v.setShow(!1),h&&rt(h,!1))})}function a(r){var o;if(!(!((o=i.value)===null||o===void 0)&&o.getMergedShow()))return;const{onNegativeClick:c,"onUpdate:show":h}=e;Promise.resolve(c?c(r):!0).then(u=>{var v;u!==!1&&((v=i.value)===null||v===void 0||v.setShow(!1),h&&rt(h,!1))})}return Rn(ab,{mergedThemeRef:n,mergedClsPrefixRef:t,props:e}),{setShow(r){var o;(o=i.value)===null||o===void 0||o.setShow(r)},syncPosition(){var r;(r=i.value)===null||r===void 0||r.syncPosition()},mergedTheme:n,popoverInstRef:i,handlePositiveClick:s,handleNegativeClick:a}},render(){const{$slots:e,$props:t,mergedTheme:n}=this;return H(Ko,dh(t,hg,{theme:n.peers.Popover,themeOverrides:n.peerOverrides.Popover,internalExtraClass:["popconfirm"],ref:"popoverInstRef"}),{trigger:e.activator||e.trigger,default:()=>{const i=Oc(t,hg);return H(C$,Object.assign(Object.assign({},i),{onPositiveClick:this.handlePositiveClick,onNegativeClick:this.handleNegativeClick}),e)}})}}),R$=Ke([Ke("@keyframes spin-rotate",` + from { + transform: rotate(0); + } + to { + transform: rotate(360deg); + } + `),Re("spin-container",` + position: relative; + `,[Re("spin-body",` + position: absolute; + top: 50%; + left: 50%; + transform: translateX(-50%) translateY(-50%); + `,[hw()])]),Re("spin-body",` + display: inline-flex; + align-items: center; + justify-content: center; + flex-direction: column; + `),Re("spin",` + display: inline-flex; + height: var(--n-size); + width: var(--n-size); + font-size: var(--n-size); + color: var(--n-color); + `,[We("rotate",` + animation: spin-rotate 2s linear infinite; + `)]),Re("spin-description",` + display: inline-block; + font-size: var(--n-font-size); + color: var(--n-text-color); + transition: color .3s var(--n-bezier); + margin-top: 8px; + `),Re("spin-content",` + opacity: 1; + transition: opacity .3s var(--n-bezier); + pointer-events: all; + `,[We("spinning",` + user-select: none; + -webkit-user-select: none; + pointer-events: none; + opacity: var(--n-opacity-spinning); + `)])]),T$={small:20,medium:18,large:16},E$=Object.assign(Object.assign({},Ht.props),{contentClass:String,contentStyle:[Object,String],description:String,stroke:String,size:{type:[String,Number],default:"medium"},show:{type:Boolean,default:!0},strokeWidth:Number,rotate:{type:Boolean,default:!0},spinning:{type:Boolean,validator:()=>!0,default:void 0},delay:Number}),P$=$e({name:"Spin",props:E$,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n}=bn(e),i=Ht("Spin","-spin",R$,fw,e,t),s=W(()=>{const{size:o}=e,{common:{cubicBezierEaseInOut:c},self:h}=i.value,{opacitySpinning:u,color:v,textColor:m}=h,b=typeof o=="number"?Wn(o):h[Mt("size",o)];return{"--n-bezier":c,"--n-opacity-spinning":u,"--n-size":b,"--n-color":v,"--n-text-color":m}}),a=n?Bn("spin",W(()=>{const{size:o}=e;return typeof o=="number"?String(o):o[0]}),s,e):void 0,d=Mh(e,["spinning","show"]),r=F(!1);return Yi(o=>{let c;if(d.value){const{delay:h}=e;if(h){c=window.setTimeout(()=>{r.value=!0},h),o(()=>{clearTimeout(c)});return}}r.value=d.value}),{mergedClsPrefix:t,active:r,mergedStrokeWidth:W(()=>{const{strokeWidth:o}=e;if(o!==void 0)return o;const{size:c}=e;return T$[typeof c=="number"?"medium":c]}),cssVars:n?void 0:s,themeClass:a==null?void 0:a.themeClass,onRender:a==null?void 0:a.onRender}},render(){var e,t;const{$slots:n,mergedClsPrefix:i,description:s}=this,a=n.icon&&this.rotate,d=(s||n.description)&&H("div",{class:`${i}-spin-description`},s||((e=n.description)===null||e===void 0?void 0:e.call(n))),r=n.icon?H("div",{class:[`${i}-spin-body`,this.themeClass]},H("div",{class:[`${i}-spin`,a&&`${i}-spin--rotate`],style:n.default?"":this.cssVars},n.icon()),d):H("div",{class:[`${i}-spin-body`,this.themeClass]},H(kc,{clsPrefix:i,style:n.default?"":this.cssVars,stroke:this.stroke,"stroke-width":this.mergedStrokeWidth,class:`${i}-spin`}),d);return(t=this.onRender)===null||t===void 0||t.call(this),n.default?H("div",{class:[`${i}-spin-container`,this.themeClass],style:this.cssVars},H("div",{class:[`${i}-spin-content`,this.active&&`${i}-spin-content--spinning`,this.contentClass],style:this.contentStyle},n),H(xi,{name:"fade-in-transition"},{default:()=>this.active?r:null})):r}});async function L$(){const{data:e}=await gn("/admin/api/users");return e}async function D$(e){const{data:t}=await gn(`/admin/api/users/${encodeURIComponent(e)}/reset-password`,{method:"POST"});return t}async function I$(e){await gn(`/admin/api/users/${encodeURIComponent(e)}/disable`,{method:"POST"})}async function M$(e){await gn(`/admin/api/users/${encodeURIComponent(e)}/admin`,{method:"POST"})}async function A$(e){await gn(`/admin/api/users/${encodeURIComponent(e)}/admin`,{method:"DELETE"})}async function $$(){const{data:e}=await gn("/admin/api/invitations");return e}async function O$(e){const{data:t}=await gn("/admin/api/invitations",{method:"POST",body:JSON.stringify(e)});return t&&typeof t=="object"&&"invites"in t?t.invites:[t]}async function F$(){const{data:e}=await gn("/admin/api/config");return e}async function B$(e){const{data:t}=await gn("/admin/api/config",{method:"PUT",body:JSON.stringify(e)});return t}async function H$(){const{data:e}=await gn("/admin/api/feishu");return e}async function N$(e){const{data:t}=await gn("/admin/api/feishu",{method:"PUT",body:JSON.stringify(e)});return t}async function U$(){const{data:e}=await gn("/admin/api/feishu/generate-key",{method:"POST"});return e.encrypt_key}async function z$(e){const t=new URLSearchParams;e.view&&t.set("view",e.view),e.bucket&&t.set("bucket",e.bucket),e.from&&t.set("from",e.from),e.to&&t.set("to",e.to);const{data:n}=await gn(`/admin/api/traffic?${t.toString()}`);return n}async function V$(){const{data:e}=await gn("/admin/api/health");return e}const K$={class:"field"},W$={class:"field-label"},j$={class:"field"},q$={class:"field-label"},Y$={class:"field"},G$={class:"field-label"},X$={class:"secret-msg"},J$={class:"secret-display"},Z$={key:0,class:"empty"},Q$=$e({__name:"Invitations",setup(e){const t=F([]),n=F(!0),i=F(!1),s=F(""),a=F(1),d=F(null),r=F([]),o=Ka(),{t:c}=Fo(),h={"data-testid":"invite-note",autocomplete:"off"},u={"data-testid":"invite-count"},v={"data-testid":"invite-expires"};function m(f){return im(f)}const b=W(()=>[{title:c("admin.invitationsTab.prefix"),key:"code_prefix",render:f=>H("code",{},f.code_prefix)},{title:c("admin.invitationsTab.note"),key:"note"},{title:c("admin.created"),key:"created_at",render:f=>m(f.created_at)},{title:c("admin.invitationsTab.expires"),key:"expires_at",render:f=>m(f.expires_at)},{title:c("admin.invitationsTab.consumed"),key:"consumed_at",render:f=>f.consumed_at?H("span",{},`${m(f.consumed_at)}${f.consumed_by?" · "+f.consumed_by:""}`):H(Hr,{size:"small",type:"default"},{default:()=>c("admin.invitationsTab.unused")})}]);async function g(){n.value=!0;try{t.value=await $$()}catch(f){f instanceof is&&o.error(c("admin.invitationsTab.loadFailed"))}finally{n.value=!1}}async function l(f){if(f.preventDefault(),!i.value){i.value=!0;try{const p=Math.max(1,Math.min(50,Math.round(a.value||1))),y=s.value.trim(),C={count:p};y&&(C.note=y),d.value!=null&&(C.expires_at=new Date(d.value).toISOString());const k=await O$(C);r.value=k,s.value="",d.value=null,a.value=1,await g()}catch(p){p instanceof is&&o.error(c("admin.invitationsTab.createFailed",{code:p.code}))}finally{i.value=!1}}}return It(g),(f,p)=>($(),Ct(w(Rc),{title:w(c)("admin.invitations"),bordered:!1},{default:qt(()=>[_("form",{onSubmit:l,autocomplete:"off",class:"create-form"},[Pe(w(Wi),{wrap:!1,align:"end"},{default:qt(()=>[_("div",K$,[_("label",W$,T(w(c)("admin.invitationsTab.note")),1),Pe(w(Oi),{value:s.value,"onUpdate:value":p[0]||(p[0]=y=>s.value=y),type:"text",placeholder:w(c)("common.optional"),"input-props":h},null,8,["value","placeholder"])]),_("div",j$,[_("label",q$,T(w(c)("admin.invitationsTab.count")),1),Pe(w(qu),{value:a.value,"onUpdate:value":p[1]||(p[1]=y=>a.value=y),min:1,max:50,"input-props":u},null,8,["value"])]),_("div",Y$,[_("label",G$,T(w(c)("admin.invitationsTab.expires")),1),Pe(w(g$),{value:d.value,"onUpdate:value":p[2]||(p[2]=y=>d.value=y),type:"datetime",clearable:"",placeholder:w(c)("common.optional"),"input-props":v},null,8,["value","placeholder"])]),Pe(w(yn),{type:"primary","attr-type":"submit",loading:i.value,disabled:i.value},{default:qt(()=>[et(T(w(c)("common.create")),1)]),_:1},8,["loading","disabled"])]),_:1})],32),($(!0),O(Me,null,st(r.value,(y,C)=>($(),Ct(w(dm),{key:C,type:"success","show-icon":!1,class:"secret-alert"},{default:qt(()=>[_("div",X$,T(w(c)("admin.invitationsTab.copyNow",{note:y.note?` (${y.note})`:""})),1),_("code",J$,T(y.plaintext),1)]),_:2},1024))),128)),Pe(w(Qy),{columns:b.value,data:t.value,loading:n.value,size:"small",bordered:!1,pagination:!1},null,8,["columns","data","loading"]),!n.value&&t.value.length===0?($(),O("p",Z$,T(w(c)("admin.invitationsTab.empty")),1)):Q("",!0)]),_:1},8,["title"]))}}),e4=kt(Q$,[["__scopeId","data-v-b7ce3097"]]),t4={class:"secret-msg"},n4={class:"secret-display"},i4={key:0,class:"form-error",role:"alert"},s4=$e({__name:"Users",setup(e){const t=F([]),n=F(!0),i=F(""),s=F([]);Ka();const{t:a}=Fo();function d(l){return im(l)}function r(l){if(l instanceof is){if(l.code==="last_admin")return a("admin.errors.lastAdmin");if(l.code==="cannot_demote_self")return a("admin.errors.cannotDemoteSelf")}return a("admin.errors.actionFailed")}async function o(){n.value=!0,i.value="";try{t.value=await L$()}catch(l){l instanceof is&&(i.value=a("admin.loadUsersFailed"))}finally{n.value=!1}}async function c(l){i.value="";try{await M$(l),await o()}catch(f){i.value=r(f)}}async function h(l){i.value="";try{await A$(l),await o()}catch(f){i.value=r(f)}}async function u(l,f){i.value="",s.value=[];try{const{plaintext:p}=await D$(l);s.value=[{label:a("admin.temporaryPasswordFor",{email:f}),plaintext:p}],await o()}catch(p){i.value=r(p)}}async function v(l){i.value="";try{await I$(l),await o()}catch(f){i.value=r(f)}}function m(l){return l.disabled_at?H(Hr,{size:"small",type:"error"},{default:()=>a("admin.disabled",{when:d(l.disabled_at)})}):l.is_admin?H(Hr,{size:"small",type:"success"},{default:()=>a("admin.userStatus.admin")}):H(Hr,{size:"small",type:"default"},{default:()=>a("admin.userStatus.active")})}function b(l){if(l.disabled_at)return null;const f=l.is_admin?H(kl,{onPositiveClick:()=>h(l.id)},{trigger:()=>H(yn,{size:"small","data-testid":`demote-${l.id}`},{default:()=>a("admin.demote")}),default:()=>a("admin.demoteConfirm")}):H(kl,{onPositiveClick:()=>c(l.id)},{trigger:()=>H(yn,{size:"small","data-testid":`promote-${l.id}`},{default:()=>a("admin.promote")}),default:()=>a("admin.promoteConfirm")}),p=H(kl,{onPositiveClick:()=>u(l.id,l.email)},{trigger:()=>H(yn,{size:"small","data-testid":`reset-${l.id}`},{default:()=>a("admin.resetPassword")}),default:()=>a("admin.resetPasswordConfirm")}),y=H(kl,{onPositiveClick:()=>v(l.id)},{trigger:()=>H(yn,{size:"small",type:"error","data-testid":`disable-${l.id}`},{default:()=>a("admin.disable")}),default:()=>a("admin.disableConfirm")});return H(Wi,{},{default:()=>[f,p,y]})}const g=W(()=>[{title:a("admin.email"),key:"email"},{title:a("admin.id"),key:"id",render:l=>H("code",{},l.id)},{title:a("admin.created"),key:"created_at",render:l=>d(l.created_at)},{title:a("admin.status"),key:"status",render:m},{title:a("admin.actions"),key:"actions",render:b}]);return It(o),(l,f)=>($(),Ct(w(Rc),{title:w(a)("admin.users"),bordered:!1},{default:qt(()=>[($(!0),O(Me,null,st(s.value,(p,y)=>($(),Ct(w(dm),{key:y,type:"success","show-icon":!1,class:"secret-alert"},{default:qt(()=>[_("div",t4,T(w(a)("admin.secretCopyOnce",{label:p.label})),1),_("code",n4,T(p.plaintext),1)]),_:2},1024))),128)),Pe(w(Qy),{columns:g.value,data:t.value,loading:n.value,size:"small",bordered:!1,pagination:!1},null,8,["columns","data","loading"]),i.value?($(),O("p",i4,T(i.value),1)):Q("",!0)]),_:1},8,["title"]))}}),r4=kt(s4,[["__scopeId","data-v-b54d534a"]]),o4={class:"hint"},a4={class:"muted"},l4={class:"muted"},c4={class:"muted"},d4={class:"warn"},u4={class:"muted"},h4={class:"muted version"},f4={key:1,class:"form-error",role:"alert"},p4=$e({__name:"Config",setup(e){const t=F(null),n=F(0),i=F(0),s=F(!1),a=F(!1),d=F(""),r=F(!0),o=F(!1),c=F(""),h=Ka(),{t:u}=Fo();function v(C){return C.split(` +`).map(k=>k.trim()).filter(Boolean)}function m(C,k){return C<0?u("admin.config.effectiveDisabled"):C===0?u("admin.config.effective",{value:k}):u("admin.config.effective",{value:C})}const b=W(()=>t.value?m(n.value,t.value.default_rate_limit_per_minute):""),g=W(()=>t.value?m(i.value,t.value.default_max_connections_per_key):"");async function l(){r.value=!0,c.value="";try{const C=await F$();t.value=C,n.value=C.rate_limit_per_minute,i.value=C.max_connections_per_key,s.value=C.debug,a.value=C.debug_payload,d.value=(C.allowed_origins??[]).join(` +`)}catch(C){C instanceof is&&(c.value=u("admin.config.loadFailed"))}finally{r.value=!1}}async function f(){if(!(!t.value||o.value)){c.value="",o.value=!0;try{const C=await B$({rate_limit_per_minute:Math.round(n.value),max_connections_per_key:Math.round(i.value),debug:s.value,debug_payload:a.value,allowed_origins:v(d.value)});t.value=C,n.value=C.rate_limit_per_minute,i.value=C.max_connections_per_key,s.value=C.debug,a.value=C.debug_payload,d.value=(C.allowed_origins??[]).join(` +`),h.success(u("setup.saved"))}catch(C){C instanceof is&&(c.value=u("admin.config.saveFailed"))}finally{o.value=!1}}}const p={"data-testid":"cfg-rate"},y={"data-testid":"cfg-conn"};return It(l),(C,k)=>($(),Ct(w(Rc),{title:w(u)("admin.config.runtimeLimits"),bordered:!1},{default:qt(()=>[_("p",o4,T(w(u)("admin.config.hint")),1),t.value?($(),Ct(w(sm),{key:0,"label-placement":"top","require-mark-placement":"right-hanging"},{default:qt(()=>[Pe(w(sr),{label:w(u)("admin.config.rateLimit"),"show-feedback":!1},{default:qt(()=>[Pe(w(Wi),{wrap:!1,align:"center"},{default:qt(()=>[Pe(w(qu),{value:n.value,"onUpdate:value":k[0]||(k[0]=E=>n.value=E),"show-button":!1,"input-props":p},null,8,["value"]),_("span",a4,T(b.value),1)]),_:1})]),_:1},8,["label"]),Pe(w(sr),{label:w(u)("admin.config.maxConnections"),"show-feedback":!1},{default:qt(()=>[Pe(w(Wi),{wrap:!1,align:"center"},{default:qt(()=>[Pe(w(qu),{value:i.value,"onUpdate:value":k[1]||(k[1]=E=>i.value=E),"show-button":!1,"input-props":y},null,8,["value"]),_("span",l4,T(g.value),1)]),_:1})]),_:1},8,["label"]),Pe(w(sr),{label:w(u)("admin.config.debug"),"show-feedback":!1},{default:qt(()=>[Pe(w(Wi),{align:"center",size:8},{default:qt(()=>[Pe(w(Kl),{value:s.value,"onUpdate:value":k[2]||(k[2]=E=>s.value=E),"data-testid":"cfg-debug"},null,8,["value"]),_("span",c4,T(w(u)("admin.config.debugHint")),1)]),_:1})]),_:1},8,["label"]),Pe(w(sr),{label:w(u)("admin.config.debugPayload"),"show-feedback":!1},{default:qt(()=>[Pe(w(Wi),{align:"center",size:8},{default:qt(()=>[Pe(w(Kl),{value:a.value,"onUpdate:value":k[3]||(k[3]=E=>a.value=E),"data-testid":"cfg-debug-payload"},null,8,["value"]),_("span",d4,T(w(u)("admin.config.debugPayloadWarn")),1)]),_:1})]),_:1},8,["label"]),Pe(w(sr),{label:w(u)("admin.config.allowedOrigins"),"show-feedback":!1},{default:qt(()=>[Pe(w(Wi),{vertical:"",size:4,style:{width:"100%"}},{default:qt(()=>[Pe(w(Oi),{value:d.value,"onUpdate:value":k[4]||(k[4]=E=>d.value=E),type:"textarea",placeholder:w(u)("admin.config.allowedOriginsPlaceholder"),autosize:{minRows:3,maxRows:10},"input-props":{"data-testid":"cfg-origins"}},null,8,["value","placeholder"]),_("span",u4,T(w(u)("admin.config.allowedOriginsHint")),1)]),_:1})]),_:1},8,["label"]),Pe(w(Wi),{class:"actions",align:"center"},{default:qt(()=>[Pe(w(yn),{type:"primary",loading:o.value,disabled:o.value,"data-testid":"cfg-save",onClick:f},{default:qt(()=>[et(T(w(u)("common.save")),1)]),_:1},8,["loading","disabled"]),_("span",h4,[et(T(w(u)("common.version"))+": ",1),_("code",null,T(t.value.version),1)])]),_:1})]),_:1})):Q("",!0),c.value?($(),O("p",f4,T(c.value),1)):Q("",!0)]),_:1},8,["title"]))}}),v4=kt(p4,[["__scopeId","data-v-be878b2d"]]),g4={class:"hint"},m4={key:0,class:"warn"},_4={class:"muted"},y4={class:"muted"},b4={key:1,class:"form-error",role:"alert"},w4=$e({__name:"FeishuConfig",setup(e){const t=F(null),n=F(!1),i=F(""),s=F(""),a=F(!1),d=F(!0),r=F(!1),o=F(""),c=Ka(),{t:h}=Fo();async function u(){d.value=!0,o.value="";try{const g=await H$();v(g)}catch(g){g instanceof is&&(o.value=h("admin.feishuConfig.loadFailed"))}finally{d.value=!1}}function v(g){t.value=g,n.value=g.enabled,i.value=g.base_url,s.value="",a.value=!1}async function m(){o.value="";try{s.value=await U$(),c.info(h("admin.feishuConfig.keyGenerated"))}catch(g){g instanceof is&&(o.value=h("admin.feishuConfig.saveFailed"))}}async function b(){if(!r.value){o.value="",r.value=!0;try{const g={enabled:n.value},l=s.value.trim();l&&(g.encrypt_key=l);const f=i.value.trim();f&&(g.base_url=f),a.value&&(g.force=!0);const p=await N$(g);v(p),c.success(h("setup.saved"))}catch(g){g instanceof is&&(o.value=g.status===409?h("admin.feishuConfig.rotateConflict"):h("admin.feishuConfig.saveFailed"))}finally{r.value=!1}}}return It(u),(g,l)=>($(),Ct(w(Rc),{title:w(h)("admin.feishuConfig.title"),bordered:!1},{default:qt(()=>[_("p",g4,T(w(h)("admin.feishuConfig.description")),1),t.value?($(),Ct(w(sm),{key:0,"label-placement":"top"},{default:qt(()=>[Pe(w(sr),{label:w(h)("admin.feishuConfig.enabled"),"show-feedback":!1},{default:qt(()=>[Pe(w(Kl),{value:n.value,"onUpdate:value":l[0]||(l[0]=f=>n.value=f),"data-testid":"feishu-enabled"},null,8,["value"])]),_:1},8,["label"]),Pe(w(sr),{label:w(h)("admin.feishuConfig.encryptKey"),"show-feedback":!1},{default:qt(()=>[Pe(w(Wi),{vertical:"",size:6,style:{width:"100%"}},{default:qt(()=>[Pe(w(Wi),{wrap:!1,align:"center",style:{width:"100%"}},{default:qt(()=>[Pe(w(Oi),{value:s.value,"onUpdate:value":l[1]||(l[1]=f=>s.value=f),type:"password","show-password-on":"click",placeholder:t.value.key_set?w(h)("admin.feishuConfig.keyKeepPlaceholder",{last4:t.value.key_last4??""}):w(h)("admin.feishuConfig.keyEmptyPlaceholder"),"data-testid":"feishu-key"},null,8,["value","placeholder"]),Pe(w(yn),{tertiary:"","data-testid":"feishu-generate",onClick:m},{default:qt(()=>[et(T(w(h)("admin.feishuConfig.generate")),1)]),_:1})]),_:1}),s.value?($(),O("span",m4,T(w(h)("admin.feishuConfig.keyCopyOnce")),1)):Q("",!0),s.value&&t.value.key_set?($(),Ct(w(Wi),{key:1,align:"center",size:8},{default:qt(()=>[Pe(w(Kl),{value:a.value,"onUpdate:value":l[2]||(l[2]=f=>a.value=f),size:"small","data-testid":"feishu-force"},null,8,["value"]),_("span",_4,T(w(h)("admin.feishuConfig.forceRotate")),1)]),_:1})):Q("",!0)]),_:1})]),_:1},8,["label"]),Pe(w(sr),{label:w(h)("admin.feishuConfig.baseUrl"),"show-feedback":!1},{default:qt(()=>[Pe(w(Oi),{value:i.value,"onUpdate:value":l[3]||(l[3]=f=>i.value=f),placeholder:"https://open.feishu.cn","data-testid":"feishu-base"},null,8,["value"])]),_:1},8,["label"]),Pe(w(Wi),{class:"actions",align:"center"},{default:qt(()=>[Pe(w(yn),{type:"primary",loading:r.value,disabled:r.value,"data-testid":"feishu-save",onClick:b},{default:qt(()=>[et(T(w(h)("common.save")),1)]),_:1},8,["loading","disabled"]),_("span",y4,T(t.value.running?w(h)("admin.feishuConfig.statusRunning"):w(h)("admin.feishuConfig.statusStopped")),1)]),_:1})]),_:1})):Q("",!0),o.value?($(),O("p",b4,T(o.value),1)):Q("",!0)]),_:1},8,["title"]))}}),S4=kt(w4,[["__scopeId","data-v-b32379d1"]]),gc={terminal:"#58a6ff",state:"#39c5cf",config:"#d29922",fs:"#bc8cff",preview:"#db6d28",filesystem:"#bc8cff",service:"#db6d28",control:"#d29922",other:"#8b949e"},fg=["#58a6ff","#39c5cf","#bc8cff","#db6d28","#d29922","#3fb950","#f85149","#79c0ff"];function C4(e){return new Date(`${e}T00:00:00Z`)}function cb(e){return e.toISOString().slice(0,10)}function Ul(e,t){const n=C4(e);return n.setUTCDate(n.getUTCDate()+t),cb(n)}function pg(e,t){const n=[];for(let i=e;i<=t;i=Ul(i,1))n.push(i);return n}function Yu(e,t=new Date){const n=cb(t),i=Ul(n,-(e-1)),s=Ul(i,-e);return{from:s,currentFrom:i,to:n,days:pg(i,n),previousDays:pg(s,Ul(i,-1))}}function Gu(e){const t=new Map;for(const n of e)t.set(n.user_id,n.email||n.user_id);return[...t].map(([n,i])=>({id:n,email:i})).sort((n,i)=>n.email.localeCompare(i.email))}function vg(e,t,n){return e.filter(i=>t.has(i.user_id)&&!!i.day&&n.has(i.day))}function Nc(e,t){return t==="bytes"?e.bytes:e.frames}function Mn(e,t){return e.reduce((n,i)=>n+Nc(i,t),0)}function Ss(e,t){return t===0?e===0?0:null:(e-t)/t*100}function k4(e,t,n){const i=new Set(n.days),s=new Set(n.previousDays),d=Gu(e).filter(o=>t.has(o.id)).map(o=>{const c=e.filter(b=>b.user_id===o.id),h=c.filter(b=>!!b.day&&i.has(b.day)),u=c.filter(b=>!!b.day&&s.has(b.day)),v=Mn(h,"bytes"),m=Mn(u,"bytes");return{id:o.id,email:o.email,bytes:v,frames:Mn(h,"frames"),outbound:Mn(h.filter(b=>b.direction===1),"bytes"),inbound:Mn(h.filter(b=>b.direction===0),"bytes"),previousBytes:m,trend:Ss(v,m),share:0,activeDays:new Set(h.map(b=>b.day)).size}}),r=d.reduce((o,c)=>o+c.bytes,0);for(const o of d)o.share=r?o.bytes/r*100:0;return d.sort((o,c)=>c.bytes-o.bytes||o.email.localeCompare(c.email))}function db(e){const t=new Map;for(const i of e){const s=i.category||"other",a=t.get(s)||{key:s,label:s,color:gc[s]||gc.other,bytes:0,frames:0,outbound:0,inbound:0};a.bytes+=i.bytes,a.frames+=i.frames,i.direction===1?a.outbound+=i.bytes:a.inbound+=i.bytes,t.set(s,a)}const n=[...t.values()].reduce((i,s)=>i+s.bytes,0);return[...t.values()].map(i=>({...i,share:n?i.bytes/n*100:0})).sort((i,s)=>s.bytes-i.bytes)}function x4(e,t){if(t==="group"){const i=e.category||"other";return{key:i,label:i,category:i}}const n=e.frame_type_name||String(e.frame_type??"?");return{key:String(e.frame_type??n),label:n,category:e.category||"other"}}function ub(e,t,n,i,s,a){const d=new Map(t.map((o,c)=>[o,c])),r=new Map;for(const o of e){const c=o.day?d.get(o.day):void 0;if(c===void 0||i==="out"&&o.direction!==1||i==="in"&&o.direction!==0)continue;const h=x4(o,n),u=a?`${o.user_id}:${h.key}`:h.key;let v=r.get(u);v||(v={key:u,label:h.label,userID:a?o.user_id:void 0,userLabel:a?o.email||o.user_id:void 0,category:h.category,color:n==="group"?gc[h.category]||gc.other:fg[r.size%fg.length],values:Array(t.length).fill(0),total:0},r.set(u,v));const m=Nc(o,s);v.values[c]+=m,v.total+=m}return[...r.values()].sort((o,c)=>c.total-o.total)}function hb(e,t,n){const i=new Map(t.map((d,r)=>[d,r])),s=Array(t.length).fill(0),a=Array(t.length).fill(0);for(const d of e){const r=d.day?i.get(d.day):void 0;r!==void 0&&((d.direction===1?a:s)[r]+=Nc(d,n))}return{inbound:s,outbound:a}}function gg(e,t,n){const i=Array(t.length).fill(0),s=new Map(t.map((a,d)=>[a,d]));for(const a of e){const d=a.day?s.get(a.day):void 0;d!==void 0&&(i[d]+=Nc(a,n))}return i}const R4={class:"traffic-dashboard"},T4={class:"traffic-titlebar"},E4=["aria-label","title","disabled"],P4={class:"scope-section platform-section"},L4={class:"scope-heading"},D4={class:"platform-strip","data-test":"platform-status"},I4={class:"platform-cell platform-health"},M4={class:"platform-cell"},A4={class:"platform-cell"},$4={class:"platform-cell"},O4={class:"platform-strip","data-test":"direct-metrics"},F4={class:"platform-cell"},B4={class:"platform-cell"},H4={class:"platform-cell"},N4={class:"platform-cell"},U4={class:"scope-section user-section"},z4={class:"user-heading"},V4={class:"filterbar"},K4=["aria-label"],W4=["data-test","onClick"],j4={key:0},q4={key:1},Y4={key:2},G4=["aria-label"],X4={class:"selector-head"},J4={class:"search-box"},Z4=["placeholder"],Q4={class:"selector-options"},eO=["checked","onChange"],tO=["data-test","onClick"],nO={key:0},iO={class:"selector-foot"},sO={key:0,class:"selection-empty","data-test":"traffic-selection-empty"},rO={key:0,class:"selection-banner"},oO=["aria-label"],aO={class:"kpi-strip"},lO={class:"timeline-panel"},cO={class:"panel-head timeline-head"},dO={class:"timeline-controls"},uO={class:"segmented"},hO={key:0},fO={class:"segmented"},pO=["onClick"],vO={class:"segmented"},gO={class:"chart-meta"},mO={key:0,class:"chart-empty"},_O={key:1,class:"svg-chart","data-test":"direction-chart"},yO=["aria-label"],bO={class:"grid-lines"},wO=["y1","y2"],SO=["points"],CO=["points"],kO=["x"],xO={class:"legend"},RO={key:2,class:"matrix-chart","data-test":"matrix-chart"},TO=["title"],EO={class:"matrix-cells"},PO=["title"],LO={key:3,class:"bar-chart","data-test":"stacked-chart"},DO={class:"bar-stack"},IO=["title"],MO={key:4,class:"series-legend"},AO={key:5,class:"timeline-table-wrap"},$O={class:"timeline-table"},OO={class:"lower-grid"},FO={class:"flat-panel category-panel"},BO={class:"panel-head"},HO={class:"category-list"},NO=["onClick"],UO={class:"category-name"},zO={class:"meter"},VO={class:"category-value"},KO={class:"flat-panel user-table-panel"},WO={class:"panel-head table-panel-head"},jO={class:"data-table-wrap"},qO={class:"data-table","data-test":"traffic-user-table"},YO={class:"share"},GO=["aria-label","data-test","onClick"],XO={class:"diagnostics"},JO={class:"panel-head"},ZO={class:"diagnostic-grid"},QO={class:"diagnostic-block"},eF=["title"],tF=["title"],nF={class:"diagnostic-block"},iF={class:"density-list"},sF={class:"user-drawer"},rF={class:"drawer-head"},oF=["aria-label"],aF={class:"drawer-kpis"},lF={class:"drawer-bars"},cF=["title"],dF=$e({__name:"Traffic",setup(e){const{t}=Fo(),n=Ka(),i=F([]),s=F(null),a=F(!1),d=F(7),r=F("bytes"),o=F("group"),c=F("all"),h=F([]),u=F(!1),v=F(!1),m=F(""),b=F(null),g=F("all"),l=F(null),f=F(null),p=W(()=>Yu(d.value)),y=W(()=>Gu(i.value)),C=W(()=>new Set(h.value)),k=W(()=>vg(i.value,C.value,new Set(p.value.days))),E=W(()=>vg(i.value,C.value,new Set(p.value.previousDays))),I=W(()=>y.value.filter(re=>C.value.has(re.id))),S=W(()=>{const re=m.value.trim().toLowerCase();return y.value.filter(me=>!re||me.email.toLowerCase().includes(re)||me.id.toLowerCase().includes(re))}),P=W(()=>y.value.length>0&&h.value.length===y.value.length),A=W(()=>Mn(k.value,"bytes")),L=W(()=>Mn(k.value,"frames")),x=W(()=>Mn(k.value.filter(re=>re.direction===1),"bytes")),D=W(()=>Mn(k.value.filter(re=>re.direction===0),"bytes")),M=W(()=>Mn(E.value,"bytes")),B=W(()=>Mn(E.value,"frames")),z=W(()=>Mn(E.value.filter(re=>re.direction===1),"bytes")),Y=W(()=>Mn(E.value.filter(re=>re.direction===0),"bytes")),U=W(()=>[{key:"total",label:t("admin.traffic.kpiTotal"),value:Se(A.value),trend:Ss(A.value,M.value)},{key:"out",label:t("admin.traffic.kpiOutbound"),value:Se(x.value),trend:Ss(x.value,z.value)},{key:"in",label:t("admin.traffic.kpiInbound"),value:Se(D.value),trend:Ss(D.value,Y.value)},{key:"frames",label:t("admin.traffic.kpiFrames"),value:R(L.value),trend:Ss(L.value,B.value)}]),N=W(()=>db(k.value)),V=W(()=>o.value==="direction"?[]:ub(k.value,p.value.days,o.value,c.value,r.value,I.value.length>1)),j=W(()=>hb(k.value,p.value.days,r.value)),G=W(()=>Math.max(1,...V.value.flatMap(re=>re.values),...j.value.inbound,...j.value.outbound)),te=W(()=>Math.max(1,...p.value.days.map((re,me)=>V.value.reduce((je,it)=>je+it.values[me],0)))),se=W(()=>V.value.slice(0,28)),oe=W(()=>I.value.length>1&&o.value!=="direction"),Fe=W(()=>{const re=g.value==="all"?i.value:i.value.filter(me=>(me.category||"other")===g.value);return k4(re,C.value,p.value)}),K=W(()=>Fe.value.map(re=>({label:`${re.email} · ${re.id}`,value:re.id}))),Z=W(()=>b.value?Fe.value.filter(re=>re.id===b.value):Fe.value),J=W(()=>Z.value.find(re=>re.id===l.value)||null),ae=W(()=>k.value.filter(re=>re.user_id===l.value)),Ie=W(()=>gg(ae.value,p.value.days,"bytes")),de=W(()=>Math.max(1,...Ie.value)),Le=W(()=>{const re=new Map;for(const me of ae.value){const je=me.frame_type_name||String(me.frame_type??"?"),it=re.get(je)||{name:je,category:me.category||"other",bytes:0,frames:0};it.bytes+=me.bytes,it.frames+=me.frames,re.set(je,it)}return[...re.values()].sort((me,je)=>je.bytes-me.bytes).slice(0,8)}),xe=W(()=>Z.value.slice(0,12).map(re=>{const me=k.value.filter(je=>je.user_id===re.id);return{user:re,values:gg(me,p.value.days,"bytes")}})),Qe=W(()=>Math.max(1,...xe.value.flatMap(re=>re.values))),De=W(()=>N.value.map(re=>({...re,density:re.frames?re.bytes/re.frames:0})).sort((re,me)=>me.density-re.density)),ne=W(()=>Math.max(1,...De.value.map(re=>re.density)));async function ue(){a.value=!0;const re=Yu(d.value);try{const[me,je]=await Promise.allSettled([z$({view:"detail",bucket:"day",from:re.from,to:re.to}),V$()]);if(me.status==="rejected")throw me.reason;const it=me.value,dt=je.status==="fulfilled"?je.value:null;i.value=it.rows,s.value=dt;const be=Gu(it.rows).map(Ve=>Ve.id);if(!u.value)h.value=be,u.value=!0;else{const Ve=new Set(be);h.value=h.value.filter(Xe=>Ve.has(Xe))}}catch(me){me instanceof is&&n.error(t("admin.traffic.loadFailed")),i.value=[]}finally{a.value=!1}}function he(re){d.value!==re&&(d.value=re,g.value="all",ue())}function Ae(re){o.value=re}function ce(re){h.value=C.value.has(re)?h.value.filter(me=>me!==re):[...h.value,re]}function Je(re){h.value=[re]}function ye(){h.value=y.value.map(re=>re.id)}function _e(){h.value=[]}function Ce(re){var me;v.value&&!((me=f.value)!=null&&me.contains(re.target))&&(v.value=!1)}function Be(re){return re===null?t("admin.traffic.trendNew"):Math.abs(re)<.05?t("admin.traffic.trendFlat"):`${re>0?"+":""}${re.toFixed(1)}%`}function Se(re){const me=["B","KB","MB","GB","TB"];let je=re,it=0;for(;je>=1024&&it=100?0:je>=10?1:2)} ${me[it]}`}function R(re){return new Intl.NumberFormat(void 0,{notation:re>=1e4?"compact":"standard",maximumFractionDigits:1}).format(re)}function we(re){return r.value==="bytes"?Se(re):R(re)}function ht(re){const me=t(`admin.traffic.categories.${re}`);return me===`admin.traffic.categories.${re}`?re:me}function Ne(re){return re.slice(5).replace("-","/")}function ot(re){const me=Math.max(1,re.length-1);return re.map((je,it)=>`${64+it/me*904},${276-je/G.value*224}`).join(" ")}function Rt(re){return`rgba(88, 166, 255, ${re===0?.06:.18+re/G.value*.72})`}function at(re){return`rgba(57, 197, 207, ${re===0?.05:.18+re/Qe.value*.72})`}async function gt(re){l.value=re,await hn()}return It(()=>{document.addEventListener("pointerdown",Ce),ue()}),Vt(()=>document.removeEventListener("pointerdown",Ce)),(re,me)=>($(),O("div",R4,[_("div",T4,[_("div",null,[_("h1",null,T(w(t)("admin.traffic.title")),1),_("p",null,T(w(t)("admin.traffic.timezone")),1)]),_("button",{class:"icon-button",type:"button","aria-label":w(t)("admin.traffic.refresh"),title:w(t)("admin.traffic.refresh"),disabled:a.value,"data-test":"traffic-refresh",onClick:ue},[Pe(w(hh),{class:nt({spinning:a.value})},null,8,["class"])],8,E4)]),Pe(w(P$),{show:a.value},{default:qt(()=>{var je,it,dt,be,Ve,Xe;return[_("section",P4,[_("div",L4,[_("div",null,[_("span",null,T(w(t)("admin.traffic.platformScope")),1),_("h2",null,T(w(t)("admin.traffic.platformStatus")),1)]),_("small",null,[Pe(w(ym)),et(T(w(t)("admin.traffic.globalRealtime")),1)])]),_("div",D4,[_("div",I4,[_("span",null,[Pe(w(Ll)),et(T(w(t)("admin.traffic.relayStatus")),1)]),_("strong",null,T(s.value?w(t)("admin.traffic.online"):w(t)("admin.traffic.unknown")),1),_("small",null,T(((je=s.value)==null?void 0:je.version)||"-"),1)]),_("div",M4,[_("span",null,[Pe(w(co)),et(T(w(t)("admin.traffic.activeSessions")),1)]),_("strong",null,T(((it=s.value)==null?void 0:it.active_sessions)??"-"),1),_("small",null,T(w(t)("admin.traffic.liveValue")),1)]),_("div",A4,[_("span",null,[Pe(w(_o)),et(T(w(t)("admin.traffic.relayInstances")),1)]),_("strong",null,T(((dt=s.value)==null?void 0:dt.relay_instances)??"-"),1),_("small",null,T(w(t)("admin.traffic.liveInstances")),1)]),_("div",$4,[_("span",null,[Pe(w(cu)),et(T(w(t)("admin.traffic.activeUplinks")),1)]),_("strong",null,T(((be=s.value)==null?void 0:be.active_uplinks)??"-"),1),_("small",null,T(w(t)("admin.traffic.flushEvery",{seconds:((Ve=s.value)==null?void 0:Ve.traffic_flush_interval_seconds)??60})),1)])]),_("div",O4,[_("div",F4,[_("span",null,[Pe(w(_o)),et(T(w(t)("admin.traffic.directAttempts")),1)]),_("strong",null,T(s.value?R(s.value.direct_attempts):"-"),1),_("small",null,T((Xe=s.value)!=null&&Xe.direct_signal_enabled?w(t)("admin.traffic.directEnabled"):w(t)("admin.traffic.directDisabled")),1)]),_("div",B4,[_("span",null,[Pe(w(Ll)),et(T(w(t)("admin.traffic.directSuccesses")),1)]),_("strong",null,T(s.value?R(s.value.direct_successes):"-"),1),_("small",null,T(w(t)("admin.traffic.directSuccessesHint")),1)]),_("div",H4,[_("span",null,[Pe(w(jl)),et(T(w(t)("admin.traffic.directFallbacks")),1)]),_("strong",null,T(s.value?R(s.value.direct_fallbacks):"-"),1),_("small",null,T(w(t)("admin.traffic.directFallbacksHint")),1)]),_("div",N4,[_("span",null,[Pe(w(cu)),et(T(w(t)("admin.traffic.directBytesAvoided")),1)]),_("strong",null,T(s.value?Se(s.value.direct_bytes_avoided):"-"),1),_("small",null,T(w(t)("admin.traffic.directBytesAvoidedHint")),1)])])]),_("section",U4,[_("div",z4,[_("div",null,[_("span",null,T(w(t)("admin.traffic.userScope")),1),_("h2",null,T(w(t)("admin.traffic.userAnalysis")),1)]),_("div",V4,[_("div",{class:"segmented",role:"group","aria-label":w(t)("admin.traffic.range")},[($(),O(Me,null,st([7,30,90],pe=>_("button",{key:pe,type:"button",class:nt({active:d.value===pe}),"data-test":`range-${pe}`,onClick:Ge=>he(pe)},T(w(t)("admin.traffic.days",{days:pe})),11,W4)),64))],8,K4),_("div",{ref_key:"selectorRoot",ref:f,class:"user-selector"},[_("button",{class:nt(["selector-trigger",{active:v.value}]),type:"button","data-test":"user-filter-trigger",onClick:me[0]||(me[0]=pe=>v.value=!v.value)},[Pe(w(od)),P.value?($(),O("span",j4,T(w(t)("admin.traffic.allUsers")),1)):I.value.length===1?($(),O("span",q4,T(I.value[0].email),1)):($(),O("span",Y4,T(w(t)("admin.traffic.selectedUsers",{selected:I.value.length,total:y.value.length})),1)),Pe(w(Zw))],2),v.value?($(),O("div",{key:0,class:"selector-popover",role:"dialog","aria-label":w(t)("admin.traffic.filterUsers")},[_("div",X4,[_("div",null,[_("strong",null,T(w(t)("admin.traffic.filterUsers")),1),_("span",null,T(w(t)("admin.traffic.selectedCount",{selected:I.value.length,total:y.value.length})),1)]),_("button",{type:"button","data-test":"toggle-all-users",onClick:me[1]||(me[1]=pe=>P.value?_e():ye())},T(P.value?w(t)("admin.traffic.clearAll"):w(t)("admin.traffic.selectAll")),1)]),_("label",J4,[Pe(w(bm)),ct(_("input",{"onUpdate:modelValue":me[2]||(me[2]=pe=>m.value=pe),placeholder:w(t)("admin.traffic.searchUsers")},null,8,Z4),[[Et,m.value]])]),_("div",Q4,[($(!0),O(Me,null,st(S.value,pe=>($(),O("div",{key:pe.id,class:"selector-option"},[_("label",null,[_("input",{type:"checkbox",checked:C.value.has(pe.id),onChange:Ge=>ce(pe.id)},null,40,eO),_("span",null,[_("strong",null,T(pe.email),1),_("small",null,T(pe.id),1)])]),_("button",{type:"button","data-test":`only-${pe.id}`,onClick:Ge=>Je(pe.id)},T(w(t)("admin.traffic.only")),9,tO)]))),128)),S.value.length?Q("",!0):($(),O("p",nO,T(w(t)("admin.traffic.noUserMatch")),1))]),_("div",iO,[_("button",{type:"button","data-test":"restore-users",onClick:ye},T(w(t)("admin.traffic.restoreAll")),1),_("button",{class:"primary",type:"button",onClick:me[3]||(me[3]=pe=>v.value=!1)},T(w(t)("admin.traffic.done")),1)])],8,G4)):Q("",!0)],512)])]),I.value.length?($(),O(Me,{key:1},[P.value?Q("",!0):($(),O("div",rO,[Pe(w(od)),_("strong",null,T(w(t)("admin.traffic.selectedUserCount",{count:I.value.length})),1),_("span",null,T(I.value.slice(0,3).map(pe=>pe.email).join(", ")),1),_("button",{type:"button","aria-label":w(t)("admin.traffic.restoreAll"),onClick:ye},[Pe(w(gs))],8,oO)])),_("div",aO,[($(!0),O(Me,null,st(U.value,pe=>($(),O("div",{key:pe.key,class:"kpi-cell"},[_("span",null,T(pe.label),1),_("div",null,[_("strong",null,T(pe.value),1),_("small",{class:nt({up:pe.trend!==null&&pe.trend>0,down:pe.trend!==null&&pe.trend<0})},[pe.trend!==null&&pe.trend>0?($(),Ct(w(gm),{key:0})):pe.trend!==null&&pe.trend<0?($(),Ct(w(jl),{key:1})):($(),Ct(w(_m),{key:2})),et(T(Be(pe.trend)),1)],2)])]))),128))]),_("section",lO,[_("div",cO,[_("div",null,[_("span",null,T(w(t)("admin.traffic.coreAnalysis")),1),_("h3",null,T(w(t)("admin.traffic.timelineTitle")),1),_("p",null,T(w(t)("admin.traffic.timelineScope",{count:I.value.length})),1)]),_("div",dO,[_("div",null,[_("small",null,T(w(t)("admin.traffic.view")),1),_("div",uO,[_("button",{type:"button",class:nt({active:o.value==="group"}),"data-test":"view-group",onClick:me[4]||(me[4]=pe=>Ae("group"))},T(w(t)("admin.traffic.groupTimeline")),3),_("button",{type:"button",class:nt({active:o.value==="frame"}),"data-test":"view-frame",onClick:me[5]||(me[5]=pe=>Ae("frame"))},T(w(t)("admin.traffic.frameTimeline")),3),_("button",{type:"button",class:nt({active:o.value==="direction"}),"data-test":"view-direction",onClick:me[6]||(me[6]=pe=>Ae("direction"))},T(w(t)("admin.traffic.directionTrend")),3)])]),o.value!=="direction"?($(),O("div",hO,[_("small",null,T(w(t)("admin.traffic.colDirection")),1),_("div",fO,[($(),O(Me,null,st(["all","out","in"],pe=>_("button",{key:pe,type:"button",class:nt({active:c.value===pe}),onClick:Ge=>c.value=pe},T(w(t)(`admin.traffic.direction.${pe}`)),11,pO)),64))])])):Q("",!0),_("div",null,[_("small",null,T(w(t)("admin.traffic.metric")),1),_("div",vO,[_("button",{type:"button",class:nt({active:r.value==="bytes"}),"data-test":"metric-bytes",onClick:me[7]||(me[7]=pe=>r.value="bytes")},T(w(t)("admin.traffic.bytes")),3),_("button",{type:"button",class:nt({active:r.value==="frames"}),"data-test":"metric-frames",onClick:me[8]||(me[8]=pe=>r.value="frames")},T(w(t)("admin.traffic.frames")),3)])])])]),_("div",gO,[_("span",null,T(oe.value?w(t)("admin.traffic.multiUserMatrix"):o.value==="direction"?w(t)("admin.traffic.directionTrend"):w(t)("admin.traffic.stackedTimeline")),1),_("small",null,T(w(t)("admin.traffic.bucketCount",{count:p.value.days.length})),1)]),k.value.length?o.value==="direction"?($(),O("div",_O,[($(),O("svg",{viewBox:"0 0 1000 320",preserveAspectRatio:"none",role:"img","aria-label":w(t)("admin.traffic.directionTrend")},[_("g",bO,[($(),O(Me,null,st([52,108,164,220,276],pe=>_("line",{key:pe,x1:"64",y1:pe,x2:"968",y2:pe},null,8,wO)),64))]),_("polyline",{class:"line outbound",points:ot(j.value.outbound)},null,8,SO),_("polyline",{class:"line inbound",points:ot(j.value.inbound)},null,8,CO),($(!0),O(Me,null,st(p.value.days,(pe,Ge)=>($(),O("g",{key:pe},[Ge===0||Ge===p.value.days.length-1||Ge%Math.max(1,Math.floor(p.value.days.length/6))===0?($(),O("text",{key:0,x:64+Ge/Math.max(1,p.value.days.length-1)*904,y:"305","text-anchor":"middle"},T(Ne(pe)),9,kO)):Q("",!0)]))),128))],8,yO)),_("div",xO,[_("span",null,[me[13]||(me[13]=_("i",{class:"outbound"},null,-1)),et(T(w(t)("admin.traffic.dirOut")),1)]),_("span",null,[me[14]||(me[14]=_("i",{class:"inbound"},null,-1)),et(T(w(t)("admin.traffic.dirIn")),1)])])])):oe.value?($(),O("div",RO,[_("div",{class:"matrix-grid",style:Gt({"--columns":String(p.value.days.length)})},[($(!0),O(Me,null,st(se.value,pe=>($(),O(Me,{key:pe.key},[_("div",{class:"matrix-label",title:`${pe.userLabel} · ${ht(pe.label)}`},[_("strong",null,T(pe.userLabel),1),_("span",null,T(o.value==="group"?ht(pe.label):pe.label),1)],8,TO),_("div",EO,[($(!0),O(Me,null,st(pe.values,(Ge,_t)=>($(),O("i",{key:_t,style:Gt({background:Rt(Ge)}),title:`${pe.userLabel} · ${pe.label} · ${p.value.days[_t]} · ${we(Ge)}`},null,12,PO))),128))])],64))),128))],4),_("div",{class:"matrix-axis",style:Gt({"--columns":String(p.value.days.length)})},[($(!0),O(Me,null,st(p.value.days,pe=>($(),O("span",{key:pe},T(Ne(pe)),1))),128))],4)])):($(),O("div",LO,[($(!0),O(Me,null,st(p.value.days,(pe,Ge)=>($(),O("div",{key:pe,class:"bar-column"},[_("div",DO,[($(!0),O(Me,null,st(V.value.slice(0,8),_t=>($(),O("i",{key:_t.key,style:Gt({height:`${_t.values[Ge]/te.value*100}%`,background:_t.color}),title:`${_t.label} · ${we(_t.values[Ge])}`},null,12,IO))),128))]),_("span",null,T(Ne(pe)),1)]))),128))])):($(),O("div",mO,T(w(t)("admin.traffic.empty")),1)),o.value!=="direction"&&k.value.length?($(),O("div",MO,[($(!0),O(Me,null,st(V.value.slice(0,8),pe=>($(),O("span",{key:pe.key},[_("i",{style:Gt({background:pe.color})},null,4),et(T(o.value==="group"?ht(pe.label):pe.label),1)]))),128))])):Q("",!0),o.value!=="direction"&&V.value.length?($(),O("div",AO,[_("table",$O,[_("thead",null,[_("tr",null,[_("th",null,T(w(t)("admin.traffic.colUser")),1),_("th",null,T(o.value==="group"?w(t)("admin.traffic.colCategory"):w(t)("admin.traffic.colFrameType")),1),_("th",null,T(w(t)("admin.traffic.total")),1),($(!0),O(Me,null,st(p.value.days,pe=>($(),O("th",{key:pe},T(Ne(pe)),1))),128))])]),_("tbody",null,[($(!0),O(Me,null,st(V.value.slice(0,16),pe=>($(),O("tr",{key:pe.key},[_("td",null,T(pe.userLabel||w(t)("admin.traffic.selectedAggregate")),1),_("td",null,T(o.value==="group"?ht(pe.label):pe.label),1),_("td",null,T(we(pe.total)),1),($(!0),O(Me,null,st(pe.values,(Ge,_t)=>($(),O("td",{key:_t},T(we(Ge)),1))),128))]))),128))])])])):Q("",!0)]),_("div",OO,[_("section",FO,[_("div",BO,[_("div",null,[_("h3",null,T(w(t)("admin.traffic.categorySummary")),1),_("p",null,T(w(t)("admin.traffic.totalComposition")),1)]),g.value!=="all"?($(),O("button",{key:0,type:"button",onClick:me[9]||(me[9]=pe=>g.value="all")},T(w(t)("admin.traffic.clear")),1)):Q("",!0)]),_("div",HO,[($(!0),O(Me,null,st(N.value,pe=>($(),O("button",{key:pe.key,type:"button",class:nt({active:g.value===pe.key}),onClick:Ge=>g.value=g.value===pe.key?"all":pe.key},[_("span",UO,[_("i",{style:Gt({background:pe.color})},null,4),_("strong",null,T(ht(pe.key)),1),_("em",null,T(pe.share.toFixed(1))+"%",1)]),_("span",zO,[_("i",{style:Gt({width:`${pe.share}%`,background:pe.color})},null,4)]),_("span",VO,[_("strong",null,T(Se(pe.bytes)),1),_("small",null,T(w(t)("admin.traffic.outIn",{out:Se(pe.outbound),in:Se(pe.inbound)})),1)])],10,NO))),128))])]),_("section",KO,[_("div",WO,[_("div",null,[_("h3",null,T(w(t)("admin.traffic.userDetail")),1),_("p",null,T(w(t)("admin.traffic.userCount",{count:Z.value.length})),1)]),Pe(w(Oy),{value:b.value,"onUpdate:value":me[10]||(me[10]=pe=>b.value=pe),class:"user-detail-select","data-test":"user-detail-filter",size:"small",filterable:"",clearable:"",options:K.value,placeholder:w(t)("admin.traffic.selectOrSearchUser")},{empty:qt(()=>[et(T(w(t)("admin.traffic.noUserMatch")),1)]),_:1},8,["value","options","placeholder"])]),_("div",jO,[_("table",qO,[_("thead",null,[_("tr",null,[_("th",null,T(w(t)("admin.traffic.colUser")),1),_("th",null,T(w(t)("admin.traffic.totalTraffic")),1),_("th",null,T(w(t)("admin.traffic.share")),1),_("th",null,T(w(t)("admin.traffic.periodTrend")),1),_("th",null,T(w(t)("admin.traffic.activeDays")),1),me[15]||(me[15]=_("th",null,null,-1))])]),_("tbody",null,[($(!0),O(Me,null,st(Z.value,pe=>($(),O("tr",{key:pe.id},[_("td",null,[_("strong",null,T(pe.email),1),_("small",null,T(pe.id),1)]),_("td",null,T(Se(pe.bytes)),1),_("td",null,[_("span",YO,[_("i",{style:Gt({width:`${pe.share}%`})},null,4)]),et(T(pe.share.toFixed(1))+"%",1)]),_("td",{class:nt({positive:pe.trend!==null&&pe.trend>0,negative:pe.trend!==null&&pe.trend<0})},T(Be(pe.trend)),3),_("td",null,T(pe.activeDays)+" / "+T(d.value),1),_("td",null,[_("button",{class:"icon-button small",type:"button","aria-label":w(t)("admin.traffic.viewUser",{user:pe.email}),"data-test":`open-user-${pe.id}`,onClick:Ge=>gt(pe.id)},[Pe(w(mm))],8,GO)])]))),128))])])])])]),_("section",XO,[_("div",JO,[_("div",null,[_("h3",null,T(w(t)("admin.traffic.diagnostics")),1),_("p",null,T(w(t)("admin.traffic.diagnosticsRange",{days:d.value})),1)])]),_("div",ZO,[_("div",QO,[_("h4",null,T(w(t)("admin.traffic.dailyActivity")),1),_("div",{class:"activity-grid",style:Gt({"--columns":String(p.value.days.length)})},[($(!0),O(Me,null,st(xe.value,pe=>($(),O(Me,{key:pe.user.id},[_("span",{title:pe.user.email},T(pe.user.email),9,eF),_("div",null,[($(!0),O(Me,null,st(pe.values,(Ge,_t)=>($(),O("i",{key:_t,style:Gt({background:at(Ge)}),title:`${p.value.days[_t]} · ${Se(Ge)}`},null,12,tF))),128))])],64))),128))],4)]),_("div",nF,[_("h4",null,T(w(t)("admin.traffic.frameDensity")),1),_("div",iF,[($(!0),O(Me,null,st(De.value,pe=>($(),O("div",{key:pe.key},[_("span",null,T(ht(pe.key)),1),_("div",null,[_("i",{style:Gt({width:`${pe.density/ne.value*100}%`,background:pe.color})},null,4)]),_("strong",null,T(Se(pe.density))+"/"+T(w(t)("admin.traffic.frameUnit")),1)]))),128))])])])])],64)):($(),O("div",sO,[Pe(w(od)),_("h3",null,T(w(t)("admin.traffic.noUsersSelected")),1),_("button",{type:"button","data-test":"restore-users-empty",onClick:ye},T(w(t)("admin.traffic.restoreAllUsers")),1)]))])]}),_:1},8,["show"]),J.value?($(),O("div",{key:0,class:"drawer-backdrop","data-test":"traffic-user-drawer",onClick:me[12]||(me[12]=pt(je=>l.value=null,["self"]))},[_("aside",sF,[_("div",rF,[_("div",null,[_("span",null,T(w(t)("admin.traffic.userTraffic")),1),_("h3",null,T(J.value.email),1),_("small",null,T(J.value.id),1)]),_("button",{class:"icon-button",type:"button","aria-label":w(t)("common.close"),onClick:me[11]||(me[11]=je=>l.value=null)},[Pe(w(gs))],8,oF)]),_("div",aF,[_("div",null,[_("span",null,T(w(t)("admin.traffic.totalTraffic")),1),_("strong",null,T(Se(J.value.bytes)),1)]),_("div",null,[_("span",null,T(w(t)("admin.traffic.periodTrend")),1),_("strong",null,T(Be(J.value.trend)),1)]),_("div",null,[_("span",null,T(w(t)("admin.traffic.kpiFrames")),1),_("strong",null,T(R(J.value.frames)),1)])]),_("section",null,[_("h4",null,[Pe(w(Qw)),et(T(w(t)("admin.traffic.dailyTraffic")),1)]),_("div",lF,[($(!0),O(Me,null,st(Ie.value,(je,it)=>($(),O("div",{key:p.value.days[it]},[_("i",{style:Gt({height:`${je/de.value*100}%`}),title:`${p.value.days[it]} · ${Se(je)}`},null,12,cF),_("span",null,T(Ne(p.value.days[it])),1)]))),128))])]),_("section",null,[_("h4",null,[Pe(w(Ll)),et(T(w(t)("admin.traffic.frameBreakdown")),1)]),_("table",null,[_("thead",null,[_("tr",null,[_("th",null,T(w(t)("admin.traffic.colFrameType")),1),_("th",null,T(w(t)("admin.traffic.colCategory")),1),_("th",null,T(w(t)("admin.traffic.colBytes")),1),_("th",null,T(w(t)("admin.traffic.colFrames")),1)])]),_("tbody",null,[($(!0),O(Me,null,st(Le.value,je=>($(),O("tr",{key:je.name},[_("td",null,T(je.name),1),_("td",null,T(ht(je.category)),1),_("td",null,T(Se(je.bytes)),1),_("td",null,T(R(je.frames)),1)]))),128))])])])])])):Q("",!0)]))}}),uF=kt(dF,[["__scopeId","data-v-ba91c8e7"]]),hF={class:"admin-panel"},fF={class:"admin-tabs"},pF=["onClick","data-test"],vF={class:"admin-body"},gF=$e({__name:"AdminPanel",setup(e){const{t}=Fo(),n=W(()=>Tf.value.locale),i=W(()=>Tf.value.dateLocale),s=F("invitations"),a=W(()=>[{key:"invitations",label:t("admin.invitations")},{key:"users",label:t("admin.users")},{key:"config",label:t("admin.configTab")},{key:"feishu",label:t("admin.feishuTab")},{key:"traffic",label:t("admin.trafficTab")}]),d=pw();return(r,o)=>($(),O("div",hF,[Pe(w(mw),{abstract:"",theme:w(gw),"theme-overrides":w(d),locale:n.value,"date-locale":i.value},{default:qt(()=>[Pe(w(vw),null,{default:qt(()=>[_("div",fF,[($(!0),O(Me,null,st(a.value,c=>($(),O("button",{key:c.key,type:"button",onClick:h=>s.value=c.key,class:nt({active:s.value===c.key}),"data-test":`admin-tab-${c.key}`},T(c.label),11,pF))),128))]),_("div",vF,[s.value==="invitations"?($(),Ct(e4,{key:0})):Q("",!0),s.value==="users"?($(),Ct(r4,{key:1})):Q("",!0),s.value==="config"?($(),Ct(v4,{key:2})):Q("",!0),s.value==="feishu"?($(),Ct(S4,{key:3})):Q("",!0),s.value==="traffic"?($(),Ct(uF,{key:4})):Q("",!0)])]),_:1})]),_:1},8,["theme","theme-overrides","locale","date-locale"])]))}}),mF=kt(gF,[["__scopeId","data-v-6f7ef581"]]),_F="classic",Xu=[{id:"classic",labelKey:"settings.general.themes.classicLabel",descriptionKey:"settings.general.themes.classicDescription",xtermTheme:{background:"#000000",foreground:"#c9d1d9",cursor:"#c9d1d9",cursorAccent:"#000000",selectionBackground:"#264f78",black:"#000000",red:"#f85149",green:"#3fb950",yellow:"#d29922",blue:"#58a6ff",magenta:"#bc8cff",cyan:"#39c5cf",white:"#b1bac4",brightBlack:"#6e7681",brightRed:"#ff7b72",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#79c0ff",brightMagenta:"#d2a8ff",brightCyan:"#56d4dd",brightWhite:"#f0f6fc"},appVars:{"--bg":"#0d1117","--panel":"#161b22","--border":"#30363d","--fg":"#c9d1d9","--fg-dim":"#8b949e","--accent":"#58a6ff","--good":"#3fb950","--bad":"#f85149","--warn":"#d29922","--neutral":"#6e7681","--terminal-bg":"#000000","--terminal-grid":"#11161d","--terminal-overlay":"rgba(13, 17, 23, 0.85)"}},{id:"nord",labelKey:"settings.general.themes.nordLabel",descriptionKey:"settings.general.themes.nordDescription",xtermTheme:{background:"#2e3440",foreground:"#d8dee9",cursor:"#d8dee9",cursorAccent:"#2e3440",selectionBackground:"#434c5e",black:"#3b4252",red:"#bf616a",green:"#a3be8c",yellow:"#ebcb8b",blue:"#81a1c1",magenta:"#b48ead",cyan:"#88c0d0",white:"#e5e9f0",brightBlack:"#4c566a",brightRed:"#bf616a",brightGreen:"#a3be8c",brightYellow:"#ebcb8b",brightBlue:"#81a1c1",brightMagenta:"#b48ead",brightCyan:"#8fbcbb",brightWhite:"#eceff4"},appVars:{"--bg":"#242933","--panel":"#2e3440","--border":"#4c566a","--fg":"#d8dee9","--fg-dim":"#9aa7bd","--accent":"#88c0d0","--good":"#a3be8c","--bad":"#bf616a","--warn":"#ebcb8b","--neutral":"#4c566a","--terminal-bg":"#2e3440","--terminal-grid":"#242933","--terminal-overlay":"rgba(36, 41, 51, 0.88)"}},{id:"solarized-dark",labelKey:"settings.general.themes.solarizedDarkLabel",descriptionKey:"settings.general.themes.solarizedDarkDescription",xtermTheme:{background:"#002b36",foreground:"#839496",cursor:"#93a1a1",cursorAccent:"#002b36",selectionBackground:"#073642",black:"#073642",red:"#dc322f",green:"#859900",yellow:"#b58900",blue:"#268bd2",magenta:"#d33682",cyan:"#2aa198",white:"#eee8d5",brightBlack:"#002b36",brightRed:"#cb4b16",brightGreen:"#586e75",brightYellow:"#657b83",brightBlue:"#839496",brightMagenta:"#6c71c4",brightCyan:"#93a1a1",brightWhite:"#fdf6e3"},appVars:{"--bg":"#00212b","--panel":"#073642","--border":"#28535f","--fg":"#93a1a1","--fg-dim":"#657b83","--accent":"#268bd2","--good":"#859900","--bad":"#dc322f","--warn":"#b58900","--neutral":"#586e75","--terminal-bg":"#002b36","--terminal-grid":"#001e26","--terminal-overlay":"rgba(0, 33, 43, 0.9)"}},{id:"daylight",labelKey:"settings.general.themes.daylightLabel",descriptionKey:"settings.general.themes.daylightDescription",xtermTheme:{background:"#faf4e8",foreground:"#403832",cursor:"#403832",cursorAccent:"#faf4e8",selectionBackground:"#d9c7a8",black:"#403832",red:"#c94f4f",green:"#4d8a3f",yellow:"#b9831d",blue:"#2f6db3",magenta:"#8b5fa8",cyan:"#2f8f8a",white:"#ede0cc",brightBlack:"#7a6d61",brightRed:"#d56565",brightGreen:"#5d9f4d",brightYellow:"#c9922c",brightBlue:"#3d7fcf",brightMagenta:"#9b6db8",brightCyan:"#3aa39d",brightWhite:"#fffaf0"},appVars:{"--bg":"#f4ead8","--panel":"#fff8ed","--border":"#d8c7ad","--fg":"#403832","--fg-dim":"#776b5f","--accent":"#2f6db3","--good":"#4d8a3f","--bad":"#c94f4f","--warn":"#b9831d","--neutral":"#7a6d61","--terminal-bg":"#faf4e8","--terminal-grid":"#e5d6bd","--terminal-overlay":"rgba(255, 248, 237, 0.92)"}}];function Us(e){return Xu.find(t=>t.id===e)??Xu[0]}function yF(e){return e==="daylight"}const bF={key:0,class:"terminal-appearance"},wF={class:"settings-field"},SF={class:"field-label"},CF={class:"hint"},kF={class:"settings-field-grid settings-field-grid--compact","data-test":"terminal-compact-grid"},xF={class:"settings-field"},RF={class:"field-label",for:"terminal-font-size"},TF=["value"],EF={class:"settings-field"},PF={class:"field-label",for:"terminal-line-height"},LF=["value"],DF={class:"settings-field scrollback-field"},IF={class:"field-label",for:"terminal-scrollback"},MF=["value"],AF={class:"settings-field"},$F={class:"field-label"},OF={class:"checkbox cursor-blink"},FF=["checked"],BF={class:"hint","data-test":"terminal-scrollback-hint"},HF={key:0,class:"error"},NF=$e({__name:"SettingsTerminalAppearance",emits:["appearance-changed"],setup(e,{emit:t}){const n=t,{t:i}=Ot(),s=fn(),a=s.caps,d=F(""),r=F(""),o=F(""),c=F(13),h=F(1),u=F("block"),v=F("block"),m=F(!0),b=F(5e3),g=F(5e3),l=F(!0),f=W(()=>LT.map(M=>({value:M.id,label:M.label}))),p=W(()=>[{value:"block",label:i("settings.general.terminalCursorStyleBlock")},{value:"underline",label:i("settings.general.terminalCursorStyleUnderline")},{value:"bar",label:i("settings.general.terminalCursorStyleBar")}]),y=W(()=>Math.round(b.value*2.75/1e3));async function C(){if(a.wailsBindings)try{const[M,B,z,Y,U,N]=await Promise.all([t_(),n_(),i_(),s_(),r_(),o_()]);r.value=M,o.value=M,c.value=B,h.value=z,u.value=Y,v.value=u.value,m.value=U,b.value=N,g.value=N}catch(M){d.value=(M==null?void 0:M.message)??String(M)}finally{l.value=!1}}let k=null;It(()=>{C(),k=s.events.on("prefs:changed",()=>{C()})}),Vt(()=>{k==null||k(),k=null});function E(){n("appearance-changed",{fontHead:r.value,fontSize:c.value,lineHeight:h.value,cursorStyle:u.value,cursorBlink:m.value,scrollback:g.value})}async function I(){const M=r.value,B=o.value;d.value="";try{await mk(M),o.value=M,E()}catch(z){r.value=B,d.value=(z==null?void 0:z.message)??String(z)}}async function S(M){const B=M.target,z=Number(B.value),Y=Number.isFinite(z)?Math.max(8,Math.min(32,Math.round(z))):c.value,U=c.value;c.value=Y,B.value=String(Y),d.value="";try{await _k(Y),E()}catch(N){c.value=U,B.value=String(U),d.value=(N==null?void 0:N.message)??String(N)}}async function P(M){const B=M.target,z=Number(B.value),Y=Number.isFinite(z)?Math.max(1,Math.min(2,Math.round(z*10)/10)):h.value,U=h.value;h.value=Y,B.value=String(Y),d.value="";try{await yk(Y),E()}catch(N){h.value=U,B.value=String(U),d.value=(N==null?void 0:N.message)??String(N)}}async function A(){const M=u.value,B=v.value;d.value="";try{await bk(M),v.value=M,E()}catch(z){u.value=B,d.value=(z==null?void 0:z.message)??String(z)}}async function L(M){const B=M.target,z=m.value;m.value=B.checked,d.value="";try{await wk(B.checked),E()}catch(Y){m.value=z,B.checked=z,d.value=(Y==null?void 0:Y.message)??String(Y)}}function x(M){const B=Number(M.target.value);Number.isFinite(B)&&(b.value=B)}async function D(M){const B=M.target,z=Number(B.value),Y=Number.isFinite(z)?Math.max(500,Math.min(2e4,Math.round(z))):g.value,U=g.value;b.value=Y,B.value=String(Y),d.value="";try{await Sk(Y),g.value=Y,E()}catch(N){b.value=U,B.value=String(U),d.value=(N==null?void 0:N.message)??String(N)}}return(M,B)=>w(a).wailsBindings&&!l.value?($(),O("div",bF,[_("div",wF,[_("label",SF,T(w(i)("settings.general.terminalFont")),1),Pe(qn,{modelValue:r.value,"onUpdate:modelValue":[B[0]||(B[0]=z=>r.value=z),I],options:f.value,"data-test":"terminal-font","aria-label":w(i)("settings.general.terminalFont")},null,8,["modelValue","options","aria-label"]),_("p",CF,T(w(i)("settings.general.terminalFontHint")),1)]),_("div",kF,[_("div",xF,[_("label",RF,T(w(i)("settings.general.terminalFontSize")),1),_("input",{id:"terminal-font-size",class:"number-input",type:"number","data-test":"terminal-font-size",min:"8",max:"32",step:"1",value:c.value,onChange:S},null,40,TF)]),_("div",EF,[_("label",PF,T(w(i)("settings.general.terminalLineHeight")),1),_("input",{id:"terminal-line-height",class:"number-input",type:"number","data-test":"terminal-line-height",min:"1.0",max:"2.0",step:"0.1",value:h.value,onChange:P},null,40,LF)]),_("div",DF,[_("label",IF,T(w(i)("settings.general.terminalScrollback")),1),_("input",{id:"terminal-scrollback",class:"number-input",type:"number","data-test":"terminal-scrollback",min:"500",max:"20000",step:"500",value:b.value,onInput:x,onChange:D},null,40,MF)]),_("div",AF,[_("label",$F,T(w(i)("settings.general.terminalCursorStyle")),1),Pe(qn,{modelValue:u.value,"onUpdate:modelValue":[B[1]||(B[1]=z=>u.value=z),A],options:p.value,"data-test":"terminal-cursor-style","aria-label":w(i)("settings.general.terminalCursorStyle")},null,8,["modelValue","options","aria-label"]),_("label",OF,[_("input",{type:"checkbox","data-test":"terminal-cursor-blink",checked:m.value,onChange:L},null,40,FF),et(" "+T(w(i)("settings.general.terminalCursorBlink")),1)])])]),_("p",BF,T(w(i)("settings.general.terminalScrollbackHint",{mb:y.value})),1),d.value?($(),O("p",HF,T(d.value),1)):Q("",!0)])):Q("",!0)}}),UF=kt(NF,[["__scopeId","data-v-e31f8f67"]]);async function zF(){const{data:e}=await gn("/api/push/key");return e.key}async function VF(e){await gn("/api/push/subscribe",{method:"POST",body:JSON.stringify(e)})}async function KF(e){await gn("/api/push/unsubscribe",{method:"POST",body:JSON.stringify({endpoint:e})})}async function WF(){const{data:e}=await gn("/api/push/test",{method:"POST"});return e.sent}function jF(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");for(;t.length%4===1;)t=t.slice(0,-1);const n="=".repeat((4-t.length%4)%4),i=atob(t+n),s=new Uint8Array(i.length);for(let a=0;ac.map(ye=>({value:ye.value,label:o(ye.labelKey)}))),p=W(()=>Xu.map(ye=>({value:ye.id,label:o(ye.labelKey),description:o(ye.descriptionKey)}))),y=F(!0),C=F(!0),k=F(!0),E=F(!0),I=F(!0),S=F(!0),P=F(!0),A=F(!1),L=F("auto"),x=F("auto"),D=F(""),M=F(""),B=F([]),z=F(!0),Y=F(!0),U=F(10),N=F(!0),V=W(()=>m.notifications&&typeof navigator<"u"&&"serviceWorker"in navigator),j=F(!1),G=F(!0),te=F(!1),se=F(!1),oe=F(""),Fe={denied:"settings.general.pushNotifications.errors.denied",disabled:"settings.general.pushNotifications.errors.disabled","key-failed":"settings.general.pushNotifications.errors.keyFailed","subscribe-failed":"settings.general.pushNotifications.errors.subscribeFailed","subscribe-rejected":"settings.general.pushNotifications.errors.subscribeRejected"},K=W(()=>[{value:"auto",label:o("settings.general.auto")},...B.value.map(ye=>({value:ye,label:ye})),{value:"__custom__",label:o("settings.general.customPath")}]);async function Z(){if(m.wailsBindings)try{const[ye,_e]=await Promise.all([kk(),mh()]);B.value=_e,L.value==="__custom__"&&D.value!==M.value||(ye==="auto"?L.value="auto":_e.includes(ye)?(L.value=ye,D.value=ye,M.value=ye):(L.value="__custom__",D.value=ye,M.value=ye),x.value=L.value)}catch(ye){r.value=(ye==null?void 0:ye.message)??String(ye)}finally{P.value=!1}}let J=null;It(()=>{J=v.events.on("prefs:changed",()=>{Z()})}),Vt(()=>{J==null||J(),J=null}),It(async()=>{if(m.wailsBindings)try{const ye=await Ck();b.value=ye,g.value=ye}catch(ye){r.value=(ye==null?void 0:ye.message)??String(ye)}if(m.wailsBindings){try{y.value=await a_()}catch(ye){r.value=(ye==null?void 0:ye.message)??String(ye)}finally{C.value=!1}try{k.value=await Pk()}catch(ye){r.value=(ye==null?void 0:ye.message)??String(ye)}finally{E.value=!1}try{I.value=await Gm()}catch(ye){r.value=(ye==null?void 0:ye.message)??String(ye)}finally{S.value=!1}await Z();try{z.value=await l_()}catch(ye){r.value=(ye==null?void 0:ye.message)??String(ye)}finally{Y.value=!1}try{U.value=await c_()}catch(ye){r.value=(ye==null?void 0:ye.message)??String(ye)}finally{N.value=!1}}await ae()});async function ae(){if(!V.value){G.value=!1;return}try{if(!navigator.serviceWorker.controller){j.value=!1;return}const _e=await(await navigator.serviceWorker.ready).pushManager.getSubscription();j.value=_e!==null}catch{j.value=!1}finally{G.value=!1}}async function Ie(ye){const _e=ye.target,Ce=_e.checked;oe.value="",te.value=!0;try{const Be=await navigator.serviceWorker.ready;if(Ce){const Se=await qF({notification:{permission:Notification.permission,requestPermission:()=>Notification.requestPermission()},registration:Be});if(!Se.ok){_e.checked=!1,j.value=!1,oe.value=o(Fe[Se.reason]??"settings.general.pushNotifications.errors.generic");return}j.value=!0}else await YF({registration:Be}),j.value=!1}catch(Be){_e.checked=j.value,oe.value=(Be==null?void 0:Be.message)??String(Be)}finally{te.value=!1}}async function de(){oe.value="",se.value=!0;try{await WF()}catch(ye){oe.value=(ye==null?void 0:ye.message)??String(ye)}finally{se.value=!1}}async function Le(ye){const _e=ye.target,Ce=y.value;y.value=_e.checked,r.value="";try{await xk(_e.checked)}catch(Be){y.value=Ce,r.value=(Be==null?void 0:Be.message)??String(Be)}}async function xe(ye){const _e=ye.target,Ce=k.value;k.value=_e.checked,r.value="";try{await Lk(_e.checked)}catch(Be){k.value=Ce,r.value=(Be==null?void 0:Be.message)??String(Be)}}async function Qe(ye){const _e=ye.target,Ce=I.value;I.value=_e.checked,r.value="";try{await tk(_e.checked)}catch(Be){I.value=Ce,r.value=(Be==null?void 0:Be.message)??String(Be)}}async function De(){if(L.value==="__custom__")return;const ye=x.value;A.value=!0,r.value="";try{await fp(L.value),x.value=L.value}catch(_e){L.value=ye,r.value=(_e==null?void 0:_e.message)??String(_e)}finally{A.value=!1}}async function ne(){const ye=D.value.trim();if(!ye){r.value=o("settings.general.customShellRequired");return}A.value=!0,r.value="";try{await fp(ye),L.value="__custom__",x.value="__custom__",D.value=ye,M.value=ye,B.value.includes(ye)||(B.value=[ye,...B.value])}catch(_e){r.value=(_e==null?void 0:_e.message)??String(_e)}finally{A.value=!1}}async function ue(ye){const _e=ye.target,Ce=z.value;z.value=_e.checked,r.value="";try{await Dk(_e.checked)}catch(Be){z.value=Ce,r.value=(Be==null?void 0:Be.message)??String(Be)}}async function he(ye){const _e=ye.target,Ce=Number(_e.value),Be=Number.isFinite(Ce)?Math.max(1,Math.min(600,Math.round(Ce))):10,Se=U.value;U.value=Be,_e.value=String(Be),r.value="";try{await Ik(Be),i("command-notify-threshold-changed",Be)}catch(R){U.value=Se,_e.value=String(Se),r.value=(R==null?void 0:R.message)??String(R)}}function Ae(ye){i("appearance-changed",ye)}async function ce(){const ye=b.value,_e=g.value,Ce=h.value;l.value=!0,r.value="";try{await u(ye),g.value=ye}catch(Be){b.value=_e,g.value=_e;try{await u(Ce)}catch{}r.value=(Be==null?void 0:Be.message)??String(Be)}finally{l.value=!1}}async function Je(){const ye=Us(s.value).id,_e=a.value;s.value=ye,d.value=!0,r.value="";try{m.wailsBindings&&await vk(ye),a.value=ye,i("terminal-theme-changed",ye)}catch(Ce){s.value=_e,i("terminal-theme-changed",_e),r.value=(Ce==null?void 0:Ce.message)??String(Ce)}finally{d.value=!1}}return(ye,_e)=>($(),O("div",GF,[_("div",XF,[_("div",JF,[_("label",ZF,T(w(o)("settings.general.languageLabel")),1),Pe(qn,{modelValue:b.value,"onUpdate:modelValue":[_e[0]||(_e[0]=Ce=>b.value=Ce),ce],options:f.value,disabled:l.value,"aria-label":w(o)("settings.general.languageLabel")},null,8,["modelValue","options","disabled","aria-label"]),_("p",QF,T(w(o)("settings.general.languageHint")),1)]),_("div",eB,[_("label",tB,T(w(o)("settings.general.terminalTheme")),1),Pe(qn,{modelValue:s.value,"onUpdate:modelValue":[_e[1]||(_e[1]=Ce=>s.value=Ce),Je],options:p.value,disabled:d.value,"aria-label":w(o)("settings.general.terminalTheme")},null,8,["modelValue","options","disabled","aria-label"]),_("p",nB,T(w(o)("settings.general.terminalThemeHint")),1)])]),Pe(UF,{onAppearanceChanged:Ae}),w(m).wailsBindings&&!C.value?($(),O("label",iB,[_("input",{type:"checkbox",checked:y.value,onChange:Le},null,40,sB),et(" "+T(w(o)("settings.general.notificationsBell")),1)])):Q("",!0),w(m).wailsBindings&&!C.value?($(),O("p",rB,T(w(o)("settings.general.notificationsHint")),1)):Q("",!0),w(m).wailsBindings&&!E.value?($(),O("label",oB,[_("input",{type:"checkbox",checked:k.value,onChange:xe},null,40,aB),et(" "+T(w(o)("settings.general.shellIntegration")),1)])):Q("",!0),w(m).wailsBindings&&!E.value?($(),O("p",lB,T(w(o)("settings.general.shellIntegrationHint")),1)):Q("",!0),w(m).wailsBindings&&!S.value?($(),O("label",cB,[_("input",{type:"checkbox",checked:I.value,onChange:Qe},null,40,dB),et(" "+T(w(o)("settings.general.recoveryEnabled")),1)])):Q("",!0),w(m).wailsBindings&&!S.value?($(),O("p",uB,T(w(o)("settings.general.recoveryEnabledHint")),1)):Q("",!0),w(m).wailsBindings&&!P.value?($(),O("label",hB,T(w(o)("settings.general.defaultShell")),1)):Q("",!0),w(m).wailsBindings&&!P.value?($(),Ct(qn,{key:7,modelValue:L.value,"onUpdate:modelValue":[_e[2]||(_e[2]=Ce=>L.value=Ce),De],options:K.value,"aria-label":w(o)("settings.general.defaultShell"),disabled:A.value},null,8,["modelValue","options","aria-label","disabled"])):Q("",!0),w(m).wailsBindings&&!P.value?($(),O("p",fB,T(w(o)("settings.general.defaultShellHint")),1)):Q("",!0),w(m).wailsBindings&&!P.value&&L.value==="__custom__"?($(),O("div",pB,[ct(_("input",{class:"text-input","onUpdate:modelValue":_e[3]||(_e[3]=Ce=>D.value=Ce),placeholder:w(o)("settings.general.customShellPath"),"aria-label":w(o)("settings.general.customShellPath"),disabled:A.value},null,8,vB),[[Et,D.value]]),_("button",{disabled:A.value,onClick:ne},T(w(o)("settings.general.saveCustom")),9,gB)])):Q("",!0),w(m).wailsBindings&&!Y.value?($(),O("label",mB,[_("input",{type:"checkbox",checked:z.value,onChange:ue},null,40,_B),et(" "+T(w(o)("settings.general.webglRenderer")),1)])):Q("",!0),w(m).wailsBindings&&!Y.value?($(),O("p",yB,T(w(o)("settings.general.webglHint")),1)):Q("",!0),w(m).wailsBindings&&!N.value?($(),O("label",bB,T(w(o)("settings.general.commandNotifyThreshold")),1)):Q("",!0),w(m).wailsBindings&&!N.value?($(),O("input",{key:13,class:"number-input",type:"number",min:"1",max:"600",value:U.value,onChange:he},null,40,wB)):Q("",!0),w(m).wailsBindings&&!N.value?($(),O("p",SB,T(w(o)("settings.general.commandNotifyHint")),1)):Q("",!0),r.value?($(),O("p",CB,T(r.value),1)):Q("",!0),V.value?($(),O("section",kB,[_("h3",xB,T(w(o)("settings.general.pushNotifications.title")),1),G.value?Q("",!0):($(),O("label",RB,[_("input",{type:"checkbox","data-testid":"push-toggle",checked:j.value,disabled:te.value,onChange:Ie},null,40,TB),et(" "+T(w(o)("settings.general.pushNotifications.enable")),1)])),j.value?($(),O("button",{key:1,type:"button",class:"push-test-button","data-testid":"push-test",disabled:se.value,onClick:de},T(w(o)("settings.general.pushNotifications.test")),9,EB)):Q("",!0),oe.value?($(),O("p",PB,T(oe.value),1)):Q("",!0)])):Q("",!0)]))}}),DB=kt(LB,[["__scopeId","data-v-e7440565"]]);async function mg(e,t){const{data:n}=await gn(e,{method:"POST",body:JSON.stringify(t)});return n}async function IB(e,t){const{handle:n,ke1:i}=await Tw(t),s=await mg("/api/auth/stepup/init",{email:e,login_ke:i});let a;try{({ke3:a}=await Ew(n,s.login_response,Pw,e))}catch{throw new Error("invalid credentials")}return(await mg("/api/auth/stepup/finalize",{email:e,session_id:s.session_id,login_ke3:a})).step_up_token}async function MB(e,t){const n=new URLSearchParams({from:e,to:t}),{data:i}=await gn(`/api/me/traffic?${n}`);return i}async function AB(e,t){await gn("/api/me/password",{method:"POST",body:JSON.stringify({current_password:e,new_password:t})})}async function $B(e,t){const n=await IB(e,t);await gn("/api/me",{method:"DELETE",headers:{"X-Step-Up-Token":n},body:JSON.stringify({email:e})})}function OB(e){const t=e.toLowerCase();return!!(t==="localhost"||t==="127.0.0.1"||t==="::1"||t.startsWith("127.")||t.startsWith("[")&&t.endsWith("]")&&t.slice(1,-1)==="::1")}function FB(e,t){const n=e.trim();if(!n)return cn("mobile.relayUrlRequired");let i;try{i=new URL(n)}catch{return cn("mobile.relayUrlMalformed")}return i.protocol!=="http:"&&i.protocol!=="https:"?cn("mobile.relayUrlProtocol"):i.pathname!=="/"||i.search!==""||i.hash!==""?cn("mobile.relayUrlNoPath"):i.protocol==="http:"&&!OB(i.hostname)&&!t?cn("mobile.relayUrlInsecure"):null}const _g=Ua("AttermQRScanner"),BB={class:"pair-consume"},HB={key:0,class:"pending"},NB={class:"step","data-testid":"pair-step"},UB={class:"elapsed","data-testid":"pair-elapsed"},zB={key:1,class:"pair-error","data-testid":"pair-error"},VB={class:"code"};function KB(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),i=atob(t+n),s=new Uint8Array(i.length);for(let a=0;a{const y=r.value;switch(y){case"pair_invalid_url":return a("mobile.pairing.errInvalidUrl");case"pair_invalid_scheme":return a("mobile.pairing.errInvalidScheme");case"platform_unsupported":return a("mobile.pairing.errPlatformUnsupported");case"cannot_reach_relay":return a("mobile.pairing.errCannotReachRelay");case"pair_timeout":return a("mobile.pairing.errTimeout");case"pair_invalid":return a("mobile.pairing.errPairInvalid");case"cancelled":return a("mobile.pairing.errCancelled");default:return a("mobile.pairing.errGeneric",{message:y})}}),b=W(()=>(o.value/1e3).toFixed(1)+"s"),g=W(()=>{switch(c.value){case"parsing":return a("mobile.pairing.stepParsing");case"requesting":return a("mobile.pairing.stepRequesting");case"saving":return a("mobile.pairing.stepSaving");default:return""}});function l(){v||d.value!=="pending"||(o.value=Date.now()-u,h=requestAnimationFrame(l))}function f(){v=!0,r.value="cancelled",d.value="error",h&&(cancelAnimationFrame(h),h=0)}async function p(){var C;const y=WB(n.scannedUrl,!!n.allowInsecure);if(typeof y=="string"){r.value=y,d.value="error";return}u=Date.now(),o.value=0,h=requestAnimationFrame(l);try{if(!s.relay.consumePairing)throw new Error("platform_unsupported");c.value="requesting";const k=await Promise.race([s.relay.consumePairing(y.origin,y.token,y.wrapKey),new Promise((E,I)=>setTimeout(()=>I(new Error("pair_timeout")),16e3))]);if(v||(c.value="saving",await s.relay.save({url:k.relay_url,token:k.session_token,session_expires_at:k.expires_at,allow_insecure_relay:!!n.allowInsecure,remote_permission:"full",last_email:((C=k.user)==null?void 0:C.email)??"",connected:!1,realmId:k.realm_id,homeInstanceURL:k.home_instance_url}),v))return;i("connected")}catch(k){if(v)return;r.value=k instanceof Error?k.message:String(k),d.value="error"}finally{h&&(cancelAnimationFrame(h),h=0)}}return It(p),Vt(()=>{v=!0,h&&(cancelAnimationFrame(h),h=0)}),(y,C)=>($(),O("div",BB,[d.value==="pending"?($(),O("div",HB,[_("p",null,T(w(a)("mobile.pairing.connecting")),1),_("p",NB,T(g.value),1),_("p",UB,T(b.value),1),_("button",{type:"button",class:"cancel","data-testid":"pair-cancel",onClick:f},T(w(a)("common.cancel")),1)])):($(),O("div",zB,[_("p",null,T(w(a)("mobile.pairing.failed")),1),_("p",VB,T(m.value),1),_("button",{type:"button",onClick:C[0]||(C[0]=k=>i("cancel"))},T(w(a)("mobile.pairing.back")),1)]))]))}}),qB=kt(jB,[["__scopeId","data-v-285ce5b2"]]),YB={class:"traffic-dashboard","data-testid":"account-traffic-dashboard"},GB={class:"traffic-heading"},XB={class:"traffic-actions"},JB=["aria-label"],ZB=["data-testid","onClick"],QB=["title","aria-label","disabled"],e6={key:0,class:"traffic-state error",role:"alert"},t6={key:1,class:"traffic-state"},n6={class:"kpi-strip","data-testid":"relay-kpis"},i6=["data-testid"],s6={class:"analysis-panel"},r6={class:"panel-head"},o6={class:"analysis-controls"},a6={class:"segmented compact"},l6={key:0},c6={class:"segmented compact"},d6=["onClick"],u6={class:"segmented compact"},h6={key:0,class:"chart-empty"},f6={key:1,class:"line-chart","data-testid":"traffic-direction-chart"},p6=["aria-label"],v6={class:"grid-lines"},g6=["y1","y2"],m6=["points"],_6=["points"],y6={class:"legend"},b6={key:2,class:"bar-chart","data-testid":"traffic-stacked-chart"},w6={class:"bar-stack"},S6=["title"],C6={key:3,class:"legend series-legend"},k6={class:"detail-grid"},x6={class:"detail-panel"},R6={class:"panel-head"},T6={key:0,class:"category-list"},E6={class:"category-name"},P6={class:"meter"},L6={class:"category-value"},D6={key:1,class:"detail-empty"},I6={class:"detail-panel"},M6={class:"panel-head"},A6={key:0,class:"frame-table-wrap"},$6={key:1,class:"detail-empty"},O6={class:"direct-panel"},F6={class:"panel-head"},B6={class:"direct-strip"},H6=["data-testid"],N6={key:0},U6=["title"],z6=$e({__name:"AccountTrafficDashboard",setup(e){const{t}=Ot(),n=F(7),i=F("bytes"),s=F("group"),a=F("all"),d=F(!1),r=F(!1),o=F(null),c=W(()=>Yu(n.value));async function h(){d.value=!0,r.value=!1;try{o.value=await MB(c.value.from,c.value.to)}catch{o.value=null,r.value=!0}finally{d.value=!1}}function u(de){n.value!==de&&(n.value=de,h())}const v=W(()=>{var de,Le,xe;return(Le=(de=o.value)==null?void 0:de.relay_detail)!=null&&Le.length?o.value.relay_detail.map(Qe=>({...Qe,user_id:"self"})):(((xe=o.value)==null?void 0:xe.relay)??[]).flatMap(Qe=>[{user_id:"self",day:Qe.day,direction:0,bytes:Qe.bytes_in,frames:Qe.frames_in,category:"other"},{user_id:"self",day:Qe.day,direction:1,bytes:Qe.bytes_out,frames:Qe.frames_out,category:"other"}])}),m=W(()=>new Set(c.value.days)),b=W(()=>new Set(c.value.previousDays)),g=W(()=>v.value.filter(de=>!!de.day&&m.value.has(de.day))),l=W(()=>v.value.filter(de=>!!de.day&&b.value.has(de.day))),f=W(()=>Mn(g.value,"bytes")),p=W(()=>Mn(g.value.filter(de=>de.direction===1),"bytes")),y=W(()=>Mn(g.value.filter(de=>de.direction===0),"bytes")),C=W(()=>Mn(g.value,"frames")),k=W(()=>[{key:"total",label:t("settings.account.traffic.kpiTotal"),value:se(f.value),trend:Ss(f.value,Mn(l.value,"bytes"))},{key:"out",label:t("settings.account.traffic.kpiOutbound"),value:se(p.value),trend:Ss(p.value,Mn(l.value.filter(de=>de.direction===1),"bytes"))},{key:"in",label:t("settings.account.traffic.kpiInbound"),value:se(y.value),trend:Ss(y.value,Mn(l.value.filter(de=>de.direction===0),"bytes"))},{key:"frames",label:t("settings.account.traffic.kpiFrames"),value:oe(C.value),trend:Ss(C.value,Mn(l.value,"frames"))}]),E=W(()=>{var de;return(((de=o.value)==null?void 0:de.direct)??[]).filter(Le=>m.value.has(Le.day))}),I=W(()=>{var de;return(((de=o.value)==null?void 0:de.direct)??[]).filter(Le=>b.value.has(Le.day))}),S=W(()=>E.value.reduce((de,Le)=>de+Le.bytes_sent,0)),P=W(()=>E.value.reduce((de,Le)=>de+Le.bytes_received,0)),A=W(()=>S.value+P.value),L=W(()=>I.value.reduce((de,Le)=>de+Le.bytes_sent+Le.bytes_received,0)),x=W(()=>E.value.reduce((de,Le)=>de+Le.attempts,0)),D=W(()=>E.value.reduce((de,Le)=>de+Le.successes,0)),M=W(()=>E.value.reduce((de,Le)=>de+Le.fallbacks,0)),B=W(()=>x.value?Math.min(100,D.value/x.value*100):0),z=W(()=>{const de=f.value+A.value;return de?A.value/de*100:0}),Y=W(()=>[{key:"direct",icon:ym,label:t("settings.account.traffic.p2pTraffic"),value:se(A.value),hint:t("settings.account.traffic.sentReceived",{sent:se(S.value),received:se(P.value)}),trend:Ss(A.value,L.value)},{key:"share",icon:cu,label:t("settings.account.traffic.offloadShare"),value:`${z.value.toFixed(1)}%`,hint:t("settings.account.traffic.offloadHint"),trend:null},{key:"success",icon:Ll,label:t("settings.account.traffic.successRate"),value:`${B.value.toFixed(x.value?1:0)}%`,hint:t("settings.account.traffic.connectionCounts",{attempts:oe(x.value),successes:oe(D.value),fallbacks:oe(M.value)}),trend:null},{key:"fallback",icon:jl,label:t("settings.account.traffic.fallbacks"),value:oe(M.value),hint:t("settings.account.traffic.fallbackHint"),trend:null}]),U=W(()=>db(g.value)),N=W(()=>s.value==="direction"?[]:ub(g.value,c.value.days,s.value,a.value,i.value,!1)),V=W(()=>hb(g.value,c.value.days,i.value)),j=W(()=>Math.max(1,...V.value.inbound,...V.value.outbound)),G=W(()=>Math.max(1,...c.value.days.map((de,Le)=>N.value.reduce((xe,Qe)=>xe+Qe.values[Le],0)))),te=W(()=>{const de=new Map;for(const Le of g.value){const xe=Le.frame_type_name||String(Le.frame_type??"?"),Qe=`${Le.frame_type??xe}:${Le.category??"other"}`,De=de.get(Qe)??{name:xe,category:Le.category??"other",bytes:0,frames:0};De.bytes+=Le.bytes,De.frames+=Le.frames,de.set(Qe,De)}return[...de.values()].sort((Le,xe)=>xe.bytes-Le.bytes).slice(0,8)});function se(de){const Le=["B","KB","MB","GB","TB"];let xe=de,Qe=0;for(;xe>=1024&&Qe=100?0:xe>=10?1:2;return`${xe.toFixed(De)} ${Le[Qe]}`}function oe(de){return new Intl.NumberFormat(void 0,{notation:de>=1e4?"compact":"standard",maximumFractionDigits:1}).format(de)}function Fe(de){return de===null?t("settings.account.traffic.trendNew"):Math.abs(de)<.05?t("settings.account.traffic.trendFlat"):`${de>0?"+":""}${de.toFixed(1)}%`}function K(de){return i.value==="bytes"?se(de):oe(de)}function Z(de){return de.slice(5).replace("-","/")}function J(de){const Le=t(`settings.account.traffic.categories.${de}`);return Le===`settings.account.traffic.categories.${de}`?de:Le}function ae(de){const Le=Math.max(1,Math.floor(c.value.days.length/6));return de===0||de===c.value.days.length-1||de%Le===0}function Ie(de){const Le=Math.max(1,de.length-1);return de.map((xe,Qe)=>`${34+Qe/Le*932},${204-xe/j.value*168}`).join(" ")}return It(h),(de,Le)=>($(),O("div",YB,[_("div",GB,[_("div",null,[_("h3",null,T(w(t)("settings.account.traffic.title")),1),_("p",null,T(w(t)("settings.account.traffic.period",{days:n.value})),1)]),_("div",XB,[_("div",{class:"segmented",role:"group","aria-label":w(t)("settings.account.traffic.range")},[($(),O(Me,null,st([7,30,90],xe=>_("button",{key:xe,type:"button",class:nt({active:n.value===xe}),"data-testid":`traffic-range-${xe}`,onClick:Qe=>u(xe)},T(xe)+T(w(t)("settings.account.traffic.dayUnit")),11,ZB)),64))],8,JB),_("button",{class:"icon-button",type:"button",title:w(t)("settings.account.traffic.refresh"),"aria-label":w(t)("settings.account.traffic.refresh"),disabled:d.value,onClick:h},[Pe(w(hh),{class:nt({spinning:d.value})},null,8,["class"])],8,QB)])]),r.value?($(),O("p",e6,[et(T(w(t)("settings.account.traffic.loadFailed")),1),_("button",{type:"button",onClick:h},T(w(t)("settings.account.traffic.retry")),1)])):d.value&&!o.value?($(),O("div",t6,T(w(t)("common.loading")),1)):($(),O(Me,{key:2},[_("div",n6,[($(!0),O(Me,null,st(k.value,xe=>($(),O("div",{key:xe.key,class:"kpi-cell","data-testid":xe.key==="total"?"relay-traffic-total":`relay-kpi-${xe.key}`},[_("span",null,T(xe.label),1),_("div",null,[_("strong",null,T(xe.value),1),_("small",{class:nt({up:xe.trend!==null&&xe.trend>0,down:xe.trend!==null&&xe.trend<0})},[xe.trend!==null&&xe.trend>0?($(),Ct(w(gm),{key:0})):xe.trend!==null&&xe.trend<0?($(),Ct(w(jl),{key:1})):($(),Ct(w(_m),{key:2})),et(T(Fe(xe.trend)),1)],2)])],8,i6))),128))]),_("section",s6,[_("div",r6,[_("div",null,[_("span",null,T(w(t)("settings.account.traffic.coreAnalysis")),1),_("h4",null,T(w(t)("settings.account.traffic.timelineTitle")),1)]),_("div",o6,[_("div",null,[_("small",null,T(w(t)("settings.account.traffic.view")),1),_("div",a6,[_("button",{type:"button",class:nt({active:s.value==="group"}),"data-testid":"traffic-view-group",onClick:Le[0]||(Le[0]=xe=>s.value="group")},T(w(t)("settings.account.traffic.groupTimeline")),3),_("button",{type:"button",class:nt({active:s.value==="frame"}),"data-testid":"traffic-view-frame",onClick:Le[1]||(Le[1]=xe=>s.value="frame")},T(w(t)("settings.account.traffic.frameTimeline")),3),_("button",{type:"button",class:nt({active:s.value==="direction"}),"data-testid":"traffic-view-direction",onClick:Le[2]||(Le[2]=xe=>s.value="direction")},T(w(t)("settings.account.traffic.directionTrend")),3)])]),s.value!=="direction"?($(),O("div",l6,[_("small",null,T(w(t)("settings.account.traffic.colDirection")),1),_("div",c6,[($(),O(Me,null,st(["all","out","in"],xe=>_("button",{key:xe,type:"button",class:nt({active:a.value===xe}),onClick:Qe=>a.value=xe},T(w(t)(`settings.account.traffic.direction.${xe}`)),11,d6)),64))])])):Q("",!0),_("div",null,[_("small",null,T(w(t)("settings.account.traffic.metric")),1),_("div",u6,[_("button",{type:"button",class:nt({active:i.value==="bytes"}),"data-testid":"traffic-metric-bytes",onClick:Le[3]||(Le[3]=xe=>i.value="bytes")},T(w(t)("settings.account.traffic.bytes")),3),_("button",{type:"button",class:nt({active:i.value==="frames"}),"data-testid":"traffic-metric-frames",onClick:Le[4]||(Le[4]=xe=>i.value="frames")},T(w(t)("settings.account.traffic.frames")),3)])])])]),g.value.length?s.value==="direction"?($(),O("div",f6,[($(),O("svg",{viewBox:"0 0 1000 230",preserveAspectRatio:"none",role:"img","aria-label":w(t)("settings.account.traffic.directionTrend")},[_("g",v6,[($(),O(Me,null,st([36,78,120,162,204],xe=>_("line",{key:xe,x1:"34",y1:xe,x2:"966",y2:xe},null,8,g6)),64))]),_("polyline",{class:"line outbound",points:Ie(V.value.outbound)},null,8,m6),_("polyline",{class:"line inbound",points:Ie(V.value.inbound)},null,8,_6)],8,p6)),_("div",y6,[_("span",null,[Le[5]||(Le[5]=_("i",{class:"outbound"},null,-1)),et(T(w(t)("settings.account.traffic.dirOut")),1)]),_("span",null,[Le[6]||(Le[6]=_("i",{class:"inbound"},null,-1)),et(T(w(t)("settings.account.traffic.dirIn")),1)])])])):($(),O("div",b6,[($(!0),O(Me,null,st(c.value.days,(xe,Qe)=>($(),O("div",{key:xe,class:"bar-column"},[_("div",w6,[($(!0),O(Me,null,st(N.value.slice(0,8),De=>($(),O("i",{key:De.key,style:Gt({height:`${De.values[Qe]/G.value*100}%`,background:De.color}),title:`${De.label} · ${xe} · ${K(De.values[Qe])}`},null,12,S6))),128))]),_("span",null,T(ae(Qe)?Z(xe):""),1)]))),128))])):($(),O("div",h6,T(w(t)("settings.account.traffic.empty")),1)),s.value!=="direction"&&g.value.length?($(),O("div",C6,[($(!0),O(Me,null,st(N.value.slice(0,8),xe=>($(),O("span",{key:xe.key},[_("i",{style:Gt({background:xe.color})},null,4),et(T(s.value==="group"?J(xe.label):xe.label),1)]))),128))])):Q("",!0)]),_("div",k6,[_("section",x6,[_("div",R6,[_("div",null,[_("h4",null,T(w(t)("settings.account.traffic.categorySummary")),1),_("p",null,T(w(t)("settings.account.traffic.totalComposition")),1)])]),U.value.length?($(),O("div",T6,[($(!0),O(Me,null,st(U.value,xe=>($(),O("div",{key:xe.key},[_("span",E6,[_("i",{style:Gt({background:xe.color})},null,4),_("strong",null,T(J(xe.key)),1),_("em",null,T(xe.share.toFixed(1))+"%",1)]),_("span",P6,[_("i",{style:Gt({width:`${xe.share}%`,background:xe.color})},null,4)]),_("span",L6,[_("strong",null,T(se(xe.bytes)),1),_("small",null,T(w(t)("settings.account.traffic.outIn",{out:se(xe.outbound),incoming:se(xe.inbound)})),1)])]))),128))])):($(),O("p",D6,T(w(t)("settings.account.traffic.empty")),1))]),_("section",I6,[_("div",M6,[_("div",null,[_("h4",null,T(w(t)("settings.account.traffic.frameBreakdown")),1),_("p",null,T(w(t)("settings.account.traffic.topFrames")),1)])]),te.value.length?($(),O("div",A6,[_("table",null,[_("thead",null,[_("tr",null,[_("th",null,T(w(t)("settings.account.traffic.colFrameType")),1),_("th",null,T(w(t)("settings.account.traffic.colBytes")),1),_("th",null,T(w(t)("settings.account.traffic.colFrames")),1)])]),_("tbody",null,[($(!0),O(Me,null,st(te.value,xe=>($(),O("tr",{key:`${xe.name}:${xe.category}`},[_("td",null,[_("strong",null,T(xe.name),1),_("small",null,T(J(xe.category)),1)]),_("td",null,T(se(xe.bytes)),1),_("td",null,T(oe(xe.frames)),1)]))),128))])])])):($(),O("p",$6,T(w(t)("settings.account.traffic.empty")),1))])]),_("section",O6,[_("div",F6,[_("div",null,[_("span",null,T(w(t)("settings.account.traffic.p2p")),1),_("h4",null,T(w(t)("settings.account.traffic.directQuality")),1)]),_("small",null,[Pe(w(_o)),et(T(w(t)("settings.account.traffic.aggregateOnly")),1)])]),_("div",B6,[($(!0),O(Me,null,st(Y.value,xe=>($(),O("div",{key:xe.key,"data-testid":xe.key==="direct"?"direct-traffic-total":xe.key==="success"?"direct-success-rate":void 0},[_("span",null,[($(),Ct(rm(xe.icon))),et(T(xe.label),1)]),_("strong",null,T(xe.value),1),_("small",null,T(xe.hint),1),xe.trend!==null?($(),O("em",N6,T(Fe(xe.trend)),1)):Q("",!0)],8,H6))),128))]),_("div",{class:"success-meter",title:`${B.value.toFixed(1)}%`},[_("i",{style:Gt({width:`${B.value}%`})},null,4)],8,U6)])],64))]))}}),fb=kt(z6,[["__scopeId","data-v-35494cb0"]]),V6={class:"tab-pane account-tab"},K6=["disabled"],W6={class:"field-label",for:"account-relay-url"},j6={class:"relay-url-row"},q6=["disabled"],Y6=["disabled"],G6={key:2,class:"checkbox-row"},X6=["disabled"],J6={class:"settings-field-grid settings-field-grid--two","data-testid":"account-login-credentials-grid"},Z6={class:"settings-field"},Q6={class:"field-label",for:"account-login-email"},e8=["disabled"],t8={class:"settings-field"},n8={class:"field-label",for:"account-login-password"},i8=["disabled"],s8={key:3,class:"inline-error",role:"alert"},r8=["disabled"],o8={class:"account-section"},a8={class:"field-label"},l8={class:"email-value","data-testid":"account-email"},c8=["disabled"],d8={key:0,class:"account-section"},u8={class:"account-section"},h8={class:"settings-field"},f8={class:"field-label",for:"account-old-password"},p8=["disabled"],v8={class:"settings-field-grid settings-field-grid--two","data-testid":"account-password-grid"},g8={class:"settings-field"},m8={class:"field-label",for:"account-new-password"},_8=["disabled"],y8={key:0,class:"hint"},b8={class:"settings-field"},w8={class:"field-label",for:"account-confirm-password"},S8=["disabled"],C8={key:0,class:"hint"},k8=["disabled"],x8={key:0,class:"error"},R8={key:1,class:"success"},T8={class:"account-section danger-zone"},E8={class:"hint warning-text"},P8={class:"field-label",for:"danger-current-password"},L8=["disabled"],D8={class:"field-label",for:"danger-confirm-email"},I8=["disabled"],M8=["disabled"],A8={key:0,class:"error"},$8=$e({__name:"SettingsAccount",setup(e){const{t}=Ot(),n=fn(),i=F(""),s=F(!0),a=F(!1),d=F(!1),r=F("https://"),o=F(""),c=F(""),h=F(""),u=F(!1),v=F(!1),m=F(""),b=F(""),g=W(()=>!!n.relay.login),l=W(()=>!!n.relay.consumePairing),f=W(()=>r.value+o.value.trim());function p(K){const Z=/^\s*(https?:\/\/)(.*)$/i.exec(K);Z?(r.value=Z[1].toLowerCase(),o.value=Z[2].trim()):o.value=K.trim(),r.value==="https://"&&(u.value=!1)}function y(){p(o.value)}It(async()=>{var K,Z;try{const J=await n.relay.load();J&&(p(J.url||""),c.value=J.last_email||"",u.value=!!J.allow_insecure_relay)}catch{}try{h.value=await((Z=(K=n.relay).loadSavedPassword)==null?void 0:Z.call(K))??""}catch{}try{const J=await n.relay.fetchMe();i.value=J.email,c.value||(c.value=J.email),d.value=!0}catch{d.value=!1}finally{s.value=!1}});async function C(){var K,Z;if(!a.value){a.value=!0;try{await((Z=(K=n.relay).logout)==null?void 0:Z.call(K))}catch{}finally{if(g.value){d.value=!1,i.value="",a.value=!1,n.events.emit("relay:auth-restored",void 0);return}location.assign("/login.html")}}}async function k(){if(!n.relay.login||v.value)return;m.value="";const K=FB(f.value,u.value);if(K){m.value=K;return}if(!c.value.trim()){m.value=t("mobile.emailRequired");return}if(!h.value){m.value=t("mobile.passwordRequired");return}v.value=!0;try{await n.relay.login(f.value.replace(/\/$/,""),c.value.trim(),h.value,u.value);const Z=await n.relay.fetchMe();i.value=Z.email,c.value=Z.email,d.value=!0,n.events.emit("relay:auth-restored",void 0)}catch(Z){const J=Z instanceof Error?Z.message:String(Z);J==="invalid_credentials"?m.value=t("mobile.invalidCredentials"):J==="rate_limited"?m.value=t("mobile.rateLimited"):/403|origin/i.test(J)?m.value=t("mobile.originRejected"):m.value=t("mobile.cannotReachRelay",{message:J})}finally{v.value=!1}}async function E(){m.value="";try{const{camera:K}=await _g.requestPermissions();if(K!=="granted"){m.value=t("mobile.pairing.cameraDenied");return}const Z=await _g.scan();if(Z.cancelled)return;if(!Z.rawValue){m.value=t("mobile.pairing.noQrDetected");return}b.value=Z.rawValue}catch(K){const Z=K instanceof Error?K.message:String(K);/PLUGIN_NOT_AVAILABLE|not implemented/i.test(Z)?m.value=t("mobile.pairing.scanNotAvailable"):m.value=Z}}async function I(){b.value="";try{const K=await n.relay.fetchMe();i.value=K.email,c.value=K.email,d.value=!0,n.events.emit("relay:auth-restored",void 0)}catch(K){m.value=K instanceof Error?K.message:String(K)}}function S(K){return K instanceof Error&&K.message==="invalid credentials"?t("settings.account.errors.wrongPassword"):K instanceof is?K.code==="step_up_required"||K.code==="step_up_invalid"?t("settings.account.errors.sessionExpired"):K.status===401?t("settings.account.errors.wrongPassword"):K.status===429?t("settings.account.errors.rateLimited"):K.status===0?t("settings.account.errors.network"):t("settings.account.errors.generic"):K instanceof Error?K.message:String(K)}const P=F(""),A=F(""),L=F(""),x=F(!1),D=F(""),M=F(""),B=W(()=>A.value.length>=8),z=W(()=>L.value!==""&&A.value===L.value),Y=W(()=>P.value!==""&&B.value&&z.value&&!x.value);async function U(){if(Y.value){D.value="",M.value="",x.value=!0;try{await AB(P.value,A.value),M.value=t("settings.account.changePassword.successToast"),P.value="",A.value="",L.value=""}catch(K){D.value=S(K)}finally{x.value=!1}}}const N=F(!1),V=F(""),j=F(""),G=F(!1),te=F(""),se=W(()=>V.value!==""&&i.value!==""&&j.value===i.value&&!G.value);function oe(){N.value=!N.value,N.value||(V.value="",j.value="",te.value="")}async function Fe(){if(se.value&&window.confirm(t("settings.account.dangerZone.confirmPrompt"))){te.value="",G.value=!0;try{await $B(i.value,V.value),location.assign("/login.html")}catch(K){te.value=S(K)}finally{G.value=!1}}}return(K,Z)=>($(),O("div",V6,[!d.value&&g.value?($(),O("form",{key:0,class:"account-section inline-login","data-testid":"account-inline-login",onSubmit:pt(k,["prevent"])},[_("h3",null,T(w(t)("mobile.loginButton")),1),l.value?($(),O("button",{key:0,type:"button",class:"secondary primary-action","data-testid":"account-scan-qr",disabled:v.value||!!b.value,onClick:E},T(w(t)("mobile.pairing.scan")),9,K6)):Q("",!0),b.value?($(),Ct(qB,{key:1,"scanned-url":b.value,"allow-insecure":u.value,onConnected:I,onCancel:Z[0]||(Z[0]=J=>b.value="")},null,8,["scanned-url","allow-insecure"])):Q("",!0),_("label",W6,T(w(t)("mobile.relayUrl")),1),_("div",j6,[ct(_("select",{"onUpdate:modelValue":Z[1]||(Z[1]=J=>r.value=J),"data-testid":"account-login-scheme",disabled:v.value,onChange:Z[2]||(Z[2]=J=>r.value==="https://"?u.value=!1:void 0)},Z[12]||(Z[12]=[_("option",{value:"https://"},"https://",-1),_("option",{value:"http://"},"http://",-1)]),40,q6),[[om,r.value]]),ct(_("input",{id:"account-relay-url","onUpdate:modelValue":Z[3]||(Z[3]=J=>o.value=J),"data-testid":"account-login-url",disabled:v.value,autocomplete:"off",autocapitalize:"off",spellcheck:"false",placeholder:"relay.example.com",onInput:y},null,40,Y6),[[Et,o.value]])]),r.value==="http://"?($(),O("label",G6,[_("span",null,T(w(t)("mobile.allowInsecure")),1),ct(_("input",{"onUpdate:modelValue":Z[4]||(Z[4]=J=>u.value=J),"data-testid":"account-login-allow-insecure",disabled:v.value,type:"checkbox"},null,8,X6),[[ko,u.value]])])):Q("",!0),_("div",J6,[_("div",Z6,[_("label",Q6,T(w(t)("mobile.email")),1),ct(_("input",{id:"account-login-email","onUpdate:modelValue":Z[5]||(Z[5]=J=>c.value=J),"data-testid":"account-login-email",disabled:v.value,type:"email",autocomplete:"username",autocapitalize:"off",spellcheck:"false"},null,8,e8),[[Et,c.value]])]),_("div",t8,[_("label",n8,T(w(t)("mobile.password")),1),ct(_("input",{id:"account-login-password","onUpdate:modelValue":Z[6]||(Z[6]=J=>h.value=J),"data-testid":"account-login-password",disabled:v.value,type:"password",autocomplete:"current-password"},null,8,i8),[[Et,h.value]])])]),m.value?($(),O("p",s8,T(m.value),1)):Q("",!0),_("button",{type:"submit",class:"secondary primary-action","data-testid":"account-login-submit",disabled:v.value},T(v.value?w(t)("common.loading"):w(t)("mobile.loginButton")),9,r8)],32)):($(),O(Me,{key:1},[_("section",o8,[_("label",a8,T(w(t)("settings.account.email")),1),_("p",l8,T(s.value?w(t)("common.loading"):i.value),1),_("button",{type:"button",class:"secondary","data-testid":"account-logout-button",disabled:a.value,onClick:C},T(a.value?w(t)("settings.account.logout.submitting"):w(t)("settings.account.logout.button")),9,c8)]),d.value?($(),O("section",d8,[Pe(fb)])):Q("",!0),_("section",u8,[_("h3",null,T(w(t)("settings.account.changePassword.title")),1),_("div",h8,[_("label",f8,T(w(t)("settings.account.changePassword.oldPassword")),1),ct(_("input",{id:"account-old-password","onUpdate:modelValue":Z[7]||(Z[7]=J=>P.value=J),"data-testid":"old-password-input",type:"password",autocomplete:"current-password",disabled:x.value},null,8,p8),[[Et,P.value]])]),_("div",v8,[_("div",g8,[_("label",m8,T(w(t)("settings.account.changePassword.newPassword")),1),ct(_("input",{id:"account-new-password","onUpdate:modelValue":Z[8]||(Z[8]=J=>A.value=J),"data-testid":"new-password-input",type:"password",autocomplete:"new-password",disabled:x.value},null,8,_8),[[Et,A.value]]),A.value&&!B.value?($(),O("p",y8,T(w(t)("settings.account.changePassword.hintLength")),1)):Q("",!0)]),_("div",b8,[_("label",w8,T(w(t)("settings.account.changePassword.confirmPassword")),1),ct(_("input",{id:"account-confirm-password","onUpdate:modelValue":Z[9]||(Z[9]=J=>L.value=J),"data-testid":"confirm-password-input",type:"password",autocomplete:"new-password",disabled:x.value,onKeyup:jn(U,["enter"])},null,40,S8),[[Et,L.value]]),L.value&&!z.value?($(),O("p",C8,T(w(t)("settings.account.changePassword.hintMismatch")),1)):Q("",!0)])]),_("button",{type:"button",class:"secondary","data-testid":"change-password-submit",disabled:!Y.value,onClick:U},T(x.value?w(t)("settings.account.changePassword.submitting"):w(t)("settings.account.changePassword.submit")),9,k8),D.value?($(),O("p",x8,T(D.value),1)):Q("",!0),M.value?($(),O("p",R8,T(M.value),1)):Q("",!0)]),_("section",T8,[_("h3",null,T(w(t)("settings.account.dangerZone.title")),1),_("p",E8,T(w(t)("settings.account.dangerZone.warning")),1),_("button",{type:"button",class:"secondary","data-testid":"danger-zone-toggle",onClick:oe},T(w(t)("settings.account.dangerZone.toggle")),1),N.value?($(),O(Me,{key:0},[_("label",P8,T(w(t)("settings.account.dangerZone.currentPassword")),1),ct(_("input",{id:"danger-current-password","onUpdate:modelValue":Z[10]||(Z[10]=J=>V.value=J),"data-testid":"danger-current-password",type:"password",autocomplete:"current-password",disabled:G.value},null,8,L8),[[Et,V.value]]),_("label",D8,T(w(t)("settings.account.dangerZone.typeEmailToConfirm")),1),ct(_("input",{id:"danger-confirm-email","onUpdate:modelValue":Z[11]||(Z[11]=J=>j.value=J),"data-testid":"danger-confirm-email",type:"text",autocomplete:"off",spellcheck:"false",disabled:G.value},null,8,I8),[[Et,j.value]]),_("button",{type:"button",class:"danger-btn","data-testid":"danger-delete-button",disabled:!se.value,onClick:Fe},T(G.value?w(t)("settings.account.dangerZone.deleting"):w(t)("settings.account.dangerZone.deleteButton")),9,M8),te.value?($(),O("p",A8,T(te.value),1)):Q("",!0)],64)):Q("",!0)])],64))]))}}),O8=kt($8,[["__scopeId","data-v-2c82ebe0"]]);var Wa={},F8=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},pb={},Fi={};let nf;const B8=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Fi.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};Fi.getSymbolTotalCodewords=function(t){return B8[t]};Fi.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};Fi.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');nf=t};Fi.isKanjiModeEnabled=function(){return typeof nf<"u"};Fi.toSJIS=function(t){return nf(t)};var Uc={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+n)}}e.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},e.from=function(i,s){if(e.isValid(i))return i;try{return t(i)}catch{return s}}})(Uc);function vb(){this.buffer=[],this.length=0}vb.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let n=0;n>>t-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var H8=vb;function ja(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}ja.prototype.set=function(e,t,n,i){const s=e*this.size+t;this.data[s]=n,i&&(this.reservedBit[s]=!0)};ja.prototype.get=function(e,t){return this.data[e*this.size+t]};ja.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n};ja.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var N8=ja,gb={};(function(e){const t=Fi.getSymbolSize;e.getRowColCoords=function(i){if(i===1)return[];const s=Math.floor(i/7)+2,a=t(i),d=a===145?26:Math.ceil((a-13)/(2*s-2))*2,r=[a-7];for(let o=1;o=0&&s<=7},e.from=function(s){return e.isValid(s)?parseInt(s,10):void 0},e.getPenaltyN1=function(s){const a=s.size;let d=0,r=0,o=0,c=null,h=null;for(let u=0;u=5&&(d+=t.N1+(r-5)),c=m,r=1),m=s.get(v,u),m===h?o++:(o>=5&&(d+=t.N1+(o-5)),h=m,o=1)}r>=5&&(d+=t.N1+(r-5)),o>=5&&(d+=t.N1+(o-5))}return d},e.getPenaltyN2=function(s){const a=s.size;let d=0;for(let r=0;r=10&&(r===1488||r===93)&&d++,o=o<<1&2047|s.get(h,c),h>=10&&(o===1488||o===93)&&d++}return d*t.N3},e.getPenaltyN4=function(s){let a=0;const d=s.data.length;for(let o=0;o=0;){const d=a[0];for(let o=0;o0){const a=new Uint8Array(this.degree);return a.set(i,s),a}return i};var z8=sf,wb={},br={},rf={};rf.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var Ts={};const Sb="[0-9]+",V8="[A-Z $%*+\\-./:]+";let Oa="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Oa=Oa.replace(/u/g,"\\u");const K8="(?:(?![A-Z0-9 $%*+\\-./:]|"+Oa+`)(?:.|[\r +]))+`;Ts.KANJI=new RegExp(Oa,"g");Ts.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Ts.BYTE=new RegExp(K8,"g");Ts.NUMERIC=new RegExp(Sb,"g");Ts.ALPHANUMERIC=new RegExp(V8,"g");const W8=new RegExp("^"+Oa+"$"),j8=new RegExp("^"+Sb+"$"),q8=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Ts.testKanji=function(t){return W8.test(t)};Ts.testNumeric=function(t){return j8.test(t)};Ts.testAlphanumeric=function(t){return q8.test(t)};(function(e){const t=rf,n=Ts;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(a,d){if(!a.ccBits)throw new Error("Invalid mode: "+a);if(!t.isValid(d))throw new Error("Invalid version: "+d);return d>=1&&d<10?a.ccBits[0]:d<27?a.ccBits[1]:a.ccBits[2]},e.getBestModeForData=function(a){return n.testNumeric(a)?e.NUMERIC:n.testAlphanumeric(a)?e.ALPHANUMERIC:n.testKanji(a)?e.KANJI:e.BYTE},e.toString=function(a){if(a&&a.id)return a.id;throw new Error("Invalid mode")},e.isValid=function(a){return a&&a.bit&&a.ccBits};function i(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+s)}}e.from=function(a,d){if(e.isValid(a))return a;try{return i(a)}catch{return d}}})(br);(function(e){const t=Fi,n=zc,i=Uc,s=br,a=rf,d=7973,r=t.getBCHDigit(d);function o(v,m,b){for(let g=1;g<=40;g++)if(m<=e.getCapacity(g,b,v))return g}function c(v,m){return s.getCharCountIndicator(v,m)+4}function h(v,m){let b=0;return v.forEach(function(g){const l=c(g.mode,m);b+=l+g.getBitsLength()}),b}function u(v,m){for(let b=1;b<=40;b++)if(h(v,b)<=e.getCapacity(b,m,s.MIXED))return b}e.from=function(m,b){return a.isValid(m)?parseInt(m,10):b},e.getCapacity=function(m,b,g){if(!a.isValid(m))throw new Error("Invalid QR Code version");typeof g>"u"&&(g=s.BYTE);const l=t.getSymbolTotalCodewords(m),f=n.getTotalCodewordsCount(m,b),p=(l-f)*8;if(g===s.MIXED)return p;const y=p-c(g,m);switch(g){case s.NUMERIC:return Math.floor(y/10*3);case s.ALPHANUMERIC:return Math.floor(y/11*2);case s.KANJI:return Math.floor(y/13);case s.BYTE:default:return Math.floor(y/8)}},e.getBestVersionForData=function(m,b){let g;const l=i.from(b,i.M);if(Array.isArray(m)){if(m.length>1)return u(m,l);if(m.length===0)return 1;g=m[0]}else g=m;return o(g.mode,g.getLength(),l)},e.getEncodedBits=function(m){if(!a.isValid(m)||m<7)throw new Error("Invalid QR Code version");let b=m<<12;for(;t.getBCHDigit(b)-r>=0;)b^=d<=0;)s^=kb<0&&(i=this.data.substr(n),s=parseInt(i,10),t.put(s,a*3+1))};var X8=Io;const J8=br,qd=["0","1","2","3","4","5","6","7","8","9","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"," ","$","%","*","+","-",".","/",":"];function Mo(e){this.mode=J8.ALPHANUMERIC,this.data=e}Mo.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};Mo.prototype.getLength=function(){return this.data.length};Mo.prototype.getBitsLength=function(){return Mo.getBitsLength(this.data.length)};Mo.prototype.write=function(t){let n;for(n=0;n+2<=this.data.length;n+=2){let i=qd.indexOf(this.data[n])*45;i+=qd.indexOf(this.data[n+1]),t.put(i,11)}this.data.length%2&&t.put(qd.indexOf(this.data[n]),6)};var Z8=Mo;const Q8=br;function Ao(e){this.mode=Q8.BYTE,typeof e=="string"?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}Ao.getBitsLength=function(t){return t*8};Ao.prototype.getLength=function(){return this.data.length};Ao.prototype.getBitsLength=function(){return Ao.getBitsLength(this.data.length)};Ao.prototype.write=function(e){for(let t=0,n=this.data.length;t=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+` +Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}};var iH=$o,Rb={exports:{}};(function(e){var t={single_source_shortest_paths:function(n,i,s){var a={},d={};d[i]=0;var r=t.PriorityQueue.make();r.push(i,0);for(var o,c,h,u,v,m,b,g,l;!r.empty();){o=r.pop(),c=o.value,u=o.cost,v=n[c]||{};for(h in v)v.hasOwnProperty(h)&&(m=v[h],b=u+m,g=d[h],l=typeof d[h]>"u",(l||g>b)&&(d[h]=b,r.push(h,b),a[h]=c))}if(typeof s<"u"&&typeof d[s]>"u"){var f=["Could not find a path from ",i," to ",s,"."].join("");throw new Error(f)}return a},extract_shortest_path_from_predecessor_list:function(n,i){for(var s=[],a=i;a;)s.push(a),n[a],a=n[a];return s.reverse(),s},find_path:function(n,i,s){var a=t.single_source_shortest_paths(n,i,s);return t.extract_shortest_path_from_predecessor_list(a,s)},PriorityQueue:{make:function(n){var i=t.PriorityQueue,s={},a;n=n||{};for(a in i)i.hasOwnProperty(a)&&(s[a]=i[a]);return s.queue=[],s.sorter=n.sorter||i.default_sorter,s},default_sorter:function(n,i){return n.cost-i.cost},push:function(n,i){var s={value:n,cost:i};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Rb);var sH=Rb.exports;(function(e){const t=br,n=X8,i=Z8,s=eH,a=iH,d=Ts,r=Fi,o=sH;function c(f){return unescape(encodeURIComponent(f)).length}function h(f,p,y){const C=[];let k;for(;(k=f.exec(y))!==null;)C.push({data:k[0],index:k.index,mode:p,length:k[0].length});return C}function u(f){const p=h(d.NUMERIC,t.NUMERIC,f),y=h(d.ALPHANUMERIC,t.ALPHANUMERIC,f);let C,k;return r.isKanjiModeEnabled()?(C=h(d.BYTE,t.BYTE,f),k=h(d.KANJI,t.KANJI,f)):(C=h(d.BYTE_KANJI,t.BYTE,f),k=[]),p.concat(y,C,k).sort(function(I,S){return I.index-S.index}).map(function(I){return{data:I.data,mode:I.mode,length:I.length}})}function v(f,p){switch(p){case t.NUMERIC:return n.getBitsLength(f);case t.ALPHANUMERIC:return i.getBitsLength(f);case t.KANJI:return a.getBitsLength(f);case t.BYTE:return s.getBitsLength(f)}}function m(f){return f.reduce(function(p,y){const C=p.length-1>=0?p[p.length-1]:null;return C&&C.mode===y.mode?(p[p.length-1].data+=y.data,p):(p.push(y),p)},[])}function b(f){const p=[];for(let y=0;y=0&&r<=6&&(o===0||o===6)||o>=0&&o<=6&&(r===0||r===6)||r>=2&&r<=4&&o>=2&&o<=4?e.set(a+r,d+o,!0,!0):e.set(a+r,d+o,!1,!0))}}function fH(e){const t=e.size;for(let n=8;n>r&1)===1,e.set(s,a,d,!0),e.set(a,s,d,!0)}function Xd(e,t,n){const i=e.size,s=dH.getEncodedBits(t,n);let a,d;for(a=0;a<15;a++)d=(s>>a&1)===1,a<6?e.set(a,8,d,!0):a<8?e.set(a+1,8,d,!0):e.set(i-15+a,8,d,!0),a<8?e.set(8,i-a-1,d,!0):a<9?e.set(8,15-a-1+1,d,!0):e.set(8,15-a-1,d,!0);e.set(i-8,8,1,!0)}function gH(e,t){const n=e.size;let i=-1,s=n-1,a=7,d=0;for(let r=n-1;r>0;r-=2)for(r===6&&r--;;){for(let o=0;o<2;o++)if(!e.isReserved(s,r-o)){let c=!1;d>>a&1)===1),e.set(s,r-o,c),a--,a===-1&&(d++,a=7)}if(s+=i,s<0||n<=s){s-=i,i=-i;break}}}function mH(e,t,n){const i=new rH;n.forEach(function(o){i.put(o.mode.bit,4),i.put(o.getLength(),uH.getCharCountIndicator(o.mode,e)),o.write(i)});const s=Kc.getSymbolTotalCodewords(e),a=Qu.getTotalCodewordsCount(e,t),d=(s-a)*8;for(i.getLengthInBits()+4<=d&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);const r=(d-i.getLengthInBits())/8;for(let o=0;o=7&&vH(o,t),gH(o,d),isNaN(i)&&(i=Zu.getBestMask(o,Xd.bind(null,o,n))),Zu.applyMask(i,o),Xd(o,n,i),{modules:o,version:t,errorCorrectionLevel:n,maskPattern:i,segments:s}}pb.create=function(t,n){if(typeof t>"u"||t==="")throw new Error("No input text");let i=Yd.M,s,a;return typeof n<"u"&&(i=Yd.from(n.errorCorrectionLevel,Yd.M),s=_c.from(n.version),a=Zu.from(n.maskPattern),n.toSJISFunc&&Kc.setToSJISFunction(n.toSJISFunc)),yH(t,s,i,a)};var Tb={},of={};(function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let i=n.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+n);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(a){return[a,a]}))),i.length===6&&i.push("F","F");const s=parseInt(i.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+i.slice(0,6).join("")}}e.getOptions=function(i){i||(i={}),i.color||(i.color={});const s=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,a=i.width&&i.width>=21?i.width:void 0,d=i.scale||4;return{width:a,scale:a?4:d,margin:s,color:{dark:t(i.color.dark||"#000000ff"),light:t(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},e.getScale=function(i,s){return s.width&&s.width>=i+s.margin*2?s.width/(i+s.margin*2):s.scale},e.getImageWidth=function(i,s){const a=e.getScale(i,s);return Math.floor((i+s.margin*2)*a)},e.qrToImageData=function(i,s,a){const d=s.modules.size,r=s.modules.data,o=e.getScale(d,a),c=Math.floor((d+a.margin*2)*o),h=a.margin*o,u=[a.color.light,a.color.dark];for(let v=0;v=h&&m>=h&&v"u"&&(!d||!d.getContext)&&(o=d,d=void 0),d||(c=i()),o=t.getOptions(o);const h=t.getImageWidth(a.modules.size,o),u=c.getContext("2d"),v=u.createImageData(h,h);return t.qrToImageData(v.data,a,o),n(u,c,h),u.putImageData(v,0,0),c},e.renderToDataURL=function(a,d,r){let o=r;typeof o>"u"&&(!d||!d.getContext)&&(o=d,d=void 0),o||(o={});const c=e.render(a,d,o),h=o.type||"image/png",u=o.rendererOpts||{};return c.toDataURL(h,u.quality)}})(Tb);var Eb={};const bH=of;function wg(e,t){const n=e.a/255,i=t+'="'+e.hex+'"';return n<1?i+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':i}function Jd(e,t,n){let i=e+t;return typeof n<"u"&&(i+=" "+n),i}function wH(e,t,n){let i="",s=0,a=!1,d=0;for(let r=0;r0&&o>0&&e[r-1]||(i+=a?Jd("M",o+n,.5+c+n):Jd("m",s,0),s=0,a=!1),o+1':"",c="',h='viewBox="0 0 '+r+" "+r+'"',v=''+o+c+` +`;return typeof i=="function"&&i(null,v),v};const SH=F8,eh=pb,Pb=Tb,CH=Eb;function af(e,t,n,i,s){const a=[].slice.call(arguments,1),d=a.length,r=typeof a[d-1]=="function";if(!r&&!SH())throw new Error("Callback required as last argument");if(r){if(d<2)throw new Error("Too few arguments provided");d===2?(s=n,n=t,t=i=void 0):d===3&&(t.getContext&&typeof s>"u"?(s=i,i=void 0):(s=i,i=n,n=t,t=void 0))}else{if(d<1)throw new Error("Too few arguments provided");return d===1?(n=t,t=i=void 0):d===2&&!t.getContext&&(i=n,n=t,t=void 0),new Promise(function(o,c){try{const h=eh.create(n,i);o(e(h,t,i))}catch(h){c(h)}})}try{const o=eh.create(n,i);s(null,e(o,t,i))}catch(o){s(o)}}Wa.create=eh.create;Wa.toCanvas=af.bind(null,Pb.render);Wa.toDataURL=af.bind(null,Pb.renderToDataURL);Wa.toString=af.bind(null,function(e,t,n){return CH.render(e,n)});const kH={class:"pairing-panel","data-testid":"pairing-panel"},xH={class:"title"},RH={class:"hint"},TH=["disabled"],EH={key:1,class:"qr-wrap"},PH=["src"],LH={key:0,class:"wrap-badge","data-testid":"pair-wrap-badge"},DH={key:1,class:"wrap-warning","data-testid":"pair-wrap-warning"},IH={key:2,class:"countdown"},MH={class:"time"},AH={key:3,class:"countdown expired","data-testid":"pair-expired"},$H={class:"prefix"},OH={key:2,class:"error"},FH=$e({__name:"PairingPanel",setup(e){const{t}=Ot(),n=F(!1),i=F(""),s=F(null),a=F(""),d=F(Math.floor(Date.now()/1e3));let r=null;const o=W(()=>s.value?Math.max(0,s.value.expires_at-d.value):0),c=W(()=>{const v=o.value,m=Math.floor(v/60),b=v%60;return`${m}:${b.toString().padStart(2,"0")}`}),h=W(()=>s.value!==null&&o.value===0);async function u(){n.value=!0,i.value="";try{const v=await bC();a.value=await Wa.toDataURL(v.qr_url,{width:240,margin:1}),s.value=v,d.value=Math.floor(Date.now()/1e3),r&&clearInterval(r),r=setInterval(()=>{d.value=Math.floor(Date.now()/1e3)},1e3)}catch(v){i.value=v instanceof Error?v.message:String(v)}finally{n.value=!1}}return Vt(()=>{r&&clearInterval(r)}),(v,m)=>($(),O("section",kH,[_("div",xH,T(w(t)("settings.relay.pairing.title")),1),_("p",RH,T(w(t)("settings.relay.pairing.hint")),1),s.value?($(),O("div",EH,[_("img",{src:a.value,alt:"",class:nt(["qr",{dimmed:h.value}]),"data-testid":"pair-qr"},null,10,PH),s.value.wrapped?($(),O("div",LH,T(w(t)("settings.relay.pairing.wrappedBadge")),1)):($(),O("p",DH,T(w(t)("settings.relay.pairing.unwrappedWarning")),1)),h.value?($(),O("div",AH,T(w(t)("settings.relay.pairing.expired")),1)):($(),O("div",IH,[_("span",null,T(w(t)("settings.relay.pairing.expiresIn")),1),_("span",MH,T(c.value),1)])),_("code",$H,T(s.value.token.slice(0,12))+"…",1),_("button",{type:"button","data-testid":"pair-regenerate",onClick:u},T(w(t)("settings.relay.pairing.regenerate")),1)])):($(),O("button",{key:0,type:"button","data-testid":"pair-generate",disabled:n.value,onClick:u},T(n.value?w(t)("settings.relay.pairing.generating"):w(t)("settings.relay.pairing.generate")),9,TH)),i.value?($(),O("p",OH,T(i.value),1)):Q("",!0)]))}}),BH=kt(FH,[["__scopeId","data-v-45575575"]]),HH={class:"tab-pane"},NH={key:0,class:"dim"},UH={class:"uplink-toggle-row"},zH={class:"connection-toggle-group"},VH={class:"field-label"},KH=["disabled"],WH={class:"toggle-label"},jH={key:0,class:"connection-toggle-group"},qH={class:"field-label"},YH=["title","aria-label"],GH=["checked","disabled"],XH={class:"toggle-label"},JH={class:"hint"},ZH={key:0,class:"traffic-section"},QH={class:"url-label-row"},eN={class:"field-label",for:"relay-host"},tN={class:"insecure-inline"},nN=["disabled"],iN=["disabled"],sN={key:1,class:"warning"},rN={key:2,class:"warning"},oN={class:"settings-field-grid settings-field-grid--two","data-test":"relay-credentials-grid"},aN={class:"settings-field"},lN={class:"field-label",for:"relay-email"},cN=["autocomplete","disabled"],dN={class:"settings-field"},uN={class:"field-label",for:"relay-password"},hN={class:"password-field"},fN=["type","disabled"],pN=["aria-label","aria-pressed","disabled"],vN={key:0,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},gN={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},mN={class:"field-label",for:"relay-claim-token"},_N=["placeholder","disabled"],yN={class:"hint"},bN=["disabled"],wN={class:"auth-switch-action"},SN={class:"checkbox"},CN=["checked","disabled"],kN={key:4,class:"warning"},xN={key:5,class:"error"},RN={class:"danger-zone"},TN={class:"danger-zone-text"},EN={class:"field-label"},PN={class:"hint"},LN=["disabled"],DN=$e({__name:"SettingsRelay",emits:["relay-config-changed","dirty","direct-connection-changed"],setup(e,{expose:t,emit:n}){const i=fn(),s=n,a=F(""),d=F("https"),r=[{value:"https",label:"https://"},{value:"http",label:"http://"}],o=F(""),c=F(!1),h=F(!1),u=F(!1),v=F(!0),m=F(!1),b=F(!1),g=F(!1),l=F(!1),f=F(!0),p=F(!1),y=F(""),{t:C}=Ot(),k=F(""),E=F(""),I=F(!1),S=F("login"),P=F(""),A=F(""),L=F(""),x=F(""),D=F("https"),M=F(""),B=F(!1);function z(De){return De.trim().replace(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//,"")}function Y(De){return/^(?:http|ws):\/\//i.test(De.trim())?"http":"https"}const U=W(()=>`${d.value}://`);wt(a,De=>{/:\/\//.test(De)&&(d.value=Y(De),a.value=z(De))});const N=W(()=>{const De=z(a.value);return De?U.value+De:""}),V=W(()=>{const De=z(a.value);return De?`${d.value==="http"?"ws":"wss"}://${De}`:""}),j=W(()=>z(a.value)!==x.value||d.value!==D.value||o.value!==M.value||c.value!==B.value);wt(j,De=>s("dirty",De));function G(){S.value=S.value==="login"?"register":"login",S.value==="login"&&(P.value="")}function te(De){try{const ne=new URL(De.trim());return ne.host?["http:","https:","ws:","wss:"].includes(ne.protocol):!1}catch{return!1}}const se=W(()=>L.value?{text:C("settings.relay.connectedAs",{identity:L.value}),cls:"on"}:A.value?{text:C("settings.relay.connectedAs",{identity:A.value.slice(0,8)}),cls:"on"}:N.value?u.value?{text:C("settings.relay.paused"),cls:"off"}:te(N.value)?{text:C("settings.relay.connecting"),cls:"warn"}:{text:C("settings.relay.relayInvalid"),cls:"error"}:{text:C("settings.relay.notConfigured"),cls:"off"});async function oe(){v.value=!0;try{const De=await Xl();if(c.value=De.allow_insecure_relay,d.value=Y(De.url),a.value=z(De.url),o.value=De.token,h.value=De.disable_e2ee??!1,u.value=De.paused??!1,J(),k.value=De.last_email??"",k.value)try{E.value=await mC()}catch{}else E.value="";if(A.value="",L.value="",De.token)try{const ne=await np();L.value=ne.email||"",A.value=ne.user_id||""}catch{}}catch(De){y.value=(De==null?void 0:De.message)??String(De)}finally{v.value=!1}}It(async()=>{await Promise.all([oe(),Fe()]),i.events.on("relay:auth-info",async De=>{const{user_id:ne}=De;if(A.value=ne||"",!ne){L.value="";return}try{const ue=await np();L.value=ue.email||""}catch{}}),i.events.on("e2ee-mode-changed",De=>{const ne=De==null?void 0:De.disabled;typeof ne=="boolean"&&(h.value=ne)})});async function Fe(){try{l.value=await i.directConnection.load()}catch(De){y.value=(De==null?void 0:De.message)??String(De)}finally{f.value=!1}}async function K(De){const ne=De.target,ue=l.value;l.value=ne.checked,p.value=!0,y.value="";try{await i.directConnection.save(ne.checked);const he=await i.directConnection.load();l.value=he,s("direct-connection-changed",he)}catch(he){l.value=ue,y.value=(he==null?void 0:he.message)??String(he)}finally{p.value=!1}}Vt(()=>{});async function Z(De){const ne=De.target,ue=!!(ne!=null&&ne.checked);h.value=ue;try{await fC(ue)}catch(he){h.value=!ue,y.value=(he==null?void 0:he.message)??String(he)}}function J(){x.value=z(a.value),D.value=d.value,M.value=o.value,B.value=c.value}async function ae(){try{await tp({url:V.value,token:o.value,session_expires_at:0,allow_insecure_relay:c.value,disable_e2ee:h.value,remote_permission:"full",last_email:k.value.trim()})}catch{}if(E.value)try{await _C(E.value)}catch(De){Pt("relay","remember relay password failed",{error:xt(De)})}J()}async function Ie(){if(m.value=!0,y.value="",!te(N.value)){y.value=C("settings.relay.relayInvalid"),m.value=!1;return}try{await yC(N.value,c.value)}catch(ue){await ae(),y.value=C("settings.relay.versionProbeFailed",{reason:(ue==null?void 0:ue.message)??String(ue)}),m.value=!1;return}const De=!!(k.value.trim()&&E.value),ne=!!o.value;if(De){try{S.value==="register"?await gC(N.value,k.value.trim(),E.value,P.value.trim(),c.value):await vC(N.value,k.value.trim(),E.value,c.value)}catch(ue){await ae(),y.value=C("settings.relay.loginFailedInline",{reason:(ue==null?void 0:ue.message)??String(ue)}),m.value=!1;return}P.value=""}else if(ne)try{await tp({url:V.value,token:o.value,session_expires_at:0,allow_insecure_relay:c.value,disable_e2ee:h.value,remote_permission:"full"})}catch(ue){y.value=(ue==null?void 0:ue.message)??String(ue),m.value=!1;return}else{await ae(),y.value=C("settings.relay.credentialsRequired"),m.value=!1;return}try{const ue=await Xl();c.value=ue.allow_insecure_relay,d.value=Y(ue.url),a.value=z(ue.url),o.value=ue.token,h.value=ue.disable_e2ee??!1,u.value=ue.paused??!1,k.value=ue.last_email??"",J()}catch(ue){y.value=(ue==null?void 0:ue.message)??String(ue),m.value=!1;return}m.value=!1,s("relay-config-changed")}async function de(){g.value=!0,y.value="";try{await pC(u.value),s("relay-config-changed")}catch(De){y.value=(De==null?void 0:De.message)??String(De),u.value=!u.value}finally{g.value=!1}}async function Le(){if(window.confirm(C("settings.relay.clearConfirm"))){b.value=!0,y.value="";try{await hC(),await oe(),J(),s("relay-config-changed")}catch(De){y.value=C("settings.relay.clearFailed",{reason:(De==null?void 0:De.message)??String(De)})}finally{b.value=!1}}}const xe=W(()=>!m.value&&!!z(a.value)),Qe=W(()=>m.value?C("settings.relay.saving"):C("settings.relay.saveConnect"));return t({save:Ie,canSave:xe,saveLabel:Qe,paused:u,saving:m,dirty:j}),(De,ne)=>($(),O("div",HH,[v.value?($(),O("div",NH,T(w(C)("common.loading")),1)):($(),O(Me,{key:1},[_("div",UH,[_("div",zH,[_("span",VH,T(w(C)("settings.relay.uplink")),1),_("label",{class:nt(["toggle-switch",{disabled:g.value}])},[ct(_("input",{"onUpdate:modelValue":ne[0]||(ne[0]=ue=>u.value=ue),type:"checkbox","true-value":!1,"false-value":!0,disabled:g.value||!a.value,onChange:de},null,40,KH),[[ko,u.value]]),ne[8]||(ne[8]=_("span",{class:"toggle-track"},[_("span",{class:"toggle-thumb"})],-1)),_("span",WH,T(u.value?w(C)("settings.relay.off"):w(C)("settings.relay.on")),1)],2)]),f.value?Q("",!0):($(),O("div",jH,[_("span",qH,T(w(C)("settings.relay.preferDirectConnection")),1),_("button",{type:"button",class:"connection-info","data-testid":"direct-connection-info",title:w(C)("settings.relay.preferDirectConnectionHint"),"aria-label":w(C)("settings.relay.preferDirectConnectionHint")},[Pe(w(i1),{size:14,"stroke-width":1.8,"aria-hidden":"true"})],8,YH),_("label",{class:nt(["toggle-switch",{disabled:p.value}])},[_("input",{type:"checkbox","data-testid":"direct-connection-toggle",checked:l.value,disabled:p.value,onChange:K},null,40,GH),ne[9]||(ne[9]=_("span",{class:"toggle-track"},[_("span",{class:"toggle-thumb"})],-1)),_("span",XH,T(l.value?w(C)("settings.relay.on"):w(C)("settings.relay.off")),1)],2)]))]),_("div",{class:nt(["status-pill",se.value.cls])},[ne[10]||(ne[10]=_("span",{class:"dot"},"●",-1)),et(" "+T(se.value.text),1)],2),_("p",JH,T(w(C)("settings.relay.hint")),1),A.value?($(),O("section",ZH,[Pe(fb)])):Q("",!0),_("div",QH,[_("label",eN,T(w(C)("settings.relay.relayUrl")),1),_("label",tN,[ct(_("input",{"onUpdate:modelValue":ne[1]||(ne[1]=ue=>c.value=ue),type:"checkbox",disabled:m.value},null,8,nN),[[ko,c.value]]),et(" "+T(w(C)(d.value==="http"?"settings.relay.allowCleartext":"settings.relay.insecureMode")),1)])]),_("div",{class:nt(["url-input",{insecure:c.value}])},[Pe(qn,{id:"relay-scheme",modelValue:d.value,"onUpdate:modelValue":ne[2]||(ne[2]=ue=>d.value=ue),class:"url-scheme",options:r,"aria-label":w(C)("settings.relay.scheme"),disabled:m.value},null,8,["modelValue","aria-label","disabled"]),ct(_("input",{id:"relay-host","onUpdate:modelValue":ne[3]||(ne[3]=ue=>a.value=ue),type:"text",placeholder:"relay.example.com",autocomplete:"off",spellcheck:"false",disabled:m.value,onKeyup:jn(Ie,["enter"])},null,40,iN),[[Et,a.value]])],2),d.value==="http"?($(),O("p",sN,T(w(C)("settings.relay.cleartextWarning")),1)):c.value?($(),O("p",rN,T(w(C)("settings.relay.insecureWarning")),1)):Q("",!0),_("div",oN,[_("div",aN,[_("label",lN,T(w(C)("settings.relay.email")),1),ct(_("input",{id:"relay-email","onUpdate:modelValue":ne[4]||(ne[4]=ue=>k.value=ue),type:"email",autocomplete:S.value==="register"?"email":"username",disabled:m.value,onKeyup:jn(Ie,["enter"])},null,40,cN),[[Et,k.value]])]),_("div",dN,[_("label",uN,T(w(C)("settings.relay.password")),1),_("div",hN,[ct(_("input",{id:"relay-password","onUpdate:modelValue":ne[5]||(ne[5]=ue=>E.value=ue),type:I.value?"text":"password",autocomplete:"current-password",disabled:m.value,onKeyup:jn(Ie,["enter"])},null,40,fN),[[_w,E.value]]),_("button",{type:"button",class:"password-toggle","aria-label":I.value?w(C)("settings.relay.passwordHide"):w(C)("settings.relay.passwordShow"),"aria-pressed":I.value,disabled:m.value,onClick:ne[6]||(ne[6]=ue=>I.value=!I.value)},[I.value?($(),O("svg",gN,ne[12]||(ne[12]=[_("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"},null,-1),_("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)]))):($(),O("svg",vN,ne[11]||(ne[11]=[_("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),_("circle",{cx:"12",cy:"12",r:"3"},null,-1)])))],8,pN)])])]),S.value==="register"?($(),O(Me,{key:3},[_("label",mN,T(w(C)("settings.relay.claimToken")),1),ct(_("input",{id:"relay-claim-token","onUpdate:modelValue":ne[7]||(ne[7]=ue=>P.value=ue),type:"text",autocomplete:"off",spellcheck:"false",placeholder:w(C)("settings.relay.claimTokenPlaceholder"),disabled:m.value,onKeyup:jn(Ie,["enter"])},null,40,_N),[[Et,P.value]]),_("p",yN,T(w(C)("settings.relay.claimTokenHint")),1)],64)):Q("",!0),_("button",{type:"button",class:"auth-switch",disabled:m.value,onClick:G},[et(T(S.value==="login"?w(C)("settings.relay.noAccountPrompt"):w(C)("settings.relay.haveAccountPrompt"))+" ",1),_("span",wN,T(S.value==="login"?w(C)("settings.relay.modeRegister"):w(C)("settings.relay.modeLogin")),1)],8,bN),_("label",SN,[_("input",{checked:h.value,type:"checkbox",disabled:m.value,onChange:Z},null,40,CN),et(" "+T(w(C)("settings.relay.disableE2EE")),1)]),h.value?($(),O("p",kN,T(w(C)("settings.relay.disableE2EEWarning")),1)):Q("",!0),y.value?($(),O("p",xN,T(y.value),1)):Q("",!0),Pe(BH),_("div",RN,[_("div",TN,[_("div",EN,T(w(C)("settings.relay.clearTitle")),1),_("p",PN,T(w(C)("settings.relay.clearHint")),1)]),_("button",{type:"button",class:"danger-btn",disabled:m.value||b.value||v.value,onClick:Le},T(b.value?w(C)("settings.relay.clearing"):w(C)("settings.relay.clearAction")),9,LN)])],64))]))}}),IN=kt(DN,[["__scopeId","data-v-9080bf55"]]),th={DEBUG:0,INFO:1,WARN:2,ERROR:3},MN=/^(\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}\.\d{3}) (DEBUG|INFO|WARN|ERROR)\s+\[([^\]]+)\] (.*)$/;function Lb(e){const t=MN.exec(e);return t?{kind:"structured",ts:t[1],level:t[2],tag:t[3],msg:t[4]}:{kind:"raw",text:e}}function AN(e,t){return th[e]>=th[t]}const Db=[{value:"DEBUG",label:"DEBUG+"},{value:"INFO",label:"INFO+"},{value:"WARN",label:"WARN+"},{value:"ERROR",label:"ERROR"}],$N=[{value:"DEBUG",label:"DEBUG"},{value:"INFO",label:"INFO"},{value:"WARN",label:"WARN"},{value:"ERROR",label:"ERROR"}];function ON(e){return e in th}const Wc="",yc="*";function FN(e,t){if(!t)return!0;if(t.endsWith(yc)){const n=t.slice(0,-yc.length);return e===n||e.startsWith(n+"-")}return e===t}function Ib(e,t){const n=new Map;for(const r of e.split(` +`)){const o=Lb(r);o.kind==="structured"&&n.set(o.tag,(n.get(o.tag)??0)+1)}const i=Array.from(n.values()).reduce((r,o)=>r+o,0),s=new Map;for(const r of n.keys()){const o=r.split("-")[0];s.set(o,[...s.get(o)??[],r])}const a=Array.from(s.entries()).filter(([,r])=>r.length>1).map(([r,o])=>({value:r+yc,label:`${r}${yc} (${o.reduce((c,h)=>c+(n.get(h)??0),0)})`})).sort((r,o)=>r.value.localeCompare(o.value)),d=Array.from(n.entries()).map(([r,o])=>({value:r,label:`${r} (${o})`})).sort((r,o)=>r.value.localeCompare(o.value));return[{value:Wc,label:`${t} (${i})`},...a,...d]}const BN={class:"log-lines"},HN={class:"ts"},NN={class:"lvl"},UN={class:"tag"},zN={class:"msg"},VN={key:1,class:"raw"},KN=$e({__name:"LogLines",props:{content:{},minLevel:{default:"DEBUG"},tag:{default:Wc}},setup(e){const t=e,n=W(()=>t.content.split(` +`).map(Lb).filter(s=>s.kind==="raw"?!0:AN(s.level,t.minLevel)&&FN(s.tag,t.tag)));return(i,s)=>($(),O("div",BN,[($(!0),O(Me,null,st(n.value,(a,d)=>($(),O("div",{key:d,class:nt(["log-line",a.kind==="structured"?"lvl-"+a.level:"lvl-raw"])},[a.kind==="structured"?($(),O(Me,{key:0},[_("span",HN,T(a.ts),1),_("span",NN,T(a.level),1),_("span",UN,"["+T(a.tag)+"]",1),_("span",zN,T(a.msg),1)],64)):($(),O("span",VN,T(a.text),1))],2))),128))]))}}),Mb=kt(KN,[["__scopeId","data-v-c9e8e2b4"]]),WN={class:"tab-pane"},jN={key:0,class:"dim"},qN={class:"checkbox"},YN=["checked"],GN={class:"level-row"},XN={class:"level-label"},JN={class:"level-select"},ZN=["aria-label","title"],QN={class:"checkbox-row"},e7={class:"checkbox"},t7=["checked"],n7=["aria-label","title"],i7={class:"kv"},s7={class:"k"},r7=["title"],o7={class:"actions"},a7={key:0,class:"error"},l7={key:1,class:"tail-wrap"},c7={class:"tail-header"},d7={class:"tail-label"},u7=["title"],h7={class:"tail-level"},f7={class:"tail-tag"},p7=["disabled"],v7={key:0,class:"tail-error"},g7={key:1,class:"tail-empty"},m7=$e({__name:"SettingsLogging",emits:["open-log-viewer"],setup(e){const t=F(!0),n=F(""),i=F(""),s=F(!0),a=F(""),d=F(!1),r=F("INFO"),{t:o}=Ot(),c=F(null),h=F(""),u=F(!1);let v=null;const m=F(null),b=F("DEBUG"),g=F(Wc),l=W(()=>{var x;return Ib(((x=c.value)==null?void 0:x.content)??"",o("settings.logging.tagFilterAll"))}),f=F(!0);function p(){var x;return(x=m.value)==null?void 0:x.$el}function y(x){return x.scrollHeight-x.scrollTop-x.clientHeight<24}async function C(x){if(!t.value)return;const D=p();if(!(x!=null&&x.force)&&D&&!y(D)){f.value=!1;return}f.value=!0,u.value=!0,h.value="";try{c.value=await Zm()}catch(B){h.value=(B==null?void 0:B.message)??String(B)}finally{u.value=!1}await hn();const M=p();M&&(M.scrollTop=M.scrollHeight)}function k(){const x=p();if(!x)return;const D=y(x);D&&!f.value?C():f.value=D}wt(m,(x,D,M)=>{const B=x==null?void 0:x.$el;B&&(B.addEventListener("scroll",k,{passive:!0}),M(()=>B.removeEventListener("scroll",k)))});function E(x){t.value=x.enabled,n.value=x.path,i.value=x.effective_path,ON(x.level)&&(r.value=x.level)}It(async()=>{try{E(await da())}catch(x){a.value=(x==null?void 0:x.message)??String(x)}finally{s.value=!1}try{d.value=await Tk()}catch{}await C(),v=window.setInterval(C,3e3)}),Vt(()=>{v!==null&&(window.clearInterval(v),v=null)});async function I(x){const D=x.target,M=t.value;t.value=D.checked,a.value="";try{await pl({enabled:D.checked,path:n.value}),E(await da())}catch(B){t.value=M,a.value=(B==null?void 0:B.message)??String(B)}}async function S(x){const D=r.value;r.value=x,a.value="";try{await pl({enabled:t.value,path:n.value,level:x}),E(await da()),await C({force:!0})}catch(M){r.value=D,a.value=(M==null?void 0:M.message)??String(M)}}async function P(x){const D=x.target,M=d.value;d.value=D.checked;try{await Ek(D.checked)}catch(B){d.value=M,a.value=(B==null?void 0:B.message)??String(B)}}async function A(){a.value="";try{const x=await pk();if(!x)return;await pl({enabled:t.value,path:x}),E(await da())}catch(x){a.value=(x==null?void 0:x.message)??String(x)}}async function L(){a.value="";try{await pl({enabled:t.value,path:""}),E(await da())}catch(x){a.value=(x==null?void 0:x.message)??String(x)}}return(x,D)=>($(),O("div",WN,[s.value?($(),O("div",jN,T(w(o)("common.loading")),1)):($(),O(Me,{key:1},[_("label",qN,[_("input",{type:"checkbox",checked:t.value,onChange:I},null,40,YN),et(" "+T(w(o)("settings.logging.writeLogs")),1)]),_("div",GN,[_("span",XN,T(w(o)("settings.logging.writeLevel")),1),_("div",JN,[Pe(qn,{modelValue:r.value,options:w($N),ariaLabel:w(o)("settings.logging.writeLevel"),"onUpdate:modelValue":D[0]||(D[0]=M=>S(M))},null,8,["modelValue","options","ariaLabel"])]),_("span",{class:"info-icon",role:"img","aria-label":w(o)("settings.logging.writeLevelHint"),title:w(o)("settings.logging.writeLevelHint")},"i",8,ZN)]),_("div",QN,[_("label",e7,[_("input",{type:"checkbox",checked:d.value,onChange:P},null,40,t7),et(" "+T(w(o)("settings.logging.ptyInputDebug")),1)]),_("span",{class:"info-icon",role:"img","aria-label":w(o)("settings.logging.ptyInputDebugHint"),title:w(o)("settings.logging.ptyInputDebugHint")},"i",8,n7)]),_("div",i7,[_("span",s7,T(w(o)("settings.logging.currentFile")),1),_("span",{class:"v path",title:i.value},T(i.value),9,r7)]),_("div",o7,[_("button",{onClick:A},T(w(o)("settings.logging.changeLocation")),1),_("button",{onClick:L},T(w(o)("settings.logging.resetDefault")),1),_("button",{onClick:D[1]||(D[1]=M=>x.$emit("open-log-viewer"))},T(w(o)("settings.logging.viewLogs")),1)]),a.value?($(),O("p",a7,T(a.value),1)):Q("",!0),t.value?($(),O("section",l7,[_("header",c7,[_("span",d7,T(w(o)("settings.logging.liveTail")),1),f.value?Q("",!0):($(),O("button",{key:0,class:"tail-paused",title:w(o)("settings.logging.tailPausedHint"),onClick:D[2]||(D[2]=M=>C({force:!0}))},T(w(o)("settings.logging.tailPaused")),9,u7)),_("div",h7,[Pe(qn,{modelValue:b.value,options:w(Db),ariaLabel:w(o)("settings.logging.levelFilter"),"onUpdate:modelValue":D[3]||(D[3]=M=>b.value=M)},null,8,["modelValue","options","ariaLabel"])]),_("div",f7,[Pe(qn,{modelValue:g.value,options:l.value,ariaLabel:w(o)("settings.logging.tagFilter"),"onUpdate:modelValue":D[4]||(D[4]=M=>g.value=M)},null,8,["modelValue","options","ariaLabel"])]),_("button",{class:"tail-refresh",disabled:u.value,onClick:D[5]||(D[5]=M=>C({force:!0}))},T(w(o)("common.refresh")),9,p7)]),h.value?($(),O("p",v7,T(h.value),1)):!c.value||!c.value.exists?($(),O("p",g7,T(w(o)("settings.logging.noContent")),1)):($(),Ct(Mb,{key:2,ref_key:"tailEl",ref:m,class:"tail-content",content:c.value.content,minLevel:b.value,tag:g.value},null,8,["content","minLevel","tag"]))])):Q("",!0)],64))]))}}),_7=kt(m7,[["__scopeId","data-v-cd8d05fa"]]);function Ab(e,t=Date.now()){const n=Math.floor(t/1e3)-e;return n<60?cn("settings.updates.justNow"):n<3600?cn("settings.updates.minutesAgo",{count:Math.floor(n/60)}):n<86400?cn("settings.updates.hoursAgo",{count:Math.floor(n/3600)}):cn("settings.updates.daysAgo",{count:Math.floor(n/86400)})}const y7={class:"tab-pane"},b7={key:0,class:"dim"},w7={class:"grid"},S7={class:"kv"},C7={class:"k"},k7={class:"v"},x7={class:"kv"},R7={class:"k"},T7={class:"v"},E7={key:0,class:"kv"},P7={class:"k"},L7=["title"],D7={key:0,class:"checkbox"},I7=["checked"],M7={key:1,class:"proxy-box"},A7={class:"field-label",for:"update-gh-proxy"},$7={class:"proxy-row"},O7=["disabled"],F7={class:"hint"},B7={key:2,class:"notes"},H7={key:3,class:"version-lines"},N7=["value"],U7={key:4,class:"actions"},z7=["disabled"],V7=["disabled"],K7=["disabled"],W7={key:5,class:"error"},j7=$e({__name:"SettingsUpdates",emits:["request-install"],setup(e){const t=F(null),n=F(!0),i=F(""),s=F(!1),a=F(!1),d=F(!0),r=F(""),o=F(""),c=F(!1),h=F(!1),u=F(!1);let v=null;const{t:m}=Ot();function b(A){const L=A.replace(/^v/,"").split(".");return L.length<2?"":`v${L[0]}.${L[1]}`}wt(()=>{var A;return(A=t.value)==null?void 0:A.lines},A=>{var D;if(!A||A.length===0||o.value&&A.some(M=>M.minor===o.value))return;const L=b(((D=t.value)==null?void 0:D.current)??""),x=A.find(M=>M.minor===L);o.value=x?x.minor:A[0].minor},{immediate:!0});const g=W(()=>{var x;const L=(((x=t.value)==null?void 0:x.lines)??[]).find(D=>D.minor===o.value);return(L==null?void 0:L.latest)??""});It(async()=>{try{const[A,L,x]=await Promise.all([xo(),Ym(),up()]);t.value=A,n.value=L,i.value=x}catch(A){r.value=(A==null?void 0:A.message)??String(A)}finally{d.value=!1}v=window.setInterval(async()=>{try{t.value=await xo()}catch{}},2e3)}),Vt(()=>{v!==null&&window.clearInterval(v)});async function l(){s.value=!0;try{await Km()}catch{}finally{s.value=!1}}async function f(){c.value=!0;try{await Wm()}catch{}}async function p(){if(g.value){c.value=!0;try{await GC(g.value)}catch{}}}wt(()=>{var A;return(A=t.value)==null?void 0:A.downloaded_exists},async(A,L)=>{var D;if(!A||L||!c.value||h.value)return;const x=((D=t.value)==null?void 0:D.latest)??"";c.value=!1,h.value=!0;try{if(window.confirm(m("settings.updates.redownloadPrompt",{version:x})))try{await dp(x)}catch{}}finally{h.value=!1}});async function y(){u.value=!0;try{await jm()}catch{}finally{u.value=!1}}async function C(){var L;const A=((L=t.value)==null?void 0:L.latest)??"";if(A)try{await dp(A)}catch{}}async function k(A){const L=A.target;n.value=L.checked,await XC(L.checked)}async function E(){a.value=!0,r.value="";try{await JC(i.value),i.value=await up()}catch(A){r.value=(A==null?void 0:A.message)??String(A)}finally{a.value=!1}}const I=W(()=>{var A,L;return((A=t.value)==null?void 0:A.current)==="dev"||((L=t.value)==null?void 0:L.current)===""}),S=W(()=>{var A,L;return(((L=(A=t.value)==null?void 0:A.lines)==null?void 0:L.length)??0)>=2}),P=W(()=>{const A=t.value;return A?A.current==="dev"||A.current===""?m("settings.updates.devDisabled"):A.error?A.error:A.checking||s.value?m("settings.updates.checking"):A.ready?m("settings.updates.readyToInstall",{version:A.latest}):A.downloading?m("settings.updates.downloadingStatus",{version:A.latest,pct:A.download_pct}):A.available?m("settings.updates.available",{version:A.latest}):A.last_check_at>0?m("settings.updates.upToDate",{ago:Ab(A.last_check_at)}):m("settings.updates.notChecked"):""});return(A,L)=>($(),O("div",y7,[d.value?($(),O("div",b7,T(w(m)("common.loading")),1)):t.value?($(),O(Me,{key:1},[_("div",w7,[_("div",S7,[_("span",C7,T(w(m)("settings.updates.currentVersion")),1),_("span",k7,T(t.value.current||w(m)("common.unknown")),1)]),_("div",x7,[_("span",R7,T(w(m)("settings.updates.status")),1),_("span",T7,T(P.value),1)]),t.value.download_path&&(t.value.ready||t.value.downloading)?($(),O("div",E7,[_("span",P7,T(w(m)("settings.updates.downloadPath")),1),_("span",{class:"v path",title:t.value.download_path},T(t.value.download_path),9,L7)])):Q("",!0)]),I.value?Q("",!0):($(),O("label",D7,[_("input",{type:"checkbox",checked:n.value,onChange:k},null,40,I7),et(" "+T(w(m)("settings.updates.autoCheck")),1)])),I.value?Q("",!0):($(),O("div",M7,[_("label",A7,T(w(m)("settings.updates.ghProxy")),1),_("div",$7,[ct(_("input",{id:"update-gh-proxy","onUpdate:modelValue":L[0]||(L[0]=x=>i.value=x),type:"url",placeholder:"https://gh-proxy.example.com/",spellcheck:"false"},null,512),[[Et,i.value,void 0,{trim:!0}]]),_("button",{disabled:a.value,onClick:E},T(a.value?w(m)("settings.relay.saving"):w(m)("common.save")),9,O7)]),_("p",F7,T(w(m)("settings.updates.proxyHint")),1)])),!I.value&&t.value.notes?($(),O("details",B7,[_("summary",null,T(w(m)("settings.updates.releaseNotes")),1),_("pre",null,T(t.value.notes),1)])):Q("",!0),!I.value&&S.value&&t.value.lines&&!t.value.ready?($(),O("div",H7,[($(!0),O(Me,null,st(t.value.lines,x=>($(),O("div",{key:x.minor,class:"version-line"},[_("label",null,[ct(_("input",{type:"radio",value:x.minor,"onUpdate:modelValue":L[1]||(L[1]=D=>o.value=D)},null,8,N7),[[ou,o.value]]),et(" "+T(w(m)("settings.updates.versionLine",{minor:x.minor}))+" → "+T(x.latest),1)])]))),128))])):Q("",!0),I.value?Q("",!0):($(),O("div",U7,[_("button",{onClick:l,disabled:s.value||t.value.checking},T(w(m)("settings.updates.checkNow")),9,z7),S.value&&!t.value.ready&&!t.value.downloading?($(),O("button",{key:0,class:"primary",disabled:t.value.downloading||!g.value,onClick:p},T(w(m)("settings.updates.downloadVersion",{version:g.value})),9,V7)):Q("",!0),!S.value&&t.value.available&&!t.value.ready&&!t.value.downloading?($(),O("button",{key:1,class:"primary",onClick:f},T(w(m)("settings.updates.downloadVersion",{version:t.value.latest})),1)):Q("",!0),t.value.downloading?($(),O("button",{key:2,class:"primary danger",disabled:u.value,onClick:y},T(u.value?w(m)("settings.updates.cancelling"):w(m)("settings.updates.cancelDownload",{pct:t.value.download_pct})),9,K7)):Q("",!0),t.value.ready?($(),O("button",{key:3,class:"primary danger",onClick:L[2]||(L[2]=x=>A.$emit("request-install",t.value.latest))},T(w(m)("settings.updates.forceInstallRestart")),1)):Q("",!0),t.value.ready?($(),O("button",{key:4,class:"secondary",onClick:C},T(w(m)("settings.updates.redownload")),1)):Q("",!0)])),r.value?($(),O("p",W7,T(r.value),1)):Q("",!0)],64)):Q("",!0)]))}}),q7=kt(j7,[["__scopeId","data-v-c859d0af"]]),Y7={key:0,class:"translate-settings"},G7=["value"],X7=["value"],J7=["value"],Z7=["value"],Q7={key:0,class:"extra-params-error"},eU={key:1,class:"hint"},tU={class:"muted"},nU=$e({__name:"TranslateSettings",setup(e){var u;const t=Yr(),{t:n}=Ot(),i=[{code:"zh-CN",labelKey:"plugins.translate.simplifiedChinese"},{code:"en",labelKey:"plugins.translate.targetEnglish"},{code:"ja",labelKey:"plugins.translate.targetJapanese"},{code:"ko",labelKey:"plugins.translate.targetKorean"},{code:"de",labelKey:"plugins.translate.targetGerman"},{code:"fr",labelKey:"plugins.translate.targetFrench"},{code:"es",labelKey:"plugins.translate.targetSpanish"}],s=W(()=>{var v;return(v=t.cfg)==null?void 0:v.translate}),a=W(()=>i.map(v=>({value:v.code,label:n(v.labelKey)}))),d=W({get:()=>{var v;return((v=s.value)==null?void 0:v.defaultTargetLang)??"zh-CN"},set:v=>{h({defaultTargetLang:v})}}),r=F(((u=s.value)==null?void 0:u.extraParams)??""),o=F("");wt(()=>{var v;return((v=s.value)==null?void 0:v.extraParams)??""},v=>{v!==r.value&&(r.value=v)});function c(v){const m=v.target.value;r.value=m;const b=m.trim();if(b===""){o.value="",h({extraParams:""});return}let g;try{g=JSON.parse(b)}catch(l){o.value=l instanceof Error?l.message:String(l);return}if(!g||typeof g!="object"||Array.isArray(g)){o.value=n("plugins.translate.extraParamsInvalid");return}o.value="",h({extraParams:b})}async function h(v){if(!t.cfg)return;const m=JSON.parse(JSON.stringify(t.cfg));m.translate={...m.translate,...v};try{await t.save(m)}catch(b){Gi("plugin-translate","save config failed",{error:xt(b)})}}return(v,m)=>s.value?($(),O("div",Y7,[_("label",null,[_("span",null,T(w(n)("plugins.translate.baseUrl")),1),_("input",{type:"text",value:s.value.baseUrl,onChange:m[0]||(m[0]=b=>h({baseUrl:b.target.value})),placeholder:"https://api.openai.com"},null,40,G7)]),_("label",null,[_("span",null,T(w(n)("plugins.translate.apiKey")),1),_("input",{type:"password",value:s.value.apiKey,onChange:m[1]||(m[1]=b=>h({apiKey:b.target.value})),placeholder:"sk-..."},null,40,X7)]),_("label",null,[_("span",null,T(w(n)("plugins.translate.model")),1),_("input",{type:"text",value:s.value.model,onChange:m[2]||(m[2]=b=>h({model:b.target.value})),placeholder:"gpt-4o-mini"},null,40,J7)]),_("label",null,[_("span",null,T(w(n)("plugins.translate.defaultTargetLanguage")),1),Pe(qn,{modelValue:d.value,"onUpdate:modelValue":m[3]||(m[3]=b=>d.value=b),options:a.value,"aria-label":w(n)("plugins.translate.defaultTargetLanguage")},null,8,["modelValue","options","aria-label"])]),_("label",null,[_("span",null,T(w(n)("plugins.translate.extraParams")),1),_("textarea",{class:"extra-params",rows:"3",spellcheck:"false",value:r.value,onInput:c,placeholder:'{"stream": true, "top_p": 0.9}'},null,40,Z7),o.value?($(),O("span",Q7,T(o.value),1)):($(),O("span",eU,T(w(n)("plugins.translate.extraParamsHint")),1))]),_("p",tU,T(w(n)("plugins.translate.keyStoredPlaintext",{path:"~/.config/atterm/config.json"})),1)])):Q("",!0)}}),iU=kt(nU,[["__scopeId","data-v-2b2be568"]]),sU={class:"settings-plugins"},rU={class:"hint"},oU={key:0,class:"loading"},aU={key:1,class:"plugin-list"},lU={class:"row-head"},cU=["checked","onChange"],dU={class:"title"},uU={class:"desc"},hU={key:0,class:"fe-settings"},fU={class:"muted"},pU={key:2,class:"widget-settings"},vU=["checked"],gU={class:"muted"},mU={key:0,class:"empty"},_U=$e({__name:"SettingsPlugins",setup(e){const t=Yr(),{t:n}=Ot(),i=fn(),s=W(()=>U_.filter(r=>!r.desktopOnly||i.caps.wailsBindings));It(async()=>{t.cfg||await t.load()});async function a(r){var c;if(!((c=t.cfg)!=null&&c.widget))return;const o=JSON.parse(JSON.stringify(t.cfg));o.widget.aiOnly=r;try{await t.save(o)}catch(h){Gi("plugin","widget aiOnly save failed",{error:xt(h)})}}async function d(r,o){try{await t.setEnabled(r,o)}catch(c){Gi("plugin","setEnabled failed",{error:xt(c)})}}return(r,o)=>($(),O("section",sU,[_("p",rU,T(w(n)("settings.plugins.hint")),1),w(t).cfg?($(),O("ul",aU,[($(!0),O(Me,null,st(s.value,c=>{var h,u;return $(),O("li",{key:c.id,class:"plugin-row"},[_("label",lU,[_("input",{type:"checkbox",checked:w(t).isPluginEnabled(c.id),onChange:v=>d(c.id,v.target.checked)},null,40,cU),_("span",dU,T(w(n)(c.titleKey)),1)]),_("p",uU,T(w(n)(c.descriptionKey)),1),c.id==="file-explorer"&&w(t).isPluginEnabled("file-explorer")?($(),O("div",hU,[_("p",fU,T(w(n)("settings.plugins.panelDragHint")),1)])):Q("",!0),c.id==="translate"&&w(t).isPluginEnabled("translate")?($(),Ct(iU,{key:1})):Q("",!0),c.id==="desk-widget"&&w(t).isPluginEnabled("desk-widget")?($(),O("div",pU,[_("label",null,[_("input",{type:"checkbox",checked:((u=(h=w(t).cfg)==null?void 0:h.widget)==null?void 0:u.aiOnly)??!1,onChange:o[0]||(o[0]=v=>a(v.target.checked))},null,40,vU),_("span",null,T(w(n)("plugins.deskWidget.aiOnly")),1)]),_("p",gU,T(w(n)("plugins.deskWidget.aiOnlyHint")),1)])):Q("",!0)])}),128)),s.value.length===0?($(),O("li",mU,T(w(n)("settings.plugins.noneRegistered")),1)):Q("",!0)])):($(),O("div",oU,T(w(n)("common.loading")),1))]))}}),yU=kt(_U,[["__scopeId","data-v-a25af5cc"]]),zs=[{id:"pane.split-vertical-new",group:"pane",labelKey:"settings.shortcuts.splitPaneVertically",defaultBinding:"Mod+KeyN"},{id:"pane.split-horizontal-new",group:"pane",labelKey:"settings.shortcuts.splitPaneHorizontally",defaultBinding:"Mod+Shift+KeyN"},{id:"pane.close",group:"pane",labelKey:"settings.shortcuts.closePane",defaultBinding:"Mod+KeyW"},{id:"pane.focus-left",group:"pane",labelKey:"settings.shortcuts.focusPaneLeft",defaultBinding:"Mod+Alt+ArrowLeft"},{id:"pane.focus-right",group:"pane",labelKey:"settings.shortcuts.focusPaneRight",defaultBinding:"Mod+Alt+ArrowRight"},{id:"pane.focus-up",group:"pane",labelKey:"settings.shortcuts.focusPaneUp",defaultBinding:"Mod+Alt+ArrowUp"},{id:"pane.focus-down",group:"pane",labelKey:"settings.shortcuts.focusPaneDown",defaultBinding:"Mod+Alt+ArrowDown"},{id:"terminal.search",group:"pane",labelKey:"settings.shortcuts.terminalSearch",defaultBinding:"Mod+KeyF"},{id:"tab.new",group:"tab",labelKey:"settings.shortcuts.newTab",defaultBinding:"Mod+KeyT"},{id:"tab.prev",group:"tab",labelKey:"settings.shortcuts.previousTab",defaultBinding:"Mod+Shift+BracketLeft"},{id:"tab.next",group:"tab",labelKey:"settings.shortcuts.nextTab",defaultBinding:"Mod+Shift+BracketRight"},{id:"toggleTaskSidebar",group:"sidebar",labelKey:"tasks.sidebar.collapse",defaultBinding:"Mod+KeyB"},{id:"sidebar.focus-search",group:"sidebar",labelKey:"settings.shortcuts.focusSidebarSearch",defaultBinding:"Mod+Shift+KeyF"}],ms=Object.fromEntries(zs.map(e=>[e.id,e])),bU=Object.fromEntries(zs.map(e=>[e.defaultBinding,e.id])),$b=new Set(["KeyA","KeyB","KeyC","KeyD","KeyE","KeyF","KeyG","KeyH","KeyI","KeyJ","KeyK","KeyL","KeyM","KeyN","KeyO","KeyP","KeyQ","KeyR","KeyS","KeyT","KeyU","KeyV","KeyW","KeyX","KeyY","KeyZ","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","BracketLeft","BracketRight","Minus","Equal","Backquote","Comma","Period","Slash","Semicolon","Quote","Backslash"]);function Ob(e,t){const n=t==="Meta"?e.metaKey:e.ctrlKey;if((t==="Meta"?e.ctrlKey:e.metaKey)||!$b.has(e.code)||!n&&!e.altKey&&!e.shiftKey)return null;const s=[];return n&&s.push("Mod"),e.altKey&&s.push("Alt"),e.shiftKey&&s.push("Shift"),s.push(e.code),s.join("+")}function Fb(e){const t={};for(const n of zs)t[n.id]=n.defaultBinding;for(const[n,i]of Object.entries(e))n in ms&&(t[n]=i);return t}function wU(e,t){const n=e[t];if(!n)return[];const i=[];for(const[s,a]of Object.entries(e))s!==t&&a===n&&i.push(s);return i}function SU(e){const t={...bU};for(const[n,i]of Object.entries(e))if(n in ms){for(const s of Object.keys(t))if(t[s]===n){delete t[s];break}i!==""&&(t[i]=n)}return t}const CU={KeyA:"A",KeyB:"B",KeyC:"C",KeyD:"D",KeyE:"E",KeyF:"F",KeyG:"G",KeyH:"H",KeyI:"I",KeyJ:"J",KeyK:"K",KeyL:"L",KeyM:"M",KeyN:"N",KeyO:"O",KeyP:"P",KeyQ:"Q",KeyR:"R",KeyS:"S",KeyT:"T",KeyU:"U",KeyV:"V",KeyW:"W",KeyX:"X",KeyY:"Y",KeyZ:"Z",Digit0:"0",Digit1:"1",Digit2:"2",Digit3:"3",Digit4:"4",Digit5:"5",Digit6:"6",Digit7:"7",Digit8:"8",Digit9:"9",ArrowLeft:"←",ArrowRight:"→",ArrowUp:"↑",ArrowDown:"↓",BracketLeft:"[",BracketRight:"]",Minus:"-",Equal:"=",Backquote:"`",Comma:",",Period:".",Slash:"/",Semicolon:";",Quote:"'",Backslash:"\\"};function kU(e,t){if(e==="")return"";const n=xU(e);if(n===null||n.code===null)return e;const i=CU[n.code]??n.code;if(t==="Meta"){let a="";return n.mod&&(a+="⌘"),n.alt&&(a+="⌥"),n.shift&&(a+="⇧"),a+i}const s=[];return n.mod&&s.push("Ctrl"),n.alt&&s.push("Alt"),n.shift&&s.push("Shift"),s.push(i),s.join("+")}function xU(e){if(e==="")return{mod:!1,alt:!1,shift:!1,code:null};const t=e.split("+");if(t.length<2)return null;const n=t[t.length-1];if(!$b.has(n))return null;const i=t.slice(0,-1),s=["Mod","Alt","Shift"];let a=0;const d={mod:!1,alt:!1,shift:!1};for(const r of i){for(;a{if(c.key==="Escape"){c.preventDefault(),c.stopPropagation(),o(),i("cancel");return}if(c.key==="Backspace"){c.preventDefault(),c.stopPropagation(),o(),i("update","");return}if(c.key==="Tab"||c.key==="Enter"){c.preventDefault(),c.stopPropagation();return}const h=Ob(c,n.mod);h!==null&&(c.preventDefault(),c.stopPropagation(),o(),i("update",h))},document.addEventListener("keydown",d,{capture:!0}))}function o(){s.value=!1,d&&(document.removeEventListener("keydown",d,{capture:!0}),d=null)}return Vt(o),(c,h)=>($(),O("button",{type:"button",class:nt(["hotkey-cell",{capturing:s.value,empty:!s.value&&c.value===""}]),onClick:r},[s.value?($(),O(Me,{key:0},[et(T(w(a)("settings.shortcuts.pressKey")),1)],64)):c.value===""?($(),O(Me,{key:1},[et(T(w(a)("common.disabled")),1)],64)):($(),O(Me,{key:2},[et(T(c.value),1)],64))],2))}}),Zd=kt(RU,[["__scopeId","data-v-80cabc38"]]),TU={class:"shortcut-settings"},EU={class:"shortcut-group"},PU={class:"label"},LU=["title","onClick"],DU={key:0,class:"conflict"},IU={class:"shortcut-group"},MU={class:"label"},AU=["title","onClick"],$U={key:0,class:"conflict"},OU={key:0,class:"shortcut-group"},FU={class:"label"},BU=["title","onClick"],HU={key:0,class:"conflict"},NU={class:"actions-row"},UU=["disabled"],zU=["disabled"],VU={key:1,class:"error"},KU=$e({__name:"SettingsShortcuts",props:{mod:{}},emits:["bindings-changed"],setup(e,{expose:t,emit:n}){function i(){return Th()}const s=e,a=n,d=W(()=>s.mod??i()),{t:r}=Ot(),o=F({}),c=F({}),h=F("");function u(){c.value=JSON.parse(JSON.stringify(o.value))}It(async()=>{try{o.value=await e_()}catch(P){h.value=(P==null?void 0:P.message)??String(P)}u()});const v=W(()=>JSON.stringify(o.value)!==JSON.stringify(c.value)),m=W(()=>Fb(c.value));function b(P){return m.value[P.id]??P.defaultBinding}function g(P){return wU(m.value,P.id)}const l=W(()=>zs.some(P=>g(P).length>0));function f(P,A){if(A===P.defaultBinding){const L={...c.value};delete L[P.id],c.value=L;return}c.value={...c.value,[P.id]:A}}function p(P){const A={...c.value};delete A[P.id],c.value=A}function y(){c.value={}}async function C(){const P={};for(const[A,L]of Object.entries(c.value))A in ms&&L!==ms[A].defaultBinding&&(P[A]=L);h.value="";try{await gk(P),o.value=P,a("bindings-changed",P)}catch(A){h.value=(A==null?void 0:A.message)??String(A)}}function k(){u()}const E=zs.filter(P=>P.group==="pane"),I=zs.filter(P=>P.group==="tab"),S=zs.filter(P=>P.group==="sidebar");return t({dirty:v}),(P,A)=>($(),O("div",TU,[_("section",EU,[_("h3",null,T(w(r)("settings.shortcuts.pane")),1),($(!0),O(Me,null,st(w(E),L=>($(),O("div",{key:L.id,class:"shortcut-row"},[_("div",PU,T(w(r)(L.labelKey)),1),Pe(Zd,{value:b(L),mod:d.value,onUpdate:x=>f(L,x)},null,8,["value","mod","onUpdate"]),_("button",{class:"reset-row",title:w(r)("settings.shortcuts.resetTo",{binding:L.defaultBinding}),onClick:x=>p(L)},"↺",8,LU),g(L).length?($(),O("div",DU,T(w(r)("settings.shortcuts.conflictsWith",{labels:g(L).map(x=>w(ms)[x]?w(r)(w(ms)[x].labelKey):x).join(", ")})),1)):Q("",!0)]))),128))]),_("section",IU,[_("h3",null,T(w(r)("settings.shortcuts.tab")),1),($(!0),O(Me,null,st(w(I),L=>($(),O("div",{key:L.id,class:"shortcut-row"},[_("div",MU,T(w(r)(L.labelKey)),1),Pe(Zd,{value:b(L),mod:d.value,onUpdate:x=>f(L,x)},null,8,["value","mod","onUpdate"]),_("button",{class:"reset-row",title:w(r)("settings.shortcuts.resetTo",{binding:L.defaultBinding}),onClick:x=>p(L)},"↺",8,AU),g(L).length?($(),O("div",$U,T(w(r)("settings.shortcuts.conflictsWith",{labels:g(L).map(x=>w(ms)[x]?w(r)(w(ms)[x].labelKey):x).join(", ")})),1)):Q("",!0)]))),128))]),w(S).length>0?($(),O("section",OU,[_("h3",null,T(w(r)("settings.shortcuts.sidebar")),1),($(!0),O(Me,null,st(w(S),L=>($(),O("div",{key:L.id,class:"shortcut-row"},[_("div",FU,T(w(r)(L.labelKey)),1),Pe(Zd,{value:b(L),mod:d.value,onUpdate:x=>f(L,x)},null,8,["value","mod","onUpdate"]),_("button",{class:"reset-row",title:w(r)("settings.shortcuts.resetTo",{binding:L.defaultBinding}),onClick:x=>p(L)},"↺",8,BU),g(L).length?($(),O("div",HU,T(w(r)("settings.shortcuts.conflictsWith",{labels:g(L).map(x=>w(ms)[x]?w(r)(w(ms)[x].labelKey):x).join(", ")})),1)):Q("",!0)]))),128))])):Q("",!0),_("div",NU,[_("button",{class:"reset-all",onClick:y},T(w(r)("settings.shortcuts.resetAll")),1),A[0]||(A[0]=_("div",{class:"spacer"},null,-1)),_("button",{class:"discard",disabled:!v.value,onClick:k},T(w(r)("common.discard")),9,UU),_("button",{class:"save",disabled:!v.value||l.value,onClick:C},T(w(r)("common.save")),9,zU)]),h.value?($(),O("p",VU,T(h.value),1)):Q("",!0)]))}}),WU=kt(KU,[["__scopeId","data-v-05d9d72b"]]);function jU(e){const t=i=>i.padEnd(24," ");return[`atterm desktop diagnostics — ${e.generated_at}`,"--------------------------------------------------",t("App version:")+e.app_version,t("OS:")+`${e.os} ${e.os_version} (${e.arch})`.replace(/\s+/g," ").trim(),t("WebView:")+(e.webview_summary||"(unknown)"),t("Relay URL:")+(e.relay_url||"(not configured)"),t("Relay status:")+e.relay_status,t("Relay token:")+(e.relay_token_redacted||"(none)"),t("Allow insecure HTTP:")+(e.allow_insecure_relay?"yes":"no"),t("Remote permission:")+e.remote_permission,t("Uplink paused:")+(e.uplink_paused?"yes":"no"),"","Recent relay errors (most recent first):",...e.recent_relay_errors.length===0?[" (none)"]:e.recent_relay_errors.map(i=>` ${i.timestamp} ${i.message}`),"","Config summary:",t(" Default shell:")+e.config.default_shell,t(" Locale:")+e.config.locale,t(" Theme:")+e.config.terminal_theme,t(" Notifications:")+(e.config.notifications_enabled?"enabled":"disabled"),t(" Shell integration:")+(e.config.shell_integration_enabled?"enabled":"disabled"),t(" WebGL renderer:")+(e.config.webgl_renderer_enabled?"enabled":"disabled"),t(" Logging:")+(e.config.logging_enabled?`enabled (${e.config.log_file_path})`:"disabled"),t(" Auto-check updates:")+(e.config.auto_check_updates?"enabled":"disabled"),t(" Command notify:")+`${e.config.command_notify_threshold_seconds}s`].join(` +`)}const qU={class:"diag"},YU={class:"hint"},GU={class:"preview","data-testid":"diag-preview"},XU={class:"row"},JU={key:0,class:"status"},ZU=$e({__name:"SettingsDiagnostics",setup(e){const{t}=Ot(),n=F(null),i=F(""),s=F("");async function a(){s.value="",n.value=await wC(navigator.userAgent),i.value=jU(n.value)}async function d(){if(i.value)try{await navigator.clipboard.writeText(i.value),s.value=t("settings.diagnostics.copied"),setTimeout(()=>{s.value=""},1500)}catch{s.value=t("settings.diagnostics.copyFailed")}}async function r(){if(i.value)try{const o=await SC(i.value);o&&(s.value=t("settings.diagnostics.exported",{path:o}),setTimeout(()=>{s.value=""},3e3))}catch(o){s.value=o instanceof Error?o.message:String(o)}}return It(a),(o,c)=>($(),O("div",qU,[_("p",YU,T(w(t)("settings.diagnostics.hint")),1),_("pre",GU,T(i.value),1),_("div",XU,[_("button",{type:"button","data-testid":"diag-copy",onClick:d},T(w(t)("settings.diagnostics.copy")),1),_("button",{type:"button","data-testid":"diag-export",onClick:r},T(w(t)("settings.diagnostics.export")),1),_("button",{type:"button","data-testid":"diag-refresh",onClick:a},T(w(t)("settings.diagnostics.refresh")),1),s.value?($(),O("span",JU,T(s.value),1)):Q("",!0)])]))}}),QU=kt(ZU,[["__scopeId","data-v-1a4e377a"]]),ez={key:0,class:"configio","data-testid":"configio-panel"},tz={class:"configio-section"},nz={class:"section-title"},iz={class:"hint"},sz={class:"checkbox"},rz={class:"row"},oz=["disabled"],az={key:0,class:"status","data-testid":"configio-export-status"},lz={key:1,class:"status error","data-testid":"configio-export-error"},cz={class:"configio-section"},dz={class:"section-title"},uz={class:"hint"},hz={class:"row"},fz={key:0,class:"status","data-testid":"configio-import-filename"},pz={key:0,class:"status","data-testid":"configio-import-loading"},vz={key:1,class:"status error","data-testid":"configio-preview-error"},gz={key:2,class:"configio-preview","data-testid":"configio-preview"},mz={key:0,class:"hint","data-testid":"configio-preview-empty"},_z={key:1,"data-testid":"configio-changes-add"},yz={key:2,"data-testid":"configio-changes-replace"},bz={key:3,"data-testid":"configio-changes-unchanged"},wz={key:4,"data-testid":"configio-skipped"},Sz={class:"row"},Cz=["disabled"],kz={key:5,class:"status error","data-testid":"configio-apply-error"},xz={key:3,class:"configio-report","data-testid":"configio-report"},Rz={"data-testid":"configio-report-summary"},Tz={"data-testid":"configio-report-applied"},Ez={key:0,"data-testid":"configio-report-skipped"},Pz=$e({__name:"SettingsConfigIO",setup(e){const{t}=Ot(),i=fn().caps.wailsBindings,s=F(!1),a=F(!1),d=F(""),r=F("");async function o(){if(!(!i||a.value)){a.value=!0,d.value="",r.value="";try{const M=await ok(s.value);M&&(d.value=t("settings.configio.export.success",{path:M}))}catch(M){r.value=M instanceof Error?M.message:String(M)}finally{a.value=!1}}}const c=F(null),h=F(""),u=F(""),v=F(!1),m=F(null),b=F(""),g=F(!1),l=F(""),f=F(null),p=W(()=>{var M;return((M=m.value)==null?void 0:M.changes.filter(B=>B.action==="add"))??[]}),y=W(()=>{var M;return((M=m.value)==null?void 0:M.changes.filter(B=>B.action==="replace"))??[]}),C=W(()=>{var M;return((M=m.value)==null?void 0:M.changes.filter(B=>B.action==="unchanged"))??[]}),k=W(()=>{var M;return(((M=m.value)==null?void 0:M.changes.length)??0)>0}),E=W(()=>i&&!!m.value&&!!u.value&&!g.value);function I(){var M;i&&((M=c.value)==null||M.click())}function S(M){return typeof M.text=="function"?M.text():new Promise((B,z)=>{const Y=new FileReader;Y.onload=()=>B(String(Y.result??"")),Y.onerror=()=>z(Y.error??new Error(t("settings.configio.import.fileReadError"))),Y.readAsText(M)})}async function P(M){var Y;const B=M.target,z=(Y=B.files)==null?void 0:Y[0];B.value="",z&&await A(z)}async function A(M){L(),h.value=M.name,v.value=!0;try{const B=await S(M),z=await ak(B);u.value=B,m.value=z}catch(B){b.value=B instanceof Error?B.message:String(B)}finally{v.value=!1}}function L(){h.value="",u.value="",m.value=null,b.value="",g.value=!1,l.value="",f.value=null}async function x(){if(E.value){g.value=!0,l.value="";try{f.value=await lk(u.value),m.value=null}catch(M){l.value=M instanceof Error?M.message:String(M)}finally{g.value=!1}}}function D(){L()}return(M,B)=>w(i)?($(),O("div",ez,[_("section",tz,[_("h4",nz,T(w(t)("settings.configio.export.title")),1),_("p",iz,T(w(t)("settings.configio.export.hint")),1),_("label",sz,[ct(_("input",{type:"checkbox","onUpdate:modelValue":B[0]||(B[0]=z=>s.value=z),"data-testid":"configio-env-checkbox"},null,512),[[ko,s.value]]),et(" "+T(w(t)("settings.configio.export.includeEnvLabel")),1)]),_("div",rz,[_("button",{type:"button","data-testid":"configio-export-button",disabled:a.value,onClick:o},T(a.value?w(t)("settings.configio.export.exporting"):w(t)("settings.configio.export.button")),9,oz),d.value?($(),O("span",az,T(d.value),1)):Q("",!0),r.value?($(),O("span",lz,T(r.value),1)):Q("",!0)])]),_("section",cz,[_("h4",dz,T(w(t)("settings.configio.import.title")),1),_("p",uz,T(w(t)("settings.configio.import.hint")),1),_("input",{ref_key:"fileInput",ref:c,class:"file-input",type:"file",accept:"application/json,.json","data-testid":"configio-import-file-input",onChange:P},null,544),_("div",hz,[_("button",{type:"button","data-testid":"configio-import-pick-button",onClick:I},T(w(t)("settings.configio.import.pickFile")),1),h.value?($(),O("span",fz,T(w(t)("settings.configio.import.fileLabel",{name:h.value})),1)):Q("",!0)]),v.value?($(),O("p",pz,T(w(t)("settings.configio.import.previewing")),1)):Q("",!0),b.value?($(),O("p",vz,T(w(t)("settings.configio.import.previewError",{error:b.value})),1)):Q("",!0),m.value?($(),O("div",gz,[_("h5",null,T(w(t)("settings.configio.import.previewTitle")),1),k.value?Q("",!0):($(),O("p",mz,T(w(t)("settings.configio.import.noChanges")),1)),p.value.length?($(),O("div",_z,[_("h6",null,T(w(t)("settings.configio.import.changesAdd"))+" ("+T(p.value.length)+")",1),_("ul",null,[($(!0),O(Me,null,st(p.value,z=>($(),O("li",{key:z.key},[et(T(z.key),1),z.detail?($(),O(Me,{key:0},[et(" — "+T(z.detail),1)],64)):Q("",!0)]))),128))])])):Q("",!0),y.value.length?($(),O("div",yz,[_("h6",null,T(w(t)("settings.configio.import.changesReplace"))+" ("+T(y.value.length)+")",1),_("ul",null,[($(!0),O(Me,null,st(y.value,z=>($(),O("li",{key:z.key},[et(T(z.key),1),z.detail?($(),O(Me,{key:0},[et(" — "+T(z.detail),1)],64)):Q("",!0)]))),128))])])):Q("",!0),C.value.length?($(),O("div",bz,[_("h6",null,T(w(t)("settings.configio.import.changesUnchanged"))+" ("+T(C.value.length)+")",1),_("ul",null,[($(!0),O(Me,null,st(C.value,z=>($(),O("li",{key:z.key},T(z.key),1))),128))])])):Q("",!0),m.value.skipped.length?($(),O("div",wz,[_("h6",null,T(w(t)("settings.configio.import.skippedTitle"))+" ("+T(m.value.skipped.length)+")",1),_("ul",null,[($(!0),O(Me,null,st(m.value.skipped,(z,Y)=>($(),O("li",{key:Y},T(z),1))),128))])])):Q("",!0),_("div",Sz,[_("button",{type:"button","data-testid":"configio-apply-button",disabled:!E.value,onClick:x},T(g.value?w(t)("settings.configio.import.applying"):w(t)("settings.configio.import.apply")),9,Cz),_("button",{type:"button","data-testid":"configio-cancel-button",onClick:D},T(w(t)("common.cancel")),1)]),l.value?($(),O("p",kz,T(w(t)("settings.configio.import.applyError",{error:l.value})),1)):Q("",!0)])):Q("",!0),f.value?($(),O("div",xz,[_("h5",null,T(w(t)("settings.configio.import.appliedTitle")),1),_("p",Rz,T(w(t)("settings.configio.import.appliedSummary",{count:f.value.applied.length})),1),_("ul",Tz,[($(!0),O(Me,null,st(f.value.applied,z=>($(),O("li",{key:z.key},[et(T(z.key),1),z.detail?($(),O(Me,{key:0},[et(" — "+T(z.detail),1)],64)):Q("",!0)]))),128))]),f.value.skipped.length?($(),O("div",Ez,[_("h6",null,T(w(t)("settings.configio.import.skippedTitle"))+" ("+T(f.value.skipped.length)+")",1),_("ul",null,[($(!0),O(Me,null,st(f.value.skipped,(z,Y)=>($(),O("li",{key:Y},T(z),1))),128))])])):Q("",!0)])):Q("",!0)])])):Q("",!0)}}),Lz=kt(Pz,[["__scopeId","data-v-9ef7411c"]]),Dz={class:"snippet-run-panel"},Iz={key:0,class:"select-phase"},Mz={class:"hint"},Az={key:0,class:"error","data-testid":"snippet-run-error"},$z={class:"host-list"},Oz=["data-testid","checked","onChange"],Fz={class:"footer"},Bz=["disabled","title"],Hz={key:1,class:"results-phase"},Nz={class:"rows"},Uz=["data-testid","data-state"],zz={class:"row-head"},Vz={class:"row-host"},Kz=["data-testid","data-state"],Wz=["data-testid"],jz=["data-testid"],qz=["data-testid"],Yz={key:0,class:"error","data-testid":"snippet-run-error"},Gz={class:"footer"},Xz=["disabled"],Jz=$e({__name:"SnippetRunPanel",props:{snippetLabel:{},snippetText:{}},emits:["close"],setup(e,{expose:t,emit:n}){const i=e,s=n,{t:a}=Ot(),d=fn(),r=F([]),o=F(new Set),c=F(null),h=F([]),u=F(!1),v=F(!1),m=F("");function b(x){var D;return((D=x.alias)==null?void 0:D.trim())||x.host.trim()}function g(x){const D=new Set(o.value);D.has(x)?D.delete(x):D.add(x),o.value=D}const l=W(()=>o.value.size>0&&!u.value),f=W(()=>h.value.some(x=>x.state==="pending"||x.state==="running"));async function p(){if(!l.value)return;m.value="",u.value=!0;const x=r.value.filter(D=>o.value.has(D.id)).map(D=>D.id);h.value=x.map(D=>{const M=r.value.find(B=>B.id===D);return{host_id:D,host_label:M?b(M):D,state:"pending",exit_code:0,output:"",truncated:!1}}),S=[];try{const D=await nk(i.snippetLabel,i.snippetText,x);c.value=D;const M=S;S=[];for(const B of M)B.run_id===D&&P(B)}catch(D){m.value=D instanceof Error?D.message:String(D),h.value=[],S=[]}finally{u.value=!1}}async function y(){if(!(!c.value||v.value)){v.value=!0,m.value="";try{await ik(c.value)}catch(x){m.value=x instanceof Error?x.message:String(x)}finally{v.value=!1}}}function C(x){switch(x.state){case"pending":return a("snippets.pending");case"running":return a("snippets.running");case"ok":return a("snippets.ok");case"failed":return a("snippets.failed");case"error":return`${a("snippets.error")} · ${x.error??""}`}}function k(x){if(x.state==="error"){const D=x.error??"";return x.output?`${D} +${x.output}`:D}return x.output}function E(){return h.value.map(x=>`=== ${x.host_label} === +${k(x)}`).join(` + +`)}async function I(){const x=E(),D=typeof navigator>"u"?void 0:navigator.clipboard;if(D!=null&&D.writeText){await D.writeText(x);return}Ma(x)}let S=[];function P(x){const D=h.value.findIndex(M=>M.host_id===x.result.host_id);D>=0&&(h.value[D]=x.result)}function A(x){const D=x;if(!c.value){S.push(D);return}D.run_id===c.value&&P(D)}let L=null;return It(async()=>{L=d.events.on("snippet:run:progress",A);try{r.value=await Nm()}catch(x){m.value=x instanceof Error?x.message:String(x)}}),Vt(()=>{L==null||L(),L=null}),t({buildCopyAllText:E}),(x,D)=>($(),O("div",{class:"snippet-run-overlay",onClick:D[2]||(D[2]=pt(M=>s("close"),["self"]))},[_("div",Dz,[c.value?($(),O("div",Hz,[_("ul",Nz,[($(!0),O(Me,null,st(h.value,M=>($(),O("li",{key:M.host_id,class:nt(["row",`state-${M.state}`]),"data-testid":`snippet-run-row-${M.host_id}`,"data-state":M.state},[_("div",zz,[_("span",Vz,T(M.host_label),1),_("span",{class:"row-state","data-testid":`snippet-run-state-${M.host_id}`,"data-state":M.state},T(C(M)),9,Kz)]),M.state==="failed"?($(),O("span",{key:0,class:"row-exitcode","data-testid":`snippet-run-exitcode-${M.host_id}`},T(w(a)("snippets.exitCode",{code:M.exit_code})),9,Wz)):Q("",!0),M.state==="ok"||M.state==="failed"||M.state==="error"&&M.output?($(),O("pre",{key:1,class:"row-output","data-testid":`snippet-run-output-${M.host_id}`},T(M.output),9,jz)):Q("",!0),M.truncated?($(),O("p",{key:2,class:"row-truncated","data-testid":`snippet-run-truncated-${M.host_id}`},T(w(a)("snippets.truncated")),9,qz)):Q("",!0)],10,Uz))),128))]),m.value?($(),O("p",Yz,T(m.value),1)):Q("",!0),_("div",Gz,[_("button",{"data-testid":"snippet-run-close",onClick:D[1]||(D[1]=M=>s("close"))},T(w(a)("common.close")),1),_("button",{"data-testid":"snippet-run-copyall",onClick:I},T(w(a)("snippets.copyAll")),1),f.value?($(),O("button",{key:0,"data-testid":"snippet-run-cancel",disabled:v.value,onClick:y},T(w(a)("snippets.cancel")),9,Xz)):Q("",!0)])])):($(),O("div",Iz,[_("p",Mz,T(w(a)("snippets.selectHosts")),1),m.value?($(),O("p",Az,T(m.value),1)):Q("",!0),_("ul",$z,[($(!0),O(Me,null,st(r.value,M=>($(),O("li",{key:M.id},[_("label",null,[_("input",{type:"checkbox","data-testid":`snippet-run-host-${M.id}`,checked:o.value.has(M.id),onChange:B=>g(M.id)},null,40,Oz),_("span",null,T(b(M)),1)])]))),128))]),_("div",Fz,[_("button",{"data-testid":"snippet-run-close",onClick:D[0]||(D[0]=M=>s("close"))},T(w(a)("common.close")),1),_("button",{class:"primary","data-testid":"snippet-run-start",disabled:!l.value,title:o.value.size===0?w(a)("snippets.noHostsSelected"):"",onClick:p},T(w(a)("snippets.runOnHosts")),9,Bz)])]))])]))}}),Zz=kt(Jz,[["__scopeId","data-v-ca33db20"]]),Qz={class:"tab-pane"},e9={class:"hint"},t9={class:"show-toggle"},n9=["checked"],i9={class:"list"},s9=["data-testid"],r9=["title"],o9=["title"],a9={class:"hotkey"},l9={class:"actions"},c9=["disabled","onClick"],d9=["disabled","onClick"],u9=["onClick"],h9=["data-testid","onClick"],f9=["data-testid","onClick"],p9={key:0,class:"edit-row"},v9={class:"edit-top"},g9=["placeholder"],m9=["placeholder"],_9=["placeholder"],y9={class:"edit-actions"},b9={class:"footer"},w9={key:0,class:"error"},S9={class:"actions"},C9=$e({__name:"SettingsTemplates",setup(e){const{t}=Ot(),n=fn(),i=F([]),s=F(null),a=F(!1),d=F(!1),r=F(""),o=F(null),c=n.caps.wailsBindings;function h(L){o.value=L}function u(){o.value=null}async function v(){const L=await V_(n.templates);i.value=[...L],d.value=await n.templates.loadHidden()}let m=null;It(async()=>{await v(),m=n.events.on("prefs:changed",()=>{v()})}),Vt(()=>{m==null||m(),m=null});function b(){n.events.emit("quickTemplates:changed",null)}async function g(){r.value="";try{await n.templates.save(i.value),b()}catch(L){r.value=L instanceof Error?L.message:String(L)}}async function l(L){d.value=L;try{await n.templates.saveHidden(L),b()}catch(x){r.value=x instanceof Error?x.message:String(x)}}function f(){s.value={id:crypto.randomUUID(),label:"",text:"",hotkey:"",isNew:!0}}function p(L){s.value={id:L.id,label:L.label,text:L.text,hotkey:L.hotkey||"",isNew:!1}}function y(){s.value=null}async function C(){if(!s.value)return;const L=s.value;if(!L.label.trim()||!L.text)return;const x={id:L.id,label:L.label.trim(),text:L.text};if(L.hotkey.trim()&&(x.hotkey=L.hotkey.trim()),L.isNew)i.value.push(x);else{const D=i.value.findIndex(M=>M.id===L.id);D>=0&&(i.value[D]=x)}s.value=null,await g()}async function k(L){i.value=i.value.filter(x=>x.id!==L),await g()}async function E(L){const x=i.value.findIndex(D=>D.id===L);x<=0||([i.value[x-1],i.value[x]]=[i.value[x],i.value[x-1]],await g())}async function I(L){const x=i.value.findIndex(D=>D.id===L);x<0||x>=i.value.length-1||([i.value[x],i.value[x+1]]=[i.value[x+1],i.value[x]],await g())}function S(){a.value=!0}async function P(){a.value=!1,await n.templates.clear(),await v(),b()}function A(){a.value=!1}return(L,x)=>($(),O("div",Qz,[_("p",e9,T(w(t)("settings.templates.intro")),1),_("label",t9,[_("input",{type:"checkbox","data-testid":"template-show-toggle",checked:!d.value,onChange:x[0]||(x[0]=D=>l(!D.target.checked))},null,40,n9),_("span",null,T(w(t)("settings.templates.showBar")),1)]),_("ul",i9,[($(!0),O(Me,null,st(i.value,(D,M)=>($(),O("li",{key:D.id,class:"row","data-testid":`template-row-${D.id}`},[_("span",{class:"label",title:D.label},T(D.label),9,r9),_("code",{class:"text",title:D.text},T(D.text),9,o9),_("code",a9,T(D.hotkey||"—"),1),_("div",l9,[_("button",{disabled:M===0,onClick:B=>E(D.id)},"↑",8,c9),_("button",{disabled:M===i.value.length-1,onClick:B=>I(D.id)},"↓",8,d9),_("button",{onClick:B=>p(D)},T(w(t)("settings.templates.edit")),9,u9),w(c)?($(),O("button",{key:0,"data-testid":`template-run-${D.id}`,onClick:B=>h(D)},T(w(t)("snippets.runOnHosts")),9,h9)):Q("",!0),_("button",{class:"del","data-testid":`template-delete-${D.id}`,onClick:B=>k(D.id)},T(w(t)("settings.templates.delete")),9,f9)])],8,s9))),128))]),s.value?($(),O("div",p9,[_("div",v9,[ct(_("input",{"onUpdate:modelValue":x[1]||(x[1]=D=>s.value.label=D),class:"edit-label-input",placeholder:w(t)("settings.templates.label"),"data-testid":"template-edit-label"},null,8,g9),[[Et,s.value.label]]),ct(_("input",{"onUpdate:modelValue":x[2]||(x[2]=D=>s.value.hotkey=D),class:"edit-hotkey-input",placeholder:w(t)("settings.templates.hotkey"),"data-testid":"template-edit-hotkey"},null,8,m9),[[Et,s.value.hotkey]])]),ct(_("textarea",{"onUpdate:modelValue":x[3]||(x[3]=D=>s.value.text=D),class:"edit-text-input",rows:"3",placeholder:w(t)("settings.templates.text"),"data-testid":"template-edit-text"},null,8,_9),[[Et,s.value.text]]),_("div",y9,[_("button",{onClick:y},T(w(t)("common.cancel")),1),_("button",{class:"primary","data-testid":"template-edit-save",onClick:C},T(w(t)("settings.templates.save")),1)])])):Q("",!0),_("div",b9,[_("button",{"data-testid":"template-add",onClick:f},T(w(t)("settings.templates.add")),1),_("button",{"data-testid":"template-reset",onClick:S},T(w(t)("settings.templates.reset")),1),r.value?($(),O("span",w9,T(r.value),1)):Q("",!0)]),a.value?($(),O("div",{key:1,class:"dialog-backdrop",onClick:A},[_("div",{class:"dialog",onClick:x[4]||(x[4]=pt(()=>{},["stop"]))},[_("p",null,T(w(t)("settings.templates.resetConfirm")),1),_("div",S9,[_("button",{onClick:A},T(w(t)("common.cancel")),1),_("button",{"data-testid":"template-reset-confirm",onClick:P},T(w(t)("settings.templates.reset")),1)])])])):Q("",!0),o.value?($(),Ct(Zz,{key:2,"snippet-label":o.value.label,"snippet-text":o.value.text,onClose:u},null,8,["snippet-label","snippet-text"])):Q("",!0)]))}}),k9=kt(C9,[["__scopeId","data-v-d57ad1d6"]]),x9={class:"tab-pane"},R9={class:"hint"},T9={class:"hint"},E9={class:"hint"},P9={class:"list"},L9=["data-testid"],D9=["title"],I9={key:0,class:"badge","data-testid":"profile-default-badge"},M9={class:"detail"},A9={class:"detail"},$9={class:"actions"},O9=["data-testid","onClick"],F9=["data-testid"],B9=["data-testid","onClick"],H9=["data-testid","onClick"],N9={key:0,class:"hint"},U9={key:1,class:"edit-row","data-testid":"profile-editor"},z9={class:"settings-field-grid settings-field-grid--two","data-testid":"profile-primary-grid"},V9=["placeholder"],K9=["placeholder"],W9=["placeholder"],j9=["placeholder"],q9={class:"hint"},Y9=["placeholder"],G9={class:"hint"},X9={class:"checkbox"},J9={class:"hint"},Z9={class:"edit-actions"},Q9={class:"footer"},eV={key:0,class:"error"},tV=$e({__name:"SettingsProfiles",emits:["profiles-changed"],setup(e,{emit:t}){const{t:n}=Ot(),i=fn(),s=t,a=F([]),d=F(""),r=F(!0),o=F(""),c=F(null);async function h(){o.value="";try{const[E,I]=await Promise.all([d_(),Ak()]);a.value=E??[],d.value=I??""}catch(E){o.value=(E==null?void 0:E.message)??String(E)}finally{r.value=!1}}let u=null;It(()=>{h(),u=i.events.on("prefs:changed",()=>{h()})}),Vt(()=>{u==null||u(),u=null});function v(E){return E?Object.entries(E).map(([I,S])=>`${I}=${S}`).join(` +`):""}function m(E){const I={};for(const S of E.split(` +`)){const P=S.trim();if(!P)continue;const A=P.indexOf("=");if(A<=0)continue;const L=P.slice(0,A).trim(),x=P.slice(A+1);L&&(I[L]=x)}return Object.keys(I).length>0?I:void 0}async function b(){o.value="";try{return await Mk(a.value),s("profiles-changed"),!0}catch(E){const I=(E==null?void 0:E.message)??String(E);return await h(),o.value||(o.value=I),!1}}function g(){c.value={id:crypto.randomUUID(),name:"",shell:"",cwd:"",startupCmd:"",envText:"",syncEnv:!1,isNew:!0}}function l(E){c.value={id:E.id,name:E.name,shell:E.shell??"",cwd:E.cwd??"",startupCmd:E.startup_cmd??"",envText:v(E.env),syncEnv:!!E.sync_env,isNew:!1}}function f(){c.value=null}async function p(){if(!c.value)return;const E=c.value;if(!E.name.trim()){o.value=n("settings.profiles.nameRequired");return}const I={id:E.id,name:E.name.trim()};E.shell.trim()&&(I.shell=E.shell.trim()),E.cwd.trim()&&(I.cwd=E.cwd.trim()),E.startupCmd.trim()&&(I.startup_cmd=E.startupCmd.trim());const S=m(E.envText);S&&(I.env=S),E.syncEnv&&(I.sync_env=!0),E.isNew?a.value=[...a.value,I]:a.value=a.value.map(P=>P.id===E.id?I:P),c.value=null,await b()}async function y(E){const I=d.value===E;a.value=a.value.filter(P=>P.id!==E),await b()&&I&&await k()}async function C(E){const I=d.value;d.value=E,o.value="";try{await $k(E),s("profiles-changed")}catch(S){d.value=I,o.value=(S==null?void 0:S.message)??String(S)}}async function k(){await C("")}return(E,I)=>($(),O("div",x9,[_("p",R9,T(w(n)("settings.profiles.intro")),1),_("p",T9,T(w(n)("settings.profiles.precedenceHint")),1),_("p",E9,T(w(n)("settings.profiles.envPrivacyIntro")),1),r.value?Q("",!0):($(),O(Me,{key:0},[_("ul",P9,[($(!0),O(Me,null,st(a.value,S=>($(),O("li",{key:S.id,class:"row","data-testid":`profile-row-${S.id}`},[_("span",{class:"name",title:S.name},[et(T(S.name)+" ",1),S.id===d.value?($(),O("span",I9,T(w(n)("settings.profiles.defaultBadge")),1)):Q("",!0)],8,D9),_("code",M9,T(S.shell||w(n)("settings.profiles.shellUnset")),1),_("code",A9,T(S.cwd||w(n)("settings.profiles.cwdUnset")),1),_("div",$9,[S.id!==d.value?($(),O("button",{key:0,"data-testid":`profile-set-default-${S.id}`,onClick:P=>C(S.id)},T(w(n)("settings.profiles.setDefault")),9,O9)):($(),O("button",{key:1,"data-testid":`profile-clear-default-${S.id}`,onClick:I[0]||(I[0]=P=>k())},T(w(n)("settings.profiles.clearDefault")),9,F9)),_("button",{"data-testid":`profile-edit-${S.id}`,onClick:P=>l(S)},T(w(n)("settings.profiles.edit")),9,B9),_("button",{class:"del","data-testid":`profile-delete-${S.id}`,onClick:P=>y(S.id)},T(w(n)("settings.profiles.delete")),9,H9)])],8,L9))),128))]),a.value.length===0?($(),O("p",N9,T(w(n)("settings.profiles.empty")),1)):Q("",!0)],64)),c.value?($(),O("div",U9,[_("div",z9,[ct(_("input",{"onUpdate:modelValue":I[1]||(I[1]=S=>c.value.name=S),class:"edit-input",placeholder:w(n)("settings.profiles.name"),"data-testid":"profile-edit-name"},null,8,V9),[[Et,c.value.name]]),ct(_("input",{"onUpdate:modelValue":I[2]||(I[2]=S=>c.value.shell=S),class:"edit-input",placeholder:w(n)("settings.profiles.shellPlaceholder"),"data-testid":"profile-edit-shell"},null,8,K9),[[Et,c.value.shell]])]),ct(_("input",{"onUpdate:modelValue":I[3]||(I[3]=S=>c.value.cwd=S),class:"edit-input",placeholder:w(n)("settings.profiles.cwdPlaceholder"),"data-testid":"profile-edit-cwd"},null,8,W9),[[Et,c.value.cwd]]),ct(_("input",{"onUpdate:modelValue":I[4]||(I[4]=S=>c.value.startupCmd=S),class:"edit-input",placeholder:w(n)("settings.profiles.startupCmdPlaceholder"),"data-testid":"profile-edit-startup-cmd"},null,8,j9),[[Et,c.value.startupCmd]]),_("p",q9,T(w(n)("settings.profiles.startupCmdHint")),1),ct(_("textarea",{"onUpdate:modelValue":I[5]||(I[5]=S=>c.value.envText=S),class:"edit-input edit-textarea",rows:"3",placeholder:w(n)("settings.profiles.envPlaceholder"),"data-testid":"profile-edit-env"},null,8,Y9),[[Et,c.value.envText]]),_("p",G9,T(w(n)("settings.profiles.envHint")),1),_("label",X9,[ct(_("input",{type:"checkbox","onUpdate:modelValue":I[6]||(I[6]=S=>c.value.syncEnv=S),"data-testid":"profile-edit-sync-env"},null,512),[[ko,c.value.syncEnv]]),et(" "+T(w(n)("settings.profiles.syncEnv")),1)]),_("p",J9,T(c.value.syncEnv?w(n)("settings.profiles.syncEnvOnHint"):w(n)("settings.profiles.syncEnvOffHint")),1),_("div",Z9,[_("button",{onClick:f},T(w(n)("common.cancel")),1),_("button",{class:"primary","data-testid":"profile-edit-save",onClick:p},T(w(n)("settings.profiles.save")),1)])])):Q("",!0),_("div",Q9,[_("button",{"data-testid":"profile-add",onClick:g},T(w(n)("settings.profiles.add")),1),o.value?($(),O("span",eV,T(o.value),1)):Q("",!0)])]))}}),nV=kt(tV,[["__scopeId","data-v-41aa374f"]]),iV={class:"settings-tasks"},sV={class:"preset-list"},rV=["value","checked"],oV={class:"preset-meta"},aV={class:"preset-name"},lV={class:"preset-desc"},cV={class:"preset-preview"},dV={class:"group-by-row","data-test":"settings-group-by"},uV={class:"group-by-label"},hV=["value","checked"],fV={class:"expand-toggle"},pV=["checked"],vV=$e({__name:"SettingsTasks",setup(e){const{t}=Ot(),n=F(!0),i=["iconOnly","iconLabel"],s=["host","state"],a=yh(),d=T_();It(async()=>{try{const u=await Um();(u==="iconOnly"||u==="iconLabel")&&(a.activeId.value=u)}catch{}try{const u=await zm();n.value=!u}catch{}});async function r(u){const v=u.target.value;await a.setPreset(v)}async function o(u){const v=u.target.checked;n.value=v,await Vm(!v)}async function c(u){const v=u.target.value;await d.setGroupBy(v)}function h(u){return t(u==="host"?"tasks.settings.groupByHost":"tasks.settings.groupByState")}return(u,v)=>($(),O("section",iV,[_("div",sV,[($(),O(Me,null,st(i,m=>_("label",{key:m,class:"preset-option"},[_("input",{type:"radio",name:"preset",value:m,checked:w(a).activeId.value===m,onChange:r},null,40,rV),_("div",oV,[_("div",aV,T(w(t)(`tasks.preset.${m}.name`)),1),_("div",lV,T(w(t)(`tasks.preset.${m}.description`)),1),_("div",cV,[Pe(ks,{state:"running",preset:w(va)[m]},null,8,["preset"]),Pe(ks,{state:"waiting_input",preset:w(va)[m]},null,8,["preset"]),Pe(ks,{state:"completed",preset:w(va)[m]},null,8,["preset"]),Pe(ks,{state:"failed",preset:w(va)[m]},null,8,["preset"])])])])),64))]),_("div",dV,[_("span",uV,T(w(t)("tasks.settings.groupBy")),1),($(),O(Me,null,st(s,m=>_("label",{key:m,class:"group-by-option"},[_("input",{type:"radio",name:"taskGroupBy",value:m,checked:w(d).activeId.value===m,onChange:c},null,40,hV),et(" "+T(h(m)),1)])),64))]),_("label",fV,[_("input",{type:"checkbox",checked:n.value,onChange:o},null,40,pV),et(" "+T(w(t)("tasks.settings.expandByDefault")),1)])]))}}),gV=kt(vV,[["__scopeId","data-v-d7749d1b"]]),mV={class:"tab-pane"},_V={class:"hook-install","data-test":"hook-install"},yV={class:"hook-install__row"},bV=["title"],wV={class:"hook-install__label"},SV={class:"hook-install__toggle"},CV=["checked"],kV={key:0,class:"hook-install__error"},xV={class:"ai-only","data-test":"feishu-ai-only"},RV={class:"ai-only__toggle"},TV=["checked"],EV={class:"remote-terminal","data-test":"feishu-remote-terminal"},PV={class:"remote-terminal__toggle"},LV=["checked"],DV={key:0,class:"remote-terminal__attach-label"},IV={key:0,class:"hint feishu-status-error","data-test":"feishu-load-error"},MV={key:1,class:"hint","data-test":"feishu-relay-disabled"},AV={key:2,class:"hint"},$V={class:"feishu-mode"},OV={class:"feishu-mode__label"},FV={class:"feishu-mode__label-text"},BV={class:"feishu-mode__effective"},HV={key:0,class:"feishu-mode__warn"},NV={class:"test-send","data-test":"feishu-test-send"},UV={class:"test-send__title"},zV={class:"hint"},VV={class:"test-send__buttons"},KV=["disabled","onClick","data-test"],WV={key:0,class:"test-send__ok","data-test":"feishu-test-ok"},jV={key:1,class:"error","data-test":"feishu-test-error"},qV={key:1,class:"feishu-configured","data-test":"feishu-configured"},YV={class:"configured-line"},GV={class:"configured-badge"},XV={key:0,class:"configured-appid"},JV={class:"field-label"},ZV={class:"callback-row"},QV=["value"],eK={class:"hint"},tK={key:1,class:"hint","data-test":"feishu-longconn-hint"},nK={key:2,class:"error"},iK={class:"actions"},sK={key:3,class:"pair-hint"},rK={key:2,class:"feishu-fieldset settings-field-grid settings-field-grid--two","data-test":"feishu-credentials-grid"},oK={class:"field-label settings-field"},aK={class:"field-label settings-field"},lK={class:"field-label settings-field"},cK={class:"field-label settings-field"},dK={key:0,class:"error settings-field--full"},uK={class:"actions settings-field--full"},hK=2500,fK=15*60*1e3,pK=$e({__name:"SettingsFeishu",setup(e){const{t}=Ot(),n=F({enabled:!1,mode:"local",bound:!1,open_id:"",disabled:!1}),i=F({AppID:"",AppSecret:"",EncryptKey:"",VerifyToken:""}),s=F(""),a=F(""),d=F(!0),r=F("auto"),o=F(""),c=W(()=>[{value:"auto",label:t("settings.feishu.mode.options.auto")},{value:"local",label:t("settings.feishu.mode.options.local")},{value:"relay",label:t("settings.feishu.mode.options.relay")}]);async function h(G){const te=G.target.checked;try{await Rk(te),d.value=te}catch{try{d.value=await pp()}catch(se){Pt("feishu","ai-notifications toggle out of sync with backend",{error:xt(se)})}}}async function u(G){try{await $C(G),r.value=G,o.value=await ap()}catch(te){r.value=await op(),Gi("feishu","SetFeishuModePref failed",{error:xt(te)})}}const v=F(!1),m=F("ai"),b=W(()=>[{value:"ai",label:t("settings.feishu.remoteTerminal.autoAttach.ai")},{value:"all",label:t("settings.feishu.remoteTerminal.autoAttach.all")},{value:"none",label:t("settings.feishu.remoteTerminal.autoAttach.none")}]);async function g(G){const te=G.target.checked;try{await lp(te,m.value),v.value=te}catch{try{const se=await hd();v.value=se.enabled,m.value=se.auto_attach}catch(se){Pt("feishu","remote-terminal settings out of sync with backend",{error:xt(se)})}}}async function l(G){try{await lp(v.value,G),m.value=G}catch{try{const te=await hd();v.value=te.enabled,m.value=te.auto_attach}catch(te){Pt("feishu","remote-terminal settings out of sync with backend",{error:xt(te)})}}}const f=F(!1),p=F(!1),y=["command_success","command_failure","command_sealed","waiting_input"],C=F(""),k=F({ok:!1,error:""});async function E(G){C.value=G,k.value={ok:!1,error:""};try{await NC(G),k.value={ok:!0,error:""}}catch(te){k.value={ok:!1,error:te instanceof Error?te.message:String(te)}}finally{C.value=""}}const I=F({enabled:!0,binary_path:"",binary_ok:!1,binary_version:"",settings_path:"",settings_ok:!1,last_error:"",last_check:""});async function S(){try{n.value=await OC()}catch(G){n.value={enabled:!1,mode:n.value.mode,bound:!1,open_id:"",disabled:!1,error:G instanceof Error?G.message:String(G)}}}async function P(){try{I.value=await UC()}catch{}}const A=W(()=>I.value.enabled?I.value.binary_ok&&I.value.settings_ok?"hook-install__dot--green":"hook-install__dot--amber":"hook-install__dot--gray"),L=W(()=>I.value.enabled?I.value.binary_ok&&I.value.settings_ok?t("settings.feishu.hook_install.healthy"):t("settings.feishu.hook_install.needs_attention"):t("settings.feishu.hook_install.disabled"));async function x(G){const te=G.target.checked;try{await cp(te)}finally{await P()}}async function D(){try{await cp(!0)}finally{await P()}}It(async()=>{await S(),await P();try{d.value=await pp()}catch{}try{const G=await hd();v.value=G.enabled,m.value=G.auto_attach}catch{}try{r.value=await op(),o.value=await ap()}catch{}});async function M(){a.value="";try{await FC(i.value),f.value=!1,await S()}catch(G){a.value=G instanceof Error?G.message:String(G)}}function B(){a.value="",f.value=!0}async function z(){if(n.value.callback_url)try{await navigator.clipboard.writeText(n.value.callback_url),p.value=!0,setTimeout(()=>{p.value=!1},1500)}catch{}}let Y=null;function U(){Y&&(clearInterval(Y),Y=null)}function N(){U();const G=Date.now();Y=setInterval(async()=>{if(await S(),n.value.bound){s.value="",U();return}Date.now()-G>=fK&&U()},hK)}Vt(U);async function V(){try{s.value=await BC(),N()}catch(G){a.value=G instanceof Error?G.message:String(G)}}async function j(){try{U(),await HC(),s.value="",f.value=!1,await S()}catch(G){a.value=G instanceof Error?G.message:String(G)}}return(G,te)=>($(),O("div",mV,[_("section",_V,[_("header",yV,[_("span",{class:nt(["hook-install__dot",A.value]),title:I.value.last_error||""},null,10,bV),_("span",wV,T(L.value),1),_("label",SV,[_("input",{type:"checkbox",checked:I.value.enabled,onChange:x},null,40,CV),_("span",null,T(w(t)("settings.feishu.hook_install.enable")),1)]),I.value.enabled&&(!I.value.binary_ok||!I.value.settings_ok)?($(),O("button",{key:0,type:"button",class:"hook-install__retry",onClick:D,"data-test":"hook-install-retry"},T(w(t)("settings.feishu.hook_install.retry")),1)):Q("",!0)]),I.value.enabled&&I.value.last_error?($(),O("p",kV,T(I.value.last_error),1)):Q("",!0)]),_("section",xV,[_("label",RV,[_("input",{type:"checkbox",checked:d.value,onChange:h},null,40,TV),_("span",null,T(w(t)("settings.feishu.aiOnlyNotifications")),1)])]),_("section",EV,[_("label",PV,[_("input",{type:"checkbox",checked:v.value,onChange:g},null,40,LV),_("span",null,T(w(t)("settings.feishu.remoteTerminal.enable")),1)]),v.value?($(),O("div",DV,[_("span",null,T(w(t)("settings.feishu.remoteTerminal.autoAttachLabel")),1),Pe(qn,{class:"remote-terminal__attach-select","model-value":m.value,options:b.value,"aria-label":w(t)("settings.feishu.remoteTerminal.autoAttachLabel"),"data-test":"feishu-auto-attach","onUpdate:modelValue":l},null,8,["model-value","options","aria-label"])])):Q("",!0)]),n.value.error?($(),O("div",IV,[_("span",null,T(w(t)("settings.feishu.load_error",{error:n.value.error})),1),_("button",{type:"button",class:"hook-install__retry",onClick:S,"data-test":"feishu-status-retry"},T(w(t)("settings.feishu.retry_status")),1)])):n.value.relay_disabled?($(),O("p",MV,T(w(t)("settings.feishu.relay_disabled")),1)):n.value.enabled?($(),O(Me,{key:3},[_("div",$V,[_("div",OV,[_("span",FV,T(w(t)("settings.feishu.mode.label")),1),Pe(qn,{class:"feishu-mode__select","model-value":r.value,options:c.value,"aria-label":w(t)("settings.feishu.mode.label"),"onUpdate:modelValue":u},null,8,["model-value","options","aria-label"])]),_("p",BV,[_("span",null,T(w(t)("settings.feishu.mode.effective.label"))+":",1),_("strong",null,T(o.value||"—"),1),r.value==="relay"&&o.value==="local"?($(),O("span",HV," ⚠ "+T(w(t)("settings.feishu.mode.effective.fallbackWarn")),1)):Q("",!0)])]),n.value.bound?($(),O(Me,{key:0},[_("p",null,T(w(t)("settings.feishu.bound",{open_id:n.value.open_id})),1),_("section",NV,[_("p",UV,T(w(t)("settings.feishu.test_send.title")),1),_("p",zV,T(w(t)("settings.feishu.test_send.hint")),1),_("div",VV,[($(),O(Me,null,st(y,se=>_("button",{key:se,type:"button",class:"btn-secondary",disabled:C.value!=="",onClick:oe=>E(se),"data-test":"feishu-test-"+se},T(C.value===se?w(t)("settings.feishu.test_send.sending"):w(t)(`settings.feishu.test_send.${se}`)),9,KV)),64))]),k.value.ok?($(),O("p",WV,T(w(t)("settings.feishu.test_send.sent")),1)):k.value.error?($(),O("p",jV,T(w(t)("settings.feishu.test_send.failed",{error:k.value.error})),1)):Q("",!0)]),_("button",{type:"button",class:"btn-danger",onClick:j},T(w(t)("settings.feishu.delete")),1)],64)):n.value.configured&&!f.value?($(),O("div",qV,[_("p",YV,[_("span",GV,T(w(t)("settings.feishu.configured")),1),n.value.app_id?($(),O("span",XV,T(w(t)("settings.feishu.app_id_label"))+": "+T(n.value.app_id),1)):Q("",!0)]),n.value.callback_url?($(),O(Me,{key:0},[_("label",JV,[et(T(w(t)("settings.feishu.callback_label"))+" ",1),_("span",ZV,[_("input",{value:n.value.callback_url,readonly:"",class:"field-input","data-test":"feishu-callback-url"},null,8,QV),_("button",{type:"button",class:"btn-primary",onClick:z,"data-test":"feishu-callback-copy"},T(p.value?w(t)("settings.feishu.copied"):w(t)("settings.feishu.copy")),1)])]),_("p",eK,T(w(t)("settings.feishu.callback_hint_relay")),1)],64)):($(),O("p",tK,T(w(t)("settings.feishu.longconn_hint_local")),1)),a.value?($(),O("div",nK,T(a.value),1)):Q("",!0),_("div",iK,[_("button",{type:"button",class:"btn-primary",onClick:V,"data-test":"feishu-begin-pair"},T(w(t)("settings.feishu.begin_pair")),1),_("button",{type:"button",class:"btn-secondary",onClick:B},T(w(t)("settings.feishu.reconfigure")),1)]),s.value?($(),O("p",sK,T(w(t)("settings.feishu.pair_hint",{code:s.value})),1)):Q("",!0)])):($(),O("fieldset",rK,[_("label",oK,[te[4]||(te[4]=et("App ID ")),ct(_("input",{"onUpdate:modelValue":te[0]||(te[0]=se=>i.value.AppID=se),type:"text",class:"field-input"},null,512),[[Et,i.value.AppID]])]),_("label",aK,[te[5]||(te[5]=et("App Secret ")),ct(_("input",{"onUpdate:modelValue":te[1]||(te[1]=se=>i.value.AppSecret=se),type:"password",class:"field-input"},null,512),[[Et,i.value.AppSecret]])]),_("label",lK,[te[6]||(te[6]=et("Encrypt Key ")),ct(_("input",{"onUpdate:modelValue":te[2]||(te[2]=se=>i.value.EncryptKey=se),type:"password",class:"field-input"},null,512),[[Et,i.value.EncryptKey]])]),_("label",cK,[te[7]||(te[7]=et("Verify Token ")),ct(_("input",{"onUpdate:modelValue":te[3]||(te[3]=se=>i.value.VerifyToken=se),type:"password",class:"field-input"},null,512),[[Et,i.value.VerifyToken]])]),a.value?($(),O("div",dK,T(a.value),1)):Q("",!0),_("div",uK,[_("button",{type:"button",class:"btn-primary",onClick:M},T(w(t)("settings.feishu.save")),1)])]))],64)):($(),O("p",AV,T(w(t)("settings.feishu.disabled")),1))]))}}),vK=kt(pK,[["__scopeId","data-v-2aad46af"]]),gK={class:"tab-pane"},mK={key:0,class:"dim"},_K={class:"header-row"},yK={class:"hint"},bK={key:0,class:"header-actions"},wK=["disabled","aria-label"],SK=["disabled"],CK={key:0,class:"hint"},kK={key:1,class:"error"},xK={key:2,class:"dim"},RK={key:3,class:"device-list"},TK={class:"device-info"},EK={class:"ua"},PK={class:"meta"},LK={key:0,class:"current-tag"},DK=["disabled","onClick"],IK=$e({__name:"SettingsDevices",setup(e){const{t}=Ot(),n=fn(),i=F([]),s=F(!0),a=F(!1),d=F(!1),r=F({}),o=F(""),c=F(!1);async function h(g=!1){g||(s.value=!0),a.value=!0,o.value="",c.value=!1;try{if(!n.sessions.listRelaySessions){c.value=!0,i.value=[];return}i.value=await n.sessions.listRelaySessions()}catch(l){const f=(l==null?void 0:l.message)??String(l);f.includes("not authenticated")?c.value=!0:o.value=f}finally{s.value=!1,a.value=!1}}It(()=>{h()});async function u(){await h(!0)}async function v(g){var f,p;const l=g.user_agent||t("settings.devices.unknownUA");if(window.confirm(t("settings.devices.revokeConfirm",{ua:l}))){r.value={...r.value,[g.id_hash]:!0};try{await((p=(f=n.sessions).revokeRelaySession)==null?void 0:p.call(f,g.id_hash)),await h(!0)}catch(y){o.value=(y==null?void 0:y.message)??String(y)}finally{const y={...r.value};delete y[g.id_hash],r.value=y}}}async function m(){var g,l;if(window.confirm(t("settings.devices.signOutOthersConfirm"))){d.value=!0;try{await((l=(g=n.sessions).signOutOtherRelaySessions)==null?void 0:l.call(g)),await h(!0)}catch(f){o.value=(f==null?void 0:f.message)??String(f)}finally{d.value=!1}}}function b(g){const l=new Date(g);return t("settings.devices.timeFormat",{y:l.getFullYear(),m:l.getMonth()+1,d:l.getDate(),hh:String(l.getHours()).padStart(2,"0"),mm:String(l.getMinutes()).padStart(2,"0")})}return(g,l)=>($(),O("div",gK,[s.value?($(),O("div",mK,T(w(t)("common.loading")),1)):($(),O(Me,{key:1},[_("div",_K,[_("p",yK,T(w(t)("settings.devices.hint")),1),c.value?Q("",!0):($(),O("div",bK,[_("button",{type:"button",class:"icon-btn",disabled:a.value,"aria-label":w(t)("settings.devices.refresh"),onClick:u},T(a.value?"…":"⟳"),9,wK),_("button",{type:"button",class:"secondary",disabled:d.value||i.value.filter(f=>!f.is_current).length===0,onClick:m},T(d.value?w(t)("settings.devices.signingOut"):w(t)("settings.devices.signOutOthers")),9,SK)]))]),c.value?($(),O("p",CK,T(w(t)("settings.devices.notAuthenticated")),1)):o.value?($(),O("p",kK,T(o.value),1)):i.value.length===0?($(),O("p",xK,T(w(t)("settings.devices.empty")),1)):($(),O("div",RK,[($(!0),O(Me,null,st(i.value,f=>($(),O("div",{key:f.id_hash,class:"device-row"},[_("div",TK,[_("div",EK,T(f.user_agent||w(t)("settings.devices.unknownUA")),1),_("div",PK,T(w(t)("settings.devices.loginLine",{time:b(f.created_at),ip:f.ip_prefix})),1)]),f.is_current?($(),O("span",LK,T(w(t)("settings.devices.currentTag")),1)):($(),O("button",{key:1,type:"button",class:"danger-btn",disabled:!!r.value[f.id_hash],onClick:p=>v(f)},T(r.value[f.id_hash]?w(t)("settings.devices.revoking"):w(t)("settings.devices.revoke")),9,DK))]))),128))]))],64))]))}}),MK=kt(IK,[["__scopeId","data-v-6015f38d"]]),AK={class:"received-files"},$K={class:"header"},OK={"data-testid":"total-bytes"},FK={class:"muted"},BK={class:"actions"},HK=["disabled"],NK={key:0,class:"error"},UK={key:1},zK={key:2,class:"empty"},VK={key:3,class:"sessions"},KK=["onClick"],WK={class:"session-name"},jK={class:"muted"},qK=["onClick"],YK={key:0,class:"files"},GK={class:"file-name"},XK={class:"muted"},JK=["onClick"],ZK=$e({__name:"SettingsReceivedFiles",setup(e){const t=F({total_bytes:0,sessions:[]}),n=F(!1),i=F(new Set),s=F("");function a(v){return v<1024?`${v} B`:v<1024*1024?`${(v/1024).toFixed(1)} KiB`:`${(v/(1024*1024)).toFixed(1)} MiB`}async function d(){n.value=!0,s.value="";try{t.value=await ZT()}catch(v){s.value=String(v)}finally{n.value=!1}}async function r(){if(confirm("Clear ALL received files? This cannot be undone.")){try{await GT()}catch(v){s.value=String(v)}await d()}}async function o(v){try{await XT(v)}catch(m){s.value=String(m)}await d()}async function c(v,m){try{await JT(v,m)}catch(b){s.value=String(b)}await d()}async function h(){try{await QT()}catch(v){s.value=String(v)}}function u(v){const m=new Set(i.value);m.has(v)?m.delete(v):m.add(v),i.value=m}return It(d),(v,m)=>($(),O("div",AK,[_("div",$K,[_("div",null,[_("strong",OK,"Total: "+T(a(t.value.total_bytes)),1),_("span",FK," · "+T(t.value.sessions.length)+" sessions",1)]),_("div",BK,[_("button",{onClick:h},"Open folder"),_("button",{class:"danger",disabled:t.value.sessions.length===0,onClick:r},"Clear all",8,HK)])]),s.value?($(),O("div",NK,T(s.value),1)):Q("",!0),n.value?($(),O("div",UK,"Loading…")):t.value.sessions.length===0?($(),O("div",zK,"No files received.")):($(),O("ul",VK,[($(!0),O(Me,null,st(t.value.sessions,b=>($(),O("li",{key:b.session_id,class:"session"},[_("div",{class:"session-row","data-testid":"session-row",onClick:g=>u(b.session_id)},[_("span",WK,T(b.session_name||b.session_id.slice(0,8)),1),_("span",jK," · "+T(b.files.length)+" files · "+T(a(b.bytes)),1),_("button",{class:"session-clear danger",onClick:pt(g=>o(b.session_id),["stop"])},"Clear",8,qK)],8,KK),i.value.has(b.session_id)?($(),O("ul",YK,[($(!0),O(Me,null,st(b.files,g=>($(),O("li",{key:g.name,"data-testid":"file-row"},[_("span",GK,T(g.name),1),_("span",XK," · "+T(a(g.bytes)),1),_("button",{class:"file-delete danger",onClick:l=>c(b.session_id,g.name)},"Delete",8,JK)]))),128))])):Q("",!0)]))),128))]))]))}}),QK=kt(ZK,[["__scopeId","data-v-4b01c574"]]);function Bb(e=300,t=10){const n=F(ys());let i=null;return It(()=>{if(n.value)return;let s=0;i=setInterval(()=>{s++;const a=ys();a&&(n.value=a),(a||s>=t)&&(i!==null&&clearInterval(i),i=null)},e)}),Vt(()=>{i!==null&&clearInterval(i),i=null}),n}const eW=["locale_preference","quick_templates","notifications_enabled","ai_notifications_only","command_notify_threshold_seconds","shell_integration_enabled","pinned_session_ids"],Sg=e=>`atterm.${e}.value`,Cg=e=>`atterm.${e}.meta`;function tW(){return{readValue(e){const t=localStorage.getItem(Sg(e));if(t!==null)try{return JSON.parse(t)}catch{return}},writeValue(e,t){localStorage.setItem(Sg(e),JSON.stringify(t))},readMeta(e){const t=localStorage.getItem(Cg(e));if(t===null)return{updatedAtLocal:0,dirty:!1};try{const n=JSON.parse(t);return{updatedAtLocal:Number((n==null?void 0:n.updatedAtLocal)??0),dirty:!!(n!=null&&n.dirty)}}catch{return{updatedAtLocal:0,dirty:!1}}},writeMeta(e,t){localStorage.setItem(Cg(e),JSON.stringify(t))},keys(){return[...eW]}}}function Hb(e){const t=tW().readValue(e);return typeof t=="string"?t:void 0}const nW="bbbac178-5e9b-45b4-8b79-3257d9af7ca5",iW="55480000-0000-4000-8000-000000000001",sW=241,rW=240;function Nb(e,t,n,i,s){let a;try{a=ph(t)}catch{throw new Error(`${s}: value is not valid base64`)}const d=Il(e,n,i,a);if(!d)throw new Error(`${s}: could not decrypt (wrong account key or corrupted blob)`);let r;try{r=JSON.parse(new TextDecoder().decode(d))}catch{throw new Error(`${s}: decrypted payload is not valid JSON`)}if(typeof r!="object"||r===null||Array.isArray(r))throw new Error(`${s}: decrypted payload is not a JSON object`);return r}function oW(e,t){const n=Nb(e,t,nW,sW,"openProfilesBlob");return{profiles:(n.profiles??[]).map(s=>({id:s.id,name:s.name,shell:s.shell??"",cwd:s.cwd??"",startupCmd:s.startup_cmd??"",syncEnv:!!s.sync_env,env:s.env})),defaultProfileId:n.default_profile_id??""}}function aW(e,t){const n=Nb(e,t,iW,rW,"openSSHHostsBlob"),i=(n.hosts??[]).map(({host:a})=>({id:a.id,alias:a.alias??"",host:a.host,port:a.port??"",user:a.user,authKind:a.auth_kind,keyId:a.key_id??"",tags:a.tags??[],note:a.note??"",hasJumpChain:!!a.proxy_jump,isProxyCommandHost:!!a.proxy_command})),s=(n.keys??[]).map(({key:a})=>({id:a.id,name:a.name,keyType:a.key_type??""}));return{hosts:i,keys:s}}const lW={key:0,class:"mobile-profiles","data-testid":"mobile-profiles-panel"},cW={class:"hint"},dW={key:0,class:"status","data-testid":"mobile-profiles-locked"},uW={key:1,class:"status","data-testid":"mobile-profiles-no-data"},hW={key:2,class:"status error","data-testid":"mobile-profiles-error"},fW={key:3,class:"status","data-testid":"mobile-profiles-empty"},pW={key:0,class:"host-picker"},vW=["value"],gW={key:1,class:"status","data-testid":"mobile-profiles-no-hosts"},mW={key:2,class:"status error","data-testid":"mobile-profiles-create-error"},_W={class:"profile-list","data-testid":"mobile-profiles-list"},yW={class:"profile-header"},bW={class:"profile-name"},wW={key:0,class:"badge","data-testid":"mobile-profile-default-badge"},SW=["disabled","onClick"],CW={class:"profile-fields"},kW={"data-testid":"mobile-profile-shell"},xW={"data-testid":"mobile-profile-cwd"},RW={"data-testid":"mobile-profile-startup-cmd"},TW={"data-testid":"mobile-profile-env"},EW={key:2,class:"env-list"},PW=$e({__name:"SettingsProfilesMobile",emits:["session-created"],setup(e,{emit:t}){const{t:n}=Ot(),i=fn(),s=i.caps.capacitor,a=t,d=s?Bb():F(null),r=F([]),o=F(""),c=F(""),h=F(!1);function u(){if(!s)return;c.value="";const E=d.value;if(!E)return;const I=Hb("profiles_encrypted");if(h.value=I!==void 0,I!==void 0)try{const S=oW(E,I);r.value=S.profiles,o.value=S.defaultProfileId}catch(S){c.value=S instanceof Error?S.message:String(S)}}wt(d,u,{immediate:!0});const v=W(()=>d.value?c.value?"error":h.value?r.value.length===0?"empty":"ready":"noData":"locked"),m=F([]),b=W(()=>{const E=new Map;for(const I of m.value)!I.host_id||E.has(I.host_id)||E.set(I.host_id,I.host||I.host_id);return[...E.entries()].map(([I,S])=>({id:I,name:S})).sort((I,S)=>I.name.localeCompare(S.name))}),g=F("");wt(b,E=>{var I;E.some(S=>S.id===g.value)||(g.value=((I=E[0])==null?void 0:I.id)??"")},{immediate:!0});async function l(){if(s)try{m.value=await i.sessions.listRemoteSessions()}catch{m.value=[]}}It(l);const f=F(null),p=F(""),y=new Set(["unknown_profile","permission_denied","request_in_flight","duplicate_request_id","unknown_host_id","invalid_request","upstream_unavailable","session_create_busy","timeout","relay_not_configured"]);function C(E){return y.has(E)?n(`settings.mobileProfiles.openErrors.${E}`):n("settings.mobileProfiles.openErrors.generic",{error:E})}async function k(E){if(f.value!==null)return;const I=g.value;if(!I)return;const S=i.sessions.createSessionWithProfile;if(!S){p.value=C("relay_not_configured");return}f.value=E,p.value="";try{const P=await S(I,E);a("session-created",P)}catch(P){p.value=C(P instanceof Error?P.message:String(P))}finally{f.value=null}}return(E,I)=>w(s)?($(),O("div",lW,[_("p",cW,T(w(n)("settings.mobileProfiles.intro")),1),v.value==="locked"?($(),O("p",dW,T(w(n)("settings.mobileSync.locked")),1)):v.value==="noData"?($(),O("p",uW,T(w(n)("settings.mobileSync.noData")),1)):v.value==="error"?($(),O("p",hW,T(w(n)("settings.mobileSync.error",{error:c.value})),1)):v.value==="empty"?($(),O("p",fW,T(w(n)("settings.mobileProfiles.empty")),1)):($(),O(Me,{key:4},[b.value.length>0?($(),O("label",pW,[_("span",null,T(w(n)("settings.mobileProfiles.hostLabel")),1),ct(_("select",{"onUpdate:modelValue":I[0]||(I[0]=S=>g.value=S),"data-testid":"mobile-profiles-host-select"},[($(!0),O(Me,null,st(b.value,S=>($(),O("option",{key:S.id,value:S.id},T(S.name),9,vW))),128))],512),[[om,g.value]])])):($(),O("p",gW,T(w(n)("settings.mobileProfiles.noHosts")),1)),p.value?($(),O("p",mW,T(p.value),1)):Q("",!0),_("ul",_W,[($(!0),O(Me,null,st(r.value,S=>($(),O("li",{key:S.id,class:"profile-item","data-testid":"mobile-profile-item"},[_("div",yW,[_("span",bW,T(S.name||w(n)("common.unknown")),1),S.id===o.value?($(),O("span",wW,T(w(n)("settings.mobileProfiles.defaultBadge")),1)):Q("",!0),_("button",{type:"button",class:"open-btn","data-testid":"mobile-profile-open",disabled:!g.value||f.value!==null,onClick:P=>k(S.id)},T(f.value===S.id?w(n)("settings.mobileProfiles.opening"):w(n)("settings.mobileProfiles.openButton")),9,SW)]),_("dl",CW,[_("dt",null,T(w(n)("settings.mobileProfiles.shell")),1),_("dd",kW,T(S.shell||w(n)("common.unknown")),1),_("dt",null,T(w(n)("settings.mobileProfiles.cwd")),1),_("dd",xW,T(S.cwd||w(n)("common.unknown")),1),_("dt",null,T(w(n)("settings.mobileProfiles.startupCmd")),1),_("dd",RW,T(S.startupCmd||w(n)("common.unknown")),1),_("dt",null,T(w(n)("settings.mobileProfiles.env")),1),_("dd",TW,[S.syncEnv?!S.env||Object.keys(S.env).length===0?($(),O(Me,{key:1},[et(T(w(n)("settings.mobileProfiles.envNone")),1)],64)):($(),O("ul",EW,[($(!0),O(Me,null,st(S.env,(P,A)=>($(),O("li",{key:A},T(A)+"="+T(P),1))),128))])):($(),O(Me,{key:0},[et(T(w(n)("settings.mobileProfiles.envNotSynced")),1)],64))])])]))),128))])],64))])):Q("",!0)}}),LW=kt(PW,[["__scopeId","data-v-1c4c4dd0"]]),DW={key:0,class:"mobile-hosts","data-testid":"mobile-hosts-panel"},IW={class:"hint"},MW={key:0,class:"status","data-testid":"mobile-hosts-locked"},AW={key:1,class:"status","data-testid":"mobile-hosts-no-data"},$W={key:2,class:"status error","data-testid":"mobile-hosts-error"},OW={key:3,class:"status","data-testid":"mobile-hosts-empty"},FW={key:4,class:"host-list","data-testid":"mobile-hosts-list"},BW={class:"host-header"},HW={class:"host-alias"},NW={class:"host-target"},UW={key:0,class:"badge badge-warn","data-testid":"mobile-host-proxy-command-badge"},zW={key:1,class:"badge","data-testid":"mobile-host-jump-chain-badge"},VW={class:"host-fields"},KW={"data-testid":"mobile-host-user"},WW={"data-testid":"mobile-host-port"},jW={"data-testid":"mobile-host-key"},qW={"data-testid":"mobile-host-tags"},YW={"data-testid":"mobile-host-note"},GW=$e({__name:"SettingsSSHHostsMobile",setup(e){const{t}=Ot(),i=fn().caps.capacitor,s=i?Bb():F(null),a=F([]),d=F([]),r=F(""),o=F(!1);function c(){if(!i)return;r.value="";const v=s.value;if(!v)return;const m=Hb("ssh_hosts_encrypted");if(o.value=m!==void 0,m!==void 0)try{const b=aW(v,m);a.value=b.hosts,d.value=b.keys}catch(b){r.value=b instanceof Error?b.message:String(b)}}wt(s,c,{immediate:!0});const h=W(()=>s.value?r.value?"error":o.value?a.value.length===0?"empty":"ready":"noData":"locked");function u(v){var m;return v?((m=d.value.find(b=>b.id===v))==null?void 0:m.name)??v:""}return(v,m)=>w(i)?($(),O("div",DW,[_("p",IW,T(w(t)("settings.mobileHosts.intro")),1),h.value==="locked"?($(),O("p",MW,T(w(t)("settings.mobileSync.locked")),1)):h.value==="noData"?($(),O("p",AW,T(w(t)("settings.mobileSync.noData")),1)):h.value==="error"?($(),O("p",$W,T(w(t)("settings.mobileSync.error",{error:r.value})),1)):h.value==="empty"?($(),O("p",OW,T(w(t)("settings.mobileHosts.empty")),1)):($(),O("ul",FW,[($(!0),O(Me,null,st(a.value,b=>($(),O("li",{key:b.id,class:"host-item","data-testid":"mobile-host-item"},[_("div",BW,[_("span",HW,T(b.alias||b.host),1),_("span",NW,T(b.host),1),b.isProxyCommandHost?($(),O("span",UW,T(w(t)("settings.mobileHosts.proxyCommand")),1)):b.hasJumpChain?($(),O("span",zW,T(w(t)("settings.mobileHosts.jumpChain")),1)):Q("",!0)]),_("dl",VW,[_("dt",null,T(w(t)("settings.mobileHosts.user")),1),_("dd",KW,T(b.user||w(t)("common.unknown")),1),_("dt",null,T(w(t)("settings.mobileHosts.port")),1),_("dd",WW,T(b.port||w(t)("common.unknown")),1),b.keyId?($(),O(Me,{key:0},[_("dt",null,T(w(t)("settings.mobileHosts.key")),1),_("dd",jW,T(u(b.keyId)),1)],64)):Q("",!0),b.tags.length?($(),O(Me,{key:1},[_("dt",null,T(w(t)("settings.mobileHosts.tags")),1),_("dd",qW,T(b.tags.join(", ")),1)],64)):Q("",!0),b.note?($(),O(Me,{key:2},[_("dt",null,T(w(t)("settings.mobileHosts.note")),1),_("dd",YW,T(b.note),1)],64)):Q("",!0)])]))),128))]))])):Q("",!0)}}),XW=kt(GW,[["__scopeId","data-v-721a37c4"]]),JW=["data-state"],ZW={class:"sync-row"},QW=["data-state"],ej={class:"sync-last","data-testid":"sync-last-synced"},tj={key:0,class:"sync-pending","data-testid":"sync-pending"},nj=["disabled"],ij={key:0,class:"sync-error","data-testid":"sync-error"},sj={key:1,class:"sync-error","data-testid":"sync-trigger-error"},rj={key:2,class:"sync-notice","data-testid":"sync-notice"},oj={key:0,class:"sync-notice-adopted","data-testid":"sync-notice-adopted"},aj={key:1,class:"sync-notice-conflict","data-testid":"sync-notice-conflict"},lj=$e({__name:"SyncStatusIndicator",setup(e){const{t}=Ot(),n=fn(),i=n.caps.wailsBindings,s=F({state:"idle",last_synced_at:0,pending_keys:0}),a=F(!1),d=F(""),r=F(null),o={locale_preference:"sync.keys.locale_preference",quick_templates:"sync.keys.quick_templates",notifications_enabled:"sync.keys.notifications_enabled",ai_notifications_only:"sync.keys.ai_notifications_only",command_notify_threshold_seconds:"sync.keys.command_notify_threshold_seconds",shell_integration_enabled:"sync.keys.shell_integration_enabled",pinned_session_ids:"sync.keys.pinned_session_ids",ssh_hosts_encrypted:"sync.keys.ssh_hosts_encrypted",terminal_theme:"sync.keys.terminal_theme",terminal_font_head:"sync.keys.terminal_font_head",terminal_font_size:"sync.keys.terminal_font_size",terminal_line_height:"sync.keys.terminal_line_height",terminal_cursor_style:"sync.keys.terminal_cursor_style",terminal_cursor_blink:"sync.keys.terminal_cursor_blink",terminal_scrollback:"sync.keys.terminal_scrollback",default_shell:"sync.keys.default_shell",shortcut_bindings:"sync.keys.shortcut_bindings",profiles_encrypted:"sync.keys.profiles_encrypted"};function c(p){const y=o[p];return y?t(y):p.replace(/_/g," ").replace(/\b\w/g,C=>C.toUpperCase())}const h=W(()=>{if(s.value.last_synced_at===0)return t("sync.lastSyncedNever");const p=Ab(Math.floor(s.value.last_synced_at/1e3));return t("sync.lastSyncedAt",{time:p})}),u=W(()=>{switch(s.value.state){case"idle":return t("sync.stateIdle");case"syncing":return t("sync.stateSyncing");case"offline":return t("sync.stateOffline");case"error":return t("sync.stateError")}});async function v(){if(!(s.value.state==="syncing"||a.value)){a.value=!0,d.value="";try{await rk()}catch(p){d.value=p instanceof Error?p.message:String(p)}finally{a.value=!1}}}function m(){r.value=null}function b(p){s.value=p,d.value=""}function g(p){var C,k;const y=p;(((C=y.adopted)==null?void 0:C.length)??0)===0&&(((k=y.conflict)==null?void 0:k.length)??0)===0||(r.value=y)}let l=null,f=null;return It(async()=>{if(i){l=n.events.on("sync:status",b),f=n.events.on("sync:pulled",g);try{s.value=await sk()}catch{}}}),Vt(()=>{l==null||l(),l=null,f==null||f(),f=null}),(p,y)=>w(i)?($(),O("div",{key:0,class:"sync-indicator","data-testid":"sync-indicator","data-state":s.value.state},[_("div",ZW,[_("span",{class:nt(["sync-dot",`state-${s.value.state}`]),"aria-hidden":"true"},null,2),_("span",{class:"sync-state","data-testid":"sync-state","data-state":s.value.state},T(u.value),9,QW),_("span",ej,T(h.value),1),s.value.pending_keys>0?($(),O("span",tj,T(w(t)("sync.pendingKeys",{count:s.value.pending_keys})),1)):Q("",!0),_("button",{class:"sync-now-btn","data-testid":"sync-now-button",disabled:s.value.state==="syncing"||a.value,onClick:v},T(w(t)("sync.syncNow")),9,nj)]),s.value.last_error?($(),O("p",ij,T(s.value.last_error),1)):Q("",!0),d.value?($(),O("p",sj,T(d.value),1)):Q("",!0),r.value?($(),O("div",rj,[r.value.adopted&&r.value.adopted.length?($(),O("p",oj,T(w(t)("sync.pulledAdopted",{keys:r.value.adopted.map(c).join(", ")})),1)):Q("",!0),r.value.conflict&&r.value.conflict.length?($(),O("p",aj,T(w(t)("sync.pulledConflict",{keys:r.value.conflict.map(c).join(", ")})),1)):Q("",!0),_("button",{class:"sync-notice-dismiss","data-testid":"sync-notice-dismiss",onClick:m},T(w(t)("app.dismiss")),1)])):Q("",!0)],8,JW)):Q("",!0)}}),cj=kt(lj,[["__scopeId","data-v-3da58fd3"]]),dj={class:"dialog"},uj={key:0},hj={key:0},fj={class:"dim"},pj={key:1},vj={class:"dim"},gj={key:1,class:"warn"},mj={class:"row"},_j=$e({__name:"ConfirmInstallDialog",props:{version:{},localCount:{},remoteCount:{}},emits:["confirm","cancel"],setup(e){const{t}=Ot(),n=s=>s===1?"sessions.endLocalSessionOne":"sessions.endLocalSessionMany",i=s=>s===1?"sessions.detachRemoteSessionOne":"sessions.detachRemoteSessionMany";return(s,a)=>($(),O("div",{class:"backdrop",onClick:a[2]||(a[2]=pt(d=>s.$emit("cancel"),["self"]))},[_("div",dj,[_("h2",null,T(w(t)("settings.updates.installTitle",{version:s.version})),1),_("p",null,[et(T(w(t)("settings.updates.installIntro"))+" ",1),s.localCount>0||s.remoteCount>0?($(),O(Me,{key:0},[et(T(w(t)("settings.updates.installThisWill")),1)],64)):Q("",!0)]),s.localCount>0||s.remoteCount>0?($(),O("ul",uj,[s.localCount>0?($(),O("li",hj,[et(T(w(t)(n(s.localCount),{count:s.localCount}))+" ",1),_("span",fj,T(w(t)("sessions.runningProcessesTerminated")),1)])):Q("",!0),s.remoteCount>0?($(),O("li",pj,[et(T(w(t)(i(s.remoteCount),{count:s.remoteCount}))+" ",1),_("span",vj,T(w(t)("sessions.remotePtyKeepsRunning")),1)])):Q("",!0)])):Q("",!0),s.localCount>0?($(),O("p",gj,T(w(t)("sessions.saveWorkFirst")),1)):Q("",!0),_("div",mj,[_("button",{onClick:a[0]||(a[0]=d=>s.$emit("cancel"))},T(w(t)("common.cancel")),1),_("button",{class:nt(["primary",{danger:s.localCount>0}]),onClick:a[1]||(a[1]=d=>s.$emit("confirm"))},T(s.localCount>0?w(t)("settings.updates.forceInstall"):w(t)("settings.updates.installRestart")),3)])])]))}}),yj=kt(_j,[["__scopeId","data-v-3b3531ba"]]),bj={class:"dialog"},wj={class:"header"},Sj=["title"],Cj={key:0,class:"error"},kj={key:1,class:"empty"},xj={key:2,class:"empty"},Rj={key:3,class:"content-wrap"},Tj={key:0,class:"hint"},Ej={class:"row"},Pj={class:"lvl-filter"},Lj={class:"lvl-filter-label"},Dj={class:"lvl-filter-select"},Ij={class:"lvl-filter-label"},Mj={class:"tag-filter-select"},Aj=["disabled"],$j=$e({__name:"LogViewerDialog",props:{preview:{},loading:{type:Boolean},error:{}},emits:["close","refresh"],setup(e,{emit:t}){const n=e,i=t,{t:s}=Ot(),a=F("DEBUG"),d=F(Wc),r=W(()=>Ib(n.preview.content,s("settings.logging.tagFilterAll"))),o=F(null);async function c(){var v;await hn();const u=(v=o.value)==null?void 0:v.$el;u&&(u.scrollTop=u.scrollHeight)}wt(()=>n.preview.content,()=>{c()},{immediate:!0});async function h(){await navigator.clipboard.writeText(n.preview.content)}return(u,v)=>($(),O("div",{class:"backdrop",onClick:v[4]||(v[4]=pt(m=>i("close"),["self"]))},[_("div",bj,[_("div",wj,[_("h2",null,T(w(s)("settings.logging.title")),1),_("div",{class:"path",title:n.preview.path},T(n.preview.path),9,Sj)]),n.error?($(),O("div",Cj,T(n.error),1)):n.loading?($(),O("div",kj,T(w(s)("common.loading")),1)):n.preview.exists?($(),O("div",Rj,[n.preview.truncated?($(),O("div",Tj,T(w(s)("settings.logging.truncated")),1)):Q("",!0),Pe(Mb,{ref_key:"contentEl",ref:o,class:"content",content:n.preview.content,minLevel:a.value,tag:d.value},null,8,["content","minLevel","tag"])])):($(),O("div",xj,T(w(s)("settings.logging.noContent")),1)),_("div",Ej,[_("div",Pj,[_("span",Lj,T(w(s)("settings.logging.levelFilter")),1),_("div",Dj,[Pe(qn,{modelValue:a.value,options:w(Db),ariaLabel:w(s)("settings.logging.levelFilter"),"onUpdate:modelValue":v[0]||(v[0]=m=>a.value=m)},null,8,["modelValue","options","ariaLabel"])]),_("span",Ij,T(w(s)("settings.logging.tagFilter")),1),_("div",Mj,[Pe(qn,{modelValue:d.value,options:r.value,ariaLabel:w(s)("settings.logging.tagFilter"),"onUpdate:modelValue":v[1]||(v[1]=m=>d.value=m)},null,8,["modelValue","options","ariaLabel"])])]),_("button",{onClick:v[2]||(v[2]=m=>i("refresh"))},T(w(s)("common.refresh")),1),_("button",{onClick:h,disabled:!n.preview.content},T(w(s)("common.copy")),9,Aj),_("button",{class:"primary",onClick:v[3]||(v[3]=m=>i("close"))},T(w(s)("common.close")),1)])])]))}}),Oj=kt($j,[["__scopeId","data-v-b060bffd"]]),Fj={class:"settings-dialog"},Bj={class:"settings-header"},Hj=["disabled"],Nj={class:"settings-body"},Uj={class:"settings-nav"},zj=["innerHTML"],Vj={class:"nav-label"},Kj=["innerHTML"],Wj={class:"nav-label"},jj=["innerHTML"],qj={class:"nav-label"},Yj=["innerHTML"],Gj={class:"nav-label"},Xj=["innerHTML"],Jj={class:"nav-label"},Zj=["innerHTML"],Qj={class:"nav-label"},eq=["innerHTML"],tq={class:"nav-label"},nq=["innerHTML"],iq={class:"nav-label"},sq=["innerHTML"],rq={class:"nav-label"},oq=["innerHTML"],aq={class:"nav-label"},lq=["innerHTML"],cq={class:"nav-label"},dq=["innerHTML"],uq={class:"nav-label"},hq=["innerHTML"],fq={class:"nav-label"},pq=["innerHTML"],vq={class:"nav-label"},gq=["innerHTML"],mq={class:"nav-label"},_q={class:"settings-pane"},yq={class:"settings-pane-header"},bq={class:"settings-pane-title"},wq={key:0,class:"settings-pane-subtitle"},Sq={key:9,class:"diag-merged"},Cq={key:0,class:"merged-section"},kq={class:"merged-section-title"},xq={class:"merged-section"},Rq={key:0,class:"merged-section-title"},Tq={class:"merged-section"},Eq={class:"merged-section-title"},Pq={key:0,class:"settings-footer"},Lq=["disabled"],Dq=["disabled"],Iq={class:"version-footer","data-testid":"settings-version-footer"},Mq={class:"discard-dialog"},Aq={class:"discard-row"},gi='viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"',$q=$e({__name:"SettingsDialog",props:{localSessionCount:{},remoteSessionCount:{},terminalThemeId:{},initialTab:{}},emits:["close","relay-config-changed","terminal-theme-changed","command-notify-threshold-changed","appearance-changed","direct-connection-changed","bindings-changed","profiles-changed","session-created"],setup(e,{emit:t}){const n=fn(),i=n.caps,{t:s,resolvedLocale:a}=Ot(),d={general:{labelKey:"settings.tabs.general",english:"General preferences"},account:{labelKey:"settings.account.title",english:"Account"},tasks:{labelKey:"tasks.settings.section",english:"Tasks display"},relay:{labelKey:"settings.tabs.relay",english:"Relay"},plugins:{labelKey:"settings.tabs.plugins",english:"Plugins"},shortcuts:{labelKey:"settings.tabs.shortcuts",english:"Keyboard shortcuts"},templates:{labelKey:"settings.templates.tab",english:"Quick templates"},profiles:{labelKey:"settings.profiles.tab",english:"Session profiles"},logging:{labelKey:"settings.tabs.logging",english:"Logging"},updates:{labelKey:"settings.tabs.updates",english:"Updates"},diagnostics:{labelKey:"settings.diagnostics.tab",english:"Diagnostics"},feishu:{labelKey:"settings.feishu.title",english:"Feishu integration"},devices:{labelKey:"settings.tabs.devices",english:"Signed-in devices"},"received-files":{labelKey:"settings.tabs.receivedFiles",english:"Received files"},"mobile-profiles":{labelKey:"settings.tabs.mobileProfiles",english:"Synced profiles"},"mobile-hosts":{labelKey:"settings.tabs.mobileHosts",english:"SSH hosts"}},r=W(()=>s(d[m.value].labelKey)),o=W(()=>a.value==="zh-CN"?d[m.value].english:""),c={general:``,account:``,tasks:``,relay:``,plugins:``,shortcuts:``,templates:``,profiles:``,updates:``,diagnostics:``,feishu:``,devices:``,"received-files":``,"mobile-profiles":``,"mobile-hosts":``},h=e,u=t,v=h.initialTab==="logging"?"diagnostics":h.initialTab??"general",m=F(v),b=new Set;i.autoUpdate||b.add("updates"),i.pluginHost||(b.add("plugins"),b.add("shortcuts")),i.wailsBindings&&b.add("account"),i.wailsBindings||(b.add("relay"),b.add("diagnostics"),b.add("received-files"),b.add("feishu"),b.add("profiles")),i.capacitor||(b.add("mobile-profiles"),b.add("mobile-hosts")),b.has(m.value)&&(m.value="general");const g=F(Us(h.terminalThemeId).id);wt(()=>h.terminalThemeId,Z=>{g.value=Us(Z).id});const l=F(null),f=F(!1),p=F(null),y=F(!1),C=F(null),k=F(""),E=F(!1),I=F(!1),S=F(!1),P=F(""),A=F(""),L=W(()=>{const Z=A.value.trim();return!Z||Z==="dev"?"AT Term (dev)":`AT Term ${Z.startsWith("v")?Z:`v${Z}`}`});It(async()=>{if(i.wailsBindings)try{const Z=await Qm();g.value=Us(Z).id}catch{}}),It(async()=>{try{A.value=await n.system.getAppVersion()}catch{}});function x(Z){if(m.value!==Z){if(m.value==="relay"&&f.value){p.value=Z,y.value=!0;return}m.value=Z}}function D(){y.value=!1,p.value&&(m.value=p.value,p.value=null),f.value=!1}function M(){y.value=!1,p.value=null}function B(){var Z;(Z=l.value)!=null&&Z.saving||u("close")}function z(Z){f.value=Z}function Y(){f.value=!1,u("relay-config-changed")}function U(Z){g.value=Us(Z).id,u("terminal-theme-changed",Z)}function N(Z){u("command-notify-threshold-changed",Z)}function V(Z){u("appearance-changed",Z)}function j(Z){u("bindings-changed",Z)}function G(){u("profiles-changed")}async function te(){I.value=!0,await se()}async function se(){k.value="",E.value=!0;try{C.value=await Zm()}catch(Z){k.value=(Z==null?void 0:Z.message)??String(Z)}finally{E.value=!1}}function oe(Z){P.value=Z,S.value=!0}async function Fe(){S.value=!1;try{await qm()}catch{}}function K(){var Z;(Z=l.value)==null||Z.save()}return(Z,J)=>{var ae,Ie,de,Le;return $(),O("div",{class:"backdrop",onClick:pt(B,["self"])},[_("div",Fj,[_("header",Bj,[_("h2",null,T(w(s)("settings.title")),1),w(i).wailsBindings?($(),Ct(cj,{key:0,class:"header-sync-indicator"})):Q("",!0),_("button",{class:"close-btn",onClick:B,disabled:(ae=l.value)==null?void 0:ae.saving},"×",8,Hj)]),_("div",Nj,[_("aside",Uj,[_("button",{class:nt(["settings-nav-item",{active:m.value==="general"}]),onClick:J[0]||(J[0]=xe=>x("general"))},[_("span",{class:"nav-icon",innerHTML:c.general},null,8,zj),_("span",Vj,T(w(s)("settings.tabs.general")),1)],2),w(i).wailsBindings?Q("",!0):($(),O("button",{key:0,class:nt(["settings-nav-item",{active:m.value==="account"}]),onClick:J[1]||(J[1]=xe=>x("account"))},[_("span",{class:"nav-icon",innerHTML:c.account},null,8,Kj),_("span",Wj,T(w(s)("settings.account.title")),1)],2)),_("button",{class:nt(["settings-nav-item",{active:m.value==="tasks"}]),onClick:J[2]||(J[2]=xe=>x("tasks"))},[_("span",{class:"nav-icon",innerHTML:c.tasks},null,8,jj),_("span",qj,T(w(s)("tasks.settings.section")),1)],2),w(i).wailsBindings?($(),O("button",{key:1,class:nt(["settings-nav-item",{active:m.value==="relay"}]),onClick:J[3]||(J[3]=xe=>x("relay"))},[_("span",{class:"nav-icon",innerHTML:c.relay},null,8,Yj),_("span",Gj,T(w(s)("settings.tabs.relay")),1)],2)):Q("",!0),_("button",{class:nt(["settings-nav-item",{active:m.value==="devices"}]),onClick:J[4]||(J[4]=xe=>x("devices"))},[_("span",{class:"nav-icon",innerHTML:c.devices},null,8,Xj),_("span",Jj,T(w(s)("settings.tabs.devices")),1)],2),w(i).capacitor?($(),O("button",{key:2,class:nt(["settings-nav-item",{active:m.value==="mobile-profiles"}]),onClick:J[5]||(J[5]=xe=>x("mobile-profiles"))},[_("span",{class:"nav-icon",innerHTML:c["mobile-profiles"]},null,8,Zj),_("span",Qj,T(w(s)("settings.tabs.mobileProfiles")),1)],2)):Q("",!0),w(i).capacitor?($(),O("button",{key:3,class:nt(["settings-nav-item",{active:m.value==="mobile-hosts"}]),onClick:J[6]||(J[6]=xe=>x("mobile-hosts"))},[_("span",{class:"nav-icon",innerHTML:c["mobile-hosts"]},null,8,eq),_("span",tq,T(w(s)("settings.tabs.mobileHosts")),1)],2)):Q("",!0),w(i).pluginHost?($(),O("button",{key:4,class:nt(["settings-nav-item",{active:m.value==="plugins"}]),onClick:J[7]||(J[7]=xe=>x("plugins"))},[_("span",{class:"nav-icon",innerHTML:c.plugins},null,8,nq),_("span",iq,T(w(s)("settings.tabs.plugins")),1)],2)):Q("",!0),w(i).pluginHost?($(),O("button",{key:5,class:nt(["settings-nav-item",{active:m.value==="shortcuts"}]),onClick:J[8]||(J[8]=xe=>x("shortcuts"))},[_("span",{class:"nav-icon",innerHTML:c.shortcuts},null,8,sq),_("span",rq,T(w(s)("settings.tabs.shortcuts")),1)],2)):Q("",!0),_("button",{class:nt(["settings-nav-item",{active:m.value==="templates"}]),onClick:J[9]||(J[9]=xe=>x("templates"))},[_("span",{class:"nav-icon",innerHTML:c.templates},null,8,oq),_("span",aq,T(w(s)("settings.templates.tab")),1)],2),w(i).wailsBindings?($(),O("button",{key:6,class:nt(["settings-nav-item",{active:m.value==="profiles"}]),onClick:J[10]||(J[10]=xe=>x("profiles"))},[_("span",{class:"nav-icon",innerHTML:c.profiles},null,8,lq),_("span",cq,T(w(s)("settings.profiles.tab")),1)],2)):Q("",!0),w(i).autoUpdate?($(),O("button",{key:7,class:nt(["settings-nav-item",{active:m.value==="updates"}]),onClick:J[11]||(J[11]=xe=>x("updates"))},[_("span",{class:"nav-icon",innerHTML:c.updates},null,8,dq),_("span",uq,T(w(s)("settings.tabs.updates")),1)],2)):Q("",!0),w(i).wailsBindings?($(),O("button",{key:8,class:nt(["settings-nav-item",{active:m.value==="diagnostics"}]),onClick:J[12]||(J[12]=xe=>x("diagnostics"))},[_("span",{class:"nav-icon",innerHTML:c.diagnostics},null,8,hq),_("span",fq,T(w(s)("settings.diagnostics.tab")),1)],2)):Q("",!0),w(i).wailsBindings?($(),O("button",{key:9,class:nt(["settings-nav-item",{active:m.value==="feishu"}]),onClick:J[13]||(J[13]=xe=>x("feishu"))},[_("span",{class:"nav-icon",innerHTML:c.feishu},null,8,pq),_("span",vq,T(w(s)("settings.feishu.title")),1)],2)):Q("",!0),w(i).wailsBindings?($(),O("button",{key:10,class:nt(["settings-nav-item",{active:m.value==="received-files"}]),onClick:J[14]||(J[14]=xe=>x("received-files"))},[_("span",{class:"nav-icon",innerHTML:c["received-files"]},null,8,gq),_("span",mq,T(w(s)("settings.tabs.receivedFiles")),1)],2)):Q("",!0)]),_("section",_q,[_("header",yq,[_("h3",bq,T(r.value),1),o.value?($(),O("span",wq,T(o.value),1)):Q("",!0)]),ct(Pe(DB,{"terminal-theme-id":g.value,onTerminalThemeChanged:U,onCommandNotifyThresholdChanged:N,onAppearanceChanged:V},null,8,["terminal-theme-id"]),[[Ci,m.value==="general"]]),!w(i).wailsBindings&&m.value==="account"?($(),Ct(O8,{key:0})):Q("",!0),ct(Pe(gV,null,null,512),[[Ci,m.value==="tasks"]]),w(i).wailsBindings?ct(($(),Ct(IN,{key:1,ref_key:"relayRef",ref:l,onDirty:z,onRelayConfigChanged:Y,onDirectConnectionChanged:J[15]||(J[15]=xe=>u("direct-connection-changed",xe))},null,512)),[[Ci,m.value==="relay"]]):Q("",!0),w(i).autoUpdate?ct(($(),Ct(q7,{key:2,onRequestInstall:oe},null,512)),[[Ci,m.value==="updates"]]):Q("",!0),w(i).pluginHost?ct(($(),Ct(yU,{key:3},null,512)),[[Ci,m.value==="plugins"]]):Q("",!0),w(i).pluginHost?ct(($(),Ct(WU,{key:4,onBindingsChanged:j},null,512)),[[Ci,m.value==="shortcuts"]]):Q("",!0),m.value==="templates"?($(),Ct(k9,{key:5})):Q("",!0),m.value==="profiles"&&w(i).wailsBindings?($(),Ct(nV,{key:6,onProfilesChanged:G})):Q("",!0),m.value==="mobile-profiles"&&w(i).capacitor?($(),Ct(LW,{key:7,onSessionCreated:J[16]||(J[16]=xe=>u("session-created",xe))})):Q("",!0),m.value==="mobile-hosts"&&w(i).capacitor?($(),Ct(XW,{key:8})):Q("",!0),m.value==="diagnostics"&&w(i).wailsBindings?($(),O("div",Sq,[w(i).fileDialog?($(),O("section",Cq,[_("h4",kq,T(w(s)("settings.tabs.logging")),1),Pe(_7,{onOpenLogViewer:te})])):Q("",!0),_("section",xq,[w(i).fileDialog?($(),O("h4",Rq,T(w(s)("settings.diagnostics.section")),1)):Q("",!0),Pe(QU)]),_("section",Tq,[_("h4",Eq,T(w(s)("settings.configio.title")),1),Pe(Lz)])])):Q("",!0),m.value==="feishu"&&w(i).wailsBindings?($(),Ct(vK,{key:10})):Q("",!0),m.value==="devices"?($(),Ct(MK,{key:11})):Q("",!0),m.value==="received-files"&&w(i).wailsBindings?($(),Ct(QK,{key:12})):Q("",!0)])]),m.value==="relay"?($(),O("footer",Pq,[_("button",{onClick:B,disabled:(Ie=l.value)==null?void 0:Ie.saving},T(w(s)("common.cancel")),9,Lq),_("button",{class:"primary",disabled:!((de=l.value)!=null&&de.canSave),onClick:K},T(((Le=l.value)==null?void 0:Le.saveLabel)??w(s)("settings.relay.saveConnect")),9,Dq)])):Q("",!0),_("footer",Iq,T(L.value),1)]),y.value?($(),O("div",{key:0,class:"discard-backdrop",onClick:pt(M,["self"])},[_("div",Mq,[_("h3",null,T(w(s)("settings.discardRelayTitle")),1),_("p",null,T(w(s)("settings.discardRelayBody")),1),_("div",Aq,[_("button",{onClick:M},T(w(s)("common.stay")),1),_("button",{class:"danger",onClick:D},T(w(s)("common.discard")),1)])])])):Q("",!0),S.value?($(),Ct(yj,{key:1,version:P.value,"local-count":h.localSessionCount,"remote-count":h.remoteSessionCount,onConfirm:Fe,onCancel:J[17]||(J[17]=xe=>S.value=!1)},null,8,["version","local-count","remote-count"])):Q("",!0),I.value?($(),Ct(Oj,{key:2,preview:C.value??{path:"",exists:!1,truncated:!1,content:""},loading:E.value,error:k.value,onRefresh:se,onClose:J[18]||(J[18]=xe=>I.value=!1)},null,8,["preview","loading","error"])):Q("",!0)])}}}),Oq=kt($q,[["__scopeId","data-v-6ddc3008"]]);function Ub(e){if(!e||typeof e!="object")return null;const t=e,n=typeof t.Fingerprint=="string"?t.Fingerprint:"",i=typeof t.Host=="string"?t.Host:"";if(!n||!i)return null;const s=typeof t.HopIndex=="number"&&t.HopIndex>0?t.HopIndex:0,a=typeof t.HopName=="string"?t.HopName:"";return{fingerprint:n,host:i,hopIndex:s,hopName:a}}const Fq={class:"dialog"},Bq={class:"row"},Hq={class:"inline"},Nq={class:"inline"},Uq={key:0},zq={key:2,class:"tofu","data-test":"ssh-tofu"},Vq={key:3,class:"error","data-test":"ssh-error"},Kq={class:"row end"},Wq=["disabled"],jq=$e({__name:"NewSshDialog",emits:["connected","cancel"],setup(e,{emit:t}){const n=t,i=F(""),s=F("22"),a=F(""),d=F("password"),r=F(""),o=F(""),c=F(""),h=F(!1),u=F(""),v=F(null);function m(g){return{host:i.value,port:s.value||"22",user:a.value,auth_kind:d.value,password:d.value==="password"?r.value:void 0,private_key:d.value==="key"?o.value:void 0,passphrase:d.value==="key"?c.value:void 0,accepted_host_key_host:g==null?void 0:g.host,accepted_host_key_fingerprint:g==null?void 0:g.fingerprint}}async function b(g){if(!h.value){h.value=!0,u.value="";try{const l=await xC(m(g));v.value=null,n("connected",l.session_id)}catch(l){const f=Ub(l);f?v.value=f:(v.value=null,u.value=l instanceof Error?l.message:String(l))}finally{h.value=!1}}}return(g,l)=>($(),O("div",{class:"backdrop",onClick:l[11]||(l[11]=pt(f=>g.$emit("cancel"),["self"]))},[_("div",Fq,[l[21]||(l[21]=_("h2",null,"New SSH Connection",-1)),_("label",null,[l[12]||(l[12]=et("Host ")),ct(_("input",{"data-test":"ssh-host","onUpdate:modelValue":l[0]||(l[0]=f=>i.value=f),autocomplete:"off"},null,512),[[Et,i.value]])]),_("label",null,[l[13]||(l[13]=et("Port ")),ct(_("input",{"data-test":"ssh-port","onUpdate:modelValue":l[1]||(l[1]=f=>s.value=f),autocomplete:"off"},null,512),[[Et,s.value]])]),_("label",null,[l[14]||(l[14]=et("User ")),ct(_("input",{"data-test":"ssh-user","onUpdate:modelValue":l[2]||(l[2]=f=>a.value=f),autocomplete:"off"},null,512),[[Et,a.value]])]),_("div",Bq,[_("label",Hq,[ct(_("input",{type:"radio",value:"password","onUpdate:modelValue":l[3]||(l[3]=f=>d.value=f),"data-test":"ssh-auth-password"},null,512),[[ou,d.value]]),l[15]||(l[15]=et(" Password "))]),_("label",Nq,[ct(_("input",{type:"radio",value:"key","onUpdate:modelValue":l[4]||(l[4]=f=>d.value=f),"data-test":"ssh-auth-key"},null,512),[[ou,d.value]]),l[16]||(l[16]=et(" Private key "))])]),d.value==="password"?($(),O("label",Uq,[l[17]||(l[17]=et("Password ")),ct(_("input",{"data-test":"ssh-password",type:"password","onUpdate:modelValue":l[5]||(l[5]=f=>r.value=f),autocomplete:"off"},null,512),[[Et,r.value]])])):($(),O(Me,{key:1},[_("label",null,[l[18]||(l[18]=et("Private key (PEM) ")),ct(_("textarea",{"data-test":"ssh-private-key","onUpdate:modelValue":l[6]||(l[6]=f=>o.value=f),rows:"4"},null,512),[[Et,o.value]])]),_("label",null,[l[19]||(l[19]=et("Passphrase (optional) ")),ct(_("input",{"data-test":"ssh-passphrase",type:"password","onUpdate:modelValue":l[7]||(l[7]=f=>c.value=f),autocomplete:"off"},null,512),[[Et,c.value]])])],64)),v.value?($(),O("div",zq,[l[20]||(l[20]=_("p",{class:"warn"},"Unknown host key. Verify this fingerprint before trusting it:",-1)),_("code",null,T(v.value.fingerprint),1),_("button",{class:"primary","data-test":"ssh-accept-hostkey",onClick:l[8]||(l[8]=f=>b(v.value))}," Accept & Connect ")])):Q("",!0),u.value?($(),O("p",Vq,T(u.value),1)):Q("",!0),_("div",Kq,[_("button",{onClick:l[9]||(l[9]=f=>g.$emit("cancel"))},"Cancel"),_("button",{class:"primary","data-test":"ssh-connect",disabled:h.value,onClick:l[10]||(l[10]=f=>b(null))}," Connect ",8,Wq)])])]))}}),qq=kt(jq,[["__scopeId","data-v-c791c224"]]),Yq=256*1024,Gq=/-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----/;function Xq(e){return Gq.test(e)}const kg="openssh-key-v1\0";function Jq(e){if(!e)return!1;if(e.includes("ENCRYPTED PRIVATE KEY")||/^\s*Proc-Type:\s*4,ENCRYPTED/m.test(e))return!0;if(!e.includes("BEGIN OPENSSH PRIVATE KEY"))return!1;const t=Zq(e);return t!==null&&t!=="none"}function Zq(e){const t=e.replace(/-----BEGIN [^-]*-----/g,"").replace(/-----END [^-]*-----/g,"").replace(/\s+/g,"");if(t==="")return null;let n;try{n=atob(t)}catch{return null}if(!n.startsWith(kg))return null;const i=kg.length;if(n.length{const i=new FileReader;i.onload=()=>t(String(i.result??"")),i.onerror=()=>n(i.error??new Error("could not read file")),i.readAsText(e)})}async function tY(e){if(e.size>Yq)throw new Error(`${e.name} is too large to be a private key.`);const t=await eY(e);if(!Xq(t))throw new Error(`${e.name} is not a private key file.`);return{pem:t,suggestedName:nY(e.name),encrypted:Jq(t)}}function nY(e){const t=e.split(/[/\\]/).pop()??"",n=t.toLowerCase();for(const i of Qq)if(n.endsWith(i)&&t.length>i.length)return t.slice(0,-i.length);return t}const iY="22";function sY(e){const t=e.user.trim(),n=e.host.trim(),i=(e.port??"").trim(),s=i!==""&&i!==iY?`-p ${i} `:"",a=t===""?n:`${t}@${n}`;return`ssh ${s}${a}`}const nh=e=>e.trim().toLowerCase();function bc(e){const t=new Set,n=[];for(const i of e){const s=i.trim();if(s==="")continue;const a=nh(s);t.has(a)||(t.add(a),n.push(s))}return n}function rY(e){return bc(e.split(","))}function oY(e){return bc(e.flatMap(n=>n.tags??[])).sort((n,i)=>n.localeCompare(i))}function aY(e,t){if(t.length===0)return!0;const n=new Set((e??[]).map(nh));return t.every(i=>n.has(nh(i)))}const lY={class:"ssh-shell"},cY={class:"ssh-header"},dY={class:"tabs"},uY={class:"tab-count"},hY={class:"tab-count"},fY={class:"tab-count"},pY={key:0,class:"search"},vY=["placeholder"],gY={key:1,class:"search-spacer"},mY=["disabled","title"],_Y=["title"],yY={key:0,class:"ssh-error","data-test":"ssh-hosts-error"},bY={key:1,class:"ssh-tofu","data-test":"ssh-host-tofu"},wY={class:"tofu-title"},SY={class:"tofu-msg"},CY={class:"tofu-fp"},kY={key:0,class:"tofu-note"},xY={class:"tofu-actions"},RY={key:2,class:"ssh-success","data-test":"ssh-config-import-result"},TY={class:"ssh-body"},EY={key:0,class:"empty"},PY={class:"empty-title"},LY={class:"empty-sub"},DY={key:0,class:"tag-bar","data-test":"ssh-tag-filter-bar"},IY=["data-test","onClick"],MY={key:1,class:"empty","data-test":"ssh-hosts-no-match"},AY={class:"empty-title"},$Y={class:"empty-sub"},OY={key:2,class:"card-grid"},FY=["data-test","onDblclick","onContextmenu"],BY={class:"card-glyph"},HY={class:"card-main"},NY={class:"card-label"},UY={class:"card-sub"},zY={key:0,class:"card-proxy"},VY=["data-test","title"],KY={key:1,class:"card-tags"},WY=["data-test"],jY={class:"card-actions"},qY=["data-test","disabled","title","onClick"],YY=["title","onClick"],GY=["data-test","title","onClick"],XY={class:"ssh-body"},JY={key:0,class:"empty"},ZY={class:"empty-title"},QY={class:"empty-sub"},eG={key:1,class:"card-grid"},tG={class:"card-glyph"},nG={class:"card-main"},iG={class:"card-label"},sG={class:"card-sub"},rG={class:"card-actions"},oG=["data-test","title","onClick"],aG=["data-test","title","onClick"],lG={class:"ssh-body"},cG={key:0,class:"empty","data-test":"ssh-tunnels-empty"},dG={class:"empty-title"},uG={class:"empty-sub"},hG=["data-test"],fG={class:"fwd-host-head"},pG={class:"fwd-host-name"},vG={class:"fwd-host-sub"},gG=["data-test","title"],mG=["data-test"],_G={class:"card-grid"},yG=["data-test"],bG={class:"card-glyph"},wG={class:"card-main"},SG={class:"card-label"},CG={class:"fwd-kind"},kG={key:0,class:"fwd-note"},xG={class:"card-sub fwd-route"},RG={key:0,class:"fwd-row-conns"},TG=["data-test"],EG={class:"fwd-card-side"},PG=["data-test"],LG={class:"card-actions"},DG=["data-test","title","disabled","onClick"],IG=["data-test","title","disabled","onClick"],MG=["data-test","title","disabled","onClick"],AG=["data-test","title","onClick"],$G=["data-test","title","onClick"],OG={key:0,class:"drawer"},FG={class:"drawer-head"},BG={class:"drawer-body"},HG={class:"field"},NG={class:"fl"},UG=["placeholder"],zG={class:"field-row"},VG={class:"field grow"},KG={class:"fl"},WG=["placeholder"],jG={class:"field port"},qG={class:"fl"},YG={class:"field tag-field"},GG={class:"fl"},XG={class:"tag-editor"},JG=["data-test"],ZG=["data-test","title","onClick"],QG=["placeholder","onKeydown"],eX={key:0,class:"combo-menu","data-test":"ssh-tag-menu"},tX=["data-test","onMousedown"],nX={class:"field"},iX={class:"fl"},sX=["placeholder"],rX={class:"seg"},oX={key:0,class:"identity-hint","data-test":"ssh-host-identity-file"},aX={class:"fl"},lX={class:"hint"},cX={key:1,class:"identity-hint proxy","data-test":"ssh-host-drawer-proxy"},dX={key:2,class:"field"},uX={class:"fl"},hX={key:0},fX={key:0,class:"field"},pX={class:"fl"},vX={"data-test":"ssh-add-keyid"},gX={key:1,class:"empty-keys-hint"},mX={class:"hint"},_X={class:"fwd-section","data-test":"ssh-startup-section"},yX={class:"fwd-section-head"},bX={class:"fl"},wX={class:"hint"},SX={class:"field"},CX=["placeholder"],kX={class:"field-row"},xX={class:"field port"},RX={class:"fl"},TX=["placeholder"],EX={key:0,class:"hint grow","data-test":"ssh-startup-steps"},PX={class:"fwd-section","data-test":"ssh-forwards-section"},LX={class:"fwd-section-head"},DX={class:"fl"},IX={class:"hint"},MX={key:0,class:"hint","data-test":"ssh-forwards-none"},AX=["data-test"],$X={class:"fwd-rule-head"},OX={class:"seg sm"},FX=["data-test","onClick"],BX=["data-test","onClick"],HX=["data-test","onClick"],NX=["data-test","title","onClick"],UX={class:"hint"},zX={class:"field-row"},VX={class:"field grow"},KX={class:"fl"},WX=["data-test","onUpdate:modelValue"],jX={class:"field port"},qX={class:"fl"},YX=["data-test","onUpdate:modelValue"],GX={key:0,class:"field-row"},XX={class:"field grow"},JX={class:"fl"},ZX=["data-test","onUpdate:modelValue"],QX={class:"field port"},eJ={class:"fl"},tJ=["data-test","onUpdate:modelValue"],nJ={class:"field"},iJ={class:"fl"},sJ=["data-test","onUpdate:modelValue","placeholder"],rJ=["data-test"],oJ={class:"drawer-foot"},aJ=["disabled"],lJ={key:0,class:"drawer"},cJ={class:"drawer-head"},dJ={class:"drawer-body"},uJ={class:"field"},hJ={class:"fl"},fJ=["placeholder"],pJ={class:"field"},vJ={class:"fl pem-label"},gJ={key:0},mJ={key:0,class:"pem-tools"},_J=["disabled","title"],yJ=["title"],bJ={class:"field"},wJ={class:"fl"},SJ={key:0,class:"enc-hint","data-test":"ssh-key-encrypted-hint"},CJ={class:"import-block"},kJ={class:"drawer-foot"},xJ=["disabled"],RJ={key:0,class:"drawer","data-test":"ssh-tunnel-drawer"},TJ={class:"drawer-head"},EJ={class:"drawer-body"},PJ={class:"field"},LJ={class:"fl"},DJ={"data-test":"ssh-tunnel-host"},IJ={class:"hint"},MJ={class:"seg"},AJ={class:"hint"},$J={class:"field-row"},OJ={class:"field grow"},FJ={class:"fl"},BJ={class:"field port"},HJ={class:"fl"},NJ={key:0,class:"field-row"},UJ={class:"field grow"},zJ={class:"fl"},VJ={class:"field port"},KJ={class:"fl"},WJ={class:"field"},jJ={class:"fl"},qJ=["placeholder"],YJ={key:1,class:"fwd-warn","data-test":"ssh-tunnel-bind-warning"},GJ={class:"drawer-foot"},XJ=["disabled"],JJ=["disabled"],ZJ={key:0,class:"drawer wide","data-test":"ssh-config-import-drawer"},QJ={class:"drawer-head"},eZ={class:"drawer-body"},tZ={key:0,class:"empty","data-test":"ssh-config-import-loading"},nZ={class:"empty-sub"},iZ={key:1,class:"ssh-error inline","data-test":"ssh-config-import-error"},sZ={key:0,class:"empty","data-test":"ssh-config-import-empty"},rZ={class:"empty-title"},oZ={class:"empty-sub"},aZ={key:0,class:"config-section-title"},lZ={key:1,class:"config-entry-list"},cZ={class:"config-entry-label"},dZ=["data-test","checked","onChange"],uZ={class:"config-entry-main"},hZ={class:"config-entry-alias"},fZ={class:"config-entry-sub"},pZ={class:"config-entry-badges"},vZ=["data-test","title"],gZ=["data-test","title"],mZ={class:"config-section-title"},_Z={class:"config-skipped","data-test":"ssh-config-import-skipped"},yZ={class:"skip-alias"},bZ={class:"skip-reason"},wZ={class:"config-note"},SZ={class:"drawer-foot config-foot"},CZ={key:0,class:"ssh-error inline","data-test":"ssh-config-import-confirm-error"},kZ={class:"foot-actions"},xZ=["disabled"],RZ=3e3,TZ=$e({__name:"SshHostsPanel",emits:["connected","close"],setup(e,{emit:t}){var Rr,Xr;const n=t,{t:i}=Ot(),s=F("hosts"),a=F([]),d=F([]),r=F(""),o=F(""),c=F("");async function h(){[a.value,d.value]=await Promise.all([Nm(),DC()])}function u(le){le.preventDefault()}let v;It(()=>{window.addEventListener("dragover",u),window.addEventListener("drop",u),h(),pe(),v=setInterval(()=>void pe(),RZ)}),Vt(()=>{window.removeEventListener("dragover",u),window.removeEventListener("drop",u),v!==void 0&&clearInterval(v)});const m=F([]),b=W(()=>oY(a.value)),g=W(()=>{const le=o.value.trim().toLowerCase();return a.value.filter(ve=>aY(ve.tags,m.value)?le===""?!0:`${ve.alias??""} ${ve.host} ${ve.user} ${(ve.tags??[]).join(" ")}`.toLowerCase().includes(le):!1)});function l(le){const ve=m.value.indexOf(le);m.value=ve>=0?m.value.filter(ge=>ge!==le):[...m.value,le]}function f(){m.value=[]}const p=W(()=>d.value.map(le=>({value:le.id,label:le.key_type?`${le.name} (${le.key_type})`:le.name}))),y=F(!1),C=W(()=>{const le=ue.value.trim().toLowerCase(),ve=new Set(ne.value.map(ge=>ge.toLowerCase()));return b.value.filter(ge=>!ve.has(ge.toLowerCase())&&(le===""||ge.toLowerCase().includes(le)))});function k(le){ne.value=bc([...ne.value,...le])}function E(){k(rY(ue.value)),ue.value=""}function I(le){k([le]),ue.value="",y.value=!1}function S(le){ne.value=ne.value.filter(ve=>ve!==le)}function P(){ue.value===""&&(ne.value=ne.value.slice(0,-1))}function A(){E(),window.setTimeout(()=>y.value=!1,120)}function L(le){var ve;return((ve=le.alias)==null?void 0:ve.trim())||`${le.user}@${le.host}`}function x(le){const ve=le.port&&le.port!=="22"?`:${le.port}`:"",ge=le.auth_kind==="key"?i("ssh.subtitleAuthKey"):i("ssh.subtitleAuthPassword");return`${le.user}@${le.host}${ve} · ${ge}`}function D(le){return!!le.proxy_command}function M(le){return!!(le.proxy_jump||le.proxy_command)}function B(le){return D(le)?i("ssh.proxy.commandBadge"):i("ssh.proxy.jumpBadge",{target:le.proxy_jump??""})}function z(le){return D(le)?i("ssh.proxy.commandReason",{command:le.proxy_command??""}):le.proxy_jump?i("ssh.proxy.jumpReason",{target:le.proxy_jump}):""}const Y=F(null);function U(le){return(le.alias??"").trim()||(le.host??"").trim()}const N=W(()=>{const le=Y.value;if(!le)return"";const{prompt:ve}=le;if(ve.hopIndex===0)return i("ssh.hostKey.direct");const ge=U(le.host);return ve.hopName===ge?i("ssh.hostKey.targetHop",{target:ge,hop:ve.hopIndex}):i("ssh.hostKey.jumpHop",{name:ve.hopName,hop:ve.hopIndex,target:ge})});function V(){const le=Y.value;le&&G(le.host.id,{host:le.prompt.host,fingerprint:le.prompt.fingerprint})}function j(){Y.value=null}async function G(le,ve={host:"",fingerprint:""}){if(c.value)return;r.value="";const ge=a.value.find(Oe=>Oe.id===le);if(ge&&D(ge)){r.value=z(ge);return}c.value=le;try{const Oe=await Hm(le,ve);Y.value=null,n("connected",Oe.session_id)}catch(Oe){const Nt=Ub(Oe);if(Nt&&ge){Y.value={host:ge,prompt:Nt};return}Y.value=null,r.value=Oe instanceof Error?Oe.message:String(Oe)}finally{c.value=""}}const te=F({open:!1,x:0,y:0,host:null}),se=W(()=>[{key:"connect",label:i("ssh.hosts.menuConnect")},{key:"edit",label:i("ssh.hosts.menuEdit")},{key:"duplicate",label:i("ssh.hosts.menuDuplicate")},{key:"copy-ssh",label:i("ssh.hosts.menuCopySsh")},{key:"remove",label:i("ssh.hosts.menuRemove"),separatorBefore:!0}]);function oe(le,ve){te.value={open:!0,x:le.clientX,y:le.clientY,host:ve}}function Fe(){te.value={...te.value,open:!1,host:null}}async function K(le){const ve=te.value.host;if(ve)switch(le){case"connect":await G(ve.id);break;case"edit":Se(ve);break;case"duplicate":await Z(ve);break;case"copy-ssh":await J(ve);break;case"remove":await Ne(ve.id);break}}async function Z(le){var ge;r.value="";const ve={...le,id:"",alias:(ge=le.alias)!=null&&ge.trim()?`${le.alias.trim()} copy`:""};try{const Oe=await ip(ve,{});await h(),le.auth_kind==="password"&&Se(Oe??ve)}catch(Oe){r.value=Oe instanceof Error?Oe.message:String(Oe)}}async function J(le){const ve=sY({user:le.user,host:le.host,port:le.port}),ge=typeof navigator>"u"?void 0:navigator.clipboard;if(ge!=null&&ge.writeText){await ge.writeText(ve);return}Ma(ve)}const ae=F(!1),Ie=F(null),de=F(null),Le=F(""),xe=F(""),Qe=F("22"),De=F(""),ne=F([]),ue=F(""),he=F("password"),Ae=F(""),ce=F(""),Je=F(""),ye=F("");function _e(){const le=Number.parseInt(ye.value.trim(),10);return Number.isFinite(le)&&le>0?le:0}const Ce=W(()=>Je.value.split(` +`).filter(le=>le.trim()!=="").length);function Be(){var le;Ie.value="",de.value=null,Le.value="",xe.value="",Qe.value="22",De.value="",ne.value=[],ue.value="",he.value="password",Ae.value="",ce.value=((le=d.value[0])==null?void 0:le.id)??"",Je.value="",ye.value="",ot.value=[],ae.value=!0}function Se(le){var ve;Ie.value=le.id,de.value={...le},Le.value=le.alias??"",xe.value=le.host,Qe.value=le.port||"22",De.value=le.user,ne.value=bc(le.tags??[]),ue.value="",he.value=le.auth_kind,Ae.value="",ce.value=le.key_id??((ve=d.value[0])==null?void 0:ve.id)??"",Je.value=le.startup_command??"",ye.value=le.startup_delay_ms?String(le.startup_delay_ms):"",ot.value=Rt(le.forwards),ae.value=!0}function R(){ae.value=!1,Ie.value=null,de.value=null}const we=W(()=>xe.value.trim()===""||De.value.trim()===""?!1:he.value==="key"?ce.value!=="":!0);async function ht(){if(!we.value)return;r.value="";const le={alias:Le.value.trim(),host:xe.value.trim(),port:Qe.value.trim()||"22",user:De.value.trim(),tags:ne.value,auth_kind:he.value,key_id:he.value==="key"?ce.value:void 0,startup_command:Je.value,startup_delay_ms:_e(),forwards:Rt(ot.value)},ve={password:he.value==="password"?Ae.value:void 0},ge=he.value==="password"&&Ae.value!=="";try{Ie.value?await ud({...de.value??{},id:Ie.value,...le},ge?ve:null):await ip({id:"",...le},ve),R(),await h()}catch(Oe){r.value=Oe instanceof Error?Oe.message:String(Oe)}}async function Ne(le){r.value="";try{await RC(le),await h()}catch(ve){r.value=ve instanceof Error?ve.message:String(ve)}}const ot=F([]);function Rt(le){return(le??[]).map(ve=>({id:ve.id,kind:ve.kind,bind_addr:ve.bind_addr??"",bind_port:ve.bind_port??"",target_host:ve.target_host??"",target_port:ve.target_port??"",note:ve.note??""}))}function at(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`fwd-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function gt(){ot.value=[...ot.value,{id:at(),kind:"local",bind_addr:"127.0.0.1",bind_port:"",target_host:"",target_port:"",note:""}]}function re(le){ot.value=ot.value.filter(ve=>ve.id!==le)}function me(le,ve){le.kind=ve}function je(le){return i(le==="remote"?"ssh.forwards.kindRemoteHint":le==="dynamic"?"ssh.forwards.kindDynamicHint":"ssh.forwards.kindLocalHint")}function it(le){const ve=(le??"").trim().toLowerCase();if(ve===""||ve==="localhost"||ve==="::1"||ve==="[::1]")return!0;const ge=/^127\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(ve);return ge!==null&&ge.slice(1).every(Oe=>Number(Oe)<=255)}function dt(le){if(it(le.bind_addr))return"";const ve=(le.bind_addr??"").trim();return le.kind==="dynamic"?i("ssh.forwards.warnDynamic",{addr:ve}):le.kind==="remote"?i("ssh.forwards.warnRemote",{addr:ve}):i("ssh.forwards.warnLocal",{addr:ve})}const be=F([]),Ve=F("");function Xe(le,ve){return`${le}/${ve}`}async function pe(){try{be.value=await LC()??[]}catch{}}const Ge=W(()=>{const le=new Map;for(const ve of be.value)le.set(Xe(ve.host_id,ve.rule_id),ve);return le});function _t(le,ve){return Ge.value.get(Xe(le,ve))}function Te(le,ve){var ge;return((ge=_t(le,ve))==null?void 0:ge.running)===!0}const Ye=W(()=>a.value.filter(le=>{var ve;return(((ve=le.forwards)==null?void 0:ve.length)??0)>0})),ft=W(()=>be.value.filter(le=>le.running).length);function Dt(le){return i(le==="remote"?"ssh.forwards.kindRemote":le==="dynamic"?"ssh.forwards.kindDynamic":"ssh.forwards.kindLocal")}function Yt(le,ve){const ge=_t(le.id,ve.id);return ge!=null&&ge.running&&ge.listen_addr?ge.listen_addr:`${(ve.bind_addr??"").trim()||"127.0.0.1"}:${(ve.bind_port??"").trim()}`}function jt(le,ve){var Oe;const ge=_t(le.id,ve.id);return ge!=null&&ge.running?(Oe=ge.target)!=null&&Oe.trim()?ge.target:i("ssh.forwards.dynamicTarget"):ve.kind==="dynamic"?i("ssh.forwards.dynamicTarget"):`${(ve.target_host??"").trim()}:${(ve.target_port??"").trim()}`}function Xt(le,ve){const ge=_t(le.id,ve.id);return ge?ge.running?i("ssh.forwards.stateRunning"):i("ssh.forwards.stateStopped"):i("ssh.forwards.stateIdle")}function Ln(le,ve){const ge=_t(le.id,ve.id);return ge?ge.running?"running":"stopped":"idle"}async function On(le,ve){if(!(D(le)||Ve.value)){r.value="",Ve.value=Xe(le.id,ve.id);try{await PC(le.id,ve.id)}catch(ge){r.value=ge instanceof Error?ge.message:String(ge)}finally{Ve.value="",await pe()}}}async function rn(le,ve){if(!Ve.value){r.value="",Ve.value=Xe(le.id,ve.id);try{await sp(le.id,ve.id)}catch(ge){r.value=ge instanceof Error?ge.message:String(ge)}finally{Ve.value="",await pe()}}}function on(){s.value="tunnels",pe()}const Cn=F(!1),mn=F(""),Ut=F(""),nn=F(!1),Ft=F(null),an=W(()=>a.value.filter(le=>!D(le)).map(le=>({value:le.id,label:L(le)})));function ln(){var le;r.value="",Ut.value="",mn.value=((le=an.value[0])==null?void 0:le.value)??"",Ft.value={id:at(),kind:"local",bind_addr:"127.0.0.1",bind_port:"",target_host:"",target_port:"",note:""},Cn.value=!0}function bi(le,ve){r.value="",Ut.value=ve.id,mn.value=le.id,Ft.value=Rt([ve])[0],Cn.value=!0}function hi(){Cn.value=!1,Ft.value=null,Ut.value=""}const fi=W(()=>{const le=Ft.value;return!le||mn.value===""||(le.bind_port??"").trim()===""?!1:le.kind==="dynamic"?!0:(le.target_host??"").trim()!==""&&(le.target_port??"").trim()!==""});async function ei(){const le=Ft.value;if(!fi.value||!le||nn.value)return;const ve=a.value.find(si=>si.id===mn.value);if(!ve)return;r.value="",nn.value=!0;const ge=Rt([le])[0],Oe=Rt(ve.forwards),Nt=Oe.findIndex(si=>si.id===ge.id),qs=Nt>=0?Oe.map((si,Di)=>Di===Nt?ge:si):[...Oe,ge];try{return await ud({...ve,forwards:qs},null),await h(),hi(),{host:ve,rule:ge}}catch(si){r.value=si instanceof Error?si.message:String(si);return}finally{nn.value=!1}}async function Ee(){const le=await ei();le&&await On(le.host,le.rule)}async function Ze(le,ve){r.value="";try{_t(le.id,ve.id)&&await sp(le.id,ve.id),await ud({...le,forwards:Rt(le.forwards).filter(ge=>ge.id!==ve.id)},null),await h(),await pe()}catch(ge){r.value=ge instanceof Error?ge.message:String(ge)}}const mt=F(!1),At=F(null),Zt=F(""),Kt=F(""),Hn=F(""),Yn=F(!1),_n=F(!1),ti=F(!1);function Bi(){Zt.value="",Kt.value="",Hn.value="",Yn.value=!1,_n.value=!1,ti.value=!1}async function Hi(){if(!(!At.value||ti.value)){if(_n.value){_n.value=!1,Kt.value="",Hn.value="",Yn.value=!1;return}r.value="",ti.value=!0;try{const le=await rp(At.value);Kt.value=le.private_key,Hn.value=le.passphrase??"",_n.value=!0}catch(le){r.value=le instanceof Error?le.message:String(le)}finally{ti.value=!1}}}async function Ni(){if(At.value){r.value="";try{const le=_n.value?Kt.value:(await rp(At.value)).private_key,ve=typeof navigator>"u"?void 0:navigator.clipboard;ve!=null&&ve.writeText?await ve.writeText(le):Ma(le)}catch(le){r.value=le instanceof Error?le.message:String(le)}}}function Ei(){At.value="",Bi(),mt.value=!0}function cs(){R(),s.value="keys",Ei()}function ds(le){At.value=le.id,Bi(),Zt.value=le.name,mt.value=!0}function wr(){mt.value=!1,At.value=null}const Sr=F(((Xr=(Rr=window.matchMedia)==null?void 0:Rr.call(window,"(hover: hover) and (pointer: fine)"))==null?void 0:Xr.matches)??!0),Cr=F(null),us=F(!1);function Wo(){var le;(le=Cr.value)==null||le.click()}async function jo(le){var Oe;const ve=le.target,ge=(Oe=ve.files)==null?void 0:Oe[0];await js(ge),ve.value=""}async function Ws(le){var ve,ge;us.value=!1,await js((ge=(ve=le.dataTransfer)==null?void 0:ve.files)==null?void 0:ge[0])}async function js(le){if(le){r.value="";try{const ve=await tY(le);Kt.value=ve.pem,Yn.value=ve.encrypted,Zt.value.trim()===""&&(Zt.value=ve.suggestedName)}catch(ve){r.value=ve instanceof Error?ve.message:String(ve)}}}const kr=W(()=>Zt.value.trim()!==""&&(At.value?!0:Kt.value.trim()!==""));async function Gr(){if(kr.value){r.value="";try{At.value?await MC(At.value,Zt.value.trim(),Kt.value,Hn.value):await IC(Zt.value.trim(),Kt.value,Hn.value),wr(),await h()}catch(le){r.value=le instanceof Error?le.message:String(le)}}}async function Pi(le){r.value="";try{await AC(le),await h()}catch(ve){r.value=ve instanceof Error?ve.message:String(ve)}}const Es=F(!1),Ps=F(!1),wi=F(""),Xi=F(""),Si=F(null),ni=F(new Set),hs=F(!1),Ls=F(null),Ui=W(()=>{var le;return((le=Si.value)==null?void 0:le.entries)??[]}),En=W(()=>{var le;return((le=Si.value)==null?void 0:le.skipped)??[]}),xr=W(()=>new Set(a.value.map(le=>le.alias).filter(Boolean)));function Ji(le){return!!le.alias&&xr.value.has(le.alias)}function Ds(le){return{...le}}async function pi(){Es.value=!0,wi.value="",Xi.value="",Ls.value=null,Si.value=null,ni.value=new Set,Ps.value=!0;try{Si.value=await TC()}catch(le){wi.value=le instanceof Error?le.message:String(le)}finally{Ps.value=!1}}function ii(){Es.value=!1}function qo(le){const ve=new Set(ni.value);ve.has(le)?ve.delete(le):ve.add(le),ni.value=ve}const vi=W(()=>ni.value.size>0);async function Li(){if(!(!Si.value||ni.value.size===0)){hs.value=!0,Xi.value="";try{const le=Ui.value.filter((ge,Oe)=>ni.value.has(Oe)).map(Ds),ve=await EC(le);Ls.value=ve,Es.value=!1,await h()}catch(le){Xi.value=le instanceof Error?le.message:String(le)}finally{hs.value=!1}}}return(le,ve)=>($(),O("div",{class:"ssh-overlay",onClick:ve[32]||(ve[32]=pt(ge=>le.$emit("close"),["self"]))},[_("div",lY,[_("header",cY,[_("div",dY,[_("button",{class:nt(["tab",{on:s.value==="hosts"}]),"data-test":"ssh-tab-hosts",onClick:ve[0]||(ve[0]=ge=>s.value="hosts")},[Pe(w(co),{size:14}),et(" "+T(w(i)("ssh.tabHosts"))+" ",1),_("span",uY,T(a.value.length),1)],2),_("button",{class:nt(["tab",{on:s.value==="keys"}]),"data-test":"ssh-tab-keys",onClick:ve[1]||(ve[1]=ge=>s.value="keys")},[Pe(w(cl),{size:14}),et(" "+T(w(i)("ssh.tabKeys"))+" ",1),_("span",hY,T(d.value.length),1)],2),_("button",{class:nt(["tab",{on:s.value==="tunnels"}]),"data-test":"ssh-tab-tunnels",onClick:on},[Pe(w(_o),{size:14}),et(" "+T(w(i)("ssh.forwards.tab"))+" ",1),_("span",fY,T(ft.value),1)],2)]),s.value==="hosts"?($(),O("div",pY,[Pe(w(bm),{size:13,class:"search-icon"}),ct(_("input",{"onUpdate:modelValue":ve[2]||(ve[2]=ge=>o.value=ge),"data-test":"ssh-search",placeholder:w(i)("ssh.filterPlaceholder"),spellcheck:"false",autocomplete:"off"},null,8,vY),[[Et,o.value]])])):($(),O("div",gY)),s.value==="hosts"?($(),O("button",{key:2,class:"new-btn ghost","data-test":"ssh-config-import-open",onClick:pi},[Pe(w(Mf),{size:14}),et(" "+T(w(i)("ssh.configImport.open")),1)])):Q("",!0),s.value==="hosts"?($(),O("button",{key:3,class:"new-btn","data-test":"ssh-new-host",onClick:Be},[Pe(w(Xs),{size:14}),et(" "+T(w(i)("ssh.newHost")),1)])):s.value==="keys"?($(),O("button",{key:4,class:"new-btn","data-test":"ssh-key-new",onClick:Ei},[Pe(w(Xs),{size:14}),et(" "+T(w(i)("ssh.newKey")),1)])):($(),O(Me,{key:5},[_("button",{class:"new-btn ghost","data-test":"ssh-tunnels-refresh",onClick:pe},[Pe(w(hh),{size:14}),et(" "+T(w(i)("ssh.forwards.refresh")),1)]),_("button",{class:"new-btn","data-test":"ssh-tunnel-new",disabled:an.value.length===0,title:an.value.length===0?w(i)("ssh.forwards.newNeedsHost"):"",onClick:ln},[Pe(w(Xs),{size:14}),et(" "+T(w(i)("ssh.forwards.new")),1)],8,mY)],64)),_("button",{class:"close-x",title:w(i)("common.close"),onClick:ve[3]||(ve[3]=ge=>le.$emit("close"))},[Pe(w(gs),{size:16})],8,_Y)]),r.value?($(),O("p",yY,T(r.value),1)):Q("",!0),Y.value?($(),O("div",bY,[_("p",wY,T(w(i)("ssh.hostKey.title")),1),_("p",SY,T(N.value),1),_("code",CY,T(Y.value.prompt.fingerprint),1),Y.value.prompt.hopIndex>0?($(),O("p",kY,T(w(i)("ssh.hostKey.chainNote")),1)):Q("",!0),_("div",xY,[_("button",{"data-test":"ssh-host-reject-hostkey",onClick:j},T(w(i)("ssh.hostKey.reject")),1),_("button",{class:"new-btn","data-test":"ssh-host-accept-hostkey",onClick:V},T(w(i)("ssh.hostKey.accept")),1)])])):Q("",!0),Ls.value!==null?($(),O("p",RY,T(w(i)("ssh.importedHosts",{count:Ls.value})),1)):Q("",!0),ct(_("div",TY,[a.value.length===0?($(),O("div",EY,[Pe(w(co),{size:40,class:"empty-icon"}),_("p",PY,T(w(i)("ssh.hosts.emptyTitle")),1),_("p",LY,T(w(i)("ssh.hosts.emptySub")),1),_("button",{class:"new-btn ghost",onClick:Be},[Pe(w(Xs),{size:14}),et(" "+T(w(i)("ssh.newHost")),1)])])):($(),O(Me,{key:1},[b.value.length?($(),O("div",DY,[($(!0),O(Me,null,st(b.value,ge=>($(),O("button",{key:ge,class:nt(["tag-pill",{on:m.value.includes(ge)}]),"data-test":`ssh-tag-filter-${ge}`,onClick:Oe=>l(ge)},T(ge),11,IY))),128)),m.value.length?($(),O("button",{key:0,class:"tag-clear","data-test":"ssh-tag-filter-clear",onClick:f},[Pe(w(gs),{size:11}),et(" "+T(w(i)("ssh.hosts.clearTags")),1)])):Q("",!0)])):Q("",!0),g.value.length===0?($(),O("div",MY,[Pe(w(co),{size:40,class:"empty-icon"}),_("p",AY,T(w(i)("ssh.hosts.noMatchTitle")),1),_("p",$Y,T(w(i)("ssh.hosts.noMatchSub")),1)])):($(),O("div",OY,[($(!0),O(Me,null,st(g.value,ge=>{var Oe;return $(),O("article",{key:ge.id,class:nt(["card",{busy:c.value===ge.id}]),"data-test":`ssh-host-card-${ge.id}`,onDblclick:Nt=>G(ge.id),onContextmenu:pt(Nt=>oe(Nt,ge),["prevent"])},[_("div",BY,[ge.auth_kind==="key"?($(),Ct(w(cl),{key:0,size:16})):($(),Ct(w(co),{key:1,size:16}))]),_("div",HY,[_("div",NY,T(L(ge)),1),_("div",UY,T(x(ge)),1),M(ge)?($(),O("div",zY,[_("span",{class:nt(["proxy-badge",{blocked:D(ge)}]),"data-test":`ssh-host-proxy-${ge.id}`,title:z(ge)},T(B(ge)),11,VY)])):Q("",!0),(Oe=ge.tags)!=null&&Oe.length?($(),O("div",KY,[($(!0),O(Me,null,st(ge.tags,Nt=>($(),O("span",{key:Nt,class:"card-tag","data-test":`ssh-host-tag-${ge.id}-${Nt}`},T(Nt),9,WY))),128))])):Q("",!0)]),_("div",jY,[_("button",{class:"act connect","data-test":`ssh-connect-${ge.id}`,disabled:c.value===ge.id||D(ge),title:z(ge)||w(i)("common.connect"),onClick:pt(Nt=>G(ge.id),["stop"])},[Pe(w(l1),{size:13})],8,qY),_("button",{class:"act",title:w(i)("ssh.edit"),onClick:pt(Nt=>Se(ge),["stop"])},[Pe(w(rd),{size:13})],8,YY),_("button",{class:"act danger","data-test":`ssh-delete-${ge.id}`,title:w(i)("common.delete"),onClick:pt(Nt=>Ne(ge.id),["stop"])},[Pe(w(dl),{size:13})],8,GY)])],42,FY)}),128))]))],64))],512),[[Ci,s.value==="hosts"]]),ct(_("div",XY,[d.value.length===0?($(),O("div",JY,[Pe(w(cl),{size:40,class:"empty-icon"}),_("p",ZY,T(w(i)("ssh.keys.emptyTitle")),1),_("p",QY,T(w(i)("ssh.keys.emptySub")),1),_("button",{class:"new-btn ghost",onClick:Ei},[Pe(w(Xs),{size:14}),et(" "+T(w(i)("ssh.newKey")),1)])])):($(),O("div",eG,[($(!0),O(Me,null,st(d.value,ge=>($(),O("article",{key:ge.id,class:"card"},[_("div",tG,[Pe(w(cl),{size:16})]),_("div",nG,[_("div",iG,T(ge.name),1),_("div",sG,T(ge.key_type?w(i)("ssh.keys.typeLabel",{type:ge.key_type}):w(i)("ssh.keys.genericSubtitle")),1)]),_("div",rG,[_("button",{class:"act","data-test":`ssh-key-edit-${ge.id}`,title:w(i)("ssh.edit"),onClick:pt(Oe=>ds(ge),["stop"])},[Pe(w(rd),{size:13})],8,oG),_("button",{class:"act danger","data-test":`ssh-key-delete-${ge.id}`,title:w(i)("common.delete"),onClick:pt(Oe=>Pi(ge.id),["stop"])},[Pe(w(dl),{size:13})],8,aG)])]))),128))]))],512),[[Ci,s.value==="keys"]]),ct(_("div",lG,[Ye.value.length===0?($(),O("div",cG,[Pe(w(_o),{size:40,class:"empty-icon"}),_("p",dG,T(w(i)("ssh.forwards.emptyTitle")),1),_("p",uG,T(w(i)("ssh.forwards.emptySub")),1),an.value.length?($(),O("button",{key:0,class:"new-btn ghost","data-test":"ssh-tunnel-new-empty",onClick:ln},[Pe(w(Xs),{size:14}),et(" "+T(w(i)("ssh.forwards.new")),1)])):Q("",!0)])):Q("",!0),($(!0),O(Me,null,st(Ye.value,ge=>($(),O("section",{key:ge.id,class:"fwd-host","data-test":`ssh-tunnel-host-${ge.id}`},[_("header",fG,[_("span",pG,T(L(ge)),1),_("span",vG,T(ge.user)+"@"+T(ge.host),1),M(ge)?($(),O("span",{key:0,class:nt(["proxy-badge",{blocked:D(ge)}]),"data-test":`ssh-tunnel-proxy-${ge.id}`,title:z(ge)},T(B(ge)),11,gG)):Q("",!0)]),D(ge)?($(),O("p",{key:0,class:"fwd-proxy-reason","data-test":`ssh-tunnel-proxy-reason-${ge.id}`},T(w(i)("ssh.forwards.proxyBlocked"))+" "+T(z(ge)),9,mG)):Q("",!0),_("div",_G,[($(!0),O(Me,null,st(ge.forwards,Oe=>{var Nt,qs,si;return $(),O("article",{key:Oe.id,class:"card fwd-card","data-test":`ssh-tunnel-row-${ge.id}-${Oe.id}`},[_("div",bG,[Pe(w(_o),{size:16})]),_("div",wG,[_("div",SG,[_("span",CG,T(Dt(Oe.kind)),1),Oe.note?($(),O("span",kG,T(Oe.note),1)):Q("",!0)]),_("div",xG,T(Yt(ge,Oe))+" → "+T(jt(ge,Oe)),1),_t(ge.id,Oe.id)?($(),O("div",RG,T(w(i)("ssh.forwards.conns",{count:((Nt=_t(ge.id,Oe.id))==null?void 0:Nt.conns)??0})),1)):Q("",!0),(qs=_t(ge.id,Oe.id))!=null&&qs.error?($(),O("p",{key:1,class:"fwd-row-error","data-test":`ssh-tunnel-error-${ge.id}-${Oe.id}`},T((si=_t(ge.id,Oe.id))==null?void 0:si.error),9,TG)):Q("",!0)]),_("div",EG,[_("span",{class:nt(["fwd-state",Ln(ge,Oe)]),"data-test":`ssh-tunnel-state-${ge.id}-${Oe.id}`},T(Xt(ge,Oe)),11,PG),_("div",LG,[Te(ge.id,Oe.id)?($(),O("button",{key:0,class:"act danger","data-test":`ssh-tunnel-stop-${ge.id}-${Oe.id}`,title:w(i)("ssh.forwards.stop"),disabled:Ve.value!=="",onClick:Di=>rn(ge,Oe)},[Pe(w(o1),{size:13})],8,DG)):($(),O(Me,{key:1},[_("button",{class:"act connect","data-test":`ssh-tunnel-start-${ge.id}-${Oe.id}`,title:D(ge)?z(ge):w(i)("ssh.forwards.start"),disabled:D(ge)||Ve.value!=="",onClick:Di=>On(ge,Oe)},[Pe(w(s1),{size:13})],8,IG),_t(ge.id,Oe.id)?($(),O("button",{key:0,class:"act","data-test":`ssh-tunnel-dismiss-${ge.id}-${Oe.id}`,title:w(i)("ssh.forwards.dismiss"),disabled:Ve.value!=="",onClick:Di=>rn(ge,Oe)},[Pe(w(gs),{size:13})],8,MG)):Q("",!0)],64)),_("button",{class:"act","data-test":`ssh-tunnel-edit-${ge.id}-${Oe.id}`,title:w(i)("ssh.edit"),onClick:Di=>bi(ge,Oe)},[Pe(w(rd),{size:13})],8,AG),_("button",{class:"act danger","data-test":`ssh-tunnel-delete-${ge.id}-${Oe.id}`,title:w(i)("common.delete"),onClick:Di=>Ze(ge,Oe)},[Pe(w(dl),{size:13})],8,$G)])])],8,yG)}),128))])],8,hG))),128))],512),[[Ci,s.value==="tunnels"]]),Pe(x_,{open:te.value.open,x:te.value.x,y:te.value.y,items:se.value,onClose:Fe,onSelect:K},null,8,["open","x","y","items"]),Pe(xi,{name:"drawer"},{default:qt(()=>{var ge;return[ae.value?($(),O("aside",OG,[_("div",FG,[_("span",null,T(Ie.value?w(i)("ssh.hostDrawer.titleEdit"):w(i)("ssh.hostDrawer.titleNew")),1),_("button",{class:"close-x",onClick:R},[Pe(w(gs),{size:15})])]),_("div",BG,[_("label",HG,[_("span",NG,T(w(i)("ssh.hostDrawer.address")),1),ct(_("input",{"data-test":"ssh-add-host","onUpdate:modelValue":ve[4]||(ve[4]=Oe=>xe.value=Oe),placeholder:w(i)("ssh.hostDrawer.addressPlaceholder"),spellcheck:"false",autocomplete:"off"},null,8,UG),[[Et,xe.value]])]),_("div",zG,[_("label",VG,[_("span",KG,T(w(i)("ssh.hostDrawer.label")),1),ct(_("input",{"data-test":"ssh-add-alias","onUpdate:modelValue":ve[5]||(ve[5]=Oe=>Le.value=Oe),placeholder:w(i)("ssh.hostDrawer.labelPlaceholder"),autocomplete:"off"},null,8,WG),[[Et,Le.value]])]),_("label",jG,[_("span",qG,T(w(i)("ssh.hostDrawer.port")),1),ct(_("input",{"data-test":"ssh-add-port","onUpdate:modelValue":ve[6]||(ve[6]=Oe=>Qe.value=Oe),autocomplete:"off"},null,512),[[Et,Qe.value]])])]),_("label",YG,[_("span",GG,T(w(i)("ssh.hostDrawer.tags")),1),_("div",XG,[($(!0),O(Me,null,st(ne.value,Oe=>($(),O("span",{key:Oe,class:"chip","data-test":`ssh-add-tag-chip-${Oe}`},[et(T(Oe)+" ",1),_("button",{type:"button",class:"chip-x","data-test":`ssh-add-tag-remove-${Oe}`,title:w(i)("ssh.hostDrawer.removeTag",{tag:Oe}),onClick:pt(Nt=>S(Oe),["prevent"])},[Pe(w(gs),{size:10})],8,ZG)],8,JG))),128)),ct(_("input",{class:"tag-input","data-test":"ssh-add-tag-input","onUpdate:modelValue":ve[7]||(ve[7]=Oe=>ue.value=Oe),placeholder:ne.value.length?"":w(i)("ssh.hostDrawer.tagsPlaceholder"),autocomplete:"off",spellcheck:"false",onFocus:ve[8]||(ve[8]=Oe=>y.value=!0),onInput:ve[9]||(ve[9]=Oe=>y.value=!0),onBlur:A,onKeydown:[jn(pt(E,["prevent"]),["enter"]),jn(pt(E,["prevent"]),[","]),jn(P,["backspace"])]},null,40,QG),[[Et,ue.value]]),y.value&&C.value.length?($(),O("ul",eX,[($(!0),O(Me,null,st(C.value,Oe=>($(),O("li",{key:Oe,class:"combo-opt","data-test":`ssh-tag-opt-${Oe}`,onMousedown:pt(Nt=>I(Oe),["prevent"])},T(Oe),41,tX))),128))])):Q("",!0)])]),_("label",nX,[_("span",iX,T(w(i)("ssh.hostDrawer.username")),1),ct(_("input",{"data-test":"ssh-add-user","onUpdate:modelValue":ve[10]||(ve[10]=Oe=>De.value=Oe),placeholder:w(i)("ssh.hostDrawer.usernamePlaceholder"),autocomplete:"off"},null,8,sX),[[Et,De.value]])]),_("div",rX,[_("button",{class:nt({on:he.value==="password"}),"data-test":"ssh-auth-password",onClick:ve[11]||(ve[11]=Oe=>he.value="password")},T(w(i)("ssh.hostDrawer.authPassword")),3),_("button",{class:nt({on:he.value==="key"}),"data-test":"ssh-auth-key",onClick:ve[12]||(ve[12]=Oe=>he.value="key")},T(w(i)("ssh.hostDrawer.authKey")),3)]),(ge=de.value)!=null&&ge.identity_file?($(),O("p",oX,[_("span",aX,T(w(i)("ssh.hostDrawer.identityFileLabel")),1),_("code",null,T(de.value.identity_file),1),_("span",lX,T(w(i)("ssh.hostDrawer.identityFileHint")),1)])):Q("",!0),de.value&&M(de.value)?($(),O("p",cX,T(z(de.value)),1)):Q("",!0),he.value==="password"?($(),O("label",dX,[_("span",uX,[et(T(w(i)("ssh.hostDrawer.password")),1),Ie.value?($(),O("em",hX,T(w(i)("ssh.hostDrawer.keepBlank")),1)):Q("",!0)]),ct(_("input",{"data-test":"ssh-add-password",type:"password","onUpdate:modelValue":ve[13]||(ve[13]=Oe=>Ae.value=Oe),autocomplete:"off"},null,512),[[Et,Ae.value]])])):($(),O(Me,{key:3},[d.value.length?($(),O("label",fX,[_("span",pX,T(w(i)("ssh.hostDrawer.keyPicker")),1),_("div",vX,[Pe(qn,{modelValue:ce.value,"onUpdate:modelValue":ve[14]||(ve[14]=Oe=>ce.value=Oe),options:p.value,"aria-label":w(i)("ssh.hostDrawer.keyPickerAria")},null,8,["modelValue","options","aria-label"])])])):($(),O("div",gX,[_("p",mX,T(w(i)("ssh.hostDrawer.noKeys")),1),_("button",{class:"btn primary sm","data-test":"ssh-host-add-key",onClick:cs},[Pe(w(Xs),{size:13}),et(" "+T(w(i)("ssh.hostDrawer.addKey")),1)])]))],64)),_("div",_X,[_("div",yX,[_("span",bX,T(w(i)("ssh.startup.sectionTitle")),1)]),_("p",wX,T(w(i)("ssh.startup.sectionHint")),1),_("label",SX,[ct(_("textarea",{"data-test":"ssh-startup-command","onUpdate:modelValue":ve[15]||(ve[15]=Oe=>Je.value=Oe),rows:"3",spellcheck:"false",autocomplete:"off",placeholder:w(i)("ssh.startup.placeholder")},null,8,CX),[[Et,Je.value]])]),_("div",kX,[_("label",xX,[_("span",RX,T(w(i)("ssh.startup.delay")),1),ct(_("input",{"data-test":"ssh-startup-delay","onUpdate:modelValue":ve[16]||(ve[16]=Oe=>ye.value=Oe),placeholder:String(1500),autocomplete:"off"},null,8,TX),[[Et,ye.value]])]),Ce.value?($(),O("p",EX,T(w(i)("ssh.startup.steps",{count:Ce.value})),1)):Q("",!0)])]),_("div",PX,[_("div",LX,[_("span",DX,T(w(i)("ssh.forwards.sectionTitle")),1),_("button",{class:"btn sm",type:"button","data-test":"ssh-forward-add",onClick:pt(gt,["prevent"])},[Pe(w(Xs),{size:13}),et(" "+T(w(i)("ssh.forwards.add")),1)])]),_("p",IX,T(w(i)("ssh.forwards.sectionHint")),1),ot.value.length===0?($(),O("p",MX,T(w(i)("ssh.forwards.noRules")),1)):Q("",!0),($(!0),O(Me,null,st(ot.value,Oe=>($(),O("div",{key:Oe.id,class:"fwd-rule","data-test":`ssh-forward-rule-${Oe.id}`},[_("div",$X,[_("div",OX,[_("button",{type:"button",class:nt({on:Oe.kind==="local"}),"data-test":`ssh-forward-kind-local-${Oe.id}`,onClick:pt(Nt=>me(Oe,"local"),["prevent"])},T(w(i)("ssh.forwards.kindLocal")),11,FX),_("button",{type:"button",class:nt({on:Oe.kind==="remote"}),"data-test":`ssh-forward-kind-remote-${Oe.id}`,onClick:pt(Nt=>me(Oe,"remote"),["prevent"])},T(w(i)("ssh.forwards.kindRemote")),11,BX),_("button",{type:"button",class:nt({on:Oe.kind==="dynamic"}),"data-test":`ssh-forward-kind-dynamic-${Oe.id}`,onClick:pt(Nt=>me(Oe,"dynamic"),["prevent"])},T(w(i)("ssh.forwards.kindDynamic")),11,HX)]),_("button",{type:"button",class:"act danger","data-test":`ssh-forward-remove-${Oe.id}`,title:w(i)("ssh.forwards.remove"),onClick:pt(Nt=>re(Oe.id),["prevent"])},[Pe(w(dl),{size:13})],8,NX)]),_("p",UX,T(je(Oe.kind)),1),_("div",zX,[_("label",VX,[_("span",KX,T(w(i)("ssh.forwards.bindAddr")),1),ct(_("input",{"data-test":`ssh-forward-bind-addr-${Oe.id}`,"onUpdate:modelValue":Nt=>Oe.bind_addr=Nt,placeholder:"127.0.0.1",spellcheck:"false",autocomplete:"off"},null,8,WX),[[Et,Oe.bind_addr]])]),_("label",jX,[_("span",qX,T(w(i)("ssh.forwards.bindPort")),1),ct(_("input",{"data-test":`ssh-forward-bind-port-${Oe.id}`,"onUpdate:modelValue":Nt=>Oe.bind_port=Nt,autocomplete:"off"},null,8,YX),[[Et,Oe.bind_port]])])]),Oe.kind!=="dynamic"?($(),O("div",GX,[_("label",XX,[_("span",JX,T(w(i)("ssh.forwards.targetHost")),1),ct(_("input",{"data-test":`ssh-forward-target-host-${Oe.id}`,"onUpdate:modelValue":Nt=>Oe.target_host=Nt,spellcheck:"false",autocomplete:"off"},null,8,ZX),[[Et,Oe.target_host]])]),_("label",QX,[_("span",eJ,T(w(i)("ssh.forwards.targetPort")),1),ct(_("input",{"data-test":`ssh-forward-target-port-${Oe.id}`,"onUpdate:modelValue":Nt=>Oe.target_port=Nt,autocomplete:"off"},null,8,tJ),[[Et,Oe.target_port]])])])):Q("",!0),_("label",nJ,[_("span",iJ,T(w(i)("ssh.forwards.label")),1),ct(_("input",{"data-test":`ssh-forward-note-${Oe.id}`,"onUpdate:modelValue":Nt=>Oe.note=Nt,placeholder:w(i)("ssh.forwards.labelPlaceholder"),autocomplete:"off"},null,8,sJ),[[Et,Oe.note]])]),dt(Oe)?($(),O("p",{key:1,class:"fwd-warn","data-test":`ssh-forward-bind-warning-${Oe.id}`},T(dt(Oe)),9,rJ)):Q("",!0)],8,AX))),128))])]),_("div",oJ,[_("button",{class:"btn ghost",onClick:R},T(w(i)("common.cancel")),1),_("button",{class:"btn primary","data-test":"ssh-add-submit",disabled:!we.value,onClick:ht},T(Ie.value?w(i)("common.save"):w(i)("ssh.hostDrawer.submitNew")),9,aJ)])])):Q("",!0)]}),_:1}),Pe(xi,{name:"drawer"},{default:qt(()=>[mt.value?($(),O("aside",lJ,[_("div",cJ,[_("span",null,T(At.value?w(i)("ssh.keyDrawer.titleEdit"):w(i)("ssh.keyDrawer.titleNew")),1),_("button",{class:"close-x",onClick:wr},[Pe(w(gs),{size:15})])]),_("div",dJ,[_("label",uJ,[_("span",hJ,T(w(i)("ssh.keyDrawer.name")),1),ct(_("input",{"data-test":"ssh-key-name","onUpdate:modelValue":ve[17]||(ve[17]=ge=>Zt.value=ge),placeholder:w(i)("ssh.keyDrawer.namePlaceholder"),autocomplete:"off"},null,8,fJ),[[Et,Zt.value]])]),_("label",pJ,[_("span",vJ,[_("span",null,[et(T(w(i)("ssh.keyDrawer.pem")),1),At.value&&!_n.value?($(),O("em",gJ,T(w(i)("ssh.keyDrawer.keepBlank")),1)):Q("",!0)]),At.value?($(),O("span",mJ,[_("button",{type:"button",class:"act","data-test":"ssh-key-reveal",disabled:ti.value,title:_n.value?w(i)("ssh.keyDrawer.hide"):w(i)("ssh.keyDrawer.reveal"),onClick:pt(Hi,["prevent"])},[_n.value?($(),Ct(w(t1),{key:0,size:13})):($(),Ct(w(mm),{key:1,size:13}))],8,_J),_("button",{type:"button",class:"act","data-test":"ssh-key-copy",title:w(i)("ssh.keyDrawer.copy"),onClick:pt(Ni,["prevent"])},[Pe(w(e1),{size:13})],8,yJ)])):Q("",!0)]),ct(_("textarea",{"data-test":"ssh-key-pem","onUpdate:modelValue":ve[18]||(ve[18]=ge=>Kt.value=ge),rows:"6",spellcheck:"false",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512),[[Et,Kt.value]])]),_("label",bJ,[_("span",wJ,T(w(i)("ssh.keyDrawer.passphrase")),1),ct(_("input",{"data-test":"ssh-key-passphrase",type:"password","onUpdate:modelValue":ve[19]||(ve[19]=ge=>Hn.value=ge),autocomplete:"off"},null,512),[[Et,Hn.value]])]),Yn.value?($(),O("p",SJ,T(w(i)("ssh.keyDrawer.encryptedHint")),1)):Q("",!0),_("div",CJ,[_("input",{ref_key:"keyFileInput",ref:Cr,class:"file-input","data-test":"ssh-key-file-input",type:"file",onChange:jo},null,544),Sr.value?($(),O("div",{key:0,class:nt(["dropzone",{over:us.value}]),"data-test":"ssh-key-dropzone",onDragover:ve[20]||(ve[20]=pt(ge=>us.value=!0,["prevent"])),onDragenter:ve[21]||(ve[21]=pt(ge=>us.value=!0,["prevent"])),onDragleave:ve[22]||(ve[22]=ge=>us.value=!1),onDrop:pt(Ws,["prevent"])},[Pe(w(n1),{size:20,class:"dropzone-icon"}),_("span",null,T(w(i)("ssh.keyDrawer.dropzone")),1)],34)):Q("",!0),_("button",{class:"btn import",type:"button","data-test":"ssh-key-import-btn",onClick:Wo},[Pe(w(a1),{size:13}),et(" "+T(w(i)("ssh.keyDrawer.importFromFile")),1)])])]),_("div",kJ,[_("button",{class:"btn ghost",onClick:wr},T(w(i)("common.cancel")),1),_("button",{class:"btn primary","data-test":"ssh-key-submit",disabled:!kr.value,onClick:Gr},T(At.value?w(i)("common.save"):w(i)("ssh.keyDrawer.submitNew")),9,xJ)])])):Q("",!0)]),_:1}),Pe(xi,{name:"drawer"},{default:qt(()=>[Cn.value&&Ft.value?($(),O("aside",RJ,[_("div",TJ,[_("span",null,T(Ut.value?w(i)("ssh.forwards.drawerTitleEdit"):w(i)("ssh.forwards.drawerTitleNew")),1),_("button",{class:"close-x",onClick:hi},[Pe(w(gs),{size:15})])]),_("div",EJ,[_("label",PJ,[_("span",LJ,T(w(i)("ssh.forwards.hostPicker")),1),_("div",DJ,[Pe(qn,{modelValue:mn.value,"onUpdate:modelValue":ve[23]||(ve[23]=ge=>mn.value=ge),options:an.value,disabled:Ut.value!=="","aria-label":w(i)("ssh.forwards.hostPickerAria")},null,8,["modelValue","options","disabled","aria-label"])])]),_("p",IJ,T(w(i)("ssh.forwards.hostPickerHint")),1),_("div",MJ,[_("button",{type:"button",class:nt({on:Ft.value.kind==="local"}),"data-test":"ssh-tunnel-kind-local",onClick:ve[24]||(ve[24]=pt(ge=>Ft.value.kind="local",["prevent"]))},T(w(i)("ssh.forwards.kindLocal")),3),_("button",{type:"button",class:nt({on:Ft.value.kind==="remote"}),"data-test":"ssh-tunnel-kind-remote",onClick:ve[25]||(ve[25]=pt(ge=>Ft.value.kind="remote",["prevent"]))},T(w(i)("ssh.forwards.kindRemote")),3),_("button",{type:"button",class:nt({on:Ft.value.kind==="dynamic"}),"data-test":"ssh-tunnel-kind-dynamic",onClick:ve[26]||(ve[26]=pt(ge=>Ft.value.kind="dynamic",["prevent"]))},T(w(i)("ssh.forwards.kindDynamic")),3)]),_("p",AJ,T(je(Ft.value.kind)),1),_("div",$J,[_("label",OJ,[_("span",FJ,T(w(i)("ssh.forwards.bindAddr")),1),ct(_("input",{"data-test":"ssh-tunnel-bind-addr","onUpdate:modelValue":ve[27]||(ve[27]=ge=>Ft.value.bind_addr=ge),placeholder:"127.0.0.1",spellcheck:"false",autocomplete:"off"},null,512),[[Et,Ft.value.bind_addr]])]),_("label",BJ,[_("span",HJ,T(w(i)("ssh.forwards.bindPort")),1),ct(_("input",{"data-test":"ssh-tunnel-bind-port","onUpdate:modelValue":ve[28]||(ve[28]=ge=>Ft.value.bind_port=ge),autocomplete:"off"},null,512),[[Et,Ft.value.bind_port]])])]),Ft.value.kind!=="dynamic"?($(),O("div",NJ,[_("label",UJ,[_("span",zJ,T(w(i)("ssh.forwards.targetHost")),1),ct(_("input",{"data-test":"ssh-tunnel-target-host","onUpdate:modelValue":ve[29]||(ve[29]=ge=>Ft.value.target_host=ge),spellcheck:"false",autocomplete:"off"},null,512),[[Et,Ft.value.target_host]])]),_("label",VJ,[_("span",KJ,T(w(i)("ssh.forwards.targetPort")),1),ct(_("input",{"data-test":"ssh-tunnel-target-port","onUpdate:modelValue":ve[30]||(ve[30]=ge=>Ft.value.target_port=ge),autocomplete:"off"},null,512),[[Et,Ft.value.target_port]])])])):Q("",!0),_("label",WJ,[_("span",jJ,T(w(i)("ssh.forwards.label")),1),ct(_("input",{"data-test":"ssh-tunnel-note","onUpdate:modelValue":ve[31]||(ve[31]=ge=>Ft.value.note=ge),placeholder:w(i)("ssh.forwards.labelPlaceholder"),autocomplete:"off"},null,8,qJ),[[Et,Ft.value.note]])]),dt(Ft.value)?($(),O("p",YJ,T(dt(Ft.value)),1)):Q("",!0)]),_("div",GJ,[_("button",{class:"btn ghost",onClick:hi},T(w(i)("common.cancel")),1),_("button",{class:"btn","data-test":"ssh-tunnel-save-start",disabled:!fi.value||nn.value,onClick:Ee},T(w(i)("ssh.forwards.saveAndStart")),9,XJ),_("button",{class:"btn primary","data-test":"ssh-tunnel-save",disabled:!fi.value||nn.value,onClick:ei},T(w(i)("common.save")),9,JJ)])])):Q("",!0)]),_:1}),Pe(xi,{name:"drawer"},{default:qt(()=>[Es.value?($(),O("aside",ZJ,[_("div",QJ,[_("span",null,T(w(i)("ssh.configImport.title")),1),_("button",{class:"close-x",onClick:ii},[Pe(w(gs),{size:15})])]),_("div",eZ,[Ps.value?($(),O("div",tZ,[_("p",nZ,T(w(i)("ssh.configImport.loading")),1)])):wi.value?($(),O("p",iZ,T(wi.value),1)):Si.value?($(),O(Me,{key:2},[Ui.value.length===0&&En.value.length===0?($(),O("div",sZ,[Pe(w(Mf),{size:36,class:"empty-icon"}),_("p",rZ,T(w(i)("ssh.configImport.emptyTitle")),1),_("p",oZ,T(w(i)("ssh.configImport.emptySub")),1)])):($(),O(Me,{key:1},[Ui.value.length?($(),O("p",aZ,T(w(i)("ssh.configImport.importableTitle",{count:Ui.value.length})),1)):Q("",!0),Ui.value.length?($(),O("ul",lZ,[($(!0),O(Me,null,st(Ui.value,(ge,Oe)=>($(),O("li",{key:`${ge.alias}-${Oe}`,class:"config-entry"},[_("label",cZ,[_("input",{type:"checkbox","data-test":`ssh-config-entry-check-${Oe}`,checked:ni.value.has(Oe),onChange:Nt=>qo(Oe)},null,40,dZ),_("span",uZ,[_("span",hZ,T(ge.alias||`${ge.user}@${ge.host}`),1),_("span",fZ,T(ge.user)+"@"+T(ge.host)+T(ge.port&&ge.port!=="22"?`:${ge.port}`:""),1)]),_("span",pZ,[Ji(ge)?($(),O("span",{key:0,class:"overwrite-badge","data-test":`ssh-config-entry-overwrite-${Oe}`,title:w(i)("ssh.configImport.overwriteTitle")},T(w(i)("ssh.configImport.overwriteBadge")),9,vZ)):Q("",!0),M(ge)?($(),O("span",{key:1,class:nt(["proxy-badge",{blocked:D(ge)}]),"data-test":`ssh-config-entry-proxy-${Oe}`,title:z(ge)},T(D(ge)?w(i)("ssh.configImport.proxyBadge",{label:B(ge)}):B(ge)),11,gZ)):Q("",!0)])])]))),128))])):Q("",!0),En.value.length?($(),O(Me,{key:2},[_("p",mZ,T(w(i)("ssh.configImport.skippedTitle",{count:En.value.length})),1),_("ul",_Z,[($(!0),O(Me,null,st(En.value,(ge,Oe)=>($(),O("li",{key:`${ge.alias}-${Oe}`,class:"skip-row"},[_("span",yZ,T(ge.alias),1),_("span",bZ,T(ge.reason),1)]))),128))])],64)):Q("",!0)],64)),_("p",wZ,T(Si.value.note),1)],64)):Q("",!0)]),_("div",SZ,[Xi.value?($(),O("p",CZ,T(Xi.value),1)):Q("",!0),_("div",kZ,[_("button",{class:"btn ghost",onClick:ii},T(w(i)("common.cancel")),1),_("button",{class:"btn primary","data-test":"ssh-config-import-confirm",disabled:!vi.value||hs.value,onClick:Li},T(hs.value?w(i)("ssh.configImport.importing"):w(i)("ssh.configImport.confirm",{count:ni.value.size})),9,xZ)])])])):Q("",!0)]),_:1})])]))}}),EZ=kt(TZ,[["__scopeId","data-v-d1c3506a"]]),PZ={class:"dialog"},LZ={key:0},DZ={class:"dim"},IZ={key:1},MZ={class:"dim"},AZ={key:0,class:"warn"},$Z={class:"row"},OZ=$e({__name:"ConfirmQuitDialog",props:{localCount:{},remoteCount:{}},emits:["confirm","cancel"],setup(e){const{t}=Ot(),n=s=>s===1?"sessions.endLocalSessionOne":"sessions.endLocalSessionMany",i=s=>s===1?"sessions.detachRemoteSessionOne":"sessions.detachRemoteSessionMany";return(s,a)=>($(),O("div",{class:"backdrop",onClick:a[2]||(a[2]=pt(d=>s.$emit("cancel"),["self"]))},[_("div",PZ,[_("h2",null,T(w(t)("sessions.quitTitle")),1),_("p",null,T(w(t)("sessions.closingWill")),1),_("ul",null,[s.localCount>0?($(),O("li",LZ,[et(T(w(t)(n(s.localCount),{count:s.localCount}))+" ",1),_("span",DZ,T(w(t)("sessions.runningProcessesTerminated")),1)])):Q("",!0),s.remoteCount>0?($(),O("li",IZ,[et(T(w(t)(i(s.remoteCount),{count:s.remoteCount}))+" ",1),_("span",MZ,T(w(t)("sessions.remotePtyKeepsRunning")),1)])):Q("",!0)]),s.localCount>0?($(),O("p",AZ,T(w(t)("sessions.saveWorkFirst")),1)):Q("",!0),_("div",$Z,[_("button",{onClick:a[0]||(a[0]=d=>s.$emit("cancel"))},T(w(t)("common.cancel")),1),_("button",{class:nt(["primary",{danger:s.localCount>0}]),onClick:a[1]||(a[1]=d=>s.$emit("confirm"))},T(w(t)("sessions.quit")),3)])])]))}}),FZ=kt(OZ,[["__scopeId","data-v-380786e4"]]),BZ={class:"startup-fatal","data-testid":"startup-fatal",role:"alert"},HZ={class:"startup-fatal-panel"},NZ={key:0,class:"startup-fatal-log"},UZ={class:"startup-fatal-actions"},zZ={key:1,class:"startup-fatal-copy-status"},VZ=$e({__name:"StartupFatalPanel",props:{fatal:{}},emits:["quit"],setup(e,{emit:t}){const n=e,i=t,{t:s}=Ot(),a=F("");async function d(){var o;const r=["AT Term startup failed",n.fatal.message,n.fatal.log_path?`log: ${n.fatal.log_path}`:""].filter(Boolean).join(` +`);try{if(!((o=navigator.clipboard)!=null&&o.writeText))throw new Error("clipboard unavailable");await navigator.clipboard.writeText(r),a.value=s("app.startupFailureCopied")}catch{a.value=s("terminal.copyFailed")}}return(r,o)=>($(),O("div",BZ,[_("section",HZ,[_("h1",null,T(w(s)("app.startupFailureTitle")),1),_("p",null,T(w(s)("app.startupFailureIntro")),1),_("pre",null,T(r.fatal.message),1),r.fatal.log_path?($(),O("div",NZ,[_("span",null,T(w(s)("app.startupFailureLogPath")),1),_("code",null,T(r.fatal.log_path),1)])):Q("",!0),_("div",UZ,[_("button",{onClick:d},T(w(s)("app.startupFailureCopy")),1),_("button",{class:"danger",onClick:o[0]||(o[0]=c=>i("quit"))},T(w(s)("sessions.quit")),1)]),a.value?($(),O("p",zZ,T(a.value),1)):Q("",!0)])]))}}),KZ=kt(VZ,[["__scopeId","data-v-ad8304f2"]]),WZ={class:"dialog",role:"dialog","aria-modal":"true"},jZ={key:0},qZ={key:1},YZ={class:"row"},GZ=$e({__name:"ConfirmCloseSessionDialog",props:{title:{},isAi:{type:Boolean},isRunning:{type:Boolean},isRemote:{type:Boolean},count:{default:1}},emits:["confirm","cancel"],setup(e){const{t}=Ot();return(n,i)=>($(),O("div",{class:"backdrop",onClick:i[2]||(i[2]=pt(s=>n.$emit("cancel"),["self"]))},[_("div",WZ,[_("h2",null,T(w(t)("sessions.closeSessionTitle")),1),_("p",null,T(n.count>1?w(t)("sessions.closeSessionManyBody",{count:n.count}):w(t)("sessions.closeSessionBody",{title:n.title})),1),_("ul",null,[n.isAi?($(),O("li",jZ,T(w(t)("sessions.closeAiSessionWarning")),1)):Q("",!0),n.isRunning?($(),O("li",qZ,T(w(t)("sessions.closeRunningSessionWarning")),1)):Q("",!0),_("li",null,T(w(t)(n.isRemote?"sessions.closeRemoteDetachHint":"sessions.closeLocalTerminateHint")),1)]),_("div",YZ,[_("button",{type:"button",onClick:i[0]||(i[0]=s=>n.$emit("cancel"))},T(w(t)("common.cancel")),1),_("button",{type:"button",class:"primary danger",onClick:i[1]||(i[1]=s=>n.$emit("confirm"))},T(w(t)("sessions.closeSessionConfirm")),1)])])]))}}),XZ=kt(GZ,[["__scopeId","data-v-e95fa892"]]),JZ={key:0,class:"recovery-dialog-backdrop",role:"dialog","aria-modal":"true"},ZZ={class:"recovery-dialog"},QZ={class:"subtitle"},eQ={class:"tab-list"},tQ={class:"tab-row"},nQ=["onUpdate:modelValue"],iQ=["onClick"],sQ={class:"tab-title"},rQ={class:"tab-meta"},oQ={key:0,class:"pane-list"},aQ={class:"pane-shell"},lQ={class:"pane-cwd"},cQ={class:"pane-badge"},dQ=["disabled"],uQ=$e({__name:"RecoveryDialog",props:{snapshot:{},open:{type:Boolean}},emits:["restore","discard"],setup(e,{emit:t}){const n=e,i=t,{t:s}=Ot(),a=F({}),d=F({});Yi(()=>{if(n.snapshot)for(const g of n.snapshot.tabs)a.value[g.id]===void 0&&(a.value[g.id]=!0)});const r=W(()=>{const g=Math.floor(Date.now()/1e3),l=Math.max(0,g-n.snapshot.saved_at_unix);return Math.floor(l/60)}),o=W(()=>n.snapshot.clean_shutdown?s("recovery.dialog.subtitleClean",{minutes:r.value}):s("recovery.dialog.subtitleUnclean",{minutes:r.value})),c=W(()=>n.snapshot.tabs.filter(g=>a.value[g.id]).length),h=W(()=>n.snapshot.tabs.length),u=W(()=>c.value===h.value?s("recovery.dialog.btnRestoreAll",{count:h.value}):s("recovery.dialog.btnRestoreSelected",{count:c.value}));function v(g){var l,f;if(g.session_type!=="ai"&&g.last_command_line){const p=g.last_command_line.split(/\s+/)[0];if(p&&!["claude","codex","aider"].includes(p))return s("recovery.dialog.badgeUnclassified")}return g.session_type==="ai"?((l=g.ai)==null?void 0:l.kind)==="aider"||(f=g.ai)!=null&&f.session_id?s("recovery.dialog.badgeResumable"):s("recovery.dialog.badgeFresh"):s("recovery.dialog.badgeShell")}function m(g,l){var y;const f=l.panes[0],p=((y=f==null?void 0:f.last_cwd)==null?void 0:y.split("/").filter(Boolean).pop())??"";return`Tab ${g+1}`+(p?` · ${p}`:"")}function b(){const g=n.snapshot.tabs.filter(l=>a.value[l.id]);i("restore",g)}return(g,l)=>g.open?($(),O("div",JZ,[_("div",ZZ,[_("header",null,[_("h2",null,T(w(s)("recovery.dialog.title")),1),_("p",QZ,T(o.value),1)]),_("ul",eQ,[($(!0),O(Me,null,st(g.snapshot.tabs,(f,p)=>($(),O("li",{key:f.id},[_("label",tQ,[ct(_("input",{type:"checkbox","onUpdate:modelValue":y=>a.value[f.id]=y},null,8,nQ),[[ko,a.value[f.id]]]),_("button",{class:"caret",type:"button",onClick:y=>d.value[f.id]=!d.value[f.id]},T(d.value[f.id]?"▾":"▸"),9,iQ),_("span",sQ,T(m(p,f)),1),_("span",rQ,T(f.panes.length)+" "+T(f.panes.length>1?"panes":"pane"),1)]),d.value[f.id]?($(),O("ul",oQ,[($(!0),O(Me,null,st(f.panes,y=>($(),O("li",{key:y.slot},[_("span",aQ,T(y.shell.split("/").pop()||y.shell),1),_("span",lQ,T(y.last_cwd),1),_("span",cQ,T(v(y)),1)]))),128))])):Q("",!0)]))),128))]),_("footer",null,[_("button",{"data-testid":"btn-discard",class:"btn-secondary",onClick:l[0]||(l[0]=f=>i("discard"))},T(w(s)("recovery.dialog.btnDiscard")),1),_("button",{"data-testid":"btn-restore",class:"btn-primary",disabled:c.value===0,onClick:b},T(u.value),9,dQ)])])])):Q("",!0)}}),hQ=kt(uQ,[["__scopeId","data-v-4735cb7a"]]),fQ={class:"startup-update-backdrop",role:"dialog","aria-modal":"true"},pQ={class:"startup-update-dialog"},vQ={class:"subtitle"},gQ={class:"status"},mQ={key:0,class:"notes"},_Q=["disabled"],yQ=["disabled"],bQ=$e({__name:"StartupUpdateDialog",emits:["dismiss","install"],setup(e,{emit:t}){const n=t,{t:i}=Ot(),s=F(null),a=F(!1),d=F(!1);let r=null;It(async()=>{try{s.value=await xo()}catch{}r=window.setInterval(async()=>{try{s.value=await xo()}catch{}},2e3)}),Vt(()=>{r!==null&&window.clearInterval(r)});const o=W(()=>{const v=s.value;return v?v.error?v.error:v.ready?i("startupUpdate.statusReady",{version:v.latest}):v.downloading?i("startupUpdate.statusDownloading",{version:v.latest,pct:v.download_pct}):i("startupUpdate.statusAvailable",{version:v.latest}):""});async function c(){a.value=!0;try{await Wm()}catch{}finally{a.value=!1}}async function h(){d.value=!0;try{await jm()}catch{}finally{d.value=!1}}async function u(){try{await qm(),n("install")}catch{}}return(v,m)=>{var b,g,l,f,p,y;return $(),O("div",fQ,[_("div",pQ,[_("header",null,[_("h2",null,T(w(i)("startupUpdate.title")),1),_("p",vQ,T(w(i)("startupUpdate.currentToLatest",{current:((b=s.value)==null?void 0:b.current)??"",latest:((g=s.value)==null?void 0:g.latest)??""})),1)]),_("p",gQ,T(o.value),1),(l=s.value)!=null&&l.notes?($(),O("details",mQ,[_("summary",null,T(w(i)("startupUpdate.releaseNotes")),1),_("pre",null,T(s.value.notes),1)])):Q("",!0),_("footer",null,[_("button",{"data-testid":"startup-update-later",class:"btn-secondary",onClick:m[0]||(m[0]=C=>n("dismiss"))},T(w(i)("startupUpdate.later")),1),(f=s.value)!=null&&f.ready?($(),O("button",{key:0,"data-testid":"startup-update-install",class:"btn-primary",onClick:u},T(w(i)("startupUpdate.installRestart")),1)):(p=s.value)!=null&&p.downloading?($(),O("button",{key:1,"data-testid":"startup-update-cancel",class:"btn-primary danger",disabled:d.value,onClick:h},T(d.value?w(i)("startupUpdate.cancelling"):w(i)("startupUpdate.cancel",{pct:((y=s.value)==null?void 0:y.download_pct)??0})),9,_Q)):($(),O("button",{key:2,"data-testid":"startup-update-download",class:"btn-primary",disabled:a.value,onClick:c},T(w(i)("startupUpdate.downloadInstall")),9,yQ))])])])}}}),wQ=kt(bQ,[["__scopeId","data-v-cb1e98fb"]]);function SQ(e){const t=e.thresholdMs??3e3,n=e.mod;let i=null,s=!1;function a(){i!==null&&(clearTimeout(i),i=null)}function d(){s&&(s=!1,e.onHide())}function r(){i=null,s=!0,e.onShow()}function o(v){return!(v.key!==n||v.altKey||v.shiftKey||(n==="Meta"?v.ctrlKey:v.metaKey))}function c(v){if(o(v)){if(v.repeat||i!==null||s)return;i=setTimeout(r,t);return}a(),d()}function h(v){v.key===n&&(a(),d())}function u(){a(),d()}document.addEventListener("keydown",c,{capture:!0}),document.addEventListener("keyup",h,{capture:!0}),window.addEventListener("blur",u),wc(()=>{a(),document.removeEventListener("keydown",c,{capture:!0}),document.removeEventListener("keyup",h,{capture:!0}),window.removeEventListener("blur",u)})}const CQ={key:0,class:"hints-backdrop"},kQ=["aria-label"],xQ={class:"hints-header"},RQ={class:"hints-group"},TQ={class:"chord"},EQ={class:"label"},PQ={class:"hints-group"},LQ={class:"chord"},DQ={class:"label"},IQ=$e({__name:"ShortcutHints",props:{mod:{},thresholdMs:{},bindings:{}},setup(e){function t(){return Th()}const n=e,i=n.mod??t(),s=F(!1),{t:a}=Ot();SQ({mod:i,thresholdMs:n.thresholdMs??3e3,onShow:()=>{s.value=!0},onHide:()=>{s.value=!1}});const d=W(()=>Fb(n.bindings??{})),r=zs.filter(u=>u.group==="pane"),o=zs.filter(u=>u.group==="tab");function c(u){return kU(d.value[u.id]??"",i)}function h(u){return(d.value[u.id]??"")===""}return(u,v)=>($(),Ct(xi,{name:"fade"},{default:qt(()=>[s.value?($(),O("div",CQ,[_("div",{class:"hints-panel",role:"dialog","aria-label":w(a)("settings.shortcuts.keyboardShortcuts")},[_("div",xQ,T(w(a)("settings.shortcuts.keyboardShortcuts")),1),_("section",RQ,[_("h3",null,T(w(a)("settings.shortcuts.pane")),1),($(!0),O(Me,null,st(w(r),m=>($(),O("div",{key:m.id,class:nt(["hint-row",{disabled:h(m)}])},[_("div",TQ,T(h(m)?"—":c(m)),1),_("div",EQ,T(w(a)(m.labelKey)),1)],2))),128))]),_("section",PQ,[_("h3",null,T(w(a)("settings.shortcuts.tab")),1),($(!0),O(Me,null,st(w(o),m=>($(),O("div",{key:m.id,class:nt(["hint-row",{disabled:h(m)}])},[_("div",LQ,T(h(m)?"—":c(m)),1),_("div",DQ,T(w(a)(m.labelKey)),1)],2))),128))])],8,kQ)])):Q("",!0)]),_:1}))}}),MQ=kt(IQ,[["__scopeId","data-v-f52d16ed"]]),AQ={class:"paste-preview-host"},$Q=["onMouseenter","onMouseleave"],OQ=["src","alt","onClick"],FQ={class:"paste-toast-name"},BQ=["aria-label","onClick"],HQ=["src","alt"],NQ=5e3,UQ=$e({__name:"PasteImagePreviewHost",setup(e){const t=F([]),n=F(null),i=new Map;function s(b){const g=window.setTimeout(()=>r(b),NQ);i.set(b,g)}function a(b){const g=i.get(b);g!==void 0&&(window.clearTimeout(g),i.delete(b))}function d(b){let g;try{g=URL.createObjectURL(b.file)}catch(l){Pt("paste","preview createObjectURL failed",{error:xt(l)});return}t.value.push({id:b.id,file:b.file,url:g,name:b.name}),s(b.id)}function r(b){a(b);const g=t.value.findIndex(f=>f.id===b);if(g===-1)return;const[l]=t.value.splice(g,1);URL.revokeObjectURL(l.url)}function o(b){a(b)}function c(b){t.value.some(g=>g.id===b)&&s(b)}function h(b){n.value&&URL.revokeObjectURL(n.value.url);try{n.value={url:URL.createObjectURL(b.file),name:b.name}}catch(g){Pt("paste","lightbox createObjectURL failed",{error:xt(g)}),n.value=null}}function u(){n.value&&(URL.revokeObjectURL(n.value.url),n.value=null)}function v(b){b.key==="Escape"&&n.value&&u()}let m=null;return It(()=>{m=ka.on(d),document.addEventListener("keydown",v)}),Vt(()=>{m==null||m(),m=null,document.removeEventListener("keydown",v);for(const b of i.values())window.clearTimeout(b);i.clear();for(const b of t.value)URL.revokeObjectURL(b.url);t.value=[],n.value&&(URL.revokeObjectURL(n.value.url),n.value=null)}),(b,g)=>($(),O("div",AQ,[($(!0),O(Me,null,st(t.value,l=>($(),O("div",{key:l.id,class:"paste-toast","data-testid":"paste-toast",onMouseenter:f=>o(l.id),onMouseleave:f=>c(l.id)},[_("img",{src:l.url,alt:l.name,class:"paste-toast-thumb",onClick:f=>h(l)},null,8,OQ),_("span",FQ,T(l.name),1),_("button",{type:"button",class:"paste-toast-close","data-testid":"paste-toast-close","aria-label":"close "+l.name,onClick:f=>r(l.id)},"×",8,BQ)],40,$Q))),128)),n.value?($(),O("div",{key:0,class:"paste-lightbox","data-testid":"paste-lightbox",onClick:u},[_("img",{src:n.value.url,alt:n.value.name,onClick:g[0]||(g[0]=pt(()=>{},["stop"]))},null,8,HQ)])):Q("",!0)]))}}),zQ=kt(UQ,[["__scopeId","data-v-6eda1305"]]),VQ={class:"paste-file-host"},KQ={class:"paste-file-name"},WQ={class:"paste-file-size"},jQ=["aria-label","onClick"],qQ=3e3,YQ=$e({__name:"PasteFilePreviewHost",setup(e){const t=F([]),n=new Map;function i(c){return c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KiB`:`${(c/(1024*1024)).toFixed(1)} MiB`}function s(c){const h=window.setTimeout(()=>r(c),qQ);n.set(c,h)}function a(c){const h=n.get(c);h!==void 0&&(window.clearTimeout(h),n.delete(c))}function d(c){t.value.push({id:c.id,name:c.name,size:c.size}),s(c.id)}function r(c){a(c);const h=t.value.findIndex(u=>u.id===c);h!==-1&&t.value.splice(h,1)}let o=null;return It(()=>{o=Ru.on(d)}),Vt(()=>{o==null||o(),o=null;for(const c of n.values())window.clearTimeout(c);n.clear(),t.value=[]}),(c,h)=>($(),O("div",VQ,[($(!0),O(Me,null,st(t.value,u=>($(),O("div",{key:u.id,class:"paste-file-toast","data-testid":"paste-file-toast"},[h[0]||(h[0]=_("span",{class:"paste-file-icon"},"📎",-1)),_("span",KQ,T(u.name),1),_("span",WQ,"("+T(i(u.size))+")",1),_("button",{type:"button",class:"paste-file-close","data-testid":"paste-file-close","aria-label":"close "+u.name,onClick:v=>r(u.id)},"×",8,jQ)]))),128))]))}}),GQ=kt(YQ,[["__scopeId","data-v-436c1298"]]),XQ=$e({__name:"PluginHost",props:{slotId:{},context:{}},setup(e){const t=e,n=Yr(),{t:i}=Ot(),s=Ng([]),a=F(!1);async function d(){if(n.cfg&&!a.value){a.value=!0;try{const o=z_(t.slotId).filter(h=>n.isPluginEnabled(h.id)).filter(h=>h.slot!=="context-menu"&&h.slot!=="companion-window"),c=[];for(const h of o)try{const u=await h.load();c.push({descriptor:h,component:u.default})}catch(u){Gi("plugin","failed to load",{plugin:h.id,error:xt(u)}),t.context.showToast(i("app.pluginFailedToLoad",{title:i(h.titleKey)}));try{await n.setEnabled(h.id,!1)}catch(v){Pt("plugin","disable-after-load-failure also failed",{plugin:h.id,error:xt(v)})}}s.value=c}finally{a.value=!1}}}return It(async()=>{n.cfg||await n.load(),await d()}),wt(()=>n.cfg,()=>{d()},{deep:!0}),(r,o)=>($(),O("div",{class:nt(["plugin-host",`slot-${r.slotId}`])},[($(!0),O(Me,null,st(s.value,c=>($(),Ct(rm(c.component),{key:c.descriptor.id,context:r.context},null,8,["context"]))),128))],2))}}),xg=kt(XQ,[["__scopeId","data-v-db2df210"]]),Rg=3e4;function JQ(e,t={}){let n=!0;const i=t.transport??((a,d)=>fetch(a,d));async function s(a,d,r,o){var k,E,I;const c=e.baseUrl.replace(/\/+$/,"")+"/v1/chat/completions",h=`You are a translation engine. Detect the source language and translate to ${d}. Respond with strict JSON: {"detectedSrcLang":"","translated":""}. No commentary, no markdown.`,u=`You are a translation engine. Translate the following text to ${d}. Output ONLY the translation, no explanation, no quotes, no markdown.`,v={model:e.model,messages:[{role:"system",content:o?h:u},{role:"user",content:a}],temperature:.2};o&&(v.response_format={type:"json_object"});const m=ZQ(e.extraParams);m&&Object.assign(v,m);const b=new AbortController,g=setTimeout(()=>b.abort(),Rg),l=()=>b.abort();r.addEventListener("abort",l);let f;try{f=await i(c,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},body:JSON.stringify(v),signal:b.signal})}catch(S){throw S instanceof DOMException&&S.name==="AbortError"?r.aborted?new Vi("aborted",cn("plugins.translate.userCancelled")):new Vi("timeout",cn("plugins.translate.requestTimedOut",{seconds:Rg/1e3})):new Vi("network",S instanceof Error?S.message:String(S))}finally{clearTimeout(g),r.removeEventListener("abort",l)}const p=await f.text();if(f.status===401||f.status===403)throw new Vi("auth",cn("plugins.translate.authFailed",{status:f.status}),f.status,p.slice(0,200));if(f.status===429)throw new Vi("rate_limit",cn("plugins.translate.rateLimited"),f.status,p.slice(0,200));if(f.status>=500)throw new Vi("server",cn("plugins.translate.serverError",{status:f.status}),f.status,p.slice(0,200));if(f.status===400&&o&&/response_format|json_object/i.test(p))throw n=!1,new Tg;if(!f.ok)throw new Vi("unknown",`HTTP ${f.status}`,f.status,p.slice(0,200));let y;try{y=JSON.parse(p)}catch{throw new Vi("parse",cn("plugins.translate.providerNonJson"),f.status,p.slice(0,200))}const C=((I=(E=(k=y.choices)==null?void 0:k[0])==null?void 0:E.message)==null?void 0:I.content)??"";if(!o)return{translated:C.trim(),detectedSrcLang:"unknown"};try{const S=JSON.parse(C);if(typeof S.translated!="string")throw new Error(cn("plugins.translate.missingTranslated"));const P=typeof S.detectedSrcLang=="string"?S.detectedSrcLang:"unknown";return{translated:S.translated,detectedSrcLang:P}}catch{return{translated:C,detectedSrcLang:"unknown"}}}return{async translate(a,d,r){try{return await s(a,d,r.signal,n)}catch(o){if(o instanceof Tg)return await s(a,d,r.signal,!1);throw o}}}}class Tg extends Error{constructor(){super(cn("plugins.translate.responseFormatUnsupported"))}}function ZQ(e){if(!e||!e.trim())return null;let t;try{t=JSON.parse(e)}catch(n){throw new Vi("unknown",cn("plugins.translate.invalidExtraParams",{detail:n instanceof Error?n.message:String(n)}))}if(!t||typeof t!="object"||Array.isArray(t))throw new Vi("unknown",cn("plugins.translate.invalidExtraParams",{detail:"must be JSON object"}));return t}const QQ={class:"translate-panel__handle"},eee={class:"translate-panel__title"},tee=["aria-label"],nee={class:"translate-panel__source"},iee={class:"translate-panel__label"},see={key:0,class:"translate-panel__detected"},ree={class:"translate-panel__pre"},oee={class:"translate-panel__target-row"},aee={class:"translate-panel__label"},lee={class:"translate-panel__target-select","data-testid":"translate-target"},cee={class:"translate-panel__result"},dee={key:0,class:"translate-panel__loading"},uee={key:1,class:"translate-panel__error",role:"alert"},hee={key:2,class:"translate-panel__text"},fee={key:3,class:"translate-panel__placeholder"},pee={key:0,class:"translate-panel__history"},vee=["onClick"],gee={class:"translate-panel__history-source"},mee={class:"translate-panel__history-translated"},_ee=$e({__name:"TranslatePanel",setup(e){const t=Lh(),{t:n}=Ot(),i=[{code:"zh-CN",labelKey:"plugins.translate.simplifiedChinese"},{code:"en",labelKey:"plugins.translate.targetEnglish"},{code:"ja",labelKey:"plugins.translate.targetJapanese"},{code:"ko",labelKey:"plugins.translate.targetKorean"},{code:"de",labelKey:"plugins.translate.targetGerman"},{code:"fr",labelKey:"plugins.translate.targetFrench"},{code:"es",labelKey:"plugins.translate.targetSpanish"}],s=W(()=>i.map(g=>({value:g.code,label:n(g.labelKey)}))),a=W({get:()=>t.targetLang,set:g=>{t.changeTarget(g)}}),d=F({x:-1,y:80}),r=F(!1),o=F({dx:0,dy:0});function c(g){if(g.target.closest(".translate-panel__handle")==null)return;r.value=!0;const f=g.currentTarget.getBoundingClientRect();o.value={dx:g.clientX-f.left,dy:g.clientY-f.top},d.value={x:f.left,y:f.top},g.preventDefault()}function h(g){r.value&&(d.value=v(g.clientX-o.value.dx,g.clientY-o.value.dy))}function u(){r.value=!1}function v(g,l){return{x:Math.max(8,Math.min(window.innerWidth-480-8,g)),y:Math.max(8,Math.min(window.innerHeight-320-8,l))}}window.addEventListener("mousemove",h),window.addEventListener("mouseup",u),xc(()=>{window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",u)});const m=W(()=>d.value.x<0?{left:`${Math.max(8,(window.innerWidth-480)/2)}px`,top:"80px"}:{left:`${d.value.x}px`,top:`${d.value.y}px`});function b(){t.retry()}return(g,l)=>{var f;return $(),Ct(ya,{to:"body"},[w(t).visible?($(),O("div",{key:0,"data-testid":"translate-panel",class:"translate-panel",style:Gt(m.value),onMousedown:c},[_("header",QQ,[_("span",eee,T(w(n)("plugins.translate.title")),1),_("button",{type:"button",class:"translate-panel__close","data-testid":"translate-close","aria-label":w(n)("plugins.translate.closePanel"),onClick:l[0]||(l[0]=(...p)=>w(t).close&&w(t).close(...p))},"×",8,tee)]),_("section",nee,[_("div",iee,[et(T(w(n)("plugins.translate.source"))+" ",1),(f=w(t).result)!=null&&f.detectedSrcLang&&w(t).result.detectedSrcLang!=="unknown"?($(),O("span",see,"· "+T(w(n)("plugins.translate.detected",{lang:w(t).result.detectedSrcLang})),1)):Q("",!0)]),_("pre",ree,T(w(t).source),1)]),_("section",oee,[_("label",aee,T(w(n)("plugins.translate.target")),1),_("div",lee,[Pe(qn,{modelValue:a.value,"onUpdate:modelValue":l[1]||(l[1]=p=>a.value=p),options:s.value,"aria-label":w(n)("plugins.translate.target")},null,8,["modelValue","options","aria-label"])])]),_("section",cee,[w(t).loading?($(),O("div",dee,T(w(n)("plugins.translate.translating")),1)):w(t).error?($(),O("div",uee,[_("div",null,T(w(t).error.message),1),_("button",{type:"button",onClick:b},T(w(n)("common.retry")),1)])):w(t).result?($(),O("div",hee,T(w(t).result.translated),1)):($(),O("div",fee,T(w(n)("plugins.translate.noResult")),1))]),w(t).history.length>0?($(),O("details",pee,[_("summary",null,T(w(n)("plugins.translate.recent",{count:w(t).history.length})),1),_("ul",null,[($(!0),O(Me,null,st(w(t).history,(p,y)=>($(),O("li",{key:y},[_("button",{type:"button",class:"translate-panel__history-row",onClick:C=>w(t).restoreFromHistory(p)},[_("span",gee,T(p.source.slice(0,60)),1),l[2]||(l[2]=_("span",{class:"translate-panel__history-arrow"},"→",-1)),_("span",mee,T(p.translated.slice(0,60)),1)],8,vee)]))),128))])])):Q("",!0)],36)):Q("",!0)])}}}),yee=kt(_ee,[["__scopeId","data-v-be75a3d1"]]);var Eg;(e=>{class t{constructor(o={}){q(this,"in_per_sec");q(this,"out_per_sec");typeof o=="string"&&(o=JSON.parse(o)),this.in_per_sec=o.in_per_sec,this.out_per_sec=o.out_per_sec}static createFrom(o={}){return new t(o)}}e.ByteStats=t;class n{constructor(o={}){q(this,"at_ms");q(this,"rtt_ms");typeof o=="string"&&(o=JSON.parse(o)),this.at_ms=o.at_ms,this.rtt_ms=o.rtt_ms}static createFrom(o={}){return new n(o)}}e.RTTSample=n;class i{constructor(o={}){q(this,"last_ms");q(this,"p50_ms");q(this,"p95_ms");typeof o=="string"&&(o=JSON.parse(o)),this.last_ms=o.last_ms,this.p50_ms=o.p50_ms,this.p95_ms=o.p95_ms}static createFrom(o={}){return new i(o)}}e.RTTStats=i;class s{constructor(o={}){q(this,"at_ms");q(this,"reason");q(this,"duration_ms");typeof o=="string"&&(o=JSON.parse(o)),this.at_ms=o.at_ms,this.reason=o.reason,this.duration_ms=o.duration_ms}static createFrom(o={}){return new s(o)}}e.ReconnectEvent=s;class a{constructor(o={}){q(this,"count_last_hour");q(this,"last_at_ms");q(this,"last_reason");q(this,"history");typeof o=="string"&&(o=JSON.parse(o)),this.count_last_hour=o.count_last_hour,this.last_at_ms=o.last_at_ms,this.last_reason=o.last_reason,this.history=this.convertValues(o.history,s)}static createFrom(o={}){return new a(o)}convertValues(o,c,h=!1){if(!o)return o;if(o.slice&&o.map)return o.map(u=>this.convertValues(u,c));if(typeof o=="object"){if(h){for(const u of Object.keys(o))o[u]=new c(o[u]);return o}return new c(o)}return o}}e.ReconnectStats=a;class d{constructor(o={}){q(this,"state");q(this,"rtt");q(this,"rtt_samples");q(this,"reconnect");q(this,"bytes");q(this,"seq_gaps");typeof o=="string"&&(o=JSON.parse(o)),this.state=o.state,this.rtt=this.convertValues(o.rtt,i),this.rtt_samples=this.convertValues(o.rtt_samples,n),this.reconnect=this.convertValues(o.reconnect,a),this.bytes=this.convertValues(o.bytes,t),this.seq_gaps=o.seq_gaps}static createFrom(o={}){return new d(o)}convertValues(o,c,h=!1){if(!o)return o;if(o.slice&&o.map)return o.map(u=>this.convertValues(u,c));if(typeof o=="object"){if(h){for(const u of Object.keys(o))o[u]=new c(o[u]);return o}return new c(o)}return o}}e.Snapshot=d})(Eg||(Eg={}));var Pg;(e=>{class t{constructor(i={}){q(this,"AppID");q(this,"AppSecret");q(this,"EncryptKey");q(this,"VerifyToken");typeof i=="string"&&(i=JSON.parse(i)),this.AppID=i.AppID,this.AppSecret=i.AppSecret,this.EncryptKey=i.EncryptKey,this.VerifyToken=i.VerifyToken}static createFrom(i={}){return new t(i)}}e.Credentials=t})(Pg||(Pg={}));var Lg;(e=>{class t{constructor(i={}){q(this,"enabled");q(this,"binary_path");q(this,"binary_ok");q(this,"binary_version");q(this,"settings_path");q(this,"settings_ok");q(this,"last_error");q(this,"last_check");typeof i=="string"&&(i=JSON.parse(i)),this.enabled=i.enabled,this.binary_path=i.binary_path,this.binary_ok=i.binary_ok,this.binary_version=i.binary_version,this.settings_path=i.settings_path,this.settings_ok=i.settings_ok,this.last_error=i.last_error,this.last_check=i.last_check}static createFrom(i={}){return new t(i)}}e.State=t})(Lg||(Lg={}));var ih;(e=>{class t{constructor(R={}){q(this,"kind");q(this,"session_id");q(this,"captured_at_unix");typeof R=="string"&&(R=JSON.parse(R)),this.kind=R.kind,this.session_id=R.session_id,this.captured_at_unix=R.captured_at_unix}static createFrom(R={}){return new t(R)}}e.AIInfo=t;class n{constructor(R={}){q(this,"host");q(this,"fingerprint");typeof R=="string"&&(R=JSON.parse(R)),this.host=R.host,this.fingerprint=R.fingerprint}static createFrom(R={}){return new n(R)}}e.AcceptedHostKey=n;class i{constructor(R={}){q(this,"host_id");q(this,"rule_id");q(this,"kind");q(this,"listen_addr");q(this,"target");q(this,"conns");q(this,"started_at");q(this,"running");q(this,"error");typeof R=="string"&&(R=JSON.parse(R)),this.host_id=R.host_id,this.rule_id=R.rule_id,this.kind=R.kind,this.listen_addr=R.listen_addr,this.target=R.target,this.conns=R.conns,this.started_at=R.started_at,this.running=R.running,this.error=R.error}static createFrom(R={}){return new i(R)}}e.ActiveForward=i;class s{constructor(R={}){q(this,"kind");q(this,"text");q(this,"filename");q(this,"content_type");q(this,"data_base64");q(this,"reason");typeof R=="string"&&(R=JSON.parse(R)),this.kind=R.kind,this.text=R.text,this.filename=R.filename,this.content_type=R.content_type,this.data_base64=R.data_base64,this.reason=R.reason}static createFrom(R={}){return new s(R)}}e.ClipboardPastePayload=s;class a{constructor(R={}){q(this,"atterm_export");q(this,"exported_at");q(this,"app_version");q(this,"preferences");typeof R=="string"&&(R=JSON.parse(R)),this.atterm_export=R.atterm_export,this.exported_at=R.exported_at,this.app_version=R.app_version,this.preferences=R.preferences}static createFrom(R={}){return new a(R)}}e.ConfigExport=a;class d{constructor(R={}){q(this,"default_shell");q(this,"locale");q(this,"terminal_theme");q(this,"notifications_enabled");q(this,"shell_integration_enabled");q(this,"webgl_renderer_enabled");q(this,"logging_enabled");q(this,"log_file_path");q(this,"auto_check_updates");q(this,"command_notify_threshold_seconds");typeof R=="string"&&(R=JSON.parse(R)),this.default_shell=R.default_shell,this.locale=R.locale,this.terminal_theme=R.terminal_theme,this.notifications_enabled=R.notifications_enabled,this.shell_integration_enabled=R.shell_integration_enabled,this.webgl_renderer_enabled=R.webgl_renderer_enabled,this.logging_enabled=R.logging_enabled,this.log_file_path=R.log_file_path,this.auto_check_updates=R.auto_check_updates,this.command_notify_threshold_seconds=R.command_notify_threshold_seconds}static createFrom(R={}){return new d(R)}}e.ConfigSummary=d;class r{constructor(R={}){q(this,"timestamp");q(this,"message");typeof R=="string"&&(R=JSON.parse(R)),this.timestamp=R.timestamp,this.message=R.message}static createFrom(R={}){return new r(R)}}e.RelayErrorEntry=r;class o{constructor(R={}){q(this,"generated_at");q(this,"app_version");q(this,"os");q(this,"arch");q(this,"os_version");q(this,"webview_summary");q(this,"user_agent");q(this,"relay_url");q(this,"relay_status");q(this,"relay_token_redacted");q(this,"allow_insecure_relay");q(this,"remote_permission");q(this,"uplink_paused");q(this,"recent_relay_errors");q(this,"config");typeof R=="string"&&(R=JSON.parse(R)),this.generated_at=R.generated_at,this.app_version=R.app_version,this.os=R.os,this.arch=R.arch,this.os_version=R.os_version,this.webview_summary=R.webview_summary,this.user_agent=R.user_agent,this.relay_url=R.relay_url,this.relay_status=R.relay_status,this.relay_token_redacted=R.relay_token_redacted,this.allow_insecure_relay=R.allow_insecure_relay,this.remote_permission=R.remote_permission,this.uplink_paused=R.uplink_paused,this.recent_relay_errors=this.convertValues(R.recent_relay_errors,r),this.config=this.convertValues(R.config,d)}static createFrom(R={}){return new o(R)}convertValues(R,we,ht=!1){if(!R)return R;if(R.slice&&R.map)return R.map(Ne=>this.convertValues(Ne,we));if(typeof R=="object"){if(ht){for(const Ne of Object.keys(R))R[Ne]=new we(R[Ne]);return R}return new we(R)}return R}}e.DiagnosticsPayload=o;class c{constructor(R={}){q(this,"name");q(this,"isDir");q(this,"size");q(this,"modTime");typeof R=="string"&&(R=JSON.parse(R)),this.name=R.name,this.isDir=R.isDir,this.size=R.size,this.modTime=R.modTime}static createFrom(R={}){return new c(R)}}e.DirEntry=c;class h{constructor(R={}){q(this,"url");q(this,"session_token");typeof R=="string"&&(R=JSON.parse(R)),this.url=R.url,this.session_token=R.session_token}static createFrom(R={}){return new h(R)}}e.Endpoint=h;class u{constructor(R={}){q(this,"enabled");q(this,"auto_attach");typeof R=="string"&&(R=JSON.parse(R)),this.enabled=R.enabled,this.auto_attach=R.auto_attach}static createFrom(R={}){return new u(R)}}e.FeishuRemoteTerminalSettings=u;class v{constructor(R={}){q(this,"enabled");q(this,"mode");q(this,"bound");q(this,"open_id");q(this,"disabled");q(this,"relay_disabled");q(this,"error");q(this,"configured");q(this,"app_id");q(this,"app_id_hash");q(this,"callback_url");typeof R=="string"&&(R=JSON.parse(R)),this.enabled=R.enabled,this.mode=R.mode,this.bound=R.bound,this.open_id=R.open_id,this.disabled=R.disabled,this.relay_disabled=R.relay_disabled,this.error=R.error,this.configured=R.configured,this.app_id=R.app_id,this.app_id_hash=R.app_id_hash,this.callback_url=R.callback_url}static createFrom(R={}){return new v(R)}}e.FeishuStatusResp=v;class m{constructor(R={}){q(this,"path");q(this,"data");q(this,"isBinary");q(this,"truncatedAt");typeof R=="string"&&(R=JSON.parse(R)),this.path=R.path,this.data=R.data,this.isBinary=R.isBinary,this.truncatedAt=R.truncatedAt}static createFrom(R={}){return new m(R)}}e.FileContent=m;class b{constructor(R={}){q(this,"enabled");q(this,"panelWidthPx");q(this,"panelCollapsed");q(this,"innerTreeRatio");q(this,"showHidden");q(this,"showLineNumbers");typeof R=="string"&&(R=JSON.parse(R)),this.enabled=R.enabled,this.panelWidthPx=R.panelWidthPx,this.panelCollapsed=R.panelCollapsed,this.innerTreeRatio=R.innerTreeRatio,this.showHidden=R.showHidden,this.showLineNumbers=R.showLineNumbers}static createFrom(R={}){return new b(R)}}e.FileExplorerConfig=b;class g{constructor(R={}){q(this,"path");q(this,"size");q(this,"modTime");q(this,"isBinary");typeof R=="string"&&(R=JSON.parse(R)),this.path=R.path,this.size=R.size,this.modTime=R.modTime,this.isBinary=R.isBinary}static createFrom(R={}){return new g(R)}}e.FileMetaInfo=g;class l{constructor(R={}){q(this,"id");q(this,"kind");q(this,"bind_addr");q(this,"bind_port");q(this,"target_host");q(this,"target_port");q(this,"note");typeof R=="string"&&(R=JSON.parse(R)),this.id=R.id,this.kind=R.kind,this.bind_addr=R.bind_addr,this.bind_port=R.bind_port,this.target_host=R.target_host,this.target_port=R.target_port,this.note=R.note}static createFrom(R={}){return new l(R)}}e.ForwardRule=l;class f{constructor(R={}){q(this,"timestamp_ms");q(this,"level");q(this,"tag");q(this,"message");typeof R=="string"&&(R=JSON.parse(R)),this.timestamp_ms=R.timestamp_ms,this.level=R.level,this.tag=R.tag,this.message=R.message}static createFrom(R={}){return new f(R)}}e.FrontendLogRecord=f;class p{constructor(R={}){q(this,"host_id");q(this,"host");q(this,"user");typeof R=="string"&&(R=JSON.parse(R)),this.host_id=R.host_id,this.host=R.host,this.user=R.user}static createFrom(R={}){return new p(R)}}e.HostInfo=p;class y{constructor(R={}){q(this,"key");q(this,"action");q(this,"detail");typeof R=="string"&&(R=JSON.parse(R)),this.key=R.key,this.action=R.action,this.detail=R.detail}static createFrom(R={}){return new y(R)}}e.ImportChange=y;class C{constructor(R={}){q(this,"changes");q(this,"skipped");typeof R=="string"&&(R=JSON.parse(R)),this.changes=this.convertValues(R.changes,y),this.skipped=R.skipped}static createFrom(R={}){return new C(R)}convertValues(R,we,ht=!1){if(!R)return R;if(R.slice&&R.map)return R.map(Ne=>this.convertValues(Ne,we));if(typeof R=="object"){if(ht){for(const Ne of Object.keys(R))R[Ne]=new we(R[Ne]);return R}return new we(R)}return R}}e.ImportPreview=C;class k{constructor(R={}){q(this,"applied");q(this,"skipped");typeof R=="string"&&(R=JSON.parse(R)),this.applied=this.convertValues(R.applied,y),this.skipped=R.skipped}static createFrom(R={}){return new k(R)}convertValues(R,we,ht=!1){if(!R)return R;if(R.slice&&R.map)return R.map(Ne=>this.convertValues(Ne,we));if(typeof R=="object"){if(ht){for(const Ne of Object.keys(R))R[Ne]=new we(R[Ne]);return R}return new we(R)}return R}}e.ImportReport=k;class E{constructor(R={}){q(this,"host");q(this,"fingerprint");typeof R=="string"&&(R=JSON.parse(R)),this.host=R.host,this.fingerprint=R.fingerprint}static createFrom(R={}){return new E(R)}}e.KnownHostEntry=E;class I{constructor(R={}){q(this,"path");q(this,"exists");q(this,"truncated");q(this,"content");typeof R=="string"&&(R=JSON.parse(R)),this.path=R.path,this.exists=R.exists,this.truncated=R.truncated,this.content=R.content}static createFrom(R={}){return new I(R)}}e.LogPreview=I;class S{constructor(R={}){q(this,"enabled");q(this,"path");q(this,"effective_path");q(this,"dev_dual_output");q(this,"level");typeof R=="string"&&(R=JSON.parse(R)),this.enabled=R.enabled,this.path=R.path,this.effective_path=R.effective_path,this.dev_dual_output=R.dev_dual_output,this.level=R.level}static createFrom(R={}){return new S(R)}}e.LoggingConfig=S;class P{constructor(R={}){q(this,"id");q(this,"session_id");q(this,"since_seq");q(this,"client_instance_id");typeof R=="string"&&(R=JSON.parse(R)),this.id=R.id,this.session_id=R.session_id,this.since_seq=R.since_seq,this.client_instance_id=R.client_instance_id}static createFrom(R={}){return new P(R)}}e.NativeDirectStartRequest=P;class A{constructor(R={}){q(this,"command");q(this,"args");q(this,"cwd");q(this,"cols");q(this,"rows");q(this,"profile_id");q(this,"ai_kind");q(this,"initial_ai_session_id");q(this,"initial_ai_command_line");typeof R=="string"&&(R=JSON.parse(R)),this.command=R.command,this.args=R.args,this.cwd=R.cwd,this.cols=R.cols,this.rows=R.rows,this.profile_id=R.profile_id,this.ai_kind=R.ai_kind,this.initial_ai_session_id=R.initial_ai_session_id,this.initial_ai_command_line=R.initial_ai_command_line}static createFrom(R={}){return new A(R)}}e.NewSessionReq=A;class L{constructor(R={}){q(this,"session_id");typeof R=="string"&&(R=JSON.parse(R)),this.session_id=R.session_id}static createFrom(R={}){return new L(R)}}e.NewSessionResp=L;class x{constructor(R={}){q(this,"token");q(this,"expires_at");q(this,"qr_url");q(this,"wrapped");typeof R=="string"&&(R=JSON.parse(R)),this.token=R.token,this.expires_at=R.expires_at,this.qr_url=R.qr_url,this.wrapped=R.wrapped}static createFrom(R={}){return new x(R)}}e.PairingTokenResponse=x;class D{constructor(R={}){q(this,"slot");q(this,"remote");q(this,"host_id");q(this,"session_id");q(this,"shell");q(this,"shell_args");q(this,"last_cwd");q(this,"session_type");q(this,"last_command_line");q(this,"title");q(this,"ai");typeof R=="string"&&(R=JSON.parse(R)),this.slot=R.slot,this.remote=R.remote,this.host_id=R.host_id,this.session_id=R.session_id,this.shell=R.shell,this.shell_args=R.shell_args,this.last_cwd=R.last_cwd,this.session_type=R.session_type,this.last_command_line=R.last_command_line,this.title=R.title,this.ai=this.convertValues(R.ai,t)}static createFrom(R={}){return new D(R)}convertValues(R,we,ht=!1){if(!R)return R;if(R.slice&&R.map)return R.map(Ne=>this.convertValues(Ne,we));if(typeof R=="object"){if(ht){for(const Ne of Object.keys(R))R[Ne]=new we(R[Ne]);return R}return new we(R)}return R}}e.PaneSnapshot=D;class M{constructor(R={}){q(this,"enabled");q(this,"aiOnly");q(this,"collapsed");q(this,"windowX");q(this,"windowY");q(this,"mutedUntilUnix");typeof R=="string"&&(R=JSON.parse(R)),this.enabled=R.enabled,this.aiOnly=R.aiOnly,this.collapsed=R.collapsed,this.windowX=R.windowX,this.windowY=R.windowY,this.mutedUntilUnix=R.mutedUntilUnix}static createFrom(R={}){return new M(R)}}e.WidgetConfig=M;class B{constructor(R={}){q(this,"bindings");typeof R=="string"&&(R=JSON.parse(R)),this.bindings=R.bindings}static createFrom(R={}){return new B(R)}}e.ShortcutsConfig=B;class z{constructor(R={}){q(this,"enabled");q(this,"provider");q(this,"baseUrl");q(this,"apiKey");q(this,"model");q(this,"defaultTargetLang");q(this,"extraParams");typeof R=="string"&&(R=JSON.parse(R)),this.enabled=R.enabled,this.provider=R.provider,this.baseUrl=R.baseUrl,this.apiKey=R.apiKey,this.model=R.model,this.defaultTargetLang=R.defaultTargetLang,this.extraParams=R.extraParams}static createFrom(R={}){return new z(R)}}e.TranslateConfig=z;class Y{constructor(R={}){q(this,"fileExplorer");q(this,"translate");q(this,"shortcuts");q(this,"widget");typeof R=="string"&&(R=JSON.parse(R)),this.fileExplorer=this.convertValues(R.fileExplorer,b),this.translate=this.convertValues(R.translate,z),this.shortcuts=this.convertValues(R.shortcuts,B),this.widget=this.convertValues(R.widget,M)}static createFrom(R={}){return new Y(R)}convertValues(R,we,ht=!1){if(!R)return R;if(R.slice&&R.map)return R.map(Ne=>this.convertValues(Ne,we));if(typeof R=="object"){if(ht){for(const Ne of Object.keys(R))R[Ne]=new we(R[Ne]);return R}return new we(R)}return R}}e.PluginConfig=Y;class U{constructor(R={}){q(this,"id");q(this,"label");q(this,"text");q(this,"hotkey");typeof R=="string"&&(R=JSON.parse(R)),this.id=R.id,this.label=R.label,this.text=R.text,this.hotkey=R.hotkey}static createFrom(R={}){return new U(R)}}e.QuickTemplate=U;class N{constructor(R={}){q(this,"name");q(this,"bytes");q(this,"received_at");typeof R=="string"&&(R=JSON.parse(R)),this.name=R.name,this.bytes=R.bytes,this.received_at=R.received_at}static createFrom(R={}){return new N(R)}}e.ReceivedFileEntry=N;class V{constructor(R={}){q(this,"session_id");q(this,"session_name");q(this,"bytes");q(this,"files");typeof R=="string"&&(R=JSON.parse(R)),this.session_id=R.session_id,this.session_name=R.session_name,this.bytes=R.bytes,this.files=this.convertValues(R.files,N)}static createFrom(R={}){return new V(R)}convertValues(R,we,ht=!1){if(!R)return R;if(R.slice&&R.map)return R.map(Ne=>this.convertValues(Ne,we));if(typeof R=="object"){if(ht){for(const Ne of Object.keys(R))R[Ne]=new we(R[Ne]);return R}return new we(R)}return R}}e.ReceivedFilesSessionEntry=V;class j{constructor(R={}){q(this,"total_bytes");q(this,"sessions");typeof R=="string"&&(R=JSON.parse(R)),this.total_bytes=R.total_bytes,this.sessions=this.convertValues(R.sessions,V)}static createFrom(R={}){return new j(R)}convertValues(R,we,ht=!1){if(!R)return R;if(R.slice&&R.map)return R.map(Ne=>this.convertValues(Ne,we));if(typeof R=="object"){if(ht){for(const Ne of Object.keys(R))R[Ne]=new we(R[Ne]);return R}return new we(R)}return R}}e.ReceivedFilesSummary=j;class G{constructor(R={}){q(this,"id");q(this,"layout");q(this,"active_pane_idx");q(this,"col_ratio");q(this,"row_ratio");q(this,"panes");typeof R=="string"&&(R=JSON.parse(R)),this.id=R.id,this.layout=R.layout,this.active_pane_idx=R.active_pane_idx,this.col_ratio=R.col_ratio,this.row_ratio=R.row_ratio,this.panes=this.convertValues(R.panes,D)}static createFrom(R={}){return new G(R)}convertValues(R,we,ht=!1){if(!R)return R;if(R.slice&&R.map)return R.map(Ne=>this.convertValues(Ne,we));if(typeof R=="object"){if(ht){for(const Ne of Object.keys(R))R[Ne]=new we(R[Ne]);return R}return new we(R)}return R}}e.TabSnapshot=G;class te{constructor(R={}){q(this,"version");q(this,"host_id");q(this,"clean_shutdown");q(this,"saved_at_unix");q(this,"active_tab_id");q(this,"tabs");typeof R=="string"&&(R=JSON.parse(R)),this.version=R.version,this.host_id=R.host_id,this.clean_shutdown=R.clean_shutdown,this.saved_at_unix=R.saved_at_unix,this.active_tab_id=R.active_tab_id,this.tabs=this.convertValues(R.tabs,G)}static createFrom(R={}){return new te(R)}convertValues(R,we,ht=!1){if(!R)return R;if(R.slice&&R.map)return R.map(Ne=>this.convertValues(Ne,we));if(typeof R=="object"){if(ht){for(const Ne of Object.keys(R))R[Ne]=new we(R[Ne]);return R}return new we(R)}return R}}e.RecoverySnapshot=te;class se{constructor(R={}){q(this,"url");q(this,"token");q(this,"session_expires_at");q(this,"allow_insecure_relay");q(this,"disable_e2ee");q(this,"remote_permission");q(this,"last_email");q(this,"connected");q(this,"remote_proxy_url");q(this,"remote_http_proxy_url");q(this,"home_instance_url");q(this,"paused");typeof R=="string"&&(R=JSON.parse(R)),this.url=R.url,this.token=R.token,this.session_expires_at=R.session_expires_at,this.allow_insecure_relay=R.allow_insecure_relay,this.disable_e2ee=R.disable_e2ee,this.remote_permission=R.remote_permission,this.last_email=R.last_email,this.connected=R.connected,this.remote_proxy_url=R.remote_proxy_url,this.remote_http_proxy_url=R.remote_http_proxy_url,this.home_instance_url=R.home_instance_url,this.paused=R.paused}static createFrom(R={}){return new se(R)}}e.RelayConfig=se;class oe{constructor(R={}){q(this,"user_id");q(this,"email");q(this,"is_admin");typeof R=="string"&&(R=JSON.parse(R)),this.user_id=R.user_id,this.email=R.email,this.is_admin=R.is_admin}static createFrom(R={}){return new oe(R)}}e.RelayMe=oe;class Fe{constructor(R={}){q(this,"id_hash");q(this,"user_agent");q(this,"ip_prefix");q(this,"created_at");q(this,"expires_at");q(this,"is_current");typeof R=="string"&&(R=JSON.parse(R)),this.id_hash=R.id_hash,this.user_agent=R.user_agent,this.ip_prefix=R.ip_prefix,this.created_at=R.created_at,this.expires_at=R.expires_at,this.is_current=R.is_current}static createFrom(R={}){return new Fe(R)}}e.RelaySessionRow=Fe;class K{constructor(R={}){q(this,"path");q(this,"entries");q(this,"truncated");q(this,"total");typeof R=="string"&&(R=JSON.parse(R)),this.path=R.path,this.entries=this.convertValues(R.entries,c),this.truncated=R.truncated,this.total=R.total}static createFrom(R={}){return new K(R)}convertValues(R,we,ht=!1){if(!R)return R;if(R.slice&&R.map)return R.map(Ne=>this.convertValues(Ne,we));if(typeof R=="object"){if(ht){for(const Ne of Object.keys(R))R[Ne]=new we(R[Ne]);return R}return new we(R)}return R}}e.SFTPListing=K;class Z{constructor(R={}){q(this,"alias");q(this,"reason");typeof R=="string"&&(R=JSON.parse(R)),this.alias=R.alias,this.reason=R.reason}static createFrom(R={}){return new Z(R)}}e.SSHConfigImportSkipped=Z;class J{constructor(R={}){q(this,"id");q(this,"alias");q(this,"host");q(this,"port");q(this,"user");q(this,"auth_kind");q(this,"key_id");q(this,"tags");q(this,"note");q(this,"startup_command");q(this,"startup_delay_ms");q(this,"identity_file");q(this,"proxy_jump");q(this,"proxy_command");q(this,"forwards");typeof R=="string"&&(R=JSON.parse(R)),this.id=R.id,this.alias=R.alias,this.host=R.host,this.port=R.port,this.user=R.user,this.auth_kind=R.auth_kind,this.key_id=R.key_id,this.tags=R.tags,this.note=R.note,this.startup_command=R.startup_command,this.startup_delay_ms=R.startup_delay_ms,this.identity_file=R.identity_file,this.proxy_jump=R.proxy_jump,this.proxy_command=R.proxy_command,this.forwards=this.convertValues(R.forwards,l)}static createFrom(R={}){return new J(R)}convertValues(R,we,ht=!1){if(!R)return R;if(R.slice&&R.map)return R.map(Ne=>this.convertValues(Ne,we));if(typeof R=="object"){if(ht){for(const Ne of Object.keys(R))R[Ne]=new we(R[Ne]);return R}return new we(R)}return R}}e.SSHHost=J;class ae{constructor(R={}){q(this,"entries");q(this,"skipped");q(this,"note");typeof R=="string"&&(R=JSON.parse(R)),this.entries=this.convertValues(R.entries,J),this.skipped=this.convertValues(R.skipped,Z),this.note=R.note}static createFrom(R={}){return new ae(R)}convertValues(R,we,ht=!1){if(!R)return R;if(R.slice&&R.map)return R.map(Ne=>this.convertValues(Ne,we));if(typeof R=="object"){if(ht){for(const Ne of Object.keys(R))R[Ne]=new we(R[Ne]);return R}return new we(R)}return R}}e.SSHConfigImportPreview=ae;class Ie{constructor(R={}){q(this,"host");q(this,"port");q(this,"user");q(this,"auth_kind");q(this,"password");q(this,"private_key");q(this,"passphrase");q(this,"cols");q(this,"rows");q(this,"accepted_host_key_host");q(this,"accepted_host_key_fingerprint");typeof R=="string"&&(R=JSON.parse(R)),this.host=R.host,this.port=R.port,this.user=R.user,this.auth_kind=R.auth_kind,this.password=R.password,this.private_key=R.private_key,this.passphrase=R.passphrase,this.cols=R.cols,this.rows=R.rows,this.accepted_host_key_host=R.accepted_host_key_host,this.accepted_host_key_fingerprint=R.accepted_host_key_fingerprint}static createFrom(R={}){return new Ie(R)}}e.SSHConnectReq=Ie;class de{constructor(R={}){q(this,"id");q(this,"name");q(this,"key_type");typeof R=="string"&&(R=JSON.parse(R)),this.id=R.id,this.name=R.name,this.key_type=R.key_type}static createFrom(R={}){return new de(R)}}e.SSHKey=de;class Le{constructor(R={}){q(this,"private_key");q(this,"passphrase");typeof R=="string"&&(R=JSON.parse(R)),this.private_key=R.private_key,this.passphrase=R.passphrase}static createFrom(R={}){return new Le(R)}}e.SSHKeySecret=Le;class xe{constructor(R={}){q(this,"service_id");q(this,"client_ticket");q(this,"client_to_host_key");q(this,"host_to_client_key");q(this,"port");q(this,"path_prefix");typeof R=="string"&&(R=JSON.parse(R)),this.service_id=R.service_id,this.client_ticket=R.client_ticket,this.client_to_host_key=R.client_to_host_key,this.host_to_client_key=R.host_to_client_key,this.port=R.port,this.path_prefix=R.path_prefix}static createFrom(R={}){return new xe(R)}}e.ServicePreviewMapping=xe;class Qe{constructor(R={}){q(this,"gateway_id");q(this,"mapping_index");q(this,"service_id");q(this,"client_ticket");q(this,"client_to_host_key");q(this,"host_to_client_key");typeof R=="string"&&(R=JSON.parse(R)),this.gateway_id=R.gateway_id,this.mapping_index=R.mapping_index,this.service_id=R.service_id,this.client_ticket=R.client_ticket,this.client_to_host_key=R.client_to_host_key,this.host_to_client_key=R.host_to_client_key}static createFrom(R={}){return new Qe(R)}}e.ServicePreviewRebindRequest=Qe;class De{constructor(R={}){q(this,"mappings");q(this,"service_id");q(this,"client_ticket");q(this,"client_to_host_key");q(this,"host_to_client_key");typeof R=="string"&&(R=JSON.parse(R)),this.mappings=this.convertValues(R.mappings,xe),this.service_id=R.service_id,this.client_ticket=R.client_ticket,this.client_to_host_key=R.client_to_host_key,this.host_to_client_key=R.host_to_client_key}static createFrom(R={}){return new De(R)}convertValues(R,we,ht=!1){if(!R)return R;if(R.slice&&R.map)return R.map(Ne=>this.convertValues(Ne,we));if(typeof R=="object"){if(ht){for(const Ne of Object.keys(R))R[Ne]=new we(R[Ne]);return R}return new we(R)}return R}}e.ServicePreviewStartRequest=De;class ne{constructor(R={}){q(this,"id");q(this,"url");typeof R=="string"&&(R=JSON.parse(R)),this.id=R.id,this.url=R.url}static createFrom(R={}){return new ne(R)}}e.ServicePreviewStartResponse=ne;class ue{constructor(R={}){q(this,"id");q(this,"name");q(this,"shell");q(this,"cwd");q(this,"startup_cmd");q(this,"env");q(this,"sync_env");typeof R=="string"&&(R=JSON.parse(R)),this.id=R.id,this.name=R.name,this.shell=R.shell,this.cwd=R.cwd,this.startup_cmd=R.startup_cmd,this.env=R.env,this.sync_env=R.sync_env}static createFrom(R={}){return new ue(R)}}e.SessionProfile=ue;class he{constructor(R={}){q(this,"deleted");typeof R=="string"&&(R=JSON.parse(R)),this.deleted=R.deleted}static createFrom(R={}){return new he(R)}}e.SignOutOthersResult=he;class Ae{constructor(R={}){q(this,"fatal");q(this,"message");q(this,"log_path");typeof R=="string"&&(R=JSON.parse(R)),this.fatal=R.fatal,this.message=R.message,this.log_path=R.log_path}static createFrom(R={}){return new Ae(R)}}e.StartupError=Ae;class ce{constructor(R={}){q(this,"state");q(this,"last_synced_at");q(this,"pending_keys");q(this,"last_error");typeof R=="string"&&(R=JSON.parse(R)),this.state=R.state,this.last_synced_at=R.last_synced_at,this.pending_keys=R.pending_keys,this.last_error=R.last_error}static createFrom(R={}){return new ce(R)}}e.SyncStatus=ce;class Je{constructor(R={}){q(this,"baseUrl");q(this,"apiKey");q(this,"body");q(this,"timeoutSeconds");typeof R=="string"&&(R=JSON.parse(R)),this.baseUrl=R.baseUrl,this.apiKey=R.apiKey,this.body=R.body,this.timeoutSeconds=R.timeoutSeconds}static createFrom(R={}){return new Je(R)}}e.TranslateHTTPRequest=Je;class ye{constructor(R={}){q(this,"status");q(this,"body");typeof R=="string"&&(R=JSON.parse(R)),this.status=R.status,this.body=R.body}static createFrom(R={}){return new ye(R)}}e.TranslateHTTPResponse=ye;class _e{constructor(R={}){q(this,"minor");q(this,"latest");q(this,"notes");q(this,"asset_url");typeof R=="string"&&(R=JSON.parse(R)),this.minor=R.minor,this.latest=R.latest,this.notes=R.notes,this.asset_url=R.asset_url}static createFrom(R={}){return new _e(R)}}e.VersionLine=_e;class Ce{constructor(R={}){q(this,"current");q(this,"latest");q(this,"available");q(this,"notes");q(this,"checking");q(this,"last_check_at");q(this,"downloading");q(this,"download_pct");q(this,"ready");q(this,"downloaded_exists");q(this,"error");q(this,"asset_url");q(this,"asset_size");q(this,"download_dir");q(this,"download_path");q(this,"lines");typeof R=="string"&&(R=JSON.parse(R)),this.current=R.current,this.latest=R.latest,this.available=R.available,this.notes=R.notes,this.checking=R.checking,this.last_check_at=R.last_check_at,this.downloading=R.downloading,this.download_pct=R.download_pct,this.ready=R.ready,this.downloaded_exists=R.downloaded_exists,this.error=R.error,this.asset_url=R.asset_url,this.asset_size=R.asset_size,this.download_dir=R.download_dir,this.download_path=R.download_path,this.lines=this.convertValues(R.lines,_e)}static createFrom(R={}){return new Ce(R)}convertValues(R,we,ht=!1){if(!R)return R;if(R.slice&&R.map)return R.map(Ne=>this.convertValues(Ne,we));if(typeof R=="object"){if(ht){for(const Ne of Object.keys(R))R[Ne]=new we(R[Ne]);return R}return new we(R)}return R}}e.UpdateState=Ce;class Be{constructor(R={}){q(this,"password");typeof R=="string"&&(R=JSON.parse(R)),this.password=R.password}static createFrom(R={}){return new Be(R)}}e.sshCredential=Be})(ih||(ih={}));const bee=$e({__name:"TranslatePanelHost",setup(e){const t=Lh(),n=Yr(),i=fn(),s=W(()=>{var d;return((d=n.cfg)==null?void 0:d.translate)??null});function a(d){return async(r,o)=>{const c=ih.TranslateHTTPRequest.createFrom({baseUrl:d.baseUrl,apiKey:d.apiKey,body:o.body,timeoutSeconds:30}),h=await eE(c);return new Response(h.body,{status:h.status,headers:{"Content-Type":"application/json"}})}}return Yi(()=>{const d=s.value;if(!d||!d.apiKey||!d.baseUrl||!d.model){t.configure({provider:{translate:async()=>{throw new Error(cn("plugins.translate.notConfigured"))}},defaultTargetLang:(d==null?void 0:d.defaultTargetLang)||"zh-CN"});return}const r=JQ({baseUrl:d.baseUrl,apiKey:d.apiKey,model:d.model,extraParams:d.extraParams},i.caps.wailsBindings?{transport:a({baseUrl:d.baseUrl,apiKey:d.apiKey})}:void 0);t.configure({provider:r,defaultTargetLang:d.defaultTargetLang})}),(d,r)=>($(),Ct(yee))}});function wee(e){const t=W(()=>{var o;return((o=e.activePane.value)==null?void 0:o.sessionId)??null}),n=W(()=>{var o;return!!((o=e.activePane.value)!=null&&o.remote)}),i=W(()=>{const o=e.activePane.value;return o?e.sessionConnectionForPane(o):null}),s=W(()=>{const o=e.activePane.value;return o?e.endpointForPane(o):null}),a=W(()=>{const o=e.activePane.value;if(!o)return null;const c=e.sessionInfoForPane(o);return(c==null?void 0:c.cwd)??null});function d(o){const c=e.activePane.value;if(!c||!c.sessionId){e.showToast(cn("app.noActiveSession"));return}const h=e.endpointForPane(c);if(!h){e.showToast(cn("app.noEndpoint"));return}e.sendToSession(c.sessionId,h,o)}const r=W(()=>e.terminalThemeId.value);return{activePane:e.activePane,activeSessionId:t,activeIsRemote:n,activeSessionConnection:i,activeEndpoint:s,activeCwd:a,terminalThemeId:r,send:d,showToast:e.showToast}}const Dg=new Map;function See(e,t){return`${e.url}|${t}`}function Cee(e,t,n){const i=See(e,t);let s=Dg.get(i);s||(s=new Fm(e,t,{}),Dg.set(i,s),s.attach()),s.sendInput(n)}function kee(e,t,n,i){if(t===n)return e;const s=e.slice(),a=s.findIndex(c=>c.id===t);if(a<0)return e;const[d]=s.splice(a,1),r=s.findIndex(c=>c.id===n);if(r<0)return s.push(d),s;const o=i==="after"?r+1:r;return s.splice(o,0,d),s}function xee(e,t,n,i,s){const a=e.find(c=>c.id===i);if(!a)return null;const d=[];for(const c of a.panes)c.sessionId&&!c.remote&&d.push(c.sessionId);const r=s!=null&&s.detachOnly?[]:d.slice(),o=new Set(r);return{localIdsToClose:r,nextTabs:e.filter(c=>c.id!==i),nextLocalList:o.size===0?t:t.filter(c=>!o.has(c.id)),wasCurrent:n===i}}function Ree(e,t,n){const i=new Set(n),s=[];for(const a of e){if(!i.has(a.id))continue;a.panes.some(r=>r.sessionId&&(r.remote||t.has(r.sessionId)))||s.push(a.id)}return s}let Fr=null,Fa=null,Vs=null,Hs=null;function Tee(){return new Promise(e=>{Hs=document.createElement("div"),Hs.style.cssText="position:fixed;top:0;left:0;width:0;height:0;overflow:hidden;pointer-events:none;visibility:hidden;",Vs=document.createElement("div"),Vs.style.cssText="position:absolute;top:0;left:0;width:400px;height:300px;",Hs.appendChild(Vs),document.body.appendChild(Hs),Fr=new L_.Terminal({fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",fontSize:13,allowProposedApi:!0}),Fa=new I_.FitAddon,Fr.loadAddon(Fa),Fr.open(Vs),requestAnimationFrame(()=>e())})}function Eee(){Fr==null||Fr.dispose(),Hs&&Hs.parentElement&&Hs.parentElement.removeChild(Hs),Fr=null,Fa=null,Vs=null,Hs=null}function Pee(e,t){if(!Fa||!Vs)return{cols:80,rows:24};Vs.style.width=`${Math.max(40,Math.floor(e))}px`,Vs.style.height=`${Math.max(40,Math.floor(t))}px`,Vs.offsetWidth;const n=Fa.proposeDimensions();return!n||!n.cols||!n.rows?{cols:80,rows:24}:{cols:n.cols,rows:n.rows}}function Tl(e){const t=document.querySelector(".main");if(!t||t.clientWidth<100||t.clientHeight<100)return{cols:80,rows:24};const n=e==="vertical"||e==="grid2x2"?2:1,i=e==="horizontal"||e==="grid2x2"?2:1,s=(t.clientWidth-(n-1)*2)/n,a=(t.clientHeight-(i-1)*2)/i;return Pee(s,a)}function Lee(e){let t=0,n=0,i=0,s=0,a=0;function d(c){i=c.clientX,s=c.clientY,!a&&(a=requestAnimationFrame(()=>{a=0,e.onDrag(t-i,n-s),t=i,n=s}))}function r(){var c;window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",r),a&&cancelAnimationFrame(a),a=0,(c=e.onEnd)==null||c.call(e)}function o(c){t=c.clientX,n=c.clientY,i=t,s=n,c.preventDefault(),window.addEventListener("mousemove",d),window.addEventListener("mouseup",r)}return{onMouseDown:o}}function Dee(e){const t=Yr(),n=K_(),i=W(()=>{var u;return((u=t.cfg)==null?void 0:u.fileExplorer.panelWidthPx)??380}),s=F(null),a=W(()=>s.value??i.value),d=W({get:()=>{var u;return((u=t.cfg)==null?void 0:u.fileExplorer.panelCollapsed)??!0},set:u=>{if(!t.cfg)return;const v=JSON.parse(JSON.stringify(t.cfg));v.fileExplorer.panelCollapsed=u,t.save(v)}});function r(){d.value=!d.value}wt(()=>n.pending,async u=>{u&&(t.isPluginEnabled("file-explorer")||await t.setEnabled("file-explorer",!0),d.value&&(d.value=!1))});const o=W(()=>t.isPluginEnabled("file-explorer")),c=W(()=>yF(e.terminalThemeId.value)?"light":"dimmed"),{onMouseDown:h}=Lee({onDrag:u=>{const v=s.value??i.value,m=Math.max(240,Math.min(v+u,window.innerWidth*.7));s.value=m},onEnd:()=>{if(s.value===null||!t.cfg){s.value=null;return}const u=JSON.parse(JSON.stringify(t.cfg));u.fileExplorer.panelWidthPx=s.value,t.save(u),s.value=null}});return{panelWidth:a,panelCollapsed:d,togglePanel:r,onPanelResizeDown:h,rightPanelHasPlugin:o,fileExplorerTheme:c}}function Iee(e,t,n,i){var s,a;return{command:e.shell||i||"/bin/sh",args:e.shell_args??[],cwd:e.last_cwd??"",cols:t,rows:n,ai_kind:((s=e.ai)==null?void 0:s.kind)??"",initial_ai_session_id:((a=e.ai)==null?void 0:a.session_id)??"",initial_ai_command_line:e.last_command_line??""}}function zl(e){return{id:e.session_id??"",command:e.shell??"",cwd:e.last_cwd??"",title:e.title??"",cols:0,rows:0,started_at:0,host_id:e.host_id??"",type:e.session_type??"",current_command:e.last_command_line??""}}const Ig="atterm.web.window_id",zb="atterm.web.tabs.v1.";function Mee(){if(crypto!=null&&crypto.randomUUID)return crypto.randomUUID();const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=Array.from(e,n=>n.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function Vb(){let e=sessionStorage.getItem(Ig);return e||(e=Mee(),sessionStorage.setItem(Ig,e)),e}function Aee(){const e=zb+Vb();try{const t=localStorage.getItem(e);return t?JSON.parse(t):null}catch{return null}}function $ee(e){const t=zb+Vb();localStorage.setItem(t,JSON.stringify(e))}function Mg(e){const t=/^#\/session\/([^?]+)(?:\?(.*))?$/.exec(e);if(!t)return{sid:null,focus:void 0,permission:void 0};const n=decodeURIComponent(t[1]),i=new URLSearchParams(t[2]??""),s=i.get("focus")==="input"?"input":void 0,a=i.get("permission")==="view"?"view":void 0;return{sid:n,focus:s,permission:a}}function Oee(e,t){const i=new URLSearchParams().toString();return`#/session/${encodeURIComponent(e)}${i?"?"+i:""}`}function Fee(e){const{enabled:t,tabs:n,currentTabId:i,currentTab:s,gotoTab:a,openRemoteAsTab:d,newId:r}=e;let o=null;function c(){o&&clearTimeout(o),o=setTimeout(()=>{o=null,$ee({tabs:n.value.map(m=>({id:m.id,layout:m.layout,active_pane_idx:m.activePaneIdx,col_ratio:m.colRatio,row_ratio:m.rowRatio,panes:m.panes.map((b,g)=>{var l,f;return{slot:g,session_id:b.sessionId??"",host_id:(l=b.lastSeenInfo)==null?void 0:l.host_id,sealed:(f=b.lastSeenInfo)==null?void 0:f.sealed}}).filter(b=>b.session_id)})),active_tab_id:i.value??""})},300)}function h(){const{sid:m}=Mg(location.hash);m&&d(m)}t&&(wt(s,m=>{const b=m==null?void 0:m.panes[m.activePaneIdx],g=(b==null?void 0:b.sessionId)??"",l=g?Oee(g):"#/";location.hash!==l&&history.replaceState({},"",l)}),wt(n,()=>{c()},{deep:!0}),It(()=>{window.addEventListener("hashchange",h)}),xc(()=>{window.removeEventListener("hashchange",h),o!==null&&window.clearTimeout(o)}));function u(m){const b=["single","vertical","horizontal","grid2x2"],g=[];let l=-1;for(const f of m.tabs){const p=b.includes(f.layout)?f.layout:"single",y={id:r(),layout:p,activePaneIdx:f.active_pane_idx,colRatio:f.col_ratio??Ai,rowRatio:f.row_ratio??Ai,panes:[]},C=Ih[p];for(let k=0;kI.slot===k);if(!E||!E.session_id){y.panes[k]={sessionId:null,remote:!1};continue}y.panes[k]={sessionId:E.session_id,remote:!0,lastSeenInfo:zl({slot:E.slot,host_id:E.host_id,session_id:E.session_id,shell:""})}}f.id===m.active_tab_id&&(l=g.length),n.value.push(y),g.push(y.id)}l>=0&&g[l]?a(g[l]):g.length>0&&a(g[0])}function v(){const m=Aee();if(m&&m.tabs.length>0)return u(m),!0;const{sid:b}=Mg(location.hash);return b?(d(b),!0):!1}return{tryRestoreOnBoot:v}}function Bee(e){return e.current_command||e.title||e.session_id.slice(0,8)}function Hee(e){const{isOpenRemoteSession:t}=e,n=F(null),i=F([]);let s=null;function a(g){return g.type==="ai"||g.task_state==="running"}function d(g){return!t(g.session_id)&&a(g)}const r=W(()=>{if(i.value.length>1)return"";const g=n.value;return g?Bee(g):""}),o=W(()=>i.value.some(g=>g.type==="ai")),c=W(()=>i.value.some(g=>g.task_state==="running")),h=W(()=>i.value.length>0&&i.value.every(g=>t(g.session_id)));function u(){n.value=null,i.value=[],s=null}function v(g,l){i.value=g,n.value=g[0]??null,s=l}function m(){const g=s;u(),g==null||g()}function b(){u()}return{pendingCloseSessions:i,pendingCloseTitle:r,pendingCloseIsAi:o,pendingCloseIsRunning:c,pendingCloseIsRemote:h,confirmCloseSession:m,cancelCloseSession:b,isCloseRiskySession:a,shouldConfirmCloseSession:d,openCloseSessionConfirm:v}}function Nee(e){if(e.ssh_host_id)return{kind:"reconnect",hostId:e.ssh_host_id};const t=(e.shell||e.title||e.last_command_line||"").trim();return t==="ssh"||t.startsWith("ssh ")?{kind:"adhoc"}:{kind:"local"}}const Uee=4;function zee(e){const{tabs:t,localList:n,localHostID:i,pendingLocalIds:s,pins:a,hasLocalPty:d,newId:r,gotoTab:o,startNewTab:c,predictCellDims:h,pauseRecoverySnapshot:u}=e,v=F({open:!1,snapshot:null});async function m(f){var C;const p=((C=v.value.snapshot)==null?void 0:C.active_tab_id)??"";if(v.value={open:!1,snapshot:null},f.length===0){d&&await c();return}const y=u==null?void 0:u();try{await l(f,p)}finally{y==null||y()}}async function b(){v.value={open:!1,snapshot:null};try{await ek()}catch(f){Pt("recovery","discard failed",{error:xt(f)})}d&&await c()}async function g(f,p){const y=new Array(f.length);let C=0;const k=Array.from({length:Math.min(Uee,f.length)},async()=>{for(;Cr()),C=f.map((D,M)=>({id:y[M],layout:D.layout,activePaneIdx:D.active_pane_idx,colRatio:D.col_ratio,rowRatio:D.row_ratio,panes:[]}));await a.ready();let k=-1;const E=(await mh())[0]??"",I=[];for(let D=0;D{const{pickIdx:M,slot:B,tab:z}=D,Y=z.panes.find(N=>N.slot===B);if(!Y)return{pickIdx:M,slot:B,pane:{sessionId:null,remote:!1}};if(Y.remote&&Y.session_id)return{pickIdx:M,slot:B,pane:{sessionId:Y.session_id,remote:!0,lastSeenInfo:zl(Y)}};if(!d)return{pickIdx:M,slot:B,pane:{sessionId:null,remote:!1}};const U=Nee(Y);if(U.kind==="reconnect")try{const N=await Hm(U.hostId),V=h(z.layout);return{pickIdx:M,slot:B,pane:{sessionId:N.session_id,remote:!1},seed:{id:N.session_id,command:Y.title||"ssh",cwd:"",title:Y.title||"ssh",type:"shell",cols:V.cols,rows:V.rows,started_at:Math.floor(Date.now()/1e3),host_id:i.value}}}catch{return{pickIdx:M,slot:B,pane:{sessionId:null,remote:!1,lastSeenInfo:zl({...Y,title:(Y.title||"ssh")+" — reconnect failed, open it again"})}}}if(U.kind==="adhoc")return{pickIdx:M,slot:B,pane:{sessionId:null,remote:!1,lastSeenInfo:zl({...Y,title:(Y.title||"ssh")+" — SSH disconnected, reconnect to resume"})}};try{const N=Y.session_id||"",V=h(z.layout),j=Iee(Y,V.cols,V.rows,E),G=await Xm(j);return{pickIdx:M,slot:B,pane:{sessionId:G.session_id,remote:!1},seed:{id:G.session_id,command:j.command,cwd:j.cwd||"",title:Y.title||j.command,type:Y.session_type||"",cols:V.cols,rows:V.rows,started_at:Math.floor(Date.now()/1e3),host_id:i.value},pinRename:N&&a.isPinned(N)?{oldSid:N,newSid:G.session_id}:void 0}}catch(N){return Pt("recovery","pane spawn failed",{error:xt(N)}),{pickIdx:M,slot:B,pane:{sessionId:null,remote:!1}}}}),P=[],A=[];for(const D of S)C[D.pickIdx].panes[D.slot]=D.pane,D.seed&&P.push(D.seed),D.pinRename&&A.push(D.pinRename);for(const D of P)s.add(D.id);const L=new Set(n.value.map(D=>D.id)),x=P.filter(D=>!L.has(D.id));x.length>0&&(n.value=[...n.value,...x]);for(const D of A)a.rename(D.oldSid,D.newSid);t.value=[...t.value,...C],k>=0&&y[k]?o(y[k]):y.length>0&&o(y[0]),await a.flushNow()}return{recoveryDialogState:v,onRecoveryRestore:m,onRecoveryDiscard:b}}function Vee(){let e=null,t=null,n=null;function i(){t==null||t.detach(),t=null,n!==null&&(window.clearInterval(n),n=null)}function s(o,c){e==null||e.detach(),e=new Qf(o,{onSessions:c.onSessions,onStatus:c.onStatus}),e.attach()}function a(o,c){i(),t=new Qf(o,{onSessions:c.onSessions,onPrefsChanged:c.onPrefsChanged,onStatus:c.onStatus}),t.attach()}function d(o,c){i(),n=window.setInterval(()=>{o()},c)}function r(){e==null||e.detach(),e=null,i()}return{attachLocal:s,attachRemoteWS:a,startRemotePoll:d,stopRemote:i,isRemoteWSAttached:()=>t!==null,detachAll:r}}function Ag(e,t){if(!e||!t)return null;try{const n=new URL(e),i=n.protocol==="https:"||n.protocol==="wss:"?"wss:":n.protocol==="http:"||n.protocol==="ws:"?"ws:":null;return!i||!n.host?null:{url:`${i}//${n.host}`,session_token:t}}catch{return null}}function Kee(e,t,n){const i=new Set(e.map(d=>d.id)),s=new Set,a=[];for(const d of n){if(i.has(d))continue;const r=t.find(o=>o.id===d);r&&(s.add(d),a.push(r))}return{localList:[...e,...a],pending:s}}function $g(e){if(e.layout!=="single"||e.panes.length!==1)return null;const t=e.panes[0];return!(t!=null&&t.remote)||!t.sessionId?null:t.sessionId}function Wee(e){const t=new Set(e.remoteSessions.map(a=>a.id));for(const a of t)e.missingSince.delete(a);const n=new Set;for(const a of e.tabs){const d=$g(a);d&&n.add(d)}for(const a of e.missingSince.keys())n.has(a)||e.missingSince.delete(a);const i=[],s=[];for(const a of e.tabs){const d=$g(a);if(!d){s.push(a);continue}if(t.has(d)){s.push(a);continue}const r=e.missingSince.get(d)??e.nowMs;if(e.missingSince.set(d,r),e.nowMs-r>=e.graceMs){e.missingSince.delete(d),i.push(a.id);continue}s.push(a)}return{tabs:s,removedTabIds:i}}function jee(e,t,n){if(!n)return{remote:!1,corrected:!1};const i=t.includes(e);return{remote:!i,corrected:i}}function qee(){return Th()}function Yee(e,t){var n,i,s;switch(e){case"pane.split-vertical-new":return t.onSplitVertical(),!0;case"pane.split-horizontal-new":return t.onSplitHorizontal(),!0;case"pane.close":return t.onClosePane(),!0;case"pane.focus-left":return t.onFocusPane("left"),!0;case"pane.focus-right":return t.onFocusPane("right"),!0;case"pane.focus-up":return t.onFocusPane("up"),!0;case"pane.focus-down":return t.onFocusPane("down"),!0;case"tab.new":return t.onNewTab(),!0;case"tab.prev":return t.onSwitchTab(-1),!0;case"tab.next":return t.onSwitchTab(1),!0;case"toggleTaskSidebar":return(n=t.onToggleTaskSidebar)==null||n.call(t),!0;case"sidebar.focus-search":return(i=t.onFocusSidebarSearch)==null||i.call(t),!0;case"terminal.search":return(s=t.onTerminalSearch)==null||s.call(t),!0}return!1}function Gee(e,t={}){const n=t.mod??qee(),i=W(()=>{var d;const a=((d=t.bindings)==null?void 0:d.value)??{};return SU(a)});function s(a){const d=Ob(a,n);if(d===null)return;const r=i.value[d];r&&Yee(r,e)&&(a.preventDefault(),a.stopPropagation())}document.addEventListener("keydown",s,{capture:!0}),wc(()=>{document.removeEventListener("keydown",s,{capture:!0})})}function Xee(e,t,n={}){const i=W(()=>{const v=new Map;for(const m of e.value)v.set(m.session_id,m);for(const m of t.value)v.set(m.session_id,m);return[...v.values()]}),s=W(()=>{const v={};for(const m of i.value){const b=m.host_id||"";(v[b]||(v[b]=[])).push(m)}for(const m of Object.keys(v))v[m].sort(tc);return v}),a=W(()=>{if(!n.localHostId)return s.value;const v={};for(const m of Object.keys(s.value))m!==n.localHostId&&(v[m]=s.value[m]);return v}),d=W(()=>{const v={};for(const[m,b]of Object.entries(s.value))v[m]=b.filter(g=>g.unread===!0).length;return v}),r=W(()=>Object.values(d.value).reduce((v,m)=>v+m,0)),o=W(()=>i.value.filter(v=>(v.task_state==="completed"||v.task_state==="failed")&&v.unread===!1).sort(X2)),c=W(()=>{const v={};for(const m of i.value){const b=m.task_state??"idle";(v[b]||(v[b]=[])).push(m)}for(const m of Object.keys(v))v[m].sort((b,g)=>tc(b,g));return v}),h=W(()=>{const v={};for(const[m,b]of Object.entries(c.value))v[m]=b.filter(g=>g.unread===!0).length;return v});function u(v){const m=s.value[v]??[];let b="idle",g=Ro("idle");for(const l of m){const f=l.task_state??"idle",p=Ro(f);p({id:g.id,layout:g.layout,active_pane_idx:g.activePaneIdx,col_ratio:g.colRatio,row_ratio:g.rowRatio,panes:g.panes.map((l,f)=>{var E;const p=l.sessionId?e.sessionInfoFor(l.sessionId):void 0,y=l.sessionId?t.get(l.sessionId):void 0,C=(p==null?void 0:p.type)==="ai",k=!!l.remote&&(!p||p.host_id!==e.localHostID.value);return{slot:f,remote:k||void 0,host_id:k?(p==null?void 0:p.host_id)??"":void 0,session_id:(!l.remote||k)&&l.sessionId?l.sessionId:void 0,shell:((E=p==null?void 0:p.command)==null?void 0:E.split(" ")[0])??"",shell_args:[],last_cwd:(p==null?void 0:p.cwd)??"",session_type:(p==null?void 0:p.type)??"",last_command_line:(p==null?void 0:p.current_command)??"",title:(p==null?void 0:p.title)??"",ai:C&&y?{...y}:void 0,ssh_host_id:(p==null?void 0:p.ssh_host_id)||void 0}})})).filter(g=>g.panes.length>0);return{version:1,host_id:"",clean_shutdown:!1,saved_at_unix:0,active_tab_id:e.currentTabId.value??"",tabs:b}}function r(){n&&(clearTimeout(n),n=null),i&&(clearTimeout(i),i=null),s=!1;try{QC(d()).catch(b=>{Pt("recovery","saveRecoverySnapshot failed",{error:xt(b)})})}catch(b){Pt("recovery","saveRecoverySnapshot failed",{error:xt(b)})}}function o(){a++,n&&(clearTimeout(n),n=null),i&&(clearTimeout(i),i=null);let b=!1;return()=>{b||(b=!0,a=Math.max(0,a-1),a===0&&s&&r())}}function c(){s=!0,!(a>0)&&(n&&clearTimeout(n),n=setTimeout(()=>{n=null,r()},Jee))}function h(){s=!0,!(a>0)&&(i||(i=setTimeout(()=>{i=null,r()},Zee)))}wt(()=>e.tabs.value.map(b=>({id:b.id,layout:b.layout,active:b.activePaneIdx,col:b.colRatio,row:b.rowRatio,paneIds:b.panes.map(g=>g.sessionId??"").join("|")})),()=>{c()},{deep:!0}),wt(e.currentTabId,()=>{h()}),wt(()=>e.tabs.value.map(b=>b.panes.map(g=>{const l=g.sessionId?e.sessionInfoFor(g.sessionId):void 0;return[g.sessionId??"",(l==null?void 0:l.type)??"",(l==null?void 0:l.title)??"",(l==null?void 0:l.cwd)??""].join("~")}).join("|")).join("||"),()=>{c()}),wt(()=>e.tabs.value.map(b=>b.panes.map(g=>{const l=g.sessionId?e.sessionInfoFor(g.sessionId):void 0;return(l==null?void 0:l.current_command)??""}).join("|")).join("||"),()=>{h()});const v=(e.onEvent??((b,g)=>fn().events.on(b,g)))("recovery:ai-sid",b=>{const g=(b==null?void 0:b.session_id)??"",l=(b==null?void 0:b.kind)??"",f=(b==null?void 0:b.ai_session_id)??"";if(!(!g||!l)&&!(l!=="claude"&&l!=="codex"&&l!=="aider")){if(!f){t.delete(g),c();return}t.set(g,{kind:l,session_id:f,captured_at_unix:Math.floor(Date.now()/1e3)}),c()}}),m=setInterval(()=>{s&&r()},Qee);return wc(()=>{v==null||v(),n&&clearTimeout(n),i&&clearTimeout(i),clearInterval(m)}),{buildSnapshot:d,flushNow:r,pause:o}}function po(e){return e.id??e.session_id??""}const tte=6,Og={idle:0,failed:1,waiting:2,running:3};function nte(e){switch(e){case"waiting_input":return"waiting";case"failed":return"failed";case"running":return"running";default:return"idle"}}function ite(e){switch(e){case"running":case"waiting_input":case"completed":case"failed":case"disconnected":case"closed":return e;default:return"idle"}}function ste(e){const t=e.trim().replace(/[/\\]+$/,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n>=0?t.slice(n+1):t}function rte(e){const t={current_command:e.current_command,title:e.title,session_id:po(e),cwd:e.cwd,type:e.type};if((e.current_command??"").trim()||(e.title??"").trim())return Jl(t);const n=ste(e.cwd??"");if(n)return n;const i=(e.command??"").trim();return i?qr({current_command:i,title:"",session_id:po(e)}):Jl(t)}function ote(e,t,n){const i=ec(e.cwd,t);return!i||i===n?"":i}function ate(e,t,n){if(t!=="running"&&t!=="waiting")return 0;const i=e.command_started_at;if(!i)return 0;const s=n-i*1e3;return s>0?s:0}function lte(e,t={}){const n=t.nowMs??Date.now(),i=t.maxRows??tte,s=(t.localHostId??"").trim(),a=t.home??"",d=t.aiOnly??!1,r=e.filter(p=>p.task_state!=="closed"&&(!d||p.type==="ai")),o=r.map(p=>{const y=nte(p.task_state),C=(p.host_id??"").trim(),k=!!s&&!!C&&C!==s,E={current_command:p.current_command,title:p.title,session_id:po(p),cwd:p.cwd,type:p.type},I=rte(p);return{row:{sessionId:po(p),title:I,subtitle:ote(p,a,I),state:y,taskState:ite(p.task_state),kind:p.type==="ai"?qr(E):"",remoteHost:k?(p.host??"").trim():"",ageMs:ate(p,y,n),lastOutputAt:p.last_output_at??0,unread:p.unread===!0},source:p}});o.sort((p,y)=>tc({...p.source,session_id:po(p.source)},{...y.source,session_id:po(y.source)}));const c=o.map(p=>p.row),h=c.filter(p=>p.state==="waiting").length,u=c.filter(p=>p.state==="failed").length,v=c.filter(p=>p.state==="running").length,m=c.filter(p=>p.unread).length,b=r.filter(p=>p.task_state==="completed").length;let g="idle";for(const p of c)Og[p.state]>Og[g]&&(g=p.state);const l=Math.max(0,c.filter(p=>p.state==="idle").length-b),f={waitingCount:h,failedCount:u,runningCount:v,completedCount:b,idleCount:l};return{mood:g,unreadCount:m,...f,...cte(m,f),rows:c.slice(0,i),attentionIds:c.filter(p=>p.state==="waiting"||p.state==="failed").map(p=>p.sessionId),overflowCount:Math.max(0,c.length-i),aiOnly:d}}function cte(e,t){const n=[];return t.failedCount>0&&n.push(`${t.failedCount} 个失败`),t.runningCount>0&&n.push(`${t.runningCount} 个在跑`),t.waitingCount>0&&n.push(`${t.waitingCount} 个等待输入`),t.completedCount>0&&n.push(`${t.completedCount} 个已完成`),{headline:e>0?`${e} 个会话有最新内容`:"暂无最新内容",subline:n.join(" · ")}}function dte(e){const t=fn(),n=Yr();if(!t.deskWidget)return;const i=t.deskWidget;let s=!1,a="";async function d(o){if(o!==s)try{o?(a||(a=await _h().catch(()=>"")),await i.start(),s=!0,await r()):(await i.stop(),s=!1)}catch(c){if(Pt("widget","lifecycle change failed",{enabled:o,error:xt(c)}),o){s=!1;try{await n.setEnabled("desk-widget",!1)}catch(h){Pt("widget","disable-after-start-failure also failed",{error:xt(h)})}}}}async function r(){var c,h;if(!s)return;const o=lte(e.sessions.value,{localHostId:e.localHostId.value,home:a,aiOnly:((h=(c=n.cfg)==null?void 0:c.widget)==null?void 0:h.aiOnly)??!1});try{await i.pushState(JSON.stringify(o))}catch(u){s=!1,Pt("widget","state push failed",{error:xt(u)})}}wt(()=>n.isPluginEnabled("desk-widget"),o=>{d(o)},{immediate:!0}),wt(e.sessions,()=>void r(),{deep:!0}),wt(()=>{var o,c;return(c=(o=n.cfg)==null?void 0:o.widget)==null?void 0:c.aiOnly},()=>void r())}const ute={key:1,class:"auth-error-banner",role:"alert"},hte={class:"auth-error-msg"},fte=["aria-label"],pte={key:4,class:"main-row"},vte={class:"main"},gte={key:0,class:"empty"},mte={key:2,class:"toast"},_te=["title"],yte=6e4,bte=3e3,wte=$e({__name:"App",setup(e,{expose:t}){const n=fn(),i=n.caps,{t:s}=Ot(),a=F(null),d=_a({});function r(ee){return d[ee]??0}const o={auth_invalid_token:"app.authInvalidToken",auth_user_disabled:"app.authUserDisabled",session_id_owner_mismatch:"app.sessionIdOwnerMismatch",forbidden:"app.forbidden"},c=W(()=>a.value?o[a.value]?s(o[a.value]):a.value:""),h=W(()=>i.localPty?s("app.startingFirstSession"):s("app.waitingForSessionSelection"));function u(){m.value="relay",Le.value=!0}function v(){m.value="account",Le.value=!0}const m=F(void 0),b=F(null),g=F(null),l=F(null),f=F(!1),p=F(""),y=F(""),C=F([]),k=F(""),E=F([]),I=F([]),S=F([]),P=new Map,A=new Set;function L(ee){return{...ee,session_id:ee.id}}const x=W(()=>E.value.map(L)),D=W(()=>I.value.map(L)),M=Xee(x,D);dte({sessions:M.all,localHostId:p});const B=xh(),z=Rh(),Y=F(!1);async function U(ee){Y.value=ee;try{await Vm(ee)}catch{}}function N(ee){Ys(ee.session_id)}function V(ee,fe){const He=ix(K.value,fe.sessionId);if(!He)return;const ke=ee.panes.findIndex(Qt=>Qt.sessionId===fe.sessionId);if(ke!==-1){ke===fe.paneIdx?Pi(s("app.sessionAlreadyInTab")):ee.panes=sx(ee.panes,ke,fe.paneIdx),ee.activePaneIdx=fe.paneIdx,uo();return}const St=ee.panes[fe.paneIdx],$t=St&&!St.sessionId?fe.paneIdx:null;if($t===null){const Qt=sv(ee.layout,ee.panes,fe.paneIdx,"vertical",ee.colRatio,ee.rowRatio);if(Qt.noop){Pi(s("app.paneFull"));return}ee.layout=Qt.layout,ee.panes=Qt.panes,ee.colRatio=Qt.colRatio,ee.rowRatio=Qt.rowRatio,ee.activePaneIdx=Qt.newPaneIdx,te(He),ee.panes[Qt.newPaneIdx]=He.pane,uo();return}te(He),ee.panes[$t]=He.pane,ee.activePaneIdx=$t,uo()}function j(ee){return _p(K.value,ee)!==null}function G(ee){const fe=_p(K.value,ee);if(uo(),!fe){Pi(s("terminal.alreadyOwnTab"));return}const He=K.value.find(ke=>ke.id===fe.tabId);He&&(Is(He,fe.paneIdx,{detachOnly:!0}),Ys(ee,fe.pane.remote))}function te(ee){if(!ee.from)return;const fe=K.value.find(He=>He.id===ee.from.tabId);fe&&Is(fe,ee.from.paneIdx,{detachOnly:!0})}function se(ee){const fe=Lr(K.value,ee.session_id);if(!fe)return;const He=K.value.find(ke=>ke.id===fe.tabId);He&&Is(He,fe.paneIdx)}function oe(ee){if(!Ve(ee)){se(ee);return}Xe([ee],()=>se(ee))}async function Fe(ee){try{await qC(ee)}catch{Pt("app","markSessionsSeen failed",{payload:JSON.stringify(ee)})}}const K=F([]),Z=F(null),J=F("loading"),ae=F(""),Ie=F(null),de=F(!1),Le=F(!1),xe=F(""),Qe=F(null),De=W(()=>{var ee;return((ee=Qe.value)==null?void 0:ee.is_admin)===!0});let ne=0;function ue(){ne++,Qe.value=null}async function he(ee="",fe=!1){const He=++ne;try{const ke=await n.relay.fetchMe();if(He!==ne)return;if(ee&&ke.user_id!==ee){Qe.value=null,Pt("app","discarded relay identity from a different authenticated user");return}Qe.value=ke}catch(ke){if(He!==ne)return;Qe.value=null,fe&&Pt("app","failed to refresh relay identity",{error:xt(ke)})}}const Ae=F(!1);wt(De,ee=>{ee||(Ae.value=!1)});const ce=F(!1),Je=F(!1),ye=F(!1);let _e=null,Ce=null,Be=null,Se=null,R=null,we=null;function ht(){if(nn.value){fd();return}if(rn==null||rn.flushNow(),Zo.value===0&&Qo.value===0){fd();return}ce.value=!0}function Ne(){ce.value=!1,fd()}function ot(){ce.value=!1}function Rt(ee){var ke;const fe=Lr(K.value,ee);if(!fe)return!1;const He=K.value.find(St=>St.id===fe.tabId);return((ke=He==null?void 0:He.panes[fe.paneIdx])==null?void 0:ke.remote)===!0}const{pendingCloseSessions:at,pendingCloseTitle:gt,pendingCloseIsAi:re,pendingCloseIsRunning:me,pendingCloseIsRemote:je,confirmCloseSession:it,cancelCloseSession:dt,isCloseRiskySession:be,shouldConfirmCloseSession:Ve,openCloseSessionConfirm:Xe}=Hee({isOpenRemoteSession:ee=>Rt(ee)});function pe(ee){const fe=ee.sessionId;if(!fe)return ee.lastSeenInfo?L(ee.lastSeenInfo):null;const He=Ii(fe,ee.remote)??Ii(fe,!ee.remote)??ee.lastSeenInfo;return He?L(He):null}function Ge(ee){return ee.filter(fe=>!fe.remote).map(pe).filter(fe=>!!fe&&be(fe))}const _t=F(!1);let Te=null;const Ye=F(_F),ft=W(()=>Us(Ye.value)),Dt=F({fontHead:"",fontSize:13,lineHeight:1,cursorStyle:"block",cursorBlink:!0,scrollback:5e3}),Yt=W(()=>ft.value.appVars),jt=F(10),Xt=Sh(),Ln=F(""),On=W(()=>Xt.value&&Ln.value!=="darwin");let rn=null;const{recoveryDialogState:on,onRecoveryRestore:Cn,onRecoveryDiscard:mn}=zee({tabs:K,localList:E,localHostID:p,pendingLocalIds:A,pins:B,hasLocalPty:i.localPty,newId:()=>At(),gotoTab:ee=>ri(ee),startNewTab:()=>Tr(),predictCellDims:Tl,pauseRecoverySnapshot:()=>rn==null?void 0:rn.pause()}),Ut=F(!1),nn=F(!1),Ft=F(null),an=F(!0);function ln(){var He;const ee=Ft.value;an.value&&(((He=ee==null?void 0:ee.tabs)==null?void 0:He.length)??0)>0&&ee?on.value={open:!0,snapshot:ee}:i.localPty&&Tr()}function bi(){Ut.value=!1,ln()}function hi(){nn.value=!0}async function fi(ee){try{const fe=new Promise(ke=>window.setTimeout(ke,ee));return await Promise.race([Km().catch(()=>{}),fe]),!!(await xo()).available}catch{return!1}}let ei=!1,Ee=null;const Ze=Vee();let mt="";const At=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():"tab-"+Math.random().toString(36).slice(2),Zt=W(()=>K.value.find(ee=>ee.id===Z.value)??null),Kt=_a(new Set);wt(Z,ee=>{ee&&Kt.add(ee)},{immediate:!0});const Hn=W(()=>K.value.filter(ee=>Kt.has(ee.id))),Yn=F(null),_n=F(null),ti=W(()=>{const ee=Zt.value;return(ee==null?void 0:ee.panes[ee.activePaneIdx])??null});wt(ti,ee=>{Yn.value=ee},{immediate:!0});const Bi=W(()=>{const ee=Zt.value;if(!ee)return null;const fe=ee.panes[ee.activePaneIdx];return fe!=null&&fe.sessionId?Ii(fe.sessionId,fe.remote)??fe.lastSeenInfo??null:(fe==null?void 0:fe.lastSeenInfo)??null});wt(()=>{const ee=Bi.value;return[ee==null?void 0:ee.type,ee==null?void 0:ee.title]},([ee,fe])=>{var ke,St;const He=ee==="ai"&&fe?fe:"AT Term";(St=(ke=n.system).windowSetTitle)==null||St.call(ke,He).catch(()=>{})},{immediate:!0});const Hi=W(()=>{var ee;return((ee=Bi.value)==null?void 0:ee.task_state)??null}),Ni=W(()=>{const ee=Bi.value;if(!ee)return"";if(ee.type==="ai"&&ee.title)return ee.title;if(ee.cwd){const He=ee.cwd.replace(/\/+$/,"");if(He==="")return"/";const ke=He.split("/").pop();if(ke)return ke}const fe=(ee.command||"").split(/\s+/)[0]||"";return fe.split("/").pop()||fe}),Ei=new Map;Rn("atterm:pluginInputSenders",Ei);const cs=_a(new Map);Rn("atterm:pluginSessionConnections",cs);const ds=wee({activePane:Yn,endpointForPane:kr,sessionInfoForPane:Gr,sessionConnectionForPane:ee=>ee.sessionId?cs.get(ee.sessionId)??null:null,sendToSession:(ee,fe,He)=>{const ke=Ei.get(ee);if(ke){ke(He);return}Cee(fe,ee,He)},showToast:Pi,terminalThemeId:Ye});Rn("atterm:pluginContext",ds);const{panelWidth:wr,panelCollapsed:Sr,togglePanel:Cr,onPanelResizeDown:us,rightPanelHasPlugin:Wo,fileExplorerTheme:jo}=Dee({terminalThemeId:Ye}),Ws=W(()=>{const ee=new Set;for(const fe of K.value)for(const He of fe.panes)He.sessionId&&ee.add(He.sessionId);return ee}),js=W(()=>Array.from(Ws.value));function kr(ee){return ee.remote?g.value:b.value}function Gr(ee){return ee.sessionId?Ii(ee.sessionId,ee.remote)??null:null}function Pi(ee){xe.value=ee,Ee!==null&&window.clearTimeout(Ee),Ee=window.setTimeout(()=>{xe.value="",Ee=null},2e3)}function Es(){const ee=new Map;for(const fe of E.value)ee.set(fe.id,fe);for(const fe of I.value)ee.set(fe.id,fe);return ee}function Ps(ee){const fe=new Set(E.value.map(ke=>ke.id)),He=[];for(const ke of K.value){let St=!1;for(let $t=0;$tfe.id));I.value=S.value.filter(fe=>!ee.has(fe.id))}function Xi(ee){const fe=Es(),He=Kee(ee,E.value,A);E.value=He.localList,A.clear();for(const ke of He.pending)A.add(ke);wi(),Ps(fe),J.value!=="ready"&&(J.value="ready")}function Si(ee){S.value=ee,wi();const fe=Wee({tabs:K.value,remoteSessions:I.value,missingSince:P,nowMs:Date.now(),graceMs:yte});fe.removedTabIds.length>0&&(K.value=fe.tabs,Z.value&&fe.removedTabIds.includes(Z.value)&&(K.value.length>0?ri(K.value[0].id):location.hash=""))}function ni(ee){Ze.attachLocal(ee,{onSessions:Xi,onStatus:fe=>{fe==="error"&&(J.value="error")}})}function hs(){n.events.emit("prefs:remote-changed",void 0)}function Ls(ee){Ze.attachRemoteWS(ee,{onSessions:Si,onPrefsChanged:hs,onStatus:fe=>{fe==="error"&&(J.value="error")}})}async function Ui(){try{Si(await CC())}catch(ee){ss("app","remote session poll failed; keeping last list",{error:xt(ee)})}}async function En(){const fe=(await n.sessions.listRemoteSessions()).map(He=>{const ke=He;return{...ke,id:ke.id??ke.session_id??""}});Si(fe)}async function xr(){const ee=await n.relay.load(),fe=ee?Li(ee):null;return g.value=fe,l.value=fe,fe?(Ls(fe),!0):(Ze.stopRemote(),S.value=[],I.value=[],!1)}function Ji(){Ze.isRemoteWSAttached()||Ze.startRemotePoll(En,3e3)}function Ds(ee,fe,He){if(Ze.stopRemote(),S.value=[],I.value=[],P.clear(),g.value=fe,l.value=He,!!ee){if(fe){Ls(fe);return}Ui(),Ze.startRemotePoll(Ui,2e3)}}async function pi(){let ee={url:"",token:"",connected:!1};try{ee=await Xl()}catch(Qi){ss("app","getRelayConfig failed; keeping last known",{error:xt(Qi)})}const fe=ee.remote_http_proxy_url??"";ee.token&&fe?am({baseURL:fe+"/relay-http",sessionToken:ee.token,expiresAt:null,allowInsecure:!1}):lm();const He=!!(ee.connected&&ee.url),ke=ee.remote_proxy_url??"",St=He&&ke?{url:ke,session_token:ee.token}:null,$t=He?Ag(ee.home_instance_url||ee.url,ee.token):null,Qt=`${He}|${(St==null?void 0:St.url)??""}|${(St==null?void 0:St.session_token)??""}|${($t==null?void 0:$t.url)??""}|${($t==null?void 0:$t.session_token)??""}`;Qt!==mt&&(mt=Qt,Ds(He,St,$t))}function ii(){i.wailsBindings&&pi()}function qo(){ii(),he()}function vi(){Le.value=!1,m.value=void 0,ii()}function Li(ee){if(!ee.token)return null;const fe=ee.homeInstanceURL||ee.url;return fe?Ag(fe,ee.token):{url:`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}`,session_token:ee.token}}async function Rr(){const ee=await Qm();Ye.value=Us(ee).id}function Xr(ee){Ye.value=Us(ee).id}async function le(){const[ee,fe,He,ke,St,$t]=await Promise.all([t_(),n_(),i_(),s_(),r_(),o_()]);Dt.value={fontHead:ee,fontSize:fe,lineHeight:He,cursorStyle:ke,cursorBlink:St,scrollback:$t}}function ve(ee){Dt.value=ee}function ge(ee){f.value=ee}function Oe(ee){jt.value=ee}async function Nt(){C.value=await d_()??[],k.value&&!C.value.some(ee=>ee.id===k.value)&&(k.value="")}function qs(){Nt()}function si(){const ee=location.hash.match(/^#\/t\/([\w-]+)$/);return ee?ee[1]:null}function Di(){const ee=si();ee&&K.value.some(fe=>fe.id===ee)&&(Z.value=ee)}function ri(ee){Z.value=ee,location.hash!=="#/t/"+ee&&(location.hash="#/t/"+ee),Ae.value=!1}function qa(ee,fe,He){K.value=kee(K.value,ee,fe,He)}function Ii(ee,fe){return(fe?I.value:E.value).find(He=>He.id===ee)}function Yo(ee){var He;const fe=ee.panes[ee.activePaneIdx];return!(fe!=null&&fe.sessionId)||fe.remote?"":((He=Ii(fe.sessionId,!1))==null?void 0:He.cwd)??""}async function Go(ee,fe,He){const ke=await mh();if(ke.length===0)throw new Error(s("app.noShellsFound"));const St=await Xm({command:ke[0],cwd:ee,cols:fe.cols,rows:fe.rows,...He?{profile_id:He}:{}});return A.add(St.session_id),E.value=[...E.value,{id:St.session_id,command:ke[0],cwd:ee||"",title:ke[0],cols:fe.cols,rows:fe.rows,started_at:Math.floor(Date.now()/1e3),host_id:p.value}],St.session_id}async function Tr(){if(!de.value){de.value=!0,ae.value="";try{const ee=Zt.value?Yo(Zt.value):"",fe=await Go(ee,Tl("single"),k.value),He=At();K.value.push({id:He,layout:"single",panes:[{sessionId:fe,remote:!1}],activePaneIdx:0,colRatio:Ai,rowRatio:Ai}),ri(He)}catch(ee){J.value="error",ae.value=(ee==null?void 0:ee.message)??String(ee)}finally{de.value=!1}}}function Ya(ee){if(A.add(ee),!E.value.some(He=>He.id===ee)){const He=Tl("single");E.value=[...E.value,{id:ee,command:"ssh",cwd:"",title:"ssh",cols:He.cols,rows:He.rows,started_at:Math.floor(Date.now()/1e3),host_id:p.value}]}const fe=At();K.value.push({id:fe,layout:"single",panes:[{sessionId:ee,remote:!1}],activePaneIdx:0,colRatio:Ai,rowRatio:Ai}),ri(fe)}function Ga(ee){Je.value=!1,ye.value=!1,Ya(ee)}function jc(ee){vi(),Ys(ee)}async function Xa(ee){const fe=Zt.value;if(!fe)return;const He=Yo(fe),ke=sv(fe.layout,fe.panes,fe.activePaneIdx,ee,fe.colRatio,fe.rowRatio);if(ke.noop){Pi(s("app.paneFull"));return}fe.layout=ke.layout,fe.panes=ke.panes,fe.activePaneIdx=ke.activePaneIdx,fe.colRatio=ke.colRatio,fe.rowRatio=ke.rowRatio;try{const St=await Go(He,Tl(ke.layout),k.value);fe.panes[ke.newPaneIdx]={sessionId:St,remote:!1}}catch(St){Pi(s("app.splitFailed",{message:(St==null?void 0:St.message)??String(St)}))}}async function qc(){const ee=Zt.value;ee&&Ja(ee,ee.activePaneIdx)}function Ja(ee,fe){const He=ee.panes[fe],ke=He?Ge([He]):[];if(ke.length>0){Xe(ke,()=>Is(ee,fe));return}Is(ee,fe)}function Is(ee,fe,He){const ke=ee.panes[fe];!(ee.layout==="single")&&(ke!=null&&ke.sessionId)&&!ke.remote&&!(He!=null&&He.detachOnly)&&Za(ke.sessionId);const $t=pP(ee.layout,ee.panes,fe,ee.colRatio,ee.rowRatio);ee.layout=$t.layout,ee.panes=$t.panes,ee.activePaneIdx=$t.activePaneIdx,ee.colRatio=$t.colRatio,ee.rowRatio=$t.rowRatio,$t.closeTab&&fs(ee.id,He)}function Za(ee){A.delete(ee);const fe=E.value.filter(He=>He.id!==ee);fe.length!==E.value.length&&(E.value=fe,wi()),hp(ee).catch(()=>{})}function fs(ee,fe){const He=xee(K.value,E.value,Z.value,ee,fe);if(He){for(const ke of He.localIdsToClose)A.delete(ke);K.value=He.nextTabs,He.nextLocalList!==E.value&&(E.value=He.nextLocalList,wi()),He.wasCurrent&&(K.value.length>0?ri(K.value[0].id):location.hash="");for(const ke of He.localIdsToClose)hp(ke).catch(()=>{})}}function Yc(ee){const fe=K.value.find(ke=>ke.id===ee),He=fe?Ge(fe.panes):[];if(He.length>0){Xe(He,()=>fs(ee));return}fs(ee)}function Zi(ee){const fe=Zt.value;if(!fe)return;const He=mP(fe.layout,fe.activePaneIdx,ee);He!==null&&(fe.activePaneIdx=He)}function Gc(ee){if(K.value.length===0)return;const fe=K.value.findIndex(ke=>ke.id===Z.value);if(fe===-1)return;const He=(fe+ee+K.value.length)%K.value.length;ri(K.value[He].id)}function Ys(ee,fe=!0){const He=Lr(K.value,ee);if(He){const $t=K.value.find(Qt=>Qt.id===He.tabId);$t&&$t.activePaneIdx!==He.paneIdx&&($t.activePaneIdx=He.paneIdx),ri(He.tabId);return}const ke=jee(ee,E.value.map($t=>$t.id),fe);ke.corrected&&Pt("app","opened a local session through the remote path",{sessionId:ee});const St=At();K.value.push({id:St,layout:"single",panes:[{sessionId:ee,remote:ke.remote}],activePaneIdx:0,colRatio:Ai,rowRatio:Ai}),ri(St)}function Xo(ee){return ee===1?"single":ee===2?"vertical":ee===3||ee===4?"grid2x2":null}function Qa(ee){return Lr(K.value,ee)}function el(ee){const fe=K.value.findIndex(He=>He.id===ee);return fe<0?0:fe+1}async function tl(){const ee=Array.from(z.selectedIds.value),fe=Xo(ee.length);if(!fe)return;for(const $t of ee){const Qt=Lr(K.value,$t);if(!Qt)continue;const Qi=K.value.find(Jr=>Jr.id===Qt.tabId);Qi&&await Is(Qi,Qt.paneIdx,{detachOnly:!0})}const He=Ih[fe],ke=new Array(He).fill(null).map(($t,Qt)=>Qtee.has(ke)),He=fe.map(nl).filter(ke=>!!ke&&be(ke));if(He.length>0){Xe(He,()=>Gs(fe));return}Gs(fe)}async function Gs(ee){for(const fe of ee){const He=Lr(K.value,fe);if(!He)continue;const ke=K.value.find(St=>St.id===He.tabId);ke&&await Is(ke,He.paneIdx)}z.clear()}function Jo(ee){var $t,Qt,Qi,Jr,Zr,ta,rl,ol;const fe=ee,He=typeof(fe==null?void 0:fe.session_id)=="string"?fe.session_id:typeof(fe==null?void 0:fe.sessionId)=="string"?fe.sessionId:"";if(!He)return;const ke=Lr(K.value,He);if(!ke){const na=I.value.some(es=>es.id===He)||!E.value.some(es=>es.id===He);Ys(He,na),(Qt=($t=n.system).windowUnminimize)==null||Qt.call($t),(Jr=(Qi=n.system).windowShow)==null||Jr.call(Qi);return}const St=K.value.find(na=>na.id===ke.tabId);St&&(St.activePaneIdx=ke.paneIdx,ri(ke.tabId),(ta=(Zr=n.system).windowUnminimize)==null||ta.call(Zr),(ol=(rl=n.system).windowShow)==null||ol.call(rl))}const Jc=W(()=>K.value.map(ee=>{const fe=ee.panes[ee.activePaneIdx],He=fe!=null&&fe.sessionId?Ii(fe.sessionId,fe.remote)??null:null,ke=!He&&(fe!=null&&fe.lastSeenInfo)?fe.lastSeenInfo:null;return{id:ee.id,layout:ee.layout,activeSession:He??ke,activeRemote:!!(fe!=null&&fe.remote),paneCount:ee.panes.length,disconnected:!He&&!!ke}})),Zc=W(()=>M.all.value.length),Zo=W(()=>{let ee=0;for(const fe of K.value)for(const He of fe.panes)He.sessionId&&!He.remote&&ee++;return ee}),Qo=W(()=>{let ee=0;for(const fe of K.value)for(const He of fe.panes)He.sessionId&&He.remote&&ee++;return ee}),Vn=F({});async function il(){Vn.value=await e_()}function sl(ee){Vn.value=ee}const ea=F(0);Gee({onSplitVertical:()=>Xa("vertical"),onSplitHorizontal:()=>Xa("horizontal"),onClosePane:qc,onFocusPane:Zi,onNewTab:()=>{i.localPty&&Tr()},onSwitchTab:Gc,onToggleTaskSidebar:()=>U(!Y.value),onFocusSidebarSearch:()=>{var ee;(ee=_n.value)==null||ee.focusSearch()},onTerminalSearch:()=>{ea.value++}},{bindings:Vn}),rn=i.wailsBindings?ete({tabs:K,currentTabId:Z,localHostID:p,sessionInfoFor:ee=>Ii(ee,!1)??Ii(ee,!0)}):null,wt([K,Z],()=>{K.value.length!==0&&(Z.value&&K.value.find(ee=>ee.id===Z.value)||ri(K.value[0].id))});const Qc=Fee({enabled:!i.wailsBindings,tabs:K,currentTabId:Z,currentTab:Zt,gotoTab:ri,openRemoteAsTab:Ys,newId:At});return It(async()=>{if(i.wailsBindings)try{Y.value=await zm()}catch{}_e=n.events.on("before-close",ht),Ce=n.events.on("notification:click",Jo),Be=n.events.on("widget:activate",Jo);try{const ke=await n.system.getEnvironment();ke!==null&&(Ln.value=(ke.platform??"").toLowerCase())}catch{}if(we=n.events.on("relay:auth-error",ke=>{const St=ke;a.value=(St==null?void 0:St.reason)??null,ue()}),Se=n.events.on("relay:auth-info",ke=>{const St=ke,$t=typeof(St==null?void 0:St.user_id)=="string"?St.user_id:"";if(!$t){ue();return}he($t,!0)}),n.events.on("relay:viewers",ke=>{const St=ke;St&&typeof St.session_id=="string"&&(d[St.session_id]=St.count??0)}),n.events.on("prefs:changed",()=>{i.wailsBindings&&(Rr(),le(),il(),Nt())}),R=n.events.on("relay:auth-restored",()=>{he("",!0),!i.wailsBindings&&(async()=>{try{await xr()&&(J.value="ready",Ji())}catch(ke){Pt("app","failed to refresh relay state after login",{error:xt(ke)})}})()}),he(),Di(),window.addEventListener("hashchange",Di),i.wailsBindings)try{const ke=await hk();if(ke!=null&&ke.fatal){Ie.value=ke,J.value="error",ae.value=ke.message;return}}catch(ke){Pt("app","failed to load startup fatal state",{error:xt(ke)})}await Tee();try{f.value=await n.directConnection.load()}catch(ke){f.value=!1,Pt("direct","failed to load direct connection preference",{error:xt(ke)})}if(i.wailsBindings)try{jt.value=await c_()}catch(ke){Pt("app","failed to load command-notify threshold",{error:xt(ke)})}let ee="",fe={version:1,host_id:"",clean_shutdown:!1,saved_at_unix:0,tabs:[]},He=!0;if(i.wailsBindings)try{ee="refreshTerminalTheme",await Rr(),ee="refreshTerminalAppearance",await le(),ee="refreshShortcutBindings",await il(),ee="refreshProfiles",await Nt(),ee="getEndpoint",b.value=await fk(),ee="getHostInfo";const ke=await Jm();p.value=ke.host_id,y.value=ke.host,ee="loadRecoverySnapshot",fe=await ZC(),He=await Gm(),ee="connectLocalSessionList",ni(b.value),ee="refreshRelayConfig",await pi()}catch(ke){const St=(ke==null?void 0:ke.name)??"Error",$t=(ke==null?void 0:ke.message)??String(ke);Gi("boot",`step "${ee}" failed`,{name:St,message:$t,stack:ke==null?void 0:ke.stack}),J.value="error",ae.value=`${ee}: ${St}: ${$t}`||s("app.wailsBindingsUnavailable");return}else try{ee="loadRelayConfig";const ke=await xr();!ke&&!i.localPty&&v(),J.value="ready",ke&&Ji()}catch(ke){const St=(ke==null?void 0:ke.name)??"Error",$t=(ke==null?void 0:ke.message)??String(ke);Gi("boot",`web: step "${ee}" failed`,{name:St,message:$t,stack:ke==null?void 0:ke.stack}),Ze.startRemotePoll(En,3e3)}i.wailsBindings&&(Te=window.setInterval(async()=>{try{const ke=await xo();_t.value=!!(ke.available||ke.ready)}catch{}},5e3));try{if(!ei&&K.value.length===0&&(ei=!0,!Qc.tryRestoreOnBoot())){if(Ft.value=fe,an.value=He,i.wailsBindings&&i.autoUpdate&&await Ym()&&await fi(bte)){Ut.value=!0;return}ln()}}catch(ke){const St=(ke==null?void 0:ke.name)??"Error",$t=(ke==null?void 0:ke.message)??String(ke);Gi("boot","auto-start failed",{name:St,message:$t,stack:ke==null?void 0:ke.stack}),J.value="error",ae.value=`autoStart: ${St}: ${$t}`}}),xc(()=>{_e==null||_e(),_e=null,Ce==null||Ce(),Ce=null,Be==null||Be(),Be=null,Se==null||Se(),Se=null,R==null||R(),R=null,we==null||we(),we=null,ue(),window.removeEventListener("hashchange",Di),Ze.detachAll(),Ee!==null&&window.clearTimeout(Ee),Te!==null&&window.clearInterval(Te),Eee()}),t({me:Qe}),(ee,fe)=>{var He;return $(),O("div",{class:nt(["app",[`fe-theme-${w(jo)}`,{"is-maximized":On.value}]]),style:Gt(Yt.value)},[w(i).windowControls?($(),Ct(b2,{key:0,status:J.value,"error-msg":ae.value,"session-count":Zc.value,"remote-endpoint":g.value,"current-title":Ni.value,"current-task-state":Hi.value},null,8,["status","error-msg","session-count","remote-endpoint","current-title","current-task-state"])):Q("",!0),Pe(zQ),Pe(GQ),a.value?($(),O("div",ute,[_("span",hte,T(c.value),1),_("button",{class:"auth-error-action",onClick:u},T(w(s)("app.openSettings")),1),_("button",{class:"auth-error-dismiss",onClick:fe[0]||(fe[0]=ke=>a.value=null),"aria-label":w(s)("app.dismiss")},"×",8,fte)])):Q("",!0),Ie.value?Q("",!0):($(),Ct(yx,{key:2,tabs:Jc.value,"current-id":Z.value,starting:de.value,"can-new-local":w(i).localPty,"update-badge":_t.value,"is-admin":De.value,"admin-open":Ae.value,profiles:C.value,"selected-profile-id":k.value,onActivate:ri,onDetachSession:G,onClose:Yc,onNew:Tr,onNewSsh:fe[1]||(fe[1]=ke=>ye.value=!0),onReorder:qa,onOpenSettings:fe[2]||(fe[2]=ke=>Le.value=!0),onToggleAdmin:fe[3]||(fe[3]=ke=>Ae.value=!Ae.value),onSelectProfile:fe[4]||(fe[4]=ke=>k.value=ke)},null,8,["tabs","current-id","starting","can-new-local","update-badge","is-admin","admin-open","profiles","selected-profile-id"])),Ie.value?($(),Ct(KZ,{key:3,fatal:Ie.value,onQuit:Ne},null,8,["fatal"])):($(),O("div",pte,[Pe(dT,{ref_key:"taskSidebarRef",ref:_n,collapsed:Y.value,"by-host":w(M).byHost.value,"primary-state-for-host":w(M).primaryStateForHost,"completed-seen":w(M).completedSeen.value,"total-unread":w(M).totalUnread.value,"by-state-groups":w(M).byState.value,"active-session-id":((He=Yn.value)==null?void 0:He.sessionId)??null,"open-session-ids":js.value,"local-host-id":p.value,"local-host":y.value,"pane-location-for":Qa,"can-detach-session":j,"tab-index-by-id":el,"onUpdate:collapsed":U,onOpen:N,onClose:oe,onDetachSession:G,onMergeSelected:tl,onCloseSelected:Xc,onMarkSeen:Fe},null,8,["collapsed","by-host","primary-state-for-host","completed-seen","total-unread","by-state-groups","active-session-id","open-session-ids","local-host-id","local-host"]),_("main",vte,[Ae.value?($(),Ct(mF,{key:0})):b.value||g.value?($(),O(Me,{key:1},[K.value.length===0?($(),O("div",gte,T(h.value),1)):Q("",!0),($(!0),O(Me,null,st(Hn.value,ke=>ct(($(),Ct($P,{key:ke.id,tab:ke,"endpoint-for":kr,"direct-endpoint":l.value,"prefer-direct":f.value,"session-info-for":Gr,"viewer-count-for":r,active:ke.id===Z.value,"terminal-theme":ft.value.xtermTheme,"command-notify-threshold-sec":jt.value,"search-request-seq":ea.value,appearance:Dt.value,"service-preview-available":!!w(n).servicePreview,onSetActivePane:St=>ke.activePaneIdx=St,onClosePane:St=>Ja(ke,St),onDropSession:St=>V(ke,St),onDetachSession:G,onToast:Pi,"onUpdate:colRatio":St=>{ke.colRatio=St},"onUpdate:rowRatio":St=>{ke.rowRatio=St}},null,8,["tab","direct-endpoint","prefer-direct","active","terminal-theme","command-notify-threshold-sec","search-request-seq","appearance","service-preview-available","onSetActivePane","onClosePane","onDropSession","onUpdate:colRatio","onUpdate:rowRatio"])),[[Ci,ke.id===Z.value]])),128))],64)):Q("",!0),xe.value?($(),O("div",mte,T(xe.value),1)):Q("",!0)]),w(i).pluginHost&&w(Wo)?($(),O(Me,{key:0},[_("button",{class:"panel-toggle",onClick:fe[5]||(fe[5]=(...ke)=>w(Cr)&&w(Cr)(...ke)),title:w(Sr)?w(s)("app.showPanel"):w(s)("app.hidePanel")},T(w(Sr)?"‹":"›"),9,_te),w(Sr)?Q("",!0):($(),O(Me,{key:0},[_("div",{class:"right-resizer",onMousedown:fe[6]||(fe[6]=(...ke)=>w(us)&&w(us)(...ke))},null,32),Pe(xg,{"slot-id":"right-panel",context:w(ds),class:"right-panel",style:Gt({flex:"0 0 "+w(wr)+"px"})},null,8,["context","style"])],64))],64)):Q("",!0)])),w(i).pluginHost?($(),Ct(xg,{key:5,"slot-id":"bottom-toolbar",context:w(ds),class:"bottom-toolbar"},null,8,["context"])):Q("",!0),w(i).pluginHost?($(),Ct(bee,{key:6})):Q("",!0),Le.value?($(),Ct(Oq,{key:7,"local-session-count":Zo.value,"remote-session-count":Qo.value,"terminal-theme-id":Ye.value,"initial-tab":m.value,onTerminalThemeChanged:Xr,onCommandNotifyThresholdChanged:Oe,onAppearanceChanged:ve,onDirectConnectionChanged:ge,onBindingsChanged:sl,onProfilesChanged:qs,onRelayConfigChanged:qo,onSessionCreated:jc,onClose:vi},null,8,["local-session-count","remote-session-count","terminal-theme-id","initial-tab"])):Q("",!0),Je.value?($(),Ct(qq,{key:8,onConnected:Ga,onCancel:fe[7]||(fe[7]=ke=>Je.value=!1)})):Q("",!0),ye.value?($(),Ct(EZ,{key:9,onConnected:Ga,onClose:fe[8]||(fe[8]=ke=>ye.value=!1)})):Q("",!0),ce.value?($(),Ct(FZ,{key:10,"local-count":Zo.value,"remote-count":Qo.value,onConfirm:Ne,onCancel:ot},null,8,["local-count","remote-count"])):Q("",!0),w(at).length>0?($(),Ct(XZ,{key:11,title:w(gt),count:w(at).length,"is-ai":w(re),"is-running":w(me),"is-remote":w(je),onConfirm:w(it),onCancel:w(dt)},null,8,["title","count","is-ai","is-running","is-remote","onConfirm","onCancel"])):Q("",!0),w(on).snapshot?($(),Ct(hQ,{key:12,open:w(on).open,snapshot:w(on).snapshot,onRestore:w(Cn),onDiscard:w(mn)},null,8,["open","snapshot","onRestore","onDiscard"])):Q("",!0),Ut.value?($(),Ct(wQ,{key:13,onDismiss:bi,onInstall:hi})):Q("",!0),Pe(MQ,{bindings:Vn.value},null,8,["bindings"])],6)}}}),Ste=kt(wte,[["__scopeId","data-v-d9036ca9"]]);function Cte(){yw(),Ef(ur.value),wt(ur,e=>{Ef(e)})}async function kte(e){var i,s;jw(),await f1(e.i18n),Cte();const t=bx(e.createPlatform);await((i=e.beforeMount)==null?void 0:i.call(e,t));const n=bw(Ste);n.use(Iw()),n.provide("platform",t),n.config.globalProperties.$platform=t,n.mount("#app"),await((s=e.afterMount)==null?void 0:s.call(e,t,n)),Ww("boot","renderer ready",{href:typeof location>"u"?"":location.pathname})}const xte={localPty:!1,autoUpdate:!1,pluginHost:!1,windowControls:!1,systemClipboard:!0,notifications:typeof Notification<"u",fileDialog:!0,wailsBindings:!1,capacitor:!1},Rte={async load(){const e=ww();return e?{url:e.baseURL,token:e.sessionToken??"",session_expires_at:e.expiresAt??0,allow_insecure_relay:e.allowInsecure,remote_permission:"full",last_email:"",connected:!1,...e.realmId!==void 0?{realmId:e.realmId}:{},...e.homeInstanceURL!==void 0?{homeInstanceURL:e.homeInstanceURL}:{}}:null},async save(e){am({baseURL:e.url,sessionToken:e.token||null,expiresAt:e.session_expires_at||null,allowInsecure:e.allow_insecure_relay,...e.realmId!==void 0?{realmId:e.realmId}:{},...e.homeInstanceURL!==void 0?{homeInstanceURL:e.homeInstanceURL}:{}})},async clear(){lm()},async fetchMe(){const{data:e}=await gn("/api/me");return e},async logout(){await Lw()}},Tte={async closeSession(e){await gn(`/api/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})},async listShells(){return[]},async listRemoteSessions(){const{listSessions:e}=await So(async()=>{const{listSessions:n}=await import("./sessions-BYTwjtj6.js");return{listSessions:n}},__vite__mapDeps([3,4,1,5]));return(await e()).map(n=>({...n,session_id:n.id}))},async markSessionsSeen(e){await gn("/api/sessions/seen",{method:"POST",body:JSON.stringify(e)})},async getPins(){try{const e=localStorage.getItem("atterm.pinned_session_ids.value");if(e===null)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}},async setPins(e){localStorage.setItem("atterm.pinned_session_ids.value",JSON.stringify(e));const{notifyLocalChange:t}=await So(async()=>{const{notifyLocalChange:n}=await import("./prefsSync-Dj3wNxrO.js");return{notifyLocalChange:n}},__vite__mapDeps([6,4,1]));t("pinned_session_ids")},async listRelaySessions(){const{data:e}=await gn("/api/me/sessions");return e},async revokeRelaySession(e){await gn(`/api/me/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})},async signOutOtherRelaySessions(){const{data:e}=await gn("/api/me/sessions/sign-out-others",{method:"POST"});return e}},Kb=(()=>{const e=new Map;return{on(t,n){let i=e.get(t);return i||(i=new Set,e.set(t,i)),i.add(n),()=>{i.delete(n)}},emit(t,n){const i=e.get(t);if(i)for(const s of Array.from(i))try{s(n)}catch(a){Pt("events","listener threw",{event:t,error:xt(a)})}}}})(),Ete={async showNotification(e,t,n){if(!(typeof Notification>"u"))try{const i=new Notification(e,{body:t});n&&(i.onclick=()=>Kb.emit("notification:click",n))}catch{}},async getClipboardPaste(){var e;if(typeof navigator>"u"||!((e=navigator.clipboard)!=null&&e.readText))return{kind:"none"};try{const t=await navigator.clipboard.readText();return t?{kind:"text",text:t}:{kind:"none"}}catch{return{kind:"none"}}},async openExternalURL(e){window.open(e,"_blank","noopener")},async getEnvironment(){return{buildType:"web",platform:navigator.userAgent,arch:""}},async getAppVersion(){const{fetchVersion:e}=await So(async()=>{const{fetchVersion:t}=await import("./version-DDxXxorX.js");return{fetchVersion:t}},__vite__mapDeps([7,4,1]));return e()}},Qd="atterm.quick_templates.value",Fg="atterm.templates_hidden.value",eu="atterm.aux_keys.value",tu="atterm.direct_connection.enabled",Pte={async load(){try{const e=localStorage.getItem(Qd);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}},async save(e){localStorage.setItem(Qd,JSON.stringify(e));const{notifyLocalChange:t}=await So(async()=>{const{notifyLocalChange:n}=await import("./prefsSync-Dj3wNxrO.js");return{notifyLocalChange:n}},__vite__mapDeps([6,4,1]));t("quick_templates")},async clear(){localStorage.setItem(Qd,JSON.stringify([]));const{notifyLocalChange:e}=await So(async()=>{const{notifyLocalChange:t}=await import("./prefsSync-Dj3wNxrO.js");return{notifyLocalChange:t}},__vite__mapDeps([6,4,1]));e("quick_templates")},async loadHidden(){try{return JSON.parse(localStorage.getItem(Fg)??"false")}catch{return!1}},async saveHidden(e){localStorage.setItem(Fg,JSON.stringify(e))}},Lte={async load(){try{const e=localStorage.getItem(eu);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}},async save(e){localStorage.setItem(eu,JSON.stringify(e))},async clear(){localStorage.removeItem(eu)}};function Dte(){return P1(()=>Dw()),{caps:xte,relay:Rte,sessions:Tte,system:Ete,events:Kb,templates:Pte,auxKeys:Lte,directConnection:{load:async()=>localStorage.getItem(tu)==="1",save:async e=>{e?localStorage.setItem(tu,"1"):localStorage.removeItem(tu)}}}}kte({i18n:{loadPreference:async()=>localStorage.getItem("atterm.locale"),savePreference:async e=>localStorage.setItem("atterm.locale",String(e))},createPlatform:Dte,beforeMount:e=>{const t=new Sw(Cw(),kw());xw(t);const n=()=>{t.pull().then(()=>e.events.emit("prefs:changed",void 0)).catch(()=>{})};n(),e.events.on("prefs:remote-changed",n)}});export{Zw as C,a1 as U,gs as X,Pt as a,qte as b,pn as c,Nte as d,xt as e,Ma as f,Hte as g,Kte as h,yF as i,Ute as j,jte as k,Bte as l,Wte as m,zte as n,Ot as o,fn as p,Yr as q,Lee as r,Vte as s,cn as t,K_ as u}; diff --git a/internal/relay/web-dist/assets/login-B-BiQRGX.js b/internal/relay/web-dist/assets/login-TRn4eBSs.js similarity index 89% rename from internal/relay/web-dist/assets/login-B-BiQRGX.js rename to internal/relay/web-dist/assets/login-TRn4eBSs.js index 0fe364d7..c2441bae 100644 --- a/internal/relay/web-dist/assets/login-B-BiQRGX.js +++ b/internal/relay/web-dist/assets/login-TRn4eBSs.js @@ -1 +1 @@ -import{ap as x,bH as u,a7 as I,bt as L,aI as B,bw as f,ab as C,cx as o,ak as r,ca as e,n as V,aa as l,g as q,c3 as n,j as A,k as _,m as g,B as P,ai as h,ad as S,ac as E,bi as b,am as M,h as U,cd as F,v as D,aQ as H,a9 as R}from"./useI18n-lwZlSdSx.js";import{s as T,A as j}from"./client-DMh7GjbV.js";import{g as G,a as O}from"./auth-B3RxKR1W.js";import{formatVersionLabel as Q,fetchVersion as z}from"./version-Dm8mqW3q.js";import{L as J,a as K}from"./mobile-guard-Cco5WjS8.js";import"./pwa-BO-YW0rH.js";const W={class:"auth-page"},X={class:"auth-title"},Y={class:"auth-subtitle"},Z={key:0,class:"auth-error",role:"alert"},$={class:"auth-alt"},ee={href:"/signup.html"},ae={class:"auth-version"},te=x({__name:"App",setup(re){const d=u(""),p=u(""),i=u(!1),c=u(""),v=u("dev"),{t:a}=F(),y=I(()=>Q(v.value,a));L(async()=>{try{const{admin_exists:s}=await G();if(!s){location.replace("/firstrun.html");return}}catch{}v.value=await z()});function w(s){if(s instanceof j){if(s.code==="invalid_credentials")return a("auth.errors.invalidCredentials");if(s.code==="rate_limited")return a("auth.errors.rateLimited");if(s.code==="invalid_request")return a("auth.errors.invalidRequest")}return a("auth.errors.signInFailed")}async function N(s){if(s.preventDefault(),!i.value){c.value="",i.value=!0;try{await O(d.value,p.value);const t=new URLSearchParams(location.search).get("next");location.assign(T(t))}catch(t){c.value=w(t)}finally{i.value=!1}}}const k=B();return(s,t)=>(f(),C(e(U),{theme:e(M),"theme-overrides":e(k),locale:e(b).locale,"date-locale":e(b).dateLocale},{default:o(()=>[r(e(V),null,{default:o(()=>[l("main",W,[r(J,{class:"auth-language"}),r(e(q),{class:"auth-card",bordered:!1},{default:o(()=>[l("header",X,[l("h1",null,n(e(a)("common.appName")),1),l("p",Y,n(e(a)("auth.signIn")),1)]),r(e(A),{"label-placement":"top","require-mark-placement":"right-hanging",autocomplete:"on",novalidate:"",onSubmit:N},{default:o(()=>[r(e(_),{label:e(a)("auth.email"),"show-feedback":!1},{default:o(()=>[r(e(g),{value:d.value,"onUpdate:value":t[0]||(t[0]=m=>d.value=m),type:"text",placeholder:e(a)("auth.emailPlaceholder"),"input-props":{type:"email",required:!0,autocomplete:"username"}},null,8,["value","placeholder"])]),_:1},8,["label"]),r(e(_),{label:e(a)("auth.password"),"show-feedback":!1},{default:o(()=>[r(e(g),{value:p.value,"onUpdate:value":t[1]||(t[1]=m=>p.value=m),type:"password","show-password-on":"click","input-props":{required:!0,autocomplete:"current-password"}},null,8,["value"])]),_:1},8,["label"]),r(e(P),{class:"submit-btn",type:"primary","attr-type":"submit",loading:i.value,disabled:i.value,block:""},{default:o(()=>[h(n(e(a)("auth.signIn")),1)]),_:1},8,["loading","disabled"]),c.value?(f(),S("p",Z,n(c.value),1)):E("",!0),l("p",$,[h(n(e(a)("auth.haveInviteCode"))+" ",1),l("a",ee,n(e(a)("auth.signUpHere")),1),t[2]||(t[2]=h(". "))])]),_:1})]),_:1}),l("p",ae,n(y.value),1)])]),_:1})]),_:1},8,["theme","theme-overrides","locale","date-locale"]))}}),se=D(te,[["__scopeId","data-v-45a8746e"]]);K("login")||(H(),R(se).mount("#app")); +import{ap as x,bH as u,a7 as I,bt as L,aI as B,bw as f,ab as C,cx as o,ak as r,ca as e,n as V,aa as l,g as q,c3 as n,j as A,k as _,m as g,B as P,ai as h,ad as S,ac as E,bi as b,am as M,h as U,cd as F,v as D,aQ as H,a9 as R}from"./useI18n-D4u8zssu.js";import{s as T,A as j}from"./client-n-fLEpOg.js";import{g as G,a as O}from"./auth-BBmiA1GG.js";import{formatVersionLabel as Q,fetchVersion as z}from"./version-DDxXxorX.js";import{L as J,a as K}from"./mobile-guard-B4PiwDK4.js";import"./pwa-CEp47jJM.js";const W={class:"auth-page"},X={class:"auth-title"},Y={class:"auth-subtitle"},Z={key:0,class:"auth-error",role:"alert"},$={class:"auth-alt"},ee={href:"/signup.html"},ae={class:"auth-version"},te=x({__name:"App",setup(re){const d=u(""),p=u(""),i=u(!1),c=u(""),v=u("dev"),{t:a}=F(),y=I(()=>Q(v.value,a));L(async()=>{try{const{admin_exists:s}=await G();if(!s){location.replace("/firstrun.html");return}}catch{}v.value=await z()});function w(s){if(s instanceof j){if(s.code==="invalid_credentials")return a("auth.errors.invalidCredentials");if(s.code==="rate_limited")return a("auth.errors.rateLimited");if(s.code==="invalid_request")return a("auth.errors.invalidRequest")}return a("auth.errors.signInFailed")}async function N(s){if(s.preventDefault(),!i.value){c.value="",i.value=!0;try{await O(d.value,p.value);const t=new URLSearchParams(location.search).get("next");location.assign(T(t))}catch(t){c.value=w(t)}finally{i.value=!1}}}const k=B();return(s,t)=>(f(),C(e(U),{theme:e(M),"theme-overrides":e(k),locale:e(b).locale,"date-locale":e(b).dateLocale},{default:o(()=>[r(e(V),null,{default:o(()=>[l("main",W,[r(J,{class:"auth-language"}),r(e(q),{class:"auth-card",bordered:!1},{default:o(()=>[l("header",X,[l("h1",null,n(e(a)("common.appName")),1),l("p",Y,n(e(a)("auth.signIn")),1)]),r(e(A),{"label-placement":"top","require-mark-placement":"right-hanging",autocomplete:"on",novalidate:"",onSubmit:N},{default:o(()=>[r(e(_),{label:e(a)("auth.email"),"show-feedback":!1},{default:o(()=>[r(e(g),{value:d.value,"onUpdate:value":t[0]||(t[0]=m=>d.value=m),type:"text",placeholder:e(a)("auth.emailPlaceholder"),"input-props":{type:"email",required:!0,autocomplete:"username"}},null,8,["value","placeholder"])]),_:1},8,["label"]),r(e(_),{label:e(a)("auth.password"),"show-feedback":!1},{default:o(()=>[r(e(g),{value:p.value,"onUpdate:value":t[1]||(t[1]=m=>p.value=m),type:"password","show-password-on":"click","input-props":{required:!0,autocomplete:"current-password"}},null,8,["value"])]),_:1},8,["label"]),r(e(P),{class:"submit-btn",type:"primary","attr-type":"submit",loading:i.value,disabled:i.value,block:""},{default:o(()=>[h(n(e(a)("auth.signIn")),1)]),_:1},8,["loading","disabled"]),c.value?(f(),S("p",Z,n(c.value),1)):E("",!0),l("p",$,[h(n(e(a)("auth.haveInviteCode"))+" ",1),l("a",ee,n(e(a)("auth.signUpHere")),1),t[2]||(t[2]=h(". "))])]),_:1})]),_:1}),l("p",ae,n(y.value),1)])]),_:1})]),_:1},8,["theme","theme-overrides","locale","date-locale"]))}}),se=D(te,[["__scopeId","data-v-45a8746e"]]);K("login")||(H(),R(se).mount("#app")); diff --git a/internal/relay/web-dist/assets/mobile-guard-Cco5WjS8.js b/internal/relay/web-dist/assets/mobile-guard-B4PiwDK4.js similarity index 92% rename from internal/relay/web-dist/assets/mobile-guard-Cco5WjS8.js rename to internal/relay/web-dist/assets/mobile-guard-B4PiwDK4.js index dcbc06f9..fb7cdf5a 100644 --- a/internal/relay/web-dist/assets/mobile-guard-Cco5WjS8.js +++ b/internal/relay/web-dist/assets/mobile-guard-B4PiwDK4.js @@ -1 +1 @@ -import{ap as _,bw as t,ad as n,aa as o,c3 as c,ca as s,F as g,bJ as d,cd as m,v as b,b3 as v,be as h}from"./useI18n-lwZlSdSx.js";const y={class:"language-select"},C=["value"],L=["value"],k=_({__name:"LanguageSelect",setup(e){const{t:l,languageOptions:u,localePreference:i,setLocalePreference:f}=m();async function p(r){await f(r.target.value)}return(r,x)=>(t(),n("label",y,[o("span",null,c(s(l)("common.language")),1),o("select",{"data-testid":"language-select",value:s(i),onChange:p},[(t(!0),n(g,null,d(s(u),a=>(t(),n("option",{key:a.value,value:a.value},c(a.label),9,L))),128))],40,C)]))}}),S=b(k,[["__scopeId","data-v-abd76a8e"]]);function w(e){return v()?h()!==null?e==="setup"||e==="login"||e==="signup"||e==="firstrun"?(location.replace("/"),!0):!1:e==="setup"?!1:(location.replace("/setup.html"),!0):!1}export{S as L,w as a}; +import{ap as _,bw as t,ad as n,aa as o,c3 as c,ca as s,F as g,bJ as d,cd as m,v as b,b3 as v,be as h}from"./useI18n-D4u8zssu.js";const y={class:"language-select"},C=["value"],L=["value"],k=_({__name:"LanguageSelect",setup(e){const{t:l,languageOptions:u,localePreference:i,setLocalePreference:f}=m();async function p(r){await f(r.target.value)}return(r,x)=>(t(),n("label",y,[o("span",null,c(s(l)("common.language")),1),o("select",{"data-testid":"language-select",value:s(i),onChange:p},[(t(!0),n(g,null,d(s(u),a=>(t(),n("option",{key:a.value,value:a.value},c(a.label),9,L))),128))],40,C)]))}}),S=b(k,[["__scopeId","data-v-abd76a8e"]]);function w(e){return v()?h()!==null?e==="setup"||e==="login"||e==="signup"||e==="firstrun"?(location.replace("/"),!0):!1:e==="setup"?!1:(location.replace("/setup.html"),!0):!1}export{S as L,w as a}; diff --git a/internal/relay/web-dist/assets/prefsSync-C5tz9Q-s.js b/internal/relay/web-dist/assets/prefsSync-Dj3wNxrO.js similarity index 93% rename from internal/relay/web-dist/assets/prefsSync-C5tz9Q-s.js rename to internal/relay/web-dist/assets/prefsSync-Dj3wNxrO.js index 793d8e84..0986a2b7 100644 --- a/internal/relay/web-dist/assets/prefsSync-C5tz9Q-s.js +++ b/internal/relay/web-dist/assets/prefsSync-Dj3wNxrO.js @@ -1 +1 @@ -import{a as s}from"./client-DMh7GjbV.js";import"./useI18n-lwZlSdSx.js";const c=["locale_preference","quick_templates","notifications_enabled","ai_notifications_only","command_notify_threshold_seconds","shell_integration_enabled","pinned_session_ids"];class u{constructor(a,t){this.adapter=a,this.relay=t}async pull(){const a=await this.relay.get();for(const t of a){const e=this.adapter.readMeta(t.key);if(t.updated_at>e.updatedAtLocal){if(e.dirty)continue;this.adapter.writeValue(t.key,t.value),this.adapter.writeMeta(t.key,{updatedAtLocal:t.updated_at,dirty:!1})}}}markDirty(a,t){this.adapter.writeMeta(a,{updatedAtLocal:t,dirty:!0})}async push(){const a=[];for(const e of this.adapter.keys()){const i=this.adapter.readMeta(e);if(!i.dirty)continue;const o=this.adapter.readValue(e);o!==void 0&&a.push({key:e,value:o,client_updated_at:i.updatedAtLocal})}if(a.length===0)return;const t=await this.relay.put(a);for(const e of t)this.adapter.writeValue(e.key,e.value),this.adapter.writeMeta(e.key,{updatedAtLocal:e.updated_at,dirty:!1})}}function p(){const r=t=>`atterm.${t}.value`,a=t=>`atterm.${t}.meta`;return{readValue(t){const e=localStorage.getItem(r(t));if(e!==null)try{return JSON.parse(e)}catch{return}},writeValue(t,e){localStorage.setItem(r(t),JSON.stringify(e))},readMeta(t){const e=localStorage.getItem(a(t));if(e===null)return{updatedAtLocal:0,dirty:!1};try{const i=JSON.parse(e);return{updatedAtLocal:Number((i==null?void 0:i.updatedAtLocal)??0),dirty:!!(i!=null&&i.dirty)}}catch{return{updatedAtLocal:0,dirty:!1}}},writeMeta(t,e){localStorage.setItem(a(t),JSON.stringify(e))},keys(){return[...c]}}}function y(){return{async get(){const{data:r}=await s("/api/me/preferences");return r.items??[]},async put(r){const{data:a}=await s("/api/me/preferences",{method:"PUT",body:JSON.stringify({items:r})});return a.items??[]}}}let n=null;function f(r){n=r}function h(r){n&&(n.markDirty(r,Date.now()),n.push().catch(()=>{}))}export{u as PrefsSyncEngine,c as SYNCED_KEYS,y as apiRelayClient,p as localStorageAdapter,h as notifyLocalChange,f as setSharedPrefsSync}; +import{a as s}from"./client-n-fLEpOg.js";import"./useI18n-D4u8zssu.js";const c=["locale_preference","quick_templates","notifications_enabled","ai_notifications_only","command_notify_threshold_seconds","shell_integration_enabled","pinned_session_ids"];class u{constructor(a,t){this.adapter=a,this.relay=t}async pull(){const a=await this.relay.get();for(const t of a){const e=this.adapter.readMeta(t.key);if(t.updated_at>e.updatedAtLocal){if(e.dirty)continue;this.adapter.writeValue(t.key,t.value),this.adapter.writeMeta(t.key,{updatedAtLocal:t.updated_at,dirty:!1})}}}markDirty(a,t){this.adapter.writeMeta(a,{updatedAtLocal:t,dirty:!0})}async push(){const a=[];for(const e of this.adapter.keys()){const i=this.adapter.readMeta(e);if(!i.dirty)continue;const o=this.adapter.readValue(e);o!==void 0&&a.push({key:e,value:o,client_updated_at:i.updatedAtLocal})}if(a.length===0)return;const t=await this.relay.put(a);for(const e of t)this.adapter.writeValue(e.key,e.value),this.adapter.writeMeta(e.key,{updatedAtLocal:e.updated_at,dirty:!1})}}function p(){const r=t=>`atterm.${t}.value`,a=t=>`atterm.${t}.meta`;return{readValue(t){const e=localStorage.getItem(r(t));if(e!==null)try{return JSON.parse(e)}catch{return}},writeValue(t,e){localStorage.setItem(r(t),JSON.stringify(e))},readMeta(t){const e=localStorage.getItem(a(t));if(e===null)return{updatedAtLocal:0,dirty:!1};try{const i=JSON.parse(e);return{updatedAtLocal:Number((i==null?void 0:i.updatedAtLocal)??0),dirty:!!(i!=null&&i.dirty)}}catch{return{updatedAtLocal:0,dirty:!1}}},writeMeta(t,e){localStorage.setItem(a(t),JSON.stringify(e))},keys(){return[...c]}}}function y(){return{async get(){const{data:r}=await s("/api/me/preferences");return r.items??[]},async put(r){const{data:a}=await s("/api/me/preferences",{method:"PUT",body:JSON.stringify({items:r})});return a.items??[]}}}let n=null;function f(r){n=r}function h(r){n&&(n.markDirty(r,Date.now()),n.push().catch(()=>{}))}export{u as PrefsSyncEngine,c as SYNCED_KEYS,y as apiRelayClient,p as localStorageAdapter,h as notifyLocalChange,f as setSharedPrefsSync}; diff --git a/internal/relay/web-dist/assets/pwa-BO-YW0rH.js b/internal/relay/web-dist/assets/pwa-CEp47jJM.js similarity index 92% rename from internal/relay/web-dist/assets/pwa-BO-YW0rH.js rename to internal/relay/web-dist/assets/pwa-CEp47jJM.js index 84e6289f..1b0a3f77 100644 --- a/internal/relay/web-dist/assets/pwa-BO-YW0rH.js +++ b/internal/relay/web-dist/assets/pwa-CEp47jJM.js @@ -1 +1 @@ -import{_ as f}from"./useI18n-lwZlSdSx.js";import{l as p,d as y}from"./auth-B3RxKR1W.js";function g(e={}){const{immediate:n=!1,onNeedRefresh:a,onOfflineReady:r,onRegistered:i,onRegisteredSW:s,onRegisterError:o}=e;let c,d;const l=async(t=!0)=>{await d};async function u(){if("serviceWorker"in navigator){if(c=await f(async()=>{const{Workbox:t}=await import("./workbox-window.prod.es5-BqEJf4Xk.js");return{Workbox:t}},[]).then(({Workbox:t})=>new t("/sw.js",{scope:"/",type:"classic"})).catch(t=>{o==null||o(t)}),!c)return;c.addEventListener("activated",t=>{(t.isUpdate||t.isExternal)&&window.location.reload()}),c.addEventListener("installed",t=>{t.isUpdate||r==null||r()}),c.register({immediate:n}).then(t=>{s?s("/sw.js",t):i==null||i(t)}).catch(t=>{o==null||o(t)})}}return d=u(),l}const v="atterm-decrypt-sealed-body";function h(e){try{const n=e.replace(/-/g,"+").replace(/_/g,"/"),a=n.length%4===0?"":"=".repeat(4-n.length%4),r=atob(n+a),i=new Uint8Array(r.length);for(let s=0;s"u"||!("serviceWorker"in navigator))return;const e=navigator.serviceWorker;!e||typeof e.addEventListener!="function"||e.addEventListener("message",n=>{var s;const a=n.data;if(!_(a))return;const r=(s=n.ports)==null?void 0:s[0];if(!r)return;let i;try{i=m(a)}catch{i={fields:null}}try{r.postMessage(i)}catch{}})}typeof navigator<"u"&&"serviceWorker"in navigator&&(g({immediate:!0}),w()); +import{_ as f}from"./useI18n-D4u8zssu.js";import{l as p,d as y}from"./auth-BBmiA1GG.js";function g(e={}){const{immediate:n=!1,onNeedRefresh:a,onOfflineReady:r,onRegistered:i,onRegisteredSW:s,onRegisterError:o}=e;let c,d;const l=async(t=!0)=>{await d};async function u(){if("serviceWorker"in navigator){if(c=await f(async()=>{const{Workbox:t}=await import("./workbox-window.prod.es5-BqEJf4Xk.js");return{Workbox:t}},[]).then(({Workbox:t})=>new t("/sw.js",{scope:"/",type:"classic"})).catch(t=>{o==null||o(t)}),!c)return;c.addEventListener("activated",t=>{(t.isUpdate||t.isExternal)&&window.location.reload()}),c.addEventListener("installed",t=>{t.isUpdate||r==null||r()}),c.register({immediate:n}).then(t=>{s?s("/sw.js",t):i==null||i(t)}).catch(t=>{o==null||o(t)})}}return d=u(),l}const v="atterm-decrypt-sealed-body";function h(e){try{const n=e.replace(/-/g,"+").replace(/_/g,"/"),a=n.length%4===0?"":"=".repeat(4-n.length%4),r=atob(n+a),i=new Uint8Array(r.length);for(let s=0;s"u"||!("serviceWorker"in navigator))return;const e=navigator.serviceWorker;!e||typeof e.addEventListener!="function"||e.addEventListener("message",n=>{var s;const a=n.data;if(!_(a))return;const r=(s=n.ports)==null?void 0:s[0];if(!r)return;let i;try{i=m(a)}catch{i={fields:null}}try{r.postMessage(i)}catch{}})}typeof navigator<"u"&&"serviceWorker"in navigator&&(g({immediate:!0}),w()); diff --git a/internal/relay/web-dist/assets/sessions-RpM2fLHY.js b/internal/relay/web-dist/assets/sessions-BYTwjtj6.js similarity index 82% rename from internal/relay/web-dist/assets/sessions-RpM2fLHY.js rename to internal/relay/web-dist/assets/sessions-BYTwjtj6.js index ea26a0f0..19b17582 100644 --- a/internal/relay/web-dist/assets/sessions-RpM2fLHY.js +++ b/internal/relay/web-dist/assets/sessions-BYTwjtj6.js @@ -1 +1 @@ -import{a as r}from"./client-DMh7GjbV.js";import{l as c,e as a}from"./auth-B3RxKR1W.js";import"./useI18n-lwZlSdSx.js";async function p(){const{data:t}=await r("/api/sessions");return d(t)}function d(t){const e=c();return e?t.map(o=>s(o,e)):t}function s(t,e){if(!t.sealed)return t;let o;try{o=u(t.sealed)}catch{return t}const n=a(o,e,t.id);if(!n)return t;const i={...t};return n.title!==void 0&&(i.title=n.title),n.cwd!==void 0&&(i.cwd=n.cwd),n.command!==void 0&&(i.command=n.command),n.current_command!==void 0&&(i.current_command=n.current_command),i}function u(t){const e=atob(t),o=new Uint8Array(e.length);for(let n=0;ns(o,e)):t}function s(t,e){if(!t.sealed)return t;let o;try{o=u(t.sealed)}catch{return t}const n=a(o,e,t.id);if(!n)return t;const i={...t};return n.title!==void 0&&(i.title=n.title),n.cwd!==void 0&&(i.cwd=n.cwd),n.command!==void 0&&(i.command=n.command),n.current_command!==void 0&&(i.current_command=n.current_command),i}function u(t){const e=atob(t),o=new Uint8Array(e.length);for(let n=0;n!n.value||n.value==="https://"?null:_(n.value,d.value));async function k(){o.value=null;const p=_(n.value,d.value);if(p){o.value=p;return}if(!c.value.trim()){o.value=a("setup.errors.tokenRequired");return}u.value=!0;try{const t=n.value.replace(/\/$/,"")+"/api/me",r=await fetch(t,{method:"GET",headers:{Authorization:`Bearer ${c.value.trim()}`},credentials:"omit"});if(r.status===401){o.value=a("setup.errors.tokenInvalid");return}if(r.status===403){o.value=a("setup.errors.originRejected");return}if(!r.ok){o.value=a("setup.errors.relayHttpCheckUrl",{status:r.status});return}const U={baseURL:n.value.replace(/\/$/,""),sessionToken:c.value.trim(),expiresAt:null,allowInsecure:d.value};H(U),location.replace("/")}catch(t){o.value=a("setup.errors.cannotReachRelay",{message:t instanceof Error?t.message:String(t)})}finally{u.value=!1}}const C=x();return(p,t)=>(v(),m(e(F),{theme:e($),"theme-overrides":e(C),locale:e(I).locale,"date-locale":e(I).dateLocale},{default:s(()=>[l(e(L),null,{default:s(()=>[P("main",W,[l(O,{class:"setup-language"}),l(e(T),{title:e(a)("setup.connectToRelay"),class:"setup-card"},{default:s(()=>[h.value?(v(),m(e(R),{key:0,type:"warning","show-icon":!0,style:{"margin-bottom":"1rem"}},{default:s(()=>[f(b(h.value),1)]),_:1})):w("",!0),l(e(V),{onSubmit:E(k,["prevent"])},{default:s(()=>[l(e(g),j({label:e(a)("setup.relayUrl"),feedback:y.value??""},y.value?{"validation-status":"error"}:{}),{default:s(()=>[l(e(N),{value:n.value,"onUpdate:value":t[0]||(t[0]=r=>n.value=r),placeholder:e(a)("setup.relayUrlPlaceholder"),"input-props":{name:"relay-base",autocomplete:"off"},disabled:u.value},null,8,["value","placeholder","disabled"])]),_:1},16,["label","feedback"]),l(e(g),{label:e(a)("setup.token")},{default:s(()=>[l(e(N),{value:c.value,"onUpdate:value":t[1]||(t[1]=r=>c.value=r),type:"password","show-password-on":"click",placeholder:e(a)("setup.tokenPlaceholder"),"input-props":{name:"relay-token",autocomplete:"off"},disabled:u.value},null,8,["value","placeholder","disabled"])]),_:1},8,["label"]),l(e(g),{label:e(a)("setup.allowInsecure")},{default:s(()=>[l(e(J),{value:d.value,"onUpdate:value":t[2]||(t[2]=r=>d.value=r),disabled:u.value},null,8,["value","disabled"])]),_:1},8,["label"]),o.value?(v(),m(e(R),{key:0,type:"error","show-icon":!0,style:{"margin-bottom":"1rem"}},{default:s(()=>[f(b(o.value),1)]),_:1})):w("",!0),l(e(K),{justify:"end"},{default:s(()=>[l(e(M),{type:"primary",loading:u.value,disabled:u.value,"data-testid":"connect",onClick:k},{default:s(()=>[f(b(e(a)("setup.connect")),1)]),_:1},8,["loading","disabled"])]),_:1})]),_:1})]),_:1},8,["title"])])]),_:1})]),_:1},8,["theme","theme-overrides","locale","date-locale"]))}}),Y=q(X,[["__scopeId","data-v-adef5cda"]]);Q("setup")||(z(),D(Y).mount("#app")); +import{ap as A,bH as i,a7 as S,ct as _,aI as x,bw as v,ab as m,cx as s,ak as l,ca as e,n as L,aa as P,g as T,ai as f,c3 as b,ac as w,j as V,cA as E,k as g,bg as j,m as N,B as M,bi as I,am as $,h as F,cd as G,bV as H,v as q,aQ as z,a9 as D}from"./useI18n-D4u8zssu.js";import{L as O,a as Q}from"./mobile-guard-B4PiwDK4.js";import{N as R,b as J,a as K}from"./Switch-BlSJOKEO.js";const W={class:"setup-page"},X=A({__name:"App",setup(Z){const n=i("https://"),c=i(""),d=i(!1),o=i(null),u=i(!1),{t:a}=G();function B(){return new URLSearchParams(location.search).get("reason")==="token_invalid"?a("setup.reasonTokenInvalid"):null}const h=i(B()),y=S(()=>!n.value||n.value==="https://"?null:_(n.value,d.value));async function k(){o.value=null;const p=_(n.value,d.value);if(p){o.value=p;return}if(!c.value.trim()){o.value=a("setup.errors.tokenRequired");return}u.value=!0;try{const t=n.value.replace(/\/$/,"")+"/api/me",r=await fetch(t,{method:"GET",headers:{Authorization:`Bearer ${c.value.trim()}`},credentials:"omit"});if(r.status===401){o.value=a("setup.errors.tokenInvalid");return}if(r.status===403){o.value=a("setup.errors.originRejected");return}if(!r.ok){o.value=a("setup.errors.relayHttpCheckUrl",{status:r.status});return}const U={baseURL:n.value.replace(/\/$/,""),sessionToken:c.value.trim(),expiresAt:null,allowInsecure:d.value};H(U),location.replace("/")}catch(t){o.value=a("setup.errors.cannotReachRelay",{message:t instanceof Error?t.message:String(t)})}finally{u.value=!1}}const C=x();return(p,t)=>(v(),m(e(F),{theme:e($),"theme-overrides":e(C),locale:e(I).locale,"date-locale":e(I).dateLocale},{default:s(()=>[l(e(L),null,{default:s(()=>[P("main",W,[l(O,{class:"setup-language"}),l(e(T),{title:e(a)("setup.connectToRelay"),class:"setup-card"},{default:s(()=>[h.value?(v(),m(e(R),{key:0,type:"warning","show-icon":!0,style:{"margin-bottom":"1rem"}},{default:s(()=>[f(b(h.value),1)]),_:1})):w("",!0),l(e(V),{onSubmit:E(k,["prevent"])},{default:s(()=>[l(e(g),j({label:e(a)("setup.relayUrl"),feedback:y.value??""},y.value?{"validation-status":"error"}:{}),{default:s(()=>[l(e(N),{value:n.value,"onUpdate:value":t[0]||(t[0]=r=>n.value=r),placeholder:e(a)("setup.relayUrlPlaceholder"),"input-props":{name:"relay-base",autocomplete:"off"},disabled:u.value},null,8,["value","placeholder","disabled"])]),_:1},16,["label","feedback"]),l(e(g),{label:e(a)("setup.token")},{default:s(()=>[l(e(N),{value:c.value,"onUpdate:value":t[1]||(t[1]=r=>c.value=r),type:"password","show-password-on":"click",placeholder:e(a)("setup.tokenPlaceholder"),"input-props":{name:"relay-token",autocomplete:"off"},disabled:u.value},null,8,["value","placeholder","disabled"])]),_:1},8,["label"]),l(e(g),{label:e(a)("setup.allowInsecure")},{default:s(()=>[l(e(J),{value:d.value,"onUpdate:value":t[2]||(t[2]=r=>d.value=r),disabled:u.value},null,8,["value","disabled"])]),_:1},8,["label"]),o.value?(v(),m(e(R),{key:0,type:"error","show-icon":!0,style:{"margin-bottom":"1rem"}},{default:s(()=>[f(b(o.value),1)]),_:1})):w("",!0),l(e(K),{justify:"end"},{default:s(()=>[l(e(M),{type:"primary",loading:u.value,disabled:u.value,"data-testid":"connect",onClick:k},{default:s(()=>[f(b(e(a)("setup.connect")),1)]),_:1},8,["loading","disabled"])]),_:1})]),_:1})]),_:1},8,["title"])])]),_:1})]),_:1},8,["theme","theme-overrides","locale","date-locale"]))}}),Y=q(X,[["__scopeId","data-v-adef5cda"]]);Q("setup")||(z(),D(Y).mount("#app")); diff --git a/internal/relay/web-dist/assets/signup-BXhwDxUo.js b/internal/relay/web-dist/assets/signup-CLz9yc9B.js similarity index 90% rename from internal/relay/web-dist/assets/signup-BXhwDxUo.js rename to internal/relay/web-dist/assets/signup-CLz9yc9B.js index ce3fa276..6e8235de 100644 --- a/internal/relay/web-dist/assets/signup-BXhwDxUo.js +++ b/internal/relay/web-dist/assets/signup-CLz9yc9B.js @@ -1 +1 @@ -import{ap as I,bH as i,a7 as L,bt as A,aI as C,bw as g,ab as q,cx as o,ak as s,ca as e,n as B,aa as l,g as U,c3 as n,j as V,k as f,m as h,B as E,ai as _,ad as P,ac as S,bi as w,am as M,h as F,cd as T,v as D,aQ as H,a9 as R}from"./useI18n-lwZlSdSx.js";import{s as j,A as G}from"./client-DMh7GjbV.js";import{s as O}from"./auth-B3RxKR1W.js";import{formatVersionLabel as Q,fetchVersion as W}from"./version-Dm8mqW3q.js";import{L as z,a as J}from"./mobile-guard-Cco5WjS8.js";import"./pwa-BO-YW0rH.js";const K={class:"auth-page"},X={class:"auth-title"},Y={class:"auth-subtitle"},Z={key:0,class:"auth-error",role:"alert"},$={class:"auth-alt"},ee={href:"/login.html"},ae={class:"auth-version"},te=I({__name:"App",setup(re){const p=i(""),m=i(""),v=i(""),u=i(!1),c=i(""),b=i("dev"),{t:a}=T(),k=L(()=>Q(b.value,a));A(async()=>{b.value=await W()});function y(r){if(r instanceof G){if(r.code==="email_taken")return a("auth.errors.emailTaken");if(r.code==="invite_invalid")return a("auth.errors.inviteInvalid");if(r.code==="password_weak")return a("auth.errors.passwordWeak");if(r.code==="invalid_email")return a("auth.errors.invalidEmail");if(r.code==="rate_limited")return a("auth.errors.rateLimitedShort");if(r.code==="invalid_request")return a("auth.errors.invalidRequest")}return a("auth.errors.signUpFailed")}async function N(r){if(r.preventDefault(),!u.value){c.value="",u.value=!0;try{await O(p.value,m.value,v.value);const t=new URLSearchParams(location.search).get("next");location.assign(j(t))}catch(t){c.value=y(t)}finally{u.value=!1}}}const x=C();return(r,t)=>(g(),q(e(F),{theme:e(M),"theme-overrides":e(x),locale:e(w).locale,"date-locale":e(w).dateLocale},{default:o(()=>[s(e(B),null,{default:o(()=>[l("main",K,[s(z,{class:"auth-language"}),s(e(U),{class:"auth-card",bordered:!1},{default:o(()=>[l("header",X,[l("h1",null,n(e(a)("common.appName")),1),l("p",Y,n(e(a)("auth.signUp")),1)]),s(e(V),{"label-placement":"top","require-mark-placement":"right-hanging",autocomplete:"on",novalidate:"",onSubmit:N},{default:o(()=>[s(e(f),{label:e(a)("auth.email"),"show-feedback":!1},{default:o(()=>[s(e(h),{value:p.value,"onUpdate:value":t[0]||(t[0]=d=>p.value=d),type:"text",placeholder:e(a)("auth.emailPlaceholder"),"input-props":{type:"email",required:!0,autocomplete:"username"}},null,8,["value","placeholder"])]),_:1},8,["label"]),s(e(f),{label:e(a)("auth.password"),"show-feedback":!1},{default:o(()=>[s(e(h),{value:m.value,"onUpdate:value":t[1]||(t[1]=d=>m.value=d),type:"password","show-password-on":"click","input-props":{required:!0,autocomplete:"new-password",minlength:12}},null,8,["value"])]),_:1},8,["label"]),s(e(f),{label:e(a)("auth.inviteCode"),"show-feedback":!1},{default:o(()=>[s(e(h),{value:v.value,"onUpdate:value":t[2]||(t[2]=d=>v.value=d),type:"text","input-props":{required:!0,autocomplete:"off"}},null,8,["value"])]),_:1},8,["label"]),s(e(E),{class:"submit-btn",type:"primary","attr-type":"submit",loading:u.value,disabled:u.value,block:""},{default:o(()=>[_(n(e(a)("auth.createAccount")),1)]),_:1},8,["loading","disabled"]),c.value?(g(),P("p",Z,n(c.value),1)):S("",!0),l("p",$,[_(n(e(a)("auth.alreadyHaveAccount"))+" ",1),l("a",ee,n(e(a)("auth.signIn")),1),t[3]||(t[3]=_(". "))])]),_:1})]),_:1}),l("p",ae,n(k.value),1)])]),_:1})]),_:1},8,["theme","theme-overrides","locale","date-locale"]))}}),se=D(te,[["__scopeId","data-v-04270efb"]]);J("signup")||(H(),R(se).mount("#app")); +import{ap as I,bH as i,a7 as L,bt as A,aI as C,bw as g,ab as q,cx as o,ak as s,ca as e,n as B,aa as l,g as U,c3 as n,j as V,k as f,m as h,B as E,ai as _,ad as P,ac as S,bi as w,am as M,h as F,cd as T,v as D,aQ as H,a9 as R}from"./useI18n-D4u8zssu.js";import{s as j,A as G}from"./client-n-fLEpOg.js";import{s as O}from"./auth-BBmiA1GG.js";import{formatVersionLabel as Q,fetchVersion as W}from"./version-DDxXxorX.js";import{L as z,a as J}from"./mobile-guard-B4PiwDK4.js";import"./pwa-CEp47jJM.js";const K={class:"auth-page"},X={class:"auth-title"},Y={class:"auth-subtitle"},Z={key:0,class:"auth-error",role:"alert"},$={class:"auth-alt"},ee={href:"/login.html"},ae={class:"auth-version"},te=I({__name:"App",setup(re){const p=i(""),m=i(""),v=i(""),u=i(!1),c=i(""),b=i("dev"),{t:a}=T(),k=L(()=>Q(b.value,a));A(async()=>{b.value=await W()});function y(r){if(r instanceof G){if(r.code==="email_taken")return a("auth.errors.emailTaken");if(r.code==="invite_invalid")return a("auth.errors.inviteInvalid");if(r.code==="password_weak")return a("auth.errors.passwordWeak");if(r.code==="invalid_email")return a("auth.errors.invalidEmail");if(r.code==="rate_limited")return a("auth.errors.rateLimitedShort");if(r.code==="invalid_request")return a("auth.errors.invalidRequest")}return a("auth.errors.signUpFailed")}async function N(r){if(r.preventDefault(),!u.value){c.value="",u.value=!0;try{await O(p.value,m.value,v.value);const t=new URLSearchParams(location.search).get("next");location.assign(j(t))}catch(t){c.value=y(t)}finally{u.value=!1}}}const x=C();return(r,t)=>(g(),q(e(F),{theme:e(M),"theme-overrides":e(x),locale:e(w).locale,"date-locale":e(w).dateLocale},{default:o(()=>[s(e(B),null,{default:o(()=>[l("main",K,[s(z,{class:"auth-language"}),s(e(U),{class:"auth-card",bordered:!1},{default:o(()=>[l("header",X,[l("h1",null,n(e(a)("common.appName")),1),l("p",Y,n(e(a)("auth.signUp")),1)]),s(e(V),{"label-placement":"top","require-mark-placement":"right-hanging",autocomplete:"on",novalidate:"",onSubmit:N},{default:o(()=>[s(e(f),{label:e(a)("auth.email"),"show-feedback":!1},{default:o(()=>[s(e(h),{value:p.value,"onUpdate:value":t[0]||(t[0]=d=>p.value=d),type:"text",placeholder:e(a)("auth.emailPlaceholder"),"input-props":{type:"email",required:!0,autocomplete:"username"}},null,8,["value","placeholder"])]),_:1},8,["label"]),s(e(f),{label:e(a)("auth.password"),"show-feedback":!1},{default:o(()=>[s(e(h),{value:m.value,"onUpdate:value":t[1]||(t[1]=d=>m.value=d),type:"password","show-password-on":"click","input-props":{required:!0,autocomplete:"new-password",minlength:12}},null,8,["value"])]),_:1},8,["label"]),s(e(f),{label:e(a)("auth.inviteCode"),"show-feedback":!1},{default:o(()=>[s(e(h),{value:v.value,"onUpdate:value":t[2]||(t[2]=d=>v.value=d),type:"text","input-props":{required:!0,autocomplete:"off"}},null,8,["value"])]),_:1},8,["label"]),s(e(E),{class:"submit-btn",type:"primary","attr-type":"submit",loading:u.value,disabled:u.value,block:""},{default:o(()=>[_(n(e(a)("auth.createAccount")),1)]),_:1},8,["loading","disabled"]),c.value?(g(),P("p",Z,n(c.value),1)):S("",!0),l("p",$,[_(n(e(a)("auth.alreadyHaveAccount"))+" ",1),l("a",ee,n(e(a)("auth.signIn")),1),t[3]||(t[3]=_(". "))])]),_:1})]),_:1}),l("p",ae,n(k.value),1)])]),_:1})]),_:1},8,["theme","theme-overrides","locale","date-locale"]))}}),se=D(te,[["__scopeId","data-v-04270efb"]]);J("signup")||(H(),R(se).mount("#app")); diff --git a/internal/relay/web-dist/assets/useI18n-lwZlSdSx.js b/internal/relay/web-dist/assets/useI18n-D4u8zssu.js similarity index 88% rename from internal/relay/web-dist/assets/useI18n-lwZlSdSx.js rename to internal/relay/web-dist/assets/useI18n-D4u8zssu.js index 46e5af2f..b306ab55 100644 --- a/internal/relay/web-dist/assets/useI18n-lwZlSdSx.js +++ b/internal/relay/web-dist/assets/useI18n-D4u8zssu.js @@ -1,23 +1,23 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/prefsSync-C5tz9Q-s.js","assets/client-DMh7GjbV.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/prefsSync-Dj3wNxrO.js","assets/client-n-fLEpOg.js"])))=>i.map(i=>d[i]); (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))r(n);new MutationObserver(n=>{for(const i of n)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function o(n){const i={};return n.integrity&&(i.integrity=n.integrity),n.referrerPolicy&&(i.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?i.credentials="include":n.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(n){if(n.ep)return;n.ep=!0;const i=o(n);fetch(n.href,i)}})();const up="modulepreload",fp=function(e){return"/"+e},Sl={},pp=function(t,o,r){let n=Promise.resolve();if(o&&o.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));n=Promise.allSettled(o.map(s=>{if(s=fp(s),s in Sl)return;Sl[s]=!0;const c=s.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${d}`))return;const u=document.createElement("link");if(u.rel=c?"stylesheet":up,c||(u.as="script"),u.crossOrigin="",u.href=s,l&&u.setAttribute("nonce",l),document.head.appendChild(u),c)return new Promise((p,m)=>{u.addEventListener("load",p),u.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${s}`)))})}))}function i(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return n.then(a=>{for(const l of a||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};/** * @vue/shared v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**//*! #__NO_SIDE_EFFECTS__ */function ja(e){const t=Object.create(null);for(const o of e.split(","))t[o]=1;return o=>o in t}const Me={},pr=[],Jt=()=>{},hp=()=>!1,gi=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Na=e=>e.startsWith("onUpdate:"),Xe=Object.assign,Va=(e,t)=>{const o=e.indexOf(t);o>-1&&e.splice(o,1)},gp=Object.prototype.hasOwnProperty,$e=(e,t)=>gp.call(e,t),ce=Array.isArray,hr=e=>Cn(e)==="[object Map]",Rr=e=>Cn(e)==="[object Set]",wl=e=>Cn(e)==="[object Date]",me=e=>typeof e=="function",We=e=>typeof e=="string",Bt=e=>typeof e=="symbol",_e=e=>e!==null&&typeof e=="object",lc=e=>(_e(e)||me(e))&&me(e.then)&&me(e.catch),sc=Object.prototype.toString,Cn=e=>sc.call(e),mp=e=>Cn(e).slice(8,-1),cc=e=>Cn(e)==="[object Object]",Ua=e=>We(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,qr=ja(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),mi=e=>{const t=Object.create(null);return o=>t[o]||(t[o]=e(o))},bp=/-(\w)/g,Mt=mi(e=>e.replace(bp,(t,o)=>o?o.toUpperCase():"")),vp=/\B([A-Z])/g,Io=mi(e=>e.replace(vp,"-$1").toLowerCase()),bi=mi(e=>e.charAt(0).toUpperCase()+e.slice(1)),ji=mi(e=>e?`on${bi(e)}`:""),$o=(e,t)=>!Object.is(e,t),Kn=(e,...t)=>{for(let o=0;o{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:o})},oi=e=>{const t=parseFloat(e);return isNaN(t)?e:t},xp=e=>{const t=We(e)?Number(e):NaN;return isNaN(t)?e:t};let Pl;const vi=()=>Pl||(Pl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function qa(e){if(ce(e)){const t={};for(let o=0;o{if(o){const r=o.split(yp);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function Ga(e){let t="";if(We(e))t=e;else if(ce(e))for(let o=0;oer(o,t))}const fc=e=>!!(e&&e.__v_isRef===!0),Rp=e=>We(e)?e:e==null?"":ce(e)||_e(e)&&(e.toString===sc||!me(e.toString))?fc(e)?Rp(e.value):JSON.stringify(e,pc,2):String(e),pc=(e,t)=>fc(t)?pc(e,t.value):hr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((o,[r,n],i)=>(o[Ni(r,i)+" =>"]=n,o),{})}:Rr(t)?{[`Set(${t.size})`]:[...t.values()].map(o=>Ni(o))}:Bt(t)?Ni(t):_e(t)&&!ce(t)&&!cc(t)?String(t):t,Ni=(e,t="")=>{var o;return Bt(e)?`Symbol(${(o=e.description)!=null?o:t})`:e};/** +**//*! #__NO_SIDE_EFFECTS__ */function ja(e){const t=Object.create(null);for(const o of e.split(","))t[o]=1;return o=>o in t}const Me={},pr=[],Jt=()=>{},hp=()=>!1,gi=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Na=e=>e.startsWith("onUpdate:"),Xe=Object.assign,Va=(e,t)=>{const o=e.indexOf(t);o>-1&&e.splice(o,1)},gp=Object.prototype.hasOwnProperty,$e=(e,t)=>gp.call(e,t),ce=Array.isArray,hr=e=>Cn(e)==="[object Map]",Rr=e=>Cn(e)==="[object Set]",wl=e=>Cn(e)==="[object Date]",me=e=>typeof e=="function",We=e=>typeof e=="string",Bt=e=>typeof e=="symbol",Ee=e=>e!==null&&typeof e=="object",lc=e=>(Ee(e)||me(e))&&me(e.then)&&me(e.catch),sc=Object.prototype.toString,Cn=e=>sc.call(e),mp=e=>Cn(e).slice(8,-1),cc=e=>Cn(e)==="[object Object]",Ua=e=>We(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,qr=ja(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),mi=e=>{const t=Object.create(null);return o=>t[o]||(t[o]=e(o))},bp=/-(\w)/g,Mt=mi(e=>e.replace(bp,(t,o)=>o?o.toUpperCase():"")),vp=/\B([A-Z])/g,Io=mi(e=>e.replace(vp,"-$1").toLowerCase()),bi=mi(e=>e.charAt(0).toUpperCase()+e.slice(1)),ji=mi(e=>e?`on${bi(e)}`:""),$o=(e,t)=>!Object.is(e,t),Kn=(e,...t)=>{for(let o=0;o{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:o})},oi=e=>{const t=parseFloat(e);return isNaN(t)?e:t},xp=e=>{const t=We(e)?Number(e):NaN;return isNaN(t)?e:t};let Pl;const vi=()=>Pl||(Pl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function qa(e){if(ce(e)){const t={};for(let o=0;o{if(o){const r=o.split(yp);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function Ga(e){let t="";if(We(e))t=e;else if(ce(e))for(let o=0;oer(o,t))}const fc=e=>!!(e&&e.__v_isRef===!0),Rp=e=>We(e)?e:e==null?"":ce(e)||Ee(e)&&(e.toString===sc||!me(e.toString))?fc(e)?Rp(e.value):JSON.stringify(e,pc,2):String(e),pc=(e,t)=>fc(t)?pc(e,t.value):hr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((o,[r,n],i)=>(o[Ni(r,i)+" =>"]=n,o),{})}:Rr(t)?{[`Set(${t.size})`]:[...t.values()].map(o=>Ni(o))}:Bt(t)?Ni(t):Ee(t)&&!ce(t)&&!cc(t)?String(t):t,Ni=(e,t="")=>{var o;return Bt(e)?`Symbol(${(o=e.description)!=null?o:t})`:e};/** * @vue/reactivity v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let vt;class hc{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=vt,!t&&vt&&(this.index=(vt.scopes||(vt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,o;if(this.scopes)for(t=0,o=this.scopes.length;t0)return;if(Kr){let t=Kr;for(Kr=void 0;t;){const o=t.next;t.next=void 0,t.flags&=-9,t=o}}let e;for(;Gr;){let t=Gr;for(Gr=void 0;t;){const o=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=o}}if(e)throw e}function vc(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function xc(e){let t,o=e.depsTail,r=o;for(;r;){const n=r.prevDep;r.version===-1?(r===o&&(o=n),Ja(r),Ap(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=n}e.deps=t,e.depsTail=o}function la(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Cc(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Cc(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===on))return;e.globalVersion=on;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!la(e)){e.flags&=-3;return}const o=ze,r=Ot;ze=e,Ot=!0;try{vc(e);const n=e.fn(e._value);(t.version===0||$o(n,e._value))&&(e._value=n,t.version++)}catch(n){throw t.version++,n}finally{ze=o,Ot=r,xc(e),e.flags&=-3}}function Ja(e,t=!1){const{dep:o,prevSub:r,nextSub:n}=e;if(r&&(r.nextSub=n,e.prevSub=void 0),n&&(n.prevSub=r,e.nextSub=void 0),o.subs===e&&(o.subs=r,!r&&o.computed)){o.computed.flags&=-5;for(let i=o.computed.deps;i;i=i.nextDep)Ja(i,!0)}!t&&!--o.sc&&o.map&&o.map.delete(o.key)}function Ap(e){const{prevDep:t,nextDep:o}=e;t&&(t.nextDep=o,e.prevDep=void 0),o&&(o.prevDep=t,e.nextDep=void 0)}let Ot=!0;const yc=[];function _o(){yc.push(Ot),Ot=!1}function Eo(){const e=yc.pop();Ot=e===void 0?!0:e}function Tl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const o=ze;ze=void 0;try{t()}finally{ze=o}}}let on=0;class Ip{constructor(t,o){this.sub=t,this.dep=o,this.version=o.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Za{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(t){if(!ze||!Ot||ze===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==ze)o=this.activeLink=new Ip(ze,this),ze.deps?(o.prevDep=ze.depsTail,ze.depsTail.nextDep=o,ze.depsTail=o):ze.deps=ze.depsTail=o,Sc(o);else if(o.version===-1&&(o.version=this.version,o.nextDep)){const r=o.nextDep;r.prevDep=o.prevDep,o.prevDep&&(o.prevDep.nextDep=r),o.prevDep=ze.depsTail,o.nextDep=void 0,ze.depsTail.nextDep=o,ze.depsTail=o,ze.deps===o&&(ze.deps=r)}return o}trigger(t){this.version++,on++,this.notify(t)}notify(t){Ya();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{Xa()}}}function Sc(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)Sc(r)}const o=e.dep.subs;o!==e&&(e.prevSub=o,o&&(o.nextSub=e)),e.dep.subs=e}}const ri=new WeakMap,Yo=Symbol(""),sa=Symbol(""),rn=Symbol("");function dt(e,t,o){if(Ot&&ze){let r=ri.get(e);r||ri.set(e,r=new Map);let n=r.get(o);n||(r.set(o,n=new Za),n.map=r,n.key=o),n.track()}}function so(e,t,o,r,n,i){const a=ri.get(e);if(!a){on++;return}const l=s=>{s&&s.trigger()};if(Ya(),t==="clear")a.forEach(l);else{const s=ce(e),c=s&&Ua(o);if(s&&o==="length"){const d=Number(r);a.forEach((u,p)=>{(p==="length"||p===rn||!Bt(p)&&p>=d)&&l(u)})}else switch((o!==void 0||a.has(void 0))&&l(a.get(o)),c&&l(a.get(rn)),t){case"add":s?c&&l(a.get("length")):(l(a.get(Yo)),hr(e)&&l(a.get(sa)));break;case"delete":s||(l(a.get(Yo)),hr(e)&&l(a.get(sa)));break;case"set":hr(e)&&l(a.get(Yo));break}}Xa()}function _p(e,t){const o=ri.get(e);return o&&o.get(t)}function dr(e){const t=we(e);return t===e?t:(dt(t,"iterate",rn),_t(e)?t:t.map(ut))}function xi(e){return dt(e=we(e),"iterate",rn),e}const Ep={__proto__:null,[Symbol.iterator](){return Ui(this,Symbol.iterator,ut)},concat(...e){return dr(this).concat(...e.map(t=>ce(t)?dr(t):t))},entries(){return Ui(this,"entries",e=>(e[1]=ut(e[1]),e))},every(e,t){return io(this,"every",e,t,void 0,arguments)},filter(e,t){return io(this,"filter",e,t,o=>o.map(ut),arguments)},find(e,t){return io(this,"find",e,t,ut,arguments)},findIndex(e,t){return io(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return io(this,"findLast",e,t,ut,arguments)},findLastIndex(e,t){return io(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return io(this,"forEach",e,t,void 0,arguments)},includes(...e){return qi(this,"includes",e)},indexOf(...e){return qi(this,"indexOf",e)},join(e){return dr(this).join(e)},lastIndexOf(...e){return qi(this,"lastIndexOf",e)},map(e,t){return io(this,"map",e,t,void 0,arguments)},pop(){return Or(this,"pop")},push(...e){return Or(this,"push",e)},reduce(e,...t){return $l(this,"reduce",e,t)},reduceRight(e,...t){return $l(this,"reduceRight",e,t)},shift(){return Or(this,"shift")},some(e,t){return io(this,"some",e,t,void 0,arguments)},splice(...e){return Or(this,"splice",e)},toReversed(){return dr(this).toReversed()},toSorted(e){return dr(this).toSorted(e)},toSpliced(...e){return dr(this).toSpliced(...e)},unshift(...e){return Or(this,"unshift",e)},values(){return Ui(this,"values",ut)}};function Ui(e,t,o){const r=xi(e),n=r[t]();return r!==e&&!_t(e)&&(n._next=n.next,n.next=()=>{const i=n._next();return i.value&&(i.value=o(i.value)),i}),n}const Mp=Array.prototype;function io(e,t,o,r,n,i){const a=xi(e),l=a!==e&&!_t(e),s=a[t];if(s!==Mp[t]){const u=s.apply(e,i);return l?ut(u):u}let c=o;a!==e&&(l?c=function(u,p){return o.call(this,ut(u),p,e)}:o.length>2&&(c=function(u,p){return o.call(this,u,p,e)}));const d=s.call(a,c,r);return l&&n?n(d):d}function $l(e,t,o,r){const n=xi(e);let i=o;return n!==e&&(_t(e)?o.length>3&&(i=function(a,l,s){return o.call(this,a,l,s,e)}):i=function(a,l,s){return o.call(this,a,ut(l),s,e)}),n[t](i,...r)}function qi(e,t,o){const r=we(e);dt(r,"iterate",rn);const n=r[t](...o);return(n===-1||n===!1)&&ol(o[0])?(o[0]=we(o[0]),r[t](...o)):n}function Or(e,t,o=[]){_o(),Ya();const r=we(e)[t].apply(e,o);return Xa(),Eo(),r}const zp=ja("__proto__,__v_isRef,__isVue"),wc=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Bt));function Hp(e){Bt(e)||(e=String(e));const t=we(this);return dt(t,"has",e),t.hasOwnProperty(e)}class Pc{constructor(t=!1,o=!1){this._isReadonly=t,this._isShallow=o}get(t,o,r){if(o==="__v_skip")return t.__v_skip;const n=this._isReadonly,i=this._isShallow;if(o==="__v_isReactive")return!n;if(o==="__v_isReadonly")return n;if(o==="__v_isShallow")return i;if(o==="__v_raw")return r===(n?i?Up:Fc:i?Rc:$c).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const a=ce(t);if(!n){let s;if(a&&(s=Ep[o]))return s;if(o==="hasOwnProperty")return Hp}const l=Reflect.get(t,o,ot(t)?t:r);return(Bt(o)?wc.has(o):zp(o))||(n||dt(t,"get",o),i)?l:ot(l)?a&&Ua(o)?l:l.value:_e(l)?n?el(l):Ci(l):l}}class Tc extends Pc{constructor(t=!1){super(!1,t)}set(t,o,r,n){let i=t[o];if(!this._isShallow){const s=tr(i);if(!_t(r)&&!tr(r)&&(i=we(i),r=we(r)),!ce(t)&&ot(i)&&!ot(r))return s?!1:(i.value=r,!0)}const a=ce(t)&&Ua(o)?Number(o)e,Mn=e=>Reflect.getPrototypeOf(e);function Lp(e,t,o){return function(...r){const n=this.__v_raw,i=we(n),a=hr(i),l=e==="entries"||e===Symbol.iterator&&a,s=e==="keys"&&a,c=n[e](...r),d=o?ca:t?ua:ut;return!t&&dt(i,"iterate",s?sa:Yo),{next(){const{value:u,done:p}=c.next();return p?{value:u,done:p}:{value:l?[d(u[0]),d(u[1])]:d(u),done:p}},[Symbol.iterator](){return this}}}}function zn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Wp(e,t){const o={get(n){const i=this.__v_raw,a=we(i),l=we(n);e||($o(n,l)&&dt(a,"get",n),dt(a,"get",l));const{has:s}=Mn(a),c=t?ca:e?ua:ut;if(s.call(a,n))return c(i.get(n));if(s.call(a,l))return c(i.get(l));i!==a&&i.get(n)},get size(){const n=this.__v_raw;return!e&&dt(we(n),"iterate",Yo),Reflect.get(n,"size",n)},has(n){const i=this.__v_raw,a=we(i),l=we(n);return e||($o(n,l)&&dt(a,"has",n),dt(a,"has",l)),n===l?i.has(n):i.has(n)||i.has(l)},forEach(n,i){const a=this,l=a.__v_raw,s=we(l),c=t?ca:e?ua:ut;return!e&&dt(s,"iterate",Yo),l.forEach((d,u)=>n.call(i,c(d),c(u),a))}};return Xe(o,e?{add:zn("add"),set:zn("set"),delete:zn("delete"),clear:zn("clear")}:{add(n){!t&&!_t(n)&&!tr(n)&&(n=we(n));const i=we(this);return Mn(i).has.call(i,n)||(i.add(n),so(i,"add",n,n)),this},set(n,i){!t&&!_t(i)&&!tr(i)&&(i=we(i));const a=we(this),{has:l,get:s}=Mn(a);let c=l.call(a,n);c||(n=we(n),c=l.call(a,n));const d=s.call(a,n);return a.set(n,i),c?$o(i,d)&&so(a,"set",n,i):so(a,"add",n,i),this},delete(n){const i=we(this),{has:a,get:l}=Mn(i);let s=a.call(i,n);s||(n=we(n),s=a.call(i,n)),l&&l.call(i,n);const c=i.delete(n);return s&&so(i,"delete",n,void 0),c},clear(){const n=we(this),i=n.size!==0,a=n.clear();return i&&so(n,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(n=>{o[n]=Lp(n,e,t)}),o}function Qa(e,t){const o=Wp(e,t);return(r,n,i)=>n==="__v_isReactive"?!e:n==="__v_isReadonly"?e:n==="__v_raw"?r:Reflect.get($e(o,n)&&n in r?o:r,n,i)}const jp={get:Qa(!1,!1)},Np={get:Qa(!1,!0)},Vp={get:Qa(!0,!1)};const $c=new WeakMap,Rc=new WeakMap,Fc=new WeakMap,Up=new WeakMap;function qp(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Gp(e){return e.__v_skip||!Object.isExtensible(e)?0:qp(mp(e))}function Ci(e){return tr(e)?e:tl(e,!1,Dp,jp,$c)}function Kp(e){return tl(e,!1,Bp,Np,Rc)}function el(e){return tl(e,!0,Op,Vp,Fc)}function tl(e,t,o,r,n){if(!_e(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=n.get(e);if(i)return i;const a=Gp(e);if(a===0)return e;const l=new Proxy(e,a===2?r:o);return n.set(e,l),l}function gr(e){return tr(e)?gr(e.__v_raw):!!(e&&e.__v_isReactive)}function tr(e){return!!(e&&e.__v_isReadonly)}function _t(e){return!!(e&&e.__v_isShallow)}function ol(e){return e?!!e.__v_raw:!1}function we(e){const t=e&&e.__v_raw;return t?we(t):e}function da(e){return!$e(e,"__v_skip")&&Object.isExtensible(e)&&dc(e,"__v_skip",!0),e}const ut=e=>_e(e)?Ci(e):e,ua=e=>_e(e)?el(e):e;function ot(e){return e?e.__v_isRef===!0:!1}function fe(e){return Ic(e,!1)}function Ac(e){return Ic(e,!0)}function Ic(e,t){return ot(e)?e:new Yp(e,t)}class Yp{constructor(t,o){this.dep=new Za,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=o?t:we(t),this._value=o?t:ut(t),this.__v_isShallow=o}get value(){return this.dep.track(),this._value}set value(t){const o=this._rawValue,r=this.__v_isShallow||_t(t)||tr(t);t=r?t:we(t),$o(t,o)&&(this._rawValue=t,this._value=r?t:ut(t),this.dep.trigger())}}function Xp(e){return ot(e)?e.value:e}const Jp={get:(e,t,o)=>t==="__v_raw"?e:Xp(Reflect.get(e,t,o)),set:(e,t,o,r)=>{const n=e[t];return ot(n)&&!ot(o)?(n.value=o,!0):Reflect.set(e,t,o,r)}};function _c(e){return gr(e)?e:new Proxy(e,Jp)}function N2(e){const t=ce(e)?new Array(e.length):{};for(const o in e)t[o]=Ec(e,o);return t}class Zp{constructor(t,o,r){this._object=t,this._key=o,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0}get value(){const t=this._object[this._key];return this._value=t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return _p(we(this._object),this._key)}}class Qp{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Dt(e,t,o){return ot(e)?e:me(e)?new Qp(e):_e(e)&&arguments.length>1?Ec(e,t,o):fe(e)}function Ec(e,t,o){const r=e[t];return ot(r)?r:new Zp(e,t,o)}class eh{constructor(t,o,r){this.fn=t,this.setter=o,this._value=void 0,this.dep=new Za(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=on-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!o,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ze!==this)return bc(this,!0),!0}get value(){const t=this.dep.track();return Cc(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function th(e,t,o=!1){let r,n;return me(e)?r=e:(r=e.get,n=e.set),new eh(r,n,o)}const Hn={},ni=new WeakMap;let jo;function oh(e,t=!1,o=jo){if(o){let r=ni.get(o);r||ni.set(o,r=[]),r.push(e)}}function rh(e,t,o=Me){const{immediate:r,deep:n,once:i,scheduler:a,augmentJob:l,call:s}=o,c=w=>n?w:_t(w)||n===!1||n===0?co(w,1):co(w);let d,u,p,m,f=!1,g=!1;if(ot(e)?(u=()=>e.value,f=_t(e)):gr(e)?(u=()=>c(e),f=!0):ce(e)?(g=!0,f=e.some(w=>gr(w)||_t(w)),u=()=>e.map(w=>{if(ot(w))return w.value;if(gr(w))return c(w);if(me(w))return s?s(w,2):w()})):me(e)?t?u=s?()=>s(e,2):e:u=()=>{if(p){_o();try{p()}finally{Eo()}}const w=jo;jo=d;try{return s?s(e,3,[m]):e(m)}finally{jo=w}}:u=Jt,t&&n){const w=u,_=n===!0?1/0:n;u=()=>co(w(),_)}const S=Fp(),v=()=>{d.stop(),S&&S.active&&Va(S.effects,d)};if(i&&t){const w=t;t=(..._)=>{w(..._),v()}}let $=g?new Array(e.length).fill(Hn):Hn;const T=w=>{if(!(!(d.flags&1)||!d.dirty&&!w))if(t){const _=d.run();if(n||f||(g?_.some((O,x)=>$o(O,$[x])):$o(_,$))){p&&p();const O=jo;jo=d;try{const x=[_,$===Hn?void 0:g&&$[0]===Hn?[]:$,m];s?s(t,3,x):t(...x),$=_}finally{jo=O}}}else d.run()};return l&&l(T),d=new gc(u),d.scheduler=a?()=>a(T,!1):T,m=w=>oh(w,!1,d),p=d.onStop=()=>{const w=ni.get(d);if(w){if(s)s(w,4);else for(const _ of w)_();ni.delete(d)}},t?r?T(!0):$=d.run():a?a(T.bind(null,!0),!0):d.run(),v.pause=d.pause.bind(d),v.resume=d.resume.bind(d),v.stop=v,v}function co(e,t=1/0,o){if(t<=0||!_e(e)||e.__v_skip||(o=o||new Set,o.has(e)))return e;if(o.add(e),t--,ot(e))co(e.value,t,o);else if(ce(e))for(let r=0;r{co(r,t,o)});else if(cc(e)){for(const r in e)co(e[r],t,o);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&co(e[r],t,o)}return e}/** +**/let vt;class hc{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=vt,!t&&vt&&(this.index=(vt.scopes||(vt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,o;if(this.scopes)for(t=0,o=this.scopes.length;t0)return;if(Kr){let t=Kr;for(Kr=void 0;t;){const o=t.next;t.next=void 0,t.flags&=-9,t=o}}let e;for(;Gr;){let t=Gr;for(Gr=void 0;t;){const o=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=o}}if(e)throw e}function vc(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function xc(e){let t,o=e.depsTail,r=o;for(;r;){const n=r.prevDep;r.version===-1?(r===o&&(o=n),Ja(r),Ap(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=n}e.deps=t,e.depsTail=o}function la(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Cc(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Cc(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===on))return;e.globalVersion=on;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!la(e)){e.flags&=-3;return}const o=ze,r=Ot;ze=e,Ot=!0;try{vc(e);const n=e.fn(e._value);(t.version===0||$o(n,e._value))&&(e._value=n,t.version++)}catch(n){throw t.version++,n}finally{ze=o,Ot=r,xc(e),e.flags&=-3}}function Ja(e,t=!1){const{dep:o,prevSub:r,nextSub:n}=e;if(r&&(r.nextSub=n,e.prevSub=void 0),n&&(n.prevSub=r,e.nextSub=void 0),o.subs===e&&(o.subs=r,!r&&o.computed)){o.computed.flags&=-5;for(let i=o.computed.deps;i;i=i.nextDep)Ja(i,!0)}!t&&!--o.sc&&o.map&&o.map.delete(o.key)}function Ap(e){const{prevDep:t,nextDep:o}=e;t&&(t.nextDep=o,e.prevDep=void 0),o&&(o.prevDep=t,e.nextDep=void 0)}let Ot=!0;const yc=[];function Eo(){yc.push(Ot),Ot=!1}function _o(){const e=yc.pop();Ot=e===void 0?!0:e}function Tl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const o=ze;ze=void 0;try{t()}finally{ze=o}}}let on=0;class Ip{constructor(t,o){this.sub=t,this.dep=o,this.version=o.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Za{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(t){if(!ze||!Ot||ze===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==ze)o=this.activeLink=new Ip(ze,this),ze.deps?(o.prevDep=ze.depsTail,ze.depsTail.nextDep=o,ze.depsTail=o):ze.deps=ze.depsTail=o,Sc(o);else if(o.version===-1&&(o.version=this.version,o.nextDep)){const r=o.nextDep;r.prevDep=o.prevDep,o.prevDep&&(o.prevDep.nextDep=r),o.prevDep=ze.depsTail,o.nextDep=void 0,ze.depsTail.nextDep=o,ze.depsTail=o,ze.deps===o&&(ze.deps=r)}return o}trigger(t){this.version++,on++,this.notify(t)}notify(t){Ya();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{Xa()}}}function Sc(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)Sc(r)}const o=e.dep.subs;o!==e&&(e.prevSub=o,o&&(o.nextSub=e)),e.dep.subs=e}}const ri=new WeakMap,Yo=Symbol(""),sa=Symbol(""),rn=Symbol("");function dt(e,t,o){if(Ot&&ze){let r=ri.get(e);r||ri.set(e,r=new Map);let n=r.get(o);n||(r.set(o,n=new Za),n.map=r,n.key=o),n.track()}}function so(e,t,o,r,n,i){const a=ri.get(e);if(!a){on++;return}const l=s=>{s&&s.trigger()};if(Ya(),t==="clear")a.forEach(l);else{const s=ce(e),c=s&&Ua(o);if(s&&o==="length"){const d=Number(r);a.forEach((u,p)=>{(p==="length"||p===rn||!Bt(p)&&p>=d)&&l(u)})}else switch((o!==void 0||a.has(void 0))&&l(a.get(o)),c&&l(a.get(rn)),t){case"add":s?c&&l(a.get("length")):(l(a.get(Yo)),hr(e)&&l(a.get(sa)));break;case"delete":s||(l(a.get(Yo)),hr(e)&&l(a.get(sa)));break;case"set":hr(e)&&l(a.get(Yo));break}}Xa()}function Ep(e,t){const o=ri.get(e);return o&&o.get(t)}function dr(e){const t=we(e);return t===e?t:(dt(t,"iterate",rn),Et(e)?t:t.map(ut))}function xi(e){return dt(e=we(e),"iterate",rn),e}const _p={__proto__:null,[Symbol.iterator](){return Ui(this,Symbol.iterator,ut)},concat(...e){return dr(this).concat(...e.map(t=>ce(t)?dr(t):t))},entries(){return Ui(this,"entries",e=>(e[1]=ut(e[1]),e))},every(e,t){return io(this,"every",e,t,void 0,arguments)},filter(e,t){return io(this,"filter",e,t,o=>o.map(ut),arguments)},find(e,t){return io(this,"find",e,t,ut,arguments)},findIndex(e,t){return io(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return io(this,"findLast",e,t,ut,arguments)},findLastIndex(e,t){return io(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return io(this,"forEach",e,t,void 0,arguments)},includes(...e){return qi(this,"includes",e)},indexOf(...e){return qi(this,"indexOf",e)},join(e){return dr(this).join(e)},lastIndexOf(...e){return qi(this,"lastIndexOf",e)},map(e,t){return io(this,"map",e,t,void 0,arguments)},pop(){return Or(this,"pop")},push(...e){return Or(this,"push",e)},reduce(e,...t){return $l(this,"reduce",e,t)},reduceRight(e,...t){return $l(this,"reduceRight",e,t)},shift(){return Or(this,"shift")},some(e,t){return io(this,"some",e,t,void 0,arguments)},splice(...e){return Or(this,"splice",e)},toReversed(){return dr(this).toReversed()},toSorted(e){return dr(this).toSorted(e)},toSpliced(...e){return dr(this).toSpliced(...e)},unshift(...e){return Or(this,"unshift",e)},values(){return Ui(this,"values",ut)}};function Ui(e,t,o){const r=xi(e),n=r[t]();return r!==e&&!Et(e)&&(n._next=n.next,n.next=()=>{const i=n._next();return i.value&&(i.value=o(i.value)),i}),n}const Mp=Array.prototype;function io(e,t,o,r,n,i){const a=xi(e),l=a!==e&&!Et(e),s=a[t];if(s!==Mp[t]){const u=s.apply(e,i);return l?ut(u):u}let c=o;a!==e&&(l?c=function(u,p){return o.call(this,ut(u),p,e)}:o.length>2&&(c=function(u,p){return o.call(this,u,p,e)}));const d=s.call(a,c,r);return l&&n?n(d):d}function $l(e,t,o,r){const n=xi(e);let i=o;return n!==e&&(Et(e)?o.length>3&&(i=function(a,l,s){return o.call(this,a,l,s,e)}):i=function(a,l,s){return o.call(this,a,ut(l),s,e)}),n[t](i,...r)}function qi(e,t,o){const r=we(e);dt(r,"iterate",rn);const n=r[t](...o);return(n===-1||n===!1)&&ol(o[0])?(o[0]=we(o[0]),r[t](...o)):n}function Or(e,t,o=[]){Eo(),Ya();const r=we(e)[t].apply(e,o);return Xa(),_o(),r}const zp=ja("__proto__,__v_isRef,__isVue"),wc=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Bt));function Hp(e){Bt(e)||(e=String(e));const t=we(this);return dt(t,"has",e),t.hasOwnProperty(e)}class Pc{constructor(t=!1,o=!1){this._isReadonly=t,this._isShallow=o}get(t,o,r){if(o==="__v_skip")return t.__v_skip;const n=this._isReadonly,i=this._isShallow;if(o==="__v_isReactive")return!n;if(o==="__v_isReadonly")return n;if(o==="__v_isShallow")return i;if(o==="__v_raw")return r===(n?i?Up:Fc:i?Rc:$c).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const a=ce(t);if(!n){let s;if(a&&(s=_p[o]))return s;if(o==="hasOwnProperty")return Hp}const l=Reflect.get(t,o,ot(t)?t:r);return(Bt(o)?wc.has(o):zp(o))||(n||dt(t,"get",o),i)?l:ot(l)?a&&Ua(o)?l:l.value:Ee(l)?n?el(l):Ci(l):l}}class Tc extends Pc{constructor(t=!1){super(!1,t)}set(t,o,r,n){let i=t[o];if(!this._isShallow){const s=tr(i);if(!Et(r)&&!tr(r)&&(i=we(i),r=we(r)),!ce(t)&&ot(i)&&!ot(r))return s?!1:(i.value=r,!0)}const a=ce(t)&&Ua(o)?Number(o)e,Mn=e=>Reflect.getPrototypeOf(e);function Lp(e,t,o){return function(...r){const n=this.__v_raw,i=we(n),a=hr(i),l=e==="entries"||e===Symbol.iterator&&a,s=e==="keys"&&a,c=n[e](...r),d=o?ca:t?ua:ut;return!t&&dt(i,"iterate",s?sa:Yo),{next(){const{value:u,done:p}=c.next();return p?{value:u,done:p}:{value:l?[d(u[0]),d(u[1])]:d(u),done:p}},[Symbol.iterator](){return this}}}}function zn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Wp(e,t){const o={get(n){const i=this.__v_raw,a=we(i),l=we(n);e||($o(n,l)&&dt(a,"get",n),dt(a,"get",l));const{has:s}=Mn(a),c=t?ca:e?ua:ut;if(s.call(a,n))return c(i.get(n));if(s.call(a,l))return c(i.get(l));i!==a&&i.get(n)},get size(){const n=this.__v_raw;return!e&&dt(we(n),"iterate",Yo),Reflect.get(n,"size",n)},has(n){const i=this.__v_raw,a=we(i),l=we(n);return e||($o(n,l)&&dt(a,"has",n),dt(a,"has",l)),n===l?i.has(n):i.has(n)||i.has(l)},forEach(n,i){const a=this,l=a.__v_raw,s=we(l),c=t?ca:e?ua:ut;return!e&&dt(s,"iterate",Yo),l.forEach((d,u)=>n.call(i,c(d),c(u),a))}};return Xe(o,e?{add:zn("add"),set:zn("set"),delete:zn("delete"),clear:zn("clear")}:{add(n){!t&&!Et(n)&&!tr(n)&&(n=we(n));const i=we(this);return Mn(i).has.call(i,n)||(i.add(n),so(i,"add",n,n)),this},set(n,i){!t&&!Et(i)&&!tr(i)&&(i=we(i));const a=we(this),{has:l,get:s}=Mn(a);let c=l.call(a,n);c||(n=we(n),c=l.call(a,n));const d=s.call(a,n);return a.set(n,i),c?$o(i,d)&&so(a,"set",n,i):so(a,"add",n,i),this},delete(n){const i=we(this),{has:a,get:l}=Mn(i);let s=a.call(i,n);s||(n=we(n),s=a.call(i,n)),l&&l.call(i,n);const c=i.delete(n);return s&&so(i,"delete",n,void 0),c},clear(){const n=we(this),i=n.size!==0,a=n.clear();return i&&so(n,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(n=>{o[n]=Lp(n,e,t)}),o}function Qa(e,t){const o=Wp(e,t);return(r,n,i)=>n==="__v_isReactive"?!e:n==="__v_isReadonly"?e:n==="__v_raw"?r:Reflect.get($e(o,n)&&n in r?o:r,n,i)}const jp={get:Qa(!1,!1)},Np={get:Qa(!1,!0)},Vp={get:Qa(!0,!1)};const $c=new WeakMap,Rc=new WeakMap,Fc=new WeakMap,Up=new WeakMap;function qp(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Gp(e){return e.__v_skip||!Object.isExtensible(e)?0:qp(mp(e))}function Ci(e){return tr(e)?e:tl(e,!1,Dp,jp,$c)}function Kp(e){return tl(e,!1,Bp,Np,Rc)}function el(e){return tl(e,!0,Op,Vp,Fc)}function tl(e,t,o,r,n){if(!Ee(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=n.get(e);if(i)return i;const a=Gp(e);if(a===0)return e;const l=new Proxy(e,a===2?r:o);return n.set(e,l),l}function gr(e){return tr(e)?gr(e.__v_raw):!!(e&&e.__v_isReactive)}function tr(e){return!!(e&&e.__v_isReadonly)}function Et(e){return!!(e&&e.__v_isShallow)}function ol(e){return e?!!e.__v_raw:!1}function we(e){const t=e&&e.__v_raw;return t?we(t):e}function da(e){return!$e(e,"__v_skip")&&Object.isExtensible(e)&&dc(e,"__v_skip",!0),e}const ut=e=>Ee(e)?Ci(e):e,ua=e=>Ee(e)?el(e):e;function ot(e){return e?e.__v_isRef===!0:!1}function fe(e){return Ic(e,!1)}function Ac(e){return Ic(e,!0)}function Ic(e,t){return ot(e)?e:new Yp(e,t)}class Yp{constructor(t,o){this.dep=new Za,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=o?t:we(t),this._value=o?t:ut(t),this.__v_isShallow=o}get value(){return this.dep.track(),this._value}set value(t){const o=this._rawValue,r=this.__v_isShallow||Et(t)||tr(t);t=r?t:we(t),$o(t,o)&&(this._rawValue=t,this._value=r?t:ut(t),this.dep.trigger())}}function Xp(e){return ot(e)?e.value:e}const Jp={get:(e,t,o)=>t==="__v_raw"?e:Xp(Reflect.get(e,t,o)),set:(e,t,o,r)=>{const n=e[t];return ot(n)&&!ot(o)?(n.value=o,!0):Reflect.set(e,t,o,r)}};function Ec(e){return gr(e)?e:new Proxy(e,Jp)}function N2(e){const t=ce(e)?new Array(e.length):{};for(const o in e)t[o]=_c(e,o);return t}class Zp{constructor(t,o,r){this._object=t,this._key=o,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0}get value(){const t=this._object[this._key];return this._value=t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return Ep(we(this._object),this._key)}}class Qp{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Dt(e,t,o){return ot(e)?e:me(e)?new Qp(e):Ee(e)&&arguments.length>1?_c(e,t,o):fe(e)}function _c(e,t,o){const r=e[t];return ot(r)?r:new Zp(e,t,o)}class eh{constructor(t,o,r){this.fn=t,this.setter=o,this._value=void 0,this.dep=new Za(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=on-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!o,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ze!==this)return bc(this,!0),!0}get value(){const t=this.dep.track();return Cc(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function th(e,t,o=!1){let r,n;return me(e)?r=e:(r=e.get,n=e.set),new eh(r,n,o)}const Hn={},ni=new WeakMap;let jo;function oh(e,t=!1,o=jo){if(o){let r=ni.get(o);r||ni.set(o,r=[]),r.push(e)}}function rh(e,t,o=Me){const{immediate:r,deep:n,once:i,scheduler:a,augmentJob:l,call:s}=o,c=w=>n?w:Et(w)||n===!1||n===0?co(w,1):co(w);let d,u,p,m,f=!1,g=!1;if(ot(e)?(u=()=>e.value,f=Et(e)):gr(e)?(u=()=>c(e),f=!0):ce(e)?(g=!0,f=e.some(w=>gr(w)||Et(w)),u=()=>e.map(w=>{if(ot(w))return w.value;if(gr(w))return c(w);if(me(w))return s?s(w,2):w()})):me(e)?t?u=s?()=>s(e,2):e:u=()=>{if(p){Eo();try{p()}finally{_o()}}const w=jo;jo=d;try{return s?s(e,3,[m]):e(m)}finally{jo=w}}:u=Jt,t&&n){const w=u,E=n===!0?1/0:n;u=()=>co(w(),E)}const S=Fp(),v=()=>{d.stop(),S&&S.active&&Va(S.effects,d)};if(i&&t){const w=t;t=(...E)=>{w(...E),v()}}let $=g?new Array(e.length).fill(Hn):Hn;const T=w=>{if(!(!(d.flags&1)||!d.dirty&&!w))if(t){const E=d.run();if(n||f||(g?E.some((O,x)=>$o(O,$[x])):$o(E,$))){p&&p();const O=jo;jo=d;try{const x=[E,$===Hn?void 0:g&&$[0]===Hn?[]:$,m];s?s(t,3,x):t(...x),$=E}finally{jo=O}}}else d.run()};return l&&l(T),d=new gc(u),d.scheduler=a?()=>a(T,!1):T,m=w=>oh(w,!1,d),p=d.onStop=()=>{const w=ni.get(d);if(w){if(s)s(w,4);else for(const E of w)E();ni.delete(d)}},t?r?T(!0):$=d.run():a?a(T.bind(null,!0),!0):d.run(),v.pause=d.pause.bind(d),v.resume=d.resume.bind(d),v.stop=v,v}function co(e,t=1/0,o){if(t<=0||!Ee(e)||e.__v_skip||(o=o||new Set,o.has(e)))return e;if(o.add(e),t--,ot(e))co(e.value,t,o);else if(ce(e))for(let r=0;r{co(r,t,o)});else if(cc(e)){for(const r in e)co(e[r],t,o);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&co(e[r],t,o)}return e}/** * @vue/runtime-core v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function yn(e,t,o,r){try{return r?e(...r):e()}catch(n){yi(n,t,o)}}function Lt(e,t,o,r){if(me(e)){const n=yn(e,t,o,r);return n&&lc(n)&&n.catch(i=>{yi(i,t,o)}),n}if(ce(e)){const n=[];for(let i=0;i>>1,n=xt[r],i=an(n);i=an(o)?xt.push(e):xt.splice(ih(t),0,e),e.flags|=1,zc()}}function zc(){ii||(ii=Mc.then(kc))}function ah(e){ce(e)?mr.push(...e):yo&&e.id===-1?yo.splice(fr+1,0,e):e.flags&1||(mr.push(e),e.flags|=1),zc()}function Rl(e,t,o=Gt+1){for(;oan(o)-an(r));if(mr.length=0,yo){yo.push(...t);return}for(yo=t,fr=0;fre.id==null?e.flags&2?-1:1/0:e.id;function kc(e){try{for(Gt=0;Gt{r._d&&Wl(-1);const i=ai(t);let a;try{a=e(...n)}finally{ai(i),r._d&&Wl(1)}return a};return r._n=!0,r._c=!0,r._d=!0,r}function V2(e,t){if(Ye===null)return e;const o=Ri(Ye),r=e.dirs||(e.dirs=[]);for(let n=0;ne.__isTeleport,Yr=e=>e&&(e.disabled||e.disabled===""),Fl=e=>e&&(e.defer||e.defer===""),Al=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Il=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,fa=(e,t)=>{const o=e&&e.to;return We(o)?t?t(o):null:o},Lc={name:"Teleport",__isTeleport:!0,process(e,t,o,r,n,i,a,l,s,c){const{mc:d,pc:u,pbc:p,o:{insert:m,querySelector:f,createText:g,createComment:S}}=c,v=Yr(t.props);let{shapeFlag:$,children:T,dynamicChildren:w}=t;if(e==null){const _=t.el=g(""),O=t.anchor=g("");m(_,o,r),m(O,o,r);const x=(R,B)=>{$&16&&(n&&n.isCE&&(n.ce._teleportTarget=R),d(T,R,B,n,i,a,l,s))},F=()=>{const R=t.target=fa(t.props,f),B=Wc(R,t,g,m);R&&(a!=="svg"&&Al(R)?a="svg":a!=="mathml"&&Il(R)&&(a="mathml"),v||(x(R,B),Yn(t,!1)))};v&&(x(o,O),Yn(t,!0)),Fl(t.props)?bt(()=>{F(),t.el.__isMounted=!0},i):F()}else{if(Fl(t.props)&&!e.el.__isMounted){bt(()=>{Lc.process(e,t,o,r,n,i,a,l,s,c),delete e.el.__isMounted},i);return}t.el=e.el,t.targetStart=e.targetStart;const _=t.anchor=e.anchor,O=t.target=e.target,x=t.targetAnchor=e.targetAnchor,F=Yr(e.props),R=F?o:O,B=F?_:x;if(a==="svg"||Al(O)?a="svg":(a==="mathml"||Il(O))&&(a="mathml"),w?(p(e.dynamicChildren,w,R,n,i,a,l),al(e,t,!0)):s||u(e,t,R,B,n,i,a,l,!1),v)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):kn(t,o,_,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const j=t.target=fa(t.props,f);j&&kn(t,j,null,c,0)}else F&&kn(t,O,x,c,1);Yn(t,v)}},remove(e,t,o,{um:r,o:{remove:n}},i){const{shapeFlag:a,children:l,anchor:s,targetStart:c,targetAnchor:d,target:u,props:p}=e;if(u&&(n(c),n(d)),i&&n(s),a&16){const m=i||!Yr(p);for(let f=0;f{e.isMounted=!0}),nr(()=>{e.isUnmounting=!0}),e}const It=[Function,Array],Nc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:It,onEnter:It,onAfterEnter:It,onEnterCancelled:It,onBeforeLeave:It,onLeave:It,onAfterLeave:It,onLeaveCancelled:It,onBeforeAppear:It,onAppear:It,onAfterAppear:It,onAppearCancelled:It},Vc=e=>{const t=e.subTree;return t.component?Vc(t.component):t},dh={name:"BaseTransition",props:Nc,setup(e,{slots:t}){const o=Sn(),r=jc();return()=>{const n=t.default&&nl(t.default(),!0);if(!n||!n.length)return;const i=Uc(n),a=we(e),{mode:l}=a;if(r.isLeaving)return Gi(i);const s=_l(i);if(!s)return Gi(i);let c=ln(s,a,r,o,u=>c=u);s.type!==pt&&or(s,c);let d=o.subTree&&_l(o.subTree);if(d&&d.type!==pt&&!No(s,d)&&Vc(o).type!==pt){let u=ln(d,a,r,o);if(or(d,u),l==="out-in"&&s.type!==pt)return r.isLeaving=!0,u.afterLeave=()=>{r.isLeaving=!1,o.job.flags&8||o.update(),delete u.afterLeave,d=void 0},Gi(i);l==="in-out"&&s.type!==pt?u.delayLeave=(p,m,f)=>{const g=qc(r,d);g[String(d.key)]=d,p[So]=()=>{m(),p[So]=void 0,delete c.delayedLeave,d=void 0},c.delayedLeave=()=>{f(),delete c.delayedLeave,d=void 0}}:d=void 0}else d&&(d=void 0);return i}}};function Uc(e){let t=e[0];if(e.length>1){for(const o of e)if(o.type!==pt){t=o;break}}return t}const uh=dh;function qc(e,t){const{leavingVNodes:o}=e;let r=o.get(t.type);return r||(r=Object.create(null),o.set(t.type,r)),r}function ln(e,t,o,r,n){const{appear:i,mode:a,persisted:l=!1,onBeforeEnter:s,onEnter:c,onAfterEnter:d,onEnterCancelled:u,onBeforeLeave:p,onLeave:m,onAfterLeave:f,onLeaveCancelled:g,onBeforeAppear:S,onAppear:v,onAfterAppear:$,onAppearCancelled:T}=t,w=String(e.key),_=qc(o,e),O=(R,B)=>{R&&Lt(R,r,9,B)},x=(R,B)=>{const j=B[1];O(R,B),ce(R)?R.every(A=>A.length<=1)&&j():R.length<=1&&j()},F={mode:a,persisted:l,beforeEnter(R){let B=s;if(!o.isMounted)if(i)B=S||s;else return;R[So]&&R[So](!0);const j=_[w];j&&No(e,j)&&j.el[So]&&j.el[So](),O(B,[R])},enter(R){let B=c,j=d,A=u;if(!o.isMounted)if(i)B=v||c,j=$||d,A=T||u;else return;let J=!1;const G=R[Dn]=le=>{J||(J=!0,le?O(A,[R]):O(j,[R]),F.delayedLeave&&F.delayedLeave(),R[Dn]=void 0)};B?x(B,[R,G]):G()},leave(R,B){const j=String(e.key);if(R[Dn]&&R[Dn](!0),o.isUnmounting)return B();O(p,[R]);let A=!1;const J=R[So]=G=>{A||(A=!0,B(),G?O(g,[R]):O(f,[R]),R[So]=void 0,_[j]===e&&delete _[j])};_[j]=e,m?x(m,[R,J]):J()},clone(R){const B=ln(R,t,o,r,n);return n&&n(B),B}};return F}function Gi(e){if(Si(e))return e=Ro(e),e.children=null,e}function _l(e){if(!Si(e))return Bc(e.type)&&e.children?Uc(e.children):e;const{shapeFlag:t,children:o}=e;if(o){if(t&16)return o[0];if(t&32&&me(o.default))return o.default()}}function or(e,t){e.shapeFlag&6&&e.component?(e.transition=t,or(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function nl(e,t=!1,o){let r=[],n=0;for(let i=0;i1)for(let i=0;ili(f,t&&(ce(t)?t[g]:t),o,r,n));return}if(br(r)&&!n){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&li(e,t,o,r.component.subTree);return}const i=r.shapeFlag&4?Ri(r.component):r.el,a=n?null:i,{i:l,r:s}=e,c=t&&t.r,d=l.refs===Me?l.refs={}:l.refs,u=l.setupState,p=we(u),m=u===Me?()=>!1:f=>$e(p,f);if(c!=null&&c!==s&&(We(c)?(d[c]=null,m(c)&&(u[c]=null)):ot(c)&&(c.value=null)),me(s))yn(s,l,12,[a,d]);else{const f=We(s),g=ot(s);if(f||g){const S=()=>{if(e.f){const v=f?m(s)?u[s]:d[s]:s.value;n?ce(v)&&Va(v,i):ce(v)?v.includes(i)||v.push(i):f?(d[s]=[i],m(s)&&(u[s]=d[s])):(s.value=[i],e.k&&(d[e.k]=s.value))}else f?(d[s]=a,m(s)&&(u[s]=a)):g&&(s.value=a,e.k&&(d[e.k]=a))};a?(S.id=-1,bt(S,o)):S()}}}vi().requestIdleCallback;vi().cancelIdleCallback;const br=e=>!!e.type.__asyncLoader,Si=e=>e.type.__isKeepAlive;function Kc(e,t){Xc(e,"a",t)}function Yc(e,t){Xc(e,"da",t)}function Xc(e,t,o=tt){const r=e.__wdc||(e.__wdc=()=>{let n=o;for(;n;){if(n.isDeactivated)return;n=n.parent}return e()});if(wi(t,r,o),o){let n=o.parent;for(;n&&n.parent;)Si(n.parent.vnode)&&fh(r,t,o,n),n=n.parent}}function fh(e,t,o,r){const n=wi(t,e,r,!0);Zc(()=>{Va(r[t],n)},o)}function wi(e,t,o=tt,r=!1){if(o){const n=o[e]||(o[e]=[]),i=t.__weh||(t.__weh=(...a)=>{_o();const l=wn(o),s=Lt(t,o,e,a);return l(),Eo(),s});return r?n.unshift(i):n.push(i),i}}const go=e=>(t,o=tt)=>{(!dn||e==="sp")&&wi(e,(...r)=>t(...r),o)},Pi=go("bm"),Mo=go("m"),ph=go("bu"),Jc=go("u"),nr=go("bum"),Zc=go("um"),hh=go("sp"),gh=go("rtg"),mh=go("rtc");function bh(e,t=tt){wi("ec",e,t)}const Qc="components";function U2(e,t){return td(Qc,e,!0,t)||e}const ed=Symbol.for("v-ndc");function q2(e){return We(e)?td(Qc,e,!1)||e:e||ed}function td(e,t,o=!0,r=!1){const n=Ye||tt;if(n){const i=n.type;{const l=rg(i,!1);if(l&&(l===t||l===Mt(t)||l===bi(Mt(t))))return i}const a=El(n[e]||i[e],t)||El(n.appContext[e],t);return!a&&r?i:a}}function El(e,t){return e&&(e[t]||e[Mt(t)]||e[bi(Mt(t))])}function G2(e,t,o,r){let n;const i=o,a=ce(e);if(a||We(e)){const l=a&&gr(e);let s=!1;l&&(s=!_t(e),e=xi(e)),n=new Array(e.length);for(let c=0,d=e.length;ct(l,s,void 0,i));else{const l=Object.keys(e);n=new Array(l.length);for(let s=0,c=l.length;sCr(t)?!(t.type===pt||t.type===et&&!od(t.children)):!0)?e:null}const pa=e=>e?wd(e)?Ri(e):pa(e.parent):null,Xr=Xe(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>pa(e.parent),$root:e=>pa(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>nd(e),$forceUpdate:e=>e.f||(e.f=()=>{rl(e.update)}),$nextTick:e=>e.n||(e.n=nn.bind(e.proxy)),$watch:e=>Bh.bind(e)}),Ki=(e,t)=>e!==Me&&!e.__isScriptSetup&&$e(e,t),xh={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:o,setupState:r,data:n,props:i,accessCache:a,type:l,appContext:s}=e;let c;if(t[0]!=="$"){const m=a[t];if(m!==void 0)switch(m){case 1:return r[t];case 2:return n[t];case 4:return o[t];case 3:return i[t]}else{if(Ki(r,t))return a[t]=1,r[t];if(n!==Me&&$e(n,t))return a[t]=2,n[t];if((c=e.propsOptions[0])&&$e(c,t))return a[t]=3,i[t];if(o!==Me&&$e(o,t))return a[t]=4,o[t];ha&&(a[t]=0)}}const d=Xr[t];let u,p;if(d)return t==="$attrs"&&dt(e.attrs,"get",""),d(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(o!==Me&&$e(o,t))return a[t]=4,o[t];if(p=s.config.globalProperties,$e(p,t))return p[t]},set({_:e},t,o){const{data:r,setupState:n,ctx:i}=e;return Ki(n,t)?(n[t]=o,!0):r!==Me&&$e(r,t)?(r[t]=o,!0):$e(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=o,!0)},has({_:{data:e,setupState:t,accessCache:o,ctx:r,appContext:n,propsOptions:i}},a){let l;return!!o[a]||e!==Me&&$e(e,a)||Ki(t,a)||(l=i[0])&&$e(l,a)||$e(r,a)||$e(Xr,a)||$e(n.config.globalProperties,a)},defineProperty(e,t,o){return o.get!=null?e._.accessCache[t]=0:$e(o,"value")&&this.set(e,t,o.value,null),Reflect.defineProperty(e,t,o)}};function Ml(e){return ce(e)?e.reduce((t,o)=>(t[o]=null,t),{}):e}let ha=!0;function Ch(e){const t=nd(e),o=e.proxy,r=e.ctx;ha=!1,t.beforeCreate&&zl(t.beforeCreate,e,"bc");const{data:n,computed:i,methods:a,watch:l,provide:s,inject:c,created:d,beforeMount:u,mounted:p,beforeUpdate:m,updated:f,activated:g,deactivated:S,beforeDestroy:v,beforeUnmount:$,destroyed:T,unmounted:w,render:_,renderTracked:O,renderTriggered:x,errorCaptured:F,serverPrefetch:R,expose:B,inheritAttrs:j,components:A,directives:J,filters:G}=t;if(c&&yh(c,r,null),a)for(const N in a){const oe=a[N];me(oe)&&(r[N]=oe.bind(o))}if(n){const N=n.call(o,o);_e(N)&&(e.data=Ci(N))}if(ha=!0,i)for(const N in i){const oe=i[N],ye=me(oe)?oe.bind(o,o):me(oe.get)?oe.get.bind(o,o):Jt,Pe=!me(oe)&&me(oe.set)?oe.set.bind(o):Jt,Re=Y({get:ye,set:Pe});Object.defineProperty(r,N,{enumerable:!0,configurable:!0,get:()=>Re.value,set:Fe=>Re.value=Fe})}if(l)for(const N in l)rd(l[N],r,o,N);if(s){const N=me(s)?s.call(o):s;Reflect.ownKeys(N).forEach(oe=>{po(oe,N[oe])})}d&&zl(d,e,"c");function te(N,oe){ce(oe)?oe.forEach(ye=>N(ye.bind(o))):oe&&N(oe.bind(o))}if(te(Pi,u),te(Mo,p),te(ph,m),te(Jc,f),te(Kc,g),te(Yc,S),te(bh,F),te(mh,O),te(gh,x),te(nr,$),te(Zc,w),te(hh,R),ce(B))if(B.length){const N=e.exposed||(e.exposed={});B.forEach(oe=>{Object.defineProperty(N,oe,{get:()=>o[oe],set:ye=>o[oe]=ye})})}else e.exposed||(e.exposed={});_&&e.render===Jt&&(e.render=_),j!=null&&(e.inheritAttrs=j),A&&(e.components=A),J&&(e.directives=J),R&&Gc(e)}function yh(e,t,o=Jt){ce(e)&&(e=ga(e));for(const r in e){const n=e[r];let i;_e(n)?"default"in n?i=Le(n.from||r,n.default,!0):i=Le(n.from||r):i=Le(n),ot(i)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>i.value,set:a=>i.value=a}):t[r]=i}}function zl(e,t,o){Lt(ce(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,o)}function rd(e,t,o,r){let n=r.includes(".")?md(o,r):()=>o[r];if(We(e)){const i=t[e];me(i)&&Zt(n,i)}else if(me(e))Zt(n,e.bind(o));else if(_e(e))if(ce(e))e.forEach(i=>rd(i,t,o,r));else{const i=me(e.handler)?e.handler.bind(o):t[e.handler];me(i)&&Zt(n,i,e)}}function nd(e){const t=e.type,{mixins:o,extends:r}=t,{mixins:n,optionsCache:i,config:{optionMergeStrategies:a}}=e.appContext,l=i.get(t);let s;return l?s=l:!n.length&&!o&&!r?s=t:(s={},n.length&&n.forEach(c=>si(s,c,a,!0)),si(s,t,a)),_e(t)&&i.set(t,s),s}function si(e,t,o,r=!1){const{mixins:n,extends:i}=t;i&&si(e,i,o,!0),n&&n.forEach(a=>si(e,a,o,!0));for(const a in t)if(!(r&&a==="expose")){const l=Sh[a]||o&&o[a];e[a]=l?l(e[a],t[a]):t[a]}return e}const Sh={data:Hl,props:kl,emits:kl,methods:Nr,computed:Nr,beforeCreate:mt,created:mt,beforeMount:mt,mounted:mt,beforeUpdate:mt,updated:mt,beforeDestroy:mt,beforeUnmount:mt,destroyed:mt,unmounted:mt,activated:mt,deactivated:mt,errorCaptured:mt,serverPrefetch:mt,components:Nr,directives:Nr,watch:Ph,provide:Hl,inject:wh};function Hl(e,t){return t?e?function(){return Xe(me(e)?e.call(this,this):e,me(t)?t.call(this,this):t)}:t:e}function wh(e,t){return Nr(ga(e),ga(t))}function ga(e){if(ce(e)){const t={};for(let o=0;o1)return o&&me(t)?t.call(r&&r.proxy):t}}function K2(){return!!(tt||Ye||Xo)}const ad={},ld=()=>Object.create(ad),sd=e=>Object.getPrototypeOf(e)===ad;function Rh(e,t,o,r=!1){const n={},i=ld();e.propsDefaults=Object.create(null),cd(e,t,n,i);for(const a in e.propsOptions[0])a in n||(n[a]=void 0);o?e.props=r?n:Kp(n):e.type.props?e.props=n:e.props=i,e.attrs=i}function Fh(e,t,o,r){const{props:n,attrs:i,vnode:{patchFlag:a}}=e,l=we(n),[s]=e.propsOptions;let c=!1;if((r||a>0)&&!(a&16)){if(a&8){const d=e.vnode.dynamicProps;for(let u=0;u{s=!0;const[p,m]=dd(u,t,!0);Xe(a,p),m&&l.push(...m)};!o&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!i&&!s)return _e(e)&&r.set(e,pr),pr;if(ce(i))for(let d=0;de[0]==="_"||e==="$stable",il=e=>ce(e)?e.map(Kt):[Kt(e)],Ih=(e,t,o)=>{if(t._n)return t;const r=lh((...n)=>il(t(...n)),o);return r._c=!1,r},fd=(e,t,o)=>{const r=e._ctx;for(const n in e){if(ud(n))continue;const i=e[n];if(me(i))t[n]=Ih(n,i,r);else if(i!=null){const a=il(i);t[n]=()=>a}}},pd=(e,t)=>{const o=il(t);e.slots.default=()=>o},hd=(e,t,o)=>{for(const r in t)(o||r!=="_")&&(e[r]=t[r])},_h=(e,t,o)=>{const r=e.slots=ld();if(e.vnode.shapeFlag&32){const n=t._;n?(hd(r,t,o),o&&dc(r,"_",n,!0)):fd(t,r)}else t&&pd(e,t)},Eh=(e,t,o)=>{const{vnode:r,slots:n}=e;let i=!0,a=Me;if(r.shapeFlag&32){const l=t._;l?o&&l===1?i=!1:hd(n,t,o):(i=!t.$stable,fd(t,n)),a=t}else t&&(pd(e,t),a={default:1});if(i)for(const l in n)!ud(l)&&a[l]==null&&delete n[l]},bt=qh;function Mh(e){return zh(e)}function zh(e,t){const o=vi();o.__VUE__=!0;const{insert:r,remove:n,patchProp:i,createElement:a,createText:l,createComment:s,setText:c,setElementText:d,parentNode:u,nextSibling:p,setScopeId:m=Jt,insertStaticContent:f}=e,g=(h,b,P,H=null,M=null,k=null,q=void 0,U=null,z=!!b.dynamicChildren)=>{if(h===b)return;h&&!No(h,b)&&(H=Ue(h),Fe(h,M,k,!0),h=null),b.patchFlag===-2&&(z=!1,b.dynamicChildren=null);const{type:I,ref:ie,shapeFlag:X}=b;switch(I){case $i:S(h,b,P,H);break;case pt:v(h,b,P,H);break;case Xn:h==null&&$(b,P,H,q);break;case et:A(h,b,P,H,M,k,q,U,z);break;default:X&1?_(h,b,P,H,M,k,q,U,z):X&6?J(h,b,P,H,M,k,q,U,z):(X&64||X&128)&&I.process(h,b,P,H,M,k,q,U,z,Ge)}ie!=null&&M&&li(ie,h&&h.ref,k,b||h,!b)},S=(h,b,P,H)=>{if(h==null)r(b.el=l(b.children),P,H);else{const M=b.el=h.el;b.children!==h.children&&c(M,b.children)}},v=(h,b,P,H)=>{h==null?r(b.el=s(b.children||""),P,H):b.el=h.el},$=(h,b,P,H)=>{[h.el,h.anchor]=f(h.children,b,P,H,h.el,h.anchor)},T=({el:h,anchor:b},P,H)=>{let M;for(;h&&h!==b;)M=p(h),r(h,P,H),h=M;r(b,P,H)},w=({el:h,anchor:b})=>{let P;for(;h&&h!==b;)P=p(h),n(h),h=P;n(b)},_=(h,b,P,H,M,k,q,U,z)=>{b.type==="svg"?q="svg":b.type==="math"&&(q="mathml"),h==null?O(b,P,H,M,k,q,U,z):R(h,b,M,k,q,U,z)},O=(h,b,P,H,M,k,q,U)=>{let z,I;const{props:ie,shapeFlag:X,transition:ne,dirs:se}=h;if(z=h.el=a(h.type,k,ie&&ie.is,ie),X&8?d(z,h.children):X&16&&F(h.children,z,null,H,M,Yi(h,k),q,U),se&&Do(h,null,H,"created"),x(z,h,h.scopeId,q,H),ie){for(const Te in ie)Te!=="value"&&!qr(Te)&&i(z,Te,null,ie[Te],k,H);"value"in ie&&i(z,"value",null,ie.value,k),(I=ie.onVnodeBeforeMount)&&Nt(I,H,h)}se&&Do(h,null,H,"beforeMount");const ve=Hh(M,ne);ve&&ne.beforeEnter(z),r(z,b,P),((I=ie&&ie.onVnodeMounted)||ve||se)&&bt(()=>{I&&Nt(I,H,h),ve&&ne.enter(z),se&&Do(h,null,H,"mounted")},M)},x=(h,b,P,H,M)=>{if(P&&m(h,P),H)for(let k=0;k{for(let I=z;I{const U=b.el=h.el;let{patchFlag:z,dynamicChildren:I,dirs:ie}=b;z|=h.patchFlag&16;const X=h.props||Me,ne=b.props||Me;let se;if(P&&Oo(P,!1),(se=ne.onVnodeBeforeUpdate)&&Nt(se,P,b,h),ie&&Do(b,h,P,"beforeUpdate"),P&&Oo(P,!0),(X.innerHTML&&ne.innerHTML==null||X.textContent&&ne.textContent==null)&&d(U,""),I?B(h.dynamicChildren,I,U,P,H,Yi(b,M),k):q||oe(h,b,U,null,P,H,Yi(b,M),k,!1),z>0){if(z&16)j(U,X,ne,P,M);else if(z&2&&X.class!==ne.class&&i(U,"class",null,ne.class,M),z&4&&i(U,"style",X.style,ne.style,M),z&8){const ve=b.dynamicProps;for(let Te=0;Te{se&&Nt(se,P,b,h),ie&&Do(b,h,P,"updated")},H)},B=(h,b,P,H,M,k,q)=>{for(let U=0;U{if(b!==P){if(b!==Me)for(const k in b)!qr(k)&&!(k in P)&&i(h,k,b[k],null,M,H);for(const k in P){if(qr(k))continue;const q=P[k],U=b[k];q!==U&&k!=="value"&&i(h,k,U,q,M,H)}"value"in P&&i(h,"value",b.value,P.value,M)}},A=(h,b,P,H,M,k,q,U,z)=>{const I=b.el=h?h.el:l(""),ie=b.anchor=h?h.anchor:l("");let{patchFlag:X,dynamicChildren:ne,slotScopeIds:se}=b;se&&(U=U?U.concat(se):se),h==null?(r(I,P,H),r(ie,P,H),F(b.children||[],P,ie,M,k,q,U,z)):X>0&&X&64&&ne&&h.dynamicChildren?(B(h.dynamicChildren,ne,P,M,k,q,U),(b.key!=null||M&&b===M.subTree)&&al(h,b,!0)):oe(h,b,P,ie,M,k,q,U,z)},J=(h,b,P,H,M,k,q,U,z)=>{b.slotScopeIds=U,h==null?b.shapeFlag&512?M.ctx.activate(b,P,H,q,z):G(b,P,H,M,k,q,z):le(h,b,z)},G=(h,b,P,H,M,k,q)=>{const U=h.component=Zh(h,H,M);if(Si(h)&&(U.ctx.renderer=Ge),Qh(U,!1,q),U.asyncDep){if(M&&M.registerDep(U,te,q),!h.el){const z=U.subTree=ht(pt);v(null,z,b,P)}}else te(U,h,b,P,M,k,q)},le=(h,b,P)=>{const H=b.component=h.component;if(Vh(h,b,P))if(H.asyncDep&&!H.asyncResolved){N(H,b,P);return}else H.next=b,H.update();else b.el=h.el,H.vnode=b},te=(h,b,P,H,M,k,q)=>{const U=()=>{if(h.isMounted){let{next:X,bu:ne,u:se,parent:ve,vnode:Te}=h;{const it=gd(h);if(it){X&&(X.el=Te.el,N(h,X,q)),it.asyncDep.then(()=>{h.isUnmounted||U()});return}}let Ce=X,Ze;Oo(h,!1),X?(X.el=Te.el,N(h,X,q)):X=Te,ne&&Kn(ne),(Ze=X.props&&X.props.onVnodeBeforeUpdate)&&Nt(Ze,ve,X,Te),Oo(h,!0);const Qe=Bl(h),nt=h.subTree;h.subTree=Qe,g(nt,Qe,u(nt.el),Ue(nt),h,M,k),X.el=Qe.el,Ce===null&&Uh(h,Qe.el),se&&bt(se,M),(Ze=X.props&&X.props.onVnodeUpdated)&&bt(()=>Nt(Ze,ve,X,Te),M)}else{let X;const{el:ne,props:se}=b,{bm:ve,m:Te,parent:Ce,root:Ze,type:Qe}=h,nt=br(b);Oo(h,!1),ve&&Kn(ve),!nt&&(X=se&&se.onVnodeBeforeMount)&&Nt(X,Ce,b),Oo(h,!0);{Ze.ce&&Ze.ce._injectChildStyle(Qe);const it=h.subTree=Bl(h);g(null,it,P,H,h,M,k),b.el=it.el}if(Te&&bt(Te,M),!nt&&(X=se&&se.onVnodeMounted)){const it=b;bt(()=>Nt(X,Ce,it),M)}(b.shapeFlag&256||Ce&&br(Ce.vnode)&&Ce.vnode.shapeFlag&256)&&h.a&&bt(h.a,M),h.isMounted=!0,b=P=H=null}};h.scope.on();const z=h.effect=new gc(U);h.scope.off();const I=h.update=z.run.bind(z),ie=h.job=z.runIfDirty.bind(z);ie.i=h,ie.id=h.uid,z.scheduler=()=>rl(ie),Oo(h,!0),I()},N=(h,b,P)=>{b.component=h;const H=h.vnode.props;h.vnode=b,h.next=null,Fh(h,b.props,H,P),Eh(h,b.children,P),_o(),Rl(h),Eo()},oe=(h,b,P,H,M,k,q,U,z=!1)=>{const I=h&&h.children,ie=h?h.shapeFlag:0,X=b.children,{patchFlag:ne,shapeFlag:se}=b;if(ne>0){if(ne&128){Pe(I,X,P,H,M,k,q,U,z);return}else if(ne&256){ye(I,X,P,H,M,k,q,U,z);return}}se&8?(ie&16&&he(I,M,k),X!==I&&d(P,X)):ie&16?se&16?Pe(I,X,P,H,M,k,q,U,z):he(I,M,k,!0):(ie&8&&d(P,""),se&16&&F(X,P,H,M,k,q,U,z))},ye=(h,b,P,H,M,k,q,U,z)=>{h=h||pr,b=b||pr;const I=h.length,ie=b.length,X=Math.min(I,ie);let ne;for(ne=0;neie?he(h,M,k,!0,!1,X):F(b,P,H,M,k,q,U,z,X)},Pe=(h,b,P,H,M,k,q,U,z)=>{let I=0;const ie=b.length;let X=h.length-1,ne=ie-1;for(;I<=X&&I<=ne;){const se=h[I],ve=b[I]=z?wo(b[I]):Kt(b[I]);if(No(se,ve))g(se,ve,P,null,M,k,q,U,z);else break;I++}for(;I<=X&&I<=ne;){const se=h[X],ve=b[ne]=z?wo(b[ne]):Kt(b[ne]);if(No(se,ve))g(se,ve,P,null,M,k,q,U,z);else break;X--,ne--}if(I>X){if(I<=ne){const se=ne+1,ve=sene)for(;I<=X;)Fe(h[I],M,k,!0),I++;else{const se=I,ve=I,Te=new Map;for(I=ve;I<=ne;I++){const at=b[I]=z?wo(b[I]):Kt(b[I]);at.key!=null&&Te.set(at.key,I)}let Ce,Ze=0;const Qe=ne-ve+1;let nt=!1,it=0;const Wt=new Array(Qe);for(I=0;I=Qe){Fe(at,M,k,!0);continue}let D;if(at.key!=null)D=Te.get(at.key);else for(Ce=ve;Ce<=ne;Ce++)if(Wt[Ce-ve]===0&&No(at,b[Ce])){D=Ce;break}D===void 0?Fe(at,M,k,!0):(Wt[D-ve]=I+1,D>=it?it=D:nt=!0,g(at,b[D],P,null,M,k,q,U,z),Ze++)}const Ht=nt?kh(Wt):pr;for(Ce=Ht.length-1,I=Qe-1;I>=0;I--){const at=ve+I,D=b[at],Q=at+1{const{el:k,type:q,transition:U,children:z,shapeFlag:I}=h;if(I&6){Re(h.component.subTree,b,P,H);return}if(I&128){h.suspense.move(b,P,H);return}if(I&64){q.move(h,b,P,Ge);return}if(q===et){r(k,b,P);for(let X=0;XU.enter(k),M);else{const{leave:X,delayLeave:ne,afterLeave:se}=U,ve=()=>r(k,b,P),Te=()=>{X(k,()=>{ve(),se&&se()})};ne?ne(k,ve,Te):Te()}else r(k,b,P)},Fe=(h,b,P,H=!1,M=!1)=>{const{type:k,props:q,ref:U,children:z,dynamicChildren:I,shapeFlag:ie,patchFlag:X,dirs:ne,cacheIndex:se}=h;if(X===-2&&(M=!1),U!=null&&li(U,null,P,h,!0),se!=null&&(b.renderCache[se]=void 0),ie&256){b.ctx.deactivate(h);return}const ve=ie&1&&ne,Te=!br(h);let Ce;if(Te&&(Ce=q&&q.onVnodeBeforeUnmount)&&Nt(Ce,b,h),ie&6)gt(h.component,P,H);else{if(ie&128){h.suspense.unmount(P,H);return}ve&&Do(h,null,b,"beforeUnmount"),ie&64?h.type.remove(h,b,P,Ge,H):I&&!I.hasOnce&&(k!==et||X>0&&X&64)?he(I,b,P,!1,!0):(k===et&&X&384||!M&&ie&16)&&he(z,b,P),H&&Ve(h)}(Te&&(Ce=q&&q.onVnodeUnmounted)||ve)&&bt(()=>{Ce&&Nt(Ce,b,h),ve&&Do(h,null,b,"unmounted")},P)},Ve=h=>{const{type:b,el:P,anchor:H,transition:M}=h;if(b===et){qe(P,H);return}if(b===Xn){w(h);return}const k=()=>{n(P),M&&!M.persisted&&M.afterLeave&&M.afterLeave()};if(h.shapeFlag&1&&M&&!M.persisted){const{leave:q,delayLeave:U}=M,z=()=>q(P,k);U?U(h.el,k,z):z()}else k()},qe=(h,b)=>{let P;for(;h!==b;)P=p(h),n(h),h=P;n(b)},gt=(h,b,P)=>{const{bum:H,scope:M,job:k,subTree:q,um:U,m:z,a:I}=h;Ol(z),Ol(I),H&&Kn(H),M.stop(),k&&(k.flags|=8,Fe(q,h,b,P)),U&&bt(U,b),bt(()=>{h.isUnmounted=!0},b),b&&b.pendingBranch&&!b.isUnmounted&&h.asyncDep&&!h.asyncResolved&&h.suspenseId===b.pendingId&&(b.deps--,b.deps===0&&b.resolve())},he=(h,b,P,H=!1,M=!1,k=0)=>{for(let q=k;q{if(h.shapeFlag&6)return Ue(h.component.subTree);if(h.shapeFlag&128)return h.suspense.next();const b=p(h.anchor||h.el),P=b&&b[Oc];return P?p(P):b};let rt=!1;const be=(h,b,P)=>{h==null?b._vnode&&Fe(b._vnode,null,null,!0):g(b._vnode||null,h,b,null,null,null,P),b._vnode=h,rt||(rt=!0,Rl(),Hc(),rt=!1)},Ge={p:g,um:Fe,m:Re,r:Ve,mt:G,mc:F,pc:oe,pbc:B,n:Ue,o:e};return{render:be,hydrate:void 0,createApp:$h(be)}}function Yi({type:e,props:t},o){return o==="svg"&&e==="foreignObject"||o==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:o}function Oo({effect:e,job:t},o){o?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Hh(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function al(e,t,o=!1){const r=e.children,n=t.children;if(ce(r)&&ce(n))for(let i=0;i>1,e[o[l]]0&&(t[r]=o[i-1]),o[i]=r)}}for(i=o.length,a=o[i-1];i-- >0;)o[i]=a,a=t[a];return o}function gd(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:gd(t)}function Ol(e){if(e)for(let t=0;tLe(Dh);function sn(e,t){return ll(e,null,t)}function Zt(e,t,o){return ll(e,t,o)}function ll(e,t,o=Me){const{immediate:r,deep:n,flush:i,once:a}=o,l=Xe({},o),s=t&&r||!t&&i!=="post";let c;if(dn){if(i==="sync"){const m=Oh();c=m.__watcherHandles||(m.__watcherHandles=[])}else if(!s){const m=()=>{};return m.stop=Jt,m.resume=Jt,m.pause=Jt,m}}const d=tt;l.call=(m,f,g)=>Lt(m,d,f,g);let u=!1;i==="post"?l.scheduler=m=>{bt(m,d&&d.suspense)}:i!=="sync"&&(u=!0,l.scheduler=(m,f)=>{f?m():rl(m)}),l.augmentJob=m=>{t&&(m.flags|=4),u&&(m.flags|=2,d&&(m.id=d.uid,m.i=d))};const p=rh(e,t,l);return dn&&(c?c.push(p):s&&p()),p}function Bh(e,t,o){const r=this.proxy,n=We(e)?e.includes(".")?md(r,e):()=>r[e]:e.bind(r,r);let i;me(t)?i=t:(i=t.handler,o=t);const a=wn(this),l=ll(n,i.bind(r),o);return a(),l}function md(e,t){const o=t.split(".");return()=>{let r=e;for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Mt(t)}Modifiers`]||e[`${Io(t)}Modifiers`];function Wh(e,t,...o){if(e.isUnmounted)return;const r=e.vnode.props||Me;let n=o;const i=t.startsWith("update:"),a=i&&Lh(r,t.slice(7));a&&(a.trim&&(n=o.map(d=>We(d)?d.trim():d)),a.number&&(n=o.map(oi)));let l,s=r[l=ji(t)]||r[l=ji(Mt(t))];!s&&i&&(s=r[l=ji(Io(t))]),s&&Lt(s,e,6,n);const c=r[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Lt(c,e,6,n)}}function bd(e,t,o=!1){const r=t.emitsCache,n=r.get(e);if(n!==void 0)return n;const i=e.emits;let a={},l=!1;if(!me(e)){const s=c=>{const d=bd(c,t,!0);d&&(l=!0,Xe(a,d))};!o&&t.mixins.length&&t.mixins.forEach(s),e.extends&&s(e.extends),e.mixins&&e.mixins.forEach(s)}return!i&&!l?(_e(e)&&r.set(e,null),null):(ce(i)?i.forEach(s=>a[s]=null):Xe(a,i),_e(e)&&r.set(e,a),a)}function Ti(e,t){return!e||!gi(t)?!1:(t=t.slice(2).replace(/Once$/,""),$e(e,t[0].toLowerCase()+t.slice(1))||$e(e,Io(t))||$e(e,t))}function Bl(e){const{type:t,vnode:o,proxy:r,withProxy:n,propsOptions:[i],slots:a,attrs:l,emit:s,render:c,renderCache:d,props:u,data:p,setupState:m,ctx:f,inheritAttrs:g}=e,S=ai(e);let v,$;try{if(o.shapeFlag&4){const w=n||r,_=w;v=Kt(c.call(_,w,d,u,m,p,f)),$=l}else{const w=t;v=Kt(w.length>1?w(u,{attrs:l,slots:a,emit:s}):w(u,null)),$=t.props?l:jh(l)}}catch(w){Jr.length=0,yi(w,e,1),v=ht(pt)}let T=v;if($&&g!==!1){const w=Object.keys($),{shapeFlag:_}=T;w.length&&_&7&&(i&&w.some(Na)&&($=Nh($,i)),T=Ro(T,$,!1,!0))}return o.dirs&&(T=Ro(T,null,!1,!0),T.dirs=T.dirs?T.dirs.concat(o.dirs):o.dirs),o.transition&&or(T,o.transition),v=T,ai(S),v}const jh=e=>{let t;for(const o in e)(o==="class"||o==="style"||gi(o))&&((t||(t={}))[o]=e[o]);return t},Nh=(e,t)=>{const o={};for(const r in e)(!Na(r)||!(r.slice(9)in t))&&(o[r]=e[r]);return o};function Vh(e,t,o){const{props:r,children:n,component:i}=e,{props:a,children:l,patchFlag:s}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(o&&s>=0){if(s&1024)return!0;if(s&16)return r?Ll(r,a,c):!!a;if(s&8){const d=t.dynamicProps;for(let u=0;ue.__isSuspense;function qh(e,t){t&&t.pendingBranch?ce(e)?t.effects.push(...e):t.effects.push(e):ah(e)}const et=Symbol.for("v-fgt"),$i=Symbol.for("v-txt"),pt=Symbol.for("v-cmt"),Xn=Symbol.for("v-stc"),Jr=[];let Rt=null;function ba(e=!1){Jr.push(Rt=e?null:[])}function Gh(){Jr.pop(),Rt=Jr[Jr.length-1]||null}let cn=1;function Wl(e,t=!1){cn+=e,e<0&&Rt&&t&&(Rt.hasOnce=!0)}function xd(e){return e.dynamicChildren=cn>0?Rt||pr:null,Gh(),cn>0&&Rt&&Rt.push(e),e}function Y2(e,t,o,r,n,i){return xd(yd(e,t,o,r,n,i,!0))}function va(e,t,o,r,n){return xd(ht(e,t,o,r,n,!0))}function Cr(e){return e?e.__v_isVNode===!0:!1}function No(e,t){return e.type===t.type&&e.key===t.key}const Cd=({key:e})=>e??null,Jn=({ref:e,ref_key:t,ref_for:o})=>(typeof e=="number"&&(e=""+e),e!=null?We(e)||ot(e)||me(e)?{i:Ye,r:e,k:t,f:!!o}:e:null);function yd(e,t=null,o=null,r=0,n=null,i=e===et?0:1,a=!1,l=!1){const s={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Cd(t),ref:t&&Jn(t),scopeId:Dc,slotScopeIds:null,children:o,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:r,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:Ye};return l?(sl(s,o),i&128&&e.normalize(s)):o&&(s.shapeFlag|=We(o)?8:16),cn>0&&!a&&Rt&&(s.patchFlag>0||i&6)&&s.patchFlag!==32&&Rt.push(s),s}const ht=Kh;function Kh(e,t=null,o=null,r=0,n=null,i=!1){if((!e||e===ed)&&(e=pt),Cr(e)){const l=Ro(e,t,!0);return o&&sl(l,o),cn>0&&!i&&Rt&&(l.shapeFlag&6?Rt[Rt.indexOf(e)]=l:Rt.push(l)),l.patchFlag=-2,l}if(ng(e)&&(e=e.__vccOpts),t){t=Yh(t);let{class:l,style:s}=t;l&&!We(l)&&(t.class=Ga(l)),_e(s)&&(ol(s)&&!ce(s)&&(s=Xe({},s)),t.style=qa(s))}const a=We(e)?1:vd(e)?128:Bc(e)?64:_e(e)?4:me(e)?2:0;return yd(e,t,o,r,n,a,i,!0)}function Yh(e){return e?ol(e)||sd(e)?Xe({},e):e:null}function Ro(e,t,o=!1,r=!1){const{props:n,ref:i,patchFlag:a,children:l,transition:s}=e,c=t?Sd(n||{},t):n,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Cd(c),ref:t&&t.ref?o&&i?ce(i)?i.concat(Jn(t)):[i,Jn(t)]:Jn(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==et?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:s,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ro(e.ssContent),ssFallback:e.ssFallback&&Ro(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return s&&r&&or(d,s.clone(d)),d}function xa(e=" ",t=0){return ht($i,null,e,t)}function X2(e,t){const o=ht(Xn,null,e);return o.staticCount=t,o}function J2(e="",t=!1){return t?(ba(),va(pt,null,e)):ht(pt,null,e)}function Kt(e){return e==null||typeof e=="boolean"?ht(pt):ce(e)?ht(et,null,e.slice()):Cr(e)?wo(e):ht($i,null,String(e))}function wo(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ro(e)}function sl(e,t){let o=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(ce(t))o=16;else if(typeof t=="object")if(r&65){const n=t.default;n&&(n._c&&(n._d=!1),sl(e,n()),n._c&&(n._d=!0));return}else{o=32;const n=t._;!n&&!sd(t)?t._ctx=Ye:n===3&&Ye&&(Ye.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else me(t)?(t={default:t,_ctx:Ye},o=32):(t=String(t),r&64?(o=16,t=[xa(t)]):o=8);e.children=t,e.shapeFlag|=o}function Sd(...e){const t={};for(let o=0;ott||Ye;let ci,Ca;{const e=vi(),t=(o,r)=>{let n;return(n=e[o])||(n=e[o]=[]),n.push(r),i=>{n.length>1?n.forEach(a=>a(i)):n[0](i)}};ci=t("__VUE_INSTANCE_SETTERS__",o=>tt=o),Ca=t("__VUE_SSR_SETTERS__",o=>dn=o)}const wn=e=>{const t=tt;return ci(e),e.scope.on(),()=>{e.scope.off(),ci(t)}},jl=()=>{tt&&tt.scope.off(),ci(null)};function wd(e){return e.vnode.shapeFlag&4}let dn=!1;function Qh(e,t=!1,o=!1){t&&Ca(t);const{props:r,children:n}=e.vnode,i=wd(e);Rh(e,r,i,t),_h(e,n,o);const a=i?eg(e,t):void 0;return t&&Ca(!1),a}function eg(e,t){const o=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,xh);const{setup:r}=o;if(r){_o();const n=e.setupContext=r.length>1?og(e):null,i=wn(e),a=yn(r,e,0,[e.props,n]),l=lc(a);if(Eo(),i(),(l||e.sp)&&!br(e)&&Gc(e),l){if(a.then(jl,jl),t)return a.then(s=>{Nl(e,s)}).catch(s=>{yi(s,e,0)});e.asyncDep=a}else Nl(e,a)}else Pd(e)}function Nl(e,t,o){me(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:_e(t)&&(e.setupState=_c(t)),Pd(e)}function Pd(e,t,o){const r=e.type;e.render||(e.render=r.render||Jt);{const n=wn(e);_o();try{Ch(e)}finally{Eo(),n()}}}const tg={get(e,t){return dt(e,"get",""),e[t]}};function og(e){const t=o=>{e.exposed=o||{}};return{attrs:new Proxy(e.attrs,tg),slots:e.slots,emit:e.emit,expose:t}}function Ri(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(_c(da(e.exposed)),{get(t,o){if(o in t)return t[o];if(o in Xr)return Xr[o](e)},has(t,o){return o in t||o in Xr}})):e.proxy}function rg(e,t=!0){return me(e)?e.displayName||e.name:e.name||t&&e.__name}function ng(e){return me(e)&&"__vccOpts"in e}const Y=(e,t)=>th(e,t,dn);function y(e,t,o){const r=arguments.length;return r===2?_e(t)&&!ce(t)?Cr(t)?ht(e,null,[t]):ht(e,t):ht(e,null,t):(r>3?o=Array.prototype.slice.call(arguments,2):r===3&&Cr(o)&&(o=[o]),ht(e,t,o))}const ig="3.5.13";/** +**/function yn(e,t,o,r){try{return r?e(...r):e()}catch(n){yi(n,t,o)}}function Lt(e,t,o,r){if(me(e)){const n=yn(e,t,o,r);return n&&lc(n)&&n.catch(i=>{yi(i,t,o)}),n}if(ce(e)){const n=[];for(let i=0;i>>1,n=xt[r],i=an(n);i=an(o)?xt.push(e):xt.splice(ih(t),0,e),e.flags|=1,zc()}}function zc(){ii||(ii=Mc.then(kc))}function ah(e){ce(e)?mr.push(...e):yo&&e.id===-1?yo.splice(fr+1,0,e):e.flags&1||(mr.push(e),e.flags|=1),zc()}function Rl(e,t,o=Gt+1){for(;oan(o)-an(r));if(mr.length=0,yo){yo.push(...t);return}for(yo=t,fr=0;fre.id==null?e.flags&2?-1:1/0:e.id;function kc(e){try{for(Gt=0;Gt{r._d&&Wl(-1);const i=ai(t);let a;try{a=e(...n)}finally{ai(i),r._d&&Wl(1)}return a};return r._n=!0,r._c=!0,r._d=!0,r}function V2(e,t){if(Ye===null)return e;const o=Ri(Ye),r=e.dirs||(e.dirs=[]);for(let n=0;ne.__isTeleport,Yr=e=>e&&(e.disabled||e.disabled===""),Fl=e=>e&&(e.defer||e.defer===""),Al=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Il=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,fa=(e,t)=>{const o=e&&e.to;return We(o)?t?t(o):null:o},Lc={name:"Teleport",__isTeleport:!0,process(e,t,o,r,n,i,a,l,s,c){const{mc:d,pc:u,pbc:p,o:{insert:m,querySelector:f,createText:g,createComment:S}}=c,v=Yr(t.props);let{shapeFlag:$,children:T,dynamicChildren:w}=t;if(e==null){const E=t.el=g(""),O=t.anchor=g("");m(E,o,r),m(O,o,r);const x=(R,B)=>{$&16&&(n&&n.isCE&&(n.ce._teleportTarget=R),d(T,R,B,n,i,a,l,s))},F=()=>{const R=t.target=fa(t.props,f),B=Wc(R,t,g,m);R&&(a!=="svg"&&Al(R)?a="svg":a!=="mathml"&&Il(R)&&(a="mathml"),v||(x(R,B),Yn(t,!1)))};v&&(x(o,O),Yn(t,!0)),Fl(t.props)?bt(()=>{F(),t.el.__isMounted=!0},i):F()}else{if(Fl(t.props)&&!e.el.__isMounted){bt(()=>{Lc.process(e,t,o,r,n,i,a,l,s,c),delete e.el.__isMounted},i);return}t.el=e.el,t.targetStart=e.targetStart;const E=t.anchor=e.anchor,O=t.target=e.target,x=t.targetAnchor=e.targetAnchor,F=Yr(e.props),R=F?o:O,B=F?E:x;if(a==="svg"||Al(O)?a="svg":(a==="mathml"||Il(O))&&(a="mathml"),w?(p(e.dynamicChildren,w,R,n,i,a,l),al(e,t,!0)):s||u(e,t,R,B,n,i,a,l,!1),v)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):kn(t,o,E,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const j=t.target=fa(t.props,f);j&&kn(t,j,null,c,0)}else F&&kn(t,O,x,c,1);Yn(t,v)}},remove(e,t,o,{um:r,o:{remove:n}},i){const{shapeFlag:a,children:l,anchor:s,targetStart:c,targetAnchor:d,target:u,props:p}=e;if(u&&(n(c),n(d)),i&&n(s),a&16){const m=i||!Yr(p);for(let f=0;f{e.isMounted=!0}),nr(()=>{e.isUnmounting=!0}),e}const It=[Function,Array],Nc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:It,onEnter:It,onAfterEnter:It,onEnterCancelled:It,onBeforeLeave:It,onLeave:It,onAfterLeave:It,onLeaveCancelled:It,onBeforeAppear:It,onAppear:It,onAfterAppear:It,onAppearCancelled:It},Vc=e=>{const t=e.subTree;return t.component?Vc(t.component):t},dh={name:"BaseTransition",props:Nc,setup(e,{slots:t}){const o=Sn(),r=jc();return()=>{const n=t.default&&nl(t.default(),!0);if(!n||!n.length)return;const i=Uc(n),a=we(e),{mode:l}=a;if(r.isLeaving)return Gi(i);const s=El(i);if(!s)return Gi(i);let c=ln(s,a,r,o,u=>c=u);s.type!==pt&&or(s,c);let d=o.subTree&&El(o.subTree);if(d&&d.type!==pt&&!No(s,d)&&Vc(o).type!==pt){let u=ln(d,a,r,o);if(or(d,u),l==="out-in"&&s.type!==pt)return r.isLeaving=!0,u.afterLeave=()=>{r.isLeaving=!1,o.job.flags&8||o.update(),delete u.afterLeave,d=void 0},Gi(i);l==="in-out"&&s.type!==pt?u.delayLeave=(p,m,f)=>{const g=qc(r,d);g[String(d.key)]=d,p[So]=()=>{m(),p[So]=void 0,delete c.delayedLeave,d=void 0},c.delayedLeave=()=>{f(),delete c.delayedLeave,d=void 0}}:d=void 0}else d&&(d=void 0);return i}}};function Uc(e){let t=e[0];if(e.length>1){for(const o of e)if(o.type!==pt){t=o;break}}return t}const uh=dh;function qc(e,t){const{leavingVNodes:o}=e;let r=o.get(t.type);return r||(r=Object.create(null),o.set(t.type,r)),r}function ln(e,t,o,r,n){const{appear:i,mode:a,persisted:l=!1,onBeforeEnter:s,onEnter:c,onAfterEnter:d,onEnterCancelled:u,onBeforeLeave:p,onLeave:m,onAfterLeave:f,onLeaveCancelled:g,onBeforeAppear:S,onAppear:v,onAfterAppear:$,onAppearCancelled:T}=t,w=String(e.key),E=qc(o,e),O=(R,B)=>{R&&Lt(R,r,9,B)},x=(R,B)=>{const j=B[1];O(R,B),ce(R)?R.every(A=>A.length<=1)&&j():R.length<=1&&j()},F={mode:a,persisted:l,beforeEnter(R){let B=s;if(!o.isMounted)if(i)B=S||s;else return;R[So]&&R[So](!0);const j=E[w];j&&No(e,j)&&j.el[So]&&j.el[So](),O(B,[R])},enter(R){let B=c,j=d,A=u;if(!o.isMounted)if(i)B=v||c,j=$||d,A=T||u;else return;let J=!1;const G=R[Dn]=le=>{J||(J=!0,le?O(A,[R]):O(j,[R]),F.delayedLeave&&F.delayedLeave(),R[Dn]=void 0)};B?x(B,[R,G]):G()},leave(R,B){const j=String(e.key);if(R[Dn]&&R[Dn](!0),o.isUnmounting)return B();O(p,[R]);let A=!1;const J=R[So]=G=>{A||(A=!0,B(),G?O(g,[R]):O(f,[R]),R[So]=void 0,E[j]===e&&delete E[j])};E[j]=e,m?x(m,[R,J]):J()},clone(R){const B=ln(R,t,o,r,n);return n&&n(B),B}};return F}function Gi(e){if(Si(e))return e=Ro(e),e.children=null,e}function El(e){if(!Si(e))return Bc(e.type)&&e.children?Uc(e.children):e;const{shapeFlag:t,children:o}=e;if(o){if(t&16)return o[0];if(t&32&&me(o.default))return o.default()}}function or(e,t){e.shapeFlag&6&&e.component?(e.transition=t,or(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function nl(e,t=!1,o){let r=[],n=0;for(let i=0;i1)for(let i=0;ili(f,t&&(ce(t)?t[g]:t),o,r,n));return}if(br(r)&&!n){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&li(e,t,o,r.component.subTree);return}const i=r.shapeFlag&4?Ri(r.component):r.el,a=n?null:i,{i:l,r:s}=e,c=t&&t.r,d=l.refs===Me?l.refs={}:l.refs,u=l.setupState,p=we(u),m=u===Me?()=>!1:f=>$e(p,f);if(c!=null&&c!==s&&(We(c)?(d[c]=null,m(c)&&(u[c]=null)):ot(c)&&(c.value=null)),me(s))yn(s,l,12,[a,d]);else{const f=We(s),g=ot(s);if(f||g){const S=()=>{if(e.f){const v=f?m(s)?u[s]:d[s]:s.value;n?ce(v)&&Va(v,i):ce(v)?v.includes(i)||v.push(i):f?(d[s]=[i],m(s)&&(u[s]=d[s])):(s.value=[i],e.k&&(d[e.k]=s.value))}else f?(d[s]=a,m(s)&&(u[s]=a)):g&&(s.value=a,e.k&&(d[e.k]=a))};a?(S.id=-1,bt(S,o)):S()}}}vi().requestIdleCallback;vi().cancelIdleCallback;const br=e=>!!e.type.__asyncLoader,Si=e=>e.type.__isKeepAlive;function Kc(e,t){Xc(e,"a",t)}function Yc(e,t){Xc(e,"da",t)}function Xc(e,t,o=tt){const r=e.__wdc||(e.__wdc=()=>{let n=o;for(;n;){if(n.isDeactivated)return;n=n.parent}return e()});if(wi(t,r,o),o){let n=o.parent;for(;n&&n.parent;)Si(n.parent.vnode)&&fh(r,t,o,n),n=n.parent}}function fh(e,t,o,r){const n=wi(t,e,r,!0);Zc(()=>{Va(r[t],n)},o)}function wi(e,t,o=tt,r=!1){if(o){const n=o[e]||(o[e]=[]),i=t.__weh||(t.__weh=(...a)=>{Eo();const l=wn(o),s=Lt(t,o,e,a);return l(),_o(),s});return r?n.unshift(i):n.push(i),i}}const go=e=>(t,o=tt)=>{(!dn||e==="sp")&&wi(e,(...r)=>t(...r),o)},Pi=go("bm"),Mo=go("m"),ph=go("bu"),Jc=go("u"),nr=go("bum"),Zc=go("um"),hh=go("sp"),gh=go("rtg"),mh=go("rtc");function bh(e,t=tt){wi("ec",e,t)}const Qc="components";function U2(e,t){return td(Qc,e,!0,t)||e}const ed=Symbol.for("v-ndc");function q2(e){return We(e)?td(Qc,e,!1)||e:e||ed}function td(e,t,o=!0,r=!1){const n=Ye||tt;if(n){const i=n.type;{const l=rg(i,!1);if(l&&(l===t||l===Mt(t)||l===bi(Mt(t))))return i}const a=_l(n[e]||i[e],t)||_l(n.appContext[e],t);return!a&&r?i:a}}function _l(e,t){return e&&(e[t]||e[Mt(t)]||e[bi(Mt(t))])}function G2(e,t,o,r){let n;const i=o,a=ce(e);if(a||We(e)){const l=a&&gr(e);let s=!1;l&&(s=!Et(e),e=xi(e)),n=new Array(e.length);for(let c=0,d=e.length;ct(l,s,void 0,i));else{const l=Object.keys(e);n=new Array(l.length);for(let s=0,c=l.length;sCr(t)?!(t.type===pt||t.type===et&&!od(t.children)):!0)?e:null}const pa=e=>e?wd(e)?Ri(e):pa(e.parent):null,Xr=Xe(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>pa(e.parent),$root:e=>pa(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>nd(e),$forceUpdate:e=>e.f||(e.f=()=>{rl(e.update)}),$nextTick:e=>e.n||(e.n=nn.bind(e.proxy)),$watch:e=>Bh.bind(e)}),Ki=(e,t)=>e!==Me&&!e.__isScriptSetup&&$e(e,t),xh={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:o,setupState:r,data:n,props:i,accessCache:a,type:l,appContext:s}=e;let c;if(t[0]!=="$"){const m=a[t];if(m!==void 0)switch(m){case 1:return r[t];case 2:return n[t];case 4:return o[t];case 3:return i[t]}else{if(Ki(r,t))return a[t]=1,r[t];if(n!==Me&&$e(n,t))return a[t]=2,n[t];if((c=e.propsOptions[0])&&$e(c,t))return a[t]=3,i[t];if(o!==Me&&$e(o,t))return a[t]=4,o[t];ha&&(a[t]=0)}}const d=Xr[t];let u,p;if(d)return t==="$attrs"&&dt(e.attrs,"get",""),d(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(o!==Me&&$e(o,t))return a[t]=4,o[t];if(p=s.config.globalProperties,$e(p,t))return p[t]},set({_:e},t,o){const{data:r,setupState:n,ctx:i}=e;return Ki(n,t)?(n[t]=o,!0):r!==Me&&$e(r,t)?(r[t]=o,!0):$e(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=o,!0)},has({_:{data:e,setupState:t,accessCache:o,ctx:r,appContext:n,propsOptions:i}},a){let l;return!!o[a]||e!==Me&&$e(e,a)||Ki(t,a)||(l=i[0])&&$e(l,a)||$e(r,a)||$e(Xr,a)||$e(n.config.globalProperties,a)},defineProperty(e,t,o){return o.get!=null?e._.accessCache[t]=0:$e(o,"value")&&this.set(e,t,o.value,null),Reflect.defineProperty(e,t,o)}};function Ml(e){return ce(e)?e.reduce((t,o)=>(t[o]=null,t),{}):e}let ha=!0;function Ch(e){const t=nd(e),o=e.proxy,r=e.ctx;ha=!1,t.beforeCreate&&zl(t.beforeCreate,e,"bc");const{data:n,computed:i,methods:a,watch:l,provide:s,inject:c,created:d,beforeMount:u,mounted:p,beforeUpdate:m,updated:f,activated:g,deactivated:S,beforeDestroy:v,beforeUnmount:$,destroyed:T,unmounted:w,render:E,renderTracked:O,renderTriggered:x,errorCaptured:F,serverPrefetch:R,expose:B,inheritAttrs:j,components:A,directives:J,filters:G}=t;if(c&&yh(c,r,null),a)for(const N in a){const oe=a[N];me(oe)&&(r[N]=oe.bind(o))}if(n){const N=n.call(o,o);Ee(N)&&(e.data=Ci(N))}if(ha=!0,i)for(const N in i){const oe=i[N],ye=me(oe)?oe.bind(o,o):me(oe.get)?oe.get.bind(o,o):Jt,Pe=!me(oe)&&me(oe.set)?oe.set.bind(o):Jt,Re=Y({get:ye,set:Pe});Object.defineProperty(r,N,{enumerable:!0,configurable:!0,get:()=>Re.value,set:Fe=>Re.value=Fe})}if(l)for(const N in l)rd(l[N],r,o,N);if(s){const N=me(s)?s.call(o):s;Reflect.ownKeys(N).forEach(oe=>{po(oe,N[oe])})}d&&zl(d,e,"c");function te(N,oe){ce(oe)?oe.forEach(ye=>N(ye.bind(o))):oe&&N(oe.bind(o))}if(te(Pi,u),te(Mo,p),te(ph,m),te(Jc,f),te(Kc,g),te(Yc,S),te(bh,F),te(mh,O),te(gh,x),te(nr,$),te(Zc,w),te(hh,R),ce(B))if(B.length){const N=e.exposed||(e.exposed={});B.forEach(oe=>{Object.defineProperty(N,oe,{get:()=>o[oe],set:ye=>o[oe]=ye})})}else e.exposed||(e.exposed={});E&&e.render===Jt&&(e.render=E),j!=null&&(e.inheritAttrs=j),A&&(e.components=A),J&&(e.directives=J),R&&Gc(e)}function yh(e,t,o=Jt){ce(e)&&(e=ga(e));for(const r in e){const n=e[r];let i;Ee(n)?"default"in n?i=Le(n.from||r,n.default,!0):i=Le(n.from||r):i=Le(n),ot(i)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>i.value,set:a=>i.value=a}):t[r]=i}}function zl(e,t,o){Lt(ce(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,o)}function rd(e,t,o,r){let n=r.includes(".")?md(o,r):()=>o[r];if(We(e)){const i=t[e];me(i)&&Zt(n,i)}else if(me(e))Zt(n,e.bind(o));else if(Ee(e))if(ce(e))e.forEach(i=>rd(i,t,o,r));else{const i=me(e.handler)?e.handler.bind(o):t[e.handler];me(i)&&Zt(n,i,e)}}function nd(e){const t=e.type,{mixins:o,extends:r}=t,{mixins:n,optionsCache:i,config:{optionMergeStrategies:a}}=e.appContext,l=i.get(t);let s;return l?s=l:!n.length&&!o&&!r?s=t:(s={},n.length&&n.forEach(c=>si(s,c,a,!0)),si(s,t,a)),Ee(t)&&i.set(t,s),s}function si(e,t,o,r=!1){const{mixins:n,extends:i}=t;i&&si(e,i,o,!0),n&&n.forEach(a=>si(e,a,o,!0));for(const a in t)if(!(r&&a==="expose")){const l=Sh[a]||o&&o[a];e[a]=l?l(e[a],t[a]):t[a]}return e}const Sh={data:Hl,props:kl,emits:kl,methods:Nr,computed:Nr,beforeCreate:mt,created:mt,beforeMount:mt,mounted:mt,beforeUpdate:mt,updated:mt,beforeDestroy:mt,beforeUnmount:mt,destroyed:mt,unmounted:mt,activated:mt,deactivated:mt,errorCaptured:mt,serverPrefetch:mt,components:Nr,directives:Nr,watch:Ph,provide:Hl,inject:wh};function Hl(e,t){return t?e?function(){return Xe(me(e)?e.call(this,this):e,me(t)?t.call(this,this):t)}:t:e}function wh(e,t){return Nr(ga(e),ga(t))}function ga(e){if(ce(e)){const t={};for(let o=0;o1)return o&&me(t)?t.call(r&&r.proxy):t}}function K2(){return!!(tt||Ye||Xo)}const ad={},ld=()=>Object.create(ad),sd=e=>Object.getPrototypeOf(e)===ad;function Rh(e,t,o,r=!1){const n={},i=ld();e.propsDefaults=Object.create(null),cd(e,t,n,i);for(const a in e.propsOptions[0])a in n||(n[a]=void 0);o?e.props=r?n:Kp(n):e.type.props?e.props=n:e.props=i,e.attrs=i}function Fh(e,t,o,r){const{props:n,attrs:i,vnode:{patchFlag:a}}=e,l=we(n),[s]=e.propsOptions;let c=!1;if((r||a>0)&&!(a&16)){if(a&8){const d=e.vnode.dynamicProps;for(let u=0;u{s=!0;const[p,m]=dd(u,t,!0);Xe(a,p),m&&l.push(...m)};!o&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!i&&!s)return Ee(e)&&r.set(e,pr),pr;if(ce(i))for(let d=0;de[0]==="_"||e==="$stable",il=e=>ce(e)?e.map(Kt):[Kt(e)],Ih=(e,t,o)=>{if(t._n)return t;const r=lh((...n)=>il(t(...n)),o);return r._c=!1,r},fd=(e,t,o)=>{const r=e._ctx;for(const n in e){if(ud(n))continue;const i=e[n];if(me(i))t[n]=Ih(n,i,r);else if(i!=null){const a=il(i);t[n]=()=>a}}},pd=(e,t)=>{const o=il(t);e.slots.default=()=>o},hd=(e,t,o)=>{for(const r in t)(o||r!=="_")&&(e[r]=t[r])},Eh=(e,t,o)=>{const r=e.slots=ld();if(e.vnode.shapeFlag&32){const n=t._;n?(hd(r,t,o),o&&dc(r,"_",n,!0)):fd(t,r)}else t&&pd(e,t)},_h=(e,t,o)=>{const{vnode:r,slots:n}=e;let i=!0,a=Me;if(r.shapeFlag&32){const l=t._;l?o&&l===1?i=!1:hd(n,t,o):(i=!t.$stable,fd(t,n)),a=t}else t&&(pd(e,t),a={default:1});if(i)for(const l in n)!ud(l)&&a[l]==null&&delete n[l]},bt=qh;function Mh(e){return zh(e)}function zh(e,t){const o=vi();o.__VUE__=!0;const{insert:r,remove:n,patchProp:i,createElement:a,createText:l,createComment:s,setText:c,setElementText:d,parentNode:u,nextSibling:p,setScopeId:m=Jt,insertStaticContent:f}=e,g=(h,b,P,H=null,M=null,k=null,q=void 0,U=null,z=!!b.dynamicChildren)=>{if(h===b)return;h&&!No(h,b)&&(H=Ue(h),Fe(h,M,k,!0),h=null),b.patchFlag===-2&&(z=!1,b.dynamicChildren=null);const{type:I,ref:ie,shapeFlag:X}=b;switch(I){case $i:S(h,b,P,H);break;case pt:v(h,b,P,H);break;case Xn:h==null&&$(b,P,H,q);break;case et:A(h,b,P,H,M,k,q,U,z);break;default:X&1?E(h,b,P,H,M,k,q,U,z):X&6?J(h,b,P,H,M,k,q,U,z):(X&64||X&128)&&I.process(h,b,P,H,M,k,q,U,z,Ge)}ie!=null&&M&&li(ie,h&&h.ref,k,b||h,!b)},S=(h,b,P,H)=>{if(h==null)r(b.el=l(b.children),P,H);else{const M=b.el=h.el;b.children!==h.children&&c(M,b.children)}},v=(h,b,P,H)=>{h==null?r(b.el=s(b.children||""),P,H):b.el=h.el},$=(h,b,P,H)=>{[h.el,h.anchor]=f(h.children,b,P,H,h.el,h.anchor)},T=({el:h,anchor:b},P,H)=>{let M;for(;h&&h!==b;)M=p(h),r(h,P,H),h=M;r(b,P,H)},w=({el:h,anchor:b})=>{let P;for(;h&&h!==b;)P=p(h),n(h),h=P;n(b)},E=(h,b,P,H,M,k,q,U,z)=>{b.type==="svg"?q="svg":b.type==="math"&&(q="mathml"),h==null?O(b,P,H,M,k,q,U,z):R(h,b,M,k,q,U,z)},O=(h,b,P,H,M,k,q,U)=>{let z,I;const{props:ie,shapeFlag:X,transition:ne,dirs:se}=h;if(z=h.el=a(h.type,k,ie&&ie.is,ie),X&8?d(z,h.children):X&16&&F(h.children,z,null,H,M,Yi(h,k),q,U),se&&Do(h,null,H,"created"),x(z,h,h.scopeId,q,H),ie){for(const Te in ie)Te!=="value"&&!qr(Te)&&i(z,Te,null,ie[Te],k,H);"value"in ie&&i(z,"value",null,ie.value,k),(I=ie.onVnodeBeforeMount)&&Nt(I,H,h)}se&&Do(h,null,H,"beforeMount");const ve=Hh(M,ne);ve&&ne.beforeEnter(z),r(z,b,P),((I=ie&&ie.onVnodeMounted)||ve||se)&&bt(()=>{I&&Nt(I,H,h),ve&&ne.enter(z),se&&Do(h,null,H,"mounted")},M)},x=(h,b,P,H,M)=>{if(P&&m(h,P),H)for(let k=0;k{for(let I=z;I{const U=b.el=h.el;let{patchFlag:z,dynamicChildren:I,dirs:ie}=b;z|=h.patchFlag&16;const X=h.props||Me,ne=b.props||Me;let se;if(P&&Oo(P,!1),(se=ne.onVnodeBeforeUpdate)&&Nt(se,P,b,h),ie&&Do(b,h,P,"beforeUpdate"),P&&Oo(P,!0),(X.innerHTML&&ne.innerHTML==null||X.textContent&&ne.textContent==null)&&d(U,""),I?B(h.dynamicChildren,I,U,P,H,Yi(b,M),k):q||oe(h,b,U,null,P,H,Yi(b,M),k,!1),z>0){if(z&16)j(U,X,ne,P,M);else if(z&2&&X.class!==ne.class&&i(U,"class",null,ne.class,M),z&4&&i(U,"style",X.style,ne.style,M),z&8){const ve=b.dynamicProps;for(let Te=0;Te{se&&Nt(se,P,b,h),ie&&Do(b,h,P,"updated")},H)},B=(h,b,P,H,M,k,q)=>{for(let U=0;U{if(b!==P){if(b!==Me)for(const k in b)!qr(k)&&!(k in P)&&i(h,k,b[k],null,M,H);for(const k in P){if(qr(k))continue;const q=P[k],U=b[k];q!==U&&k!=="value"&&i(h,k,U,q,M,H)}"value"in P&&i(h,"value",b.value,P.value,M)}},A=(h,b,P,H,M,k,q,U,z)=>{const I=b.el=h?h.el:l(""),ie=b.anchor=h?h.anchor:l("");let{patchFlag:X,dynamicChildren:ne,slotScopeIds:se}=b;se&&(U=U?U.concat(se):se),h==null?(r(I,P,H),r(ie,P,H),F(b.children||[],P,ie,M,k,q,U,z)):X>0&&X&64&&ne&&h.dynamicChildren?(B(h.dynamicChildren,ne,P,M,k,q,U),(b.key!=null||M&&b===M.subTree)&&al(h,b,!0)):oe(h,b,P,ie,M,k,q,U,z)},J=(h,b,P,H,M,k,q,U,z)=>{b.slotScopeIds=U,h==null?b.shapeFlag&512?M.ctx.activate(b,P,H,q,z):G(b,P,H,M,k,q,z):le(h,b,z)},G=(h,b,P,H,M,k,q)=>{const U=h.component=Zh(h,H,M);if(Si(h)&&(U.ctx.renderer=Ge),Qh(U,!1,q),U.asyncDep){if(M&&M.registerDep(U,te,q),!h.el){const z=U.subTree=ht(pt);v(null,z,b,P)}}else te(U,h,b,P,M,k,q)},le=(h,b,P)=>{const H=b.component=h.component;if(Vh(h,b,P))if(H.asyncDep&&!H.asyncResolved){N(H,b,P);return}else H.next=b,H.update();else b.el=h.el,H.vnode=b},te=(h,b,P,H,M,k,q)=>{const U=()=>{if(h.isMounted){let{next:X,bu:ne,u:se,parent:ve,vnode:Te}=h;{const it=gd(h);if(it){X&&(X.el=Te.el,N(h,X,q)),it.asyncDep.then(()=>{h.isUnmounted||U()});return}}let Ce=X,Ze;Oo(h,!1),X?(X.el=Te.el,N(h,X,q)):X=Te,ne&&Kn(ne),(Ze=X.props&&X.props.onVnodeBeforeUpdate)&&Nt(Ze,ve,X,Te),Oo(h,!0);const Qe=Bl(h),nt=h.subTree;h.subTree=Qe,g(nt,Qe,u(nt.el),Ue(nt),h,M,k),X.el=Qe.el,Ce===null&&Uh(h,Qe.el),se&&bt(se,M),(Ze=X.props&&X.props.onVnodeUpdated)&&bt(()=>Nt(Ze,ve,X,Te),M)}else{let X;const{el:ne,props:se}=b,{bm:ve,m:Te,parent:Ce,root:Ze,type:Qe}=h,nt=br(b);Oo(h,!1),ve&&Kn(ve),!nt&&(X=se&&se.onVnodeBeforeMount)&&Nt(X,Ce,b),Oo(h,!0);{Ze.ce&&Ze.ce._injectChildStyle(Qe);const it=h.subTree=Bl(h);g(null,it,P,H,h,M,k),b.el=it.el}if(Te&&bt(Te,M),!nt&&(X=se&&se.onVnodeMounted)){const it=b;bt(()=>Nt(X,Ce,it),M)}(b.shapeFlag&256||Ce&&br(Ce.vnode)&&Ce.vnode.shapeFlag&256)&&h.a&&bt(h.a,M),h.isMounted=!0,b=P=H=null}};h.scope.on();const z=h.effect=new gc(U);h.scope.off();const I=h.update=z.run.bind(z),ie=h.job=z.runIfDirty.bind(z);ie.i=h,ie.id=h.uid,z.scheduler=()=>rl(ie),Oo(h,!0),I()},N=(h,b,P)=>{b.component=h;const H=h.vnode.props;h.vnode=b,h.next=null,Fh(h,b.props,H,P),_h(h,b.children,P),Eo(),Rl(h),_o()},oe=(h,b,P,H,M,k,q,U,z=!1)=>{const I=h&&h.children,ie=h?h.shapeFlag:0,X=b.children,{patchFlag:ne,shapeFlag:se}=b;if(ne>0){if(ne&128){Pe(I,X,P,H,M,k,q,U,z);return}else if(ne&256){ye(I,X,P,H,M,k,q,U,z);return}}se&8?(ie&16&&he(I,M,k),X!==I&&d(P,X)):ie&16?se&16?Pe(I,X,P,H,M,k,q,U,z):he(I,M,k,!0):(ie&8&&d(P,""),se&16&&F(X,P,H,M,k,q,U,z))},ye=(h,b,P,H,M,k,q,U,z)=>{h=h||pr,b=b||pr;const I=h.length,ie=b.length,X=Math.min(I,ie);let ne;for(ne=0;neie?he(h,M,k,!0,!1,X):F(b,P,H,M,k,q,U,z,X)},Pe=(h,b,P,H,M,k,q,U,z)=>{let I=0;const ie=b.length;let X=h.length-1,ne=ie-1;for(;I<=X&&I<=ne;){const se=h[I],ve=b[I]=z?wo(b[I]):Kt(b[I]);if(No(se,ve))g(se,ve,P,null,M,k,q,U,z);else break;I++}for(;I<=X&&I<=ne;){const se=h[X],ve=b[ne]=z?wo(b[ne]):Kt(b[ne]);if(No(se,ve))g(se,ve,P,null,M,k,q,U,z);else break;X--,ne--}if(I>X){if(I<=ne){const se=ne+1,ve=sene)for(;I<=X;)Fe(h[I],M,k,!0),I++;else{const se=I,ve=I,Te=new Map;for(I=ve;I<=ne;I++){const at=b[I]=z?wo(b[I]):Kt(b[I]);at.key!=null&&Te.set(at.key,I)}let Ce,Ze=0;const Qe=ne-ve+1;let nt=!1,it=0;const Wt=new Array(Qe);for(I=0;I=Qe){Fe(at,M,k,!0);continue}let D;if(at.key!=null)D=Te.get(at.key);else for(Ce=ve;Ce<=ne;Ce++)if(Wt[Ce-ve]===0&&No(at,b[Ce])){D=Ce;break}D===void 0?Fe(at,M,k,!0):(Wt[D-ve]=I+1,D>=it?it=D:nt=!0,g(at,b[D],P,null,M,k,q,U,z),Ze++)}const Ht=nt?kh(Wt):pr;for(Ce=Ht.length-1,I=Qe-1;I>=0;I--){const at=ve+I,D=b[at],Q=at+1{const{el:k,type:q,transition:U,children:z,shapeFlag:I}=h;if(I&6){Re(h.component.subTree,b,P,H);return}if(I&128){h.suspense.move(b,P,H);return}if(I&64){q.move(h,b,P,Ge);return}if(q===et){r(k,b,P);for(let X=0;XU.enter(k),M);else{const{leave:X,delayLeave:ne,afterLeave:se}=U,ve=()=>r(k,b,P),Te=()=>{X(k,()=>{ve(),se&&se()})};ne?ne(k,ve,Te):Te()}else r(k,b,P)},Fe=(h,b,P,H=!1,M=!1)=>{const{type:k,props:q,ref:U,children:z,dynamicChildren:I,shapeFlag:ie,patchFlag:X,dirs:ne,cacheIndex:se}=h;if(X===-2&&(M=!1),U!=null&&li(U,null,P,h,!0),se!=null&&(b.renderCache[se]=void 0),ie&256){b.ctx.deactivate(h);return}const ve=ie&1&&ne,Te=!br(h);let Ce;if(Te&&(Ce=q&&q.onVnodeBeforeUnmount)&&Nt(Ce,b,h),ie&6)gt(h.component,P,H);else{if(ie&128){h.suspense.unmount(P,H);return}ve&&Do(h,null,b,"beforeUnmount"),ie&64?h.type.remove(h,b,P,Ge,H):I&&!I.hasOnce&&(k!==et||X>0&&X&64)?he(I,b,P,!1,!0):(k===et&&X&384||!M&&ie&16)&&he(z,b,P),H&&Ve(h)}(Te&&(Ce=q&&q.onVnodeUnmounted)||ve)&&bt(()=>{Ce&&Nt(Ce,b,h),ve&&Do(h,null,b,"unmounted")},P)},Ve=h=>{const{type:b,el:P,anchor:H,transition:M}=h;if(b===et){qe(P,H);return}if(b===Xn){w(h);return}const k=()=>{n(P),M&&!M.persisted&&M.afterLeave&&M.afterLeave()};if(h.shapeFlag&1&&M&&!M.persisted){const{leave:q,delayLeave:U}=M,z=()=>q(P,k);U?U(h.el,k,z):z()}else k()},qe=(h,b)=>{let P;for(;h!==b;)P=p(h),n(h),h=P;n(b)},gt=(h,b,P)=>{const{bum:H,scope:M,job:k,subTree:q,um:U,m:z,a:I}=h;Ol(z),Ol(I),H&&Kn(H),M.stop(),k&&(k.flags|=8,Fe(q,h,b,P)),U&&bt(U,b),bt(()=>{h.isUnmounted=!0},b),b&&b.pendingBranch&&!b.isUnmounted&&h.asyncDep&&!h.asyncResolved&&h.suspenseId===b.pendingId&&(b.deps--,b.deps===0&&b.resolve())},he=(h,b,P,H=!1,M=!1,k=0)=>{for(let q=k;q{if(h.shapeFlag&6)return Ue(h.component.subTree);if(h.shapeFlag&128)return h.suspense.next();const b=p(h.anchor||h.el),P=b&&b[Oc];return P?p(P):b};let rt=!1;const be=(h,b,P)=>{h==null?b._vnode&&Fe(b._vnode,null,null,!0):g(b._vnode||null,h,b,null,null,null,P),b._vnode=h,rt||(rt=!0,Rl(),Hc(),rt=!1)},Ge={p:g,um:Fe,m:Re,r:Ve,mt:G,mc:F,pc:oe,pbc:B,n:Ue,o:e};return{render:be,hydrate:void 0,createApp:$h(be)}}function Yi({type:e,props:t},o){return o==="svg"&&e==="foreignObject"||o==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:o}function Oo({effect:e,job:t},o){o?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Hh(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function al(e,t,o=!1){const r=e.children,n=t.children;if(ce(r)&&ce(n))for(let i=0;i>1,e[o[l]]0&&(t[r]=o[i-1]),o[i]=r)}}for(i=o.length,a=o[i-1];i-- >0;)o[i]=a,a=t[a];return o}function gd(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:gd(t)}function Ol(e){if(e)for(let t=0;tLe(Dh);function sn(e,t){return ll(e,null,t)}function Zt(e,t,o){return ll(e,t,o)}function ll(e,t,o=Me){const{immediate:r,deep:n,flush:i,once:a}=o,l=Xe({},o),s=t&&r||!t&&i!=="post";let c;if(dn){if(i==="sync"){const m=Oh();c=m.__watcherHandles||(m.__watcherHandles=[])}else if(!s){const m=()=>{};return m.stop=Jt,m.resume=Jt,m.pause=Jt,m}}const d=tt;l.call=(m,f,g)=>Lt(m,d,f,g);let u=!1;i==="post"?l.scheduler=m=>{bt(m,d&&d.suspense)}:i!=="sync"&&(u=!0,l.scheduler=(m,f)=>{f?m():rl(m)}),l.augmentJob=m=>{t&&(m.flags|=4),u&&(m.flags|=2,d&&(m.id=d.uid,m.i=d))};const p=rh(e,t,l);return dn&&(c?c.push(p):s&&p()),p}function Bh(e,t,o){const r=this.proxy,n=We(e)?e.includes(".")?md(r,e):()=>r[e]:e.bind(r,r);let i;me(t)?i=t:(i=t.handler,o=t);const a=wn(this),l=ll(n,i.bind(r),o);return a(),l}function md(e,t){const o=t.split(".");return()=>{let r=e;for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Mt(t)}Modifiers`]||e[`${Io(t)}Modifiers`];function Wh(e,t,...o){if(e.isUnmounted)return;const r=e.vnode.props||Me;let n=o;const i=t.startsWith("update:"),a=i&&Lh(r,t.slice(7));a&&(a.trim&&(n=o.map(d=>We(d)?d.trim():d)),a.number&&(n=o.map(oi)));let l,s=r[l=ji(t)]||r[l=ji(Mt(t))];!s&&i&&(s=r[l=ji(Io(t))]),s&&Lt(s,e,6,n);const c=r[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Lt(c,e,6,n)}}function bd(e,t,o=!1){const r=t.emitsCache,n=r.get(e);if(n!==void 0)return n;const i=e.emits;let a={},l=!1;if(!me(e)){const s=c=>{const d=bd(c,t,!0);d&&(l=!0,Xe(a,d))};!o&&t.mixins.length&&t.mixins.forEach(s),e.extends&&s(e.extends),e.mixins&&e.mixins.forEach(s)}return!i&&!l?(Ee(e)&&r.set(e,null),null):(ce(i)?i.forEach(s=>a[s]=null):Xe(a,i),Ee(e)&&r.set(e,a),a)}function Ti(e,t){return!e||!gi(t)?!1:(t=t.slice(2).replace(/Once$/,""),$e(e,t[0].toLowerCase()+t.slice(1))||$e(e,Io(t))||$e(e,t))}function Bl(e){const{type:t,vnode:o,proxy:r,withProxy:n,propsOptions:[i],slots:a,attrs:l,emit:s,render:c,renderCache:d,props:u,data:p,setupState:m,ctx:f,inheritAttrs:g}=e,S=ai(e);let v,$;try{if(o.shapeFlag&4){const w=n||r,E=w;v=Kt(c.call(E,w,d,u,m,p,f)),$=l}else{const w=t;v=Kt(w.length>1?w(u,{attrs:l,slots:a,emit:s}):w(u,null)),$=t.props?l:jh(l)}}catch(w){Jr.length=0,yi(w,e,1),v=ht(pt)}let T=v;if($&&g!==!1){const w=Object.keys($),{shapeFlag:E}=T;w.length&&E&7&&(i&&w.some(Na)&&($=Nh($,i)),T=Ro(T,$,!1,!0))}return o.dirs&&(T=Ro(T,null,!1,!0),T.dirs=T.dirs?T.dirs.concat(o.dirs):o.dirs),o.transition&&or(T,o.transition),v=T,ai(S),v}const jh=e=>{let t;for(const o in e)(o==="class"||o==="style"||gi(o))&&((t||(t={}))[o]=e[o]);return t},Nh=(e,t)=>{const o={};for(const r in e)(!Na(r)||!(r.slice(9)in t))&&(o[r]=e[r]);return o};function Vh(e,t,o){const{props:r,children:n,component:i}=e,{props:a,children:l,patchFlag:s}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(o&&s>=0){if(s&1024)return!0;if(s&16)return r?Ll(r,a,c):!!a;if(s&8){const d=t.dynamicProps;for(let u=0;ue.__isSuspense;function qh(e,t){t&&t.pendingBranch?ce(e)?t.effects.push(...e):t.effects.push(e):ah(e)}const et=Symbol.for("v-fgt"),$i=Symbol.for("v-txt"),pt=Symbol.for("v-cmt"),Xn=Symbol.for("v-stc"),Jr=[];let Rt=null;function ba(e=!1){Jr.push(Rt=e?null:[])}function Gh(){Jr.pop(),Rt=Jr[Jr.length-1]||null}let cn=1;function Wl(e,t=!1){cn+=e,e<0&&Rt&&t&&(Rt.hasOnce=!0)}function xd(e){return e.dynamicChildren=cn>0?Rt||pr:null,Gh(),cn>0&&Rt&&Rt.push(e),e}function Y2(e,t,o,r,n,i){return xd(yd(e,t,o,r,n,i,!0))}function va(e,t,o,r,n){return xd(ht(e,t,o,r,n,!0))}function Cr(e){return e?e.__v_isVNode===!0:!1}function No(e,t){return e.type===t.type&&e.key===t.key}const Cd=({key:e})=>e??null,Jn=({ref:e,ref_key:t,ref_for:o})=>(typeof e=="number"&&(e=""+e),e!=null?We(e)||ot(e)||me(e)?{i:Ye,r:e,k:t,f:!!o}:e:null);function yd(e,t=null,o=null,r=0,n=null,i=e===et?0:1,a=!1,l=!1){const s={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Cd(t),ref:t&&Jn(t),scopeId:Dc,slotScopeIds:null,children:o,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:r,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:Ye};return l?(sl(s,o),i&128&&e.normalize(s)):o&&(s.shapeFlag|=We(o)?8:16),cn>0&&!a&&Rt&&(s.patchFlag>0||i&6)&&s.patchFlag!==32&&Rt.push(s),s}const ht=Kh;function Kh(e,t=null,o=null,r=0,n=null,i=!1){if((!e||e===ed)&&(e=pt),Cr(e)){const l=Ro(e,t,!0);return o&&sl(l,o),cn>0&&!i&&Rt&&(l.shapeFlag&6?Rt[Rt.indexOf(e)]=l:Rt.push(l)),l.patchFlag=-2,l}if(ng(e)&&(e=e.__vccOpts),t){t=Yh(t);let{class:l,style:s}=t;l&&!We(l)&&(t.class=Ga(l)),Ee(s)&&(ol(s)&&!ce(s)&&(s=Xe({},s)),t.style=qa(s))}const a=We(e)?1:vd(e)?128:Bc(e)?64:Ee(e)?4:me(e)?2:0;return yd(e,t,o,r,n,a,i,!0)}function Yh(e){return e?ol(e)||sd(e)?Xe({},e):e:null}function Ro(e,t,o=!1,r=!1){const{props:n,ref:i,patchFlag:a,children:l,transition:s}=e,c=t?Sd(n||{},t):n,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Cd(c),ref:t&&t.ref?o&&i?ce(i)?i.concat(Jn(t)):[i,Jn(t)]:Jn(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==et?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:s,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ro(e.ssContent),ssFallback:e.ssFallback&&Ro(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return s&&r&&or(d,s.clone(d)),d}function xa(e=" ",t=0){return ht($i,null,e,t)}function X2(e,t){const o=ht(Xn,null,e);return o.staticCount=t,o}function J2(e="",t=!1){return t?(ba(),va(pt,null,e)):ht(pt,null,e)}function Kt(e){return e==null||typeof e=="boolean"?ht(pt):ce(e)?ht(et,null,e.slice()):Cr(e)?wo(e):ht($i,null,String(e))}function wo(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ro(e)}function sl(e,t){let o=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(ce(t))o=16;else if(typeof t=="object")if(r&65){const n=t.default;n&&(n._c&&(n._d=!1),sl(e,n()),n._c&&(n._d=!0));return}else{o=32;const n=t._;!n&&!sd(t)?t._ctx=Ye:n===3&&Ye&&(Ye.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else me(t)?(t={default:t,_ctx:Ye},o=32):(t=String(t),r&64?(o=16,t=[xa(t)]):o=8);e.children=t,e.shapeFlag|=o}function Sd(...e){const t={};for(let o=0;ott||Ye;let ci,Ca;{const e=vi(),t=(o,r)=>{let n;return(n=e[o])||(n=e[o]=[]),n.push(r),i=>{n.length>1?n.forEach(a=>a(i)):n[0](i)}};ci=t("__VUE_INSTANCE_SETTERS__",o=>tt=o),Ca=t("__VUE_SSR_SETTERS__",o=>dn=o)}const wn=e=>{const t=tt;return ci(e),e.scope.on(),()=>{e.scope.off(),ci(t)}},jl=()=>{tt&&tt.scope.off(),ci(null)};function wd(e){return e.vnode.shapeFlag&4}let dn=!1;function Qh(e,t=!1,o=!1){t&&Ca(t);const{props:r,children:n}=e.vnode,i=wd(e);Rh(e,r,i,t),Eh(e,n,o);const a=i?eg(e,t):void 0;return t&&Ca(!1),a}function eg(e,t){const o=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,xh);const{setup:r}=o;if(r){Eo();const n=e.setupContext=r.length>1?og(e):null,i=wn(e),a=yn(r,e,0,[e.props,n]),l=lc(a);if(_o(),i(),(l||e.sp)&&!br(e)&&Gc(e),l){if(a.then(jl,jl),t)return a.then(s=>{Nl(e,s)}).catch(s=>{yi(s,e,0)});e.asyncDep=a}else Nl(e,a)}else Pd(e)}function Nl(e,t,o){me(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ee(t)&&(e.setupState=Ec(t)),Pd(e)}function Pd(e,t,o){const r=e.type;e.render||(e.render=r.render||Jt);{const n=wn(e);Eo();try{Ch(e)}finally{_o(),n()}}}const tg={get(e,t){return dt(e,"get",""),e[t]}};function og(e){const t=o=>{e.exposed=o||{}};return{attrs:new Proxy(e.attrs,tg),slots:e.slots,emit:e.emit,expose:t}}function Ri(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Ec(da(e.exposed)),{get(t,o){if(o in t)return t[o];if(o in Xr)return Xr[o](e)},has(t,o){return o in t||o in Xr}})):e.proxy}function rg(e,t=!0){return me(e)?e.displayName||e.name:e.name||t&&e.__name}function ng(e){return me(e)&&"__vccOpts"in e}const Y=(e,t)=>th(e,t,dn);function y(e,t,o){const r=arguments.length;return r===2?Ee(t)&&!ce(t)?Cr(t)?ht(e,null,[t]):ht(e,t):ht(e,null,t):(r>3?o=Array.prototype.slice.call(arguments,2):r===3&&Cr(o)&&(o=[o]),ht(e,t,o))}const ig="3.5.13";/** * @vue/runtime-dom v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let ya;const Vl=typeof window<"u"&&window.trustedTypes;if(Vl)try{ya=Vl.createPolicy("vue",{createHTML:e=>e})}catch{}const Td=ya?e=>ya.createHTML(e):e=>e,ag="http://www.w3.org/2000/svg",lg="http://www.w3.org/1998/Math/MathML",ao=typeof document<"u"?document:null,Ul=ao&&ao.createElement("template"),sg={insert:(e,t,o)=>{t.insertBefore(e,o||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,o,r)=>{const n=t==="svg"?ao.createElementNS(ag,e):t==="mathml"?ao.createElementNS(lg,e):o?ao.createElement(e,{is:o}):ao.createElement(e);return e==="select"&&r&&r.multiple!=null&&n.setAttribute("multiple",r.multiple),n},createText:e=>ao.createTextNode(e),createComment:e=>ao.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ao.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,o,r,n,i){const a=o?o.previousSibling:t.lastChild;if(n&&(n===i||n.nextSibling))for(;t.insertBefore(n.cloneNode(!0),o),!(n===i||!(n=n.nextSibling)););else{Ul.innerHTML=Td(r==="svg"?`${e}`:r==="mathml"?`${e}`:e);const l=Ul.content;if(r==="svg"||r==="mathml"){const s=l.firstChild;for(;s.firstChild;)l.appendChild(s.firstChild);l.removeChild(s)}t.insertBefore(l,o)}return[a?a.nextSibling:t.firstChild,o?o.previousSibling:t.lastChild]}},vo="transition",Br="animation",yr=Symbol("_vtc"),$d={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Rd=Xe({},Nc,$d),cg=e=>(e.displayName="Transition",e.props=Rd,e),un=cg((e,{slots:t})=>y(uh,Fd(e),t)),Bo=(e,t=[])=>{ce(e)?e.forEach(o=>o(...t)):e&&e(...t)},ql=e=>e?ce(e)?e.some(t=>t.length>1):e.length>1:!1;function Fd(e){const t={};for(const A in e)A in $d||(t[A]=e[A]);if(e.css===!1)return t;const{name:o="v",type:r,duration:n,enterFromClass:i=`${o}-enter-from`,enterActiveClass:a=`${o}-enter-active`,enterToClass:l=`${o}-enter-to`,appearFromClass:s=i,appearActiveClass:c=a,appearToClass:d=l,leaveFromClass:u=`${o}-leave-from`,leaveActiveClass:p=`${o}-leave-active`,leaveToClass:m=`${o}-leave-to`}=e,f=dg(n),g=f&&f[0],S=f&&f[1],{onBeforeEnter:v,onEnter:$,onEnterCancelled:T,onLeave:w,onLeaveCancelled:_,onBeforeAppear:O=v,onAppear:x=$,onAppearCancelled:F=T}=t,R=(A,J,G,le)=>{A._enterCancelled=le,Co(A,J?d:l),Co(A,J?c:a),G&&G()},B=(A,J)=>{A._isLeaving=!1,Co(A,u),Co(A,m),Co(A,p),J&&J()},j=A=>(J,G)=>{const le=A?x:$,te=()=>R(J,A,G);Bo(le,[J,te]),Gl(()=>{Co(J,A?s:i),qt(J,A?d:l),ql(le)||Kl(J,r,g,te)})};return Xe(t,{onBeforeEnter(A){Bo(v,[A]),qt(A,i),qt(A,a)},onBeforeAppear(A){Bo(O,[A]),qt(A,s),qt(A,c)},onEnter:j(!1),onAppear:j(!0),onLeave(A,J){A._isLeaving=!0;const G=()=>B(A,J);qt(A,u),A._enterCancelled?(qt(A,p),Sa()):(Sa(),qt(A,p)),Gl(()=>{A._isLeaving&&(Co(A,u),qt(A,m),ql(w)||Kl(A,r,S,G))}),Bo(w,[A,G])},onEnterCancelled(A){R(A,!1,void 0,!0),Bo(T,[A])},onAppearCancelled(A){R(A,!0,void 0,!0),Bo(F,[A])},onLeaveCancelled(A){B(A),Bo(_,[A])}})}function dg(e){if(e==null)return null;if(_e(e))return[Xi(e.enter),Xi(e.leave)];{const t=Xi(e);return[t,t]}}function Xi(e){return xp(e)}function qt(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.add(o)),(e[yr]||(e[yr]=new Set)).add(t)}function Co(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const o=e[yr];o&&(o.delete(t),o.size||(e[yr]=void 0))}function Gl(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let ug=0;function Kl(e,t,o,r){const n=e._endId=++ug,i=()=>{n===e._endId&&r()};if(o!=null)return setTimeout(i,o);const{type:a,timeout:l,propCount:s}=Ad(e,t);if(!a)return r();const c=a+"end";let d=0;const u=()=>{e.removeEventListener(c,p),i()},p=m=>{m.target===e&&++d>=s&&u()};setTimeout(()=>{d(o[f]||"").split(", "),n=r(`${vo}Delay`),i=r(`${vo}Duration`),a=Yl(n,i),l=r(`${Br}Delay`),s=r(`${Br}Duration`),c=Yl(l,s);let d=null,u=0,p=0;t===vo?a>0&&(d=vo,u=a,p=i.length):t===Br?c>0&&(d=Br,u=c,p=s.length):(u=Math.max(a,c),d=u>0?a>c?vo:Br:null,p=d?d===vo?i.length:s.length:0);const m=d===vo&&/\b(transform|all)(,|$)/.test(r(`${vo}Property`).toString());return{type:d,timeout:u,propCount:p,hasTransform:m}}function Yl(e,t){for(;e.lengthXl(o)+Xl(e[r])))}function Xl(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Sa(){return document.body.offsetHeight}function fg(e,t,o){const r=e[yr];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):o?e.setAttribute("class",t):e.className=t}const di=Symbol("_vod"),Id=Symbol("_vsh"),Z2={beforeMount(e,{value:t},{transition:o}){e[di]=e.style.display==="none"?"":e.style.display,o&&t?o.beforeEnter(e):Lr(e,t)},mounted(e,{value:t},{transition:o}){o&&t&&o.enter(e)},updated(e,{value:t,oldValue:o},{transition:r}){!t!=!o&&(r?t?(r.beforeEnter(e),Lr(e,!0),r.enter(e)):r.leave(e,()=>{Lr(e,!1)}):Lr(e,t))},beforeUnmount(e,{value:t}){Lr(e,t)}};function Lr(e,t){e.style.display=t?e[di]:"none",e[Id]=!t}const pg=Symbol(""),hg=/(^|;)\s*display\s*:/;function gg(e,t,o){const r=e.style,n=We(o);let i=!1;if(o&&!n){if(t)if(We(t))for(const a of t.split(";")){const l=a.slice(0,a.indexOf(":")).trim();o[l]==null&&Zn(r,l,"")}else for(const a in t)o[a]==null&&Zn(r,a,"");for(const a in o)a==="display"&&(i=!0),Zn(r,a,o[a])}else if(n){if(t!==o){const a=r[pg];a&&(o+=";"+a),r.cssText=o,i=hg.test(o)}}else t&&e.removeAttribute("style");di in e&&(e[di]=i?r.display:"",e[Id]&&(r.display="none"))}const Jl=/\s*!important$/;function Zn(e,t,o){if(ce(o))o.forEach(r=>Zn(e,t,r));else if(o==null&&(o=""),t.startsWith("--"))e.setProperty(t,o);else{const r=mg(e,t);Jl.test(o)?e.setProperty(Io(r),o.replace(Jl,""),"important"):e[r]=o}}const Zl=["Webkit","Moz","ms"],Ji={};function mg(e,t){const o=Ji[t];if(o)return o;let r=Mt(t);if(r!=="filter"&&r in e)return Ji[t]=r;r=bi(r);for(let n=0;nZi||(Cg.then(()=>Zi=0),Zi=Date.now());function Sg(e,t){const o=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=o.attached)return;Lt(wg(r,o.value),t,5,[r])};return o.value=e,o.attached=yg(),o}function wg(e,t){if(ce(t)){const o=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{o.call(e),e._stopped=!0},t.map(r=>n=>!n._stopped&&r&&r(n))}else return t}const ns=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Pg=(e,t,o,r,n,i)=>{const a=n==="svg";t==="class"?fg(e,r,a):t==="style"?gg(e,o,r):gi(t)?Na(t)||vg(e,t,o,r,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Tg(e,t,r,a))?(ts(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&es(e,t,r,a,i,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!We(r))?ts(e,Mt(t),r,i,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),es(e,t,r,a))};function Tg(e,t,o,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&ns(t)&&me(o));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const n=e.tagName;if(n==="IMG"||n==="VIDEO"||n==="CANVAS"||n==="SOURCE")return!1}return ns(t)&&We(o)?!1:t in e}const _d=new WeakMap,Ed=new WeakMap,ui=Symbol("_moveCb"),is=Symbol("_enterCb"),$g=e=>(delete e.props.mode,e),Rg=$g({name:"TransitionGroup",props:Xe({},Rd,{tag:String,moveClass:String}),setup(e,{slots:t}){const o=Sn(),r=jc();let n,i;return Jc(()=>{if(!n.length)return;const a=e.moveClass||`${e.name||"v"}-move`;if(!Eg(n[0].el,o.vnode.el,a))return;n.forEach(Ag),n.forEach(Ig);const l=n.filter(_g);Sa(),l.forEach(s=>{const c=s.el,d=c.style;qt(c,a),d.transform=d.webkitTransform=d.transitionDuration="";const u=c[ui]=p=>{p&&p.target!==c||(!p||/transform$/.test(p.propertyName))&&(c.removeEventListener("transitionend",u),c[ui]=null,Co(c,a))};c.addEventListener("transitionend",u)})}),()=>{const a=we(e),l=Fd(a);let s=a.tag||et;if(n=[],i)for(let c=0;c{l.split(/\s+/).forEach(s=>s&&r.classList.remove(s))}),o.split(/\s+/).forEach(l=>l&&r.classList.add(l)),r.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(r);const{hasTransform:a}=Ad(r);return i.removeChild(r),a}const Fo=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ce(t)?o=>Kn(t,o):t};function Mg(e){e.target.composing=!0}function as(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Et=Symbol("_assign"),ls={created(e,{modifiers:{lazy:t,trim:o,number:r}},n){e[Et]=Fo(n);const i=r||n.props&&n.props.type==="number";uo(e,t?"change":"input",a=>{if(a.target.composing)return;let l=e.value;o&&(l=l.trim()),i&&(l=oi(l)),e[Et](l)}),o&&uo(e,"change",()=>{e.value=e.value.trim()}),t||(uo(e,"compositionstart",Mg),uo(e,"compositionend",as),uo(e,"change",as))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:o,modifiers:{lazy:r,trim:n,number:i}},a){if(e[Et]=Fo(a),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?oi(e.value):e.value,s=t??"";l!==s&&(document.activeElement===e&&e.type!=="range"&&(r&&t===o||n&&e.value.trim()===s)||(e.value=s))}},zg={deep:!0,created(e,t,o){e[Et]=Fo(o),uo(e,"change",()=>{const r=e._modelValue,n=Sr(e),i=e.checked,a=e[Et];if(ce(r)){const l=Ka(r,n),s=l!==-1;if(i&&!s)a(r.concat(n));else if(!i&&s){const c=[...r];c.splice(l,1),a(c)}}else if(Rr(r)){const l=new Set(r);i?l.add(n):l.delete(n),a(l)}else a(Md(e,i))})},mounted:ss,beforeUpdate(e,t,o){e[Et]=Fo(o),ss(e,t,o)}};function ss(e,{value:t,oldValue:o},r){e._modelValue=t;let n;if(ce(t))n=Ka(t,r.props.value)>-1;else if(Rr(t))n=t.has(r.props.value);else{if(t===o)return;n=er(t,Md(e,!0))}e.checked!==n&&(e.checked=n)}const Hg={created(e,{value:t},o){e.checked=er(t,o.props.value),e[Et]=Fo(o),uo(e,"change",()=>{e[Et](Sr(e))})},beforeUpdate(e,{value:t,oldValue:o},r){e[Et]=Fo(r),t!==o&&(e.checked=er(t,r.props.value))}},kg={deep:!0,created(e,{value:t,modifiers:{number:o}},r){const n=Rr(t);uo(e,"change",()=>{const i=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>o?oi(Sr(a)):Sr(a));e[Et](e.multiple?n?new Set(i):i:i[0]),e._assigning=!0,nn(()=>{e._assigning=!1})}),e[Et]=Fo(r)},mounted(e,{value:t}){cs(e,t)},beforeUpdate(e,t,o){e[Et]=Fo(o)},updated(e,{value:t}){e._assigning||cs(e,t)}};function cs(e,t){const o=e.multiple,r=ce(t);if(!(o&&!r&&!Rr(t))){for(let n=0,i=e.options.length;nString(c)===String(l)):a.selected=Ka(t,l)>-1}else a.selected=t.has(l);else if(er(Sr(a),t)){e.selectedIndex!==n&&(e.selectedIndex=n);return}}!o&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Sr(e){return"_value"in e?e._value:e.value}function Md(e,t){const o=t?"_trueValue":"_falseValue";return o in e?e[o]:t}const Q2={created(e,t,o){On(e,t,o,null,"created")},mounted(e,t,o){On(e,t,o,null,"mounted")},beforeUpdate(e,t,o,r){On(e,t,o,r,"beforeUpdate")},updated(e,t,o,r){On(e,t,o,r,"updated")}};function Dg(e,t){switch(e){case"SELECT":return kg;case"TEXTAREA":return ls;default:switch(t){case"checkbox":return zg;case"radio":return Hg;default:return ls}}}function On(e,t,o,r,n){const a=Dg(e.tagName,o.props&&o.props.type)[n];a&&a(e,t,o,r)}const Og=["ctrl","shift","alt","meta"],Bg={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Og.some(o=>e[`${o}Key`]&&!t.includes(o))},eP=(e,t)=>{const o=e._withMods||(e._withMods={}),r=t.join(".");return o[r]||(o[r]=(n,...i)=>{for(let a=0;a{const o=e._withKeys||(e._withKeys={}),r=t.join(".");return o[r]||(o[r]=n=>{if(!("key"in n))return;const i=Io(n.key);if(t.some(a=>a===i||Lg[a]===i))return e(n)})},Wg=Xe({patchProp:Pg},sg);let ds;function jg(){return ds||(ds=Mh(Wg))}const oP=(...e)=>{const t=jg().createApp(...e),{mount:o}=t;return t.mount=r=>{const n=Vg(r);if(!n)return;const i=t._component;!me(i)&&!i.render&&!i.template&&(i.template=n.innerHTML),n.nodeType===1&&(n.textContent="");const a=o(n,!1,Ng(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),a},t};function Ng(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Vg(e){return We(e)?document.querySelector(e):e}const Ug={common:{appName:"AT Term",cancel:"Cancel",close:"Close",confirm:"Confirm",copy:"Copy",create:"Create",created:"created",delete:"Delete",english:"English",language:"Language",loading:"Loading...",no:"no",optional:"optional",revoke:"Revoke",save:"Save",send:"send",simplifiedChinese:"Simplified Chinese",system:"System",unknown:"unknown",version:"Version",versionLabel:"version {version}",yes:"yes"},auth:{alreadyHaveAccount:"Already have an account?",createAccount:"Create account",email:"Email",emailPlaceholder:"you@example.com",setup:{title:"First-run setup",hint:"No admin yet. Create the first admin account — use the email you set in ATTERM_BOOTSTRAP_ADMIN_EMAIL.",emailPlaceholder:"your ATTERM_BOOTSTRAP_ADMIN_EMAIL",confirmPassword:"Confirm password",createAdmin:"Create admin",passwordMismatch:"The two passwords do not match.",notAdmin:"Account created, but it is not an admin — make sure the email matches ATTERM_BOOTSTRAP_ADMIN_EMAIL.",failed:"Setup failed. Please try again."},errors:{emailTaken:"An account with that email already exists.",invalidCredentials:"Invalid email or password.",invalidEmail:"Please enter a valid email.",invalidRequest:"Please check your input.",inviteInvalid:"Invite code is invalid or already used.",passwordWeak:"Password must be at least 12 characters.",rateLimited:"Too many attempts. Please wait a few minutes.",rateLimitedShort:"Too many attempts. Please wait.",signInFailed:"Sign-in failed. Please try again.",signUpFailed:"Sign-up failed. Check your invite code and try again."},haveInviteCode:"Have an invite code?",inviteCode:"Invite code",password:"Password",signIn:"Sign in",signUp:"Sign up",signUpHere:"Sign up here"},setup:{allowInsecure:"Allow insecure HTTP/WS (non-loopback)",connect:"Connect",connectToRelay:"Connect to relay",disconnect:"Disconnect",errors:{cannotReachRelay:"Cannot reach relay: {message}",invalidRelayUrl:"invalid or malformed relay URL",originRejected:"Relay rejected the origin. Make sure the relay was started with ATTERM_ORIGINS containing capacitor://localhost.",relayHttp:"Relay returned HTTP {status}.",relayHttpCheckUrl:"Relay returned HTTP {status}. Check the URL and try again.",relayUrlMustBeHttp:"relay URL must start with http:// or https://",relayUrlNoPath:"relay URL must not contain a path, query, or fragment",relayUrlRequired:"relay URL is required",tokenInvalid:"API token is invalid. Generate a new one from Settings -> API Tokens on the relay web UI.",tokenInvalidSettings:"API token is invalid. Generate a new one from the relay web UI under Settings -> API Tokens.",tokenRequired:"API token is required",useInsecureForHttp:'enable "Allow insecure HTTP/WS" to use http:// with a non-loopback host'},reasonTokenInvalid:"Your API token is no longer valid. Please paste a fresh token to sign in again.",title:"Set up relay",relayUrl:"Relay URL",relayUrlPlaceholder:"https://relay.example.com",token:"API token",tokenPlaceholder:"atk_...",saved:"Saved."},main:{activeSessions:"active sessions",back:"back",backToSessions:"Back to sessions",empty:"No live sessions. Start one from the desktop app or",errors:{loadSessions:"Failed to load sessions."},install:{dismiss:"Dismiss install hint",text:"on iPhone, open this site with HTTPS, then tap Share -> Add to Home Screen.",title:"install AT Term"},reconnect:"Reconnect",refresh:"refresh",sessionCount:"{count} sessions",sessionCountOne:"{count} session",title:"Remote sessions",unknownCommand:"(unknown)",unknownHost:"unknown host",unlock:{action:"Sign in again",text:"This browser is signed in, but the in-memory encryption key is locked. Sign in again to decrypt session names, commands, and paths.",title:"Unlock encrypted session details"},viewOnlyNotice:"This session is view-only from this device. You can inspect output, but input is disabled.",taskTypes:{ai:"AI",test:"Test",build:"Build",deploy:"Deploy"}},terminal:{cannotReachRelay:"Cannot reach relay.",connecting:"Connecting...",disconnected:"Disconnected",ended:"session ended (exit {code})",loadingHistory:"loading history... {percent}%",paste:"Paste",pickImage:"pick image",pickFile:"pick file",remoteControl:"remote has taken control",statuses:{attached:"attached",connecting:"connecting",ended:"ended",lost:"lost",reconnecting:"reconnecting"},shortcuts:"terminal shortcuts",takeControl:"Take control",tapToChangeConfig:"Tap to change configuration.",templatePreviewTitle:"Send preview",templatePreviewSend:"Send"},sessions:{attach:"Attach",created:"Created",host:"Host"},admin:{actions:"Actions",config:{effective:"effective: {value}",effectiveDisabled:"effective: disabled",hint:'0 means "use the built-in default"; negative disables the limit entirely. Changes apply immediately and persist to the admin config file.',loadFailed:"Failed to load config.",maxConnections:"Max WS connections (per IP+token)",rateLimit:"Rate limit (requests/min per IP+token)",saveFailed:"Save failed.",runtimeLimits:"Runtime limits",debug:"Verbose logging",debugHint:"Logs relay frames. Applies immediately, no restart.",debugPayload:"Log payload bytes",debugPayloadWarn:"Logs terminal input/output — sensitive. Use only while debugging.",allowedOrigins:"Allowed Origins",allowedOriginsHint:'One per line. Mobile Capacitor clients need "capacitor://localhost". Empty = allow any origin (dev only).',allowedOriginsPlaceholder:`https://relay.example.com -capacitor://localhost`},configTab:"Config",feishuTab:"Feishu",trafficTab:"Traffic",traffic:{title:"Traffic analysis",timezone:"Daily aggregation in UTC",refresh:"Refresh data",platformScope:"Platform scope",platformStatus:"Platform status",globalRealtime:"Global live data",relayStatus:"Relay status",online:"Online",unknown:"Unknown",activeSessions:"Active sessions",relayInstances:"Active relays",activeUplinks:"Active uplinks",liveValue:"Live on this node",liveInstances:"Heartbeat within 90s",flushEvery:"Traffic flushes every {seconds}s",userScope:"User scope",userAnalysis:"User traffic analysis",range:"Date range",days:"{days} days",allUsers:"Users: all",selectedUsers:"Users: {selected}/{total}",filterUsers:"Filter users",selectedCount:"{selected} / {total} selected",clearAll:"Clear all",selectAll:"Select all",searchUsers:"Search email or user ID",selectOrSearchUser:"Select or search user",only:"Only",noUserMatch:"No matching users",restoreAll:"Restore all",done:"Done",noUsersSelected:"No users selected",restoreAllUsers:"Restore all users",selectedUserCount:"{count} users selected",kpiTotal:"Total traffic",kpiOutbound:"Outbound",kpiInbound:"Inbound",kpiFrames:"Frames",trendNew:"No prior data",trendFlat:"Flat",coreAnalysis:"Core analysis",timelineTitle:"User traffic timeline",timelineScope:"{count} users",view:"View",groupTimeline:"Group timeline",frameTimeline:"Frame types",directionTrend:"Direction trend",metric:"Metric",bytes:"Bytes",frames:"Frames",direction:{all:"All",out:"Outbound",in:"Inbound"},multiUserMatrix:"Multi-user matrix",stackedTimeline:"Single-user stacked",bucketCount:"{count} daily buckets",total:"Total",selectedAggregate:"Selected users",categorySummary:"Category summary",totalComposition:"Traffic mix for selected users",clear:"Clear",outIn:"Out {out} · In {in}",userDetail:"User detail",userCount:"{count} users",totalTraffic:"Total traffic",share:"Share",periodTrend:"vs prior",activeDays:"Active days",viewUser:"View {user}",diagnostics:"Traffic diagnostics",diagnosticsRange:"Last {days} days",dailyActivity:"Daily user activity",frameDensity:"Category frame density",frameUnit:"frame",userTraffic:"User traffic",dailyTraffic:"Daily traffic",frameBreakdown:"Frame type breakdown",colUser:"User",colCategory:"Category",colFrameType:"Frame type",colDirection:"Direction",colBytes:"Bytes",colFrames:"Frames",dirIn:"In",dirOut:"Out",empty:"No traffic recorded for this range.",loadFailed:"Failed to load traffic stats.",categories:{terminal:"Terminal relay",state:"State sync",filesystem:"File browser",service:"Remote preview",control:"Control",other:"Other"}},feishuConfig:{title:"Feishu integration",description:"Enable the Feishu bot bridge for this relay. The encrypt key protects Feishu app credentials stored on the server.",enabled:"Enable Feishu",encryptKey:"Encrypt key",generate:"Generate",keyGenerated:"Key generated — save to apply.",keyEmptyPlaceholder:"Paste or generate a 32-byte base64 key",keyKeepPlaceholder:"Key set (…{last4}). Leave blank to keep it.",keyCopyOnce:"Copy this key somewhere safe — it is shown only once and never again.",forceRotate:"Replace the existing key (existing Feishu bindings will stop working)",baseUrl:"Base URL",statusRunning:"Running",statusStopped:"Stopped",rotateConflict:'That changes the existing key. Enable "replace" to rotate it (existing bindings will break).',loadFailed:"Failed to load Feishu config.",saveFailed:"Save failed."},created:"Created",disabled:"disabled {when}",email:"Email",errors:{actionFailed:"Action failed.",cannotDemoteSelf:"You can't demote yourself.",lastAdmin:"Can't demote the last admin - promote another user first."},id:"ID",invitationsTab:{consumed:"Consumed",count:"Count",createFailed:"Create failed: {code}",copyNow:"Copy this invitation now{note} - it will not be shown again.",empty:"No invitations yet.",expires:"Expires",loadFailed:"Failed to load invitations.",note:"Note",prefix:"Prefix",unused:"unused"},loadUsersFailed:"Failed to load users.",promote:"Promote",promoteConfirm:"Promote this user to admin?",resetPassword:"Reset password",resetPasswordConfirm:"Reset password? A new temporary password is shown once.",secretCopyOnce:"{label} - copy it now, only shown once.",status:"Status",temporaryPasswordFor:"Temporary password for {email}",title:"Admin",userStatus:{active:"active",admin:"admin"},users:"Users",invitations:"Invitations",demote:"Demote",demoteConfirm:"Demote this admin?",disable:"Disable",disableConfirm:"Disable this user? They are signed out and cannot log in."},test:{interpolation:"{count} sessions"},connHealth:{pillLabelConnecting:"connecting…",pillLabelReconnecting:"reconnecting…",pillLabelOff:"off",drawerTitle:"Connection health",drawerRttNow:"RTT (now)",drawerRttP50P95:"p50 / p95 (5 min)",drawerBytesIn:"↓ in",drawerBytesOut:"↑ out",drawerState:"State",drawerReconnectsLastHour:"Reconnects (1 h)",drawerReconnectsTime:"time",drawerReconnectsReason:"reason",drawerReconnectsDowntime:"downtime",drawerSeqGaps:"Seq gaps observed:"}},qg={common:{appName:"AT Term",cancel:"取消",close:"关闭",confirm:"确认",copy:"复制",create:"创建",created:"创建于",delete:"删除",english:"英语",language:"语言",loading:"正在加载...",no:"否",optional:"可选",revoke:"撤销",save:"保存",send:"发送",simplifiedChinese:"简体中文",system:"跟随系统",unknown:"未知",version:"版本",versionLabel:"版本 {version}",yes:"是"},auth:{alreadyHaveAccount:"已有账号?",createAccount:"创建账号",email:"邮箱",emailPlaceholder:"you@example.com",setup:{title:"首次安装",hint:"还没有管理员。创建第一个管理员账号——请填写你在 ATTERM_BOOTSTRAP_ADMIN_EMAIL 配置的邮箱。",emailPlaceholder:"你配置的 ATTERM_BOOTSTRAP_ADMIN_EMAIL",confirmPassword:"确认密码",createAdmin:"创建管理员",passwordMismatch:"两次输入的密码不一致。",notAdmin:"账号已创建,但不是管理员——请确认邮箱与 ATTERM_BOOTSTRAP_ADMIN_EMAIL 一致。",failed:"初始化失败,请重试。"},errors:{emailTaken:"该邮箱已注册。",invalidCredentials:"邮箱或密码不正确。",invalidEmail:"请输入有效邮箱。",invalidRequest:"请检查输入。",inviteInvalid:"邀请码无效或已被使用。",passwordWeak:"密码至少需要 12 个字符。",rateLimited:"尝试次数过多,请等待几分钟。",rateLimitedShort:"尝试次数过多,请稍后再试。",signInFailed:"登录失败,请重试。",signUpFailed:"注册失败,请检查邀请码后重试。"},haveInviteCode:"有邀请码?",inviteCode:"邀请码",password:"密码",signIn:"登录",signUp:"注册",signUpHere:"在这里注册"},setup:{allowInsecure:"允许不安全的 HTTP/WS(非 loopback)",connect:"连接",connectToRelay:"连接到 relay",disconnect:"断开连接",errors:{cannotReachRelay:"无法连接 relay:{message}",invalidRelayUrl:"relay 地址无效或格式错误",originRejected:"relay 拒绝了该 Origin。请确认启动 relay 时 ATTERM_ORIGINS 包含 capacitor://localhost。",relayHttp:"relay 返回 HTTP {status}。",relayHttpCheckUrl:"relay 返回 HTTP {status}。请检查地址后重试。",relayUrlMustBeHttp:"relay 地址必须以 http:// 或 https:// 开头",relayUrlNoPath:"relay 地址不能包含 path、query 或 fragment",relayUrlRequired:"relay 地址必填",tokenInvalid:"API token 无效。请在 relay Web UI 的设置 -> API Tokens 中生成新 token。",tokenInvalidSettings:"API token 无效。请在 relay Web UI 的设置 -> API Tokens 中生成新 token。",tokenRequired:"API token 必填",useInsecureForHttp:"如需对非 loopback 主机使用 http://,请启用“允许不安全的 HTTP/WS”"},reasonTokenInvalid:"你的 API token 已失效。请粘贴新的 token 重新登录。",title:"设置 relay",relayUrl:"Relay 地址",relayUrlPlaceholder:"https://relay.example.com",token:"API token",tokenPlaceholder:"atk_...",saved:"已保存。"},main:{activeSessions:"活动会话",back:"返回",backToSessions:"返回会话列表",empty:"没有在线会话。请从桌面 app 或",errors:{loadSessions:"加载会话失败。"},install:{dismiss:"关闭安装提示",text:"在 iPhone 上,用 HTTPS 打开本站,然后点分享 -> 添加到主屏幕。",title:"安装 AT Term"},reconnect:"重新连接",refresh:"刷新",sessionCount:"{count} 个会话",sessionCountOne:"{count} 个会话",title:"远程会话",unknownCommand:"(未知)",unknownHost:"未知主机",unlock:{action:"重新登录",text:"此浏览器仍处于登录状态,但内存中的加密密钥已锁定。重新登录后才能解密会话名称、命令和路径。",title:"解锁加密会话信息"},viewOnlyNotice:"此设备只能查看该会话。你可以查看输出,但不能输入。",taskTypes:{ai:"AI",test:"测试",build:"构建",deploy:"部署"}},terminal:{cannotReachRelay:"无法连接 relay。",connecting:"正在连接...",disconnected:"连接已断开",ended:"会话已结束(退出码 {code})",loadingHistory:"正在加载历史... {percent}%",paste:"粘贴",pickImage:"选择图片",pickFile:"选择文件",remoteControl:"远端已接管控制",statuses:{attached:"已连接",connecting:"正在连接",ended:"已结束",lost:"连接丢失",reconnecting:"正在重连"},shortcuts:"终端快捷键",takeControl:"接管控制",tapToChangeConfig:"点击修改配置。",templatePreviewTitle:"发送预览",templatePreviewSend:"发送"},sessions:{attach:"接管",created:"创建时间",host:"主机"},admin:{actions:"操作",config:{effective:"实际:{value}",effectiveDisabled:"实际:已禁用",hint:"0 表示使用内建默认值;负数表示完全禁用限制。修改会立即生效,并持久化到管理配置文件。",loadFailed:"加载配置失败。",maxConnections:"最大 WS 连接数(每 IP+token)",rateLimit:"速率限制(每 IP+token 每分钟请求数)",saveFailed:"保存失败。",runtimeLimits:"运行时限制",debug:"详细日志",debugHint:"记录 relay 帧。立即生效,无需重启。",debugPayload:"记录 payload 字节",debugPayloadWarn:"会记录终端输入/输出,属敏感信息,仅排查问题时临时开启。",allowedOrigins:"允许的 Origin",allowedOriginsHint:'一行一个。手机 Capacitor 客户端必须包含 "capacitor://localhost"。留空 = 允许任意 origin(仅供开发)。',allowedOriginsPlaceholder:`https://relay.example.com -capacitor://localhost`},configTab:"配置",feishuTab:"飞书",trafficTab:"流量",traffic:{title:"流量分析",timezone:"按 UTC 日聚合",refresh:"刷新数据",platformScope:"平台范围",platformStatus:"平台状态",globalRealtime:"全局实时",relayStatus:"Relay 状态",online:"运行中",unknown:"未知",activeSessions:"在线会话",relayInstances:"活跃 Relay",activeUplinks:"在线 Uplink",liveValue:"当前节点实时值",liveInstances:"90 秒内有心跳",flushEvery:"流量每 {seconds} 秒入库",userScope:"用户范围",userAnalysis:"用户流量分析",range:"时间范围",days:"{days} 天",allUsers:"用户:全部",selectedUsers:"用户:已选 {selected}/{total}",filterUsers:"筛选用户",selectedCount:"{selected} / {total} 已选",clearAll:"取消全选",selectAll:"全选",searchUsers:"搜索邮箱或用户 ID",selectOrSearchUser:"选择或搜索用户",only:"仅看",noUserMatch:"未找到匹配用户",restoreAll:"恢复全部",done:"完成",noUsersSelected:"当前未选择用户",restoreAllUsers:"恢复全部用户",selectedUserCount:"已筛选 {count} 位用户",kpiTotal:"总流量",kpiOutbound:"出站流量",kpiInbound:"入站流量",kpiFrames:"帧数",trendNew:"上期为 0",trendFlat:"持平",coreAnalysis:"核心分析",timelineTitle:"用户时序流量",timelineScope:"{count} 位用户",view:"视图",groupTimeline:"分组时序",frameTimeline:"帧类型",directionTrend:"方向走势",metric:"指标",bytes:"字节",frames:"帧数",direction:{all:"全部",out:"出站",in:"入站"},multiUserMatrix:"多用户矩阵",stackedTimeline:"单用户堆叠",bucketCount:"{count} 个日桶",total:"合计",selectedAggregate:"所选用户合计",categorySummary:"类别摘要",totalComposition:"所选用户的流量构成",clear:"清除",outIn:"出 {out} · 入 {in}",userDetail:"用户明细",userCount:"{count} 位用户",totalTraffic:"总流量",share:"占比",periodTrend:"较上期",activeDays:"活跃天数",viewUser:"查看 {user}",diagnostics:"流量诊断",diagnosticsRange:"最近 {days} 天",dailyActivity:"用户日活跃度",frameDensity:"类别帧密度",frameUnit:"帧",userTraffic:"用户流量",dailyTraffic:"每日流量",frameBreakdown:"帧类型构成",colUser:"用户",colCategory:"类别",colFrameType:"帧类型",colDirection:"方向",colBytes:"字节",colFrames:"帧数",dirIn:"接收",dirOut:"发送",empty:"该时间范围内暂无流量记录。",loadFailed:"加载流量统计失败。",categories:{terminal:"终端转发",state:"状态同步",filesystem:"文件浏览",service:"远程预览",control:"控制信令",other:"其他"}},feishuConfig:{title:"飞书集成",description:"为本 relay 启用飞书机器人桥接。加密密钥用于保护服务器上保存的飞书应用凭据。",enabled:"启用飞书",encryptKey:"加密密钥",generate:"生成",keyGenerated:"已生成密钥,保存后生效。",keyEmptyPlaceholder:"粘贴或生成一个 32 字节 base64 密钥",keyKeepPlaceholder:"已设置密钥(…{last4})。留空则保持不变。",keyCopyOnce:"请妥善复制保存此密钥——它只显示这一次,之后不再展示。",forceRotate:"替换现有密钥(现有飞书绑定将失效)",baseUrl:"Base URL",statusRunning:"运行中",statusStopped:"已停止",rotateConflict:"这会更改现有密钥。需勾选「替换」才能轮换(现有绑定会失效)。",loadFailed:"加载飞书配置失败。",saveFailed:"保存失败。"},created:"创建时间",disabled:"已禁用 {when}",email:"邮箱",errors:{actionFailed:"操作失败。",cannotDemoteSelf:"不能降级你自己。",lastAdmin:"不能降级最后一个管理员,请先提升其他用户。"},id:"ID",invitationsTab:{consumed:"已使用",count:"数量",createFailed:"创建失败:{code}",copyNow:"请立即复制此邀请{note},此后不会再次显示。",empty:"还没有邀请。",expires:"过期时间",loadFailed:"加载邀请失败。",note:"备注",prefix:"前缀",unused:"未使用"},loadUsersFailed:"加载用户失败。",promote:"提升",promoteConfirm:"将此用户提升为管理员?",resetPassword:"重置密码",resetPasswordConfirm:"重置密码?新的临时密码只会显示一次。",secretCopyOnce:"{label} - 请立即复制,仅显示一次。",status:"状态",temporaryPasswordFor:"{email} 的临时密码",title:"管理",userStatus:{active:"活跃",admin:"管理员"},users:"用户",invitations:"邀请",demote:"降级",demoteConfirm:"降级此管理员?",disable:"禁用",disableConfirm:"禁用此用户?该用户将被登出且无法登录。"},test:{interpolation:"{count} 个会话"},connHealth:{pillLabelConnecting:"连接中…",pillLabelReconnecting:"重连中…",pillLabelOff:"已关闭",drawerTitle:"连接质量",drawerRttNow:"RTT(当前)",drawerRttP50P95:"p50 / p95(最近 5 分钟)",drawerBytesIn:"↓ 接收",drawerBytesOut:"↑ 发送",drawerState:"状态",drawerReconnectsLastHour:"最近 1 小时重连",drawerReconnectsTime:"时间",drawerReconnectsReason:"原因",drawerReconnectsDowntime:"断开时长",drawerSeqGaps:"观察到的序号跳跃:"}},zd="atterm.locale",us={en:Ug,"zh-CN":qg},Fi=fe("system"),Pn=fe("en"),Gg=Y(()=>[{label:fo("common.system"),value:"system"},{label:fo("common.english"),value:"en"},{label:fo("common.simplifiedChinese"),value:"zh-CN"}]);let Hd=cl,Wr;function rP(e={}){Wr==null||Wr(),Wr=void 0,Hd=e.getLanguages??cl;const t=Xg();Fi.value=t,wa(),Wr=(e.listenLanguageChange??rm)(()=>{wa()})}function Kg(e){Fi.value=e,wa();try{window.localStorage.setItem(zd,e)}catch{}try{window.localStorage.setItem("atterm.locale_preference.value",JSON.stringify(e))}catch{}pp(async()=>{const{notifyLocalChange:t}=await import("./prefsSync-C5tz9Q-s.js");return{notifyLocalChange:t}},__vite__mapDeps([0,1])).then(({notifyLocalChange:t})=>{t("locale_preference")}).catch(()=>{})}function Yg(e,t=cl()){if(e==="en"||e==="zh-CN")return e;for(const o of t){const r=o.trim().toLowerCase();if(r!==""){if(r==="zh"||r.startsWith("zh-"))return"zh-CN";if(r==="en"||r.startsWith("en-"))return"en"}}return"en"}function fo(e,t={}){const o=fs(us[Pn.value],e)??fs(us.en,e)??e;return em(o,t)}function nP(e){return tm(e,{dateStyle:"medium",timeStyle:"short"})}function Xg(){try{const e=window.localStorage.getItem(zd);return Jg(e)?e:"system"}catch{return"system"}}function Jg(e){return e==="system"||e==="en"||e==="zh-CN"}function wa(){Zg(Yg(Fi.value,Hd()))}function Zg(e){Pn.value=e,Qg(e)}function Qg(e){typeof document>"u"||(document.documentElement.lang=e)}function fs(e,t){let o=e;for(const r of t.split(".")){if(!om(o))return;o=o[r]}return typeof o=="string"?o:void 0}function em(e,t){return e.replace(/\{([^{}]+)\}/g,(o,r)=>{const n=t[r];return n===void 0?o:String(n)})}function tm(e,t){if(e===void 0||e==="")return"";try{return new Intl.DateTimeFormat(Pn.value,t).format(new Date(e))}catch{return typeof e=="string"?e:""}}function om(e){return typeof e=="object"&&e!==null}function cl(){return typeof navigator>"u"?[]:navigator.languages.length>0?navigator.languages:navigator.language?[navigator.language]:[]}function rm(e){return typeof window>"u"?()=>{}:(window.addEventListener("languagechange",e),()=>window.removeEventListener("languagechange",e))}const dl="atterm.relay";let Bn=null;function iP(){if(Bn!==null)return Bn;const e=globalThis.Capacitor;return Bn=!!(e&&typeof e.isNativePlatform=="function"&&e.isNativePlatform()),Bn}function aP(){if(typeof localStorage>"u")return null;const e=localStorage.getItem(dl);if(!e)return null;try{const t=JSON.parse(e);return typeof t!="object"||t===null?null:{baseURL:t.baseURL??t.base??"",sessionToken:t.sessionToken??t.token??null,expiresAt:t.expiresAt??null,allowInsecure:t.allowInsecure??t.allow_insecure??!1,...t.realmId!==void 0?{realmId:t.realmId}:{},...t.homeInstanceURL!==void 0?{homeInstanceURL:t.homeInstanceURL}:{}}}catch{return null}}function lP(e){typeof localStorage>"u"||localStorage.setItem(dl,JSON.stringify(e))}function sP(){typeof localStorage>"u"||localStorage.removeItem(dl)}function cP(e,t){const o=e.trim();if(!o)return fo("setup.errors.relayUrlRequired");let r;try{r=new URL(o)}catch{return fo("setup.errors.invalidRelayUrl")}return r.protocol!=="http:"&&r.protocol!=="https:"?fo("setup.errors.relayUrlMustBeHttp"):r.pathname!=="/"||r.search!==""||r.hash!==""?fo("setup.errors.relayUrlNoPath"):r.protocol==="http:"&&!nm(r.hostname)&&!t?fo("setup.errors.useInsecureForHttp"):null}function nm(e){const t=e.toLowerCase();return!!(t==="localhost"||t==="127.0.0.1"||t==="::1"||t.startsWith("127.")||t.startsWith("[")&&t.endsWith("]")&&t.slice(1,-1)==="::1")}const dP=(e,t)=>{const o=e.__vccOpts||e;for(const[r,n]of t)o[r]=n;return o};function im(e){let t=".",o="__",r="--",n;if(e){let f=e.blockPrefix;f&&(t=f),f=e.elementPrefix,f&&(o=f),f=e.modifierPrefix,f&&(r=f)}const i={install(f){n=f.c;const g=f.context;g.bem={},g.bem.b=null,g.bem.els=null}};function a(f){let g,S;return{before(v){g=v.bem.b,S=v.bem.els,v.bem.els=null},after(v){v.bem.b=g,v.bem.els=S},$({context:v,props:$}){return f=typeof f=="string"?f:f({context:v,props:$}),v.bem.b=f,`${($==null?void 0:$.bPrefix)||t}${v.bem.b}`}}}function l(f){let g;return{before(S){g=S.bem.els},after(S){S.bem.els=g},$({context:S,props:v}){return f=typeof f=="string"?f:f({context:S,props:v}),S.bem.els=f.split(",").map($=>$.trim()),S.bem.els.map($=>`${(v==null?void 0:v.bPrefix)||t}${S.bem.b}${o}${$}`).join(", ")}}}function s(f){return{$({context:g,props:S}){f=typeof f=="string"?f:f({context:g,props:S});const v=f.split(",").map(w=>w.trim());function $(w){return v.map(_=>`&${(S==null?void 0:S.bPrefix)||t}${g.bem.b}${w!==void 0?`${o}${w}`:""}${r}${_}`).join(", ")}const T=g.bem.els;return T!==null?$(T[0]):$()}}}function c(f){return{$({context:g,props:S}){f=typeof f=="string"?f:f({context:g,props:S});const v=g.bem.els;return`&:not(${(S==null?void 0:S.bPrefix)||t}${g.bem.b}${v!==null&&v.length>0?`${o}${v[0]}`:""}${r}${f})`}}}return Object.assign(i,{cB:(...f)=>n(a(f[0]),f[1],f[2]),cE:(...f)=>n(l(f[0]),f[1],f[2]),cM:(...f)=>n(s(f[0]),f[1],f[2]),cNotM:(...f)=>n(c(f[0]),f[1],f[2])}),i}function am(e){let t=0;for(let o=0;o{let n=am(r);if(n){if(n===1){e.forEach(a=>{o.push(r.replace("&",a))});return}}else{e.forEach(a=>{o.push((a&&a+" ")+r)});return}let i=[r];for(;n--;){const a=[];i.forEach(l=>{e.forEach(s=>{a.push(l.replace("&",s))})}),i=a}i.forEach(a=>o.push(a))}),o}function cm(e,t){const o=[];return t.split(kd).forEach(r=>{e.forEach(n=>{o.push((n&&n+" ")+r)})}),o}function dm(e){let t=[""];return e.forEach(o=>{o=o&&o.trim(),o&&(o.includes("&")?t=sm(t,o):t=cm(t,o))}),t.join(", ").replace(lm," ")}function ps(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}function Ai(e,t){return(t??document.head).querySelector(`style[cssr-id="${e}"]`)}function um(e){const t=document.createElement("style");return t.setAttribute("cssr-id",e),t}function Ln(e){return e?/^\s*@(s|m)/.test(e):!1}const fm=/[A-Z]/g;function Dd(e){return e.replace(fm,t=>"-"+t.toLowerCase())}function pm(e,t=" "){return typeof e=="object"&&e!==null?` { +**/let ya;const Vl=typeof window<"u"&&window.trustedTypes;if(Vl)try{ya=Vl.createPolicy("vue",{createHTML:e=>e})}catch{}const Td=ya?e=>ya.createHTML(e):e=>e,ag="http://www.w3.org/2000/svg",lg="http://www.w3.org/1998/Math/MathML",ao=typeof document<"u"?document:null,Ul=ao&&ao.createElement("template"),sg={insert:(e,t,o)=>{t.insertBefore(e,o||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,o,r)=>{const n=t==="svg"?ao.createElementNS(ag,e):t==="mathml"?ao.createElementNS(lg,e):o?ao.createElement(e,{is:o}):ao.createElement(e);return e==="select"&&r&&r.multiple!=null&&n.setAttribute("multiple",r.multiple),n},createText:e=>ao.createTextNode(e),createComment:e=>ao.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ao.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,o,r,n,i){const a=o?o.previousSibling:t.lastChild;if(n&&(n===i||n.nextSibling))for(;t.insertBefore(n.cloneNode(!0),o),!(n===i||!(n=n.nextSibling)););else{Ul.innerHTML=Td(r==="svg"?`${e}`:r==="mathml"?`${e}`:e);const l=Ul.content;if(r==="svg"||r==="mathml"){const s=l.firstChild;for(;s.firstChild;)l.appendChild(s.firstChild);l.removeChild(s)}t.insertBefore(l,o)}return[a?a.nextSibling:t.firstChild,o?o.previousSibling:t.lastChild]}},vo="transition",Br="animation",yr=Symbol("_vtc"),$d={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Rd=Xe({},Nc,$d),cg=e=>(e.displayName="Transition",e.props=Rd,e),un=cg((e,{slots:t})=>y(uh,Fd(e),t)),Bo=(e,t=[])=>{ce(e)?e.forEach(o=>o(...t)):e&&e(...t)},ql=e=>e?ce(e)?e.some(t=>t.length>1):e.length>1:!1;function Fd(e){const t={};for(const A in e)A in $d||(t[A]=e[A]);if(e.css===!1)return t;const{name:o="v",type:r,duration:n,enterFromClass:i=`${o}-enter-from`,enterActiveClass:a=`${o}-enter-active`,enterToClass:l=`${o}-enter-to`,appearFromClass:s=i,appearActiveClass:c=a,appearToClass:d=l,leaveFromClass:u=`${o}-leave-from`,leaveActiveClass:p=`${o}-leave-active`,leaveToClass:m=`${o}-leave-to`}=e,f=dg(n),g=f&&f[0],S=f&&f[1],{onBeforeEnter:v,onEnter:$,onEnterCancelled:T,onLeave:w,onLeaveCancelled:E,onBeforeAppear:O=v,onAppear:x=$,onAppearCancelled:F=T}=t,R=(A,J,G,le)=>{A._enterCancelled=le,Co(A,J?d:l),Co(A,J?c:a),G&&G()},B=(A,J)=>{A._isLeaving=!1,Co(A,u),Co(A,m),Co(A,p),J&&J()},j=A=>(J,G)=>{const le=A?x:$,te=()=>R(J,A,G);Bo(le,[J,te]),Gl(()=>{Co(J,A?s:i),qt(J,A?d:l),ql(le)||Kl(J,r,g,te)})};return Xe(t,{onBeforeEnter(A){Bo(v,[A]),qt(A,i),qt(A,a)},onBeforeAppear(A){Bo(O,[A]),qt(A,s),qt(A,c)},onEnter:j(!1),onAppear:j(!0),onLeave(A,J){A._isLeaving=!0;const G=()=>B(A,J);qt(A,u),A._enterCancelled?(qt(A,p),Sa()):(Sa(),qt(A,p)),Gl(()=>{A._isLeaving&&(Co(A,u),qt(A,m),ql(w)||Kl(A,r,S,G))}),Bo(w,[A,G])},onEnterCancelled(A){R(A,!1,void 0,!0),Bo(T,[A])},onAppearCancelled(A){R(A,!0,void 0,!0),Bo(F,[A])},onLeaveCancelled(A){B(A),Bo(E,[A])}})}function dg(e){if(e==null)return null;if(Ee(e))return[Xi(e.enter),Xi(e.leave)];{const t=Xi(e);return[t,t]}}function Xi(e){return xp(e)}function qt(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.add(o)),(e[yr]||(e[yr]=new Set)).add(t)}function Co(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const o=e[yr];o&&(o.delete(t),o.size||(e[yr]=void 0))}function Gl(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let ug=0;function Kl(e,t,o,r){const n=e._endId=++ug,i=()=>{n===e._endId&&r()};if(o!=null)return setTimeout(i,o);const{type:a,timeout:l,propCount:s}=Ad(e,t);if(!a)return r();const c=a+"end";let d=0;const u=()=>{e.removeEventListener(c,p),i()},p=m=>{m.target===e&&++d>=s&&u()};setTimeout(()=>{d(o[f]||"").split(", "),n=r(`${vo}Delay`),i=r(`${vo}Duration`),a=Yl(n,i),l=r(`${Br}Delay`),s=r(`${Br}Duration`),c=Yl(l,s);let d=null,u=0,p=0;t===vo?a>0&&(d=vo,u=a,p=i.length):t===Br?c>0&&(d=Br,u=c,p=s.length):(u=Math.max(a,c),d=u>0?a>c?vo:Br:null,p=d?d===vo?i.length:s.length:0);const m=d===vo&&/\b(transform|all)(,|$)/.test(r(`${vo}Property`).toString());return{type:d,timeout:u,propCount:p,hasTransform:m}}function Yl(e,t){for(;e.lengthXl(o)+Xl(e[r])))}function Xl(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Sa(){return document.body.offsetHeight}function fg(e,t,o){const r=e[yr];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):o?e.setAttribute("class",t):e.className=t}const di=Symbol("_vod"),Id=Symbol("_vsh"),Z2={beforeMount(e,{value:t},{transition:o}){e[di]=e.style.display==="none"?"":e.style.display,o&&t?o.beforeEnter(e):Lr(e,t)},mounted(e,{value:t},{transition:o}){o&&t&&o.enter(e)},updated(e,{value:t,oldValue:o},{transition:r}){!t!=!o&&(r?t?(r.beforeEnter(e),Lr(e,!0),r.enter(e)):r.leave(e,()=>{Lr(e,!1)}):Lr(e,t))},beforeUnmount(e,{value:t}){Lr(e,t)}};function Lr(e,t){e.style.display=t?e[di]:"none",e[Id]=!t}const pg=Symbol(""),hg=/(^|;)\s*display\s*:/;function gg(e,t,o){const r=e.style,n=We(o);let i=!1;if(o&&!n){if(t)if(We(t))for(const a of t.split(";")){const l=a.slice(0,a.indexOf(":")).trim();o[l]==null&&Zn(r,l,"")}else for(const a in t)o[a]==null&&Zn(r,a,"");for(const a in o)a==="display"&&(i=!0),Zn(r,a,o[a])}else if(n){if(t!==o){const a=r[pg];a&&(o+=";"+a),r.cssText=o,i=hg.test(o)}}else t&&e.removeAttribute("style");di in e&&(e[di]=i?r.display:"",e[Id]&&(r.display="none"))}const Jl=/\s*!important$/;function Zn(e,t,o){if(ce(o))o.forEach(r=>Zn(e,t,r));else if(o==null&&(o=""),t.startsWith("--"))e.setProperty(t,o);else{const r=mg(e,t);Jl.test(o)?e.setProperty(Io(r),o.replace(Jl,""),"important"):e[r]=o}}const Zl=["Webkit","Moz","ms"],Ji={};function mg(e,t){const o=Ji[t];if(o)return o;let r=Mt(t);if(r!=="filter"&&r in e)return Ji[t]=r;r=bi(r);for(let n=0;nZi||(Cg.then(()=>Zi=0),Zi=Date.now());function Sg(e,t){const o=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=o.attached)return;Lt(wg(r,o.value),t,5,[r])};return o.value=e,o.attached=yg(),o}function wg(e,t){if(ce(t)){const o=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{o.call(e),e._stopped=!0},t.map(r=>n=>!n._stopped&&r&&r(n))}else return t}const ns=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Pg=(e,t,o,r,n,i)=>{const a=n==="svg";t==="class"?fg(e,r,a):t==="style"?gg(e,o,r):gi(t)?Na(t)||vg(e,t,o,r,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Tg(e,t,r,a))?(ts(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&es(e,t,r,a,i,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!We(r))?ts(e,Mt(t),r,i,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),es(e,t,r,a))};function Tg(e,t,o,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&ns(t)&&me(o));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const n=e.tagName;if(n==="IMG"||n==="VIDEO"||n==="CANVAS"||n==="SOURCE")return!1}return ns(t)&&We(o)?!1:t in e}const Ed=new WeakMap,_d=new WeakMap,ui=Symbol("_moveCb"),is=Symbol("_enterCb"),$g=e=>(delete e.props.mode,e),Rg=$g({name:"TransitionGroup",props:Xe({},Rd,{tag:String,moveClass:String}),setup(e,{slots:t}){const o=Sn(),r=jc();let n,i;return Jc(()=>{if(!n.length)return;const a=e.moveClass||`${e.name||"v"}-move`;if(!_g(n[0].el,o.vnode.el,a))return;n.forEach(Ag),n.forEach(Ig);const l=n.filter(Eg);Sa(),l.forEach(s=>{const c=s.el,d=c.style;qt(c,a),d.transform=d.webkitTransform=d.transitionDuration="";const u=c[ui]=p=>{p&&p.target!==c||(!p||/transform$/.test(p.propertyName))&&(c.removeEventListener("transitionend",u),c[ui]=null,Co(c,a))};c.addEventListener("transitionend",u)})}),()=>{const a=we(e),l=Fd(a);let s=a.tag||et;if(n=[],i)for(let c=0;c{l.split(/\s+/).forEach(s=>s&&r.classList.remove(s))}),o.split(/\s+/).forEach(l=>l&&r.classList.add(l)),r.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(r);const{hasTransform:a}=Ad(r);return i.removeChild(r),a}const Fo=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ce(t)?o=>Kn(t,o):t};function Mg(e){e.target.composing=!0}function as(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const _t=Symbol("_assign"),ls={created(e,{modifiers:{lazy:t,trim:o,number:r}},n){e[_t]=Fo(n);const i=r||n.props&&n.props.type==="number";uo(e,t?"change":"input",a=>{if(a.target.composing)return;let l=e.value;o&&(l=l.trim()),i&&(l=oi(l)),e[_t](l)}),o&&uo(e,"change",()=>{e.value=e.value.trim()}),t||(uo(e,"compositionstart",Mg),uo(e,"compositionend",as),uo(e,"change",as))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:o,modifiers:{lazy:r,trim:n,number:i}},a){if(e[_t]=Fo(a),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?oi(e.value):e.value,s=t??"";l!==s&&(document.activeElement===e&&e.type!=="range"&&(r&&t===o||n&&e.value.trim()===s)||(e.value=s))}},zg={deep:!0,created(e,t,o){e[_t]=Fo(o),uo(e,"change",()=>{const r=e._modelValue,n=Sr(e),i=e.checked,a=e[_t];if(ce(r)){const l=Ka(r,n),s=l!==-1;if(i&&!s)a(r.concat(n));else if(!i&&s){const c=[...r];c.splice(l,1),a(c)}}else if(Rr(r)){const l=new Set(r);i?l.add(n):l.delete(n),a(l)}else a(Md(e,i))})},mounted:ss,beforeUpdate(e,t,o){e[_t]=Fo(o),ss(e,t,o)}};function ss(e,{value:t,oldValue:o},r){e._modelValue=t;let n;if(ce(t))n=Ka(t,r.props.value)>-1;else if(Rr(t))n=t.has(r.props.value);else{if(t===o)return;n=er(t,Md(e,!0))}e.checked!==n&&(e.checked=n)}const Hg={created(e,{value:t},o){e.checked=er(t,o.props.value),e[_t]=Fo(o),uo(e,"change",()=>{e[_t](Sr(e))})},beforeUpdate(e,{value:t,oldValue:o},r){e[_t]=Fo(r),t!==o&&(e.checked=er(t,r.props.value))}},kg={deep:!0,created(e,{value:t,modifiers:{number:o}},r){const n=Rr(t);uo(e,"change",()=>{const i=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>o?oi(Sr(a)):Sr(a));e[_t](e.multiple?n?new Set(i):i:i[0]),e._assigning=!0,nn(()=>{e._assigning=!1})}),e[_t]=Fo(r)},mounted(e,{value:t}){cs(e,t)},beforeUpdate(e,t,o){e[_t]=Fo(o)},updated(e,{value:t}){e._assigning||cs(e,t)}};function cs(e,t){const o=e.multiple,r=ce(t);if(!(o&&!r&&!Rr(t))){for(let n=0,i=e.options.length;nString(c)===String(l)):a.selected=Ka(t,l)>-1}else a.selected=t.has(l);else if(er(Sr(a),t)){e.selectedIndex!==n&&(e.selectedIndex=n);return}}!o&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Sr(e){return"_value"in e?e._value:e.value}function Md(e,t){const o=t?"_trueValue":"_falseValue";return o in e?e[o]:t}const Q2={created(e,t,o){On(e,t,o,null,"created")},mounted(e,t,o){On(e,t,o,null,"mounted")},beforeUpdate(e,t,o,r){On(e,t,o,r,"beforeUpdate")},updated(e,t,o,r){On(e,t,o,r,"updated")}};function Dg(e,t){switch(e){case"SELECT":return kg;case"TEXTAREA":return ls;default:switch(t){case"checkbox":return zg;case"radio":return Hg;default:return ls}}}function On(e,t,o,r,n){const a=Dg(e.tagName,o.props&&o.props.type)[n];a&&a(e,t,o,r)}const Og=["ctrl","shift","alt","meta"],Bg={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Og.some(o=>e[`${o}Key`]&&!t.includes(o))},eP=(e,t)=>{const o=e._withMods||(e._withMods={}),r=t.join(".");return o[r]||(o[r]=(n,...i)=>{for(let a=0;a{const o=e._withKeys||(e._withKeys={}),r=t.join(".");return o[r]||(o[r]=n=>{if(!("key"in n))return;const i=Io(n.key);if(t.some(a=>a===i||Lg[a]===i))return e(n)})},Wg=Xe({patchProp:Pg},sg);let ds;function jg(){return ds||(ds=Mh(Wg))}const oP=(...e)=>{const t=jg().createApp(...e),{mount:o}=t;return t.mount=r=>{const n=Vg(r);if(!n)return;const i=t._component;!me(i)&&!i.render&&!i.template&&(i.template=n.innerHTML),n.nodeType===1&&(n.textContent="");const a=o(n,!1,Ng(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),a},t};function Ng(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Vg(e){return We(e)?document.querySelector(e):e}const Ug={common:{appName:"AT Term",cancel:"Cancel",close:"Close",confirm:"Confirm",copy:"Copy",create:"Create",created:"created",delete:"Delete",english:"English",language:"Language",loading:"Loading...",no:"no",optional:"optional",revoke:"Revoke",save:"Save",send:"send",simplifiedChinese:"Simplified Chinese",system:"System",unknown:"unknown",version:"Version",versionLabel:"version {version}",yes:"yes"},auth:{alreadyHaveAccount:"Already have an account?",createAccount:"Create account",email:"Email",emailPlaceholder:"you@example.com",setup:{title:"First-run setup",hint:"No admin yet. Create the first admin account — use the email you set in ATTERM_BOOTSTRAP_ADMIN_EMAIL.",emailPlaceholder:"your ATTERM_BOOTSTRAP_ADMIN_EMAIL",confirmPassword:"Confirm password",createAdmin:"Create admin",passwordMismatch:"The two passwords do not match.",notAdmin:"Account created, but it is not an admin — make sure the email matches ATTERM_BOOTSTRAP_ADMIN_EMAIL.",failed:"Setup failed. Please try again."},errors:{emailTaken:"An account with that email already exists.",invalidCredentials:"Invalid email or password.",invalidEmail:"Please enter a valid email.",invalidRequest:"Please check your input.",inviteInvalid:"Invite code is invalid or already used.",passwordWeak:"Password must be at least 12 characters.",rateLimited:"Too many attempts. Please wait a few minutes.",rateLimitedShort:"Too many attempts. Please wait.",signInFailed:"Sign-in failed. Please try again.",signUpFailed:"Sign-up failed. Check your invite code and try again."},haveInviteCode:"Have an invite code?",inviteCode:"Invite code",password:"Password",signIn:"Sign in",signUp:"Sign up",signUpHere:"Sign up here"},setup:{allowInsecure:"Allow insecure HTTP/WS (non-loopback)",connect:"Connect",connectToRelay:"Connect to relay",disconnect:"Disconnect",errors:{cannotReachRelay:"Cannot reach relay: {message}",invalidRelayUrl:"invalid or malformed relay URL",originRejected:"Relay rejected the origin. Make sure the relay was started with ATTERM_ORIGINS containing capacitor://localhost.",relayHttp:"Relay returned HTTP {status}.",relayHttpCheckUrl:"Relay returned HTTP {status}. Check the URL and try again.",relayUrlMustBeHttp:"relay URL must start with http:// or https://",relayUrlNoPath:"relay URL must not contain a path, query, or fragment",relayUrlRequired:"relay URL is required",tokenInvalid:"API token is invalid. Generate a new one from Settings -> API Tokens on the relay web UI.",tokenInvalidSettings:"API token is invalid. Generate a new one from the relay web UI under Settings -> API Tokens.",tokenRequired:"API token is required",useInsecureForHttp:'enable "Allow insecure HTTP/WS" to use http:// with a non-loopback host'},reasonTokenInvalid:"Your API token is no longer valid. Please paste a fresh token to sign in again.",title:"Set up relay",relayUrl:"Relay URL",relayUrlPlaceholder:"https://relay.example.com",token:"API token",tokenPlaceholder:"atk_...",saved:"Saved."},main:{activeSessions:"active sessions",back:"back",backToSessions:"Back to sessions",empty:"No live sessions. Start one from the desktop app or",errors:{loadSessions:"Failed to load sessions."},install:{dismiss:"Dismiss install hint",text:"on iPhone, open this site with HTTPS, then tap Share -> Add to Home Screen.",title:"install AT Term"},reconnect:"Reconnect",refresh:"refresh",sessionCount:"{count} sessions",sessionCountOne:"{count} session",title:"Remote sessions",unknownCommand:"(unknown)",unknownHost:"unknown host",unlock:{action:"Sign in again",text:"This browser is signed in, but the in-memory encryption key is locked. Sign in again to decrypt session names, commands, and paths.",title:"Unlock encrypted session details"},viewOnlyNotice:"This session is view-only from this device. You can inspect output, but input is disabled.",taskTypes:{ai:"AI",test:"Test",build:"Build",deploy:"Deploy"}},terminal:{cannotReachRelay:"Cannot reach relay.",connecting:"Connecting...",disconnected:"Disconnected",ended:"session ended (exit {code})",loadingHistory:"loading history... {percent}%",paste:"Paste",pickImage:"pick image",pickFile:"pick file",remoteControl:"remote has taken control",statuses:{attached:"attached",connecting:"connecting",ended:"ended",lost:"lost",reconnecting:"reconnecting"},shortcuts:"terminal shortcuts",takeControl:"Take control",tapToChangeConfig:"Tap to change configuration.",templatePreviewTitle:"Send preview",templatePreviewSend:"Send"},sessions:{attach:"Attach",created:"Created",host:"Host"},admin:{actions:"Actions",config:{effective:"effective: {value}",effectiveDisabled:"effective: disabled",hint:'0 means "use the built-in default"; negative disables the limit entirely. Changes apply immediately and persist to the admin config file.',loadFailed:"Failed to load config.",maxConnections:"Max WS connections (per IP+token)",rateLimit:"Rate limit (requests/min per IP+token)",saveFailed:"Save failed.",runtimeLimits:"Runtime limits",debug:"Verbose logging",debugHint:"Logs relay frames. Applies immediately, no restart.",debugPayload:"Log payload bytes",debugPayloadWarn:"Logs terminal input/output — sensitive. Use only while debugging.",allowedOrigins:"Allowed Origins",allowedOriginsHint:'One per line. Mobile Capacitor clients need "capacitor://localhost". Empty = allow any origin (dev only).',allowedOriginsPlaceholder:`https://relay.example.com +capacitor://localhost`},configTab:"Config",feishuTab:"Feishu",trafficTab:"Traffic",traffic:{title:"Traffic analysis",timezone:"Daily aggregation in UTC",refresh:"Refresh data",platformScope:"Platform scope",platformStatus:"Platform status",globalRealtime:"Global live data",relayStatus:"Relay status",online:"Online",unknown:"Unknown",activeSessions:"Active sessions",relayInstances:"Active relays",activeUplinks:"Active uplinks",liveValue:"Live on this node",liveInstances:"Heartbeat within 90s",flushEvery:"Traffic flushes every {seconds}s",directAttempts:"Direct attempts",directAttemptsHint:"Since this Relay started",directEnabled:"Signaling enabled",directDisabled:"Signaling disabled",directSuccesses:"Direct successes",directSuccessesHint:"Authenticated data channels",directFallbacks:"Direct fallbacks",directFallbacksHint:"Setup failures and route loss",directBytesAvoided:"Relay bytes avoided",directBytesAvoidedHint:"Estimated from host reports",userScope:"User scope",userAnalysis:"User traffic analysis",range:"Date range",days:"{days} days",allUsers:"Users: all",selectedUsers:"Users: {selected}/{total}",filterUsers:"Filter users",selectedCount:"{selected} / {total} selected",clearAll:"Clear all",selectAll:"Select all",searchUsers:"Search email or user ID",selectOrSearchUser:"Select or search user",only:"Only",noUserMatch:"No matching users",restoreAll:"Restore all",done:"Done",noUsersSelected:"No users selected",restoreAllUsers:"Restore all users",selectedUserCount:"{count} users selected",kpiTotal:"Total traffic",kpiOutbound:"Outbound",kpiInbound:"Inbound",kpiFrames:"Frames",trendNew:"No prior data",trendFlat:"Flat",coreAnalysis:"Core analysis",timelineTitle:"User traffic timeline",timelineScope:"{count} users",view:"View",groupTimeline:"Group timeline",frameTimeline:"Frame types",directionTrend:"Direction trend",metric:"Metric",bytes:"Bytes",frames:"Frames",direction:{all:"All",out:"Outbound",in:"Inbound"},multiUserMatrix:"Multi-user matrix",stackedTimeline:"Single-user stacked",bucketCount:"{count} daily buckets",total:"Total",selectedAggregate:"Selected users",categorySummary:"Category summary",totalComposition:"Traffic mix for selected users",clear:"Clear",outIn:"Out {out} · In {in}",userDetail:"User detail",userCount:"{count} users",totalTraffic:"Total traffic",share:"Share",periodTrend:"vs prior",activeDays:"Active days",viewUser:"View {user}",diagnostics:"Traffic diagnostics",diagnosticsRange:"Last {days} days",dailyActivity:"Daily user activity",frameDensity:"Category frame density",frameUnit:"frame",userTraffic:"User traffic",dailyTraffic:"Daily traffic",frameBreakdown:"Frame type breakdown",colUser:"User",colCategory:"Category",colFrameType:"Frame type",colDirection:"Direction",colBytes:"Bytes",colFrames:"Frames",dirIn:"In",dirOut:"Out",empty:"No traffic recorded for this range.",loadFailed:"Failed to load traffic stats.",categories:{terminal:"Terminal relay",state:"State sync",config:"Configuration",fs:"File browser",preview:"Remote preview",filesystem:"File browser",service:"Remote preview",control:"Control",other:"Other"}},feishuConfig:{title:"Feishu integration",description:"Enable the Feishu bot bridge for this relay. The encrypt key protects Feishu app credentials stored on the server.",enabled:"Enable Feishu",encryptKey:"Encrypt key",generate:"Generate",keyGenerated:"Key generated — save to apply.",keyEmptyPlaceholder:"Paste or generate a 32-byte base64 key",keyKeepPlaceholder:"Key set (…{last4}). Leave blank to keep it.",keyCopyOnce:"Copy this key somewhere safe — it is shown only once and never again.",forceRotate:"Replace the existing key (existing Feishu bindings will stop working)",baseUrl:"Base URL",statusRunning:"Running",statusStopped:"Stopped",rotateConflict:'That changes the existing key. Enable "replace" to rotate it (existing bindings will break).',loadFailed:"Failed to load Feishu config.",saveFailed:"Save failed."},created:"Created",disabled:"disabled {when}",email:"Email",errors:{actionFailed:"Action failed.",cannotDemoteSelf:"You can't demote yourself.",lastAdmin:"Can't demote the last admin - promote another user first."},id:"ID",invitationsTab:{consumed:"Consumed",count:"Count",createFailed:"Create failed: {code}",copyNow:"Copy this invitation now{note} - it will not be shown again.",empty:"No invitations yet.",expires:"Expires",loadFailed:"Failed to load invitations.",note:"Note",prefix:"Prefix",unused:"unused"},loadUsersFailed:"Failed to load users.",promote:"Promote",promoteConfirm:"Promote this user to admin?",resetPassword:"Reset password",resetPasswordConfirm:"Reset password? A new temporary password is shown once.",secretCopyOnce:"{label} - copy it now, only shown once.",status:"Status",temporaryPasswordFor:"Temporary password for {email}",title:"Admin",userStatus:{active:"active",admin:"admin"},users:"Users",invitations:"Invitations",demote:"Demote",demoteConfirm:"Demote this admin?",disable:"Disable",disableConfirm:"Disable this user? They are signed out and cannot log in."},test:{interpolation:"{count} sessions"},connHealth:{pillLabelConnecting:"connecting…",pillLabelReconnecting:"reconnecting…",pillLabelOff:"off",drawerTitle:"Connection health",drawerRttNow:"RTT (now)",drawerRttP50P95:"p50 / p95 (5 min)",drawerBytesIn:"↓ in",drawerBytesOut:"↑ out",drawerState:"State",drawerReconnectsLastHour:"Reconnects (1 h)",drawerReconnectsTime:"time",drawerReconnectsReason:"reason",drawerReconnectsDowntime:"downtime",drawerSeqGaps:"Seq gaps observed:"}},qg={common:{appName:"AT Term",cancel:"取消",close:"关闭",confirm:"确认",copy:"复制",create:"创建",created:"创建于",delete:"删除",english:"英语",language:"语言",loading:"正在加载...",no:"否",optional:"可选",revoke:"撤销",save:"保存",send:"发送",simplifiedChinese:"简体中文",system:"跟随系统",unknown:"未知",version:"版本",versionLabel:"版本 {version}",yes:"是"},auth:{alreadyHaveAccount:"已有账号?",createAccount:"创建账号",email:"邮箱",emailPlaceholder:"you@example.com",setup:{title:"首次安装",hint:"还没有管理员。创建第一个管理员账号——请填写你在 ATTERM_BOOTSTRAP_ADMIN_EMAIL 配置的邮箱。",emailPlaceholder:"你配置的 ATTERM_BOOTSTRAP_ADMIN_EMAIL",confirmPassword:"确认密码",createAdmin:"创建管理员",passwordMismatch:"两次输入的密码不一致。",notAdmin:"账号已创建,但不是管理员——请确认邮箱与 ATTERM_BOOTSTRAP_ADMIN_EMAIL 一致。",failed:"初始化失败,请重试。"},errors:{emailTaken:"该邮箱已注册。",invalidCredentials:"邮箱或密码不正确。",invalidEmail:"请输入有效邮箱。",invalidRequest:"请检查输入。",inviteInvalid:"邀请码无效或已被使用。",passwordWeak:"密码至少需要 12 个字符。",rateLimited:"尝试次数过多,请等待几分钟。",rateLimitedShort:"尝试次数过多,请稍后再试。",signInFailed:"登录失败,请重试。",signUpFailed:"注册失败,请检查邀请码后重试。"},haveInviteCode:"有邀请码?",inviteCode:"邀请码",password:"密码",signIn:"登录",signUp:"注册",signUpHere:"在这里注册"},setup:{allowInsecure:"允许不安全的 HTTP/WS(非 loopback)",connect:"连接",connectToRelay:"连接到 relay",disconnect:"断开连接",errors:{cannotReachRelay:"无法连接 relay:{message}",invalidRelayUrl:"relay 地址无效或格式错误",originRejected:"relay 拒绝了该 Origin。请确认启动 relay 时 ATTERM_ORIGINS 包含 capacitor://localhost。",relayHttp:"relay 返回 HTTP {status}。",relayHttpCheckUrl:"relay 返回 HTTP {status}。请检查地址后重试。",relayUrlMustBeHttp:"relay 地址必须以 http:// 或 https:// 开头",relayUrlNoPath:"relay 地址不能包含 path、query 或 fragment",relayUrlRequired:"relay 地址必填",tokenInvalid:"API token 无效。请在 relay Web UI 的设置 -> API Tokens 中生成新 token。",tokenInvalidSettings:"API token 无效。请在 relay Web UI 的设置 -> API Tokens 中生成新 token。",tokenRequired:"API token 必填",useInsecureForHttp:"如需对非 loopback 主机使用 http://,请启用“允许不安全的 HTTP/WS”"},reasonTokenInvalid:"你的 API token 已失效。请粘贴新的 token 重新登录。",title:"设置 relay",relayUrl:"Relay 地址",relayUrlPlaceholder:"https://relay.example.com",token:"API token",tokenPlaceholder:"atk_...",saved:"已保存。"},main:{activeSessions:"活动会话",back:"返回",backToSessions:"返回会话列表",empty:"没有在线会话。请从桌面 app 或",errors:{loadSessions:"加载会话失败。"},install:{dismiss:"关闭安装提示",text:"在 iPhone 上,用 HTTPS 打开本站,然后点分享 -> 添加到主屏幕。",title:"安装 AT Term"},reconnect:"重新连接",refresh:"刷新",sessionCount:"{count} 个会话",sessionCountOne:"{count} 个会话",title:"远程会话",unknownCommand:"(未知)",unknownHost:"未知主机",unlock:{action:"重新登录",text:"此浏览器仍处于登录状态,但内存中的加密密钥已锁定。重新登录后才能解密会话名称、命令和路径。",title:"解锁加密会话信息"},viewOnlyNotice:"此设备只能查看该会话。你可以查看输出,但不能输入。",taskTypes:{ai:"AI",test:"测试",build:"构建",deploy:"部署"}},terminal:{cannotReachRelay:"无法连接 relay。",connecting:"正在连接...",disconnected:"连接已断开",ended:"会话已结束(退出码 {code})",loadingHistory:"正在加载历史... {percent}%",paste:"粘贴",pickImage:"选择图片",pickFile:"选择文件",remoteControl:"远端已接管控制",statuses:{attached:"已连接",connecting:"正在连接",ended:"已结束",lost:"连接丢失",reconnecting:"正在重连"},shortcuts:"终端快捷键",takeControl:"接管控制",tapToChangeConfig:"点击修改配置。",templatePreviewTitle:"发送预览",templatePreviewSend:"发送"},sessions:{attach:"接管",created:"创建时间",host:"主机"},admin:{actions:"操作",config:{effective:"实际:{value}",effectiveDisabled:"实际:已禁用",hint:"0 表示使用内建默认值;负数表示完全禁用限制。修改会立即生效,并持久化到管理配置文件。",loadFailed:"加载配置失败。",maxConnections:"最大 WS 连接数(每 IP+token)",rateLimit:"速率限制(每 IP+token 每分钟请求数)",saveFailed:"保存失败。",runtimeLimits:"运行时限制",debug:"详细日志",debugHint:"记录 relay 帧。立即生效,无需重启。",debugPayload:"记录 payload 字节",debugPayloadWarn:"会记录终端输入/输出,属敏感信息,仅排查问题时临时开启。",allowedOrigins:"允许的 Origin",allowedOriginsHint:'一行一个。手机 Capacitor 客户端必须包含 "capacitor://localhost"。留空 = 允许任意 origin(仅供开发)。',allowedOriginsPlaceholder:`https://relay.example.com +capacitor://localhost`},configTab:"配置",feishuTab:"飞书",trafficTab:"流量",traffic:{title:"流量分析",timezone:"按 UTC 日聚合",refresh:"刷新数据",platformScope:"平台范围",platformStatus:"平台状态",globalRealtime:"全局实时",relayStatus:"Relay 状态",online:"运行中",unknown:"未知",activeSessions:"在线会话",relayInstances:"活跃 Relay",activeUplinks:"在线 Uplink",liveValue:"当前节点实时值",liveInstances:"90 秒内有心跳",flushEvery:"流量每 {seconds} 秒入库",directAttempts:"直连尝试",directAttemptsHint:"当前 Relay 进程启动以来",directEnabled:"信令已启用",directDisabled:"信令已关闭",directSuccesses:"直连成功",directSuccessesHint:"已完成认证的数据通道",directFallbacks:"直连回退",directFallbacksHint:"建立失败与活跃通道中断",directBytesAvoided:"节省 Relay 流量",directBytesAvoidedHint:"根据 host 上报估算",userScope:"用户范围",userAnalysis:"用户流量分析",range:"时间范围",days:"{days} 天",allUsers:"用户:全部",selectedUsers:"用户:已选 {selected}/{total}",filterUsers:"筛选用户",selectedCount:"{selected} / {total} 已选",clearAll:"取消全选",selectAll:"全选",searchUsers:"搜索邮箱或用户 ID",selectOrSearchUser:"选择或搜索用户",only:"仅看",noUserMatch:"未找到匹配用户",restoreAll:"恢复全部",done:"完成",noUsersSelected:"当前未选择用户",restoreAllUsers:"恢复全部用户",selectedUserCount:"已筛选 {count} 位用户",kpiTotal:"总流量",kpiOutbound:"出站流量",kpiInbound:"入站流量",kpiFrames:"帧数",trendNew:"上期为 0",trendFlat:"持平",coreAnalysis:"核心分析",timelineTitle:"用户时序流量",timelineScope:"{count} 位用户",view:"视图",groupTimeline:"分组时序",frameTimeline:"帧类型",directionTrend:"方向走势",metric:"指标",bytes:"字节",frames:"帧数",direction:{all:"全部",out:"出站",in:"入站"},multiUserMatrix:"多用户矩阵",stackedTimeline:"单用户堆叠",bucketCount:"{count} 个日桶",total:"合计",selectedAggregate:"所选用户合计",categorySummary:"类别摘要",totalComposition:"所选用户的流量构成",clear:"清除",outIn:"出 {out} · 入 {in}",userDetail:"用户明细",userCount:"{count} 位用户",totalTraffic:"总流量",share:"占比",periodTrend:"较上期",activeDays:"活跃天数",viewUser:"查看 {user}",diagnostics:"流量诊断",diagnosticsRange:"最近 {days} 天",dailyActivity:"用户日活跃度",frameDensity:"类别帧密度",frameUnit:"帧",userTraffic:"用户流量",dailyTraffic:"每日流量",frameBreakdown:"帧类型构成",colUser:"用户",colCategory:"类别",colFrameType:"帧类型",colDirection:"方向",colBytes:"字节",colFrames:"帧数",dirIn:"接收",dirOut:"发送",empty:"该时间范围内暂无流量记录。",loadFailed:"加载流量统计失败。",categories:{terminal:"终端转发",state:"状态同步",config:"配置同步",fs:"文件浏览",preview:"远程预览",filesystem:"文件浏览",service:"远程预览",control:"控制信令",other:"其他"}},feishuConfig:{title:"飞书集成",description:"为本 relay 启用飞书机器人桥接。加密密钥用于保护服务器上保存的飞书应用凭据。",enabled:"启用飞书",encryptKey:"加密密钥",generate:"生成",keyGenerated:"已生成密钥,保存后生效。",keyEmptyPlaceholder:"粘贴或生成一个 32 字节 base64 密钥",keyKeepPlaceholder:"已设置密钥(…{last4})。留空则保持不变。",keyCopyOnce:"请妥善复制保存此密钥——它只显示这一次,之后不再展示。",forceRotate:"替换现有密钥(现有飞书绑定将失效)",baseUrl:"Base URL",statusRunning:"运行中",statusStopped:"已停止",rotateConflict:"这会更改现有密钥。需勾选「替换」才能轮换(现有绑定会失效)。",loadFailed:"加载飞书配置失败。",saveFailed:"保存失败。"},created:"创建时间",disabled:"已禁用 {when}",email:"邮箱",errors:{actionFailed:"操作失败。",cannotDemoteSelf:"不能降级你自己。",lastAdmin:"不能降级最后一个管理员,请先提升其他用户。"},id:"ID",invitationsTab:{consumed:"已使用",count:"数量",createFailed:"创建失败:{code}",copyNow:"请立即复制此邀请{note},此后不会再次显示。",empty:"还没有邀请。",expires:"过期时间",loadFailed:"加载邀请失败。",note:"备注",prefix:"前缀",unused:"未使用"},loadUsersFailed:"加载用户失败。",promote:"提升",promoteConfirm:"将此用户提升为管理员?",resetPassword:"重置密码",resetPasswordConfirm:"重置密码?新的临时密码只会显示一次。",secretCopyOnce:"{label} - 请立即复制,仅显示一次。",status:"状态",temporaryPasswordFor:"{email} 的临时密码",title:"管理",userStatus:{active:"活跃",admin:"管理员"},users:"用户",invitations:"邀请",demote:"降级",demoteConfirm:"降级此管理员?",disable:"禁用",disableConfirm:"禁用此用户?该用户将被登出且无法登录。"},test:{interpolation:"{count} 个会话"},connHealth:{pillLabelConnecting:"连接中…",pillLabelReconnecting:"重连中…",pillLabelOff:"已关闭",drawerTitle:"连接质量",drawerRttNow:"RTT(当前)",drawerRttP50P95:"p50 / p95(最近 5 分钟)",drawerBytesIn:"↓ 接收",drawerBytesOut:"↑ 发送",drawerState:"状态",drawerReconnectsLastHour:"最近 1 小时重连",drawerReconnectsTime:"时间",drawerReconnectsReason:"原因",drawerReconnectsDowntime:"断开时长",drawerSeqGaps:"观察到的序号跳跃:"}},zd="atterm.locale",us={en:Ug,"zh-CN":qg},Fi=fe("system"),Pn=fe("en"),Gg=Y(()=>[{label:fo("common.system"),value:"system"},{label:fo("common.english"),value:"en"},{label:fo("common.simplifiedChinese"),value:"zh-CN"}]);let Hd=cl,Wr;function rP(e={}){Wr==null||Wr(),Wr=void 0,Hd=e.getLanguages??cl;const t=Xg();Fi.value=t,wa(),Wr=(e.listenLanguageChange??rm)(()=>{wa()})}function Kg(e){Fi.value=e,wa();try{window.localStorage.setItem(zd,e)}catch{}try{window.localStorage.setItem("atterm.locale_preference.value",JSON.stringify(e))}catch{}pp(async()=>{const{notifyLocalChange:t}=await import("./prefsSync-Dj3wNxrO.js");return{notifyLocalChange:t}},__vite__mapDeps([0,1])).then(({notifyLocalChange:t})=>{t("locale_preference")}).catch(()=>{})}function Yg(e,t=cl()){if(e==="en"||e==="zh-CN")return e;for(const o of t){const r=o.trim().toLowerCase();if(r!==""){if(r==="zh"||r.startsWith("zh-"))return"zh-CN";if(r==="en"||r.startsWith("en-"))return"en"}}return"en"}function fo(e,t={}){const o=fs(us[Pn.value],e)??fs(us.en,e)??e;return em(o,t)}function nP(e){return tm(e,{dateStyle:"medium",timeStyle:"short"})}function Xg(){try{const e=window.localStorage.getItem(zd);return Jg(e)?e:"system"}catch{return"system"}}function Jg(e){return e==="system"||e==="en"||e==="zh-CN"}function wa(){Zg(Yg(Fi.value,Hd()))}function Zg(e){Pn.value=e,Qg(e)}function Qg(e){typeof document>"u"||(document.documentElement.lang=e)}function fs(e,t){let o=e;for(const r of t.split(".")){if(!om(o))return;o=o[r]}return typeof o=="string"?o:void 0}function em(e,t){return e.replace(/\{([^{}]+)\}/g,(o,r)=>{const n=t[r];return n===void 0?o:String(n)})}function tm(e,t){if(e===void 0||e==="")return"";try{return new Intl.DateTimeFormat(Pn.value,t).format(new Date(e))}catch{return typeof e=="string"?e:""}}function om(e){return typeof e=="object"&&e!==null}function cl(){return typeof navigator>"u"?[]:navigator.languages.length>0?navigator.languages:navigator.language?[navigator.language]:[]}function rm(e){return typeof window>"u"?()=>{}:(window.addEventListener("languagechange",e),()=>window.removeEventListener("languagechange",e))}const dl="atterm.relay";let Bn=null;function iP(){if(Bn!==null)return Bn;const e=globalThis.Capacitor;return Bn=!!(e&&typeof e.isNativePlatform=="function"&&e.isNativePlatform()),Bn}function aP(){if(typeof localStorage>"u")return null;const e=localStorage.getItem(dl);if(!e)return null;try{const t=JSON.parse(e);return typeof t!="object"||t===null?null:{baseURL:t.baseURL??t.base??"",sessionToken:t.sessionToken??t.token??null,expiresAt:t.expiresAt??null,allowInsecure:t.allowInsecure??t.allow_insecure??!1,...t.realmId!==void 0?{realmId:t.realmId}:{},...t.homeInstanceURL!==void 0?{homeInstanceURL:t.homeInstanceURL}:{}}}catch{return null}}function lP(e){typeof localStorage>"u"||localStorage.setItem(dl,JSON.stringify(e))}function sP(){typeof localStorage>"u"||localStorage.removeItem(dl)}function cP(e,t){const o=e.trim();if(!o)return fo("setup.errors.relayUrlRequired");let r;try{r=new URL(o)}catch{return fo("setup.errors.invalidRelayUrl")}return r.protocol!=="http:"&&r.protocol!=="https:"?fo("setup.errors.relayUrlMustBeHttp"):r.pathname!=="/"||r.search!==""||r.hash!==""?fo("setup.errors.relayUrlNoPath"):r.protocol==="http:"&&!nm(r.hostname)&&!t?fo("setup.errors.useInsecureForHttp"):null}function nm(e){const t=e.toLowerCase();return!!(t==="localhost"||t==="127.0.0.1"||t==="::1"||t.startsWith("127.")||t.startsWith("[")&&t.endsWith("]")&&t.slice(1,-1)==="::1")}const dP=(e,t)=>{const o=e.__vccOpts||e;for(const[r,n]of t)o[r]=n;return o};function im(e){let t=".",o="__",r="--",n;if(e){let f=e.blockPrefix;f&&(t=f),f=e.elementPrefix,f&&(o=f),f=e.modifierPrefix,f&&(r=f)}const i={install(f){n=f.c;const g=f.context;g.bem={},g.bem.b=null,g.bem.els=null}};function a(f){let g,S;return{before(v){g=v.bem.b,S=v.bem.els,v.bem.els=null},after(v){v.bem.b=g,v.bem.els=S},$({context:v,props:$}){return f=typeof f=="string"?f:f({context:v,props:$}),v.bem.b=f,`${($==null?void 0:$.bPrefix)||t}${v.bem.b}`}}}function l(f){let g;return{before(S){g=S.bem.els},after(S){S.bem.els=g},$({context:S,props:v}){return f=typeof f=="string"?f:f({context:S,props:v}),S.bem.els=f.split(",").map($=>$.trim()),S.bem.els.map($=>`${(v==null?void 0:v.bPrefix)||t}${S.bem.b}${o}${$}`).join(", ")}}}function s(f){return{$({context:g,props:S}){f=typeof f=="string"?f:f({context:g,props:S});const v=f.split(",").map(w=>w.trim());function $(w){return v.map(E=>`&${(S==null?void 0:S.bPrefix)||t}${g.bem.b}${w!==void 0?`${o}${w}`:""}${r}${E}`).join(", ")}const T=g.bem.els;return T!==null?$(T[0]):$()}}}function c(f){return{$({context:g,props:S}){f=typeof f=="string"?f:f({context:g,props:S});const v=g.bem.els;return`&:not(${(S==null?void 0:S.bPrefix)||t}${g.bem.b}${v!==null&&v.length>0?`${o}${v[0]}`:""}${r}${f})`}}}return Object.assign(i,{cB:(...f)=>n(a(f[0]),f[1],f[2]),cE:(...f)=>n(l(f[0]),f[1],f[2]),cM:(...f)=>n(s(f[0]),f[1],f[2]),cNotM:(...f)=>n(c(f[0]),f[1],f[2])}),i}function am(e){let t=0;for(let o=0;o{let n=am(r);if(n){if(n===1){e.forEach(a=>{o.push(r.replace("&",a))});return}}else{e.forEach(a=>{o.push((a&&a+" ")+r)});return}let i=[r];for(;n--;){const a=[];i.forEach(l=>{e.forEach(s=>{a.push(l.replace("&",s))})}),i=a}i.forEach(a=>o.push(a))}),o}function cm(e,t){const o=[];return t.split(kd).forEach(r=>{e.forEach(n=>{o.push((n&&n+" ")+r)})}),o}function dm(e){let t=[""];return e.forEach(o=>{o=o&&o.trim(),o&&(o.includes("&")?t=sm(t,o):t=cm(t,o))}),t.join(", ").replace(lm," ")}function ps(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}function Ai(e,t){return(t??document.head).querySelector(`style[cssr-id="${e}"]`)}function um(e){const t=document.createElement("style");return t.setAttribute("cssr-id",e),t}function Ln(e){return e?/^\s*@(s|m)/.test(e):!1}const fm=/[A-Z]/g;function Dd(e){return e.replace(fm,t=>"-"+t.toLowerCase())}function pm(e,t=" "){return typeof e=="object"&&e!==null?` { `+Object.entries(e).map(o=>t+` ${Dd(o[0])}: ${o[1]};`).join(` `)+` `+t+"}":`: ${e};`}function hm(e,t,o){return typeof e=="function"?e({context:t.context,props:o}):e}function hs(e,t,o,r){if(!t)return"";const n=hm(t,o,r);if(!n)return"";if(typeof n=="string")return`${e} { @@ -28,9 +28,9 @@ ${n} `);return}l=Dd(l),s!=null&&a.push(` ${l}${pm(s)}`)}),e&&a.push("}"),a.join(` `)}function Pa(e,t,o){e&&e.forEach(r=>{if(Array.isArray(r))Pa(r,t,o);else if(typeof r=="function"){const n=r(t);Array.isArray(n)?Pa(n,t,o):n&&o(n)}else r&&o(r)})}function Od(e,t,o,r,n){const i=e.$;let a="";if(!i||typeof i=="string")Ln(i)?a=i:t.push(i);else if(typeof i=="function"){const c=i({context:r.context,props:n});Ln(c)?a=c:t.push(c)}else if(i.before&&i.before(r.context),!i.$||typeof i.$=="string")Ln(i.$)?a=i.$:t.push(i.$);else if(i.$){const c=i.$({context:r.context,props:n});Ln(c)?a=c:t.push(c)}const l=dm(t),s=hs(l,e.props,r,n);a?o.push(`${a} {`):s.length&&o.push(s),e.children&&Pa(e.children,{context:r.context,props:n},c=>{if(typeof c=="string"){const d=hs(l,{raw:c},r,n);o.push(d)}else Od(c,t,o,r,n)}),t.pop(),a&&o.push("}"),i&&i.after&&i.after(r.context)}function gm(e,t,o){const r=[];return Od(e,[],r,t,o),r.join(` -`)}function fn(e){for(var t=0,o,r=0,n=e.length;n>=4;++r,n-=4)o=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,o=(o&65535)*1540483477+((o>>>16)*59797<<16),o^=o>>>24,t=(o&65535)*1540483477+((o>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(n){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function mm(e,t,o,r){const{els:n}=t;if(o===void 0)n.forEach(ps),t.els=[];else{const i=Ai(o,r);i&&n.includes(i)&&(ps(i),t.els=n.filter(a=>a!==i))}}function gs(e,t){e.push(t)}function bm(e,t,o,r,n,i,a,l,s){let c;if(o===void 0&&(c=t.render(r),o=fn(c)),s){s.adapter(o,c??t.render(r));return}l===void 0&&(l=document.head);const d=Ai(o,l);if(d!==null&&!i)return d;const u=d??um(o);if(c===void 0&&(c=t.render(r)),u.textContent=c,d!==null)return d;if(a){const p=l.querySelector(`meta[name="${a}"]`);if(p)return l.insertBefore(u,p),gs(t.els,u),u}return n?l.insertBefore(u,l.querySelector("style, link")):l.appendChild(u),gs(t.els,u),u}function vm(e){return gm(this,this.instance,e)}function xm(e={}){const{id:t,ssr:o,props:r,head:n=!1,force:i=!1,anchorMetaName:a,parent:l}=e;return bm(this.instance,this,t,r,n,i,a,l,o)}function Cm(e={}){const{id:t,parent:o}=e;mm(this.instance,this,t,o)}const Wn=function(e,t,o,r){return{instance:e,$:t,props:o,children:r,els:[],render:vm,mount:xm,unmount:Cm}},ym=function(e,t,o,r){return Array.isArray(t)?Wn(e,{$:null},null,t):Array.isArray(o)?Wn(e,t,null,o):Array.isArray(r)?Wn(e,t,o,r):Wn(e,t,o,null)};function Sm(e={}){const t={c:(...o)=>ym(t,...o),use:(o,...r)=>o.install(t,...r),find:Ai,context:{},config:e};return t}function wm(e,t){if(e===void 0)return!1;if(t){const{context:{ids:o}}=t;return o.has(e)}return Ai(e)!==null}const Pm="n",pn=`.${Pm}-`,Tm="__",$m="--",Bd=Sm(),Ld=im({blockPrefix:pn,elementPrefix:Tm,modifierPrefix:$m});Bd.use(Ld);const{c:L,find:uP}=Bd,{cB:pe,cE:V,cM:re,cNotM:Po}=Ld;function Rm(e){return L(({props:{bPrefix:t}})=>`${t||pn}modal, ${t||pn}drawer`,[e])}function Fm(e){return L(({props:{bPrefix:t}})=>`${t||pn}popover`,[e])}function Am(e){return L(({props:{bPrefix:t}})=>`&${t||pn}modal`,e)}const fP=(...e)=>L(">",[pe(...e)]);function ae(e,t){return e+(t==="default"?"":t.replace(/^[a-z]/,o=>o.toUpperCase()))}function Im(e){return e.composedPath()[0]||null}function ms(e){return typeof e=="string"?e.endsWith("px")?Number(e.slice(0,e.length-2)):Number(e):e}function pP(e){if(e!=null)return typeof e=="number"?`${e}px`:e.endsWith("px")?e:`${e}px`}function Vo(e,t){const o=e.trim().split(/\s+/g),r={top:o[0]};switch(o.length){case 1:r.right=o[0],r.bottom=o[0],r.left=o[0];break;case 2:r.right=o[1],r.left=o[1],r.bottom=o[0];break;case 3:r.right=o[1],r.bottom=o[2],r.left=o[1];break;case 4:r.right=o[1],r.bottom=o[2],r.left=o[3];break;default:throw new Error("[seemly/getMargin]:"+e+" is not a valid value.")}return t===void 0?r:r[t]}function hP(e,t){const[o,r]=e.split(" ");return{row:o,col:r||o}}const bs={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#F0F",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#F00",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32",transparent:"#0000"};function _m(e,t,o){t/=100,o/=100;let r=(n,i=(n+e/60)%6)=>o-o*t*Math.max(Math.min(i,4-i,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function Em(e,t,o){t/=100,o/=100;let r=t*Math.min(o,1-o),n=(i,a=(i+e/30)%12)=>o-r*Math.max(Math.min(a-3,9-a,1),-1);return[n(0)*255,n(8)*255,n(4)*255]}const eo="^\\s*",to="\\s*$",Ao="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Ft="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",Uo="([0-9A-Fa-f])",qo="([0-9A-Fa-f]{2})",Wd=new RegExp(`${eo}hsl\\s*\\(${Ft},${Ao},${Ao}\\)${to}`),jd=new RegExp(`${eo}hsv\\s*\\(${Ft},${Ao},${Ao}\\)${to}`),Nd=new RegExp(`${eo}hsla\\s*\\(${Ft},${Ao},${Ao},${Ft}\\)${to}`),Vd=new RegExp(`${eo}hsva\\s*\\(${Ft},${Ao},${Ao},${Ft}\\)${to}`),Mm=new RegExp(`${eo}rgb\\s*\\(${Ft},${Ft},${Ft}\\)${to}`),zm=new RegExp(`${eo}rgba\\s*\\(${Ft},${Ft},${Ft},${Ft}\\)${to}`),Hm=new RegExp(`${eo}#${Uo}${Uo}${Uo}${to}`),km=new RegExp(`${eo}#${qo}${qo}${qo}${to}`),Dm=new RegExp(`${eo}#${Uo}${Uo}${Uo}${Uo}${to}`),Om=new RegExp(`${eo}#${qo}${qo}${qo}${qo}${to}`);function yt(e){return parseInt(e,16)}function Bm(e){try{let t;if(t=Nd.exec(e))return[fi(t[1]),To(t[5]),To(t[9]),Jo(t[13])];if(t=Wd.exec(e))return[fi(t[1]),To(t[5]),To(t[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${e}.`)}catch(t){throw t}}function Lm(e){try{let t;if(t=Vd.exec(e))return[fi(t[1]),To(t[5]),To(t[9]),Jo(t[13])];if(t=jd.exec(e))return[fi(t[1]),To(t[5]),To(t[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${e}.`)}catch(t){throw t}}function ho(e){try{let t;if(t=km.exec(e))return[yt(t[1]),yt(t[2]),yt(t[3]),1];if(t=Mm.exec(e))return[ft(t[1]),ft(t[5]),ft(t[9]),1];if(t=zm.exec(e))return[ft(t[1]),ft(t[5]),ft(t[9]),Jo(t[13])];if(t=Hm.exec(e))return[yt(t[1]+t[1]),yt(t[2]+t[2]),yt(t[3]+t[3]),1];if(t=Om.exec(e))return[yt(t[1]),yt(t[2]),yt(t[3]),Jo(yt(t[4])/255)];if(t=Dm.exec(e))return[yt(t[1]+t[1]),yt(t[2]+t[2]),yt(t[3]+t[3]),Jo(yt(t[4]+t[4])/255)];if(e in bs)return ho(bs[e]);if(Wd.test(e)||Nd.test(e)){const[o,r,n,i]=Bm(e);return[...Em(o,r,n),i]}else if(jd.test(e)||Vd.test(e)){const[o,r,n,i]=Lm(e);return[..._m(o,r,n),i]}throw new Error(`[seemly/rgba]: Invalid color value ${e}.`)}catch(t){throw t}}function Wm(e){return e>1?1:e<0?0:e}function Ta(e,t,o,r){return`rgba(${ft(e)}, ${ft(t)}, ${ft(o)}, ${Wm(r)})`}function Qi(e,t,o,r,n){return ft((e*t*(1-r)+o*r)/n)}function ee(e,t){Array.isArray(e)||(e=ho(e)),Array.isArray(t)||(t=ho(t));const o=e[3],r=t[3],n=Jo(o+r-o*r);return Ta(Qi(e[0],o,t[0],r,n),Qi(e[1],o,t[1],r,n),Qi(e[2],o,t[2],r,n),n)}function K(e,t){const[o,r,n,i=1]=Array.isArray(e)?e:ho(e);return typeof t.alpha=="number"?Ta(o,r,n,t.alpha):Ta(o,r,n,i)}function Ne(e,t){const[o,r,n,i=1]=Array.isArray(e)?e:ho(e),{lightness:a=1,alpha:l=1}=t;return jm([o*a,r*a,n*a,i*l])}function Jo(e){const t=Math.round(Number(e)*100)/100;return t>1?1:t<0?0:t}function fi(e){const t=Math.round(Number(e));return t>=360||t<0?0:t}function ft(e){const t=Math.round(Number(e));return t>255?255:t<0?0:t}function To(e){const t=Math.round(Number(e));return t>100?100:t<0?0:t}function jm(e){const[t,o,r]=e;return 3 in e?`rgba(${ft(t)}, ${ft(o)}, ${ft(r)}, ${Jo(e[3])})`:`rgba(${ft(t)}, ${ft(o)}, ${ft(r)}, 1)`}function $a(e=8){return Math.random().toString(16).slice(2,2+e)}function gP(e,t){const o=[];for(let r=0;r{t.contains(Qn(n))||o(n)};return{mousemove:r,touchstart:r}}else if(e==="clickoutside"){let r=!1;const n=a=>{r=!t.contains(Qn(a))},i=a=>{r&&(t.contains(Qn(a))||o(a))};return{mousedown:n,mouseup:i,touchstart:n,touchend:i}}return console.error(`[evtd/create-trap-handler]: name \`${e}\` is invalid. This could be a bug of evtd.`),{}}function Ud(e,t,o){const r=Nm[e];let n=r.get(t);n===void 0&&r.set(t,n=new WeakMap);let i=n.get(o);return i===void 0&&n.set(o,i=Vm(e,t,o)),i}function Um(e,t,o,r){if(e==="mousemoveoutside"||e==="clickoutside"){const n=Ud(e,t,o);return Object.keys(n).forEach(i=>{Go(i,document,n[i],r)}),!0}return!1}function qm(e,t,o,r){if(e==="mousemoveoutside"||e==="clickoutside"){const n=Ud(e,t,o);return Object.keys(n).forEach(i=>{lo(i,document,n[i],r)}),!0}return!1}function Gm(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const e=new WeakMap,t=new WeakMap;function o(){e.set(this,!0)}function r(){e.set(this,!0),t.set(this,!0)}function n(x,F,R){const B=x[F];return x[F]=function(){return R.apply(x,arguments),B.apply(x,arguments)},x}function i(x,F){x[F]=Event.prototype[F]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function s(){var x;return(x=a.get(this))!==null&&x!==void 0?x:null}function c(x,F){l!==void 0&&Object.defineProperty(x,"currentTarget",{configurable:!0,enumerable:!0,get:F??l.get})}const d={bubble:{},capture:{}},u={};function p(){const x=function(F){const{type:R,eventPhase:B,bubbles:j}=F,A=Qn(F);if(B===2)return;const J=B===1?"capture":"bubble";let G=A;const le=[];for(;G===null&&(G=window),le.push(G),G!==window;)G=G.parentNode||null;const te=d.capture[R],N=d.bubble[R];if(n(F,"stopPropagation",o),n(F,"stopImmediatePropagation",r),c(F,s),J==="capture"){if(te===void 0)return;for(let oe=le.length-1;oe>=0&&!e.has(F);--oe){const ye=le[oe],Pe=te.get(ye);if(Pe!==void 0){a.set(F,ye);for(const Re of Pe){if(t.has(F))break;Re(F)}}if(oe===0&&!j&&N!==void 0){const Re=N.get(ye);if(Re!==void 0)for(const Fe of Re){if(t.has(F))break;Fe(F)}}}}else if(J==="bubble"){if(N===void 0)return;for(let oe=0;oeA(F))};return x.displayName="evtdUnifiedWindowEventHandler",x}const f=p(),g=m();function S(x,F){const R=d[x];return R[F]===void 0&&(R[F]=new Map,window.addEventListener(F,f,x==="capture")),R[F]}function v(x){return u[x]===void 0&&(u[x]=new Set,window.addEventListener(x,g)),u[x]}function $(x,F){let R=x.get(F);return R===void 0&&x.set(F,R=new Set),R}function T(x,F,R,B){const j=d[F][R];if(j!==void 0){const A=j.get(x);if(A!==void 0&&A.has(B))return!0}return!1}function w(x,F){const R=u[x];return!!(R!==void 0&&R.has(F))}function _(x,F,R,B){let j;if(typeof B=="object"&&B.once===!0?j=te=>{O(x,F,j,B),R(te)}:j=R,Um(x,F,j,B))return;const J=B===!0||typeof B=="object"&&B.capture===!0?"capture":"bubble",G=S(J,x),le=$(G,F);if(le.has(j)||le.add(j),F===window){const te=v(x);te.has(j)||te.add(j)}}function O(x,F,R,B){if(qm(x,F,R,B))return;const A=B===!0||typeof B=="object"&&B.capture===!0,J=A?"capture":"bubble",G=S(J,x),le=$(G,F);if(F===window&&!T(F,A?"bubble":"capture",x,R)&&w(x,R)){const N=u[x];N.delete(R),N.size===0&&(window.removeEventListener(x,g),u[x]=void 0)}le.has(R)&&le.delete(R),le.size===0&&G.delete(F),G.size===0&&(window.removeEventListener(x,f,J==="capture"),d[J][x]=void 0)}return{on:_,off:O}}const{on:Go,off:lo}=Gm();function hn(e){const t=Y(e),o=fe(t.value);return Zt(t,r=>{o.value=r}),typeof e=="function"?o:{__v_isRef:!0,get value(){return o.value},set value(r){e.set(r)}}}function Km(e,t){return Zt(e,o=>{o!==void 0&&(t.value=o)}),Y(()=>e.value===void 0?t.value:e.value)}function Ym(){const e=fe(!1);return Mo(()=>{e.value=!0}),el(e)}const Xm=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function Jm(){return Xm}function mP(e){return e}function Zm(e,t,o){var r;const n=Le(e,null);if(n===null)return;const i=(r=Sn())===null||r===void 0?void 0:r.proxy;Zt(o,a),a(o.value),nr(()=>{a(void 0,o.value)});function a(c,d){if(!n)return;const u=n[t];d!==void 0&&l(u,d),c!==void 0&&s(u,c)}function l(c,d){c[d]||(c[d]=[]),c[d].splice(c[d].findIndex(u=>u===i),1)}function s(c,d){c[d]||(c[d]=[]),~c[d].findIndex(u=>u===i)||c[d].push(i)}}const Ii=typeof document<"u"&&typeof window<"u";function Qm(e){const t={isDeactivated:!1};let o=!1;return Kc(()=>{if(t.isDeactivated=!1,!o){o=!0;return}e()}),Yc(()=>{t.isDeactivated=!0,o||(o=!0)}),t}const eb="@css-render/vue3-ssr";function tb(e,t){return``}function ob(e,t,o){const{styles:r,ids:n}=o;n.has(e)||r!==null&&(n.add(e),r.push(tb(e,t)))}const rb=typeof document<"u";function _i(){if(rb)return;const e=Le(eb,null);if(e!==null)return{adapter:(t,o)=>ob(t,o,e),context:e}}function vs(e,t){console.error(`[vueuc/${e}]: ${t}`)}var Zo=[],nb=function(){return Zo.some(function(e){return e.activeTargets.length>0})},ib=function(){return Zo.some(function(e){return e.skippedTargets.length>0})},xs="ResizeObserver loop completed with undelivered notifications.",ab=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:xs}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=xs),window.dispatchEvent(e)},gn;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(gn||(gn={}));var Qo=function(e){return Object.freeze(e)},lb=function(){function e(t,o){this.inlineSize=t,this.blockSize=o,Qo(this)}return e}(),qd=function(){function e(t,o,r,n){return this.x=t,this.y=o,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Qo(this)}return e.prototype.toJSON=function(){var t=this,o=t.x,r=t.y,n=t.top,i=t.right,a=t.bottom,l=t.left,s=t.width,c=t.height;return{x:o,y:r,top:n,right:i,bottom:a,left:l,width:s,height:c}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),ul=function(e){return e instanceof SVGElement&&"getBBox"in e},Gd=function(e){if(ul(e)){var t=e.getBBox(),o=t.width,r=t.height;return!o&&!r}var n=e,i=n.offsetWidth,a=n.offsetHeight;return!(i||a||e.getClientRects().length)},Cs=function(e){var t;if(e instanceof Element)return!0;var o=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(o&&e instanceof o.Element)},sb=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},Zr=typeof window<"u"?window:{},jn=new WeakMap,ys=/auto|scroll/,cb=/^tb|vertical/,db=/msie|trident/i.test(Zr.navigator&&Zr.navigator.userAgent),Vt=function(e){return parseFloat(e||"0")},vr=function(e,t,o){return e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=!1),new lb((o?t:e)||0,(o?e:t)||0)},Ss=Qo({devicePixelContentBoxSize:vr(),borderBoxSize:vr(),contentBoxSize:vr(),contentRect:new qd(0,0,0,0)}),Kd=function(e,t){if(t===void 0&&(t=!1),jn.has(e)&&!t)return jn.get(e);if(Gd(e))return jn.set(e,Ss),Ss;var o=getComputedStyle(e),r=ul(e)&&e.ownerSVGElement&&e.getBBox(),n=!db&&o.boxSizing==="border-box",i=cb.test(o.writingMode||""),a=!r&&ys.test(o.overflowY||""),l=!r&&ys.test(o.overflowX||""),s=r?0:Vt(o.paddingTop),c=r?0:Vt(o.paddingRight),d=r?0:Vt(o.paddingBottom),u=r?0:Vt(o.paddingLeft),p=r?0:Vt(o.borderTopWidth),m=r?0:Vt(o.borderRightWidth),f=r?0:Vt(o.borderBottomWidth),g=r?0:Vt(o.borderLeftWidth),S=u+c,v=s+d,$=g+m,T=p+f,w=l?e.offsetHeight-T-e.clientHeight:0,_=a?e.offsetWidth-$-e.clientWidth:0,O=n?S+$:0,x=n?v+T:0,F=r?r.width:Vt(o.width)-O-_,R=r?r.height:Vt(o.height)-x-w,B=F+S+_+$,j=R+v+w+T,A=Qo({devicePixelContentBoxSize:vr(Math.round(F*devicePixelRatio),Math.round(R*devicePixelRatio),i),borderBoxSize:vr(B,j,i),contentBoxSize:vr(F,R,i),contentRect:new qd(u,s,F,R)});return jn.set(e,A),A},Yd=function(e,t,o){var r=Kd(e,o),n=r.borderBoxSize,i=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case gn.DEVICE_PIXEL_CONTENT_BOX:return a;case gn.BORDER_BOX:return n;default:return i}},ub=function(){function e(t){var o=Kd(t);this.target=t,this.contentRect=o.contentRect,this.borderBoxSize=Qo([o.borderBoxSize]),this.contentBoxSize=Qo([o.contentBoxSize]),this.devicePixelContentBoxSize=Qo([o.devicePixelContentBoxSize])}return e}(),Xd=function(e){if(Gd(e))return 1/0;for(var t=0,o=e.parentNode;o;)t+=1,o=o.parentNode;return t},fb=function(){var e=1/0,t=[];Zo.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(c){var d=new ub(c.target),u=Xd(c.target);l.push(d),c.lastReportedSize=Yd(c.target,c.observedBox),ue?o.activeTargets.push(n):o.skippedTargets.push(n))})})},pb=function(){var e=0;for(ws(e);nb();)e=fb(),ws(e);return ib()&&ab(),e>0},ea,Jd=[],hb=function(){return Jd.splice(0).forEach(function(e){return e()})},gb=function(e){if(!ea){var t=0,o=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return hb()}).observe(o,r),ea=function(){o.textContent="".concat(t?t--:t++)}}Jd.push(e),ea()},mb=function(e){gb(function(){requestAnimationFrame(e)})},ei=0,bb=function(){return!!ei},vb=250,xb={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ps=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Ts=function(e){return e===void 0&&(e=0),Date.now()+e},ta=!1,Cb=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var o=this;if(t===void 0&&(t=vb),!ta){ta=!0;var r=Ts(t);mb(function(){var n=!1;try{n=pb()}finally{if(ta=!1,t=r-Ts(),!bb())return;n?o.run(1e3):t>0?o.run(t):o.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,o=function(){return t.observer&&t.observer.observe(document.body,xb)};document.body?o():Zr.addEventListener("DOMContentLoaded",o)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ps.forEach(function(o){return Zr.addEventListener(o,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Ps.forEach(function(o){return Zr.removeEventListener(o,t.listener,!0)}),this.stopped=!0)},e}(),Ra=new Cb,$s=function(e){!ei&&e>0&&Ra.start(),ei+=e,!ei&&Ra.stop()},yb=function(e){return!ul(e)&&!sb(e)&&getComputedStyle(e).display==="inline"},Sb=function(){function e(t,o){this.target=t,this.observedBox=o||gn.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=Yd(this.target,this.observedBox,!0);return yb(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),wb=function(){function e(t,o){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=o}return e}(),Nn=new WeakMap,Rs=function(e,t){for(var o=0;o=0&&(i&&Zo.splice(Zo.indexOf(r),1),r.observationTargets.splice(n,1),$s(-1))},e.disconnect=function(t){var o=this,r=Nn.get(t);r.observationTargets.slice().forEach(function(n){return o.unobserve(t,n.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Pb=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Vn.connect(this,t)}return e.prototype.observe=function(t,o){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Cs(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Vn.observe(this,t,o)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Cs(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Vn.unobserve(this,t)},e.prototype.disconnect=function(){Vn.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();class Tb{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Pb)(this.handleResize),this.elHandlersMap=new Map}handleResize(t){for(const o of t){const r=this.elHandlersMap.get(o.target);r!==void 0&&r(o)}}registerHandler(t,o){this.elHandlersMap.set(t,o),this.observer.observe(t)}unregisterHandler(t){this.elHandlersMap.has(t)&&(this.elHandlersMap.delete(t),this.observer.unobserve(t))}}const Fs=new Tb,Fa=He({name:"ResizeObserver",props:{onResize:Function},setup(e){let t=!1;const o=Sn().proxy;function r(n){const{onResize:i}=e;i!==void 0&&i(n)}Mo(()=>{const n=o.$el;if(n===void 0){vs("resize-observer","$el does not exist.");return}if(n.nextElementSibling!==n.nextSibling&&n.nodeType===3&&n.nodeValue!==""){vs("resize-observer","$el can not be observed (it may be a text node).");return}n.nextElementSibling!==null&&(Fs.registerHandler(n.nextElementSibling,r),t=!0)}),nr(()=>{t&&Fs.unregisterHandler(o.$el.nextElementSibling)})},render(){return vh(this.$slots,"default")}});function As(e){return e.replace(/#|\(|\)|,|\s|\./g,"_")}const $b=/^(\d|\.)+$/,Is=/(\d|\.)+/;function oa(e,{c:t=1,offset:o=0,attachPx:r=!0}={}){if(typeof e=="number"){const n=(e+o)*t;return n===0?"0":`${n}px`}else if(typeof e=="string")if($b.test(e)){const n=(Number(e)+o)*t;return r?n===0?"0":`${n}px`:`${n}`}else{const n=Is.exec(e);return n?e.replace(Is,String((Number(n[0])+o)*t)):e}return e}function _s(e){const{left:t,right:o,top:r,bottom:n}=Vo(e);return`${r} ${t} ${n} ${o}`}function Aa(e,t){console.error(`[naive/${e}]: ${t}`)}function Rb(e,t){throw new Error(`[naive/${e}]: ${t}`)}function Ke(e,...t){if(Array.isArray(e))e.forEach(o=>Ke(o,...t));else return e(...t)}function Es(e){return Object.keys(e)}function Fb(e,t=[],o){const r={};return Object.getOwnPropertyNames(e).forEach(i=>{t.includes(i)||(r[i]=e[i])}),Object.assign(r,o)}function Ab(e,...t){return typeof e=="function"?e(...t):typeof e=="string"?xa(e):typeof e=="number"?xa(String(e)):null}function kt(e){return e.some(t=>Cr(t)?!(t.type===pt||t.type===et&&!kt(t.children)):!0)?e:null}function Qr(e,t){return e&&kt(e())||t()}function Ib(e,t,o){return e&&kt(e(t))||o(t)}function $t(e,t){const o=e&&kt(e());return t(o||null)}function _b(e){return!(e&&kt(e()))}const Ms=He({render(){var e,t;return(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)}}),Qt="n-config-provider",pi="n";function zo(e={},t={defaultBordered:!0}){const o=Le(Qt,null);return{inlineThemeDisabled:o==null?void 0:o.inlineThemeDisabled,mergedRtlRef:o==null?void 0:o.mergedRtlRef,mergedComponentPropsRef:o==null?void 0:o.mergedComponentPropsRef,mergedBreakpointsRef:o==null?void 0:o.mergedBreakpointsRef,mergedBorderedRef:Y(()=>{var r,n;const{bordered:i}=e;return i!==void 0?i:(n=(r=o==null?void 0:o.mergedBorderedRef.value)!==null&&r!==void 0?r:t.defaultBordered)!==null&&n!==void 0?n:!0}),mergedClsPrefixRef:o?o.mergedClsPrefixRef:Ac(pi),namespaceRef:Y(()=>o==null?void 0:o.mergedNamespaceRef.value)}}function bP(){const e=Le(Qt,null);return e?e.mergedClsPrefixRef:Ac(pi)}function Fr(e,t,o,r){o||Rb("useThemeClass","cssVarsRef is not passed");const n=Le(Qt,null),i=n==null?void 0:n.mergedThemeHashRef,a=n==null?void 0:n.styleMountTarget,l=fe(""),s=_i();let c;const d=`__${e}`,u=()=>{let p=d;const m=t?t.value:void 0,f=i==null?void 0:i.value;f&&(p+=`-${f}`),m&&(p+=`-${m}`);const{themeOverrides:g,builtinThemeOverrides:S}=r;g&&(p+=`-${fn(JSON.stringify(g))}`),S&&(p+=`-${fn(JSON.stringify(S))}`),l.value=p,c=()=>{const v=o.value;let $="";for(const T in v)$+=`${T}: ${v[T]};`;L(`.${p}`,$).mount({id:p,ssr:s,parent:a}),c=void 0}};return sn(()=>{u()}),{themeClass:l,onRender:()=>{c==null||c()}}}const Ia="n-form-item";function Zd(e,{defaultSize:t="medium",mergedSize:o,mergedDisabled:r}={}){const n=Le(Ia,null);po(Ia,null);const i=Y(o?()=>o(n):()=>{const{size:s}=e;if(s)return s;if(n){const{mergedSize:c}=n;if(c.value!==void 0)return c.value}return t}),a=Y(r?()=>r(n):()=>{const{disabled:s}=e;return s!==void 0?s:n?n.disabled.value:!1}),l=Y(()=>{const{status:s}=e;return s||(n==null?void 0:n.mergedValidationStatus.value)});return nr(()=>{n&&n.restoreValidation()}),{mergedSizeRef:i,mergedDisabledRef:a,mergedStatusRef:l,nTriggerFormBlur(){n&&n.handleContentBlur()},nTriggerFormChange(){n&&n.handleContentChange()},nTriggerFormFocus(){n&&n.handleContentFocus()},nTriggerFormInput(){n&&n.handleContentInput()}}}const Qd={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:e=>`Please load all ${e}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:e=>`Total ${e} items`,selected:e=>`${e} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"}},Eb={name:"zh-CN",global:{undo:"撤销",redo:"重做",confirm:"确认",clear:"清除"},Popconfirm:{positiveText:"确认",negativeText:"取消"},Cascader:{placeholder:"请选择",loading:"加载中",loadingRequiredMessage:e=>`加载全部 ${e} 的子节点后才可选中`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy年",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w周",clear:"清除",now:"此刻",confirm:"确认",selectTime:"选择时间",selectDate:"选择日期",datePlaceholder:"选择日期",datetimePlaceholder:"选择日期时间",monthPlaceholder:"选择月份",yearPlaceholder:"选择年份",quarterPlaceholder:"选择季度",weekPlaceholder:"选择周",startDatePlaceholder:"开始日期",endDatePlaceholder:"结束日期",startDatetimePlaceholder:"开始日期时间",endDatetimePlaceholder:"结束日期时间",startMonthPlaceholder:"开始月份",endMonthPlaceholder:"结束月份",monthBeforeYear:!1,firstDayOfWeek:0,today:"今天"},DataTable:{checkTableAll:"选择全部表格数据",uncheckTableAll:"取消选择全部表格数据",confirm:"确认",clear:"重置"},LegacyTransfer:{sourceTitle:"源项",targetTitle:"目标项"},Transfer:{selectAll:"全选",clearAll:"清除",unselectAll:"取消全选",total:e=>`共 ${e} 项`,selected:e=>`已选 ${e} 项`},Empty:{description:"无数据"},Select:{placeholder:"请选择"},TimePicker:{placeholder:"请选择时间",positiveText:"确认",negativeText:"取消",now:"此刻",clear:"清除"},Pagination:{goto:"跳至",selectionSuffix:"页"},DynamicTags:{add:"添加"},Log:{loading:"加载中"},Input:{placeholder:"请输入"},InputNumber:{placeholder:"请输入"},DynamicInput:{create:"添加"},ThemeEditor:{title:"主题编辑器",clearAllVars:"清除全部变量",clearSearch:"清除搜索",filterCompName:"过滤组件名",filterVarName:"过滤变量名",import:"导入",export:"导出",restore:"恢复默认"},Image:{tipPrevious:"上一张(←)",tipNext:"下一张(→)",tipCounterclockwise:"向左旋转",tipClockwise:"向右旋转",tipZoomOut:"缩小",tipZoomIn:"放大",tipDownload:"下载",tipClose:"关闭(Esc)",tipOriginalSize:"缩放到原始尺寸"}};function xr(e){return(t={})=>{const o=t.width?String(t.width):e.defaultWidth;return e.formats[o]||e.formats[e.defaultWidth]}}function Yt(e){return(t,o)=>{const r=o!=null&&o.context?String(o.context):"standalone";let n;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=o!=null&&o.width?String(o.width):a;n=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=o!=null&&o.width?String(o.width):e.defaultWidth;n=e.values[l]||e.values[a]}const i=e.argumentCallback?e.argumentCallback(t):t;return n[i]}}function Xt(e){return(t,o={})=>{const r=o.width,n=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(n);if(!i)return null;const a=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(l)?zb(l,u=>u.test(a)):Mb(l,u=>u.test(a));let c;c=e.valueCallback?e.valueCallback(s):s,c=o.valueCallback?o.valueCallback(c):c;const d=t.slice(a.length);return{value:c,rest:d}}}function Mb(e,t){for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t(e[o]))return o}function zb(e,t){for(let o=0;o{const r=t.match(e.matchPattern);if(!r)return null;const n=r[0],i=t.match(e.parsePattern);if(!i)return null;let a=e.valueCallback?e.valueCallback(i[0]):i[0];a=o.valueCallback?o.valueCallback(a):a;const l=t.slice(n.length);return{value:a,rest:l}}}function Hb(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}let kb={};function Db(){return kb}function zs(e,t){var l,s,c,d;const o=Db(),r=(t==null?void 0:t.weekStartsOn)??((s=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:s.weekStartsOn)??o.weekStartsOn??((d=(c=o.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,n=Hb(e),i=n.getDay(),a=(i{let r;const n=Bb[e];return typeof n=="string"?r=n:t===1?r=n.one:r=n.other.replace("{{count}}",t.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+r:r+" ago":r},Wb={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},jb=(e,t,o,r)=>Wb[e],Nb={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Vb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ub={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},qb={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Gb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Kb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Yb=(e,t)=>{const o=Number(e),r=o%100;if(r>20||r<10)switch(r%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},Xb={ordinalNumber:Yb,era:Yt({values:Nb,defaultWidth:"wide"}),quarter:Yt({values:Vb,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Yt({values:Ub,defaultWidth:"wide"}),day:Yt({values:qb,defaultWidth:"wide"}),dayPeriod:Yt({values:Gb,defaultWidth:"wide",formattingValues:Kb,defaultFormattingWidth:"wide"})},Jb=/^(\d+)(th|st|nd|rd)?/i,Zb=/\d+/i,Qb={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ev={any:[/^b/i,/^(a|c)/i]},tv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ov={any:[/1/i,/2/i,/3/i,/4/i]},rv={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},nv={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},iv={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},av={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},lv={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},sv={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},cv={ordinalNumber:eu({matchPattern:Jb,parsePattern:Zb,valueCallback:e=>parseInt(e,10)}),era:Xt({matchPatterns:Qb,defaultMatchWidth:"wide",parsePatterns:ev,defaultParseWidth:"any"}),quarter:Xt({matchPatterns:tv,defaultMatchWidth:"wide",parsePatterns:ov,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Xt({matchPatterns:rv,defaultMatchWidth:"wide",parsePatterns:nv,defaultParseWidth:"any"}),day:Xt({matchPatterns:iv,defaultMatchWidth:"wide",parsePatterns:av,defaultParseWidth:"any"}),dayPeriod:Xt({matchPatterns:lv,defaultMatchWidth:"any",parsePatterns:sv,defaultParseWidth:"any"})},dv={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},uv={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},fv={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pv={date:xr({formats:dv,defaultWidth:"full"}),time:xr({formats:uv,defaultWidth:"full"}),dateTime:xr({formats:fv,defaultWidth:"full"})},hv={code:"en-US",formatDistance:Lb,formatLong:pv,formatRelative:jb,localize:Xb,match:cv,options:{weekStartsOn:0,firstWeekContainsDate:1}},gv={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},mv=(e,t,o)=>{let r;const n=gv[e];return typeof n=="string"?r=n:t===1?r=n.one:r=n.other.replace("{{count}}",String(t)),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?r+"内":r+"前":r},bv={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},vv={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},xv={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},Cv={date:xr({formats:bv,defaultWidth:"full"}),time:xr({formats:vv,defaultWidth:"full"}),dateTime:xr({formats:xv,defaultWidth:"full"})};function Hs(e,t,o){const r="eeee p";return Ob(e,t,o)?r:e.getTime()>t.getTime()?"'下个'"+r:"'上个'"+r}const yv={lastWeek:Hs,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:Hs,other:"PP p"},Sv=(e,t,o,r)=>{const n=yv[e];return typeof n=="function"?n(t,o,r):n},wv={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},Pv={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},Tv={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},$v={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},Rv={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},Fv={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},Av=(e,t)=>{const o=Number(e);switch(t==null?void 0:t.unit){case"date":return o.toString()+"日";case"hour":return o.toString()+"时";case"minute":return o.toString()+"分";case"second":return o.toString()+"秒";default:return"第 "+o.toString()}},Iv={ordinalNumber:Av,era:Yt({values:wv,defaultWidth:"wide"}),quarter:Yt({values:Pv,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Yt({values:Tv,defaultWidth:"wide"}),day:Yt({values:$v,defaultWidth:"wide"}),dayPeriod:Yt({values:Rv,defaultWidth:"wide",formattingValues:Fv,defaultFormattingWidth:"wide"})},_v=/^(第\s*)?\d+(日|时|分|秒)?/i,Ev=/\d+/i,Mv={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},zv={any:[/^(前)/i,/^(公元)/i]},Hv={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},kv={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},Dv={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},Ov={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},Bv={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},Lv={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},Wv={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},jv={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},Nv={ordinalNumber:eu({matchPattern:_v,parsePattern:Ev,valueCallback:e=>parseInt(e,10)}),era:Xt({matchPatterns:Mv,defaultMatchWidth:"wide",parsePatterns:zv,defaultParseWidth:"any"}),quarter:Xt({matchPatterns:Hv,defaultMatchWidth:"wide",parsePatterns:kv,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Xt({matchPatterns:Dv,defaultMatchWidth:"wide",parsePatterns:Ov,defaultParseWidth:"any"}),day:Xt({matchPatterns:Bv,defaultMatchWidth:"wide",parsePatterns:Lv,defaultParseWidth:"any"}),dayPeriod:Xt({matchPatterns:Wv,defaultMatchWidth:"any",parsePatterns:jv,defaultParseWidth:"any"})},Vv={code:"zh-CN",formatDistance:mv,formatLong:Cv,formatRelative:Sv,localize:Iv,match:Nv,options:{weekStartsOn:1,firstWeekContainsDate:4}},tu={name:"en-US",locale:hv},Uv={name:"zh-CN",locale:Vv};var ou=typeof global=="object"&&global&&global.Object===Object&&global,qv=typeof self=="object"&&self&&self.Object===Object&&self,Ar=ou||qv||Function("return this")(),wr=Ar.Symbol,ru=Object.prototype,Gv=ru.hasOwnProperty,Kv=ru.toString,jr=wr?wr.toStringTag:void 0;function Yv(e){var t=Gv.call(e,jr),o=e[jr];try{e[jr]=void 0;var r=!0}catch{}var n=Kv.call(e);return r&&(t?e[jr]=o:delete e[jr]),n}var Xv=Object.prototype,Jv=Xv.toString;function Zv(e){return Jv.call(e)}var Qv="[object Null]",e0="[object Undefined]",ks=wr?wr.toStringTag:void 0;function Tn(e){return e==null?e===void 0?e0:Qv:ks&&ks in Object(e)?Yv(e):Zv(e)}function Ir(e){return e!=null&&typeof e=="object"}var t0="[object Symbol]";function fl(e){return typeof e=="symbol"||Ir(e)&&Tn(e)==t0}function o0(e,t){for(var o=-1,r=e==null?0:e.length,n=Array(r);++o0){if(++t>=w0)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function R0(e){return function(){return e}}var hi=function(){try{var e=hl(Object,"defineProperty");return e({},"",{}),e}catch{}}(),F0=hi?function(e,t){return hi(e,"toString",{configurable:!0,enumerable:!1,value:R0(t),writable:!0})}:iu,A0=$0(F0),I0=9007199254740991,_0=/^(?:0|[1-9]\d*)$/;function au(e,t){var o=typeof e;return t=t??I0,!!t&&(o=="number"||o!="symbol"&&_0.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=O0}function ml(e){return e!=null&&lu(e.length)&&!pl(e)}function B0(e,t,o){if(!ir(o))return!1;var r=typeof t;return(r=="number"?ml(o)&&au(t,o.length):r=="string"&&t in o)?Ei(o[t],e):!1}function L0(e){return D0(function(t,o){var r=-1,n=o.length,i=n>1?o[n-1]:void 0,a=n>2?o[2]:void 0;for(i=e.length>3&&typeof i=="function"?(n--,i):void 0,a&&B0(o[0],o[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++r-1}function Xx(e,t){var o=this.__data__,r=Mi(o,e);return r<0?(++this.size,o.push([e,t])):o[r][1]=t,this}function mo(e){var t=-1,o=e==null?0:e.length;for(this.clear();++tn?0:n+t),o=o>n?n:o,o<0&&(o+=n),n=t>o?0:o-t>>>0,t>>>=0;for(var i=Array(n);++r=r?e:vC(e,t,o)}var CC="\\ud800-\\udfff",yC="\\u0300-\\u036f",SC="\\ufe20-\\ufe2f",wC="\\u20d0-\\u20ff",PC=yC+SC+wC,TC="\\ufe0e\\ufe0f",$C="\\u200d",RC=RegExp("["+$C+CC+PC+TC+"]");function Cu(e){return RC.test(e)}function FC(e){return e.split("")}var yu="\\ud800-\\udfff",AC="\\u0300-\\u036f",IC="\\ufe20-\\ufe2f",_C="\\u20d0-\\u20ff",EC=AC+IC+_C,MC="\\ufe0e\\ufe0f",zC="["+yu+"]",Ea="["+EC+"]",Ma="\\ud83c[\\udffb-\\udfff]",HC="(?:"+Ea+"|"+Ma+")",Su="[^"+yu+"]",wu="(?:\\ud83c[\\udde6-\\uddff]){2}",Pu="[\\ud800-\\udbff][\\udc00-\\udfff]",kC="\\u200d",Tu=HC+"?",$u="["+MC+"]?",DC="(?:"+kC+"(?:"+[Su,wu,Pu].join("|")+")"+$u+Tu+")*",OC=$u+Tu+DC,BC="(?:"+[Su+Ea+"?",Ea,wu,Pu,zC].join("|")+")",LC=RegExp(Ma+"(?="+Ma+")|"+BC+OC,"g");function WC(e){return e.match(LC)||[]}function jC(e){return Cu(e)?WC(e):FC(e)}function NC(e){return function(t){t=mu(t);var o=Cu(t)?jC(t):void 0,r=o?o[0]:t.charAt(0),n=o?xC(o,1).join(""):t.slice(1);return r[e]()+n}}var VC=NC("toUpperCase");function UC(){this.__data__=new mo,this.size=0}function qC(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o}function GC(e){return this.__data__.get(e)}function KC(e){return this.__data__.has(e)}var YC=200;function XC(e,t){var o=this.__data__;if(o instanceof mo){var r=o.__data__;if(!gu||r.length{var i,a;return(a=(i=t==null?void 0:t.value)===null||i===void 0?void 0:i[e])!==null&&a!==void 0?a:Qd[e]});return{dateLocaleRef:Y(()=>{var i;return(i=o==null?void 0:o.value)!==null&&i!==void 0?i:tu}),localeRef:r}}const bn="naive-ui-style";function $n(e,t,o){if(!t)return;const r=_i(),n=Y(()=>{const{value:l}=t;if(!l)return;const s=l[e];if(s)return s}),i=Le(Qt,null),a=()=>{sn(()=>{const{value:l}=o,s=`${l}${e}Rtl`;if(wm(s,r))return;const{value:c}=n;c&&c.style.mount({id:s,head:!0,anchorMetaName:bn,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:i==null?void 0:i.styleMountTarget})})};return r?a():Pi(a),n}const ko={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:sy,fontFamily:cy,lineHeight:dy}=ko,Au=L("body",` +`}function ob(e,t,o){const{styles:r,ids:n}=o;n.has(e)||r!==null&&(n.add(e),r.push(tb(e,t)))}const rb=typeof document<"u";function Ei(){if(rb)return;const e=Le(eb,null);if(e!==null)return{adapter:(t,o)=>ob(t,o,e),context:e}}function vs(e,t){console.error(`[vueuc/${e}]: ${t}`)}var Zo=[],nb=function(){return Zo.some(function(e){return e.activeTargets.length>0})},ib=function(){return Zo.some(function(e){return e.skippedTargets.length>0})},xs="ResizeObserver loop completed with undelivered notifications.",ab=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:xs}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=xs),window.dispatchEvent(e)},gn;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(gn||(gn={}));var Qo=function(e){return Object.freeze(e)},lb=function(){function e(t,o){this.inlineSize=t,this.blockSize=o,Qo(this)}return e}(),qd=function(){function e(t,o,r,n){return this.x=t,this.y=o,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Qo(this)}return e.prototype.toJSON=function(){var t=this,o=t.x,r=t.y,n=t.top,i=t.right,a=t.bottom,l=t.left,s=t.width,c=t.height;return{x:o,y:r,top:n,right:i,bottom:a,left:l,width:s,height:c}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),ul=function(e){return e instanceof SVGElement&&"getBBox"in e},Gd=function(e){if(ul(e)){var t=e.getBBox(),o=t.width,r=t.height;return!o&&!r}var n=e,i=n.offsetWidth,a=n.offsetHeight;return!(i||a||e.getClientRects().length)},Cs=function(e){var t;if(e instanceof Element)return!0;var o=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(o&&e instanceof o.Element)},sb=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},Zr=typeof window<"u"?window:{},jn=new WeakMap,ys=/auto|scroll/,cb=/^tb|vertical/,db=/msie|trident/i.test(Zr.navigator&&Zr.navigator.userAgent),Vt=function(e){return parseFloat(e||"0")},vr=function(e,t,o){return e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=!1),new lb((o?t:e)||0,(o?e:t)||0)},Ss=Qo({devicePixelContentBoxSize:vr(),borderBoxSize:vr(),contentBoxSize:vr(),contentRect:new qd(0,0,0,0)}),Kd=function(e,t){if(t===void 0&&(t=!1),jn.has(e)&&!t)return jn.get(e);if(Gd(e))return jn.set(e,Ss),Ss;var o=getComputedStyle(e),r=ul(e)&&e.ownerSVGElement&&e.getBBox(),n=!db&&o.boxSizing==="border-box",i=cb.test(o.writingMode||""),a=!r&&ys.test(o.overflowY||""),l=!r&&ys.test(o.overflowX||""),s=r?0:Vt(o.paddingTop),c=r?0:Vt(o.paddingRight),d=r?0:Vt(o.paddingBottom),u=r?0:Vt(o.paddingLeft),p=r?0:Vt(o.borderTopWidth),m=r?0:Vt(o.borderRightWidth),f=r?0:Vt(o.borderBottomWidth),g=r?0:Vt(o.borderLeftWidth),S=u+c,v=s+d,$=g+m,T=p+f,w=l?e.offsetHeight-T-e.clientHeight:0,E=a?e.offsetWidth-$-e.clientWidth:0,O=n?S+$:0,x=n?v+T:0,F=r?r.width:Vt(o.width)-O-E,R=r?r.height:Vt(o.height)-x-w,B=F+S+E+$,j=R+v+w+T,A=Qo({devicePixelContentBoxSize:vr(Math.round(F*devicePixelRatio),Math.round(R*devicePixelRatio),i),borderBoxSize:vr(B,j,i),contentBoxSize:vr(F,R,i),contentRect:new qd(u,s,F,R)});return jn.set(e,A),A},Yd=function(e,t,o){var r=Kd(e,o),n=r.borderBoxSize,i=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case gn.DEVICE_PIXEL_CONTENT_BOX:return a;case gn.BORDER_BOX:return n;default:return i}},ub=function(){function e(t){var o=Kd(t);this.target=t,this.contentRect=o.contentRect,this.borderBoxSize=Qo([o.borderBoxSize]),this.contentBoxSize=Qo([o.contentBoxSize]),this.devicePixelContentBoxSize=Qo([o.devicePixelContentBoxSize])}return e}(),Xd=function(e){if(Gd(e))return 1/0;for(var t=0,o=e.parentNode;o;)t+=1,o=o.parentNode;return t},fb=function(){var e=1/0,t=[];Zo.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(c){var d=new ub(c.target),u=Xd(c.target);l.push(d),c.lastReportedSize=Yd(c.target,c.observedBox),ue?o.activeTargets.push(n):o.skippedTargets.push(n))})})},pb=function(){var e=0;for(ws(e);nb();)e=fb(),ws(e);return ib()&&ab(),e>0},ea,Jd=[],hb=function(){return Jd.splice(0).forEach(function(e){return e()})},gb=function(e){if(!ea){var t=0,o=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return hb()}).observe(o,r),ea=function(){o.textContent="".concat(t?t--:t++)}}Jd.push(e),ea()},mb=function(e){gb(function(){requestAnimationFrame(e)})},ei=0,bb=function(){return!!ei},vb=250,xb={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ps=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Ts=function(e){return e===void 0&&(e=0),Date.now()+e},ta=!1,Cb=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var o=this;if(t===void 0&&(t=vb),!ta){ta=!0;var r=Ts(t);mb(function(){var n=!1;try{n=pb()}finally{if(ta=!1,t=r-Ts(),!bb())return;n?o.run(1e3):t>0?o.run(t):o.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,o=function(){return t.observer&&t.observer.observe(document.body,xb)};document.body?o():Zr.addEventListener("DOMContentLoaded",o)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ps.forEach(function(o){return Zr.addEventListener(o,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Ps.forEach(function(o){return Zr.removeEventListener(o,t.listener,!0)}),this.stopped=!0)},e}(),Ra=new Cb,$s=function(e){!ei&&e>0&&Ra.start(),ei+=e,!ei&&Ra.stop()},yb=function(e){return!ul(e)&&!sb(e)&&getComputedStyle(e).display==="inline"},Sb=function(){function e(t,o){this.target=t,this.observedBox=o||gn.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=Yd(this.target,this.observedBox,!0);return yb(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),wb=function(){function e(t,o){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=o}return e}(),Nn=new WeakMap,Rs=function(e,t){for(var o=0;o=0&&(i&&Zo.splice(Zo.indexOf(r),1),r.observationTargets.splice(n,1),$s(-1))},e.disconnect=function(t){var o=this,r=Nn.get(t);r.observationTargets.slice().forEach(function(n){return o.unobserve(t,n.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Pb=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Vn.connect(this,t)}return e.prototype.observe=function(t,o){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Cs(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Vn.observe(this,t,o)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Cs(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Vn.unobserve(this,t)},e.prototype.disconnect=function(){Vn.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();class Tb{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Pb)(this.handleResize),this.elHandlersMap=new Map}handleResize(t){for(const o of t){const r=this.elHandlersMap.get(o.target);r!==void 0&&r(o)}}registerHandler(t,o){this.elHandlersMap.set(t,o),this.observer.observe(t)}unregisterHandler(t){this.elHandlersMap.has(t)&&(this.elHandlersMap.delete(t),this.observer.unobserve(t))}}const Fs=new Tb,Fa=He({name:"ResizeObserver",props:{onResize:Function},setup(e){let t=!1;const o=Sn().proxy;function r(n){const{onResize:i}=e;i!==void 0&&i(n)}Mo(()=>{const n=o.$el;if(n===void 0){vs("resize-observer","$el does not exist.");return}if(n.nextElementSibling!==n.nextSibling&&n.nodeType===3&&n.nodeValue!==""){vs("resize-observer","$el can not be observed (it may be a text node).");return}n.nextElementSibling!==null&&(Fs.registerHandler(n.nextElementSibling,r),t=!0)}),nr(()=>{t&&Fs.unregisterHandler(o.$el.nextElementSibling)})},render(){return vh(this.$slots,"default")}});function As(e){return e.replace(/#|\(|\)|,|\s|\./g,"_")}const $b=/^(\d|\.)+$/,Is=/(\d|\.)+/;function oa(e,{c:t=1,offset:o=0,attachPx:r=!0}={}){if(typeof e=="number"){const n=(e+o)*t;return n===0?"0":`${n}px`}else if(typeof e=="string")if($b.test(e)){const n=(Number(e)+o)*t;return r?n===0?"0":`${n}px`:`${n}`}else{const n=Is.exec(e);return n?e.replace(Is,String((Number(n[0])+o)*t)):e}return e}function Es(e){const{left:t,right:o,top:r,bottom:n}=Vo(e);return`${r} ${t} ${n} ${o}`}function Aa(e,t){console.error(`[naive/${e}]: ${t}`)}function Rb(e,t){throw new Error(`[naive/${e}]: ${t}`)}function Ke(e,...t){if(Array.isArray(e))e.forEach(o=>Ke(o,...t));else return e(...t)}function _s(e){return Object.keys(e)}function Fb(e,t=[],o){const r={};return Object.getOwnPropertyNames(e).forEach(i=>{t.includes(i)||(r[i]=e[i])}),Object.assign(r,o)}function Ab(e,...t){return typeof e=="function"?e(...t):typeof e=="string"?xa(e):typeof e=="number"?xa(String(e)):null}function kt(e){return e.some(t=>Cr(t)?!(t.type===pt||t.type===et&&!kt(t.children)):!0)?e:null}function Qr(e,t){return e&&kt(e())||t()}function Ib(e,t,o){return e&&kt(e(t))||o(t)}function $t(e,t){const o=e&&kt(e());return t(o||null)}function Eb(e){return!(e&&kt(e()))}const Ms=He({render(){var e,t;return(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)}}),Qt="n-config-provider",pi="n";function zo(e={},t={defaultBordered:!0}){const o=Le(Qt,null);return{inlineThemeDisabled:o==null?void 0:o.inlineThemeDisabled,mergedRtlRef:o==null?void 0:o.mergedRtlRef,mergedComponentPropsRef:o==null?void 0:o.mergedComponentPropsRef,mergedBreakpointsRef:o==null?void 0:o.mergedBreakpointsRef,mergedBorderedRef:Y(()=>{var r,n;const{bordered:i}=e;return i!==void 0?i:(n=(r=o==null?void 0:o.mergedBorderedRef.value)!==null&&r!==void 0?r:t.defaultBordered)!==null&&n!==void 0?n:!0}),mergedClsPrefixRef:o?o.mergedClsPrefixRef:Ac(pi),namespaceRef:Y(()=>o==null?void 0:o.mergedNamespaceRef.value)}}function bP(){const e=Le(Qt,null);return e?e.mergedClsPrefixRef:Ac(pi)}function Fr(e,t,o,r){o||Rb("useThemeClass","cssVarsRef is not passed");const n=Le(Qt,null),i=n==null?void 0:n.mergedThemeHashRef,a=n==null?void 0:n.styleMountTarget,l=fe(""),s=Ei();let c;const d=`__${e}`,u=()=>{let p=d;const m=t?t.value:void 0,f=i==null?void 0:i.value;f&&(p+=`-${f}`),m&&(p+=`-${m}`);const{themeOverrides:g,builtinThemeOverrides:S}=r;g&&(p+=`-${fn(JSON.stringify(g))}`),S&&(p+=`-${fn(JSON.stringify(S))}`),l.value=p,c=()=>{const v=o.value;let $="";for(const T in v)$+=`${T}: ${v[T]};`;L(`.${p}`,$).mount({id:p,ssr:s,parent:a}),c=void 0}};return sn(()=>{u()}),{themeClass:l,onRender:()=>{c==null||c()}}}const Ia="n-form-item";function Zd(e,{defaultSize:t="medium",mergedSize:o,mergedDisabled:r}={}){const n=Le(Ia,null);po(Ia,null);const i=Y(o?()=>o(n):()=>{const{size:s}=e;if(s)return s;if(n){const{mergedSize:c}=n;if(c.value!==void 0)return c.value}return t}),a=Y(r?()=>r(n):()=>{const{disabled:s}=e;return s!==void 0?s:n?n.disabled.value:!1}),l=Y(()=>{const{status:s}=e;return s||(n==null?void 0:n.mergedValidationStatus.value)});return nr(()=>{n&&n.restoreValidation()}),{mergedSizeRef:i,mergedDisabledRef:a,mergedStatusRef:l,nTriggerFormBlur(){n&&n.handleContentBlur()},nTriggerFormChange(){n&&n.handleContentChange()},nTriggerFormFocus(){n&&n.handleContentFocus()},nTriggerFormInput(){n&&n.handleContentInput()}}}const Qd={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:e=>`Please load all ${e}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:e=>`Total ${e} items`,selected:e=>`${e} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"}},_b={name:"zh-CN",global:{undo:"撤销",redo:"重做",confirm:"确认",clear:"清除"},Popconfirm:{positiveText:"确认",negativeText:"取消"},Cascader:{placeholder:"请选择",loading:"加载中",loadingRequiredMessage:e=>`加载全部 ${e} 的子节点后才可选中`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy年",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w周",clear:"清除",now:"此刻",confirm:"确认",selectTime:"选择时间",selectDate:"选择日期",datePlaceholder:"选择日期",datetimePlaceholder:"选择日期时间",monthPlaceholder:"选择月份",yearPlaceholder:"选择年份",quarterPlaceholder:"选择季度",weekPlaceholder:"选择周",startDatePlaceholder:"开始日期",endDatePlaceholder:"结束日期",startDatetimePlaceholder:"开始日期时间",endDatetimePlaceholder:"结束日期时间",startMonthPlaceholder:"开始月份",endMonthPlaceholder:"结束月份",monthBeforeYear:!1,firstDayOfWeek:0,today:"今天"},DataTable:{checkTableAll:"选择全部表格数据",uncheckTableAll:"取消选择全部表格数据",confirm:"确认",clear:"重置"},LegacyTransfer:{sourceTitle:"源项",targetTitle:"目标项"},Transfer:{selectAll:"全选",clearAll:"清除",unselectAll:"取消全选",total:e=>`共 ${e} 项`,selected:e=>`已选 ${e} 项`},Empty:{description:"无数据"},Select:{placeholder:"请选择"},TimePicker:{placeholder:"请选择时间",positiveText:"确认",negativeText:"取消",now:"此刻",clear:"清除"},Pagination:{goto:"跳至",selectionSuffix:"页"},DynamicTags:{add:"添加"},Log:{loading:"加载中"},Input:{placeholder:"请输入"},InputNumber:{placeholder:"请输入"},DynamicInput:{create:"添加"},ThemeEditor:{title:"主题编辑器",clearAllVars:"清除全部变量",clearSearch:"清除搜索",filterCompName:"过滤组件名",filterVarName:"过滤变量名",import:"导入",export:"导出",restore:"恢复默认"},Image:{tipPrevious:"上一张(←)",tipNext:"下一张(→)",tipCounterclockwise:"向左旋转",tipClockwise:"向右旋转",tipZoomOut:"缩小",tipZoomIn:"放大",tipDownload:"下载",tipClose:"关闭(Esc)",tipOriginalSize:"缩放到原始尺寸"}};function xr(e){return(t={})=>{const o=t.width?String(t.width):e.defaultWidth;return e.formats[o]||e.formats[e.defaultWidth]}}function Yt(e){return(t,o)=>{const r=o!=null&&o.context?String(o.context):"standalone";let n;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=o!=null&&o.width?String(o.width):a;n=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=o!=null&&o.width?String(o.width):e.defaultWidth;n=e.values[l]||e.values[a]}const i=e.argumentCallback?e.argumentCallback(t):t;return n[i]}}function Xt(e){return(t,o={})=>{const r=o.width,n=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(n);if(!i)return null;const a=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(l)?zb(l,u=>u.test(a)):Mb(l,u=>u.test(a));let c;c=e.valueCallback?e.valueCallback(s):s,c=o.valueCallback?o.valueCallback(c):c;const d=t.slice(a.length);return{value:c,rest:d}}}function Mb(e,t){for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t(e[o]))return o}function zb(e,t){for(let o=0;o{const r=t.match(e.matchPattern);if(!r)return null;const n=r[0],i=t.match(e.parsePattern);if(!i)return null;let a=e.valueCallback?e.valueCallback(i[0]):i[0];a=o.valueCallback?o.valueCallback(a):a;const l=t.slice(n.length);return{value:a,rest:l}}}function Hb(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}let kb={};function Db(){return kb}function zs(e,t){var l,s,c,d;const o=Db(),r=(t==null?void 0:t.weekStartsOn)??((s=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:s.weekStartsOn)??o.weekStartsOn??((d=(c=o.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,n=Hb(e),i=n.getDay(),a=(i{let r;const n=Bb[e];return typeof n=="string"?r=n:t===1?r=n.one:r=n.other.replace("{{count}}",t.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+r:r+" ago":r},Wb={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},jb=(e,t,o,r)=>Wb[e],Nb={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Vb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ub={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},qb={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Gb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Kb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Yb=(e,t)=>{const o=Number(e),r=o%100;if(r>20||r<10)switch(r%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},Xb={ordinalNumber:Yb,era:Yt({values:Nb,defaultWidth:"wide"}),quarter:Yt({values:Vb,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Yt({values:Ub,defaultWidth:"wide"}),day:Yt({values:qb,defaultWidth:"wide"}),dayPeriod:Yt({values:Gb,defaultWidth:"wide",formattingValues:Kb,defaultFormattingWidth:"wide"})},Jb=/^(\d+)(th|st|nd|rd)?/i,Zb=/\d+/i,Qb={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ev={any:[/^b/i,/^(a|c)/i]},tv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ov={any:[/1/i,/2/i,/3/i,/4/i]},rv={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},nv={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},iv={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},av={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},lv={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},sv={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},cv={ordinalNumber:eu({matchPattern:Jb,parsePattern:Zb,valueCallback:e=>parseInt(e,10)}),era:Xt({matchPatterns:Qb,defaultMatchWidth:"wide",parsePatterns:ev,defaultParseWidth:"any"}),quarter:Xt({matchPatterns:tv,defaultMatchWidth:"wide",parsePatterns:ov,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Xt({matchPatterns:rv,defaultMatchWidth:"wide",parsePatterns:nv,defaultParseWidth:"any"}),day:Xt({matchPatterns:iv,defaultMatchWidth:"wide",parsePatterns:av,defaultParseWidth:"any"}),dayPeriod:Xt({matchPatterns:lv,defaultMatchWidth:"any",parsePatterns:sv,defaultParseWidth:"any"})},dv={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},uv={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},fv={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pv={date:xr({formats:dv,defaultWidth:"full"}),time:xr({formats:uv,defaultWidth:"full"}),dateTime:xr({formats:fv,defaultWidth:"full"})},hv={code:"en-US",formatDistance:Lb,formatLong:pv,formatRelative:jb,localize:Xb,match:cv,options:{weekStartsOn:0,firstWeekContainsDate:1}},gv={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},mv=(e,t,o)=>{let r;const n=gv[e];return typeof n=="string"?r=n:t===1?r=n.one:r=n.other.replace("{{count}}",String(t)),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?r+"内":r+"前":r},bv={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},vv={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},xv={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},Cv={date:xr({formats:bv,defaultWidth:"full"}),time:xr({formats:vv,defaultWidth:"full"}),dateTime:xr({formats:xv,defaultWidth:"full"})};function Hs(e,t,o){const r="eeee p";return Ob(e,t,o)?r:e.getTime()>t.getTime()?"'下个'"+r:"'上个'"+r}const yv={lastWeek:Hs,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:Hs,other:"PP p"},Sv=(e,t,o,r)=>{const n=yv[e];return typeof n=="function"?n(t,o,r):n},wv={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},Pv={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},Tv={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},$v={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},Rv={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},Fv={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},Av=(e,t)=>{const o=Number(e);switch(t==null?void 0:t.unit){case"date":return o.toString()+"日";case"hour":return o.toString()+"时";case"minute":return o.toString()+"分";case"second":return o.toString()+"秒";default:return"第 "+o.toString()}},Iv={ordinalNumber:Av,era:Yt({values:wv,defaultWidth:"wide"}),quarter:Yt({values:Pv,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Yt({values:Tv,defaultWidth:"wide"}),day:Yt({values:$v,defaultWidth:"wide"}),dayPeriod:Yt({values:Rv,defaultWidth:"wide",formattingValues:Fv,defaultFormattingWidth:"wide"})},Ev=/^(第\s*)?\d+(日|时|分|秒)?/i,_v=/\d+/i,Mv={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},zv={any:[/^(前)/i,/^(公元)/i]},Hv={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},kv={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},Dv={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},Ov={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},Bv={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},Lv={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},Wv={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},jv={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},Nv={ordinalNumber:eu({matchPattern:Ev,parsePattern:_v,valueCallback:e=>parseInt(e,10)}),era:Xt({matchPatterns:Mv,defaultMatchWidth:"wide",parsePatterns:zv,defaultParseWidth:"any"}),quarter:Xt({matchPatterns:Hv,defaultMatchWidth:"wide",parsePatterns:kv,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Xt({matchPatterns:Dv,defaultMatchWidth:"wide",parsePatterns:Ov,defaultParseWidth:"any"}),day:Xt({matchPatterns:Bv,defaultMatchWidth:"wide",parsePatterns:Lv,defaultParseWidth:"any"}),dayPeriod:Xt({matchPatterns:Wv,defaultMatchWidth:"any",parsePatterns:jv,defaultParseWidth:"any"})},Vv={code:"zh-CN",formatDistance:mv,formatLong:Cv,formatRelative:Sv,localize:Iv,match:Nv,options:{weekStartsOn:1,firstWeekContainsDate:4}},tu={name:"en-US",locale:hv},Uv={name:"zh-CN",locale:Vv};var ou=typeof global=="object"&&global&&global.Object===Object&&global,qv=typeof self=="object"&&self&&self.Object===Object&&self,Ar=ou||qv||Function("return this")(),wr=Ar.Symbol,ru=Object.prototype,Gv=ru.hasOwnProperty,Kv=ru.toString,jr=wr?wr.toStringTag:void 0;function Yv(e){var t=Gv.call(e,jr),o=e[jr];try{e[jr]=void 0;var r=!0}catch{}var n=Kv.call(e);return r&&(t?e[jr]=o:delete e[jr]),n}var Xv=Object.prototype,Jv=Xv.toString;function Zv(e){return Jv.call(e)}var Qv="[object Null]",e0="[object Undefined]",ks=wr?wr.toStringTag:void 0;function Tn(e){return e==null?e===void 0?e0:Qv:ks&&ks in Object(e)?Yv(e):Zv(e)}function Ir(e){return e!=null&&typeof e=="object"}var t0="[object Symbol]";function fl(e){return typeof e=="symbol"||Ir(e)&&Tn(e)==t0}function o0(e,t){for(var o=-1,r=e==null?0:e.length,n=Array(r);++o0){if(++t>=w0)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function R0(e){return function(){return e}}var hi=function(){try{var e=hl(Object,"defineProperty");return e({},"",{}),e}catch{}}(),F0=hi?function(e,t){return hi(e,"toString",{configurable:!0,enumerable:!1,value:R0(t),writable:!0})}:iu,A0=$0(F0),I0=9007199254740991,E0=/^(?:0|[1-9]\d*)$/;function au(e,t){var o=typeof e;return t=t??I0,!!t&&(o=="number"||o!="symbol"&&E0.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=O0}function ml(e){return e!=null&&lu(e.length)&&!pl(e)}function B0(e,t,o){if(!ir(o))return!1;var r=typeof t;return(r=="number"?ml(o)&&au(t,o.length):r=="string"&&t in o)?_i(o[t],e):!1}function L0(e){return D0(function(t,o){var r=-1,n=o.length,i=n>1?o[n-1]:void 0,a=n>2?o[2]:void 0;for(i=e.length>3&&typeof i=="function"?(n--,i):void 0,a&&B0(o[0],o[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++r-1}function Xx(e,t){var o=this.__data__,r=Mi(o,e);return r<0?(++this.size,o.push([e,t])):o[r][1]=t,this}function mo(e){var t=-1,o=e==null?0:e.length;for(this.clear();++tn?0:n+t),o=o>n?n:o,o<0&&(o+=n),n=t>o?0:o-t>>>0,t>>>=0;for(var i=Array(n);++r=r?e:vC(e,t,o)}var CC="\\ud800-\\udfff",yC="\\u0300-\\u036f",SC="\\ufe20-\\ufe2f",wC="\\u20d0-\\u20ff",PC=yC+SC+wC,TC="\\ufe0e\\ufe0f",$C="\\u200d",RC=RegExp("["+$C+CC+PC+TC+"]");function Cu(e){return RC.test(e)}function FC(e){return e.split("")}var yu="\\ud800-\\udfff",AC="\\u0300-\\u036f",IC="\\ufe20-\\ufe2f",EC="\\u20d0-\\u20ff",_C=AC+IC+EC,MC="\\ufe0e\\ufe0f",zC="["+yu+"]",_a="["+_C+"]",Ma="\\ud83c[\\udffb-\\udfff]",HC="(?:"+_a+"|"+Ma+")",Su="[^"+yu+"]",wu="(?:\\ud83c[\\udde6-\\uddff]){2}",Pu="[\\ud800-\\udbff][\\udc00-\\udfff]",kC="\\u200d",Tu=HC+"?",$u="["+MC+"]?",DC="(?:"+kC+"(?:"+[Su,wu,Pu].join("|")+")"+$u+Tu+")*",OC=$u+Tu+DC,BC="(?:"+[Su+_a+"?",_a,wu,Pu,zC].join("|")+")",LC=RegExp(Ma+"(?="+Ma+")|"+BC+OC,"g");function WC(e){return e.match(LC)||[]}function jC(e){return Cu(e)?WC(e):FC(e)}function NC(e){return function(t){t=mu(t);var o=Cu(t)?jC(t):void 0,r=o?o[0]:t.charAt(0),n=o?xC(o,1).join(""):t.slice(1);return r[e]()+n}}var VC=NC("toUpperCase");function UC(){this.__data__=new mo,this.size=0}function qC(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o}function GC(e){return this.__data__.get(e)}function KC(e){return this.__data__.has(e)}var YC=200;function XC(e,t){var o=this.__data__;if(o instanceof mo){var r=o.__data__;if(!gu||r.length{var i,a;return(a=(i=t==null?void 0:t.value)===null||i===void 0?void 0:i[e])!==null&&a!==void 0?a:Qd[e]});return{dateLocaleRef:Y(()=>{var i;return(i=o==null?void 0:o.value)!==null&&i!==void 0?i:tu}),localeRef:r}}const bn="naive-ui-style";function $n(e,t,o){if(!t)return;const r=Ei(),n=Y(()=>{const{value:l}=t;if(!l)return;const s=l[e];if(s)return s}),i=Le(Qt,null),a=()=>{sn(()=>{const{value:l}=o,s=`${l}${e}Rtl`;if(wm(s,r))return;const{value:c}=n;c&&c.style.mount({id:s,head:!0,anchorMetaName:bn,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:i==null?void 0:i.styleMountTarget})})};return r?a():Pi(a),n}const ko={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:sy,fontFamily:cy,lineHeight:dy}=ko,Au=L("body",` margin: 0; font-size: ${sy}; font-family: ${cy}; @@ -40,7 +40,7 @@ ${t} `,[L("input",` font-family: inherit; font-size: inherit; - `)]);function Er(e,t,o){if(!t)return;const r=_i(),n=Le(Qt,null),i=()=>{const a=o.value;t.mount({id:a===void 0?e:a+e,head:!0,anchorMetaName:bn,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:n==null?void 0:n.styleMountTarget}),n!=null&&n.preflightStyleDisabled||Au.mount({id:"n-global",head:!0,anchorMetaName:bn,ssr:r,parent:n==null?void 0:n.styleMountTarget})};r?i():Pi(i)}function vP(e){return e}function Ct(e,t,o,r,n,i){const a=_i(),l=Le(Qt,null);if(o){const c=()=>{const d=i==null?void 0:i.value;o.mount({id:d===void 0?t:d+t,head:!0,props:{bPrefix:d?`.${d}-`:void 0},anchorMetaName:bn,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||Au.mount({id:"n-global",head:!0,anchorMetaName:bn,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?c():Pi(c)}return Y(()=>{var c;const{theme:{common:d,self:u,peers:p={}}={},themeOverrides:m={},builtinThemeOverrides:f={}}=n,{common:g,peers:S}=m,{common:v=void 0,[e]:{common:$=void 0,self:T=void 0,peers:w={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:_=void 0,[e]:O={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:x,peers:F={}}=O,R=Vr({},d||$||v||r.common,_,x,g),B=Vr((c=u||T||r.self)===null||c===void 0?void 0:c(R),f,O,m);return{common:R,self:B,peers:Vr({},r.peers,w,p),peerOverrides:Vr({},f.peers,F,S)}})}Ct.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const uy=pe("base-icon",` + `)]);function _r(e,t,o){if(!t)return;const r=Ei(),n=Le(Qt,null),i=()=>{const a=o.value;t.mount({id:a===void 0?e:a+e,head:!0,anchorMetaName:bn,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:n==null?void 0:n.styleMountTarget}),n!=null&&n.preflightStyleDisabled||Au.mount({id:"n-global",head:!0,anchorMetaName:bn,ssr:r,parent:n==null?void 0:n.styleMountTarget})};r?i():Pi(i)}function vP(e){return e}function Ct(e,t,o,r,n,i){const a=Ei(),l=Le(Qt,null);if(o){const c=()=>{const d=i==null?void 0:i.value;o.mount({id:d===void 0?t:d+t,head:!0,props:{bPrefix:d?`.${d}-`:void 0},anchorMetaName:bn,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||Au.mount({id:"n-global",head:!0,anchorMetaName:bn,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?c():Pi(c)}return Y(()=>{var c;const{theme:{common:d,self:u,peers:p={}}={},themeOverrides:m={},builtinThemeOverrides:f={}}=n,{common:g,peers:S}=m,{common:v=void 0,[e]:{common:$=void 0,self:T=void 0,peers:w={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:E=void 0,[e]:O={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:x,peers:F={}}=O,R=Vr({},d||$||v||r.common,E,x,g),B=Vr((c=u||T||r.self)===null||c===void 0?void 0:c(R),f,O,m);return{common:R,self:B,peers:Vr({},r.peers,w,p),peerOverrides:Vr({},f.peers,F,S)}})}Ct.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const uy=pe("base-icon",` height: 1em; width: 1em; line-height: 1em; @@ -52,7 +52,7 @@ ${t} `,[L("svg",` height: 1em; width: 1em; - `)]),Tr=He({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(e){Er("-base-icon",uy,Dt(e,"clsPrefix"))},render(){return y("i",{class:`${this.clsPrefix}-base-icon`,onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},this.$slots)}}),Hi=He({name:"BaseIconSwitchTransition",setup(e,{slots:t}){const o=Ym();return()=>y(un,{name:"icon-switch-transition",appear:o.value},t)}});function Mr(e,t){const o=He({render(){return t()}});return He({name:VC(e),setup(){var r;const n=(r=Le(Qt,null))===null||r===void 0?void 0:r.mergedIconsRef;return()=>{var i;const a=(i=n==null?void 0:n.value)===null||i===void 0?void 0:i[e];return a?a():y(o,null)}}})}const fy=He({name:"ChevronDown",render(){return y("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},y("path",{d:"M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",fill:"currentColor"}))}}),py=Mr("clear",()=>y("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},y("g",{fill:"currentColor","fill-rule":"nonzero"},y("path",{d:"M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"}))))),hy=Mr("close",()=>y("svg",{viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},y("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},y("g",{fill:"currentColor","fill-rule":"nonzero"},y("path",{d:"M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z"}))))),gy=Mr("error",()=>y("svg",{viewBox:"0 0 48 48",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},y("g",{"fill-rule":"nonzero"},y("path",{d:"M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M17.8838835,16.1161165 L17.7823881,16.0249942 C17.3266086,15.6583353 16.6733914,15.6583353 16.2176119,16.0249942 L16.1161165,16.1161165 L16.0249942,16.2176119 C15.6583353,16.6733914 15.6583353,17.3266086 16.0249942,17.7823881 L16.1161165,17.8838835 L22.233,24 L16.1161165,30.1161165 L16.0249942,30.2176119 C15.6583353,30.6733914 15.6583353,31.3266086 16.0249942,31.7823881 L16.1161165,31.8838835 L16.2176119,31.9750058 C16.6733914,32.3416647 17.3266086,32.3416647 17.7823881,31.9750058 L17.8838835,31.8838835 L24,25.767 L30.1161165,31.8838835 L30.2176119,31.9750058 C30.6733914,32.3416647 31.3266086,32.3416647 31.7823881,31.9750058 L31.8838835,31.8838835 L31.9750058,31.7823881 C32.3416647,31.3266086 32.3416647,30.6733914 31.9750058,30.2176119 L31.8838835,30.1161165 L25.767,24 L31.8838835,17.8838835 L31.9750058,17.7823881 C32.3416647,17.3266086 32.3416647,16.6733914 31.9750058,16.2176119 L31.8838835,16.1161165 L31.7823881,16.0249942 C31.3266086,15.6583353 30.6733914,15.6583353 30.2176119,16.0249942 L30.1161165,16.1161165 L24,22.233 L17.8838835,16.1161165 L17.7823881,16.0249942 L17.8838835,16.1161165 Z"}))))),my=He({name:"Eye",render(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},y("path",{d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),y("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"}))}}),by=He({name:"EyeOff",render(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},y("path",{d:"M432 448a15.92 15.92 0 0 1-11.31-4.69l-352-352a16 16 0 0 1 22.62-22.62l352 352A16 16 0 0 1 432 448z",fill:"currentColor"}),y("path",{d:"M255.66 384c-41.49 0-81.5-12.28-118.92-36.5c-34.07-22-64.74-53.51-88.7-91v-.08c19.94-28.57 41.78-52.73 65.24-72.21a2 2 0 0 0 .14-2.94L93.5 161.38a2 2 0 0 0-2.71-.12c-24.92 21-48.05 46.76-69.08 76.92a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416a239.13 239.13 0 0 0 75.8-12.58a2 2 0 0 0 .77-3.31l-21.58-21.58a4 4 0 0 0-3.83-1a204.8 204.8 0 0 1-51.16 6.47z",fill:"currentColor"}),y("path",{d:"M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96a227.34 227.34 0 0 0-74.89 12.83a2 2 0 0 0-.75 3.31l21.55 21.55a4 4 0 0 0 3.88 1a192.82 192.82 0 0 1 50.21-6.69c40.69 0 80.58 12.43 118.55 37c34.71 22.4 65.74 53.88 89.76 91a.13.13 0 0 1 0 .16a310.72 310.72 0 0 1-64.12 72.73a2 2 0 0 0-.15 2.95l19.9 19.89a2 2 0 0 0 2.7.13a343.49 343.49 0 0 0 68.64-78.48a32.2 32.2 0 0 0-.1-34.78z",fill:"currentColor"}),y("path",{d:"M256 160a95.88 95.88 0 0 0-21.37 2.4a2 2 0 0 0-1 3.38l112.59 112.56a2 2 0 0 0 3.38-1A96 96 0 0 0 256 160z",fill:"currentColor"}),y("path",{d:"M165.78 233.66a2 2 0 0 0-3.38 1a96 96 0 0 0 115 115a2 2 0 0 0 1-3.38z",fill:"currentColor"}))}}),vy=Mr("info",()=>y("svg",{viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},y("g",{"fill-rule":"nonzero"},y("path",{d:"M14,2 C20.6274,2 26,7.37258 26,14 C26,20.6274 20.6274,26 14,26 C7.37258,26 2,20.6274 2,14 C2,7.37258 7.37258,2 14,2 Z M14,11 C13.4477,11 13,11.4477 13,12 L13,12 L13,20 C13,20.5523 13.4477,21 14,21 C14.5523,21 15,20.5523 15,20 L15,20 L15,12 C15,11.4477 14.5523,11 14,11 Z M14,6.75 C13.3096,6.75 12.75,7.30964 12.75,8 C12.75,8.69036 13.3096,9.25 14,9.25 C14.6904,9.25 15.25,8.69036 15.25,8 C15.25,7.30964 14.6904,6.75 14,6.75 Z"}))))),xy=Mr("success",()=>y("svg",{viewBox:"0 0 48 48",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},y("g",{"fill-rule":"nonzero"},y("path",{d:"M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M32.6338835,17.6161165 C32.1782718,17.1605048 31.4584514,17.1301307 30.9676119,17.5249942 L30.8661165,17.6161165 L20.75,27.732233 L17.1338835,24.1161165 C16.6457281,23.6279612 15.8542719,23.6279612 15.3661165,24.1161165 C14.9105048,24.5717282 14.8801307,25.2915486 15.2749942,25.7823881 L15.3661165,25.8838835 L19.8661165,30.3838835 C20.3217282,30.8394952 21.0415486,30.8698693 21.5323881,30.4750058 L21.6338835,30.3838835 L32.6338835,19.3838835 C33.1220388,18.8957281 33.1220388,18.1042719 32.6338835,17.6161165 Z"}))))),Cy=Mr("warning",()=>y("svg",{viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},y("g",{"fill-rule":"nonzero"},y("path",{d:"M12,2 C17.523,2 22,6.478 22,12 C22,17.522 17.523,22 12,22 C6.477,22 2,17.522 2,12 C2,6.478 6.477,2 12,2 Z M12.0018002,15.0037242 C11.450254,15.0037242 11.0031376,15.4508407 11.0031376,16.0023869 C11.0031376,16.553933 11.450254,17.0010495 12.0018002,17.0010495 C12.5533463,17.0010495 13.0004628,16.553933 13.0004628,16.0023869 C13.0004628,15.4508407 12.5533463,15.0037242 12.0018002,15.0037242 Z M11.99964,7 C11.4868042,7.00018474 11.0642719,7.38637706 11.0066858,7.8837365 L11,8.00036004 L11.0018003,13.0012393 L11.00857,13.117858 C11.0665141,13.6151758 11.4893244,14.0010638 12.0021602,14.0008793 C12.514996,14.0006946 12.9375283,13.6145023 12.9951144,13.1171428 L13.0018002,13.0005193 L13,7.99964009 L12.9932303,7.8830214 C12.9352861,7.38570354 12.5124758,6.99981552 11.99964,7 Z"}))))),{cubicBezierEaseInOut:yy}=ko;function vn({originalTransform:e="",left:t=0,top:o=0,transition:r=`all .3s ${yy} !important`}={}){return[L("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:`${e} scale(0.75)`,left:t,top:o,opacity:0}),L("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${e}`,left:t,top:o,opacity:1}),L("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:t,top:o,transition:r})]}const Sy=pe("base-clear",` + `)]),Tr=He({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(e){_r("-base-icon",uy,Dt(e,"clsPrefix"))},render(){return y("i",{class:`${this.clsPrefix}-base-icon`,onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},this.$slots)}}),Hi=He({name:"BaseIconSwitchTransition",setup(e,{slots:t}){const o=Ym();return()=>y(un,{name:"icon-switch-transition",appear:o.value},t)}});function Mr(e,t){const o=He({render(){return t()}});return He({name:VC(e),setup(){var r;const n=(r=Le(Qt,null))===null||r===void 0?void 0:r.mergedIconsRef;return()=>{var i;const a=(i=n==null?void 0:n.value)===null||i===void 0?void 0:i[e];return a?a():y(o,null)}}})}const fy=He({name:"ChevronDown",render(){return y("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},y("path",{d:"M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",fill:"currentColor"}))}}),py=Mr("clear",()=>y("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},y("g",{fill:"currentColor","fill-rule":"nonzero"},y("path",{d:"M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"}))))),hy=Mr("close",()=>y("svg",{viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},y("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},y("g",{fill:"currentColor","fill-rule":"nonzero"},y("path",{d:"M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z"}))))),gy=Mr("error",()=>y("svg",{viewBox:"0 0 48 48",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},y("g",{"fill-rule":"nonzero"},y("path",{d:"M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M17.8838835,16.1161165 L17.7823881,16.0249942 C17.3266086,15.6583353 16.6733914,15.6583353 16.2176119,16.0249942 L16.1161165,16.1161165 L16.0249942,16.2176119 C15.6583353,16.6733914 15.6583353,17.3266086 16.0249942,17.7823881 L16.1161165,17.8838835 L22.233,24 L16.1161165,30.1161165 L16.0249942,30.2176119 C15.6583353,30.6733914 15.6583353,31.3266086 16.0249942,31.7823881 L16.1161165,31.8838835 L16.2176119,31.9750058 C16.6733914,32.3416647 17.3266086,32.3416647 17.7823881,31.9750058 L17.8838835,31.8838835 L24,25.767 L30.1161165,31.8838835 L30.2176119,31.9750058 C30.6733914,32.3416647 31.3266086,32.3416647 31.7823881,31.9750058 L31.8838835,31.8838835 L31.9750058,31.7823881 C32.3416647,31.3266086 32.3416647,30.6733914 31.9750058,30.2176119 L31.8838835,30.1161165 L25.767,24 L31.8838835,17.8838835 L31.9750058,17.7823881 C32.3416647,17.3266086 32.3416647,16.6733914 31.9750058,16.2176119 L31.8838835,16.1161165 L31.7823881,16.0249942 C31.3266086,15.6583353 30.6733914,15.6583353 30.2176119,16.0249942 L30.1161165,16.1161165 L24,22.233 L17.8838835,16.1161165 L17.7823881,16.0249942 L17.8838835,16.1161165 Z"}))))),my=He({name:"Eye",render(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},y("path",{d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),y("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"}))}}),by=He({name:"EyeOff",render(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},y("path",{d:"M432 448a15.92 15.92 0 0 1-11.31-4.69l-352-352a16 16 0 0 1 22.62-22.62l352 352A16 16 0 0 1 432 448z",fill:"currentColor"}),y("path",{d:"M255.66 384c-41.49 0-81.5-12.28-118.92-36.5c-34.07-22-64.74-53.51-88.7-91v-.08c19.94-28.57 41.78-52.73 65.24-72.21a2 2 0 0 0 .14-2.94L93.5 161.38a2 2 0 0 0-2.71-.12c-24.92 21-48.05 46.76-69.08 76.92a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416a239.13 239.13 0 0 0 75.8-12.58a2 2 0 0 0 .77-3.31l-21.58-21.58a4 4 0 0 0-3.83-1a204.8 204.8 0 0 1-51.16 6.47z",fill:"currentColor"}),y("path",{d:"M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96a227.34 227.34 0 0 0-74.89 12.83a2 2 0 0 0-.75 3.31l21.55 21.55a4 4 0 0 0 3.88 1a192.82 192.82 0 0 1 50.21-6.69c40.69 0 80.58 12.43 118.55 37c34.71 22.4 65.74 53.88 89.76 91a.13.13 0 0 1 0 .16a310.72 310.72 0 0 1-64.12 72.73a2 2 0 0 0-.15 2.95l19.9 19.89a2 2 0 0 0 2.7.13a343.49 343.49 0 0 0 68.64-78.48a32.2 32.2 0 0 0-.1-34.78z",fill:"currentColor"}),y("path",{d:"M256 160a95.88 95.88 0 0 0-21.37 2.4a2 2 0 0 0-1 3.38l112.59 112.56a2 2 0 0 0 3.38-1A96 96 0 0 0 256 160z",fill:"currentColor"}),y("path",{d:"M165.78 233.66a2 2 0 0 0-3.38 1a96 96 0 0 0 115 115a2 2 0 0 0 1-3.38z",fill:"currentColor"}))}}),vy=Mr("info",()=>y("svg",{viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},y("g",{"fill-rule":"nonzero"},y("path",{d:"M14,2 C20.6274,2 26,7.37258 26,14 C26,20.6274 20.6274,26 14,26 C7.37258,26 2,20.6274 2,14 C2,7.37258 7.37258,2 14,2 Z M14,11 C13.4477,11 13,11.4477 13,12 L13,12 L13,20 C13,20.5523 13.4477,21 14,21 C14.5523,21 15,20.5523 15,20 L15,20 L15,12 C15,11.4477 14.5523,11 14,11 Z M14,6.75 C13.3096,6.75 12.75,7.30964 12.75,8 C12.75,8.69036 13.3096,9.25 14,9.25 C14.6904,9.25 15.25,8.69036 15.25,8 C15.25,7.30964 14.6904,6.75 14,6.75 Z"}))))),xy=Mr("success",()=>y("svg",{viewBox:"0 0 48 48",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},y("g",{"fill-rule":"nonzero"},y("path",{d:"M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M32.6338835,17.6161165 C32.1782718,17.1605048 31.4584514,17.1301307 30.9676119,17.5249942 L30.8661165,17.6161165 L20.75,27.732233 L17.1338835,24.1161165 C16.6457281,23.6279612 15.8542719,23.6279612 15.3661165,24.1161165 C14.9105048,24.5717282 14.8801307,25.2915486 15.2749942,25.7823881 L15.3661165,25.8838835 L19.8661165,30.3838835 C20.3217282,30.8394952 21.0415486,30.8698693 21.5323881,30.4750058 L21.6338835,30.3838835 L32.6338835,19.3838835 C33.1220388,18.8957281 33.1220388,18.1042719 32.6338835,17.6161165 Z"}))))),Cy=Mr("warning",()=>y("svg",{viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},y("g",{"fill-rule":"nonzero"},y("path",{d:"M12,2 C17.523,2 22,6.478 22,12 C22,17.522 17.523,22 12,22 C6.477,22 2,17.522 2,12 C2,6.478 6.477,2 12,2 Z M12.0018002,15.0037242 C11.450254,15.0037242 11.0031376,15.4508407 11.0031376,16.0023869 C11.0031376,16.553933 11.450254,17.0010495 12.0018002,17.0010495 C12.5533463,17.0010495 13.0004628,16.553933 13.0004628,16.0023869 C13.0004628,15.4508407 12.5533463,15.0037242 12.0018002,15.0037242 Z M11.99964,7 C11.4868042,7.00018474 11.0642719,7.38637706 11.0066858,7.8837365 L11,8.00036004 L11.0018003,13.0012393 L11.00857,13.117858 C11.0665141,13.6151758 11.4893244,14.0010638 12.0021602,14.0008793 C12.514996,14.0006946 12.9375283,13.6145023 12.9951144,13.1171428 L13.0018002,13.0005193 L13,7.99964009 L12.9932303,7.8830214 C12.9352861,7.38570354 12.5124758,6.99981552 11.99964,7 Z"}))))),{cubicBezierEaseInOut:yy}=ko;function vn({originalTransform:e="",left:t=0,top:o=0,transition:r=`all .3s ${yy} !important`}={}){return[L("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:`${e} scale(0.75)`,left:t,top:o,opacity:0}),L("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${e}`,left:t,top:o,opacity:1}),L("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:t,top:o,transition:r})]}const Sy=pe("base-clear",` flex-shrink: 0; height: 1em; width: 1em; @@ -76,7 +76,7 @@ ${t} left: 50%; top: 50%; transform: translateX(-50%) translateY(-50%); - `,[vn({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),ka=He({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return Er("-base-clear",Sy,Dt(e,"clsPrefix")),{handleMouseDown(t){t.preventDefault()}}},render(){const{clsPrefix:e}=this;return y("div",{class:`${e}-base-clear`},y(Hi,null,{default:()=>{var t,o;return this.show?y("div",{key:"dismiss",class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},Qr(this.$slots.icon,()=>[y(Tr,{clsPrefix:e},{default:()=>y(py,null)})])):y("div",{key:"icon",class:`${e}-base-clear__placeholder`},(o=(t=this.$slots).placeholder)===null||o===void 0?void 0:o.call(t))}}))}}),wy=pe("base-close",` + `,[vn({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),ka=He({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return _r("-base-clear",Sy,Dt(e,"clsPrefix")),{handleMouseDown(t){t.preventDefault()}}},render(){const{clsPrefix:e}=this;return y("div",{class:`${e}-base-clear`},y(Hi,null,{default:()=>{var t,o;return this.show?y("div",{key:"dismiss",class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},Qr(this.$slots.icon,()=>[y(Tr,{clsPrefix:e},{default:()=>y(py,null)})])):y("div",{key:"icon",class:`${e}-base-clear__placeholder`},(o=(t=this.$slots).placeholder)===null||o===void 0?void 0:o.call(t))}}))}}),wy=pe("base-close",` display: flex; align-items: center; justify-content: center; @@ -120,7 +120,7 @@ ${t} background-color: transparent; `),re("round",[L("&::before",` border-radius: 50%; - `)])]),Iu=He({name:"BaseClose",props:{isButtonTag:{type:Boolean,default:!0},clsPrefix:{type:String,required:!0},disabled:{type:Boolean,default:void 0},focusable:{type:Boolean,default:!0},round:Boolean,onClick:Function,absolute:Boolean},setup(e){return Er("-base-close",wy,Dt(e,"clsPrefix")),()=>{const{clsPrefix:t,disabled:o,absolute:r,round:n,isButtonTag:i}=e;return y(i?"button":"div",{type:i?"button":void 0,tabindex:o||!e.focusable?-1:0,"aria-disabled":o,"aria-label":"close",role:i?void 0:"button",disabled:o,class:[`${t}-base-close`,r&&`${t}-base-close--absolute`,o&&`${t}-base-close--disabled`,n&&`${t}-base-close--round`],onMousedown:l=>{e.focusable||l.preventDefault()},onClick:e.onClick},y(Tr,{clsPrefix:t},{default:()=>y(hy,null)}))}}}),_u=He({name:"FadeInExpandTransition",props:{appear:Boolean,group:Boolean,mode:String,onLeave:Function,onAfterLeave:Function,onAfterEnter:Function,width:Boolean,reverse:Boolean},setup(e,{slots:t}){function o(l){e.width?l.style.maxWidth=`${l.offsetWidth}px`:l.style.maxHeight=`${l.offsetHeight}px`,l.offsetWidth}function r(l){e.width?l.style.maxWidth="0":l.style.maxHeight="0",l.offsetWidth;const{onLeave:s}=e;s&&s()}function n(l){e.width?l.style.maxWidth="":l.style.maxHeight="";const{onAfterLeave:s}=e;s&&s()}function i(l){if(l.style.transition="none",e.width){const s=l.offsetWidth;l.style.maxWidth="0",l.offsetWidth,l.style.transition="",l.style.maxWidth=`${s}px`}else if(e.reverse)l.style.maxHeight=`${l.offsetHeight}px`,l.offsetHeight,l.style.transition="",l.style.maxHeight="0";else{const s=l.offsetHeight;l.style.maxHeight="0",l.offsetWidth,l.style.transition="",l.style.maxHeight=`${s}px`}l.offsetWidth}function a(l){var s;e.width?l.style.maxWidth="":e.reverse||(l.style.maxHeight=""),(s=e.onAfterEnter)===null||s===void 0||s.call(e)}return()=>{const{group:l,width:s,appear:c,mode:d}=e,u=l?Fg:un,p={name:s?"fade-in-width-expand-transition":"fade-in-height-expand-transition",appear:c,onEnter:i,onAfterEnter:a,onBeforeLeave:o,onLeave:r,onAfterLeave:n};return l||(p.mode=d),y(u,p,t)}}}),Py=L([L("@keyframes rotator",` + `)])]),Iu=He({name:"BaseClose",props:{isButtonTag:{type:Boolean,default:!0},clsPrefix:{type:String,required:!0},disabled:{type:Boolean,default:void 0},focusable:{type:Boolean,default:!0},round:Boolean,onClick:Function,absolute:Boolean},setup(e){return _r("-base-close",wy,Dt(e,"clsPrefix")),()=>{const{clsPrefix:t,disabled:o,absolute:r,round:n,isButtonTag:i}=e;return y(i?"button":"div",{type:i?"button":void 0,tabindex:o||!e.focusable?-1:0,"aria-disabled":o,"aria-label":"close",role:i?void 0:"button",disabled:o,class:[`${t}-base-close`,r&&`${t}-base-close--absolute`,o&&`${t}-base-close--disabled`,n&&`${t}-base-close--round`],onMousedown:l=>{e.focusable||l.preventDefault()},onClick:e.onClick},y(Tr,{clsPrefix:t},{default:()=>y(hy,null)}))}}}),Eu=He({name:"FadeInExpandTransition",props:{appear:Boolean,group:Boolean,mode:String,onLeave:Function,onAfterLeave:Function,onAfterEnter:Function,width:Boolean,reverse:Boolean},setup(e,{slots:t}){function o(l){e.width?l.style.maxWidth=`${l.offsetWidth}px`:l.style.maxHeight=`${l.offsetHeight}px`,l.offsetWidth}function r(l){e.width?l.style.maxWidth="0":l.style.maxHeight="0",l.offsetWidth;const{onLeave:s}=e;s&&s()}function n(l){e.width?l.style.maxWidth="":l.style.maxHeight="";const{onAfterLeave:s}=e;s&&s()}function i(l){if(l.style.transition="none",e.width){const s=l.offsetWidth;l.style.maxWidth="0",l.offsetWidth,l.style.transition="",l.style.maxWidth=`${s}px`}else if(e.reverse)l.style.maxHeight=`${l.offsetHeight}px`,l.offsetHeight,l.style.transition="",l.style.maxHeight="0";else{const s=l.offsetHeight;l.style.maxHeight="0",l.offsetWidth,l.style.transition="",l.style.maxHeight=`${s}px`}l.offsetWidth}function a(l){var s;e.width?l.style.maxWidth="":e.reverse||(l.style.maxHeight=""),(s=e.onAfterEnter)===null||s===void 0||s.call(e)}return()=>{const{group:l,width:s,appear:c,mode:d}=e,u=l?Fg:un,p={name:s?"fade-in-width-expand-transition":"fade-in-height-expand-transition",appear:c,onEnter:i,onAfterEnter:a,onBeforeLeave:o,onLeave:r,onAfterLeave:n};return l||(p.mode=d),y(u,p,t)}}}),Py=L([L("@keyframes rotator",` 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); @@ -147,7 +147,7 @@ ${t} `,[V("icon",` height: 1em; width: 1em; - `)])])]),ia="1.6s",Ty={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},vl=He({name:"BaseLoading",props:Object.assign({clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},scale:{type:Number,default:1},radius:{type:Number,default:100}},Ty),setup(e){Er("-base-loading",Py,Dt(e,"clsPrefix"))},render(){const{clsPrefix:e,radius:t,strokeWidth:o,stroke:r,scale:n}=this,i=t/n;return y("div",{class:`${e}-base-loading`,role:"img","aria-label":"loading"},y(Hi,null,{default:()=>this.show?y("div",{key:"icon",class:`${e}-base-loading__transition-wrapper`},y("div",{class:`${e}-base-loading__container`},y("svg",{class:`${e}-base-loading__icon`,viewBox:`0 0 ${2*i} ${2*i}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},y("g",null,y("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${i} ${i};270 ${i} ${i}`,begin:"0s",dur:ia,fill:"freeze",repeatCount:"indefinite"}),y("circle",{class:`${e}-base-loading__icon`,fill:"none",stroke:"currentColor","stroke-width":o,"stroke-linecap":"round",cx:i,cy:i,r:t-o/2,"stroke-dasharray":5.67*t,"stroke-dashoffset":18.48*t},y("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${i} ${i};135 ${i} ${i};450 ${i} ${i}`,begin:"0s",dur:ia,fill:"freeze",repeatCount:"indefinite"}),y("animate",{attributeName:"stroke-dashoffset",values:`${5.67*t};${1.42*t};${5.67*t}`,begin:"0s",dur:ia,fill:"freeze",repeatCount:"indefinite"})))))):y("div",{key:"placeholder",class:`${e}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:Xs}=ko;function $y({name:e="fade-in",enterDuration:t="0.2s",leaveDuration:o="0.2s",enterCubicBezier:r=Xs,leaveCubicBezier:n=Xs}={}){return[L(`&.${e}-transition-enter-active`,{transition:`all ${t} ${r}!important`}),L(`&.${e}-transition-leave-active`,{transition:`all ${o} ${n}!important`}),L(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0}),L(`&.${e}-transition-leave-from, &.${e}-transition-enter-to`,{opacity:1})]}const Z={neutralBase:"#000",neutralInvertBase:"#fff",neutralTextBase:"#fff",neutralPopover:"rgb(72, 72, 78)",neutralCard:"rgb(24, 24, 28)",neutralModal:"rgb(44, 44, 50)",neutralBody:"rgb(16, 16, 20)",alpha1:"0.9",alpha2:"0.82",alpha3:"0.52",alpha4:"0.38",alpha5:"0.28",alphaClose:"0.52",alphaDisabled:"0.38",alphaDisabledInput:"0.06",alphaPending:"0.09",alphaTablePending:"0.06",alphaTableStriped:"0.05",alphaPressed:"0.05",alphaAvatar:"0.18",alphaRail:"0.2",alphaProgressRail:"0.12",alphaBorder:"0.24",alphaDivider:"0.09",alphaInput:"0.1",alphaAction:"0.06",alphaTab:"0.04",alphaScrollbar:"0.2",alphaScrollbarHover:"0.3",alphaCode:"0.12",alphaTag:"0.2",primaryHover:"#7fe7c4",primaryDefault:"#63e2b7",primaryActive:"#5acea7",primarySuppl:"rgb(42, 148, 125)",infoHover:"#8acbec",infoDefault:"#70c0e8",infoActive:"#66afd3",infoSuppl:"rgb(56, 137, 197)",errorHover:"#e98b8b",errorDefault:"#e88080",errorActive:"#e57272",errorSuppl:"rgb(208, 58, 82)",warningHover:"#f5d599",warningDefault:"#f2c97d",warningActive:"#e6c260",warningSuppl:"rgb(240, 138, 0)",successHover:"#7fe7c4",successDefault:"#63e2b7",successActive:"#5acea7",successSuppl:"rgb(42, 148, 125)"},Ry=ho(Z.neutralBase),Eu=ho(Z.neutralInvertBase),Fy=`rgba(${Eu.slice(0,3).join(", ")}, `;function Se(e){return`${Fy+String(e)})`}function Ay(e){const t=Array.from(Eu);return t[3]=Number(e),ee(Ry,t)}const W=Object.assign(Object.assign({name:"common"},ko),{baseColor:Z.neutralBase,primaryColor:Z.primaryDefault,primaryColorHover:Z.primaryHover,primaryColorPressed:Z.primaryActive,primaryColorSuppl:Z.primarySuppl,infoColor:Z.infoDefault,infoColorHover:Z.infoHover,infoColorPressed:Z.infoActive,infoColorSuppl:Z.infoSuppl,successColor:Z.successDefault,successColorHover:Z.successHover,successColorPressed:Z.successActive,successColorSuppl:Z.successSuppl,warningColor:Z.warningDefault,warningColorHover:Z.warningHover,warningColorPressed:Z.warningActive,warningColorSuppl:Z.warningSuppl,errorColor:Z.errorDefault,errorColorHover:Z.errorHover,errorColorPressed:Z.errorActive,errorColorSuppl:Z.errorSuppl,textColorBase:Z.neutralTextBase,textColor1:Se(Z.alpha1),textColor2:Se(Z.alpha2),textColor3:Se(Z.alpha3),textColorDisabled:Se(Z.alpha4),placeholderColor:Se(Z.alpha4),placeholderColorDisabled:Se(Z.alpha5),iconColor:Se(Z.alpha4),iconColorDisabled:Se(Z.alpha5),iconColorHover:Se(Number(Z.alpha4)*1.25),iconColorPressed:Se(Number(Z.alpha4)*.8),opacity1:Z.alpha1,opacity2:Z.alpha2,opacity3:Z.alpha3,opacity4:Z.alpha4,opacity5:Z.alpha5,dividerColor:Se(Z.alphaDivider),borderColor:Se(Z.alphaBorder),closeIconColorHover:Se(Number(Z.alphaClose)),closeIconColor:Se(Number(Z.alphaClose)),closeIconColorPressed:Se(Number(Z.alphaClose)),closeColorHover:"rgba(255, 255, 255, .12)",closeColorPressed:"rgba(255, 255, 255, .08)",clearColor:Se(Z.alpha4),clearColorHover:Ne(Se(Z.alpha4),{alpha:1.25}),clearColorPressed:Ne(Se(Z.alpha4),{alpha:.8}),scrollbarColor:Se(Z.alphaScrollbar),scrollbarColorHover:Se(Z.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:Se(Z.alphaProgressRail),railColor:Se(Z.alphaRail),popoverColor:Z.neutralPopover,tableColor:Z.neutralCard,cardColor:Z.neutralCard,modalColor:Z.neutralModal,bodyColor:Z.neutralBody,tagColor:Ay(Z.alphaTag),avatarColor:Se(Z.alphaAvatar),invertedColor:Z.neutralBase,inputColor:Se(Z.alphaInput),codeColor:Se(Z.alphaCode),tabColor:Se(Z.alphaTab),actionColor:Se(Z.alphaAction),tableHeaderColor:Se(Z.alphaAction),hoverColor:Se(Z.alphaPending),tableColorHover:Se(Z.alphaTablePending),tableColorStriped:Se(Z.alphaTableStriped),pressedColor:Se(Z.alphaPressed),opacityDisabled:Z.alphaDisabled,inputColorDisabled:Se(Z.alphaDisabledInput),buttonColor2:"rgba(255, 255, 255, .08)",buttonColor2Hover:"rgba(255, 255, 255, .12)",buttonColor2Pressed:"rgba(255, 255, 255, .08)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .24), 0 3px 6px 0 rgba(0, 0, 0, .18), 0 5px 12px 4px rgba(0, 0, 0, .12)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .24), 0 6px 12px 0 rgba(0, 0, 0, .16), 0 9px 18px 8px rgba(0, 0, 0, .10)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),ue={neutralBase:"#FFF",neutralInvertBase:"#000",neutralTextBase:"#000",neutralPopover:"#fff",neutralCard:"#fff",neutralModal:"#fff",neutralBody:"#fff",alpha1:"0.82",alpha2:"0.72",alpha3:"0.38",alpha4:"0.24",alpha5:"0.18",alphaClose:"0.6",alphaDisabled:"0.5",alphaAvatar:"0.2",alphaProgressRail:".08",alphaInput:"0",alphaScrollbar:"0.25",alphaScrollbarHover:"0.4",primaryHover:"#36ad6a",primaryDefault:"#18a058",primaryActive:"#0c7a43",primarySuppl:"#36ad6a",infoHover:"#4098fc",infoDefault:"#2080f0",infoActive:"#1060c9",infoSuppl:"#4098fc",errorHover:"#de576d",errorDefault:"#d03050",errorActive:"#ab1f3f",errorSuppl:"#de576d",warningHover:"#fcb040",warningDefault:"#f0a020",warningActive:"#c97c10",warningSuppl:"#fcb040",successHover:"#36ad6a",successDefault:"#18a058",successActive:"#0c7a43",successSuppl:"#36ad6a"},Iy=ho(ue.neutralBase),Mu=ho(ue.neutralInvertBase),_y=`rgba(${Mu.slice(0,3).join(", ")}, `;function Js(e){return`${_y+String(e)})`}function ct(e){const t=Array.from(Mu);return t[3]=Number(e),ee(Iy,t)}const Be=Object.assign(Object.assign({name:"common"},ko),{baseColor:ue.neutralBase,primaryColor:ue.primaryDefault,primaryColorHover:ue.primaryHover,primaryColorPressed:ue.primaryActive,primaryColorSuppl:ue.primarySuppl,infoColor:ue.infoDefault,infoColorHover:ue.infoHover,infoColorPressed:ue.infoActive,infoColorSuppl:ue.infoSuppl,successColor:ue.successDefault,successColorHover:ue.successHover,successColorPressed:ue.successActive,successColorSuppl:ue.successSuppl,warningColor:ue.warningDefault,warningColorHover:ue.warningHover,warningColorPressed:ue.warningActive,warningColorSuppl:ue.warningSuppl,errorColor:ue.errorDefault,errorColorHover:ue.errorHover,errorColorPressed:ue.errorActive,errorColorSuppl:ue.errorSuppl,textColorBase:ue.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:ct(ue.alpha4),placeholderColor:ct(ue.alpha4),placeholderColorDisabled:ct(ue.alpha5),iconColor:ct(ue.alpha4),iconColorHover:Ne(ct(ue.alpha4),{lightness:.75}),iconColorPressed:Ne(ct(ue.alpha4),{lightness:.9}),iconColorDisabled:ct(ue.alpha5),opacity1:ue.alpha1,opacity2:ue.alpha2,opacity3:ue.alpha3,opacity4:ue.alpha4,opacity5:ue.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:ct(Number(ue.alphaClose)),closeIconColorHover:ct(Number(ue.alphaClose)),closeIconColorPressed:ct(Number(ue.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:ct(ue.alpha4),clearColorHover:Ne(ct(ue.alpha4),{lightness:.75}),clearColorPressed:Ne(ct(ue.alpha4),{lightness:.9}),scrollbarColor:Js(ue.alphaScrollbar),scrollbarColorHover:Js(ue.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:ct(ue.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:ue.neutralPopover,tableColor:ue.neutralCard,cardColor:ue.neutralCard,modalColor:ue.neutralModal,bodyColor:ue.neutralBody,tagColor:"#eee",avatarColor:ct(ue.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:ct(ue.alphaInput),codeColor:"rgb(244, 244, 248)",tabColor:"rgb(247, 247, 250)",actionColor:"rgb(250, 250, 252)",tableHeaderColor:"rgb(250, 250, 252)",hoverColor:"rgb(243, 243, 245)",tableColorHover:"rgba(0, 0, 100, 0.03)",tableColorStriped:"rgba(0, 0, 100, 0.02)",pressedColor:"rgb(237, 237, 239)",opacityDisabled:ue.alphaDisabled,inputColorDisabled:"rgb(250, 250, 252)",buttonColor2:"rgba(46, 51, 56, .05)",buttonColor2Hover:"rgba(46, 51, 56, .09)",buttonColor2Pressed:"rgba(46, 51, 56, .13)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),Ey={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function zu(e){const{scrollbarColor:t,scrollbarColorHover:o,scrollbarHeight:r,scrollbarWidth:n,scrollbarBorderRadius:i}=e;return Object.assign(Object.assign({},Ey),{height:r,width:n,borderRadius:i,color:t,colorHover:o})}const Rn={name:"Scrollbar",common:Be,self:zu},St={name:"Scrollbar",common:W,self:zu},My=pe("scrollbar",` + `)])])]),ia="1.6s",Ty={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},vl=He({name:"BaseLoading",props:Object.assign({clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},scale:{type:Number,default:1},radius:{type:Number,default:100}},Ty),setup(e){_r("-base-loading",Py,Dt(e,"clsPrefix"))},render(){const{clsPrefix:e,radius:t,strokeWidth:o,stroke:r,scale:n}=this,i=t/n;return y("div",{class:`${e}-base-loading`,role:"img","aria-label":"loading"},y(Hi,null,{default:()=>this.show?y("div",{key:"icon",class:`${e}-base-loading__transition-wrapper`},y("div",{class:`${e}-base-loading__container`},y("svg",{class:`${e}-base-loading__icon`,viewBox:`0 0 ${2*i} ${2*i}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},y("g",null,y("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${i} ${i};270 ${i} ${i}`,begin:"0s",dur:ia,fill:"freeze",repeatCount:"indefinite"}),y("circle",{class:`${e}-base-loading__icon`,fill:"none",stroke:"currentColor","stroke-width":o,"stroke-linecap":"round",cx:i,cy:i,r:t-o/2,"stroke-dasharray":5.67*t,"stroke-dashoffset":18.48*t},y("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${i} ${i};135 ${i} ${i};450 ${i} ${i}`,begin:"0s",dur:ia,fill:"freeze",repeatCount:"indefinite"}),y("animate",{attributeName:"stroke-dashoffset",values:`${5.67*t};${1.42*t};${5.67*t}`,begin:"0s",dur:ia,fill:"freeze",repeatCount:"indefinite"})))))):y("div",{key:"placeholder",class:`${e}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:Xs}=ko;function $y({name:e="fade-in",enterDuration:t="0.2s",leaveDuration:o="0.2s",enterCubicBezier:r=Xs,leaveCubicBezier:n=Xs}={}){return[L(`&.${e}-transition-enter-active`,{transition:`all ${t} ${r}!important`}),L(`&.${e}-transition-leave-active`,{transition:`all ${o} ${n}!important`}),L(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0}),L(`&.${e}-transition-leave-from, &.${e}-transition-enter-to`,{opacity:1})]}const Z={neutralBase:"#000",neutralInvertBase:"#fff",neutralTextBase:"#fff",neutralPopover:"rgb(72, 72, 78)",neutralCard:"rgb(24, 24, 28)",neutralModal:"rgb(44, 44, 50)",neutralBody:"rgb(16, 16, 20)",alpha1:"0.9",alpha2:"0.82",alpha3:"0.52",alpha4:"0.38",alpha5:"0.28",alphaClose:"0.52",alphaDisabled:"0.38",alphaDisabledInput:"0.06",alphaPending:"0.09",alphaTablePending:"0.06",alphaTableStriped:"0.05",alphaPressed:"0.05",alphaAvatar:"0.18",alphaRail:"0.2",alphaProgressRail:"0.12",alphaBorder:"0.24",alphaDivider:"0.09",alphaInput:"0.1",alphaAction:"0.06",alphaTab:"0.04",alphaScrollbar:"0.2",alphaScrollbarHover:"0.3",alphaCode:"0.12",alphaTag:"0.2",primaryHover:"#7fe7c4",primaryDefault:"#63e2b7",primaryActive:"#5acea7",primarySuppl:"rgb(42, 148, 125)",infoHover:"#8acbec",infoDefault:"#70c0e8",infoActive:"#66afd3",infoSuppl:"rgb(56, 137, 197)",errorHover:"#e98b8b",errorDefault:"#e88080",errorActive:"#e57272",errorSuppl:"rgb(208, 58, 82)",warningHover:"#f5d599",warningDefault:"#f2c97d",warningActive:"#e6c260",warningSuppl:"rgb(240, 138, 0)",successHover:"#7fe7c4",successDefault:"#63e2b7",successActive:"#5acea7",successSuppl:"rgb(42, 148, 125)"},Ry=ho(Z.neutralBase),_u=ho(Z.neutralInvertBase),Fy=`rgba(${_u.slice(0,3).join(", ")}, `;function Se(e){return`${Fy+String(e)})`}function Ay(e){const t=Array.from(_u);return t[3]=Number(e),ee(Ry,t)}const W=Object.assign(Object.assign({name:"common"},ko),{baseColor:Z.neutralBase,primaryColor:Z.primaryDefault,primaryColorHover:Z.primaryHover,primaryColorPressed:Z.primaryActive,primaryColorSuppl:Z.primarySuppl,infoColor:Z.infoDefault,infoColorHover:Z.infoHover,infoColorPressed:Z.infoActive,infoColorSuppl:Z.infoSuppl,successColor:Z.successDefault,successColorHover:Z.successHover,successColorPressed:Z.successActive,successColorSuppl:Z.successSuppl,warningColor:Z.warningDefault,warningColorHover:Z.warningHover,warningColorPressed:Z.warningActive,warningColorSuppl:Z.warningSuppl,errorColor:Z.errorDefault,errorColorHover:Z.errorHover,errorColorPressed:Z.errorActive,errorColorSuppl:Z.errorSuppl,textColorBase:Z.neutralTextBase,textColor1:Se(Z.alpha1),textColor2:Se(Z.alpha2),textColor3:Se(Z.alpha3),textColorDisabled:Se(Z.alpha4),placeholderColor:Se(Z.alpha4),placeholderColorDisabled:Se(Z.alpha5),iconColor:Se(Z.alpha4),iconColorDisabled:Se(Z.alpha5),iconColorHover:Se(Number(Z.alpha4)*1.25),iconColorPressed:Se(Number(Z.alpha4)*.8),opacity1:Z.alpha1,opacity2:Z.alpha2,opacity3:Z.alpha3,opacity4:Z.alpha4,opacity5:Z.alpha5,dividerColor:Se(Z.alphaDivider),borderColor:Se(Z.alphaBorder),closeIconColorHover:Se(Number(Z.alphaClose)),closeIconColor:Se(Number(Z.alphaClose)),closeIconColorPressed:Se(Number(Z.alphaClose)),closeColorHover:"rgba(255, 255, 255, .12)",closeColorPressed:"rgba(255, 255, 255, .08)",clearColor:Se(Z.alpha4),clearColorHover:Ne(Se(Z.alpha4),{alpha:1.25}),clearColorPressed:Ne(Se(Z.alpha4),{alpha:.8}),scrollbarColor:Se(Z.alphaScrollbar),scrollbarColorHover:Se(Z.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:Se(Z.alphaProgressRail),railColor:Se(Z.alphaRail),popoverColor:Z.neutralPopover,tableColor:Z.neutralCard,cardColor:Z.neutralCard,modalColor:Z.neutralModal,bodyColor:Z.neutralBody,tagColor:Ay(Z.alphaTag),avatarColor:Se(Z.alphaAvatar),invertedColor:Z.neutralBase,inputColor:Se(Z.alphaInput),codeColor:Se(Z.alphaCode),tabColor:Se(Z.alphaTab),actionColor:Se(Z.alphaAction),tableHeaderColor:Se(Z.alphaAction),hoverColor:Se(Z.alphaPending),tableColorHover:Se(Z.alphaTablePending),tableColorStriped:Se(Z.alphaTableStriped),pressedColor:Se(Z.alphaPressed),opacityDisabled:Z.alphaDisabled,inputColorDisabled:Se(Z.alphaDisabledInput),buttonColor2:"rgba(255, 255, 255, .08)",buttonColor2Hover:"rgba(255, 255, 255, .12)",buttonColor2Pressed:"rgba(255, 255, 255, .08)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .24), 0 3px 6px 0 rgba(0, 0, 0, .18), 0 5px 12px 4px rgba(0, 0, 0, .12)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .24), 0 6px 12px 0 rgba(0, 0, 0, .16), 0 9px 18px 8px rgba(0, 0, 0, .10)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),ue={neutralBase:"#FFF",neutralInvertBase:"#000",neutralTextBase:"#000",neutralPopover:"#fff",neutralCard:"#fff",neutralModal:"#fff",neutralBody:"#fff",alpha1:"0.82",alpha2:"0.72",alpha3:"0.38",alpha4:"0.24",alpha5:"0.18",alphaClose:"0.6",alphaDisabled:"0.5",alphaAvatar:"0.2",alphaProgressRail:".08",alphaInput:"0",alphaScrollbar:"0.25",alphaScrollbarHover:"0.4",primaryHover:"#36ad6a",primaryDefault:"#18a058",primaryActive:"#0c7a43",primarySuppl:"#36ad6a",infoHover:"#4098fc",infoDefault:"#2080f0",infoActive:"#1060c9",infoSuppl:"#4098fc",errorHover:"#de576d",errorDefault:"#d03050",errorActive:"#ab1f3f",errorSuppl:"#de576d",warningHover:"#fcb040",warningDefault:"#f0a020",warningActive:"#c97c10",warningSuppl:"#fcb040",successHover:"#36ad6a",successDefault:"#18a058",successActive:"#0c7a43",successSuppl:"#36ad6a"},Iy=ho(ue.neutralBase),Mu=ho(ue.neutralInvertBase),Ey=`rgba(${Mu.slice(0,3).join(", ")}, `;function Js(e){return`${Ey+String(e)})`}function ct(e){const t=Array.from(Mu);return t[3]=Number(e),ee(Iy,t)}const Be=Object.assign(Object.assign({name:"common"},ko),{baseColor:ue.neutralBase,primaryColor:ue.primaryDefault,primaryColorHover:ue.primaryHover,primaryColorPressed:ue.primaryActive,primaryColorSuppl:ue.primarySuppl,infoColor:ue.infoDefault,infoColorHover:ue.infoHover,infoColorPressed:ue.infoActive,infoColorSuppl:ue.infoSuppl,successColor:ue.successDefault,successColorHover:ue.successHover,successColorPressed:ue.successActive,successColorSuppl:ue.successSuppl,warningColor:ue.warningDefault,warningColorHover:ue.warningHover,warningColorPressed:ue.warningActive,warningColorSuppl:ue.warningSuppl,errorColor:ue.errorDefault,errorColorHover:ue.errorHover,errorColorPressed:ue.errorActive,errorColorSuppl:ue.errorSuppl,textColorBase:ue.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:ct(ue.alpha4),placeholderColor:ct(ue.alpha4),placeholderColorDisabled:ct(ue.alpha5),iconColor:ct(ue.alpha4),iconColorHover:Ne(ct(ue.alpha4),{lightness:.75}),iconColorPressed:Ne(ct(ue.alpha4),{lightness:.9}),iconColorDisabled:ct(ue.alpha5),opacity1:ue.alpha1,opacity2:ue.alpha2,opacity3:ue.alpha3,opacity4:ue.alpha4,opacity5:ue.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:ct(Number(ue.alphaClose)),closeIconColorHover:ct(Number(ue.alphaClose)),closeIconColorPressed:ct(Number(ue.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:ct(ue.alpha4),clearColorHover:Ne(ct(ue.alpha4),{lightness:.75}),clearColorPressed:Ne(ct(ue.alpha4),{lightness:.9}),scrollbarColor:Js(ue.alphaScrollbar),scrollbarColorHover:Js(ue.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:ct(ue.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:ue.neutralPopover,tableColor:ue.neutralCard,cardColor:ue.neutralCard,modalColor:ue.neutralModal,bodyColor:ue.neutralBody,tagColor:"#eee",avatarColor:ct(ue.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:ct(ue.alphaInput),codeColor:"rgb(244, 244, 248)",tabColor:"rgb(247, 247, 250)",actionColor:"rgb(250, 250, 252)",tableHeaderColor:"rgb(250, 250, 252)",hoverColor:"rgb(243, 243, 245)",tableColorHover:"rgba(0, 0, 100, 0.03)",tableColorStriped:"rgba(0, 0, 100, 0.02)",pressedColor:"rgb(237, 237, 239)",opacityDisabled:ue.alphaDisabled,inputColorDisabled:"rgb(250, 250, 252)",buttonColor2:"rgba(46, 51, 56, .05)",buttonColor2Hover:"rgba(46, 51, 56, .09)",buttonColor2Pressed:"rgba(46, 51, 56, .13)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),_y={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function zu(e){const{scrollbarColor:t,scrollbarColorHover:o,scrollbarHeight:r,scrollbarWidth:n,scrollbarBorderRadius:i}=e;return Object.assign(Object.assign({},_y),{height:r,width:n,borderRadius:i,color:t,colorHover:o})}const Rn={name:"Scrollbar",common:Be,self:zu},St={name:"Scrollbar",common:W,self:zu},My=pe("scrollbar",` overflow: hidden; position: relative; z-index: auto; @@ -212,7 +212,7 @@ ${t} pointer-events: all; background-color: var(--n-scrollbar-color); transition: background-color .2s var(--n-scrollbar-bezier); - `,[$y(),L("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),zy=Object.assign(Object.assign({},Ct.props),{duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean,yPlacement:{type:String,default:"right"},xPlacement:{type:String,default:"bottom"}}),Hu=He({name:"Scrollbar",props:zy,inheritAttrs:!1,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:o,mergedRtlRef:r}=zo(e),n=$n("Scrollbar",r,t),i=fe(null),a=fe(null),l=fe(null),s=fe(null),c=fe(null),d=fe(null),u=fe(null),p=fe(null),m=fe(null),f=fe(null),g=fe(null),S=fe(0),v=fe(0),$=fe(!1),T=fe(!1);let w=!1,_=!1,O,x,F=0,R=0,B=0,j=0;const A=Jm(),J=Ct("Scrollbar","-scrollbar",My,Rn,e,t),G=Y(()=>{const{value:D}=p,{value:Q}=d,{value:ge}=f;return D===null||Q===null||ge===null?0:Math.min(D,ge*D/Q+ms(J.value.self.width)*1.5)}),le=Y(()=>`${G.value}px`),te=Y(()=>{const{value:D}=m,{value:Q}=u,{value:ge}=g;return D===null||Q===null||ge===null?0:ge*D/Q+ms(J.value.self.height)*1.5}),N=Y(()=>`${te.value}px`),oe=Y(()=>{const{value:D}=p,{value:Q}=S,{value:ge}=d,{value:Ee}=f;if(D===null||ge===null||Ee===null)return 0;{const je=ge-D;return je?Q/je*(Ee-G.value):0}}),ye=Y(()=>`${oe.value}px`),Pe=Y(()=>{const{value:D}=m,{value:Q}=v,{value:ge}=u,{value:Ee}=g;if(D===null||ge===null||Ee===null)return 0;{const je=ge-D;return je?Q/je*(Ee-te.value):0}}),Re=Y(()=>`${Pe.value}px`),Fe=Y(()=>{const{value:D}=p,{value:Q}=d;return D!==null&&Q!==null&&Q>D}),Ve=Y(()=>{const{value:D}=m,{value:Q}=u;return D!==null&&Q!==null&&Q>D}),qe=Y(()=>{const{trigger:D}=e;return D==="none"||$.value}),gt=Y(()=>{const{trigger:D}=e;return D==="none"||T.value}),he=Y(()=>{const{container:D}=e;return D?D():a.value}),Ue=Y(()=>{const{content:D}=e;return D?D():l.value}),rt=(D,Q)=>{if(!e.scrollable)return;if(typeof D=="number"){b(D,Q??0,0,!1,"auto");return}const{left:ge,top:Ee,index:je,elSize:lt,position:Tt,behavior:ke,el:st,debounce:jt=!0}=D;(ge!==void 0||Ee!==void 0)&&b(ge??0,Ee??0,0,!1,ke),st!==void 0?b(0,st.offsetTop,st.offsetHeight,jt,ke):je!==void 0&<!==void 0?b(0,je*lt,lt,jt,ke):Tt==="bottom"?b(0,Number.MAX_SAFE_INTEGER,0,!1,ke):Tt==="top"&&b(0,0,0,!1,ke)},be=Qm(()=>{e.container||rt({top:S.value,left:v.value})}),Ge=()=>{be.isDeactivated||se()},Pt=D=>{if(be.isDeactivated)return;const{onResize:Q}=e;Q&&Q(D),se()},h=(D,Q)=>{if(!e.scrollable)return;const{value:ge}=he;ge&&(typeof D=="object"?ge.scrollBy(D):ge.scrollBy(D,Q||0))};function b(D,Q,ge,Ee,je){const{value:lt}=he;if(lt){if(Ee){const{scrollTop:Tt,offsetHeight:ke}=lt;if(Q>Tt){Q+ge<=Tt+ke||lt.scrollTo({left:D,top:Q+ge-ke,behavior:je});return}}lt.scrollTo({left:D,top:Q,behavior:je})}}function P(){U(),z(),se()}function H(){M()}function M(){k(),q()}function k(){x!==void 0&&window.clearTimeout(x),x=window.setTimeout(()=>{T.value=!1},e.duration)}function q(){O!==void 0&&window.clearTimeout(O),O=window.setTimeout(()=>{$.value=!1},e.duration)}function U(){O!==void 0&&window.clearTimeout(O),$.value=!0}function z(){x!==void 0&&window.clearTimeout(x),T.value=!0}function I(D){const{onScroll:Q}=e;Q&&Q(D),ie()}function ie(){const{value:D}=he;D&&(S.value=D.scrollTop,v.value=D.scrollLeft*(n!=null&&n.value?-1:1))}function X(){const{value:D}=Ue;D&&(d.value=D.offsetHeight,u.value=D.offsetWidth);const{value:Q}=he;Q&&(p.value=Q.offsetHeight,m.value=Q.offsetWidth);const{value:ge}=c,{value:Ee}=s;ge&&(g.value=ge.offsetWidth),Ee&&(f.value=Ee.offsetHeight)}function ne(){const{value:D}=he;D&&(S.value=D.scrollTop,v.value=D.scrollLeft*(n!=null&&n.value?-1:1),p.value=D.offsetHeight,m.value=D.offsetWidth,d.value=D.scrollHeight,u.value=D.scrollWidth);const{value:Q}=c,{value:ge}=s;Q&&(g.value=Q.offsetWidth),ge&&(f.value=ge.offsetHeight)}function se(){e.scrollable&&(e.useUnifiedContainer?ne():(X(),ie()))}function ve(D){var Q;return!(!((Q=i.value)===null||Q===void 0)&&Q.contains(Im(D)))}function Te(D){D.preventDefault(),D.stopPropagation(),_=!0,Go("mousemove",window,Ce,!0),Go("mouseup",window,Ze,!0),R=v.value,B=n!=null&&n.value?window.innerWidth-D.clientX:D.clientX}function Ce(D){if(!_)return;O!==void 0&&window.clearTimeout(O),x!==void 0&&window.clearTimeout(x);const{value:Q}=m,{value:ge}=u,{value:Ee}=te;if(Q===null||ge===null)return;const lt=(n!=null&&n.value?window.innerWidth-D.clientX-B:D.clientX-B)*(ge-Q)/(Q-Ee),Tt=ge-Q;let ke=R+lt;ke=Math.min(Tt,ke),ke=Math.max(ke,0);const{value:st}=he;if(st){st.scrollLeft=ke*(n!=null&&n.value?-1:1);const{internalOnUpdateScrollLeft:jt}=e;jt&&jt(ke)}}function Ze(D){D.preventDefault(),D.stopPropagation(),lo("mousemove",window,Ce,!0),lo("mouseup",window,Ze,!0),_=!1,se(),ve(D)&&M()}function Qe(D){D.preventDefault(),D.stopPropagation(),w=!0,Go("mousemove",window,nt,!0),Go("mouseup",window,it,!0),F=S.value,j=D.clientY}function nt(D){if(!w)return;O!==void 0&&window.clearTimeout(O),x!==void 0&&window.clearTimeout(x);const{value:Q}=p,{value:ge}=d,{value:Ee}=G;if(Q===null||ge===null)return;const lt=(D.clientY-j)*(ge-Q)/(Q-Ee),Tt=ge-Q;let ke=F+lt;ke=Math.min(Tt,ke),ke=Math.max(ke,0);const{value:st}=he;st&&(st.scrollTop=ke)}function it(D){D.preventDefault(),D.stopPropagation(),lo("mousemove",window,nt,!0),lo("mouseup",window,it,!0),w=!1,se(),ve(D)&&M()}sn(()=>{const{value:D}=Ve,{value:Q}=Fe,{value:ge}=t,{value:Ee}=c,{value:je}=s;Ee&&(D?Ee.classList.remove(`${ge}-scrollbar-rail--disabled`):Ee.classList.add(`${ge}-scrollbar-rail--disabled`)),je&&(Q?je.classList.remove(`${ge}-scrollbar-rail--disabled`):je.classList.add(`${ge}-scrollbar-rail--disabled`))}),Mo(()=>{e.container||se()}),nr(()=>{O!==void 0&&window.clearTimeout(O),x!==void 0&&window.clearTimeout(x),lo("mousemove",window,nt,!0),lo("mouseup",window,it,!0)});const Wt=Y(()=>{const{common:{cubicBezierEaseInOut:D},self:{color:Q,colorHover:ge,height:Ee,width:je,borderRadius:lt,railInsetHorizontalTop:Tt,railInsetHorizontalBottom:ke,railInsetVerticalRight:st,railInsetVerticalLeft:jt,railColor:_n}}=J.value,{top:Oi,right:sr,bottom:cr,left:Bi}=Vo(Tt),{top:Li,right:En,bottom:bo,left:C}=Vo(ke),{top:E,right:de,bottom:Ie,left:Oe}=Vo(n!=null&&n.value?_s(st):st),{top:Ae,right:oo,bottom:ro,left:no}=Vo(n!=null&&n.value?_s(jt):jt);return{"--n-scrollbar-bezier":D,"--n-scrollbar-color":Q,"--n-scrollbar-color-hover":ge,"--n-scrollbar-border-radius":lt,"--n-scrollbar-width":je,"--n-scrollbar-height":Ee,"--n-scrollbar-rail-top-horizontal-top":Oi,"--n-scrollbar-rail-right-horizontal-top":sr,"--n-scrollbar-rail-bottom-horizontal-top":cr,"--n-scrollbar-rail-left-horizontal-top":Bi,"--n-scrollbar-rail-top-horizontal-bottom":Li,"--n-scrollbar-rail-right-horizontal-bottom":En,"--n-scrollbar-rail-bottom-horizontal-bottom":bo,"--n-scrollbar-rail-left-horizontal-bottom":C,"--n-scrollbar-rail-top-vertical-right":E,"--n-scrollbar-rail-right-vertical-right":de,"--n-scrollbar-rail-bottom-vertical-right":Ie,"--n-scrollbar-rail-left-vertical-right":Oe,"--n-scrollbar-rail-top-vertical-left":Ae,"--n-scrollbar-rail-right-vertical-left":oo,"--n-scrollbar-rail-bottom-vertical-left":ro,"--n-scrollbar-rail-left-vertical-left":no,"--n-scrollbar-rail-color":_n}}),Ht=o?Fr("scrollbar",void 0,Wt,e):void 0;return Object.assign(Object.assign({},{scrollTo:rt,scrollBy:h,sync:se,syncUnifiedContainer:ne,handleMouseEnterWrapper:P,handleMouseLeaveWrapper:H}),{mergedClsPrefix:t,rtlEnabled:n,containerScrollTop:S,wrapperRef:i,containerRef:a,contentRef:l,yRailRef:s,xRailRef:c,needYBar:Fe,needXBar:Ve,yBarSizePx:le,xBarSizePx:N,yBarTopPx:ye,xBarLeftPx:Re,isShowXBar:qe,isShowYBar:gt,isIos:A,handleScroll:I,handleContentResize:Ge,handleContainerResize:Pt,handleYScrollMouseDown:Qe,handleXScrollMouseDown:Te,cssVars:o?void 0:Wt,themeClass:Ht==null?void 0:Ht.themeClass,onRender:Ht==null?void 0:Ht.onRender})},render(){var e;const{$slots:t,mergedClsPrefix:o,triggerDisplayManually:r,rtlEnabled:n,internalHoistYRail:i,yPlacement:a,xPlacement:l,xScrollable:s}=this;if(!this.scrollable)return(e=t.default)===null||e===void 0?void 0:e.call(t);const c=this.trigger==="none",d=(m,f)=>y("div",{ref:"yRailRef",class:[`${o}-scrollbar-rail`,`${o}-scrollbar-rail--vertical`,`${o}-scrollbar-rail--vertical--${a}`,m],"data-scrollbar-rail":!0,style:[f||"",this.verticalRailStyle],"aria-hidden":!0},y(c?Ms:un,c?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?y("div",{class:`${o}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),u=()=>{var m,f;return(m=this.onRender)===null||m===void 0||m.call(this),y("div",Sd(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${o}-scrollbar`,this.themeClass,n&&`${o}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(f=t.default)===null||f===void 0?void 0:f.call(t):y("div",{role:"none",ref:"containerRef",class:[`${o}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},y(Fa,{onResize:this.handleContentResize},{default:()=>y("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${o}-scrollbar-content`,this.contentClass]},t)})),i?null:d(void 0,void 0),s&&y("div",{ref:"xRailRef",class:[`${o}-scrollbar-rail`,`${o}-scrollbar-rail--horizontal`,`${o}-scrollbar-rail--horizontal--${l}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},y(c?Ms:un,c?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?y("div",{class:`${o}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:n?this.xBarLeftPx:void 0,left:n?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},p=this.container?u():y(Fa,{onResize:this.handleContainerResize},{default:u});return i?y(et,null,p,d(this.themeClass,this.cssVars)):p}}),xP=Hu,Hy={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function ku(e){const{textColorDisabled:t,iconColor:o,textColor2:r,fontSizeTiny:n,fontSizeSmall:i,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:s}=e;return Object.assign(Object.assign({},Hy),{fontSizeTiny:n,fontSizeSmall:i,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:s,textColor:t,iconColor:o,extraTextColor:r})}const xl={name:"Empty",common:Be,self:ku},ar={name:"Empty",common:W,self:ku},ky={height:"calc(var(--n-option-height) * 7.6)",paddingTiny:"4px 0",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingTiny:"0 12px",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"};function Du(e){const{borderRadius:t,popoverColor:o,textColor3:r,dividerColor:n,textColor2:i,primaryColorPressed:a,textColorDisabled:l,primaryColor:s,opacityDisabled:c,hoverColor:d,fontSizeTiny:u,fontSizeSmall:p,fontSizeMedium:m,fontSizeLarge:f,fontSizeHuge:g,heightTiny:S,heightSmall:v,heightMedium:$,heightLarge:T,heightHuge:w}=e;return Object.assign(Object.assign({},ky),{optionFontSizeTiny:u,optionFontSizeSmall:p,optionFontSizeMedium:m,optionFontSizeLarge:f,optionFontSizeHuge:g,optionHeightTiny:S,optionHeightSmall:v,optionHeightMedium:$,optionHeightLarge:T,optionHeightHuge:w,borderRadius:t,color:o,groupHeaderTextColor:r,actionDividerColor:n,optionTextColor:i,optionTextColorPressed:a,optionTextColorDisabled:l,optionTextColorActive:s,optionOpacityDisabled:c,optionCheckColor:s,optionColorPending:d,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:d,actionTextColor:i,loadingColor:s})}const Ou={name:"InternalSelectMenu",common:Be,peers:{Scrollbar:Rn,Empty:xl},self:Du},Fn={name:"InternalSelectMenu",common:W,peers:{Scrollbar:St,Empty:ar},self:Du},Dy={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function Bu(e){const{boxShadow2:t,popoverColor:o,textColor2:r,borderRadius:n,fontSize:i,dividerColor:a}=e;return Object.assign(Object.assign({},Dy),{fontSize:i,borderRadius:n,color:o,dividerColor:a,textColor:r,boxShadow:t})}const zr={name:"Popover",common:Be,self:Bu},lr={name:"Popover",common:W,self:Bu},Oy={closeIconSizeTiny:"12px",closeIconSizeSmall:"12px",closeIconSizeMedium:"14px",closeIconSizeLarge:"14px",closeSizeTiny:"16px",closeSizeSmall:"16px",closeSizeMedium:"18px",closeSizeLarge:"18px",padding:"0 7px",closeMargin:"0 0 0 4px"},Lu={name:"Tag",common:W,self(e){const{textColor2:t,primaryColorHover:o,primaryColorPressed:r,primaryColor:n,infoColor:i,successColor:a,warningColor:l,errorColor:s,baseColor:c,borderColor:d,tagColor:u,opacityDisabled:p,closeIconColor:m,closeIconColorHover:f,closeIconColorPressed:g,closeColorHover:S,closeColorPressed:v,borderRadiusSmall:$,fontSizeMini:T,fontSizeTiny:w,fontSizeSmall:_,fontSizeMedium:O,heightMini:x,heightTiny:F,heightSmall:R,heightMedium:B,buttonColor2Hover:j,buttonColor2Pressed:A,fontWeightStrong:J}=e;return Object.assign(Object.assign({},Oy),{closeBorderRadius:$,heightTiny:x,heightSmall:F,heightMedium:R,heightLarge:B,borderRadius:$,opacityDisabled:p,fontSizeTiny:T,fontSizeSmall:w,fontSizeMedium:_,fontSizeLarge:O,fontWeightStrong:J,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:c,colorCheckable:"#0000",colorHoverCheckable:j,colorPressedCheckable:A,colorChecked:n,colorCheckedHover:o,colorCheckedPressed:r,border:`1px solid ${d}`,textColor:t,color:u,colorBordered:"#0000",closeIconColor:m,closeIconColorHover:f,closeIconColorPressed:g,closeColorHover:S,closeColorPressed:v,borderPrimary:`1px solid ${K(n,{alpha:.3})}`,textColorPrimary:n,colorPrimary:K(n,{alpha:.16}),colorBorderedPrimary:"#0000",closeIconColorPrimary:Ne(n,{lightness:.7}),closeIconColorHoverPrimary:Ne(n,{lightness:.7}),closeIconColorPressedPrimary:Ne(n,{lightness:.7}),closeColorHoverPrimary:K(n,{alpha:.16}),closeColorPressedPrimary:K(n,{alpha:.12}),borderInfo:`1px solid ${K(i,{alpha:.3})}`,textColorInfo:i,colorInfo:K(i,{alpha:.16}),colorBorderedInfo:"#0000",closeIconColorInfo:Ne(i,{alpha:.7}),closeIconColorHoverInfo:Ne(i,{alpha:.7}),closeIconColorPressedInfo:Ne(i,{alpha:.7}),closeColorHoverInfo:K(i,{alpha:.16}),closeColorPressedInfo:K(i,{alpha:.12}),borderSuccess:`1px solid ${K(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:K(a,{alpha:.16}),colorBorderedSuccess:"#0000",closeIconColorSuccess:Ne(a,{alpha:.7}),closeIconColorHoverSuccess:Ne(a,{alpha:.7}),closeIconColorPressedSuccess:Ne(a,{alpha:.7}),closeColorHoverSuccess:K(a,{alpha:.16}),closeColorPressedSuccess:K(a,{alpha:.12}),borderWarning:`1px solid ${K(l,{alpha:.3})}`,textColorWarning:l,colorWarning:K(l,{alpha:.16}),colorBorderedWarning:"#0000",closeIconColorWarning:Ne(l,{alpha:.7}),closeIconColorHoverWarning:Ne(l,{alpha:.7}),closeIconColorPressedWarning:Ne(l,{alpha:.7}),closeColorHoverWarning:K(l,{alpha:.16}),closeColorPressedWarning:K(l,{alpha:.11}),borderError:`1px solid ${K(s,{alpha:.3})}`,textColorError:s,colorError:K(s,{alpha:.16}),colorBorderedError:"#0000",closeIconColorError:Ne(s,{alpha:.7}),closeIconColorHoverError:Ne(s,{alpha:.7}),closeIconColorPressedError:Ne(s,{alpha:.7}),closeColorHoverError:K(s,{alpha:.16}),closeColorPressedError:K(s,{alpha:.12})})}},By=He({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(e,{slots:t}){return()=>{const{clsPrefix:o}=e;return y(vl,{clsPrefix:o,class:`${o}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?y(ka,{clsPrefix:o,show:e.showClear,onClear:e.onClear},{placeholder:()=>y(Tr,{clsPrefix:o,class:`${o}-base-suffix__arrow`},{default:()=>Qr(t.default,()=>[y(fy,null)])})}):null})}}}),Wu={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"},Cl={name:"InternalSelection",common:W,peers:{Popover:lr},self(e){const{borderRadius:t,textColor2:o,textColorDisabled:r,inputColor:n,inputColorDisabled:i,primaryColor:a,primaryColorHover:l,warningColor:s,warningColorHover:c,errorColor:d,errorColorHover:u,iconColor:p,iconColorDisabled:m,clearColor:f,clearColorHover:g,clearColorPressed:S,placeholderColor:v,placeholderColorDisabled:$,fontSizeTiny:T,fontSizeSmall:w,fontSizeMedium:_,fontSizeLarge:O,heightTiny:x,heightSmall:F,heightMedium:R,heightLarge:B,fontWeight:j}=e;return Object.assign(Object.assign({},Wu),{fontWeight:j,fontSizeTiny:T,fontSizeSmall:w,fontSizeMedium:_,fontSizeLarge:O,heightTiny:x,heightSmall:F,heightMedium:R,heightLarge:B,borderRadius:t,textColor:o,textColorDisabled:r,placeholderColor:v,placeholderColorDisabled:$,color:n,colorDisabled:i,colorActive:K(a,{alpha:.1}),border:"1px solid #0000",borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 8px 0 ${K(a,{alpha:.4})}`,boxShadowFocus:`0 0 8px 0 ${K(a,{alpha:.4})}`,caretColor:a,arrowColor:p,arrowColorDisabled:m,loadingColor:a,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${c}`,borderActiveWarning:`1px solid ${s}`,borderFocusWarning:`1px solid ${c}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 8px 0 ${K(s,{alpha:.4})}`,boxShadowFocusWarning:`0 0 8px 0 ${K(s,{alpha:.4})}`,colorActiveWarning:K(s,{alpha:.1}),caretColorWarning:s,borderError:`1px solid ${d}`,borderHoverError:`1px solid ${u}`,borderActiveError:`1px solid ${d}`,borderFocusError:`1px solid ${u}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 8px 0 ${K(d,{alpha:.4})}`,boxShadowFocusError:`0 0 8px 0 ${K(d,{alpha:.4})}`,colorActiveError:K(d,{alpha:.1}),caretColorError:d,clearColor:f,clearColorHover:g,clearColorPressed:S})}};function Ly(e){const{borderRadius:t,textColor2:o,textColorDisabled:r,inputColor:n,inputColorDisabled:i,primaryColor:a,primaryColorHover:l,warningColor:s,warningColorHover:c,errorColor:d,errorColorHover:u,borderColor:p,iconColor:m,iconColorDisabled:f,clearColor:g,clearColorHover:S,clearColorPressed:v,placeholderColor:$,placeholderColorDisabled:T,fontSizeTiny:w,fontSizeSmall:_,fontSizeMedium:O,fontSizeLarge:x,heightTiny:F,heightSmall:R,heightMedium:B,heightLarge:j,fontWeight:A}=e;return Object.assign(Object.assign({},Wu),{fontSizeTiny:w,fontSizeSmall:_,fontSizeMedium:O,fontSizeLarge:x,heightTiny:F,heightSmall:R,heightMedium:B,heightLarge:j,borderRadius:t,fontWeight:A,textColor:o,textColorDisabled:r,placeholderColor:$,placeholderColorDisabled:T,color:n,colorDisabled:i,colorActive:n,border:`1px solid ${p}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${K(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${K(a,{alpha:.2})}`,caretColor:a,arrowColor:m,arrowColorDisabled:f,loadingColor:a,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${c}`,borderActiveWarning:`1px solid ${s}`,borderFocusWarning:`1px solid ${c}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 0 2px ${K(s,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${K(s,{alpha:.2})}`,colorActiveWarning:n,caretColorWarning:s,borderError:`1px solid ${d}`,borderHoverError:`1px solid ${u}`,borderActiveError:`1px solid ${d}`,borderFocusError:`1px solid ${u}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${K(d,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${K(d,{alpha:.2})}`,colorActiveError:n,caretColorError:d,clearColor:g,clearColorHover:S,clearColorPressed:v})}const Wy={name:"InternalSelection",common:Be,peers:{Popover:zr},self:Ly},{cubicBezierEaseInOut:xo}=ko;function jy({duration:e=".2s",delay:t=".1s"}={}){return[L("&.fade-in-width-expand-transition-leave-from, &.fade-in-width-expand-transition-enter-to",{opacity:1}),L("&.fade-in-width-expand-transition-leave-to, &.fade-in-width-expand-transition-enter-from",` + `,[$y(),L("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),zy=Object.assign(Object.assign({},Ct.props),{duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean,yPlacement:{type:String,default:"right"},xPlacement:{type:String,default:"bottom"}}),Hu=He({name:"Scrollbar",props:zy,inheritAttrs:!1,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:o,mergedRtlRef:r}=zo(e),n=$n("Scrollbar",r,t),i=fe(null),a=fe(null),l=fe(null),s=fe(null),c=fe(null),d=fe(null),u=fe(null),p=fe(null),m=fe(null),f=fe(null),g=fe(null),S=fe(0),v=fe(0),$=fe(!1),T=fe(!1);let w=!1,E=!1,O,x,F=0,R=0,B=0,j=0;const A=Jm(),J=Ct("Scrollbar","-scrollbar",My,Rn,e,t),G=Y(()=>{const{value:D}=p,{value:Q}=d,{value:ge}=f;return D===null||Q===null||ge===null?0:Math.min(D,ge*D/Q+ms(J.value.self.width)*1.5)}),le=Y(()=>`${G.value}px`),te=Y(()=>{const{value:D}=m,{value:Q}=u,{value:ge}=g;return D===null||Q===null||ge===null?0:ge*D/Q+ms(J.value.self.height)*1.5}),N=Y(()=>`${te.value}px`),oe=Y(()=>{const{value:D}=p,{value:Q}=S,{value:ge}=d,{value:_e}=f;if(D===null||ge===null||_e===null)return 0;{const je=ge-D;return je?Q/je*(_e-G.value):0}}),ye=Y(()=>`${oe.value}px`),Pe=Y(()=>{const{value:D}=m,{value:Q}=v,{value:ge}=u,{value:_e}=g;if(D===null||ge===null||_e===null)return 0;{const je=ge-D;return je?Q/je*(_e-te.value):0}}),Re=Y(()=>`${Pe.value}px`),Fe=Y(()=>{const{value:D}=p,{value:Q}=d;return D!==null&&Q!==null&&Q>D}),Ve=Y(()=>{const{value:D}=m,{value:Q}=u;return D!==null&&Q!==null&&Q>D}),qe=Y(()=>{const{trigger:D}=e;return D==="none"||$.value}),gt=Y(()=>{const{trigger:D}=e;return D==="none"||T.value}),he=Y(()=>{const{container:D}=e;return D?D():a.value}),Ue=Y(()=>{const{content:D}=e;return D?D():l.value}),rt=(D,Q)=>{if(!e.scrollable)return;if(typeof D=="number"){b(D,Q??0,0,!1,"auto");return}const{left:ge,top:_e,index:je,elSize:lt,position:Tt,behavior:ke,el:st,debounce:jt=!0}=D;(ge!==void 0||_e!==void 0)&&b(ge??0,_e??0,0,!1,ke),st!==void 0?b(0,st.offsetTop,st.offsetHeight,jt,ke):je!==void 0&<!==void 0?b(0,je*lt,lt,jt,ke):Tt==="bottom"?b(0,Number.MAX_SAFE_INTEGER,0,!1,ke):Tt==="top"&&b(0,0,0,!1,ke)},be=Qm(()=>{e.container||rt({top:S.value,left:v.value})}),Ge=()=>{be.isDeactivated||se()},Pt=D=>{if(be.isDeactivated)return;const{onResize:Q}=e;Q&&Q(D),se()},h=(D,Q)=>{if(!e.scrollable)return;const{value:ge}=he;ge&&(typeof D=="object"?ge.scrollBy(D):ge.scrollBy(D,Q||0))};function b(D,Q,ge,_e,je){const{value:lt}=he;if(lt){if(_e){const{scrollTop:Tt,offsetHeight:ke}=lt;if(Q>Tt){Q+ge<=Tt+ke||lt.scrollTo({left:D,top:Q+ge-ke,behavior:je});return}}lt.scrollTo({left:D,top:Q,behavior:je})}}function P(){U(),z(),se()}function H(){M()}function M(){k(),q()}function k(){x!==void 0&&window.clearTimeout(x),x=window.setTimeout(()=>{T.value=!1},e.duration)}function q(){O!==void 0&&window.clearTimeout(O),O=window.setTimeout(()=>{$.value=!1},e.duration)}function U(){O!==void 0&&window.clearTimeout(O),$.value=!0}function z(){x!==void 0&&window.clearTimeout(x),T.value=!0}function I(D){const{onScroll:Q}=e;Q&&Q(D),ie()}function ie(){const{value:D}=he;D&&(S.value=D.scrollTop,v.value=D.scrollLeft*(n!=null&&n.value?-1:1))}function X(){const{value:D}=Ue;D&&(d.value=D.offsetHeight,u.value=D.offsetWidth);const{value:Q}=he;Q&&(p.value=Q.offsetHeight,m.value=Q.offsetWidth);const{value:ge}=c,{value:_e}=s;ge&&(g.value=ge.offsetWidth),_e&&(f.value=_e.offsetHeight)}function ne(){const{value:D}=he;D&&(S.value=D.scrollTop,v.value=D.scrollLeft*(n!=null&&n.value?-1:1),p.value=D.offsetHeight,m.value=D.offsetWidth,d.value=D.scrollHeight,u.value=D.scrollWidth);const{value:Q}=c,{value:ge}=s;Q&&(g.value=Q.offsetWidth),ge&&(f.value=ge.offsetHeight)}function se(){e.scrollable&&(e.useUnifiedContainer?ne():(X(),ie()))}function ve(D){var Q;return!(!((Q=i.value)===null||Q===void 0)&&Q.contains(Im(D)))}function Te(D){D.preventDefault(),D.stopPropagation(),E=!0,Go("mousemove",window,Ce,!0),Go("mouseup",window,Ze,!0),R=v.value,B=n!=null&&n.value?window.innerWidth-D.clientX:D.clientX}function Ce(D){if(!E)return;O!==void 0&&window.clearTimeout(O),x!==void 0&&window.clearTimeout(x);const{value:Q}=m,{value:ge}=u,{value:_e}=te;if(Q===null||ge===null)return;const lt=(n!=null&&n.value?window.innerWidth-D.clientX-B:D.clientX-B)*(ge-Q)/(Q-_e),Tt=ge-Q;let ke=R+lt;ke=Math.min(Tt,ke),ke=Math.max(ke,0);const{value:st}=he;if(st){st.scrollLeft=ke*(n!=null&&n.value?-1:1);const{internalOnUpdateScrollLeft:jt}=e;jt&&jt(ke)}}function Ze(D){D.preventDefault(),D.stopPropagation(),lo("mousemove",window,Ce,!0),lo("mouseup",window,Ze,!0),E=!1,se(),ve(D)&&M()}function Qe(D){D.preventDefault(),D.stopPropagation(),w=!0,Go("mousemove",window,nt,!0),Go("mouseup",window,it,!0),F=S.value,j=D.clientY}function nt(D){if(!w)return;O!==void 0&&window.clearTimeout(O),x!==void 0&&window.clearTimeout(x);const{value:Q}=p,{value:ge}=d,{value:_e}=G;if(Q===null||ge===null)return;const lt=(D.clientY-j)*(ge-Q)/(Q-_e),Tt=ge-Q;let ke=F+lt;ke=Math.min(Tt,ke),ke=Math.max(ke,0);const{value:st}=he;st&&(st.scrollTop=ke)}function it(D){D.preventDefault(),D.stopPropagation(),lo("mousemove",window,nt,!0),lo("mouseup",window,it,!0),w=!1,se(),ve(D)&&M()}sn(()=>{const{value:D}=Ve,{value:Q}=Fe,{value:ge}=t,{value:_e}=c,{value:je}=s;_e&&(D?_e.classList.remove(`${ge}-scrollbar-rail--disabled`):_e.classList.add(`${ge}-scrollbar-rail--disabled`)),je&&(Q?je.classList.remove(`${ge}-scrollbar-rail--disabled`):je.classList.add(`${ge}-scrollbar-rail--disabled`))}),Mo(()=>{e.container||se()}),nr(()=>{O!==void 0&&window.clearTimeout(O),x!==void 0&&window.clearTimeout(x),lo("mousemove",window,nt,!0),lo("mouseup",window,it,!0)});const Wt=Y(()=>{const{common:{cubicBezierEaseInOut:D},self:{color:Q,colorHover:ge,height:_e,width:je,borderRadius:lt,railInsetHorizontalTop:Tt,railInsetHorizontalBottom:ke,railInsetVerticalRight:st,railInsetVerticalLeft:jt,railColor:En}}=J.value,{top:Oi,right:sr,bottom:cr,left:Bi}=Vo(Tt),{top:Li,right:_n,bottom:bo,left:C}=Vo(ke),{top:_,right:de,bottom:Ie,left:Oe}=Vo(n!=null&&n.value?Es(st):st),{top:Ae,right:oo,bottom:ro,left:no}=Vo(n!=null&&n.value?Es(jt):jt);return{"--n-scrollbar-bezier":D,"--n-scrollbar-color":Q,"--n-scrollbar-color-hover":ge,"--n-scrollbar-border-radius":lt,"--n-scrollbar-width":je,"--n-scrollbar-height":_e,"--n-scrollbar-rail-top-horizontal-top":Oi,"--n-scrollbar-rail-right-horizontal-top":sr,"--n-scrollbar-rail-bottom-horizontal-top":cr,"--n-scrollbar-rail-left-horizontal-top":Bi,"--n-scrollbar-rail-top-horizontal-bottom":Li,"--n-scrollbar-rail-right-horizontal-bottom":_n,"--n-scrollbar-rail-bottom-horizontal-bottom":bo,"--n-scrollbar-rail-left-horizontal-bottom":C,"--n-scrollbar-rail-top-vertical-right":_,"--n-scrollbar-rail-right-vertical-right":de,"--n-scrollbar-rail-bottom-vertical-right":Ie,"--n-scrollbar-rail-left-vertical-right":Oe,"--n-scrollbar-rail-top-vertical-left":Ae,"--n-scrollbar-rail-right-vertical-left":oo,"--n-scrollbar-rail-bottom-vertical-left":ro,"--n-scrollbar-rail-left-vertical-left":no,"--n-scrollbar-rail-color":En}}),Ht=o?Fr("scrollbar",void 0,Wt,e):void 0;return Object.assign(Object.assign({},{scrollTo:rt,scrollBy:h,sync:se,syncUnifiedContainer:ne,handleMouseEnterWrapper:P,handleMouseLeaveWrapper:H}),{mergedClsPrefix:t,rtlEnabled:n,containerScrollTop:S,wrapperRef:i,containerRef:a,contentRef:l,yRailRef:s,xRailRef:c,needYBar:Fe,needXBar:Ve,yBarSizePx:le,xBarSizePx:N,yBarTopPx:ye,xBarLeftPx:Re,isShowXBar:qe,isShowYBar:gt,isIos:A,handleScroll:I,handleContentResize:Ge,handleContainerResize:Pt,handleYScrollMouseDown:Qe,handleXScrollMouseDown:Te,cssVars:o?void 0:Wt,themeClass:Ht==null?void 0:Ht.themeClass,onRender:Ht==null?void 0:Ht.onRender})},render(){var e;const{$slots:t,mergedClsPrefix:o,triggerDisplayManually:r,rtlEnabled:n,internalHoistYRail:i,yPlacement:a,xPlacement:l,xScrollable:s}=this;if(!this.scrollable)return(e=t.default)===null||e===void 0?void 0:e.call(t);const c=this.trigger==="none",d=(m,f)=>y("div",{ref:"yRailRef",class:[`${o}-scrollbar-rail`,`${o}-scrollbar-rail--vertical`,`${o}-scrollbar-rail--vertical--${a}`,m],"data-scrollbar-rail":!0,style:[f||"",this.verticalRailStyle],"aria-hidden":!0},y(c?Ms:un,c?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?y("div",{class:`${o}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),u=()=>{var m,f;return(m=this.onRender)===null||m===void 0||m.call(this),y("div",Sd(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${o}-scrollbar`,this.themeClass,n&&`${o}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(f=t.default)===null||f===void 0?void 0:f.call(t):y("div",{role:"none",ref:"containerRef",class:[`${o}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},y(Fa,{onResize:this.handleContentResize},{default:()=>y("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${o}-scrollbar-content`,this.contentClass]},t)})),i?null:d(void 0,void 0),s&&y("div",{ref:"xRailRef",class:[`${o}-scrollbar-rail`,`${o}-scrollbar-rail--horizontal`,`${o}-scrollbar-rail--horizontal--${l}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},y(c?Ms:un,c?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?y("div",{class:`${o}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:n?this.xBarLeftPx:void 0,left:n?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},p=this.container?u():y(Fa,{onResize:this.handleContainerResize},{default:u});return i?y(et,null,p,d(this.themeClass,this.cssVars)):p}}),xP=Hu,Hy={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function ku(e){const{textColorDisabled:t,iconColor:o,textColor2:r,fontSizeTiny:n,fontSizeSmall:i,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:s}=e;return Object.assign(Object.assign({},Hy),{fontSizeTiny:n,fontSizeSmall:i,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:s,textColor:t,iconColor:o,extraTextColor:r})}const xl={name:"Empty",common:Be,self:ku},ar={name:"Empty",common:W,self:ku},ky={height:"calc(var(--n-option-height) * 7.6)",paddingTiny:"4px 0",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingTiny:"0 12px",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"};function Du(e){const{borderRadius:t,popoverColor:o,textColor3:r,dividerColor:n,textColor2:i,primaryColorPressed:a,textColorDisabled:l,primaryColor:s,opacityDisabled:c,hoverColor:d,fontSizeTiny:u,fontSizeSmall:p,fontSizeMedium:m,fontSizeLarge:f,fontSizeHuge:g,heightTiny:S,heightSmall:v,heightMedium:$,heightLarge:T,heightHuge:w}=e;return Object.assign(Object.assign({},ky),{optionFontSizeTiny:u,optionFontSizeSmall:p,optionFontSizeMedium:m,optionFontSizeLarge:f,optionFontSizeHuge:g,optionHeightTiny:S,optionHeightSmall:v,optionHeightMedium:$,optionHeightLarge:T,optionHeightHuge:w,borderRadius:t,color:o,groupHeaderTextColor:r,actionDividerColor:n,optionTextColor:i,optionTextColorPressed:a,optionTextColorDisabled:l,optionTextColorActive:s,optionOpacityDisabled:c,optionCheckColor:s,optionColorPending:d,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:d,actionTextColor:i,loadingColor:s})}const Ou={name:"InternalSelectMenu",common:Be,peers:{Scrollbar:Rn,Empty:xl},self:Du},Fn={name:"InternalSelectMenu",common:W,peers:{Scrollbar:St,Empty:ar},self:Du},Dy={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function Bu(e){const{boxShadow2:t,popoverColor:o,textColor2:r,borderRadius:n,fontSize:i,dividerColor:a}=e;return Object.assign(Object.assign({},Dy),{fontSize:i,borderRadius:n,color:o,dividerColor:a,textColor:r,boxShadow:t})}const zr={name:"Popover",common:Be,self:Bu},lr={name:"Popover",common:W,self:Bu},Oy={closeIconSizeTiny:"12px",closeIconSizeSmall:"12px",closeIconSizeMedium:"14px",closeIconSizeLarge:"14px",closeSizeTiny:"16px",closeSizeSmall:"16px",closeSizeMedium:"18px",closeSizeLarge:"18px",padding:"0 7px",closeMargin:"0 0 0 4px"},Lu={name:"Tag",common:W,self(e){const{textColor2:t,primaryColorHover:o,primaryColorPressed:r,primaryColor:n,infoColor:i,successColor:a,warningColor:l,errorColor:s,baseColor:c,borderColor:d,tagColor:u,opacityDisabled:p,closeIconColor:m,closeIconColorHover:f,closeIconColorPressed:g,closeColorHover:S,closeColorPressed:v,borderRadiusSmall:$,fontSizeMini:T,fontSizeTiny:w,fontSizeSmall:E,fontSizeMedium:O,heightMini:x,heightTiny:F,heightSmall:R,heightMedium:B,buttonColor2Hover:j,buttonColor2Pressed:A,fontWeightStrong:J}=e;return Object.assign(Object.assign({},Oy),{closeBorderRadius:$,heightTiny:x,heightSmall:F,heightMedium:R,heightLarge:B,borderRadius:$,opacityDisabled:p,fontSizeTiny:T,fontSizeSmall:w,fontSizeMedium:E,fontSizeLarge:O,fontWeightStrong:J,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:c,colorCheckable:"#0000",colorHoverCheckable:j,colorPressedCheckable:A,colorChecked:n,colorCheckedHover:o,colorCheckedPressed:r,border:`1px solid ${d}`,textColor:t,color:u,colorBordered:"#0000",closeIconColor:m,closeIconColorHover:f,closeIconColorPressed:g,closeColorHover:S,closeColorPressed:v,borderPrimary:`1px solid ${K(n,{alpha:.3})}`,textColorPrimary:n,colorPrimary:K(n,{alpha:.16}),colorBorderedPrimary:"#0000",closeIconColorPrimary:Ne(n,{lightness:.7}),closeIconColorHoverPrimary:Ne(n,{lightness:.7}),closeIconColorPressedPrimary:Ne(n,{lightness:.7}),closeColorHoverPrimary:K(n,{alpha:.16}),closeColorPressedPrimary:K(n,{alpha:.12}),borderInfo:`1px solid ${K(i,{alpha:.3})}`,textColorInfo:i,colorInfo:K(i,{alpha:.16}),colorBorderedInfo:"#0000",closeIconColorInfo:Ne(i,{alpha:.7}),closeIconColorHoverInfo:Ne(i,{alpha:.7}),closeIconColorPressedInfo:Ne(i,{alpha:.7}),closeColorHoverInfo:K(i,{alpha:.16}),closeColorPressedInfo:K(i,{alpha:.12}),borderSuccess:`1px solid ${K(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:K(a,{alpha:.16}),colorBorderedSuccess:"#0000",closeIconColorSuccess:Ne(a,{alpha:.7}),closeIconColorHoverSuccess:Ne(a,{alpha:.7}),closeIconColorPressedSuccess:Ne(a,{alpha:.7}),closeColorHoverSuccess:K(a,{alpha:.16}),closeColorPressedSuccess:K(a,{alpha:.12}),borderWarning:`1px solid ${K(l,{alpha:.3})}`,textColorWarning:l,colorWarning:K(l,{alpha:.16}),colorBorderedWarning:"#0000",closeIconColorWarning:Ne(l,{alpha:.7}),closeIconColorHoverWarning:Ne(l,{alpha:.7}),closeIconColorPressedWarning:Ne(l,{alpha:.7}),closeColorHoverWarning:K(l,{alpha:.16}),closeColorPressedWarning:K(l,{alpha:.11}),borderError:`1px solid ${K(s,{alpha:.3})}`,textColorError:s,colorError:K(s,{alpha:.16}),colorBorderedError:"#0000",closeIconColorError:Ne(s,{alpha:.7}),closeIconColorHoverError:Ne(s,{alpha:.7}),closeIconColorPressedError:Ne(s,{alpha:.7}),closeColorHoverError:K(s,{alpha:.16}),closeColorPressedError:K(s,{alpha:.12})})}},By=He({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(e,{slots:t}){return()=>{const{clsPrefix:o}=e;return y(vl,{clsPrefix:o,class:`${o}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?y(ka,{clsPrefix:o,show:e.showClear,onClear:e.onClear},{placeholder:()=>y(Tr,{clsPrefix:o,class:`${o}-base-suffix__arrow`},{default:()=>Qr(t.default,()=>[y(fy,null)])})}):null})}}}),Wu={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"},Cl={name:"InternalSelection",common:W,peers:{Popover:lr},self(e){const{borderRadius:t,textColor2:o,textColorDisabled:r,inputColor:n,inputColorDisabled:i,primaryColor:a,primaryColorHover:l,warningColor:s,warningColorHover:c,errorColor:d,errorColorHover:u,iconColor:p,iconColorDisabled:m,clearColor:f,clearColorHover:g,clearColorPressed:S,placeholderColor:v,placeholderColorDisabled:$,fontSizeTiny:T,fontSizeSmall:w,fontSizeMedium:E,fontSizeLarge:O,heightTiny:x,heightSmall:F,heightMedium:R,heightLarge:B,fontWeight:j}=e;return Object.assign(Object.assign({},Wu),{fontWeight:j,fontSizeTiny:T,fontSizeSmall:w,fontSizeMedium:E,fontSizeLarge:O,heightTiny:x,heightSmall:F,heightMedium:R,heightLarge:B,borderRadius:t,textColor:o,textColorDisabled:r,placeholderColor:v,placeholderColorDisabled:$,color:n,colorDisabled:i,colorActive:K(a,{alpha:.1}),border:"1px solid #0000",borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 8px 0 ${K(a,{alpha:.4})}`,boxShadowFocus:`0 0 8px 0 ${K(a,{alpha:.4})}`,caretColor:a,arrowColor:p,arrowColorDisabled:m,loadingColor:a,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${c}`,borderActiveWarning:`1px solid ${s}`,borderFocusWarning:`1px solid ${c}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 8px 0 ${K(s,{alpha:.4})}`,boxShadowFocusWarning:`0 0 8px 0 ${K(s,{alpha:.4})}`,colorActiveWarning:K(s,{alpha:.1}),caretColorWarning:s,borderError:`1px solid ${d}`,borderHoverError:`1px solid ${u}`,borderActiveError:`1px solid ${d}`,borderFocusError:`1px solid ${u}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 8px 0 ${K(d,{alpha:.4})}`,boxShadowFocusError:`0 0 8px 0 ${K(d,{alpha:.4})}`,colorActiveError:K(d,{alpha:.1}),caretColorError:d,clearColor:f,clearColorHover:g,clearColorPressed:S})}};function Ly(e){const{borderRadius:t,textColor2:o,textColorDisabled:r,inputColor:n,inputColorDisabled:i,primaryColor:a,primaryColorHover:l,warningColor:s,warningColorHover:c,errorColor:d,errorColorHover:u,borderColor:p,iconColor:m,iconColorDisabled:f,clearColor:g,clearColorHover:S,clearColorPressed:v,placeholderColor:$,placeholderColorDisabled:T,fontSizeTiny:w,fontSizeSmall:E,fontSizeMedium:O,fontSizeLarge:x,heightTiny:F,heightSmall:R,heightMedium:B,heightLarge:j,fontWeight:A}=e;return Object.assign(Object.assign({},Wu),{fontSizeTiny:w,fontSizeSmall:E,fontSizeMedium:O,fontSizeLarge:x,heightTiny:F,heightSmall:R,heightMedium:B,heightLarge:j,borderRadius:t,fontWeight:A,textColor:o,textColorDisabled:r,placeholderColor:$,placeholderColorDisabled:T,color:n,colorDisabled:i,colorActive:n,border:`1px solid ${p}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${K(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${K(a,{alpha:.2})}`,caretColor:a,arrowColor:m,arrowColorDisabled:f,loadingColor:a,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${c}`,borderActiveWarning:`1px solid ${s}`,borderFocusWarning:`1px solid ${c}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 0 2px ${K(s,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${K(s,{alpha:.2})}`,colorActiveWarning:n,caretColorWarning:s,borderError:`1px solid ${d}`,borderHoverError:`1px solid ${u}`,borderActiveError:`1px solid ${d}`,borderFocusError:`1px solid ${u}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${K(d,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${K(d,{alpha:.2})}`,colorActiveError:n,caretColorError:d,clearColor:g,clearColorHover:S,clearColorPressed:v})}const Wy={name:"InternalSelection",common:Be,peers:{Popover:zr},self:Ly},{cubicBezierEaseInOut:xo}=ko;function jy({duration:e=".2s",delay:t=".1s"}={}){return[L("&.fade-in-width-expand-transition-leave-from, &.fade-in-width-expand-transition-enter-to",{opacity:1}),L("&.fade-in-width-expand-transition-leave-to, &.fade-in-width-expand-transition-enter-from",` opacity: 0!important; margin-left: 0!important; margin-right: 0!important; @@ -237,7 +237,7 @@ ${t} top: 0; bottom: 0; border-radius: inherit; -`),Vy=He({name:"BaseWave",props:{clsPrefix:{type:String,required:!0}},setup(e){Er("-base-wave",Ny,Dt(e,"clsPrefix"));const t=fe(null),o=fe(!1);let r=null;return nr(()=>{r!==null&&window.clearTimeout(r)}),{active:o,selfRef:t,play(){r!==null&&(window.clearTimeout(r),o.value=!1,r=null),nn(()=>{var n;(n=t.value)===null||n===void 0||n.offsetHeight,o.value=!0,r=window.setTimeout(()=>{o.value=!1,r=null},1e3)})}}},render(){const{clsPrefix:e}=this;return y("div",{ref:"selfRef","aria-hidden":!0,class:[`${e}-base-wave`,this.active&&`${e}-base-wave--active`]})}}),Uy={iconMargin:"11px 8px 0 12px",iconMarginRtl:"11px 12px 0 8px",iconSize:"24px",closeIconSize:"16px",closeSize:"20px",closeMargin:"13px 14px 0 0",closeMarginRtl:"13px 0 0 14px",padding:"13px"},qy={name:"Alert",common:W,self(e){const{lineHeight:t,borderRadius:o,fontWeightStrong:r,dividerColor:n,inputColor:i,textColor1:a,textColor2:l,closeColorHover:s,closeColorPressed:c,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,infoColorSuppl:m,successColorSuppl:f,warningColorSuppl:g,errorColorSuppl:S,fontSize:v}=e;return Object.assign(Object.assign({},Uy),{fontSize:v,lineHeight:t,titleFontWeight:r,borderRadius:o,border:`1px solid ${n}`,color:i,titleTextColor:a,iconColor:l,contentTextColor:l,closeBorderRadius:o,closeColorHover:s,closeColorPressed:c,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,borderInfo:`1px solid ${K(m,{alpha:.35})}`,colorInfo:K(m,{alpha:.25}),titleTextColorInfo:a,iconColorInfo:m,contentTextColorInfo:l,closeColorHoverInfo:s,closeColorPressedInfo:c,closeIconColorInfo:d,closeIconColorHoverInfo:u,closeIconColorPressedInfo:p,borderSuccess:`1px solid ${K(f,{alpha:.35})}`,colorSuccess:K(f,{alpha:.25}),titleTextColorSuccess:a,iconColorSuccess:f,contentTextColorSuccess:l,closeColorHoverSuccess:s,closeColorPressedSuccess:c,closeIconColorSuccess:d,closeIconColorHoverSuccess:u,closeIconColorPressedSuccess:p,borderWarning:`1px solid ${K(g,{alpha:.35})}`,colorWarning:K(g,{alpha:.25}),titleTextColorWarning:a,iconColorWarning:g,contentTextColorWarning:l,closeColorHoverWarning:s,closeColorPressedWarning:c,closeIconColorWarning:d,closeIconColorHoverWarning:u,closeIconColorPressedWarning:p,borderError:`1px solid ${K(S,{alpha:.35})}`,colorError:K(S,{alpha:.25}),titleTextColorError:a,iconColorError:S,contentTextColorError:l,closeColorHoverError:s,closeColorPressedError:c,closeIconColorError:d,closeIconColorHoverError:u,closeIconColorPressedError:p})}},{cubicBezierEaseInOut:Ut,cubicBezierEaseOut:Gy,cubicBezierEaseIn:Ky}=ko;function Yy({overflow:e="hidden",duration:t=".3s",originalTransition:o="",leavingDelay:r="0s",foldPadding:n=!1,enterToProps:i=void 0,leaveToProps:a=void 0,reverse:l=!1}={}){const s=l?"leave":"enter",c=l?"enter":"leave";return[L(`&.fade-in-height-expand-transition-${c}-from, +`),Vy=He({name:"BaseWave",props:{clsPrefix:{type:String,required:!0}},setup(e){_r("-base-wave",Ny,Dt(e,"clsPrefix"));const t=fe(null),o=fe(!1);let r=null;return nr(()=>{r!==null&&window.clearTimeout(r)}),{active:o,selfRef:t,play(){r!==null&&(window.clearTimeout(r),o.value=!1,r=null),nn(()=>{var n;(n=t.value)===null||n===void 0||n.offsetHeight,o.value=!0,r=window.setTimeout(()=>{o.value=!1,r=null},1e3)})}}},render(){const{clsPrefix:e}=this;return y("div",{ref:"selfRef","aria-hidden":!0,class:[`${e}-base-wave`,this.active&&`${e}-base-wave--active`]})}}),Uy={iconMargin:"11px 8px 0 12px",iconMarginRtl:"11px 12px 0 8px",iconSize:"24px",closeIconSize:"16px",closeSize:"20px",closeMargin:"13px 14px 0 0",closeMarginRtl:"13px 0 0 14px",padding:"13px"},qy={name:"Alert",common:W,self(e){const{lineHeight:t,borderRadius:o,fontWeightStrong:r,dividerColor:n,inputColor:i,textColor1:a,textColor2:l,closeColorHover:s,closeColorPressed:c,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,infoColorSuppl:m,successColorSuppl:f,warningColorSuppl:g,errorColorSuppl:S,fontSize:v}=e;return Object.assign(Object.assign({},Uy),{fontSize:v,lineHeight:t,titleFontWeight:r,borderRadius:o,border:`1px solid ${n}`,color:i,titleTextColor:a,iconColor:l,contentTextColor:l,closeBorderRadius:o,closeColorHover:s,closeColorPressed:c,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,borderInfo:`1px solid ${K(m,{alpha:.35})}`,colorInfo:K(m,{alpha:.25}),titleTextColorInfo:a,iconColorInfo:m,contentTextColorInfo:l,closeColorHoverInfo:s,closeColorPressedInfo:c,closeIconColorInfo:d,closeIconColorHoverInfo:u,closeIconColorPressedInfo:p,borderSuccess:`1px solid ${K(f,{alpha:.35})}`,colorSuccess:K(f,{alpha:.25}),titleTextColorSuccess:a,iconColorSuccess:f,contentTextColorSuccess:l,closeColorHoverSuccess:s,closeColorPressedSuccess:c,closeIconColorSuccess:d,closeIconColorHoverSuccess:u,closeIconColorPressedSuccess:p,borderWarning:`1px solid ${K(g,{alpha:.35})}`,colorWarning:K(g,{alpha:.25}),titleTextColorWarning:a,iconColorWarning:g,contentTextColorWarning:l,closeColorHoverWarning:s,closeColorPressedWarning:c,closeIconColorWarning:d,closeIconColorHoverWarning:u,closeIconColorPressedWarning:p,borderError:`1px solid ${K(S,{alpha:.35})}`,colorError:K(S,{alpha:.25}),titleTextColorError:a,iconColorError:S,contentTextColorError:l,closeColorHoverError:s,closeColorPressedError:c,closeIconColorError:d,closeIconColorHoverError:u,closeIconColorPressedError:p})}},{cubicBezierEaseInOut:Ut,cubicBezierEaseOut:Gy,cubicBezierEaseIn:Ky}=ko;function Yy({overflow:e="hidden",duration:t=".3s",originalTransition:o="",leavingDelay:r="0s",foldPadding:n=!1,enterToProps:i=void 0,leaveToProps:a=void 0,reverse:l=!1}={}){const s=l?"leave":"enter",c=l?"enter":"leave";return[L(`&.fade-in-height-expand-transition-${c}-from, &.fade-in-height-expand-transition-${s}-to`,Object.assign(Object.assign({},i),{opacity:1})),L(`&.fade-in-height-expand-transition-${c}-to, &.fade-in-height-expand-transition-${s}-from`,Object.assign(Object.assign({},a),{opacity:0,marginTop:"0 !important",marginBottom:"0 !important",paddingTop:n?"0 !important":void 0,paddingBottom:n?"0 !important":void 0})),L(`&.fade-in-height-expand-transition-${c}-active`,` overflow: ${e}; @@ -259,7 +259,7 @@ ${t} padding-top ${t} ${Ut}, padding-bottom ${t} ${Ut} ${o?`,${o}`:""} - `)]}const Xy={linkFontSize:"13px",linkPadding:"0 0 0 16px",railWidth:"4px"};function Jy(e){const{borderRadius:t,railColor:o,primaryColor:r,primaryColorHover:n,primaryColorPressed:i,textColor2:a}=e;return Object.assign(Object.assign({},Xy),{borderRadius:t,railColor:o,railColorActive:r,linkColor:K(r,{alpha:.15}),linkTextColor:a,linkTextColorHover:n,linkTextColorPressed:i,linkTextColorActive:r})}const Zy={name:"Anchor",common:W,self:Jy},Qy=Ii&&"chrome"in window;Ii&&navigator.userAgent.includes("Firefox");const ju=Ii&&navigator.userAgent.includes("Safari")&&!Qy,Nu={paddingTiny:"0 8px",paddingSmall:"0 10px",paddingMedium:"0 12px",paddingLarge:"0 14px",clearSize:"16px"},zt={name:"Input",common:W,self(e){const{textColor2:t,textColor3:o,textColorDisabled:r,primaryColor:n,primaryColorHover:i,inputColor:a,inputColorDisabled:l,warningColor:s,warningColorHover:c,errorColor:d,errorColorHover:u,borderRadius:p,lineHeight:m,fontSizeTiny:f,fontSizeSmall:g,fontSizeMedium:S,fontSizeLarge:v,heightTiny:$,heightSmall:T,heightMedium:w,heightLarge:_,clearColor:O,clearColorHover:x,clearColorPressed:F,placeholderColor:R,placeholderColorDisabled:B,iconColor:j,iconColorDisabled:A,iconColorHover:J,iconColorPressed:G,fontWeight:le}=e;return Object.assign(Object.assign({},Nu),{fontWeight:le,countTextColorDisabled:r,countTextColor:o,heightTiny:$,heightSmall:T,heightMedium:w,heightLarge:_,fontSizeTiny:f,fontSizeSmall:g,fontSizeMedium:S,fontSizeLarge:v,lineHeight:m,lineHeightTextarea:m,borderRadius:p,iconSize:"16px",groupLabelColor:a,textColor:t,textColorDisabled:r,textDecorationColor:t,groupLabelTextColor:t,caretColor:n,placeholderColor:R,placeholderColorDisabled:B,color:a,colorDisabled:l,colorFocus:K(n,{alpha:.1}),groupLabelBorder:"1px solid #0000",border:"1px solid #0000",borderHover:`1px solid ${i}`,borderDisabled:"1px solid #0000",borderFocus:`1px solid ${i}`,boxShadowFocus:`0 0 8px 0 ${K(n,{alpha:.3})}`,loadingColor:n,loadingColorWarning:s,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${c}`,colorFocusWarning:K(s,{alpha:.1}),borderFocusWarning:`1px solid ${c}`,boxShadowFocusWarning:`0 0 8px 0 ${K(s,{alpha:.3})}`,caretColorWarning:s,loadingColorError:d,borderError:`1px solid ${d}`,borderHoverError:`1px solid ${u}`,colorFocusError:K(d,{alpha:.1}),borderFocusError:`1px solid ${u}`,boxShadowFocusError:`0 0 8px 0 ${K(d,{alpha:.3})}`,caretColorError:d,clearColor:O,clearColorHover:x,clearColorPressed:F,iconColor:j,iconColorDisabled:A,iconColorHover:J,iconColorPressed:G,suffixTextColor:t})}};function e1(e){const{textColor2:t,textColor3:o,textColorDisabled:r,primaryColor:n,primaryColorHover:i,inputColor:a,inputColorDisabled:l,borderColor:s,warningColor:c,warningColorHover:d,errorColor:u,errorColorHover:p,borderRadius:m,lineHeight:f,fontSizeTiny:g,fontSizeSmall:S,fontSizeMedium:v,fontSizeLarge:$,heightTiny:T,heightSmall:w,heightMedium:_,heightLarge:O,actionColor:x,clearColor:F,clearColorHover:R,clearColorPressed:B,placeholderColor:j,placeholderColorDisabled:A,iconColor:J,iconColorDisabled:G,iconColorHover:le,iconColorPressed:te,fontWeight:N}=e;return Object.assign(Object.assign({},Nu),{fontWeight:N,countTextColorDisabled:r,countTextColor:o,heightTiny:T,heightSmall:w,heightMedium:_,heightLarge:O,fontSizeTiny:g,fontSizeSmall:S,fontSizeMedium:v,fontSizeLarge:$,lineHeight:f,lineHeightTextarea:f,borderRadius:m,iconSize:"16px",groupLabelColor:x,groupLabelTextColor:t,textColor:t,textColorDisabled:r,textDecorationColor:t,caretColor:n,placeholderColor:j,placeholderColorDisabled:A,color:a,colorDisabled:l,colorFocus:a,groupLabelBorder:`1px solid ${s}`,border:`1px solid ${s}`,borderHover:`1px solid ${i}`,borderDisabled:`1px solid ${s}`,borderFocus:`1px solid ${i}`,boxShadowFocus:`0 0 0 2px ${K(n,{alpha:.2})}`,loadingColor:n,loadingColorWarning:c,borderWarning:`1px solid ${c}`,borderHoverWarning:`1px solid ${d}`,colorFocusWarning:a,borderFocusWarning:`1px solid ${d}`,boxShadowFocusWarning:`0 0 0 2px ${K(c,{alpha:.2})}`,caretColorWarning:c,loadingColorError:u,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${p}`,colorFocusError:a,borderFocusError:`1px solid ${p}`,boxShadowFocusError:`0 0 0 2px ${K(u,{alpha:.2})}`,caretColorError:u,clearColor:F,clearColorHover:R,clearColorPressed:B,iconColor:J,iconColorDisabled:G,iconColorHover:le,iconColorPressed:te,suffixTextColor:t})}const ki={name:"Input",common:Be,self:e1},Vu="n-input",t1=pe("input",` + `)]}const Xy={linkFontSize:"13px",linkPadding:"0 0 0 16px",railWidth:"4px"};function Jy(e){const{borderRadius:t,railColor:o,primaryColor:r,primaryColorHover:n,primaryColorPressed:i,textColor2:a}=e;return Object.assign(Object.assign({},Xy),{borderRadius:t,railColor:o,railColorActive:r,linkColor:K(r,{alpha:.15}),linkTextColor:a,linkTextColorHover:n,linkTextColorPressed:i,linkTextColorActive:r})}const Zy={name:"Anchor",common:W,self:Jy},Qy=Ii&&"chrome"in window;Ii&&navigator.userAgent.includes("Firefox");const ju=Ii&&navigator.userAgent.includes("Safari")&&!Qy,Nu={paddingTiny:"0 8px",paddingSmall:"0 10px",paddingMedium:"0 12px",paddingLarge:"0 14px",clearSize:"16px"},zt={name:"Input",common:W,self(e){const{textColor2:t,textColor3:o,textColorDisabled:r,primaryColor:n,primaryColorHover:i,inputColor:a,inputColorDisabled:l,warningColor:s,warningColorHover:c,errorColor:d,errorColorHover:u,borderRadius:p,lineHeight:m,fontSizeTiny:f,fontSizeSmall:g,fontSizeMedium:S,fontSizeLarge:v,heightTiny:$,heightSmall:T,heightMedium:w,heightLarge:E,clearColor:O,clearColorHover:x,clearColorPressed:F,placeholderColor:R,placeholderColorDisabled:B,iconColor:j,iconColorDisabled:A,iconColorHover:J,iconColorPressed:G,fontWeight:le}=e;return Object.assign(Object.assign({},Nu),{fontWeight:le,countTextColorDisabled:r,countTextColor:o,heightTiny:$,heightSmall:T,heightMedium:w,heightLarge:E,fontSizeTiny:f,fontSizeSmall:g,fontSizeMedium:S,fontSizeLarge:v,lineHeight:m,lineHeightTextarea:m,borderRadius:p,iconSize:"16px",groupLabelColor:a,textColor:t,textColorDisabled:r,textDecorationColor:t,groupLabelTextColor:t,caretColor:n,placeholderColor:R,placeholderColorDisabled:B,color:a,colorDisabled:l,colorFocus:K(n,{alpha:.1}),groupLabelBorder:"1px solid #0000",border:"1px solid #0000",borderHover:`1px solid ${i}`,borderDisabled:"1px solid #0000",borderFocus:`1px solid ${i}`,boxShadowFocus:`0 0 8px 0 ${K(n,{alpha:.3})}`,loadingColor:n,loadingColorWarning:s,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${c}`,colorFocusWarning:K(s,{alpha:.1}),borderFocusWarning:`1px solid ${c}`,boxShadowFocusWarning:`0 0 8px 0 ${K(s,{alpha:.3})}`,caretColorWarning:s,loadingColorError:d,borderError:`1px solid ${d}`,borderHoverError:`1px solid ${u}`,colorFocusError:K(d,{alpha:.1}),borderFocusError:`1px solid ${u}`,boxShadowFocusError:`0 0 8px 0 ${K(d,{alpha:.3})}`,caretColorError:d,clearColor:O,clearColorHover:x,clearColorPressed:F,iconColor:j,iconColorDisabled:A,iconColorHover:J,iconColorPressed:G,suffixTextColor:t})}};function e1(e){const{textColor2:t,textColor3:o,textColorDisabled:r,primaryColor:n,primaryColorHover:i,inputColor:a,inputColorDisabled:l,borderColor:s,warningColor:c,warningColorHover:d,errorColor:u,errorColorHover:p,borderRadius:m,lineHeight:f,fontSizeTiny:g,fontSizeSmall:S,fontSizeMedium:v,fontSizeLarge:$,heightTiny:T,heightSmall:w,heightMedium:E,heightLarge:O,actionColor:x,clearColor:F,clearColorHover:R,clearColorPressed:B,placeholderColor:j,placeholderColorDisabled:A,iconColor:J,iconColorDisabled:G,iconColorHover:le,iconColorPressed:te,fontWeight:N}=e;return Object.assign(Object.assign({},Nu),{fontWeight:N,countTextColorDisabled:r,countTextColor:o,heightTiny:T,heightSmall:w,heightMedium:E,heightLarge:O,fontSizeTiny:g,fontSizeSmall:S,fontSizeMedium:v,fontSizeLarge:$,lineHeight:f,lineHeightTextarea:f,borderRadius:m,iconSize:"16px",groupLabelColor:x,groupLabelTextColor:t,textColor:t,textColorDisabled:r,textDecorationColor:t,caretColor:n,placeholderColor:j,placeholderColorDisabled:A,color:a,colorDisabled:l,colorFocus:a,groupLabelBorder:`1px solid ${s}`,border:`1px solid ${s}`,borderHover:`1px solid ${i}`,borderDisabled:`1px solid ${s}`,borderFocus:`1px solid ${i}`,boxShadowFocus:`0 0 0 2px ${K(n,{alpha:.2})}`,loadingColor:n,loadingColorWarning:c,borderWarning:`1px solid ${c}`,borderHoverWarning:`1px solid ${d}`,colorFocusWarning:a,borderFocusWarning:`1px solid ${d}`,boxShadowFocusWarning:`0 0 0 2px ${K(c,{alpha:.2})}`,caretColorWarning:c,loadingColorError:u,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${p}`,colorFocusError:a,borderFocusError:`1px solid ${p}`,boxShadowFocusError:`0 0 0 2px ${K(u,{alpha:.2})}`,caretColorError:u,clearColor:F,clearColorHover:R,clearColorPressed:B,iconColor:J,iconColorDisabled:G,iconColorHover:le,iconColorPressed:te,suffixTextColor:t})}const ki={name:"Input",common:Be,self:e1},Vu="n-input",t1=pe("input",` max-width: 100%; cursor: text; line-height: 1.5; @@ -492,8 +492,8 @@ ${t} border: var(--n-border-focus-${e}); `)])])]))]),o1=pe("input",[re("disabled",[V("input-el, textarea-el",` -webkit-text-fill-color: var(--n-text-color-disabled); - `)])]);function r1(e){let t=0;for(const o of e)t++;return t}function Un(e){return e===""||e==null}function n1(e){const t=fe(null);function o(){const{value:i}=e;if(!(i!=null&&i.focus)){n();return}const{selectionStart:a,selectionEnd:l,value:s}=i;if(a==null||l==null){n();return}t.value={start:a,end:l,beforeText:s.slice(0,a),afterText:s.slice(l)}}function r(){var i;const{value:a}=t,{value:l}=e;if(!a||!l)return;const{value:s}=l,{start:c,beforeText:d,afterText:u}=a;let p=s.length;if(s.endsWith(u))p=s.length-u.length;else if(s.startsWith(d))p=d.length;else{const m=d[c-1],f=s.indexOf(m,c-1);f!==-1&&(p=f+1)}(i=l.setSelectionRange)===null||i===void 0||i.call(l,p,p)}function n(){t.value=null}return Zt(e,n),{recordCursor:o,restoreCursor:r}}const Zs=He({name:"InputWordCount",setup(e,{slots:t}){const{mergedValueRef:o,maxlengthRef:r,mergedClsPrefixRef:n,countGraphemesRef:i}=Le(Vu),a=Y(()=>{const{value:l}=o;return l===null||Array.isArray(l)?0:(i.value||r1)(l)});return()=>{const{value:l}=r,{value:s}=o;return y("span",{class:`${n.value}-input-word-count`},Ib(t.default,{value:s===null||Array.isArray(s)?"":s},()=>[l===void 0?a.value:`${a.value} / ${l}`]))}}}),i1=Object.assign(Object.assign({},Ct.props),{bordered:{type:Boolean,default:void 0},type:{type:String,default:"text"},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:[Function,Array],onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:{type:Boolean,default:!0},showPasswordToggle:Boolean}),CP=He({name:"Input",props:i1,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:o,inlineThemeDisabled:r,mergedRtlRef:n}=zo(e),i=Ct("Input","-input",t1,ki,e,t);ju&&Er("-input-safari",o1,t);const a=fe(null),l=fe(null),s=fe(null),c=fe(null),d=fe(null),u=fe(null),p=fe(null),m=n1(p),f=fe(null),{localeRef:g}=ly("Input"),S=fe(e.defaultValue),v=Dt(e,"value"),$=Km(v,S),T=Zd(e),{mergedSizeRef:w,mergedDisabledRef:_,mergedStatusRef:O}=T,x=fe(!1),F=fe(!1),R=fe(!1),B=fe(!1);let j=null;const A=Y(()=>{const{placeholder:C,pair:E}=e;return E?Array.isArray(C)?C:C===void 0?["",""]:[C,C]:C===void 0?[g.value.placeholder]:[C]}),J=Y(()=>{const{value:C}=R,{value:E}=$,{value:de}=A;return!C&&(Un(E)||Array.isArray(E)&&Un(E[0]))&&de[0]}),G=Y(()=>{const{value:C}=R,{value:E}=$,{value:de}=A;return!C&&de[1]&&(Un(E)||Array.isArray(E)&&Un(E[1]))}),le=hn(()=>e.internalForceFocus||x.value),te=hn(()=>{if(_.value||e.readonly||!e.clearable||!le.value&&!F.value)return!1;const{value:C}=$,{value:E}=le;return e.pair?!!(Array.isArray(C)&&(C[0]||C[1]))&&(F.value||E):!!C&&(F.value||E)}),N=Y(()=>{const{showPasswordOn:C}=e;if(C)return C;if(e.showPasswordToggle)return"click"}),oe=fe(!1),ye=Y(()=>{const{textDecoration:C}=e;return C?Array.isArray(C)?C.map(E=>({textDecoration:E})):[{textDecoration:C}]:["",""]}),Pe=fe(void 0),Re=()=>{var C,E;if(e.type==="textarea"){const{autosize:de}=e;if(de&&(Pe.value=(E=(C=f.value)===null||C===void 0?void 0:C.$el)===null||E===void 0?void 0:E.offsetWidth),!l.value||typeof de=="boolean")return;const{paddingTop:Ie,paddingBottom:Oe,lineHeight:Ae}=window.getComputedStyle(l.value),oo=Number(Ie.slice(0,-2)),ro=Number(Oe.slice(0,-2)),no=Number(Ae.slice(0,-2)),{value:kr}=s;if(!kr)return;if(de.minRows){const Dr=Math.max(de.minRows,1),Wi=`${oo+ro+no*Dr}px`;kr.style.minHeight=Wi}if(de.maxRows){const Dr=`${oo+ro+no*de.maxRows}px`;kr.style.maxHeight=Dr}}},Fe=Y(()=>{const{maxlength:C}=e;return C===void 0?void 0:Number(C)});Mo(()=>{const{value:C}=$;Array.isArray(C)||st(C)});const Ve=Sn().proxy;function qe(C,E){const{onUpdateValue:de,"onUpdate:value":Ie,onInput:Oe}=e,{nTriggerFormInput:Ae}=T;de&&Ke(de,C,E),Ie&&Ke(Ie,C,E),Oe&&Ke(Oe,C,E),S.value=C,Ae()}function gt(C,E){const{onChange:de}=e,{nTriggerFormChange:Ie}=T;de&&Ke(de,C,E),S.value=C,Ie()}function he(C){const{onBlur:E}=e,{nTriggerFormBlur:de}=T;E&&Ke(E,C),de()}function Ue(C){const{onFocus:E}=e,{nTriggerFormFocus:de}=T;E&&Ke(E,C),de()}function rt(C){const{onClear:E}=e;E&&Ke(E,C)}function be(C){const{onInputBlur:E}=e;E&&Ke(E,C)}function Ge(C){const{onInputFocus:E}=e;E&&Ke(E,C)}function Pt(){const{onDeactivate:C}=e;C&&Ke(C)}function h(){const{onActivate:C}=e;C&&Ke(C)}function b(C){const{onClick:E}=e;E&&Ke(E,C)}function P(C){const{onWrapperFocus:E}=e;E&&Ke(E,C)}function H(C){const{onWrapperBlur:E}=e;E&&Ke(E,C)}function M(){R.value=!0}function k(C){R.value=!1,C.target===u.value?q(C,1):q(C,0)}function q(C,E=0,de="input"){const Ie=C.target.value;if(st(Ie),C instanceof InputEvent&&!C.isComposing&&(R.value=!1),e.type==="textarea"){const{value:Ae}=f;Ae&&Ae.syncUnifiedContainer()}if(j=Ie,R.value)return;m.recordCursor();const Oe=U(Ie);if(Oe)if(!e.pair)de==="input"?qe(Ie,{source:E}):gt(Ie,{source:E});else{let{value:Ae}=$;Array.isArray(Ae)?Ae=[Ae[0],Ae[1]]:Ae=["",""],Ae[E]=Ie,de==="input"?qe(Ae,{source:E}):gt(Ae,{source:E})}Ve.$forceUpdate(),Oe||nn(m.restoreCursor)}function U(C){const{countGraphemes:E,maxlength:de,minlength:Ie}=e;if(E){let Ae;if(de!==void 0&&(Ae===void 0&&(Ae=E(C)),Ae>Number(de))||Ie!==void 0&&(Ae===void 0&&(Ae=E(C)),Ae{Ie.preventDefault(),lo("mouseup",document,E)};if(Go("mouseup",document,E),N.value!=="mousedown")return;oe.value=!0;const de=()=>{oe.value=!1,lo("mouseup",document,de)};Go("mouseup",document,de)}function Ht(C){e.onKeyup&&Ke(e.onKeyup,C)}function at(C){switch(e.onKeydown&&Ke(e.onKeydown,C),C.key){case"Escape":Q();break;case"Enter":D(C);break}}function D(C){var E,de;if(e.passivelyActivated){const{value:Ie}=B;if(Ie){e.internalDeactivateOnEnter&&Q();return}C.preventDefault(),e.type==="textarea"?(E=l.value)===null||E===void 0||E.focus():(de=d.value)===null||de===void 0||de.focus()}}function Q(){e.passivelyActivated&&(B.value=!1,nn(()=>{var C;(C=a.value)===null||C===void 0||C.focus()}))}function ge(){var C,E,de;_.value||(e.passivelyActivated?(C=a.value)===null||C===void 0||C.focus():((E=l.value)===null||E===void 0||E.focus(),(de=d.value)===null||de===void 0||de.focus()))}function Ee(){var C;!((C=a.value)===null||C===void 0)&&C.contains(document.activeElement)&&document.activeElement.blur()}function je(){var C,E;(C=l.value)===null||C===void 0||C.select(),(E=d.value)===null||E===void 0||E.select()}function lt(){_.value||(l.value?l.value.focus():d.value&&d.value.focus())}function Tt(){const{value:C}=a;C!=null&&C.contains(document.activeElement)&&C!==document.activeElement&&Q()}function ke(C){if(e.type==="textarea"){const{value:E}=l;E==null||E.scrollTo(C)}else{const{value:E}=d;E==null||E.scrollTo(C)}}function st(C){const{type:E,pair:de,autosize:Ie}=e;if(!de&&Ie)if(E==="textarea"){const{value:Oe}=s;Oe&&(Oe.textContent=`${C??""}\r -`)}else{const{value:Oe}=c;Oe&&(C?Oe.textContent=C:Oe.innerHTML=" ")}}function jt(){Re()}const _n=fe({top:"0"});function Oi(C){var E;const{scrollTop:de}=C.target;_n.value.top=`${-de}px`,(E=f.value)===null||E===void 0||E.syncUnifiedContainer()}let sr=null;sn(()=>{const{autosize:C,type:E}=e;C&&E==="textarea"?sr=Zt($,de=>{!Array.isArray(de)&&de!==j&&st(de)}):sr==null||sr()});let cr=null;sn(()=>{e.type==="textarea"?cr=Zt($,C=>{var E;!Array.isArray(C)&&C!==j&&((E=f.value)===null||E===void 0||E.syncUnifiedContainer())}):cr==null||cr()}),po(Vu,{mergedValueRef:$,maxlengthRef:Fe,mergedClsPrefixRef:t,countGraphemesRef:Dt(e,"countGraphemes")});const Bi={wrapperElRef:a,inputElRef:d,textareaElRef:l,isCompositing:R,clear:Ce,focus:ge,blur:Ee,select:je,deactivate:Tt,activate:lt,scrollTo:ke},Li=$n("Input",n,t),En=Y(()=>{const{value:C}=w,{common:{cubicBezierEaseInOut:E},self:{color:de,borderRadius:Ie,textColor:Oe,caretColor:Ae,caretColorError:oo,caretColorWarning:ro,textDecorationColor:no,border:kr,borderDisabled:Dr,borderHover:Wi,borderFocus:$f,placeholderColor:Rf,placeholderColorDisabled:Ff,lineHeightTextarea:Af,colorDisabled:If,colorFocus:_f,textColorDisabled:Ef,boxShadowFocus:Mf,iconSize:zf,colorFocusWarning:Hf,boxShadowFocusWarning:kf,borderWarning:Df,borderFocusWarning:Of,borderHoverWarning:Bf,colorFocusError:Lf,boxShadowFocusError:Wf,borderError:jf,borderFocusError:Nf,borderHoverError:Vf,clearSize:Uf,clearColor:qf,clearColorHover:Gf,clearColorPressed:Kf,iconColor:Yf,iconColorDisabled:Xf,suffixTextColor:Jf,countTextColor:Zf,countTextColorDisabled:Qf,iconColorHover:ep,iconColorPressed:tp,loadingColor:op,loadingColorError:rp,loadingColorWarning:np,fontWeight:ip,[ae("padding",C)]:ap,[ae("fontSize",C)]:lp,[ae("height",C)]:sp}}=i.value,{left:cp,right:dp}=Vo(ap);return{"--n-bezier":E,"--n-count-text-color":Zf,"--n-count-text-color-disabled":Qf,"--n-color":de,"--n-font-size":lp,"--n-font-weight":ip,"--n-border-radius":Ie,"--n-height":sp,"--n-padding-left":cp,"--n-padding-right":dp,"--n-text-color":Oe,"--n-caret-color":Ae,"--n-text-decoration-color":no,"--n-border":kr,"--n-border-disabled":Dr,"--n-border-hover":Wi,"--n-border-focus":$f,"--n-placeholder-color":Rf,"--n-placeholder-color-disabled":Ff,"--n-icon-size":zf,"--n-line-height-textarea":Af,"--n-color-disabled":If,"--n-color-focus":_f,"--n-text-color-disabled":Ef,"--n-box-shadow-focus":Mf,"--n-loading-color":op,"--n-caret-color-warning":ro,"--n-color-focus-warning":Hf,"--n-box-shadow-focus-warning":kf,"--n-border-warning":Df,"--n-border-focus-warning":Of,"--n-border-hover-warning":Bf,"--n-loading-color-warning":np,"--n-caret-color-error":oo,"--n-color-focus-error":Lf,"--n-box-shadow-focus-error":Wf,"--n-border-error":jf,"--n-border-focus-error":Nf,"--n-border-hover-error":Vf,"--n-loading-color-error":rp,"--n-clear-color":qf,"--n-clear-size":Uf,"--n-clear-color-hover":Gf,"--n-clear-color-pressed":Kf,"--n-icon-color":Yf,"--n-icon-color-hover":ep,"--n-icon-color-pressed":tp,"--n-icon-color-disabled":Xf,"--n-suffix-text-color":Jf}}),bo=r?Fr("input",Y(()=>{const{value:C}=w;return C[0]}),En,e):void 0;return Object.assign(Object.assign({},Bi),{wrapperElRef:a,inputElRef:d,inputMirrorElRef:c,inputEl2Ref:u,textareaElRef:l,textareaMirrorElRef:s,textareaScrollbarInstRef:f,rtlEnabled:Li,uncontrolledValue:S,mergedValue:$,passwordVisible:oe,mergedPlaceholder:A,showPlaceholder1:J,showPlaceholder2:G,mergedFocus:le,isComposing:R,activated:B,showClearButton:te,mergedSize:w,mergedDisabled:_,textDecorationStyle:ye,mergedClsPrefix:t,mergedBordered:o,mergedShowPasswordOn:N,placeholderStyle:_n,mergedStatus:O,textAreaScrollContainerWidth:Pe,handleTextAreaScroll:Oi,handleCompositionStart:M,handleCompositionEnd:k,handleInput:q,handleInputBlur:z,handleInputFocus:I,handleWrapperBlur:ie,handleWrapperFocus:X,handleMouseEnter:Qe,handleMouseLeave:nt,handleMouseDown:Ze,handleChange:se,handleClick:ve,handleClear:Te,handlePasswordToggleClick:it,handlePasswordToggleMousedown:Wt,handleWrapperKeydown:at,handleWrapperKeyup:Ht,handleTextAreaMirrorResize:jt,getTextareaScrollContainer:()=>l.value,mergedTheme:i,cssVars:r?void 0:En,themeClass:bo==null?void 0:bo.themeClass,onRender:bo==null?void 0:bo.onRender})},render(){var e,t;const{mergedClsPrefix:o,mergedStatus:r,themeClass:n,type:i,countGraphemes:a,onRender:l}=this,s=this.$slots;return l==null||l(),y("div",{ref:"wrapperElRef",class:[`${o}-input`,n,r&&`${o}-input--${r}-status`,{[`${o}-input--rtl`]:this.rtlEnabled,[`${o}-input--disabled`]:this.mergedDisabled,[`${o}-input--textarea`]:i==="textarea",[`${o}-input--resizable`]:this.resizable&&!this.autosize,[`${o}-input--autosize`]:this.autosize,[`${o}-input--round`]:this.round&&i!=="textarea",[`${o}-input--pair`]:this.pair,[`${o}-input--focus`]:this.mergedFocus,[`${o}-input--stateful`]:this.stateful}],style:this.cssVars,tabindex:!this.mergedDisabled&&this.passivelyActivated&&!this.activated?0:void 0,onFocus:this.handleWrapperFocus,onBlur:this.handleWrapperBlur,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd,onKeyup:this.handleWrapperKeyup,onKeydown:this.handleWrapperKeydown},y("div",{class:`${o}-input-wrapper`},$t(s.prefix,c=>c&&y("div",{class:`${o}-input__prefix`},c)),i==="textarea"?y(Hu,{ref:"textareaScrollbarInstRef",class:`${o}-input__textarea`,container:this.getTextareaScrollContainer,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{var c,d;const{textAreaScrollContainerWidth:u}=this,p={width:this.autosize&&u&&`${u}px`};return y(et,null,y("textarea",Object.assign({},this.inputProps,{ref:"textareaElRef",class:[`${o}-input__textarea-el`,(c=this.inputProps)===null||c===void 0?void 0:c.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],(d=this.inputProps)===null||d===void 0?void 0:d.style,p],onBlur:this.handleInputBlur,onFocus:m=>{this.handleInputFocus(m,2)},onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?y("div",{class:`${o}-input__placeholder`,style:[this.placeholderStyle,p],key:"placeholder"},this.mergedPlaceholder[0]):null,this.autosize?y(Fa,{onResize:this.handleTextAreaMirrorResize},{default:()=>y("div",{ref:"textareaMirrorElRef",class:`${o}-input__textarea-mirror`,key:"mirror"})}):null)}}):y("div",{class:`${o}-input__input`},y("input",Object.assign({type:i==="password"&&this.mergedShowPasswordOn&&this.passwordVisible?"text":i},this.inputProps,{ref:"inputElRef",class:[`${o}-input__input-el`,(e=this.inputProps)===null||e===void 0?void 0:e.class],style:[this.textDecorationStyle[0],(t=this.inputProps)===null||t===void 0?void 0:t.style],tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[0]:this.mergedValue,readonly:this.readonly,autofocus:this.autofocus,size:this.attrSize,onBlur:this.handleInputBlur,onFocus:c=>{this.handleInputFocus(c,0)},onInput:c=>{this.handleInput(c,0)},onChange:c=>{this.handleChange(c,0)}})),this.showPlaceholder1?y("div",{class:`${o}-input__placeholder`},y("span",null,this.mergedPlaceholder[0])):null,this.autosize?y("div",{class:`${o}-input__input-mirror`,key:"mirror",ref:"inputMirrorElRef"}," "):null),!this.pair&&$t(s.suffix,c=>c||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?y("div",{class:`${o}-input__suffix`},[$t(s["clear-icon-placeholder"],d=>(this.clearable||d)&&y(ka,{clsPrefix:o,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>d,icon:()=>{var u,p;return(p=(u=this.$slots)["clear-icon"])===null||p===void 0?void 0:p.call(u)}})),this.internalLoadingBeforeSuffix?null:c,this.loading!==void 0?y(By,{clsPrefix:o,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}):null,this.internalLoadingBeforeSuffix?c:null,this.showCount&&this.type!=="textarea"?y(Zs,null,{default:d=>{var u;return(u=s.count)===null||u===void 0?void 0:u.call(s,d)}}):null,this.mergedShowPasswordOn&&this.type==="password"?y("div",{class:`${o}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?Qr(s["password-visible-icon"],()=>[y(Tr,{clsPrefix:o},{default:()=>y(my,null)})]):Qr(s["password-invisible-icon"],()=>[y(Tr,{clsPrefix:o},{default:()=>y(by,null)})])):null]):null)),this.pair?y("span",{class:`${o}-input__separator`},Qr(s.separator,()=>[this.separator])):null,this.pair?y("div",{class:`${o}-input-wrapper`},y("div",{class:`${o}-input__input`},y("input",{ref:"inputEl2Ref",type:this.type,class:`${o}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[1]:void 0,readonly:this.readonly,style:this.textDecorationStyle[1],onBlur:this.handleInputBlur,onFocus:c=>{this.handleInputFocus(c,1)},onInput:c=>{this.handleInput(c,1)},onChange:c=>{this.handleChange(c,1)}}),this.showPlaceholder2?y("div",{class:`${o}-input__placeholder`},y("span",null,this.mergedPlaceholder[1])):null),$t(s.suffix,c=>(this.clearable||c)&&y("div",{class:`${o}-input__suffix`},[this.clearable&&y(ka,{clsPrefix:o,show:this.showClearButton,onClear:this.handleClear},{icon:()=>{var d;return(d=s["clear-icon"])===null||d===void 0?void 0:d.call(s)},placeholder:()=>{var d;return(d=s["clear-icon-placeholder"])===null||d===void 0?void 0:d.call(s)}}),c]))):null,this.mergedBordered?y("div",{class:`${o}-input__border`}):null,this.mergedBordered?y("div",{class:`${o}-input__state-border`}):null,this.showCount&&i==="textarea"?y(Zs,null,{default:c=>{var d;const{renderCount:u}=this;return u?u(c):(d=s.count)===null||d===void 0?void 0:d.call(s,c)}}):null)}});function a1(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const l1={name:"AutoComplete",common:W,peers:{InternalSelectMenu:Fn,Input:zt},self:a1};function s1(e){const{borderRadius:t,avatarColor:o,cardColor:r,fontSize:n,heightTiny:i,heightSmall:a,heightMedium:l,heightLarge:s,heightHuge:c,modalColor:d,popoverColor:u}=e;return{borderRadius:t,fontSize:n,border:`2px solid ${r}`,heightTiny:i,heightSmall:a,heightMedium:l,heightLarge:s,heightHuge:c,color:ee(r,o),colorModal:ee(d,o),colorPopover:ee(u,o)}}const Uu={name:"Avatar",common:W,self:s1};function c1(){return{gap:"-12px"}}const d1={name:"AvatarGroup",common:W,peers:{Avatar:Uu},self:c1},u1={width:"44px",height:"44px",borderRadius:"22px",iconSize:"26px"},f1={name:"BackTop",common:W,self(e){const{popoverColor:t,textColor2:o,primaryColorHover:r,primaryColorPressed:n}=e;return Object.assign(Object.assign({},u1),{color:t,textColor:o,iconColor:o,iconColorHover:r,iconColorPressed:n,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .18)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .18)"})}},p1={name:"Badge",common:W,self(e){const{errorColorSuppl:t,infoColorSuppl:o,successColorSuppl:r,warningColorSuppl:n,fontFamily:i}=e;return{color:t,colorInfo:o,colorSuccess:r,colorError:t,colorWarning:n,fontSize:"12px",fontFamily:i}}},h1={fontWeightActive:"400"};function g1(e){const{fontSize:t,textColor3:o,textColor2:r,borderRadius:n,buttonColor2Hover:i,buttonColor2Pressed:a}=e;return Object.assign(Object.assign({},h1),{fontSize:t,itemLineHeight:"1.25",itemTextColor:o,itemTextColorHover:r,itemTextColorPressed:r,itemTextColorActive:r,itemBorderRadius:n,itemColorHover:i,itemColorPressed:a,separatorColor:o})}const m1={name:"Breadcrumb",common:W,self:g1};function Lo(e){return ee(e,[255,255,255,.16])}function qn(e){return ee(e,[0,0,0,.12])}const b1="n-button-group",v1={paddingTiny:"0 6px",paddingSmall:"0 10px",paddingMedium:"0 14px",paddingLarge:"0 18px",paddingRoundTiny:"0 10px",paddingRoundSmall:"0 14px",paddingRoundMedium:"0 18px",paddingRoundLarge:"0 22px",iconMarginTiny:"6px",iconMarginSmall:"6px",iconMarginMedium:"6px",iconMarginLarge:"6px",iconSizeTiny:"14px",iconSizeSmall:"18px",iconSizeMedium:"18px",iconSizeLarge:"20px",rippleDuration:".6s"};function qu(e){const{heightTiny:t,heightSmall:o,heightMedium:r,heightLarge:n,borderRadius:i,fontSizeTiny:a,fontSizeSmall:l,fontSizeMedium:s,fontSizeLarge:c,opacityDisabled:d,textColor2:u,textColor3:p,primaryColorHover:m,primaryColorPressed:f,borderColor:g,primaryColor:S,baseColor:v,infoColor:$,infoColorHover:T,infoColorPressed:w,successColor:_,successColorHover:O,successColorPressed:x,warningColor:F,warningColorHover:R,warningColorPressed:B,errorColor:j,errorColorHover:A,errorColorPressed:J,fontWeight:G,buttonColor2:le,buttonColor2Hover:te,buttonColor2Pressed:N,fontWeightStrong:oe}=e;return Object.assign(Object.assign({},v1),{heightTiny:t,heightSmall:o,heightMedium:r,heightLarge:n,borderRadiusTiny:i,borderRadiusSmall:i,borderRadiusMedium:i,borderRadiusLarge:i,fontSizeTiny:a,fontSizeSmall:l,fontSizeMedium:s,fontSizeLarge:c,opacityDisabled:d,colorOpacitySecondary:"0.16",colorOpacitySecondaryHover:"0.22",colorOpacitySecondaryPressed:"0.28",colorSecondary:le,colorSecondaryHover:te,colorSecondaryPressed:N,colorTertiary:le,colorTertiaryHover:te,colorTertiaryPressed:N,colorQuaternary:"#0000",colorQuaternaryHover:te,colorQuaternaryPressed:N,color:"#0000",colorHover:"#0000",colorPressed:"#0000",colorFocus:"#0000",colorDisabled:"#0000",textColor:u,textColorTertiary:p,textColorHover:m,textColorPressed:f,textColorFocus:m,textColorDisabled:u,textColorText:u,textColorTextHover:m,textColorTextPressed:f,textColorTextFocus:m,textColorTextDisabled:u,textColorGhost:u,textColorGhostHover:m,textColorGhostPressed:f,textColorGhostFocus:m,textColorGhostDisabled:u,border:`1px solid ${g}`,borderHover:`1px solid ${m}`,borderPressed:`1px solid ${f}`,borderFocus:`1px solid ${m}`,borderDisabled:`1px solid ${g}`,rippleColor:S,colorPrimary:S,colorHoverPrimary:m,colorPressedPrimary:f,colorFocusPrimary:m,colorDisabledPrimary:S,textColorPrimary:v,textColorHoverPrimary:v,textColorPressedPrimary:v,textColorFocusPrimary:v,textColorDisabledPrimary:v,textColorTextPrimary:S,textColorTextHoverPrimary:m,textColorTextPressedPrimary:f,textColorTextFocusPrimary:m,textColorTextDisabledPrimary:u,textColorGhostPrimary:S,textColorGhostHoverPrimary:m,textColorGhostPressedPrimary:f,textColorGhostFocusPrimary:m,textColorGhostDisabledPrimary:S,borderPrimary:`1px solid ${S}`,borderHoverPrimary:`1px solid ${m}`,borderPressedPrimary:`1px solid ${f}`,borderFocusPrimary:`1px solid ${m}`,borderDisabledPrimary:`1px solid ${S}`,rippleColorPrimary:S,colorInfo:$,colorHoverInfo:T,colorPressedInfo:w,colorFocusInfo:T,colorDisabledInfo:$,textColorInfo:v,textColorHoverInfo:v,textColorPressedInfo:v,textColorFocusInfo:v,textColorDisabledInfo:v,textColorTextInfo:$,textColorTextHoverInfo:T,textColorTextPressedInfo:w,textColorTextFocusInfo:T,textColorTextDisabledInfo:u,textColorGhostInfo:$,textColorGhostHoverInfo:T,textColorGhostPressedInfo:w,textColorGhostFocusInfo:T,textColorGhostDisabledInfo:$,borderInfo:`1px solid ${$}`,borderHoverInfo:`1px solid ${T}`,borderPressedInfo:`1px solid ${w}`,borderFocusInfo:`1px solid ${T}`,borderDisabledInfo:`1px solid ${$}`,rippleColorInfo:$,colorSuccess:_,colorHoverSuccess:O,colorPressedSuccess:x,colorFocusSuccess:O,colorDisabledSuccess:_,textColorSuccess:v,textColorHoverSuccess:v,textColorPressedSuccess:v,textColorFocusSuccess:v,textColorDisabledSuccess:v,textColorTextSuccess:_,textColorTextHoverSuccess:O,textColorTextPressedSuccess:x,textColorTextFocusSuccess:O,textColorTextDisabledSuccess:u,textColorGhostSuccess:_,textColorGhostHoverSuccess:O,textColorGhostPressedSuccess:x,textColorGhostFocusSuccess:O,textColorGhostDisabledSuccess:_,borderSuccess:`1px solid ${_}`,borderHoverSuccess:`1px solid ${O}`,borderPressedSuccess:`1px solid ${x}`,borderFocusSuccess:`1px solid ${O}`,borderDisabledSuccess:`1px solid ${_}`,rippleColorSuccess:_,colorWarning:F,colorHoverWarning:R,colorPressedWarning:B,colorFocusWarning:R,colorDisabledWarning:F,textColorWarning:v,textColorHoverWarning:v,textColorPressedWarning:v,textColorFocusWarning:v,textColorDisabledWarning:v,textColorTextWarning:F,textColorTextHoverWarning:R,textColorTextPressedWarning:B,textColorTextFocusWarning:R,textColorTextDisabledWarning:u,textColorGhostWarning:F,textColorGhostHoverWarning:R,textColorGhostPressedWarning:B,textColorGhostFocusWarning:R,textColorGhostDisabledWarning:F,borderWarning:`1px solid ${F}`,borderHoverWarning:`1px solid ${R}`,borderPressedWarning:`1px solid ${B}`,borderFocusWarning:`1px solid ${R}`,borderDisabledWarning:`1px solid ${F}`,rippleColorWarning:F,colorError:j,colorHoverError:A,colorPressedError:J,colorFocusError:A,colorDisabledError:j,textColorError:v,textColorHoverError:v,textColorPressedError:v,textColorFocusError:v,textColorDisabledError:v,textColorTextError:j,textColorTextHoverError:A,textColorTextPressedError:J,textColorTextFocusError:A,textColorTextDisabledError:u,textColorGhostError:j,textColorGhostHoverError:A,textColorGhostPressedError:J,textColorGhostFocusError:A,textColorGhostDisabledError:j,borderError:`1px solid ${j}`,borderHoverError:`1px solid ${A}`,borderPressedError:`1px solid ${J}`,borderFocusError:`1px solid ${A}`,borderDisabledError:`1px solid ${j}`,rippleColorError:j,waveOpacity:"0.6",fontWeight:G,fontWeightStrong:oe})}const An={name:"Button",common:Be,self:qu},wt={name:"Button",common:W,self(e){const t=qu(e);return t.waveOpacity="0.8",t.colorOpacitySecondary="0.16",t.colorOpacitySecondaryHover="0.2",t.colorOpacitySecondaryPressed="0.12",t}},x1=L([pe("button",` + `)])]);function r1(e){let t=0;for(const o of e)t++;return t}function Un(e){return e===""||e==null}function n1(e){const t=fe(null);function o(){const{value:i}=e;if(!(i!=null&&i.focus)){n();return}const{selectionStart:a,selectionEnd:l,value:s}=i;if(a==null||l==null){n();return}t.value={start:a,end:l,beforeText:s.slice(0,a),afterText:s.slice(l)}}function r(){var i;const{value:a}=t,{value:l}=e;if(!a||!l)return;const{value:s}=l,{start:c,beforeText:d,afterText:u}=a;let p=s.length;if(s.endsWith(u))p=s.length-u.length;else if(s.startsWith(d))p=d.length;else{const m=d[c-1],f=s.indexOf(m,c-1);f!==-1&&(p=f+1)}(i=l.setSelectionRange)===null||i===void 0||i.call(l,p,p)}function n(){t.value=null}return Zt(e,n),{recordCursor:o,restoreCursor:r}}const Zs=He({name:"InputWordCount",setup(e,{slots:t}){const{mergedValueRef:o,maxlengthRef:r,mergedClsPrefixRef:n,countGraphemesRef:i}=Le(Vu),a=Y(()=>{const{value:l}=o;return l===null||Array.isArray(l)?0:(i.value||r1)(l)});return()=>{const{value:l}=r,{value:s}=o;return y("span",{class:`${n.value}-input-word-count`},Ib(t.default,{value:s===null||Array.isArray(s)?"":s},()=>[l===void 0?a.value:`${a.value} / ${l}`]))}}}),i1=Object.assign(Object.assign({},Ct.props),{bordered:{type:Boolean,default:void 0},type:{type:String,default:"text"},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:[Function,Array],onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:{type:Boolean,default:!0},showPasswordToggle:Boolean}),CP=He({name:"Input",props:i1,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:o,inlineThemeDisabled:r,mergedRtlRef:n}=zo(e),i=Ct("Input","-input",t1,ki,e,t);ju&&_r("-input-safari",o1,t);const a=fe(null),l=fe(null),s=fe(null),c=fe(null),d=fe(null),u=fe(null),p=fe(null),m=n1(p),f=fe(null),{localeRef:g}=ly("Input"),S=fe(e.defaultValue),v=Dt(e,"value"),$=Km(v,S),T=Zd(e),{mergedSizeRef:w,mergedDisabledRef:E,mergedStatusRef:O}=T,x=fe(!1),F=fe(!1),R=fe(!1),B=fe(!1);let j=null;const A=Y(()=>{const{placeholder:C,pair:_}=e;return _?Array.isArray(C)?C:C===void 0?["",""]:[C,C]:C===void 0?[g.value.placeholder]:[C]}),J=Y(()=>{const{value:C}=R,{value:_}=$,{value:de}=A;return!C&&(Un(_)||Array.isArray(_)&&Un(_[0]))&&de[0]}),G=Y(()=>{const{value:C}=R,{value:_}=$,{value:de}=A;return!C&&de[1]&&(Un(_)||Array.isArray(_)&&Un(_[1]))}),le=hn(()=>e.internalForceFocus||x.value),te=hn(()=>{if(E.value||e.readonly||!e.clearable||!le.value&&!F.value)return!1;const{value:C}=$,{value:_}=le;return e.pair?!!(Array.isArray(C)&&(C[0]||C[1]))&&(F.value||_):!!C&&(F.value||_)}),N=Y(()=>{const{showPasswordOn:C}=e;if(C)return C;if(e.showPasswordToggle)return"click"}),oe=fe(!1),ye=Y(()=>{const{textDecoration:C}=e;return C?Array.isArray(C)?C.map(_=>({textDecoration:_})):[{textDecoration:C}]:["",""]}),Pe=fe(void 0),Re=()=>{var C,_;if(e.type==="textarea"){const{autosize:de}=e;if(de&&(Pe.value=(_=(C=f.value)===null||C===void 0?void 0:C.$el)===null||_===void 0?void 0:_.offsetWidth),!l.value||typeof de=="boolean")return;const{paddingTop:Ie,paddingBottom:Oe,lineHeight:Ae}=window.getComputedStyle(l.value),oo=Number(Ie.slice(0,-2)),ro=Number(Oe.slice(0,-2)),no=Number(Ae.slice(0,-2)),{value:kr}=s;if(!kr)return;if(de.minRows){const Dr=Math.max(de.minRows,1),Wi=`${oo+ro+no*Dr}px`;kr.style.minHeight=Wi}if(de.maxRows){const Dr=`${oo+ro+no*de.maxRows}px`;kr.style.maxHeight=Dr}}},Fe=Y(()=>{const{maxlength:C}=e;return C===void 0?void 0:Number(C)});Mo(()=>{const{value:C}=$;Array.isArray(C)||st(C)});const Ve=Sn().proxy;function qe(C,_){const{onUpdateValue:de,"onUpdate:value":Ie,onInput:Oe}=e,{nTriggerFormInput:Ae}=T;de&&Ke(de,C,_),Ie&&Ke(Ie,C,_),Oe&&Ke(Oe,C,_),S.value=C,Ae()}function gt(C,_){const{onChange:de}=e,{nTriggerFormChange:Ie}=T;de&&Ke(de,C,_),S.value=C,Ie()}function he(C){const{onBlur:_}=e,{nTriggerFormBlur:de}=T;_&&Ke(_,C),de()}function Ue(C){const{onFocus:_}=e,{nTriggerFormFocus:de}=T;_&&Ke(_,C),de()}function rt(C){const{onClear:_}=e;_&&Ke(_,C)}function be(C){const{onInputBlur:_}=e;_&&Ke(_,C)}function Ge(C){const{onInputFocus:_}=e;_&&Ke(_,C)}function Pt(){const{onDeactivate:C}=e;C&&Ke(C)}function h(){const{onActivate:C}=e;C&&Ke(C)}function b(C){const{onClick:_}=e;_&&Ke(_,C)}function P(C){const{onWrapperFocus:_}=e;_&&Ke(_,C)}function H(C){const{onWrapperBlur:_}=e;_&&Ke(_,C)}function M(){R.value=!0}function k(C){R.value=!1,C.target===u.value?q(C,1):q(C,0)}function q(C,_=0,de="input"){const Ie=C.target.value;if(st(Ie),C instanceof InputEvent&&!C.isComposing&&(R.value=!1),e.type==="textarea"){const{value:Ae}=f;Ae&&Ae.syncUnifiedContainer()}if(j=Ie,R.value)return;m.recordCursor();const Oe=U(Ie);if(Oe)if(!e.pair)de==="input"?qe(Ie,{source:_}):gt(Ie,{source:_});else{let{value:Ae}=$;Array.isArray(Ae)?Ae=[Ae[0],Ae[1]]:Ae=["",""],Ae[_]=Ie,de==="input"?qe(Ae,{source:_}):gt(Ae,{source:_})}Ve.$forceUpdate(),Oe||nn(m.restoreCursor)}function U(C){const{countGraphemes:_,maxlength:de,minlength:Ie}=e;if(_){let Ae;if(de!==void 0&&(Ae===void 0&&(Ae=_(C)),Ae>Number(de))||Ie!==void 0&&(Ae===void 0&&(Ae=_(C)),Ae{Ie.preventDefault(),lo("mouseup",document,_)};if(Go("mouseup",document,_),N.value!=="mousedown")return;oe.value=!0;const de=()=>{oe.value=!1,lo("mouseup",document,de)};Go("mouseup",document,de)}function Ht(C){e.onKeyup&&Ke(e.onKeyup,C)}function at(C){switch(e.onKeydown&&Ke(e.onKeydown,C),C.key){case"Escape":Q();break;case"Enter":D(C);break}}function D(C){var _,de;if(e.passivelyActivated){const{value:Ie}=B;if(Ie){e.internalDeactivateOnEnter&&Q();return}C.preventDefault(),e.type==="textarea"?(_=l.value)===null||_===void 0||_.focus():(de=d.value)===null||de===void 0||de.focus()}}function Q(){e.passivelyActivated&&(B.value=!1,nn(()=>{var C;(C=a.value)===null||C===void 0||C.focus()}))}function ge(){var C,_,de;E.value||(e.passivelyActivated?(C=a.value)===null||C===void 0||C.focus():((_=l.value)===null||_===void 0||_.focus(),(de=d.value)===null||de===void 0||de.focus()))}function _e(){var C;!((C=a.value)===null||C===void 0)&&C.contains(document.activeElement)&&document.activeElement.blur()}function je(){var C,_;(C=l.value)===null||C===void 0||C.select(),(_=d.value)===null||_===void 0||_.select()}function lt(){E.value||(l.value?l.value.focus():d.value&&d.value.focus())}function Tt(){const{value:C}=a;C!=null&&C.contains(document.activeElement)&&C!==document.activeElement&&Q()}function ke(C){if(e.type==="textarea"){const{value:_}=l;_==null||_.scrollTo(C)}else{const{value:_}=d;_==null||_.scrollTo(C)}}function st(C){const{type:_,pair:de,autosize:Ie}=e;if(!de&&Ie)if(_==="textarea"){const{value:Oe}=s;Oe&&(Oe.textContent=`${C??""}\r +`)}else{const{value:Oe}=c;Oe&&(C?Oe.textContent=C:Oe.innerHTML=" ")}}function jt(){Re()}const En=fe({top:"0"});function Oi(C){var _;const{scrollTop:de}=C.target;En.value.top=`${-de}px`,(_=f.value)===null||_===void 0||_.syncUnifiedContainer()}let sr=null;sn(()=>{const{autosize:C,type:_}=e;C&&_==="textarea"?sr=Zt($,de=>{!Array.isArray(de)&&de!==j&&st(de)}):sr==null||sr()});let cr=null;sn(()=>{e.type==="textarea"?cr=Zt($,C=>{var _;!Array.isArray(C)&&C!==j&&((_=f.value)===null||_===void 0||_.syncUnifiedContainer())}):cr==null||cr()}),po(Vu,{mergedValueRef:$,maxlengthRef:Fe,mergedClsPrefixRef:t,countGraphemesRef:Dt(e,"countGraphemes")});const Bi={wrapperElRef:a,inputElRef:d,textareaElRef:l,isCompositing:R,clear:Ce,focus:ge,blur:_e,select:je,deactivate:Tt,activate:lt,scrollTo:ke},Li=$n("Input",n,t),_n=Y(()=>{const{value:C}=w,{common:{cubicBezierEaseInOut:_},self:{color:de,borderRadius:Ie,textColor:Oe,caretColor:Ae,caretColorError:oo,caretColorWarning:ro,textDecorationColor:no,border:kr,borderDisabled:Dr,borderHover:Wi,borderFocus:$f,placeholderColor:Rf,placeholderColorDisabled:Ff,lineHeightTextarea:Af,colorDisabled:If,colorFocus:Ef,textColorDisabled:_f,boxShadowFocus:Mf,iconSize:zf,colorFocusWarning:Hf,boxShadowFocusWarning:kf,borderWarning:Df,borderFocusWarning:Of,borderHoverWarning:Bf,colorFocusError:Lf,boxShadowFocusError:Wf,borderError:jf,borderFocusError:Nf,borderHoverError:Vf,clearSize:Uf,clearColor:qf,clearColorHover:Gf,clearColorPressed:Kf,iconColor:Yf,iconColorDisabled:Xf,suffixTextColor:Jf,countTextColor:Zf,countTextColorDisabled:Qf,iconColorHover:ep,iconColorPressed:tp,loadingColor:op,loadingColorError:rp,loadingColorWarning:np,fontWeight:ip,[ae("padding",C)]:ap,[ae("fontSize",C)]:lp,[ae("height",C)]:sp}}=i.value,{left:cp,right:dp}=Vo(ap);return{"--n-bezier":_,"--n-count-text-color":Zf,"--n-count-text-color-disabled":Qf,"--n-color":de,"--n-font-size":lp,"--n-font-weight":ip,"--n-border-radius":Ie,"--n-height":sp,"--n-padding-left":cp,"--n-padding-right":dp,"--n-text-color":Oe,"--n-caret-color":Ae,"--n-text-decoration-color":no,"--n-border":kr,"--n-border-disabled":Dr,"--n-border-hover":Wi,"--n-border-focus":$f,"--n-placeholder-color":Rf,"--n-placeholder-color-disabled":Ff,"--n-icon-size":zf,"--n-line-height-textarea":Af,"--n-color-disabled":If,"--n-color-focus":Ef,"--n-text-color-disabled":_f,"--n-box-shadow-focus":Mf,"--n-loading-color":op,"--n-caret-color-warning":ro,"--n-color-focus-warning":Hf,"--n-box-shadow-focus-warning":kf,"--n-border-warning":Df,"--n-border-focus-warning":Of,"--n-border-hover-warning":Bf,"--n-loading-color-warning":np,"--n-caret-color-error":oo,"--n-color-focus-error":Lf,"--n-box-shadow-focus-error":Wf,"--n-border-error":jf,"--n-border-focus-error":Nf,"--n-border-hover-error":Vf,"--n-loading-color-error":rp,"--n-clear-color":qf,"--n-clear-size":Uf,"--n-clear-color-hover":Gf,"--n-clear-color-pressed":Kf,"--n-icon-color":Yf,"--n-icon-color-hover":ep,"--n-icon-color-pressed":tp,"--n-icon-color-disabled":Xf,"--n-suffix-text-color":Jf}}),bo=r?Fr("input",Y(()=>{const{value:C}=w;return C[0]}),_n,e):void 0;return Object.assign(Object.assign({},Bi),{wrapperElRef:a,inputElRef:d,inputMirrorElRef:c,inputEl2Ref:u,textareaElRef:l,textareaMirrorElRef:s,textareaScrollbarInstRef:f,rtlEnabled:Li,uncontrolledValue:S,mergedValue:$,passwordVisible:oe,mergedPlaceholder:A,showPlaceholder1:J,showPlaceholder2:G,mergedFocus:le,isComposing:R,activated:B,showClearButton:te,mergedSize:w,mergedDisabled:E,textDecorationStyle:ye,mergedClsPrefix:t,mergedBordered:o,mergedShowPasswordOn:N,placeholderStyle:En,mergedStatus:O,textAreaScrollContainerWidth:Pe,handleTextAreaScroll:Oi,handleCompositionStart:M,handleCompositionEnd:k,handleInput:q,handleInputBlur:z,handleInputFocus:I,handleWrapperBlur:ie,handleWrapperFocus:X,handleMouseEnter:Qe,handleMouseLeave:nt,handleMouseDown:Ze,handleChange:se,handleClick:ve,handleClear:Te,handlePasswordToggleClick:it,handlePasswordToggleMousedown:Wt,handleWrapperKeydown:at,handleWrapperKeyup:Ht,handleTextAreaMirrorResize:jt,getTextareaScrollContainer:()=>l.value,mergedTheme:i,cssVars:r?void 0:_n,themeClass:bo==null?void 0:bo.themeClass,onRender:bo==null?void 0:bo.onRender})},render(){var e,t;const{mergedClsPrefix:o,mergedStatus:r,themeClass:n,type:i,countGraphemes:a,onRender:l}=this,s=this.$slots;return l==null||l(),y("div",{ref:"wrapperElRef",class:[`${o}-input`,n,r&&`${o}-input--${r}-status`,{[`${o}-input--rtl`]:this.rtlEnabled,[`${o}-input--disabled`]:this.mergedDisabled,[`${o}-input--textarea`]:i==="textarea",[`${o}-input--resizable`]:this.resizable&&!this.autosize,[`${o}-input--autosize`]:this.autosize,[`${o}-input--round`]:this.round&&i!=="textarea",[`${o}-input--pair`]:this.pair,[`${o}-input--focus`]:this.mergedFocus,[`${o}-input--stateful`]:this.stateful}],style:this.cssVars,tabindex:!this.mergedDisabled&&this.passivelyActivated&&!this.activated?0:void 0,onFocus:this.handleWrapperFocus,onBlur:this.handleWrapperBlur,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd,onKeyup:this.handleWrapperKeyup,onKeydown:this.handleWrapperKeydown},y("div",{class:`${o}-input-wrapper`},$t(s.prefix,c=>c&&y("div",{class:`${o}-input__prefix`},c)),i==="textarea"?y(Hu,{ref:"textareaScrollbarInstRef",class:`${o}-input__textarea`,container:this.getTextareaScrollContainer,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{var c,d;const{textAreaScrollContainerWidth:u}=this,p={width:this.autosize&&u&&`${u}px`};return y(et,null,y("textarea",Object.assign({},this.inputProps,{ref:"textareaElRef",class:[`${o}-input__textarea-el`,(c=this.inputProps)===null||c===void 0?void 0:c.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],(d=this.inputProps)===null||d===void 0?void 0:d.style,p],onBlur:this.handleInputBlur,onFocus:m=>{this.handleInputFocus(m,2)},onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?y("div",{class:`${o}-input__placeholder`,style:[this.placeholderStyle,p],key:"placeholder"},this.mergedPlaceholder[0]):null,this.autosize?y(Fa,{onResize:this.handleTextAreaMirrorResize},{default:()=>y("div",{ref:"textareaMirrorElRef",class:`${o}-input__textarea-mirror`,key:"mirror"})}):null)}}):y("div",{class:`${o}-input__input`},y("input",Object.assign({type:i==="password"&&this.mergedShowPasswordOn&&this.passwordVisible?"text":i},this.inputProps,{ref:"inputElRef",class:[`${o}-input__input-el`,(e=this.inputProps)===null||e===void 0?void 0:e.class],style:[this.textDecorationStyle[0],(t=this.inputProps)===null||t===void 0?void 0:t.style],tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[0]:this.mergedValue,readonly:this.readonly,autofocus:this.autofocus,size:this.attrSize,onBlur:this.handleInputBlur,onFocus:c=>{this.handleInputFocus(c,0)},onInput:c=>{this.handleInput(c,0)},onChange:c=>{this.handleChange(c,0)}})),this.showPlaceholder1?y("div",{class:`${o}-input__placeholder`},y("span",null,this.mergedPlaceholder[0])):null,this.autosize?y("div",{class:`${o}-input__input-mirror`,key:"mirror",ref:"inputMirrorElRef"}," "):null),!this.pair&&$t(s.suffix,c=>c||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?y("div",{class:`${o}-input__suffix`},[$t(s["clear-icon-placeholder"],d=>(this.clearable||d)&&y(ka,{clsPrefix:o,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>d,icon:()=>{var u,p;return(p=(u=this.$slots)["clear-icon"])===null||p===void 0?void 0:p.call(u)}})),this.internalLoadingBeforeSuffix?null:c,this.loading!==void 0?y(By,{clsPrefix:o,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}):null,this.internalLoadingBeforeSuffix?c:null,this.showCount&&this.type!=="textarea"?y(Zs,null,{default:d=>{var u;return(u=s.count)===null||u===void 0?void 0:u.call(s,d)}}):null,this.mergedShowPasswordOn&&this.type==="password"?y("div",{class:`${o}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?Qr(s["password-visible-icon"],()=>[y(Tr,{clsPrefix:o},{default:()=>y(my,null)})]):Qr(s["password-invisible-icon"],()=>[y(Tr,{clsPrefix:o},{default:()=>y(by,null)})])):null]):null)),this.pair?y("span",{class:`${o}-input__separator`},Qr(s.separator,()=>[this.separator])):null,this.pair?y("div",{class:`${o}-input-wrapper`},y("div",{class:`${o}-input__input`},y("input",{ref:"inputEl2Ref",type:this.type,class:`${o}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[1]:void 0,readonly:this.readonly,style:this.textDecorationStyle[1],onBlur:this.handleInputBlur,onFocus:c=>{this.handleInputFocus(c,1)},onInput:c=>{this.handleInput(c,1)},onChange:c=>{this.handleChange(c,1)}}),this.showPlaceholder2?y("div",{class:`${o}-input__placeholder`},y("span",null,this.mergedPlaceholder[1])):null),$t(s.suffix,c=>(this.clearable||c)&&y("div",{class:`${o}-input__suffix`},[this.clearable&&y(ka,{clsPrefix:o,show:this.showClearButton,onClear:this.handleClear},{icon:()=>{var d;return(d=s["clear-icon"])===null||d===void 0?void 0:d.call(s)},placeholder:()=>{var d;return(d=s["clear-icon-placeholder"])===null||d===void 0?void 0:d.call(s)}}),c]))):null,this.mergedBordered?y("div",{class:`${o}-input__border`}):null,this.mergedBordered?y("div",{class:`${o}-input__state-border`}):null,this.showCount&&i==="textarea"?y(Zs,null,{default:c=>{var d;const{renderCount:u}=this;return u?u(c):(d=s.count)===null||d===void 0?void 0:d.call(s,c)}}):null)}});function a1(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const l1={name:"AutoComplete",common:W,peers:{InternalSelectMenu:Fn,Input:zt},self:a1};function s1(e){const{borderRadius:t,avatarColor:o,cardColor:r,fontSize:n,heightTiny:i,heightSmall:a,heightMedium:l,heightLarge:s,heightHuge:c,modalColor:d,popoverColor:u}=e;return{borderRadius:t,fontSize:n,border:`2px solid ${r}`,heightTiny:i,heightSmall:a,heightMedium:l,heightLarge:s,heightHuge:c,color:ee(r,o),colorModal:ee(d,o),colorPopover:ee(u,o)}}const Uu={name:"Avatar",common:W,self:s1};function c1(){return{gap:"-12px"}}const d1={name:"AvatarGroup",common:W,peers:{Avatar:Uu},self:c1},u1={width:"44px",height:"44px",borderRadius:"22px",iconSize:"26px"},f1={name:"BackTop",common:W,self(e){const{popoverColor:t,textColor2:o,primaryColorHover:r,primaryColorPressed:n}=e;return Object.assign(Object.assign({},u1),{color:t,textColor:o,iconColor:o,iconColorHover:r,iconColorPressed:n,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .18)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .18)"})}},p1={name:"Badge",common:W,self(e){const{errorColorSuppl:t,infoColorSuppl:o,successColorSuppl:r,warningColorSuppl:n,fontFamily:i}=e;return{color:t,colorInfo:o,colorSuccess:r,colorError:t,colorWarning:n,fontSize:"12px",fontFamily:i}}},h1={fontWeightActive:"400"};function g1(e){const{fontSize:t,textColor3:o,textColor2:r,borderRadius:n,buttonColor2Hover:i,buttonColor2Pressed:a}=e;return Object.assign(Object.assign({},h1),{fontSize:t,itemLineHeight:"1.25",itemTextColor:o,itemTextColorHover:r,itemTextColorPressed:r,itemTextColorActive:r,itemBorderRadius:n,itemColorHover:i,itemColorPressed:a,separatorColor:o})}const m1={name:"Breadcrumb",common:W,self:g1};function Lo(e){return ee(e,[255,255,255,.16])}function qn(e){return ee(e,[0,0,0,.12])}const b1="n-button-group",v1={paddingTiny:"0 6px",paddingSmall:"0 10px",paddingMedium:"0 14px",paddingLarge:"0 18px",paddingRoundTiny:"0 10px",paddingRoundSmall:"0 14px",paddingRoundMedium:"0 18px",paddingRoundLarge:"0 22px",iconMarginTiny:"6px",iconMarginSmall:"6px",iconMarginMedium:"6px",iconMarginLarge:"6px",iconSizeTiny:"14px",iconSizeSmall:"18px",iconSizeMedium:"18px",iconSizeLarge:"20px",rippleDuration:".6s"};function qu(e){const{heightTiny:t,heightSmall:o,heightMedium:r,heightLarge:n,borderRadius:i,fontSizeTiny:a,fontSizeSmall:l,fontSizeMedium:s,fontSizeLarge:c,opacityDisabled:d,textColor2:u,textColor3:p,primaryColorHover:m,primaryColorPressed:f,borderColor:g,primaryColor:S,baseColor:v,infoColor:$,infoColorHover:T,infoColorPressed:w,successColor:E,successColorHover:O,successColorPressed:x,warningColor:F,warningColorHover:R,warningColorPressed:B,errorColor:j,errorColorHover:A,errorColorPressed:J,fontWeight:G,buttonColor2:le,buttonColor2Hover:te,buttonColor2Pressed:N,fontWeightStrong:oe}=e;return Object.assign(Object.assign({},v1),{heightTiny:t,heightSmall:o,heightMedium:r,heightLarge:n,borderRadiusTiny:i,borderRadiusSmall:i,borderRadiusMedium:i,borderRadiusLarge:i,fontSizeTiny:a,fontSizeSmall:l,fontSizeMedium:s,fontSizeLarge:c,opacityDisabled:d,colorOpacitySecondary:"0.16",colorOpacitySecondaryHover:"0.22",colorOpacitySecondaryPressed:"0.28",colorSecondary:le,colorSecondaryHover:te,colorSecondaryPressed:N,colorTertiary:le,colorTertiaryHover:te,colorTertiaryPressed:N,colorQuaternary:"#0000",colorQuaternaryHover:te,colorQuaternaryPressed:N,color:"#0000",colorHover:"#0000",colorPressed:"#0000",colorFocus:"#0000",colorDisabled:"#0000",textColor:u,textColorTertiary:p,textColorHover:m,textColorPressed:f,textColorFocus:m,textColorDisabled:u,textColorText:u,textColorTextHover:m,textColorTextPressed:f,textColorTextFocus:m,textColorTextDisabled:u,textColorGhost:u,textColorGhostHover:m,textColorGhostPressed:f,textColorGhostFocus:m,textColorGhostDisabled:u,border:`1px solid ${g}`,borderHover:`1px solid ${m}`,borderPressed:`1px solid ${f}`,borderFocus:`1px solid ${m}`,borderDisabled:`1px solid ${g}`,rippleColor:S,colorPrimary:S,colorHoverPrimary:m,colorPressedPrimary:f,colorFocusPrimary:m,colorDisabledPrimary:S,textColorPrimary:v,textColorHoverPrimary:v,textColorPressedPrimary:v,textColorFocusPrimary:v,textColorDisabledPrimary:v,textColorTextPrimary:S,textColorTextHoverPrimary:m,textColorTextPressedPrimary:f,textColorTextFocusPrimary:m,textColorTextDisabledPrimary:u,textColorGhostPrimary:S,textColorGhostHoverPrimary:m,textColorGhostPressedPrimary:f,textColorGhostFocusPrimary:m,textColorGhostDisabledPrimary:S,borderPrimary:`1px solid ${S}`,borderHoverPrimary:`1px solid ${m}`,borderPressedPrimary:`1px solid ${f}`,borderFocusPrimary:`1px solid ${m}`,borderDisabledPrimary:`1px solid ${S}`,rippleColorPrimary:S,colorInfo:$,colorHoverInfo:T,colorPressedInfo:w,colorFocusInfo:T,colorDisabledInfo:$,textColorInfo:v,textColorHoverInfo:v,textColorPressedInfo:v,textColorFocusInfo:v,textColorDisabledInfo:v,textColorTextInfo:$,textColorTextHoverInfo:T,textColorTextPressedInfo:w,textColorTextFocusInfo:T,textColorTextDisabledInfo:u,textColorGhostInfo:$,textColorGhostHoverInfo:T,textColorGhostPressedInfo:w,textColorGhostFocusInfo:T,textColorGhostDisabledInfo:$,borderInfo:`1px solid ${$}`,borderHoverInfo:`1px solid ${T}`,borderPressedInfo:`1px solid ${w}`,borderFocusInfo:`1px solid ${T}`,borderDisabledInfo:`1px solid ${$}`,rippleColorInfo:$,colorSuccess:E,colorHoverSuccess:O,colorPressedSuccess:x,colorFocusSuccess:O,colorDisabledSuccess:E,textColorSuccess:v,textColorHoverSuccess:v,textColorPressedSuccess:v,textColorFocusSuccess:v,textColorDisabledSuccess:v,textColorTextSuccess:E,textColorTextHoverSuccess:O,textColorTextPressedSuccess:x,textColorTextFocusSuccess:O,textColorTextDisabledSuccess:u,textColorGhostSuccess:E,textColorGhostHoverSuccess:O,textColorGhostPressedSuccess:x,textColorGhostFocusSuccess:O,textColorGhostDisabledSuccess:E,borderSuccess:`1px solid ${E}`,borderHoverSuccess:`1px solid ${O}`,borderPressedSuccess:`1px solid ${x}`,borderFocusSuccess:`1px solid ${O}`,borderDisabledSuccess:`1px solid ${E}`,rippleColorSuccess:E,colorWarning:F,colorHoverWarning:R,colorPressedWarning:B,colorFocusWarning:R,colorDisabledWarning:F,textColorWarning:v,textColorHoverWarning:v,textColorPressedWarning:v,textColorFocusWarning:v,textColorDisabledWarning:v,textColorTextWarning:F,textColorTextHoverWarning:R,textColorTextPressedWarning:B,textColorTextFocusWarning:R,textColorTextDisabledWarning:u,textColorGhostWarning:F,textColorGhostHoverWarning:R,textColorGhostPressedWarning:B,textColorGhostFocusWarning:R,textColorGhostDisabledWarning:F,borderWarning:`1px solid ${F}`,borderHoverWarning:`1px solid ${R}`,borderPressedWarning:`1px solid ${B}`,borderFocusWarning:`1px solid ${R}`,borderDisabledWarning:`1px solid ${F}`,rippleColorWarning:F,colorError:j,colorHoverError:A,colorPressedError:J,colorFocusError:A,colorDisabledError:j,textColorError:v,textColorHoverError:v,textColorPressedError:v,textColorFocusError:v,textColorDisabledError:v,textColorTextError:j,textColorTextHoverError:A,textColorTextPressedError:J,textColorTextFocusError:A,textColorTextDisabledError:u,textColorGhostError:j,textColorGhostHoverError:A,textColorGhostPressedError:J,textColorGhostFocusError:A,textColorGhostDisabledError:j,borderError:`1px solid ${j}`,borderHoverError:`1px solid ${A}`,borderPressedError:`1px solid ${J}`,borderFocusError:`1px solid ${A}`,borderDisabledError:`1px solid ${j}`,rippleColorError:j,waveOpacity:"0.6",fontWeight:G,fontWeightStrong:oe})}const An={name:"Button",common:Be,self:qu},wt={name:"Button",common:W,self(e){const t=qu(e);return t.waveOpacity="0.8",t.colorOpacitySecondary="0.16",t.colorOpacitySecondaryHover="0.2",t.colorOpacitySecondaryPressed="0.12",t}},x1=L([pe("button",` margin: 0; font-weight: var(--n-font-weight); line-height: 1; @@ -570,7 +570,7 @@ ${t} `,[L("~",[V("icon",{margin:"var(--n-icon-margin)",marginRight:0})])]),re("block",` display: flex; width: 100%; - `),re("dashed",[V("border, state-border",{borderStyle:"dashed !important"})]),re("disabled",{cursor:"not-allowed",opacity:"var(--n-opacity-disabled)"})]),L("@keyframes button-wave-spread",{from:{boxShadow:"0 0 0.5px 0 var(--n-ripple-color)"},to:{boxShadow:"0 0 0.5px 4.5px var(--n-ripple-color)"}}),L("@keyframes button-wave-opacity",{from:{opacity:"var(--n-wave-opacity)"},to:{opacity:0}})]),C1=Object.assign(Object.assign({},Ct.props),{color:String,textColor:String,text:Boolean,block:Boolean,loading:Boolean,disabled:Boolean,circle:Boolean,size:String,ghost:Boolean,round:Boolean,secondary:Boolean,tertiary:Boolean,quaternary:Boolean,strong:Boolean,focusable:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},tag:{type:String,default:"button"},type:{type:String,default:"default"},dashed:Boolean,renderIcon:Function,iconPlacement:{type:String,default:"left"},attrType:{type:String,default:"button"},bordered:{type:Boolean,default:!0},onClick:[Function,Array],nativeFocusBehavior:{type:Boolean,default:!ju}}),y1=He({name:"Button",props:C1,setup(e){const t=fe(null),o=fe(null),r=fe(!1),n=hn(()=>!e.quaternary&&!e.tertiary&&!e.secondary&&!e.text&&(!e.color||e.ghost||e.dashed)&&e.bordered),i=Le(b1,{}),{mergedSizeRef:a}=Zd({},{defaultSize:"medium",mergedSize:w=>{const{size:_}=e;if(_)return _;const{size:O}=i;if(O)return O;const{mergedSize:x}=w||{};return x?x.value:"medium"}}),l=Y(()=>e.focusable&&!e.disabled),s=w=>{var _;l.value||w.preventDefault(),!e.nativeFocusBehavior&&(w.preventDefault(),!e.disabled&&l.value&&((_=t.value)===null||_===void 0||_.focus({preventScroll:!0})))},c=w=>{var _;if(!e.disabled&&!e.loading){const{onClick:O}=e;O&&Ke(O,w),e.text||(_=o.value)===null||_===void 0||_.play()}},d=w=>{switch(w.key){case"Enter":if(!e.keyboard)return;r.value=!1}},u=w=>{switch(w.key){case"Enter":if(!e.keyboard||e.loading){w.preventDefault();return}r.value=!0}},p=()=>{r.value=!1},{inlineThemeDisabled:m,mergedClsPrefixRef:f,mergedRtlRef:g}=zo(e),S=Ct("Button","-button",x1,An,e,f),v=$n("Button",g,f),$=Y(()=>{const w=S.value,{common:{cubicBezierEaseInOut:_,cubicBezierEaseOut:O},self:x}=w,{rippleDuration:F,opacityDisabled:R,fontWeight:B,fontWeightStrong:j}=x,A=a.value,{dashed:J,type:G,ghost:le,text:te,color:N,round:oe,circle:ye,textColor:Pe,secondary:Re,tertiary:Fe,quaternary:Ve,strong:qe}=e,gt={"--n-font-weight":qe?j:B};let he={"--n-color":"initial","--n-color-hover":"initial","--n-color-pressed":"initial","--n-color-focus":"initial","--n-color-disabled":"initial","--n-ripple-color":"initial","--n-text-color":"initial","--n-text-color-hover":"initial","--n-text-color-pressed":"initial","--n-text-color-focus":"initial","--n-text-color-disabled":"initial"};const Ue=G==="tertiary",rt=G==="default",be=Ue?"default":G;if(te){const z=Pe||N;he={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":"#0000","--n-text-color":z||x[ae("textColorText",be)],"--n-text-color-hover":z?Lo(z):x[ae("textColorTextHover",be)],"--n-text-color-pressed":z?qn(z):x[ae("textColorTextPressed",be)],"--n-text-color-focus":z?Lo(z):x[ae("textColorTextHover",be)],"--n-text-color-disabled":z||x[ae("textColorTextDisabled",be)]}}else if(le||J){const z=Pe||N;he={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":N||x[ae("rippleColor",be)],"--n-text-color":z||x[ae("textColorGhost",be)],"--n-text-color-hover":z?Lo(z):x[ae("textColorGhostHover",be)],"--n-text-color-pressed":z?qn(z):x[ae("textColorGhostPressed",be)],"--n-text-color-focus":z?Lo(z):x[ae("textColorGhostHover",be)],"--n-text-color-disabled":z||x[ae("textColorGhostDisabled",be)]}}else if(Re){const z=rt?x.textColor:Ue?x.textColorTertiary:x[ae("color",be)],I=N||z,ie=G!=="default"&&G!=="tertiary";he={"--n-color":ie?K(I,{alpha:Number(x.colorOpacitySecondary)}):x.colorSecondary,"--n-color-hover":ie?K(I,{alpha:Number(x.colorOpacitySecondaryHover)}):x.colorSecondaryHover,"--n-color-pressed":ie?K(I,{alpha:Number(x.colorOpacitySecondaryPressed)}):x.colorSecondaryPressed,"--n-color-focus":ie?K(I,{alpha:Number(x.colorOpacitySecondaryHover)}):x.colorSecondaryHover,"--n-color-disabled":x.colorSecondary,"--n-ripple-color":"#0000","--n-text-color":I,"--n-text-color-hover":I,"--n-text-color-pressed":I,"--n-text-color-focus":I,"--n-text-color-disabled":I}}else if(Fe||Ve){const z=rt?x.textColor:Ue?x.textColorTertiary:x[ae("color",be)],I=N||z;Fe?(he["--n-color"]=x.colorTertiary,he["--n-color-hover"]=x.colorTertiaryHover,he["--n-color-pressed"]=x.colorTertiaryPressed,he["--n-color-focus"]=x.colorSecondaryHover,he["--n-color-disabled"]=x.colorTertiary):(he["--n-color"]=x.colorQuaternary,he["--n-color-hover"]=x.colorQuaternaryHover,he["--n-color-pressed"]=x.colorQuaternaryPressed,he["--n-color-focus"]=x.colorQuaternaryHover,he["--n-color-disabled"]=x.colorQuaternary),he["--n-ripple-color"]="#0000",he["--n-text-color"]=I,he["--n-text-color-hover"]=I,he["--n-text-color-pressed"]=I,he["--n-text-color-focus"]=I,he["--n-text-color-disabled"]=I}else he={"--n-color":N||x[ae("color",be)],"--n-color-hover":N?Lo(N):x[ae("colorHover",be)],"--n-color-pressed":N?qn(N):x[ae("colorPressed",be)],"--n-color-focus":N?Lo(N):x[ae("colorFocus",be)],"--n-color-disabled":N||x[ae("colorDisabled",be)],"--n-ripple-color":N||x[ae("rippleColor",be)],"--n-text-color":Pe||(N?x.textColorPrimary:Ue?x.textColorTertiary:x[ae("textColor",be)]),"--n-text-color-hover":Pe||(N?x.textColorHoverPrimary:x[ae("textColorHover",be)]),"--n-text-color-pressed":Pe||(N?x.textColorPressedPrimary:x[ae("textColorPressed",be)]),"--n-text-color-focus":Pe||(N?x.textColorFocusPrimary:x[ae("textColorFocus",be)]),"--n-text-color-disabled":Pe||(N?x.textColorDisabledPrimary:x[ae("textColorDisabled",be)])};let Ge={"--n-border":"initial","--n-border-hover":"initial","--n-border-pressed":"initial","--n-border-focus":"initial","--n-border-disabled":"initial"};te?Ge={"--n-border":"none","--n-border-hover":"none","--n-border-pressed":"none","--n-border-focus":"none","--n-border-disabled":"none"}:Ge={"--n-border":x[ae("border",be)],"--n-border-hover":x[ae("borderHover",be)],"--n-border-pressed":x[ae("borderPressed",be)],"--n-border-focus":x[ae("borderFocus",be)],"--n-border-disabled":x[ae("borderDisabled",be)]};const{[ae("height",A)]:Pt,[ae("fontSize",A)]:h,[ae("padding",A)]:b,[ae("paddingRound",A)]:P,[ae("iconSize",A)]:H,[ae("borderRadius",A)]:M,[ae("iconMargin",A)]:k,waveOpacity:q}=x,U={"--n-width":ye&&!te?Pt:"initial","--n-height":te?"initial":Pt,"--n-font-size":h,"--n-padding":ye||te?"initial":oe?P:b,"--n-icon-size":H,"--n-icon-margin":k,"--n-border-radius":te?"initial":ye||oe?Pt:M};return Object.assign(Object.assign(Object.assign(Object.assign({"--n-bezier":_,"--n-bezier-ease-out":O,"--n-ripple-duration":F,"--n-opacity-disabled":R,"--n-wave-opacity":q},gt),he),Ge),U)}),T=m?Fr("button",Y(()=>{let w="";const{dashed:_,type:O,ghost:x,text:F,color:R,round:B,circle:j,textColor:A,secondary:J,tertiary:G,quaternary:le,strong:te}=e;_&&(w+="a"),x&&(w+="b"),F&&(w+="c"),B&&(w+="d"),j&&(w+="e"),J&&(w+="f"),G&&(w+="g"),le&&(w+="h"),te&&(w+="i"),R&&(w+=`j${As(R)}`),A&&(w+=`k${As(A)}`);const{value:N}=a;return w+=`l${N[0]}`,w+=`m${O[0]}`,w}),$,e):void 0;return{selfElRef:t,waveElRef:o,mergedClsPrefix:f,mergedFocusable:l,mergedSize:a,showBorder:n,enterPressed:r,rtlEnabled:v,handleMousedown:s,handleKeydown:u,handleBlur:p,handleKeyup:d,handleClick:c,customColorCssVars:Y(()=>{const{color:w}=e;if(!w)return null;const _=Lo(w);return{"--n-border-color":w,"--n-border-color-hover":_,"--n-border-color-pressed":qn(w),"--n-border-color-focus":_,"--n-border-color-disabled":w}}),cssVars:m?void 0:$,themeClass:T==null?void 0:T.themeClass,onRender:T==null?void 0:T.onRender}},render(){const{mergedClsPrefix:e,tag:t,onRender:o}=this;o==null||o();const r=$t(this.$slots.default,n=>n&&y("span",{class:`${e}-button__content`},n));return y(t,{ref:"selfElRef",class:[this.themeClass,`${e}-button`,`${e}-button--${this.type}-type`,`${e}-button--${this.mergedSize}-type`,this.rtlEnabled&&`${e}-button--rtl`,this.disabled&&`${e}-button--disabled`,this.block&&`${e}-button--block`,this.enterPressed&&`${e}-button--pressed`,!this.text&&this.dashed&&`${e}-button--dashed`,this.color&&`${e}-button--color`,this.secondary&&`${e}-button--secondary`,this.loading&&`${e}-button--loading`,this.ghost&&`${e}-button--ghost`],tabindex:this.mergedFocusable?0:-1,type:this.attrType,style:this.cssVars,disabled:this.disabled,onClick:this.handleClick,onBlur:this.handleBlur,onMousedown:this.handleMousedown,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},this.iconPlacement==="right"&&r,y(_u,{width:!0},{default:()=>$t(this.$slots.icon,n=>(this.loading||this.renderIcon||n)&&y("span",{class:`${e}-button__icon`,style:{margin:_b(this.$slots.default)?"0":""}},y(Hi,null,{default:()=>this.loading?y(vl,{clsPrefix:e,key:"loading",class:`${e}-icon-slot`,strokeWidth:20}):y("div",{key:"icon",class:`${e}-icon-slot`,role:"none"},this.renderIcon?this.renderIcon():n)})))}),this.iconPlacement==="left"&&r,this.text?null:y(Vy,{ref:"waveElRef",clsPrefix:e}),this.showBorder?y("div",{"aria-hidden":!0,class:`${e}-button__border`,style:this.customColorCssVars}):null,this.showBorder?y("div",{"aria-hidden":!0,class:`${e}-button__state-border`,style:this.customColorCssVars}):null)}}),yP=y1,S1={titleFontSize:"22px"};function w1(e){const{borderRadius:t,fontSize:o,lineHeight:r,textColor2:n,textColor1:i,textColorDisabled:a,dividerColor:l,fontWeightStrong:s,primaryColor:c,baseColor:d,hoverColor:u,cardColor:p,modalColor:m,popoverColor:f}=e;return Object.assign(Object.assign({},S1),{borderRadius:t,borderColor:ee(p,l),borderColorModal:ee(m,l),borderColorPopover:ee(f,l),textColor:n,titleFontWeight:s,titleTextColor:i,dayTextColor:a,fontSize:o,lineHeight:r,dateColorCurrent:c,dateTextColorCurrent:d,cellColorHover:ee(p,u),cellColorHoverModal:ee(m,u),cellColorHoverPopover:ee(f,u),cellColor:p,cellColorModal:m,cellColorPopover:f,barColor:c})}const P1={name:"Calendar",common:W,peers:{Button:wt},self:w1},T1={paddingSmall:"12px 16px 12px",paddingMedium:"19px 24px 20px",paddingLarge:"23px 32px 24px",paddingHuge:"27px 40px 28px",titleFontSizeSmall:"16px",titleFontSizeMedium:"18px",titleFontSizeLarge:"18px",titleFontSizeHuge:"18px",closeIconSize:"18px",closeSize:"22px"};function Gu(e){const{primaryColor:t,borderRadius:o,lineHeight:r,fontSize:n,cardColor:i,textColor2:a,textColor1:l,dividerColor:s,fontWeightStrong:c,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,closeColorHover:m,closeColorPressed:f,modalColor:g,boxShadow1:S,popoverColor:v,actionColor:$}=e;return Object.assign(Object.assign({},T1),{lineHeight:r,color:i,colorModal:g,colorPopover:v,colorTarget:t,colorEmbedded:$,colorEmbeddedModal:$,colorEmbeddedPopover:$,textColor:a,titleTextColor:l,borderColor:s,actionColor:$,titleFontWeight:c,closeColorHover:m,closeColorPressed:f,closeBorderRadius:o,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,fontSizeSmall:n,fontSizeMedium:n,fontSizeLarge:n,fontSizeHuge:n,boxShadow:S,borderRadius:o})}const $1={common:Be,self:Gu},Ku={name:"Card",common:W,self(e){const t=Gu(e),{cardColor:o,modalColor:r,popoverColor:n}=e;return t.colorEmbedded=o,t.colorEmbeddedModal=r,t.colorEmbeddedPopover=n,t}},R1=L([pe("card",` + `),re("dashed",[V("border, state-border",{borderStyle:"dashed !important"})]),re("disabled",{cursor:"not-allowed",opacity:"var(--n-opacity-disabled)"})]),L("@keyframes button-wave-spread",{from:{boxShadow:"0 0 0.5px 0 var(--n-ripple-color)"},to:{boxShadow:"0 0 0.5px 4.5px var(--n-ripple-color)"}}),L("@keyframes button-wave-opacity",{from:{opacity:"var(--n-wave-opacity)"},to:{opacity:0}})]),C1=Object.assign(Object.assign({},Ct.props),{color:String,textColor:String,text:Boolean,block:Boolean,loading:Boolean,disabled:Boolean,circle:Boolean,size:String,ghost:Boolean,round:Boolean,secondary:Boolean,tertiary:Boolean,quaternary:Boolean,strong:Boolean,focusable:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},tag:{type:String,default:"button"},type:{type:String,default:"default"},dashed:Boolean,renderIcon:Function,iconPlacement:{type:String,default:"left"},attrType:{type:String,default:"button"},bordered:{type:Boolean,default:!0},onClick:[Function,Array],nativeFocusBehavior:{type:Boolean,default:!ju}}),y1=He({name:"Button",props:C1,setup(e){const t=fe(null),o=fe(null),r=fe(!1),n=hn(()=>!e.quaternary&&!e.tertiary&&!e.secondary&&!e.text&&(!e.color||e.ghost||e.dashed)&&e.bordered),i=Le(b1,{}),{mergedSizeRef:a}=Zd({},{defaultSize:"medium",mergedSize:w=>{const{size:E}=e;if(E)return E;const{size:O}=i;if(O)return O;const{mergedSize:x}=w||{};return x?x.value:"medium"}}),l=Y(()=>e.focusable&&!e.disabled),s=w=>{var E;l.value||w.preventDefault(),!e.nativeFocusBehavior&&(w.preventDefault(),!e.disabled&&l.value&&((E=t.value)===null||E===void 0||E.focus({preventScroll:!0})))},c=w=>{var E;if(!e.disabled&&!e.loading){const{onClick:O}=e;O&&Ke(O,w),e.text||(E=o.value)===null||E===void 0||E.play()}},d=w=>{switch(w.key){case"Enter":if(!e.keyboard)return;r.value=!1}},u=w=>{switch(w.key){case"Enter":if(!e.keyboard||e.loading){w.preventDefault();return}r.value=!0}},p=()=>{r.value=!1},{inlineThemeDisabled:m,mergedClsPrefixRef:f,mergedRtlRef:g}=zo(e),S=Ct("Button","-button",x1,An,e,f),v=$n("Button",g,f),$=Y(()=>{const w=S.value,{common:{cubicBezierEaseInOut:E,cubicBezierEaseOut:O},self:x}=w,{rippleDuration:F,opacityDisabled:R,fontWeight:B,fontWeightStrong:j}=x,A=a.value,{dashed:J,type:G,ghost:le,text:te,color:N,round:oe,circle:ye,textColor:Pe,secondary:Re,tertiary:Fe,quaternary:Ve,strong:qe}=e,gt={"--n-font-weight":qe?j:B};let he={"--n-color":"initial","--n-color-hover":"initial","--n-color-pressed":"initial","--n-color-focus":"initial","--n-color-disabled":"initial","--n-ripple-color":"initial","--n-text-color":"initial","--n-text-color-hover":"initial","--n-text-color-pressed":"initial","--n-text-color-focus":"initial","--n-text-color-disabled":"initial"};const Ue=G==="tertiary",rt=G==="default",be=Ue?"default":G;if(te){const z=Pe||N;he={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":"#0000","--n-text-color":z||x[ae("textColorText",be)],"--n-text-color-hover":z?Lo(z):x[ae("textColorTextHover",be)],"--n-text-color-pressed":z?qn(z):x[ae("textColorTextPressed",be)],"--n-text-color-focus":z?Lo(z):x[ae("textColorTextHover",be)],"--n-text-color-disabled":z||x[ae("textColorTextDisabled",be)]}}else if(le||J){const z=Pe||N;he={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":N||x[ae("rippleColor",be)],"--n-text-color":z||x[ae("textColorGhost",be)],"--n-text-color-hover":z?Lo(z):x[ae("textColorGhostHover",be)],"--n-text-color-pressed":z?qn(z):x[ae("textColorGhostPressed",be)],"--n-text-color-focus":z?Lo(z):x[ae("textColorGhostHover",be)],"--n-text-color-disabled":z||x[ae("textColorGhostDisabled",be)]}}else if(Re){const z=rt?x.textColor:Ue?x.textColorTertiary:x[ae("color",be)],I=N||z,ie=G!=="default"&&G!=="tertiary";he={"--n-color":ie?K(I,{alpha:Number(x.colorOpacitySecondary)}):x.colorSecondary,"--n-color-hover":ie?K(I,{alpha:Number(x.colorOpacitySecondaryHover)}):x.colorSecondaryHover,"--n-color-pressed":ie?K(I,{alpha:Number(x.colorOpacitySecondaryPressed)}):x.colorSecondaryPressed,"--n-color-focus":ie?K(I,{alpha:Number(x.colorOpacitySecondaryHover)}):x.colorSecondaryHover,"--n-color-disabled":x.colorSecondary,"--n-ripple-color":"#0000","--n-text-color":I,"--n-text-color-hover":I,"--n-text-color-pressed":I,"--n-text-color-focus":I,"--n-text-color-disabled":I}}else if(Fe||Ve){const z=rt?x.textColor:Ue?x.textColorTertiary:x[ae("color",be)],I=N||z;Fe?(he["--n-color"]=x.colorTertiary,he["--n-color-hover"]=x.colorTertiaryHover,he["--n-color-pressed"]=x.colorTertiaryPressed,he["--n-color-focus"]=x.colorSecondaryHover,he["--n-color-disabled"]=x.colorTertiary):(he["--n-color"]=x.colorQuaternary,he["--n-color-hover"]=x.colorQuaternaryHover,he["--n-color-pressed"]=x.colorQuaternaryPressed,he["--n-color-focus"]=x.colorQuaternaryHover,he["--n-color-disabled"]=x.colorQuaternary),he["--n-ripple-color"]="#0000",he["--n-text-color"]=I,he["--n-text-color-hover"]=I,he["--n-text-color-pressed"]=I,he["--n-text-color-focus"]=I,he["--n-text-color-disabled"]=I}else he={"--n-color":N||x[ae("color",be)],"--n-color-hover":N?Lo(N):x[ae("colorHover",be)],"--n-color-pressed":N?qn(N):x[ae("colorPressed",be)],"--n-color-focus":N?Lo(N):x[ae("colorFocus",be)],"--n-color-disabled":N||x[ae("colorDisabled",be)],"--n-ripple-color":N||x[ae("rippleColor",be)],"--n-text-color":Pe||(N?x.textColorPrimary:Ue?x.textColorTertiary:x[ae("textColor",be)]),"--n-text-color-hover":Pe||(N?x.textColorHoverPrimary:x[ae("textColorHover",be)]),"--n-text-color-pressed":Pe||(N?x.textColorPressedPrimary:x[ae("textColorPressed",be)]),"--n-text-color-focus":Pe||(N?x.textColorFocusPrimary:x[ae("textColorFocus",be)]),"--n-text-color-disabled":Pe||(N?x.textColorDisabledPrimary:x[ae("textColorDisabled",be)])};let Ge={"--n-border":"initial","--n-border-hover":"initial","--n-border-pressed":"initial","--n-border-focus":"initial","--n-border-disabled":"initial"};te?Ge={"--n-border":"none","--n-border-hover":"none","--n-border-pressed":"none","--n-border-focus":"none","--n-border-disabled":"none"}:Ge={"--n-border":x[ae("border",be)],"--n-border-hover":x[ae("borderHover",be)],"--n-border-pressed":x[ae("borderPressed",be)],"--n-border-focus":x[ae("borderFocus",be)],"--n-border-disabled":x[ae("borderDisabled",be)]};const{[ae("height",A)]:Pt,[ae("fontSize",A)]:h,[ae("padding",A)]:b,[ae("paddingRound",A)]:P,[ae("iconSize",A)]:H,[ae("borderRadius",A)]:M,[ae("iconMargin",A)]:k,waveOpacity:q}=x,U={"--n-width":ye&&!te?Pt:"initial","--n-height":te?"initial":Pt,"--n-font-size":h,"--n-padding":ye||te?"initial":oe?P:b,"--n-icon-size":H,"--n-icon-margin":k,"--n-border-radius":te?"initial":ye||oe?Pt:M};return Object.assign(Object.assign(Object.assign(Object.assign({"--n-bezier":E,"--n-bezier-ease-out":O,"--n-ripple-duration":F,"--n-opacity-disabled":R,"--n-wave-opacity":q},gt),he),Ge),U)}),T=m?Fr("button",Y(()=>{let w="";const{dashed:E,type:O,ghost:x,text:F,color:R,round:B,circle:j,textColor:A,secondary:J,tertiary:G,quaternary:le,strong:te}=e;E&&(w+="a"),x&&(w+="b"),F&&(w+="c"),B&&(w+="d"),j&&(w+="e"),J&&(w+="f"),G&&(w+="g"),le&&(w+="h"),te&&(w+="i"),R&&(w+=`j${As(R)}`),A&&(w+=`k${As(A)}`);const{value:N}=a;return w+=`l${N[0]}`,w+=`m${O[0]}`,w}),$,e):void 0;return{selfElRef:t,waveElRef:o,mergedClsPrefix:f,mergedFocusable:l,mergedSize:a,showBorder:n,enterPressed:r,rtlEnabled:v,handleMousedown:s,handleKeydown:u,handleBlur:p,handleKeyup:d,handleClick:c,customColorCssVars:Y(()=>{const{color:w}=e;if(!w)return null;const E=Lo(w);return{"--n-border-color":w,"--n-border-color-hover":E,"--n-border-color-pressed":qn(w),"--n-border-color-focus":E,"--n-border-color-disabled":w}}),cssVars:m?void 0:$,themeClass:T==null?void 0:T.themeClass,onRender:T==null?void 0:T.onRender}},render(){const{mergedClsPrefix:e,tag:t,onRender:o}=this;o==null||o();const r=$t(this.$slots.default,n=>n&&y("span",{class:`${e}-button__content`},n));return y(t,{ref:"selfElRef",class:[this.themeClass,`${e}-button`,`${e}-button--${this.type}-type`,`${e}-button--${this.mergedSize}-type`,this.rtlEnabled&&`${e}-button--rtl`,this.disabled&&`${e}-button--disabled`,this.block&&`${e}-button--block`,this.enterPressed&&`${e}-button--pressed`,!this.text&&this.dashed&&`${e}-button--dashed`,this.color&&`${e}-button--color`,this.secondary&&`${e}-button--secondary`,this.loading&&`${e}-button--loading`,this.ghost&&`${e}-button--ghost`],tabindex:this.mergedFocusable?0:-1,type:this.attrType,style:this.cssVars,disabled:this.disabled,onClick:this.handleClick,onBlur:this.handleBlur,onMousedown:this.handleMousedown,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},this.iconPlacement==="right"&&r,y(Eu,{width:!0},{default:()=>$t(this.$slots.icon,n=>(this.loading||this.renderIcon||n)&&y("span",{class:`${e}-button__icon`,style:{margin:Eb(this.$slots.default)?"0":""}},y(Hi,null,{default:()=>this.loading?y(vl,{clsPrefix:e,key:"loading",class:`${e}-icon-slot`,strokeWidth:20}):y("div",{key:"icon",class:`${e}-icon-slot`,role:"none"},this.renderIcon?this.renderIcon():n)})))}),this.iconPlacement==="left"&&r,this.text?null:y(Vy,{ref:"waveElRef",clsPrefix:e}),this.showBorder?y("div",{"aria-hidden":!0,class:`${e}-button__border`,style:this.customColorCssVars}):null,this.showBorder?y("div",{"aria-hidden":!0,class:`${e}-button__state-border`,style:this.customColorCssVars}):null)}}),yP=y1,S1={titleFontSize:"22px"};function w1(e){const{borderRadius:t,fontSize:o,lineHeight:r,textColor2:n,textColor1:i,textColorDisabled:a,dividerColor:l,fontWeightStrong:s,primaryColor:c,baseColor:d,hoverColor:u,cardColor:p,modalColor:m,popoverColor:f}=e;return Object.assign(Object.assign({},S1),{borderRadius:t,borderColor:ee(p,l),borderColorModal:ee(m,l),borderColorPopover:ee(f,l),textColor:n,titleFontWeight:s,titleTextColor:i,dayTextColor:a,fontSize:o,lineHeight:r,dateColorCurrent:c,dateTextColorCurrent:d,cellColorHover:ee(p,u),cellColorHoverModal:ee(m,u),cellColorHoverPopover:ee(f,u),cellColor:p,cellColorModal:m,cellColorPopover:f,barColor:c})}const P1={name:"Calendar",common:W,peers:{Button:wt},self:w1},T1={paddingSmall:"12px 16px 12px",paddingMedium:"19px 24px 20px",paddingLarge:"23px 32px 24px",paddingHuge:"27px 40px 28px",titleFontSizeSmall:"16px",titleFontSizeMedium:"18px",titleFontSizeLarge:"18px",titleFontSizeHuge:"18px",closeIconSize:"18px",closeSize:"22px"};function Gu(e){const{primaryColor:t,borderRadius:o,lineHeight:r,fontSize:n,cardColor:i,textColor2:a,textColor1:l,dividerColor:s,fontWeightStrong:c,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,closeColorHover:m,closeColorPressed:f,modalColor:g,boxShadow1:S,popoverColor:v,actionColor:$}=e;return Object.assign(Object.assign({},T1),{lineHeight:r,color:i,colorModal:g,colorPopover:v,colorTarget:t,colorEmbedded:$,colorEmbeddedModal:$,colorEmbeddedPopover:$,textColor:a,titleTextColor:l,borderColor:s,actionColor:$,titleFontWeight:c,closeColorHover:m,closeColorPressed:f,closeBorderRadius:o,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,fontSizeSmall:n,fontSizeMedium:n,fontSizeLarge:n,fontSizeHuge:n,boxShadow:S,borderRadius:o})}const $1={common:Be,self:Gu},Ku={name:"Card",common:W,self(e){const t=Gu(e),{cardColor:o,modalColor:r,popoverColor:n}=e;return t.colorEmbedded=o,t.colorEmbeddedModal=r,t.colorEmbeddedPopover=n,t}},R1=L([pe("card",` font-size: var(--n-font-size); line-height: var(--n-line-height); display: flex; @@ -656,7 +656,7 @@ ${t} background: var(--n-color-popover); `,[re("embedded",` background-color: var(--n-color-embedded-popover); - `)]))]),F1={title:[String,Function],contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],headerExtraClass:String,headerExtraStyle:[Object,String],footerClass:String,footerStyle:[Object,String],embedded:Boolean,segmented:{type:[Boolean,Object],default:!1},size:{type:String,default:"medium"},bordered:{type:Boolean,default:!0},closable:Boolean,hoverable:Boolean,role:String,onClose:[Function,Array],tag:{type:String,default:"div"},cover:Function,content:[String,Function],footer:Function,action:Function,headerExtra:Function},A1=Object.assign(Object.assign({},Ct.props),F1),SP=He({name:"Card",props:A1,setup(e){const t=()=>{const{onClose:c}=e;c&&Ke(c)},{inlineThemeDisabled:o,mergedClsPrefixRef:r,mergedRtlRef:n}=zo(e),i=Ct("Card","-card",R1,$1,e,r),a=$n("Card",n,r),l=Y(()=>{const{size:c}=e,{self:{color:d,colorModal:u,colorTarget:p,textColor:m,titleTextColor:f,titleFontWeight:g,borderColor:S,actionColor:v,borderRadius:$,lineHeight:T,closeIconColor:w,closeIconColorHover:_,closeIconColorPressed:O,closeColorHover:x,closeColorPressed:F,closeBorderRadius:R,closeIconSize:B,closeSize:j,boxShadow:A,colorPopover:J,colorEmbedded:G,colorEmbeddedModal:le,colorEmbeddedPopover:te,[ae("padding",c)]:N,[ae("fontSize",c)]:oe,[ae("titleFontSize",c)]:ye},common:{cubicBezierEaseInOut:Pe}}=i.value,{top:Re,left:Fe,bottom:Ve}=Vo(N);return{"--n-bezier":Pe,"--n-border-radius":$,"--n-color":d,"--n-color-modal":u,"--n-color-popover":J,"--n-color-embedded":G,"--n-color-embedded-modal":le,"--n-color-embedded-popover":te,"--n-color-target":p,"--n-text-color":m,"--n-line-height":T,"--n-action-color":v,"--n-title-text-color":f,"--n-title-font-weight":g,"--n-close-icon-color":w,"--n-close-icon-color-hover":_,"--n-close-icon-color-pressed":O,"--n-close-color-hover":x,"--n-close-color-pressed":F,"--n-border-color":S,"--n-box-shadow":A,"--n-padding-top":Re,"--n-padding-bottom":Ve,"--n-padding-left":Fe,"--n-font-size":oe,"--n-title-font-size":ye,"--n-close-size":j,"--n-close-icon-size":B,"--n-close-border-radius":R}}),s=o?Fr("card",Y(()=>e.size[0]),l,e):void 0;return{rtlEnabled:a,mergedClsPrefix:r,mergedTheme:i,handleCloseClick:t,cssVars:o?void 0:l,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender}},render(){const{segmented:e,bordered:t,hoverable:o,mergedClsPrefix:r,rtlEnabled:n,onRender:i,embedded:a,tag:l,$slots:s}=this;return i==null||i(),y(l,{class:[`${r}-card`,this.themeClass,a&&`${r}-card--embedded`,{[`${r}-card--rtl`]:n,[`${r}-card--content${typeof e!="boolean"&&e.content==="soft"?"-soft":""}-segmented`]:e===!0||e!==!1&&e.content,[`${r}-card--footer${typeof e!="boolean"&&e.footer==="soft"?"-soft":""}-segmented`]:e===!0||e!==!1&&e.footer,[`${r}-card--action-segmented`]:e===!0||e!==!1&&e.action,[`${r}-card--bordered`]:t,[`${r}-card--hoverable`]:o}],style:this.cssVars,role:this.role},$t(s.cover,c=>{const d=this.cover?kt([this.cover()]):c;return d&&y("div",{class:`${r}-card-cover`,role:"none"},d)}),$t(s.header,c=>{const{title:d}=this,u=d?kt(typeof d=="function"?[d()]:[d]):c;return u||this.closable?y("div",{class:[`${r}-card-header`,this.headerClass],style:this.headerStyle,role:"heading"},y("div",{class:`${r}-card-header__main`,role:"heading"},u),$t(s["header-extra"],p=>{const m=this.headerExtra?kt([this.headerExtra()]):p;return m&&y("div",{class:[`${r}-card-header__extra`,this.headerExtraClass],style:this.headerExtraStyle},m)}),this.closable&&y(Iu,{clsPrefix:r,class:`${r}-card-header__close`,onClick:this.handleCloseClick,absolute:!0})):null}),$t(s.default,c=>{const{content:d}=this,u=d?kt(typeof d=="function"?[d()]:[d]):c;return u&&y("div",{class:[`${r}-card__content`,this.contentClass],style:this.contentStyle,role:"none"},u)}),$t(s.footer,c=>{const d=this.footer?kt([this.footer()]):c;return d&&y("div",{class:[`${r}-card__footer`,this.footerClass],style:this.footerStyle,role:"none"},d)}),$t(s.action,c=>{const d=this.action?kt([this.action()]):c;return d&&y("div",{class:`${r}-card__action`,role:"none"},d)}))}});function I1(){return{dotSize:"8px",dotColor:"rgba(255, 255, 255, .3)",dotColorActive:"rgba(255, 255, 255, 1)",dotColorFocus:"rgba(255, 255, 255, .5)",dotLineWidth:"16px",dotLineWidthActive:"24px",arrowColor:"#eee"}}const _1={name:"Carousel",common:W,self:I1},E1={sizeSmall:"14px",sizeMedium:"16px",sizeLarge:"18px",labelPadding:"0 8px",labelFontWeight:"400"};function Yu(e){const{baseColor:t,inputColorDisabled:o,cardColor:r,modalColor:n,popoverColor:i,textColorDisabled:a,borderColor:l,primaryColor:s,textColor2:c,fontSizeSmall:d,fontSizeMedium:u,fontSizeLarge:p,borderRadiusSmall:m,lineHeight:f}=e;return Object.assign(Object.assign({},E1),{labelLineHeight:f,fontSizeSmall:d,fontSizeMedium:u,fontSizeLarge:p,borderRadius:m,color:t,colorChecked:s,colorDisabled:o,colorDisabledChecked:o,colorTableHeader:r,colorTableHeaderModal:n,colorTableHeaderPopover:i,checkMarkColor:t,checkMarkColorDisabled:a,checkMarkColorDisabledChecked:a,border:`1px solid ${l}`,borderDisabled:`1px solid ${l}`,borderDisabledChecked:`1px solid ${l}`,borderChecked:`1px solid ${s}`,borderFocus:`1px solid ${s}`,boxShadowFocus:`0 0 0 2px ${K(s,{alpha:.3})}`,textColor:c,textColorDisabled:a})}const M1={name:"Checkbox",common:Be,self:Yu},Hr={name:"Checkbox",common:W,self(e){const{cardColor:t}=e,o=Yu(e);return o.color="#0000",o.checkMarkColor=t,o}};function z1(e){const{borderRadius:t,boxShadow2:o,popoverColor:r,textColor2:n,textColor3:i,primaryColor:a,textColorDisabled:l,dividerColor:s,hoverColor:c,fontSizeMedium:d,heightMedium:u}=e;return{menuBorderRadius:t,menuColor:r,menuBoxShadow:o,menuDividerColor:s,menuHeight:"calc(var(--n-option-height) * 6.6)",optionArrowColor:i,optionHeight:u,optionFontSize:d,optionColorHover:c,optionTextColor:n,optionTextColorActive:a,optionTextColorDisabled:l,optionCheckMarkColor:a,loadingColor:a,columnWidth:"180px"}}const H1={name:"Cascader",common:W,peers:{InternalSelectMenu:Fn,InternalSelection:Cl,Scrollbar:St,Checkbox:Hr,Empty:xl},self:z1},Xu={name:"Code",common:W,self(e){const{textColor2:t,fontSize:o,fontWeightStrong:r,textColor3:n}=e;return{textColor:t,fontSize:o,fontWeightStrong:r,"mono-3":"#5c6370","hue-1":"#56b6c2","hue-2":"#61aeee","hue-3":"#c678dd","hue-4":"#98c379","hue-5":"#e06c75","hue-5-2":"#be5046","hue-6":"#d19a66","hue-6-2":"#e6c07b",lineNumberTextColor:n}}};function k1(e){const{fontWeight:t,textColor1:o,textColor2:r,textColorDisabled:n,dividerColor:i,fontSize:a}=e;return{titleFontSize:a,titleFontWeight:t,dividerColor:i,titleTextColor:o,titleTextColorDisabled:n,fontSize:a,textColor:r,arrowColor:r,arrowColorDisabled:n,itemMargin:"16px 0 0 0",titlePadding:"16px 0 0 0"}}const D1={name:"Collapse",common:W,self:k1};function O1(e){const{cubicBezierEaseInOut:t}=e;return{bezier:t}}const B1={name:"CollapseTransition",common:W,self:O1};function L1(e){const{fontSize:t,boxShadow2:o,popoverColor:r,textColor2:n,borderRadius:i,borderColor:a,heightSmall:l,heightMedium:s,heightLarge:c,fontSizeSmall:d,fontSizeMedium:u,fontSizeLarge:p,dividerColor:m}=e;return{panelFontSize:t,boxShadow:o,color:r,textColor:n,borderRadius:i,border:`1px solid ${a}`,heightSmall:l,heightMedium:s,heightLarge:c,fontSizeSmall:d,fontSizeMedium:u,fontSizeLarge:p,dividerColor:m}}const W1={name:"ColorPicker",common:W,peers:{Input:zt,Button:wt},self:L1},j1={abstract:Boolean,bordered:{type:Boolean,default:void 0},clsPrefix:String,locale:Object,dateLocale:Object,namespace:String,rtl:Array,tag:{type:String,default:"div"},hljs:Object,katex:Object,theme:Object,themeOverrides:Object,componentOptions:Object,icons:Object,breakpoints:Object,preflightStyleDisabled:Boolean,styleMountTarget:Object,inlineThemeDisabled:{type:Boolean,default:void 0},as:{type:String,validator:()=>(Aa("config-provider","`as` is deprecated, please use `tag` instead."),!0),default:void 0}},wP=He({name:"ConfigProvider",alias:["App"],props:j1,setup(e){const t=Le(Qt,null),o=Y(()=>{const{theme:g}=e;if(g===null)return;const S=t==null?void 0:t.mergedThemeRef.value;return g===void 0?S:S===void 0?g:Object.assign({},S,g)}),r=Y(()=>{const{themeOverrides:g}=e;if(g!==null){if(g===void 0)return t==null?void 0:t.mergedThemeOverridesRef.value;{const S=t==null?void 0:t.mergedThemeOverridesRef.value;return S===void 0?g:Vr({},S,g)}}}),n=hn(()=>{const{namespace:g}=e;return g===void 0?t==null?void 0:t.mergedNamespaceRef.value:g}),i=hn(()=>{const{bordered:g}=e;return g===void 0?t==null?void 0:t.mergedBorderedRef.value:g}),a=Y(()=>{const{icons:g}=e;return g===void 0?t==null?void 0:t.mergedIconsRef.value:g}),l=Y(()=>{const{componentOptions:g}=e;return g!==void 0?g:t==null?void 0:t.mergedComponentPropsRef.value}),s=Y(()=>{const{clsPrefix:g}=e;return g!==void 0?g:t?t.mergedClsPrefixRef.value:pi}),c=Y(()=>{var g;const{rtl:S}=e;if(S===void 0)return t==null?void 0:t.mergedRtlRef.value;const v={};for(const $ of S)v[$.name]=da($),(g=$.peers)===null||g===void 0||g.forEach(T=>{T.name in v||(v[T.name]=da(T))});return v}),d=Y(()=>e.breakpoints||(t==null?void 0:t.mergedBreakpointsRef.value)),u=e.inlineThemeDisabled||(t==null?void 0:t.inlineThemeDisabled),p=e.preflightStyleDisabled||(t==null?void 0:t.preflightStyleDisabled),m=e.styleMountTarget||(t==null?void 0:t.styleMountTarget),f=Y(()=>{const{value:g}=o,{value:S}=r,v=S&&Object.keys(S).length!==0,$=g==null?void 0:g.name;return $?v?`${$}-${fn(JSON.stringify(r.value))}`:$:v?fn(JSON.stringify(r.value)):""});return po(Qt,{mergedThemeHashRef:f,mergedBreakpointsRef:d,mergedRtlRef:c,mergedIconsRef:a,mergedComponentPropsRef:l,mergedBorderedRef:i,mergedNamespaceRef:n,mergedClsPrefixRef:s,mergedLocaleRef:Y(()=>{const{locale:g}=e;if(g!==null)return g===void 0?t==null?void 0:t.mergedLocaleRef.value:g}),mergedDateLocaleRef:Y(()=>{const{dateLocale:g}=e;if(g!==null)return g===void 0?t==null?void 0:t.mergedDateLocaleRef.value:g}),mergedHljsRef:Y(()=>{const{hljs:g}=e;return g===void 0?t==null?void 0:t.mergedHljsRef.value:g}),mergedKatexRef:Y(()=>{const{katex:g}=e;return g===void 0?t==null?void 0:t.mergedKatexRef.value:g}),mergedThemeRef:o,mergedThemeOverridesRef:r,inlineThemeDisabled:u||!1,preflightStyleDisabled:p||!1,styleMountTarget:m}),{mergedClsPrefix:s,mergedBordered:i,mergedNamespace:n,mergedTheme:o,mergedThemeOverrides:r}},render(){var e,t,o,r;return this.abstract?(r=(o=this.$slots).default)===null||r===void 0?void 0:r.call(o):y(this.as||this.tag,{class:`${this.mergedClsPrefix||pi}-config-provider`},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))}}),Ju={name:"Popselect",common:W,peers:{Popover:lr,InternalSelectMenu:Fn}};function N1(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const V1={name:"Popselect",common:Be,peers:{Popover:zr,InternalSelectMenu:Ou},self:N1};function Zu(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const U1={name:"Select",common:Be,peers:{InternalSelection:Wy,InternalSelectMenu:Ou},self:Zu},Qu={name:"Select",common:W,peers:{InternalSelection:Cl,InternalSelectMenu:Fn},self:Zu},q1={itemPaddingSmall:"0 4px",itemMarginSmall:"0 0 0 8px",itemMarginSmallRtl:"0 8px 0 0",itemPaddingMedium:"0 4px",itemMarginMedium:"0 0 0 8px",itemMarginMediumRtl:"0 8px 0 0",itemPaddingLarge:"0 4px",itemMarginLarge:"0 0 0 8px",itemMarginLargeRtl:"0 8px 0 0",buttonIconSizeSmall:"14px",buttonIconSizeMedium:"16px",buttonIconSizeLarge:"18px",inputWidthSmall:"60px",selectWidthSmall:"unset",inputMarginSmall:"0 0 0 8px",inputMarginSmallRtl:"0 8px 0 0",selectMarginSmall:"0 0 0 8px",prefixMarginSmall:"0 8px 0 0",suffixMarginSmall:"0 0 0 8px",inputWidthMedium:"60px",selectWidthMedium:"unset",inputMarginMedium:"0 0 0 8px",inputMarginMediumRtl:"0 8px 0 0",selectMarginMedium:"0 0 0 8px",prefixMarginMedium:"0 8px 0 0",suffixMarginMedium:"0 0 0 8px",inputWidthLarge:"60px",selectWidthLarge:"unset",inputMarginLarge:"0 0 0 8px",inputMarginLargeRtl:"0 8px 0 0",selectMarginLarge:"0 0 0 8px",prefixMarginLarge:"0 8px 0 0",suffixMarginLarge:"0 0 0 8px"};function ef(e){const{textColor2:t,primaryColor:o,primaryColorHover:r,primaryColorPressed:n,inputColorDisabled:i,textColorDisabled:a,borderColor:l,borderRadius:s,fontSizeTiny:c,fontSizeSmall:d,fontSizeMedium:u,heightTiny:p,heightSmall:m,heightMedium:f}=e;return Object.assign(Object.assign({},q1),{buttonColor:"#0000",buttonColorHover:"#0000",buttonColorPressed:"#0000",buttonBorder:`1px solid ${l}`,buttonBorderHover:`1px solid ${l}`,buttonBorderPressed:`1px solid ${l}`,buttonIconColor:t,buttonIconColorHover:t,buttonIconColorPressed:t,itemTextColor:t,itemTextColorHover:r,itemTextColorPressed:n,itemTextColorActive:o,itemTextColorDisabled:a,itemColor:"#0000",itemColorHover:"#0000",itemColorPressed:"#0000",itemColorActive:"#0000",itemColorActiveHover:"#0000",itemColorDisabled:i,itemBorder:"1px solid #0000",itemBorderHover:"1px solid #0000",itemBorderPressed:"1px solid #0000",itemBorderActive:`1px solid ${o}`,itemBorderDisabled:`1px solid ${l}`,itemBorderRadius:s,itemSizeSmall:p,itemSizeMedium:m,itemSizeLarge:f,itemFontSizeSmall:c,itemFontSizeMedium:d,itemFontSizeLarge:u,jumperFontSizeSmall:c,jumperFontSizeMedium:d,jumperFontSizeLarge:u,jumperTextColor:t,jumperTextColorDisabled:a})}const G1={name:"Pagination",common:Be,peers:{Select:U1,Input:ki,Popselect:V1},self:ef},tf={name:"Pagination",common:W,peers:{Select:Qu,Input:zt,Popselect:Ju},self(e){const{primaryColor:t,opacity3:o}=e,r=K(t,{alpha:Number(o)}),n=ef(e);return n.itemBorderActive=`1px solid ${r}`,n.itemBorderDisabled="1px solid #0000",n}},K1={padding:"4px 0",optionIconSizeSmall:"14px",optionIconSizeMedium:"16px",optionIconSizeLarge:"16px",optionIconSizeHuge:"18px",optionSuffixWidthSmall:"14px",optionSuffixWidthMedium:"14px",optionSuffixWidthLarge:"16px",optionSuffixWidthHuge:"16px",optionIconSuffixWidthSmall:"32px",optionIconSuffixWidthMedium:"32px",optionIconSuffixWidthLarge:"36px",optionIconSuffixWidthHuge:"36px",optionPrefixWidthSmall:"14px",optionPrefixWidthMedium:"14px",optionPrefixWidthLarge:"16px",optionPrefixWidthHuge:"16px",optionIconPrefixWidthSmall:"36px",optionIconPrefixWidthMedium:"36px",optionIconPrefixWidthLarge:"40px",optionIconPrefixWidthHuge:"40px"};function of(e){const{primaryColor:t,textColor2:o,dividerColor:r,hoverColor:n,popoverColor:i,invertedColor:a,borderRadius:l,fontSizeSmall:s,fontSizeMedium:c,fontSizeLarge:d,fontSizeHuge:u,heightSmall:p,heightMedium:m,heightLarge:f,heightHuge:g,textColor3:S,opacityDisabled:v}=e;return Object.assign(Object.assign({},K1),{optionHeightSmall:p,optionHeightMedium:m,optionHeightLarge:f,optionHeightHuge:g,borderRadius:l,fontSizeSmall:s,fontSizeMedium:c,fontSizeLarge:d,fontSizeHuge:u,optionTextColor:o,optionTextColorHover:o,optionTextColorActive:t,optionTextColorChildActive:t,color:i,dividerColor:r,suffixColor:o,prefixColor:o,optionColorHover:n,optionColorActive:K(t,{alpha:.1}),groupHeaderTextColor:S,optionTextColorInverted:"#BBB",optionTextColorHoverInverted:"#FFF",optionTextColorActiveInverted:"#FFF",optionTextColorChildActiveInverted:"#FFF",colorInverted:a,dividerColorInverted:"#BBB",suffixColorInverted:"#BBB",prefixColorInverted:"#BBB",optionColorHoverInverted:t,optionColorActiveInverted:t,groupHeaderTextColorInverted:"#AAA",optionOpacityDisabled:v})}const Y1={name:"Dropdown",common:Be,peers:{Popover:zr},self:of},yl={name:"Dropdown",common:W,peers:{Popover:lr},self(e){const{primaryColorSuppl:t,primaryColor:o,popoverColor:r}=e,n=of(e);return n.colorInverted=r,n.optionColorActive=K(o,{alpha:.15}),n.optionColorActiveInverted=t,n.optionColorHoverInverted=t,n}},rf={padding:"8px 14px"},Di={name:"Tooltip",common:W,peers:{Popover:lr},self(e){const{borderRadius:t,boxShadow2:o,popoverColor:r,textColor2:n}=e;return Object.assign(Object.assign({},rf),{borderRadius:t,boxShadow:o,color:r,textColor:n})}};function X1(e){const{borderRadius:t,boxShadow2:o,baseColor:r}=e;return Object.assign(Object.assign({},rf),{borderRadius:t,boxShadow:o,color:ee(r,"rgba(0, 0, 0, .85)"),textColor:r})}const J1={name:"Tooltip",common:Be,peers:{Popover:zr},self:X1},nf={name:"Ellipsis",common:W,peers:{Tooltip:Di}},Z1={name:"Ellipsis",common:Be,peers:{Tooltip:J1}},af={radioSizeSmall:"14px",radioSizeMedium:"16px",radioSizeLarge:"18px",labelPadding:"0 8px",labelFontWeight:"400"},lf={name:"Radio",common:W,self(e){const{borderColor:t,primaryColor:o,baseColor:r,textColorDisabled:n,inputColorDisabled:i,textColor2:a,opacityDisabled:l,borderRadius:s,fontSizeSmall:c,fontSizeMedium:d,fontSizeLarge:u,heightSmall:p,heightMedium:m,heightLarge:f,lineHeight:g}=e;return Object.assign(Object.assign({},af),{labelLineHeight:g,buttonHeightSmall:p,buttonHeightMedium:m,buttonHeightLarge:f,fontSizeSmall:c,fontSizeMedium:d,fontSizeLarge:u,boxShadow:`inset 0 0 0 1px ${t}`,boxShadowActive:`inset 0 0 0 1px ${o}`,boxShadowFocus:`inset 0 0 0 1px ${o}, 0 0 0 2px ${K(o,{alpha:.3})}`,boxShadowHover:`inset 0 0 0 1px ${o}`,boxShadowDisabled:`inset 0 0 0 1px ${t}`,color:"#0000",colorDisabled:i,colorActive:"#0000",textColor:a,textColorDisabled:n,dotColorActive:o,dotColorDisabled:t,buttonBorderColor:t,buttonBorderColorActive:o,buttonBorderColorHover:o,buttonColor:"#0000",buttonColorActive:o,buttonTextColor:a,buttonTextColorActive:r,buttonTextColorHover:o,opacityDisabled:l,buttonBoxShadowFocus:`inset 0 0 0 1px ${o}, 0 0 0 2px ${K(o,{alpha:.3})}`,buttonBoxShadowHover:`inset 0 0 0 1px ${o}`,buttonBoxShadow:"inset 0 0 0 1px #0000",buttonBorderRadius:s})}};function Q1(e){const{borderColor:t,primaryColor:o,baseColor:r,textColorDisabled:n,inputColorDisabled:i,textColor2:a,opacityDisabled:l,borderRadius:s,fontSizeSmall:c,fontSizeMedium:d,fontSizeLarge:u,heightSmall:p,heightMedium:m,heightLarge:f,lineHeight:g}=e;return Object.assign(Object.assign({},af),{labelLineHeight:g,buttonHeightSmall:p,buttonHeightMedium:m,buttonHeightLarge:f,fontSizeSmall:c,fontSizeMedium:d,fontSizeLarge:u,boxShadow:`inset 0 0 0 1px ${t}`,boxShadowActive:`inset 0 0 0 1px ${o}`,boxShadowFocus:`inset 0 0 0 1px ${o}, 0 0 0 2px ${K(o,{alpha:.2})}`,boxShadowHover:`inset 0 0 0 1px ${o}`,boxShadowDisabled:`inset 0 0 0 1px ${t}`,color:r,colorDisabled:i,colorActive:"#0000",textColor:a,textColorDisabled:n,dotColorActive:o,dotColorDisabled:t,buttonBorderColor:t,buttonBorderColorActive:o,buttonBorderColorHover:t,buttonColor:r,buttonColorActive:r,buttonTextColor:a,buttonTextColorActive:o,buttonTextColorHover:o,opacityDisabled:l,buttonBoxShadowFocus:`inset 0 0 0 1px ${o}, 0 0 0 2px ${K(o,{alpha:.3})}`,buttonBoxShadowHover:"inset 0 0 0 1px #0000",buttonBoxShadow:"inset 0 0 0 1px #0000",buttonBorderRadius:s})}const eS={name:"Radio",common:Be,self:Q1},tS={thPaddingSmall:"8px",thPaddingMedium:"12px",thPaddingLarge:"12px",tdPaddingSmall:"8px",tdPaddingMedium:"12px",tdPaddingLarge:"12px",sorterSize:"15px",resizableContainerSize:"8px",resizableSize:"2px",filterSize:"15px",paginationMargin:"12px 0 0 0",emptyPadding:"48px 0",actionPadding:"8px 12px",actionButtonMargin:"0 8px 0 0"};function sf(e){const{cardColor:t,modalColor:o,popoverColor:r,textColor2:n,textColor1:i,tableHeaderColor:a,tableColorHover:l,iconColor:s,primaryColor:c,fontWeightStrong:d,borderRadius:u,lineHeight:p,fontSizeSmall:m,fontSizeMedium:f,fontSizeLarge:g,dividerColor:S,heightSmall:v,opacityDisabled:$,tableColorStriped:T}=e;return Object.assign(Object.assign({},tS),{actionDividerColor:S,lineHeight:p,borderRadius:u,fontSizeSmall:m,fontSizeMedium:f,fontSizeLarge:g,borderColor:ee(t,S),tdColorHover:ee(t,l),tdColorSorting:ee(t,l),tdColorStriped:ee(t,T),thColor:ee(t,a),thColorHover:ee(ee(t,a),l),thColorSorting:ee(ee(t,a),l),tdColor:t,tdTextColor:n,thTextColor:i,thFontWeight:d,thButtonColorHover:l,thIconColor:s,thIconColorActive:c,borderColorModal:ee(o,S),tdColorHoverModal:ee(o,l),tdColorSortingModal:ee(o,l),tdColorStripedModal:ee(o,T),thColorModal:ee(o,a),thColorHoverModal:ee(ee(o,a),l),thColorSortingModal:ee(ee(o,a),l),tdColorModal:o,borderColorPopover:ee(r,S),tdColorHoverPopover:ee(r,l),tdColorSortingPopover:ee(r,l),tdColorStripedPopover:ee(r,T),thColorPopover:ee(r,a),thColorHoverPopover:ee(ee(r,a),l),thColorSortingPopover:ee(ee(r,a),l),tdColorPopover:r,boxShadowBefore:"inset -12px 0 8px -12px rgba(0, 0, 0, .18)",boxShadowAfter:"inset 12px 0 8px -12px rgba(0, 0, 0, .18)",loadingColor:c,loadingSize:v,opacityLoading:$})}const PP={name:"DataTable",common:Be,peers:{Button:An,Checkbox:M1,Radio:eS,Pagination:G1,Scrollbar:Rn,Empty:xl,Popover:zr,Ellipsis:Z1,Dropdown:Y1},self:sf},oS={name:"DataTable",common:W,peers:{Button:wt,Checkbox:Hr,Radio:lf,Pagination:tf,Scrollbar:St,Empty:ar,Popover:lr,Ellipsis:nf,Dropdown:yl},self(e){const t=sf(e);return t.boxShadowAfter="inset 12px 0 8px -12px rgba(0, 0, 0, .36)",t.boxShadowBefore="inset -12px 0 8px -12px rgba(0, 0, 0, .36)",t}};function cf(e){const{textColorBase:t,opacity1:o,opacity2:r,opacity3:n,opacity4:i,opacity5:a}=e;return{color:t,opacity1Depth:o,opacity2Depth:r,opacity3Depth:n,opacity4Depth:i,opacity5Depth:a}}const TP={common:Be,self:cf},rS={name:"Icon",common:W,self:cf},nS={itemFontSize:"12px",itemHeight:"36px",itemWidth:"52px",panelActionPadding:"8px 0"};function df(e){const{popoverColor:t,textColor2:o,primaryColor:r,hoverColor:n,dividerColor:i,opacityDisabled:a,boxShadow2:l,borderRadius:s,iconColor:c,iconColorDisabled:d}=e;return Object.assign(Object.assign({},nS),{panelColor:t,panelBoxShadow:l,panelDividerColor:i,itemTextColor:o,itemTextColorActive:r,itemColorHover:n,itemOpacityDisabled:a,itemBorderRadius:s,borderRadius:s,iconColor:c,iconColorDisabled:d})}const iS={name:"TimePicker",common:Be,peers:{Scrollbar:Rn,Button:An,Input:ki},self:df},uf={name:"TimePicker",common:W,peers:{Scrollbar:St,Button:wt,Input:zt},self:df},aS={itemSize:"24px",itemCellWidth:"38px",itemCellHeight:"32px",scrollItemWidth:"80px",scrollItemHeight:"40px",panelExtraFooterPadding:"8px 12px",panelActionPadding:"8px 12px",calendarTitlePadding:"0",calendarTitleHeight:"28px",arrowSize:"14px",panelHeaderPadding:"8px 12px",calendarDaysHeight:"32px",calendarTitleGridTempateColumns:"28px 28px 1fr 28px 28px",calendarLeftPaddingDate:"6px 12px 4px 12px",calendarLeftPaddingDatetime:"4px 12px",calendarLeftPaddingDaterange:"6px 12px 4px 12px",calendarLeftPaddingDatetimerange:"4px 12px",calendarLeftPaddingMonth:"0",calendarLeftPaddingYear:"0",calendarLeftPaddingQuarter:"0",calendarLeftPaddingMonthrange:"0",calendarLeftPaddingQuarterrange:"0",calendarLeftPaddingYearrange:"0",calendarLeftPaddingWeek:"6px 12px 4px 12px",calendarRightPaddingDate:"6px 12px 4px 12px",calendarRightPaddingDatetime:"4px 12px",calendarRightPaddingDaterange:"6px 12px 4px 12px",calendarRightPaddingDatetimerange:"4px 12px",calendarRightPaddingMonth:"0",calendarRightPaddingYear:"0",calendarRightPaddingQuarter:"0",calendarRightPaddingMonthrange:"0",calendarRightPaddingQuarterrange:"0",calendarRightPaddingYearrange:"0",calendarRightPaddingWeek:"0"};function ff(e){const{hoverColor:t,fontSize:o,textColor2:r,textColorDisabled:n,popoverColor:i,primaryColor:a,borderRadiusSmall:l,iconColor:s,iconColorDisabled:c,textColor1:d,dividerColor:u,boxShadow2:p,borderRadius:m,fontWeightStrong:f}=e;return Object.assign(Object.assign({},aS),{itemFontSize:o,calendarDaysFontSize:o,calendarTitleFontSize:o,itemTextColor:r,itemTextColorDisabled:n,itemTextColorActive:i,itemTextColorCurrent:a,itemColorIncluded:K(a,{alpha:.1}),itemColorHover:t,itemColorDisabled:t,itemColorActive:a,itemBorderRadius:l,panelColor:i,panelTextColor:r,arrowColor:s,calendarTitleTextColor:d,calendarTitleColorHover:t,calendarDaysTextColor:r,panelHeaderDividerColor:u,calendarDaysDividerColor:u,calendarDividerColor:u,panelActionDividerColor:u,panelBoxShadow:p,panelBorderRadius:m,calendarTitleFontWeight:f,scrollItemBorderRadius:m,iconColor:s,iconColorDisabled:c})}const $P={name:"DatePicker",common:Be,peers:{Input:ki,Button:An,TimePicker:iS,Scrollbar:Rn},self:ff},lS={name:"DatePicker",common:W,peers:{Input:zt,Button:wt,TimePicker:uf,Scrollbar:St},self(e){const{popoverColor:t,hoverColor:o,primaryColor:r}=e,n=ff(e);return n.itemColorDisabled=ee(t,o),n.itemColorIncluded=K(r,{alpha:.15}),n.itemColorHover=ee(t,o),n}},sS={thPaddingBorderedSmall:"8px 12px",thPaddingBorderedMedium:"12px 16px",thPaddingBorderedLarge:"16px 24px",thPaddingSmall:"0",thPaddingMedium:"0",thPaddingLarge:"0",tdPaddingBorderedSmall:"8px 12px",tdPaddingBorderedMedium:"12px 16px",tdPaddingBorderedLarge:"16px 24px",tdPaddingSmall:"0 0 8px 0",tdPaddingMedium:"0 0 12px 0",tdPaddingLarge:"0 0 16px 0"};function cS(e){const{tableHeaderColor:t,textColor2:o,textColor1:r,cardColor:n,modalColor:i,popoverColor:a,dividerColor:l,borderRadius:s,fontWeightStrong:c,lineHeight:d,fontSizeSmall:u,fontSizeMedium:p,fontSizeLarge:m}=e;return Object.assign(Object.assign({},sS),{lineHeight:d,fontSizeSmall:u,fontSizeMedium:p,fontSizeLarge:m,titleTextColor:r,thColor:ee(n,t),thColorModal:ee(i,t),thColorPopover:ee(a,t),thTextColor:r,thFontWeight:c,tdTextColor:o,tdColor:n,tdColorModal:i,tdColorPopover:a,borderColor:ee(n,l),borderColorModal:ee(i,l),borderColorPopover:ee(a,l),borderRadius:s})}const dS={name:"Descriptions",common:W,self:cS},uS={titleFontSize:"18px",padding:"16px 28px 20px 28px",iconSize:"28px",actionSpace:"12px",contentMargin:"8px 0 16px 0",iconMargin:"0 4px 0 0",iconMarginIconTop:"4px 0 8px 0",closeSize:"22px",closeIconSize:"18px",closeMargin:"20px 26px 0 0",closeMarginIconTop:"10px 16px 0 0"};function fS(e){const{textColor1:t,textColor2:o,modalColor:r,closeIconColor:n,closeIconColorHover:i,closeIconColorPressed:a,closeColorHover:l,closeColorPressed:s,infoColor:c,successColor:d,warningColor:u,errorColor:p,primaryColor:m,dividerColor:f,borderRadius:g,fontWeightStrong:S,lineHeight:v,fontSize:$}=e;return Object.assign(Object.assign({},uS),{fontSize:$,lineHeight:v,border:`1px solid ${f}`,titleTextColor:t,textColor:o,color:r,closeColorHover:l,closeColorPressed:s,closeIconColor:n,closeIconColorHover:i,closeIconColorPressed:a,closeBorderRadius:g,iconColor:m,iconColorInfo:c,iconColorSuccess:d,iconColorWarning:u,iconColorError:p,borderRadius:g,titleFontWeight:S})}const pf={name:"Dialog",common:W,peers:{Button:wt},self:fS};function pS(e){const{modalColor:t,textColor2:o,boxShadow3:r}=e;return{color:t,textColor:o,boxShadow:r}}const hS={name:"Modal",common:W,peers:{Scrollbar:St,Dialog:pf,Card:Ku},self:pS},gS={name:"LoadingBar",common:W,self(e){const{primaryColor:t}=e;return{colorError:"red",colorLoading:t,height:"2px"}}},mS="n-message-api",hf="n-message-provider",bS={margin:"0 0 8px 0",padding:"10px 20px",maxWidth:"720px",minWidth:"420px",iconMargin:"0 10px 0 0",closeMargin:"0 0 0 10px",closeSize:"20px",closeIconSize:"16px",iconSize:"20px",fontSize:"14px"};function gf(e){const{textColor2:t,closeIconColor:o,closeIconColorHover:r,closeIconColorPressed:n,infoColor:i,successColor:a,errorColor:l,warningColor:s,popoverColor:c,boxShadow2:d,primaryColor:u,lineHeight:p,borderRadius:m,closeColorHover:f,closeColorPressed:g}=e;return Object.assign(Object.assign({},bS),{closeBorderRadius:m,textColor:t,textColorInfo:t,textColorSuccess:t,textColorError:t,textColorWarning:t,textColorLoading:t,color:c,colorInfo:c,colorSuccess:c,colorError:c,colorWarning:c,colorLoading:c,boxShadow:d,boxShadowInfo:d,boxShadowSuccess:d,boxShadowError:d,boxShadowWarning:d,boxShadowLoading:d,iconColor:t,iconColorInfo:i,iconColorSuccess:a,iconColorWarning:s,iconColorError:l,iconColorLoading:u,closeColorHover:f,closeColorPressed:g,closeIconColor:o,closeIconColorHover:r,closeIconColorPressed:n,closeColorHoverInfo:f,closeColorPressedInfo:g,closeIconColorInfo:o,closeIconColorHoverInfo:r,closeIconColorPressedInfo:n,closeColorHoverSuccess:f,closeColorPressedSuccess:g,closeIconColorSuccess:o,closeIconColorHoverSuccess:r,closeIconColorPressedSuccess:n,closeColorHoverError:f,closeColorPressedError:g,closeIconColorError:o,closeIconColorHoverError:r,closeIconColorPressedError:n,closeColorHoverWarning:f,closeColorPressedWarning:g,closeIconColorWarning:o,closeIconColorHoverWarning:r,closeIconColorPressedWarning:n,closeColorHoverLoading:f,closeColorPressedLoading:g,closeIconColorLoading:o,closeIconColorHoverLoading:r,closeIconColorPressedLoading:n,loadingColor:u,lineHeight:p,borderRadius:m})}const vS={common:Be,self:gf},xS={name:"Message",common:W,self:gf},mf={icon:Function,type:{type:String,default:"info"},content:[String,Number,Function],showIcon:{type:Boolean,default:!0},closable:Boolean,keepAliveOnHover:Boolean,onClose:Function,onMouseenter:Function,onMouseleave:Function},CS=L([pe("message-wrapper",` + `)]))]),F1={title:[String,Function],contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],headerExtraClass:String,headerExtraStyle:[Object,String],footerClass:String,footerStyle:[Object,String],embedded:Boolean,segmented:{type:[Boolean,Object],default:!1},size:{type:String,default:"medium"},bordered:{type:Boolean,default:!0},closable:Boolean,hoverable:Boolean,role:String,onClose:[Function,Array],tag:{type:String,default:"div"},cover:Function,content:[String,Function],footer:Function,action:Function,headerExtra:Function},A1=Object.assign(Object.assign({},Ct.props),F1),SP=He({name:"Card",props:A1,setup(e){const t=()=>{const{onClose:c}=e;c&&Ke(c)},{inlineThemeDisabled:o,mergedClsPrefixRef:r,mergedRtlRef:n}=zo(e),i=Ct("Card","-card",R1,$1,e,r),a=$n("Card",n,r),l=Y(()=>{const{size:c}=e,{self:{color:d,colorModal:u,colorTarget:p,textColor:m,titleTextColor:f,titleFontWeight:g,borderColor:S,actionColor:v,borderRadius:$,lineHeight:T,closeIconColor:w,closeIconColorHover:E,closeIconColorPressed:O,closeColorHover:x,closeColorPressed:F,closeBorderRadius:R,closeIconSize:B,closeSize:j,boxShadow:A,colorPopover:J,colorEmbedded:G,colorEmbeddedModal:le,colorEmbeddedPopover:te,[ae("padding",c)]:N,[ae("fontSize",c)]:oe,[ae("titleFontSize",c)]:ye},common:{cubicBezierEaseInOut:Pe}}=i.value,{top:Re,left:Fe,bottom:Ve}=Vo(N);return{"--n-bezier":Pe,"--n-border-radius":$,"--n-color":d,"--n-color-modal":u,"--n-color-popover":J,"--n-color-embedded":G,"--n-color-embedded-modal":le,"--n-color-embedded-popover":te,"--n-color-target":p,"--n-text-color":m,"--n-line-height":T,"--n-action-color":v,"--n-title-text-color":f,"--n-title-font-weight":g,"--n-close-icon-color":w,"--n-close-icon-color-hover":E,"--n-close-icon-color-pressed":O,"--n-close-color-hover":x,"--n-close-color-pressed":F,"--n-border-color":S,"--n-box-shadow":A,"--n-padding-top":Re,"--n-padding-bottom":Ve,"--n-padding-left":Fe,"--n-font-size":oe,"--n-title-font-size":ye,"--n-close-size":j,"--n-close-icon-size":B,"--n-close-border-radius":R}}),s=o?Fr("card",Y(()=>e.size[0]),l,e):void 0;return{rtlEnabled:a,mergedClsPrefix:r,mergedTheme:i,handleCloseClick:t,cssVars:o?void 0:l,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender}},render(){const{segmented:e,bordered:t,hoverable:o,mergedClsPrefix:r,rtlEnabled:n,onRender:i,embedded:a,tag:l,$slots:s}=this;return i==null||i(),y(l,{class:[`${r}-card`,this.themeClass,a&&`${r}-card--embedded`,{[`${r}-card--rtl`]:n,[`${r}-card--content${typeof e!="boolean"&&e.content==="soft"?"-soft":""}-segmented`]:e===!0||e!==!1&&e.content,[`${r}-card--footer${typeof e!="boolean"&&e.footer==="soft"?"-soft":""}-segmented`]:e===!0||e!==!1&&e.footer,[`${r}-card--action-segmented`]:e===!0||e!==!1&&e.action,[`${r}-card--bordered`]:t,[`${r}-card--hoverable`]:o}],style:this.cssVars,role:this.role},$t(s.cover,c=>{const d=this.cover?kt([this.cover()]):c;return d&&y("div",{class:`${r}-card-cover`,role:"none"},d)}),$t(s.header,c=>{const{title:d}=this,u=d?kt(typeof d=="function"?[d()]:[d]):c;return u||this.closable?y("div",{class:[`${r}-card-header`,this.headerClass],style:this.headerStyle,role:"heading"},y("div",{class:`${r}-card-header__main`,role:"heading"},u),$t(s["header-extra"],p=>{const m=this.headerExtra?kt([this.headerExtra()]):p;return m&&y("div",{class:[`${r}-card-header__extra`,this.headerExtraClass],style:this.headerExtraStyle},m)}),this.closable&&y(Iu,{clsPrefix:r,class:`${r}-card-header__close`,onClick:this.handleCloseClick,absolute:!0})):null}),$t(s.default,c=>{const{content:d}=this,u=d?kt(typeof d=="function"?[d()]:[d]):c;return u&&y("div",{class:[`${r}-card__content`,this.contentClass],style:this.contentStyle,role:"none"},u)}),$t(s.footer,c=>{const d=this.footer?kt([this.footer()]):c;return d&&y("div",{class:[`${r}-card__footer`,this.footerClass],style:this.footerStyle,role:"none"},d)}),$t(s.action,c=>{const d=this.action?kt([this.action()]):c;return d&&y("div",{class:`${r}-card__action`,role:"none"},d)}))}});function I1(){return{dotSize:"8px",dotColor:"rgba(255, 255, 255, .3)",dotColorActive:"rgba(255, 255, 255, 1)",dotColorFocus:"rgba(255, 255, 255, .5)",dotLineWidth:"16px",dotLineWidthActive:"24px",arrowColor:"#eee"}}const E1={name:"Carousel",common:W,self:I1},_1={sizeSmall:"14px",sizeMedium:"16px",sizeLarge:"18px",labelPadding:"0 8px",labelFontWeight:"400"};function Yu(e){const{baseColor:t,inputColorDisabled:o,cardColor:r,modalColor:n,popoverColor:i,textColorDisabled:a,borderColor:l,primaryColor:s,textColor2:c,fontSizeSmall:d,fontSizeMedium:u,fontSizeLarge:p,borderRadiusSmall:m,lineHeight:f}=e;return Object.assign(Object.assign({},_1),{labelLineHeight:f,fontSizeSmall:d,fontSizeMedium:u,fontSizeLarge:p,borderRadius:m,color:t,colorChecked:s,colorDisabled:o,colorDisabledChecked:o,colorTableHeader:r,colorTableHeaderModal:n,colorTableHeaderPopover:i,checkMarkColor:t,checkMarkColorDisabled:a,checkMarkColorDisabledChecked:a,border:`1px solid ${l}`,borderDisabled:`1px solid ${l}`,borderDisabledChecked:`1px solid ${l}`,borderChecked:`1px solid ${s}`,borderFocus:`1px solid ${s}`,boxShadowFocus:`0 0 0 2px ${K(s,{alpha:.3})}`,textColor:c,textColorDisabled:a})}const M1={name:"Checkbox",common:Be,self:Yu},Hr={name:"Checkbox",common:W,self(e){const{cardColor:t}=e,o=Yu(e);return o.color="#0000",o.checkMarkColor=t,o}};function z1(e){const{borderRadius:t,boxShadow2:o,popoverColor:r,textColor2:n,textColor3:i,primaryColor:a,textColorDisabled:l,dividerColor:s,hoverColor:c,fontSizeMedium:d,heightMedium:u}=e;return{menuBorderRadius:t,menuColor:r,menuBoxShadow:o,menuDividerColor:s,menuHeight:"calc(var(--n-option-height) * 6.6)",optionArrowColor:i,optionHeight:u,optionFontSize:d,optionColorHover:c,optionTextColor:n,optionTextColorActive:a,optionTextColorDisabled:l,optionCheckMarkColor:a,loadingColor:a,columnWidth:"180px"}}const H1={name:"Cascader",common:W,peers:{InternalSelectMenu:Fn,InternalSelection:Cl,Scrollbar:St,Checkbox:Hr,Empty:xl},self:z1},Xu={name:"Code",common:W,self(e){const{textColor2:t,fontSize:o,fontWeightStrong:r,textColor3:n}=e;return{textColor:t,fontSize:o,fontWeightStrong:r,"mono-3":"#5c6370","hue-1":"#56b6c2","hue-2":"#61aeee","hue-3":"#c678dd","hue-4":"#98c379","hue-5":"#e06c75","hue-5-2":"#be5046","hue-6":"#d19a66","hue-6-2":"#e6c07b",lineNumberTextColor:n}}};function k1(e){const{fontWeight:t,textColor1:o,textColor2:r,textColorDisabled:n,dividerColor:i,fontSize:a}=e;return{titleFontSize:a,titleFontWeight:t,dividerColor:i,titleTextColor:o,titleTextColorDisabled:n,fontSize:a,textColor:r,arrowColor:r,arrowColorDisabled:n,itemMargin:"16px 0 0 0",titlePadding:"16px 0 0 0"}}const D1={name:"Collapse",common:W,self:k1};function O1(e){const{cubicBezierEaseInOut:t}=e;return{bezier:t}}const B1={name:"CollapseTransition",common:W,self:O1};function L1(e){const{fontSize:t,boxShadow2:o,popoverColor:r,textColor2:n,borderRadius:i,borderColor:a,heightSmall:l,heightMedium:s,heightLarge:c,fontSizeSmall:d,fontSizeMedium:u,fontSizeLarge:p,dividerColor:m}=e;return{panelFontSize:t,boxShadow:o,color:r,textColor:n,borderRadius:i,border:`1px solid ${a}`,heightSmall:l,heightMedium:s,heightLarge:c,fontSizeSmall:d,fontSizeMedium:u,fontSizeLarge:p,dividerColor:m}}const W1={name:"ColorPicker",common:W,peers:{Input:zt,Button:wt},self:L1},j1={abstract:Boolean,bordered:{type:Boolean,default:void 0},clsPrefix:String,locale:Object,dateLocale:Object,namespace:String,rtl:Array,tag:{type:String,default:"div"},hljs:Object,katex:Object,theme:Object,themeOverrides:Object,componentOptions:Object,icons:Object,breakpoints:Object,preflightStyleDisabled:Boolean,styleMountTarget:Object,inlineThemeDisabled:{type:Boolean,default:void 0},as:{type:String,validator:()=>(Aa("config-provider","`as` is deprecated, please use `tag` instead."),!0),default:void 0}},wP=He({name:"ConfigProvider",alias:["App"],props:j1,setup(e){const t=Le(Qt,null),o=Y(()=>{const{theme:g}=e;if(g===null)return;const S=t==null?void 0:t.mergedThemeRef.value;return g===void 0?S:S===void 0?g:Object.assign({},S,g)}),r=Y(()=>{const{themeOverrides:g}=e;if(g!==null){if(g===void 0)return t==null?void 0:t.mergedThemeOverridesRef.value;{const S=t==null?void 0:t.mergedThemeOverridesRef.value;return S===void 0?g:Vr({},S,g)}}}),n=hn(()=>{const{namespace:g}=e;return g===void 0?t==null?void 0:t.mergedNamespaceRef.value:g}),i=hn(()=>{const{bordered:g}=e;return g===void 0?t==null?void 0:t.mergedBorderedRef.value:g}),a=Y(()=>{const{icons:g}=e;return g===void 0?t==null?void 0:t.mergedIconsRef.value:g}),l=Y(()=>{const{componentOptions:g}=e;return g!==void 0?g:t==null?void 0:t.mergedComponentPropsRef.value}),s=Y(()=>{const{clsPrefix:g}=e;return g!==void 0?g:t?t.mergedClsPrefixRef.value:pi}),c=Y(()=>{var g;const{rtl:S}=e;if(S===void 0)return t==null?void 0:t.mergedRtlRef.value;const v={};for(const $ of S)v[$.name]=da($),(g=$.peers)===null||g===void 0||g.forEach(T=>{T.name in v||(v[T.name]=da(T))});return v}),d=Y(()=>e.breakpoints||(t==null?void 0:t.mergedBreakpointsRef.value)),u=e.inlineThemeDisabled||(t==null?void 0:t.inlineThemeDisabled),p=e.preflightStyleDisabled||(t==null?void 0:t.preflightStyleDisabled),m=e.styleMountTarget||(t==null?void 0:t.styleMountTarget),f=Y(()=>{const{value:g}=o,{value:S}=r,v=S&&Object.keys(S).length!==0,$=g==null?void 0:g.name;return $?v?`${$}-${fn(JSON.stringify(r.value))}`:$:v?fn(JSON.stringify(r.value)):""});return po(Qt,{mergedThemeHashRef:f,mergedBreakpointsRef:d,mergedRtlRef:c,mergedIconsRef:a,mergedComponentPropsRef:l,mergedBorderedRef:i,mergedNamespaceRef:n,mergedClsPrefixRef:s,mergedLocaleRef:Y(()=>{const{locale:g}=e;if(g!==null)return g===void 0?t==null?void 0:t.mergedLocaleRef.value:g}),mergedDateLocaleRef:Y(()=>{const{dateLocale:g}=e;if(g!==null)return g===void 0?t==null?void 0:t.mergedDateLocaleRef.value:g}),mergedHljsRef:Y(()=>{const{hljs:g}=e;return g===void 0?t==null?void 0:t.mergedHljsRef.value:g}),mergedKatexRef:Y(()=>{const{katex:g}=e;return g===void 0?t==null?void 0:t.mergedKatexRef.value:g}),mergedThemeRef:o,mergedThemeOverridesRef:r,inlineThemeDisabled:u||!1,preflightStyleDisabled:p||!1,styleMountTarget:m}),{mergedClsPrefix:s,mergedBordered:i,mergedNamespace:n,mergedTheme:o,mergedThemeOverrides:r}},render(){var e,t,o,r;return this.abstract?(r=(o=this.$slots).default)===null||r===void 0?void 0:r.call(o):y(this.as||this.tag,{class:`${this.mergedClsPrefix||pi}-config-provider`},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))}}),Ju={name:"Popselect",common:W,peers:{Popover:lr,InternalSelectMenu:Fn}};function N1(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const V1={name:"Popselect",common:Be,peers:{Popover:zr,InternalSelectMenu:Ou},self:N1};function Zu(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const U1={name:"Select",common:Be,peers:{InternalSelection:Wy,InternalSelectMenu:Ou},self:Zu},Qu={name:"Select",common:W,peers:{InternalSelection:Cl,InternalSelectMenu:Fn},self:Zu},q1={itemPaddingSmall:"0 4px",itemMarginSmall:"0 0 0 8px",itemMarginSmallRtl:"0 8px 0 0",itemPaddingMedium:"0 4px",itemMarginMedium:"0 0 0 8px",itemMarginMediumRtl:"0 8px 0 0",itemPaddingLarge:"0 4px",itemMarginLarge:"0 0 0 8px",itemMarginLargeRtl:"0 8px 0 0",buttonIconSizeSmall:"14px",buttonIconSizeMedium:"16px",buttonIconSizeLarge:"18px",inputWidthSmall:"60px",selectWidthSmall:"unset",inputMarginSmall:"0 0 0 8px",inputMarginSmallRtl:"0 8px 0 0",selectMarginSmall:"0 0 0 8px",prefixMarginSmall:"0 8px 0 0",suffixMarginSmall:"0 0 0 8px",inputWidthMedium:"60px",selectWidthMedium:"unset",inputMarginMedium:"0 0 0 8px",inputMarginMediumRtl:"0 8px 0 0",selectMarginMedium:"0 0 0 8px",prefixMarginMedium:"0 8px 0 0",suffixMarginMedium:"0 0 0 8px",inputWidthLarge:"60px",selectWidthLarge:"unset",inputMarginLarge:"0 0 0 8px",inputMarginLargeRtl:"0 8px 0 0",selectMarginLarge:"0 0 0 8px",prefixMarginLarge:"0 8px 0 0",suffixMarginLarge:"0 0 0 8px"};function ef(e){const{textColor2:t,primaryColor:o,primaryColorHover:r,primaryColorPressed:n,inputColorDisabled:i,textColorDisabled:a,borderColor:l,borderRadius:s,fontSizeTiny:c,fontSizeSmall:d,fontSizeMedium:u,heightTiny:p,heightSmall:m,heightMedium:f}=e;return Object.assign(Object.assign({},q1),{buttonColor:"#0000",buttonColorHover:"#0000",buttonColorPressed:"#0000",buttonBorder:`1px solid ${l}`,buttonBorderHover:`1px solid ${l}`,buttonBorderPressed:`1px solid ${l}`,buttonIconColor:t,buttonIconColorHover:t,buttonIconColorPressed:t,itemTextColor:t,itemTextColorHover:r,itemTextColorPressed:n,itemTextColorActive:o,itemTextColorDisabled:a,itemColor:"#0000",itemColorHover:"#0000",itemColorPressed:"#0000",itemColorActive:"#0000",itemColorActiveHover:"#0000",itemColorDisabled:i,itemBorder:"1px solid #0000",itemBorderHover:"1px solid #0000",itemBorderPressed:"1px solid #0000",itemBorderActive:`1px solid ${o}`,itemBorderDisabled:`1px solid ${l}`,itemBorderRadius:s,itemSizeSmall:p,itemSizeMedium:m,itemSizeLarge:f,itemFontSizeSmall:c,itemFontSizeMedium:d,itemFontSizeLarge:u,jumperFontSizeSmall:c,jumperFontSizeMedium:d,jumperFontSizeLarge:u,jumperTextColor:t,jumperTextColorDisabled:a})}const G1={name:"Pagination",common:Be,peers:{Select:U1,Input:ki,Popselect:V1},self:ef},tf={name:"Pagination",common:W,peers:{Select:Qu,Input:zt,Popselect:Ju},self(e){const{primaryColor:t,opacity3:o}=e,r=K(t,{alpha:Number(o)}),n=ef(e);return n.itemBorderActive=`1px solid ${r}`,n.itemBorderDisabled="1px solid #0000",n}},K1={padding:"4px 0",optionIconSizeSmall:"14px",optionIconSizeMedium:"16px",optionIconSizeLarge:"16px",optionIconSizeHuge:"18px",optionSuffixWidthSmall:"14px",optionSuffixWidthMedium:"14px",optionSuffixWidthLarge:"16px",optionSuffixWidthHuge:"16px",optionIconSuffixWidthSmall:"32px",optionIconSuffixWidthMedium:"32px",optionIconSuffixWidthLarge:"36px",optionIconSuffixWidthHuge:"36px",optionPrefixWidthSmall:"14px",optionPrefixWidthMedium:"14px",optionPrefixWidthLarge:"16px",optionPrefixWidthHuge:"16px",optionIconPrefixWidthSmall:"36px",optionIconPrefixWidthMedium:"36px",optionIconPrefixWidthLarge:"40px",optionIconPrefixWidthHuge:"40px"};function of(e){const{primaryColor:t,textColor2:o,dividerColor:r,hoverColor:n,popoverColor:i,invertedColor:a,borderRadius:l,fontSizeSmall:s,fontSizeMedium:c,fontSizeLarge:d,fontSizeHuge:u,heightSmall:p,heightMedium:m,heightLarge:f,heightHuge:g,textColor3:S,opacityDisabled:v}=e;return Object.assign(Object.assign({},K1),{optionHeightSmall:p,optionHeightMedium:m,optionHeightLarge:f,optionHeightHuge:g,borderRadius:l,fontSizeSmall:s,fontSizeMedium:c,fontSizeLarge:d,fontSizeHuge:u,optionTextColor:o,optionTextColorHover:o,optionTextColorActive:t,optionTextColorChildActive:t,color:i,dividerColor:r,suffixColor:o,prefixColor:o,optionColorHover:n,optionColorActive:K(t,{alpha:.1}),groupHeaderTextColor:S,optionTextColorInverted:"#BBB",optionTextColorHoverInverted:"#FFF",optionTextColorActiveInverted:"#FFF",optionTextColorChildActiveInverted:"#FFF",colorInverted:a,dividerColorInverted:"#BBB",suffixColorInverted:"#BBB",prefixColorInverted:"#BBB",optionColorHoverInverted:t,optionColorActiveInverted:t,groupHeaderTextColorInverted:"#AAA",optionOpacityDisabled:v})}const Y1={name:"Dropdown",common:Be,peers:{Popover:zr},self:of},yl={name:"Dropdown",common:W,peers:{Popover:lr},self(e){const{primaryColorSuppl:t,primaryColor:o,popoverColor:r}=e,n=of(e);return n.colorInverted=r,n.optionColorActive=K(o,{alpha:.15}),n.optionColorActiveInverted=t,n.optionColorHoverInverted=t,n}},rf={padding:"8px 14px"},Di={name:"Tooltip",common:W,peers:{Popover:lr},self(e){const{borderRadius:t,boxShadow2:o,popoverColor:r,textColor2:n}=e;return Object.assign(Object.assign({},rf),{borderRadius:t,boxShadow:o,color:r,textColor:n})}};function X1(e){const{borderRadius:t,boxShadow2:o,baseColor:r}=e;return Object.assign(Object.assign({},rf),{borderRadius:t,boxShadow:o,color:ee(r,"rgba(0, 0, 0, .85)"),textColor:r})}const J1={name:"Tooltip",common:Be,peers:{Popover:zr},self:X1},nf={name:"Ellipsis",common:W,peers:{Tooltip:Di}},Z1={name:"Ellipsis",common:Be,peers:{Tooltip:J1}},af={radioSizeSmall:"14px",radioSizeMedium:"16px",radioSizeLarge:"18px",labelPadding:"0 8px",labelFontWeight:"400"},lf={name:"Radio",common:W,self(e){const{borderColor:t,primaryColor:o,baseColor:r,textColorDisabled:n,inputColorDisabled:i,textColor2:a,opacityDisabled:l,borderRadius:s,fontSizeSmall:c,fontSizeMedium:d,fontSizeLarge:u,heightSmall:p,heightMedium:m,heightLarge:f,lineHeight:g}=e;return Object.assign(Object.assign({},af),{labelLineHeight:g,buttonHeightSmall:p,buttonHeightMedium:m,buttonHeightLarge:f,fontSizeSmall:c,fontSizeMedium:d,fontSizeLarge:u,boxShadow:`inset 0 0 0 1px ${t}`,boxShadowActive:`inset 0 0 0 1px ${o}`,boxShadowFocus:`inset 0 0 0 1px ${o}, 0 0 0 2px ${K(o,{alpha:.3})}`,boxShadowHover:`inset 0 0 0 1px ${o}`,boxShadowDisabled:`inset 0 0 0 1px ${t}`,color:"#0000",colorDisabled:i,colorActive:"#0000",textColor:a,textColorDisabled:n,dotColorActive:o,dotColorDisabled:t,buttonBorderColor:t,buttonBorderColorActive:o,buttonBorderColorHover:o,buttonColor:"#0000",buttonColorActive:o,buttonTextColor:a,buttonTextColorActive:r,buttonTextColorHover:o,opacityDisabled:l,buttonBoxShadowFocus:`inset 0 0 0 1px ${o}, 0 0 0 2px ${K(o,{alpha:.3})}`,buttonBoxShadowHover:`inset 0 0 0 1px ${o}`,buttonBoxShadow:"inset 0 0 0 1px #0000",buttonBorderRadius:s})}};function Q1(e){const{borderColor:t,primaryColor:o,baseColor:r,textColorDisabled:n,inputColorDisabled:i,textColor2:a,opacityDisabled:l,borderRadius:s,fontSizeSmall:c,fontSizeMedium:d,fontSizeLarge:u,heightSmall:p,heightMedium:m,heightLarge:f,lineHeight:g}=e;return Object.assign(Object.assign({},af),{labelLineHeight:g,buttonHeightSmall:p,buttonHeightMedium:m,buttonHeightLarge:f,fontSizeSmall:c,fontSizeMedium:d,fontSizeLarge:u,boxShadow:`inset 0 0 0 1px ${t}`,boxShadowActive:`inset 0 0 0 1px ${o}`,boxShadowFocus:`inset 0 0 0 1px ${o}, 0 0 0 2px ${K(o,{alpha:.2})}`,boxShadowHover:`inset 0 0 0 1px ${o}`,boxShadowDisabled:`inset 0 0 0 1px ${t}`,color:r,colorDisabled:i,colorActive:"#0000",textColor:a,textColorDisabled:n,dotColorActive:o,dotColorDisabled:t,buttonBorderColor:t,buttonBorderColorActive:o,buttonBorderColorHover:t,buttonColor:r,buttonColorActive:r,buttonTextColor:a,buttonTextColorActive:o,buttonTextColorHover:o,opacityDisabled:l,buttonBoxShadowFocus:`inset 0 0 0 1px ${o}, 0 0 0 2px ${K(o,{alpha:.3})}`,buttonBoxShadowHover:"inset 0 0 0 1px #0000",buttonBoxShadow:"inset 0 0 0 1px #0000",buttonBorderRadius:s})}const eS={name:"Radio",common:Be,self:Q1},tS={thPaddingSmall:"8px",thPaddingMedium:"12px",thPaddingLarge:"12px",tdPaddingSmall:"8px",tdPaddingMedium:"12px",tdPaddingLarge:"12px",sorterSize:"15px",resizableContainerSize:"8px",resizableSize:"2px",filterSize:"15px",paginationMargin:"12px 0 0 0",emptyPadding:"48px 0",actionPadding:"8px 12px",actionButtonMargin:"0 8px 0 0"};function sf(e){const{cardColor:t,modalColor:o,popoverColor:r,textColor2:n,textColor1:i,tableHeaderColor:a,tableColorHover:l,iconColor:s,primaryColor:c,fontWeightStrong:d,borderRadius:u,lineHeight:p,fontSizeSmall:m,fontSizeMedium:f,fontSizeLarge:g,dividerColor:S,heightSmall:v,opacityDisabled:$,tableColorStriped:T}=e;return Object.assign(Object.assign({},tS),{actionDividerColor:S,lineHeight:p,borderRadius:u,fontSizeSmall:m,fontSizeMedium:f,fontSizeLarge:g,borderColor:ee(t,S),tdColorHover:ee(t,l),tdColorSorting:ee(t,l),tdColorStriped:ee(t,T),thColor:ee(t,a),thColorHover:ee(ee(t,a),l),thColorSorting:ee(ee(t,a),l),tdColor:t,tdTextColor:n,thTextColor:i,thFontWeight:d,thButtonColorHover:l,thIconColor:s,thIconColorActive:c,borderColorModal:ee(o,S),tdColorHoverModal:ee(o,l),tdColorSortingModal:ee(o,l),tdColorStripedModal:ee(o,T),thColorModal:ee(o,a),thColorHoverModal:ee(ee(o,a),l),thColorSortingModal:ee(ee(o,a),l),tdColorModal:o,borderColorPopover:ee(r,S),tdColorHoverPopover:ee(r,l),tdColorSortingPopover:ee(r,l),tdColorStripedPopover:ee(r,T),thColorPopover:ee(r,a),thColorHoverPopover:ee(ee(r,a),l),thColorSortingPopover:ee(ee(r,a),l),tdColorPopover:r,boxShadowBefore:"inset -12px 0 8px -12px rgba(0, 0, 0, .18)",boxShadowAfter:"inset 12px 0 8px -12px rgba(0, 0, 0, .18)",loadingColor:c,loadingSize:v,opacityLoading:$})}const PP={name:"DataTable",common:Be,peers:{Button:An,Checkbox:M1,Radio:eS,Pagination:G1,Scrollbar:Rn,Empty:xl,Popover:zr,Ellipsis:Z1,Dropdown:Y1},self:sf},oS={name:"DataTable",common:W,peers:{Button:wt,Checkbox:Hr,Radio:lf,Pagination:tf,Scrollbar:St,Empty:ar,Popover:lr,Ellipsis:nf,Dropdown:yl},self(e){const t=sf(e);return t.boxShadowAfter="inset 12px 0 8px -12px rgba(0, 0, 0, .36)",t.boxShadowBefore="inset -12px 0 8px -12px rgba(0, 0, 0, .36)",t}};function cf(e){const{textColorBase:t,opacity1:o,opacity2:r,opacity3:n,opacity4:i,opacity5:a}=e;return{color:t,opacity1Depth:o,opacity2Depth:r,opacity3Depth:n,opacity4Depth:i,opacity5Depth:a}}const TP={common:Be,self:cf},rS={name:"Icon",common:W,self:cf},nS={itemFontSize:"12px",itemHeight:"36px",itemWidth:"52px",panelActionPadding:"8px 0"};function df(e){const{popoverColor:t,textColor2:o,primaryColor:r,hoverColor:n,dividerColor:i,opacityDisabled:a,boxShadow2:l,borderRadius:s,iconColor:c,iconColorDisabled:d}=e;return Object.assign(Object.assign({},nS),{panelColor:t,panelBoxShadow:l,panelDividerColor:i,itemTextColor:o,itemTextColorActive:r,itemColorHover:n,itemOpacityDisabled:a,itemBorderRadius:s,borderRadius:s,iconColor:c,iconColorDisabled:d})}const iS={name:"TimePicker",common:Be,peers:{Scrollbar:Rn,Button:An,Input:ki},self:df},uf={name:"TimePicker",common:W,peers:{Scrollbar:St,Button:wt,Input:zt},self:df},aS={itemSize:"24px",itemCellWidth:"38px",itemCellHeight:"32px",scrollItemWidth:"80px",scrollItemHeight:"40px",panelExtraFooterPadding:"8px 12px",panelActionPadding:"8px 12px",calendarTitlePadding:"0",calendarTitleHeight:"28px",arrowSize:"14px",panelHeaderPadding:"8px 12px",calendarDaysHeight:"32px",calendarTitleGridTempateColumns:"28px 28px 1fr 28px 28px",calendarLeftPaddingDate:"6px 12px 4px 12px",calendarLeftPaddingDatetime:"4px 12px",calendarLeftPaddingDaterange:"6px 12px 4px 12px",calendarLeftPaddingDatetimerange:"4px 12px",calendarLeftPaddingMonth:"0",calendarLeftPaddingYear:"0",calendarLeftPaddingQuarter:"0",calendarLeftPaddingMonthrange:"0",calendarLeftPaddingQuarterrange:"0",calendarLeftPaddingYearrange:"0",calendarLeftPaddingWeek:"6px 12px 4px 12px",calendarRightPaddingDate:"6px 12px 4px 12px",calendarRightPaddingDatetime:"4px 12px",calendarRightPaddingDaterange:"6px 12px 4px 12px",calendarRightPaddingDatetimerange:"4px 12px",calendarRightPaddingMonth:"0",calendarRightPaddingYear:"0",calendarRightPaddingQuarter:"0",calendarRightPaddingMonthrange:"0",calendarRightPaddingQuarterrange:"0",calendarRightPaddingYearrange:"0",calendarRightPaddingWeek:"0"};function ff(e){const{hoverColor:t,fontSize:o,textColor2:r,textColorDisabled:n,popoverColor:i,primaryColor:a,borderRadiusSmall:l,iconColor:s,iconColorDisabled:c,textColor1:d,dividerColor:u,boxShadow2:p,borderRadius:m,fontWeightStrong:f}=e;return Object.assign(Object.assign({},aS),{itemFontSize:o,calendarDaysFontSize:o,calendarTitleFontSize:o,itemTextColor:r,itemTextColorDisabled:n,itemTextColorActive:i,itemTextColorCurrent:a,itemColorIncluded:K(a,{alpha:.1}),itemColorHover:t,itemColorDisabled:t,itemColorActive:a,itemBorderRadius:l,panelColor:i,panelTextColor:r,arrowColor:s,calendarTitleTextColor:d,calendarTitleColorHover:t,calendarDaysTextColor:r,panelHeaderDividerColor:u,calendarDaysDividerColor:u,calendarDividerColor:u,panelActionDividerColor:u,panelBoxShadow:p,panelBorderRadius:m,calendarTitleFontWeight:f,scrollItemBorderRadius:m,iconColor:s,iconColorDisabled:c})}const $P={name:"DatePicker",common:Be,peers:{Input:ki,Button:An,TimePicker:iS,Scrollbar:Rn},self:ff},lS={name:"DatePicker",common:W,peers:{Input:zt,Button:wt,TimePicker:uf,Scrollbar:St},self(e){const{popoverColor:t,hoverColor:o,primaryColor:r}=e,n=ff(e);return n.itemColorDisabled=ee(t,o),n.itemColorIncluded=K(r,{alpha:.15}),n.itemColorHover=ee(t,o),n}},sS={thPaddingBorderedSmall:"8px 12px",thPaddingBorderedMedium:"12px 16px",thPaddingBorderedLarge:"16px 24px",thPaddingSmall:"0",thPaddingMedium:"0",thPaddingLarge:"0",tdPaddingBorderedSmall:"8px 12px",tdPaddingBorderedMedium:"12px 16px",tdPaddingBorderedLarge:"16px 24px",tdPaddingSmall:"0 0 8px 0",tdPaddingMedium:"0 0 12px 0",tdPaddingLarge:"0 0 16px 0"};function cS(e){const{tableHeaderColor:t,textColor2:o,textColor1:r,cardColor:n,modalColor:i,popoverColor:a,dividerColor:l,borderRadius:s,fontWeightStrong:c,lineHeight:d,fontSizeSmall:u,fontSizeMedium:p,fontSizeLarge:m}=e;return Object.assign(Object.assign({},sS),{lineHeight:d,fontSizeSmall:u,fontSizeMedium:p,fontSizeLarge:m,titleTextColor:r,thColor:ee(n,t),thColorModal:ee(i,t),thColorPopover:ee(a,t),thTextColor:r,thFontWeight:c,tdTextColor:o,tdColor:n,tdColorModal:i,tdColorPopover:a,borderColor:ee(n,l),borderColorModal:ee(i,l),borderColorPopover:ee(a,l),borderRadius:s})}const dS={name:"Descriptions",common:W,self:cS},uS={titleFontSize:"18px",padding:"16px 28px 20px 28px",iconSize:"28px",actionSpace:"12px",contentMargin:"8px 0 16px 0",iconMargin:"0 4px 0 0",iconMarginIconTop:"4px 0 8px 0",closeSize:"22px",closeIconSize:"18px",closeMargin:"20px 26px 0 0",closeMarginIconTop:"10px 16px 0 0"};function fS(e){const{textColor1:t,textColor2:o,modalColor:r,closeIconColor:n,closeIconColorHover:i,closeIconColorPressed:a,closeColorHover:l,closeColorPressed:s,infoColor:c,successColor:d,warningColor:u,errorColor:p,primaryColor:m,dividerColor:f,borderRadius:g,fontWeightStrong:S,lineHeight:v,fontSize:$}=e;return Object.assign(Object.assign({},uS),{fontSize:$,lineHeight:v,border:`1px solid ${f}`,titleTextColor:t,textColor:o,color:r,closeColorHover:l,closeColorPressed:s,closeIconColor:n,closeIconColorHover:i,closeIconColorPressed:a,closeBorderRadius:g,iconColor:m,iconColorInfo:c,iconColorSuccess:d,iconColorWarning:u,iconColorError:p,borderRadius:g,titleFontWeight:S})}const pf={name:"Dialog",common:W,peers:{Button:wt},self:fS};function pS(e){const{modalColor:t,textColor2:o,boxShadow3:r}=e;return{color:t,textColor:o,boxShadow:r}}const hS={name:"Modal",common:W,peers:{Scrollbar:St,Dialog:pf,Card:Ku},self:pS},gS={name:"LoadingBar",common:W,self(e){const{primaryColor:t}=e;return{colorError:"red",colorLoading:t,height:"2px"}}},mS="n-message-api",hf="n-message-provider",bS={margin:"0 0 8px 0",padding:"10px 20px",maxWidth:"720px",minWidth:"420px",iconMargin:"0 10px 0 0",closeMargin:"0 0 0 10px",closeSize:"20px",closeIconSize:"16px",iconSize:"20px",fontSize:"14px"};function gf(e){const{textColor2:t,closeIconColor:o,closeIconColorHover:r,closeIconColorPressed:n,infoColor:i,successColor:a,errorColor:l,warningColor:s,popoverColor:c,boxShadow2:d,primaryColor:u,lineHeight:p,borderRadius:m,closeColorHover:f,closeColorPressed:g}=e;return Object.assign(Object.assign({},bS),{closeBorderRadius:m,textColor:t,textColorInfo:t,textColorSuccess:t,textColorError:t,textColorWarning:t,textColorLoading:t,color:c,colorInfo:c,colorSuccess:c,colorError:c,colorWarning:c,colorLoading:c,boxShadow:d,boxShadowInfo:d,boxShadowSuccess:d,boxShadowError:d,boxShadowWarning:d,boxShadowLoading:d,iconColor:t,iconColorInfo:i,iconColorSuccess:a,iconColorWarning:s,iconColorError:l,iconColorLoading:u,closeColorHover:f,closeColorPressed:g,closeIconColor:o,closeIconColorHover:r,closeIconColorPressed:n,closeColorHoverInfo:f,closeColorPressedInfo:g,closeIconColorInfo:o,closeIconColorHoverInfo:r,closeIconColorPressedInfo:n,closeColorHoverSuccess:f,closeColorPressedSuccess:g,closeIconColorSuccess:o,closeIconColorHoverSuccess:r,closeIconColorPressedSuccess:n,closeColorHoverError:f,closeColorPressedError:g,closeIconColorError:o,closeIconColorHoverError:r,closeIconColorPressedError:n,closeColorHoverWarning:f,closeColorPressedWarning:g,closeIconColorWarning:o,closeIconColorHoverWarning:r,closeIconColorPressedWarning:n,closeColorHoverLoading:f,closeColorPressedLoading:g,closeIconColorLoading:o,closeIconColorHoverLoading:r,closeIconColorPressedLoading:n,loadingColor:u,lineHeight:p,borderRadius:m})}const vS={common:Be,self:gf},xS={name:"Message",common:W,self:gf},mf={icon:Function,type:{type:String,default:"info"},content:[String,Number,Function],showIcon:{type:Boolean,default:!0},closable:Boolean,keepAliveOnHover:Boolean,onClose:Function,onMouseenter:Function,onMouseleave:Function},CS=L([pe("message-wrapper",` margin: var(--n-margin); z-index: 0; transform-origin: top center; @@ -749,12 +749,12 @@ ${t} right: 12px; justify-content: flex-end; align-items: flex-end; - `)])]),yS={info:()=>y(vy,null),success:()=>y(xy,null),warning:()=>y(Cy,null),error:()=>y(gy,null),default:()=>null},SS=He({name:"Message",props:Object.assign(Object.assign({},mf),{render:Function}),setup(e){const{inlineThemeDisabled:t,mergedRtlRef:o}=zo(e),{props:r,mergedClsPrefixRef:n}=Le(hf),i=$n("Message",o,n),a=Ct("Message","-message",CS,vS,r,n),l=Y(()=>{const{type:c}=e,{common:{cubicBezierEaseInOut:d},self:{padding:u,margin:p,maxWidth:m,iconMargin:f,closeMargin:g,closeSize:S,iconSize:v,fontSize:$,lineHeight:T,borderRadius:w,iconColorInfo:_,iconColorSuccess:O,iconColorWarning:x,iconColorError:F,iconColorLoading:R,closeIconSize:B,closeBorderRadius:j,[ae("textColor",c)]:A,[ae("boxShadow",c)]:J,[ae("color",c)]:G,[ae("closeColorHover",c)]:le,[ae("closeColorPressed",c)]:te,[ae("closeIconColor",c)]:N,[ae("closeIconColorPressed",c)]:oe,[ae("closeIconColorHover",c)]:ye}}=a.value;return{"--n-bezier":d,"--n-margin":p,"--n-padding":u,"--n-max-width":m,"--n-font-size":$,"--n-icon-margin":f,"--n-icon-size":v,"--n-close-icon-size":B,"--n-close-border-radius":j,"--n-close-size":S,"--n-close-margin":g,"--n-text-color":A,"--n-color":G,"--n-box-shadow":J,"--n-icon-color-info":_,"--n-icon-color-success":O,"--n-icon-color-warning":x,"--n-icon-color-error":F,"--n-icon-color-loading":R,"--n-close-color-hover":le,"--n-close-color-pressed":te,"--n-close-icon-color":N,"--n-close-icon-color-pressed":oe,"--n-close-icon-color-hover":ye,"--n-line-height":T,"--n-border-radius":w}}),s=t?Fr("message",Y(()=>e.type[0]),l,{}):void 0;return{mergedClsPrefix:n,rtlEnabled:i,messageProviderProps:r,handleClose(){var c;(c=e.onClose)===null||c===void 0||c.call(e)},cssVars:t?void 0:l,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender,placement:r.placement}},render(){const{render:e,type:t,closable:o,content:r,mergedClsPrefix:n,cssVars:i,themeClass:a,onRender:l,icon:s,handleClose:c,showIcon:d}=this;l==null||l();let u;return y("div",{class:[`${n}-message-wrapper`,a],onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave,style:[{alignItems:this.placement.startsWith("top")?"flex-start":"flex-end"},i]},e?e(this.$props):y("div",{class:[`${n}-message ${n}-message--${t}-type`,this.rtlEnabled&&`${n}-message--rtl`]},(u=wS(s,t,n))&&d?y("div",{class:`${n}-message__icon ${n}-message__icon--${t}-type`},y(Hi,null,{default:()=>u})):null,y("div",{class:`${n}-message__content`},Ab(r)),o?y(Iu,{clsPrefix:n,class:`${n}-message__close`,onClick:c,absolute:!0}):null))}});function wS(e,t,o){if(typeof e=="function")return e();{const r=t==="loading"?y(vl,{clsPrefix:o,strokeWidth:24,scale:.85}):yS[t]();return r?y(Tr,{clsPrefix:o,key:t},{default:()=>r}):null}}const PS=He({name:"MessageEnvironment",props:Object.assign(Object.assign({},mf),{duration:{type:Number,default:3e3},onAfterLeave:Function,onLeave:Function,internalKey:{type:String,required:!0},onInternalAfterLeave:Function,onHide:Function,onAfterHide:Function}),setup(e){let t=null;const o=fe(!0);Mo(()=>{r()});function r(){const{duration:d}=e;d&&(t=window.setTimeout(a,d))}function n(d){d.currentTarget===d.target&&t!==null&&(window.clearTimeout(t),t=null)}function i(d){d.currentTarget===d.target&&r()}function a(){const{onHide:d}=e;o.value=!1,t&&(window.clearTimeout(t),t=null),d&&d()}function l(){const{onClose:d}=e;d&&d(),a()}function s(){const{onAfterLeave:d,onInternalAfterLeave:u,onAfterHide:p,internalKey:m}=e;d&&d(),u&&u(m),p&&p()}function c(){a()}return{show:o,hide:a,handleClose:l,handleAfterLeave:s,handleMouseleave:i,handleMouseenter:n,deactivate:c}},render(){return y(_u,{appear:!0,onAfterLeave:this.handleAfterLeave,onLeave:this.onLeave},{default:()=>[this.show?y(SS,{content:this.content,type:this.type,icon:this.icon,showIcon:this.showIcon,closable:this.closable,onClose:this.handleClose,onMouseenter:this.keepAliveOnHover?this.handleMouseenter:void 0,onMouseleave:this.keepAliveOnHover?this.handleMouseleave:void 0}):null]})}}),TS=Object.assign(Object.assign({},Ct.props),{to:[String,Object],duration:{type:Number,default:3e3},keepAliveOnHover:Boolean,max:Number,placement:{type:String,default:"top"},closable:Boolean,containerClass:String,containerStyle:[String,Object]}),RP=He({name:"MessageProvider",props:TS,setup(e){const{mergedClsPrefixRef:t}=zo(e),o=fe([]),r=fe({}),n={create(s,c){return i(s,Object.assign({type:"default"},c))},info(s,c){return i(s,Object.assign(Object.assign({},c),{type:"info"}))},success(s,c){return i(s,Object.assign(Object.assign({},c),{type:"success"}))},warning(s,c){return i(s,Object.assign(Object.assign({},c),{type:"warning"}))},error(s,c){return i(s,Object.assign(Object.assign({},c),{type:"error"}))},loading(s,c){return i(s,Object.assign(Object.assign({},c),{type:"loading"}))},destroyAll:l};po(hf,{props:e,mergedClsPrefixRef:t}),po(mS,n);function i(s,c){const d=$a(),u=Ci(Object.assign(Object.assign({},c),{content:s,key:d,destroy:()=>{var m;(m=r.value[d])===null||m===void 0||m.hide()}})),{max:p}=e;return p&&o.value.length>=p&&o.value.shift(),o.value.push(u),u}function a(s){o.value.splice(o.value.findIndex(c=>c.key===s),1),delete r.value[s]}function l(){Object.values(r.value).forEach(s=>{s.hide()})}return Object.assign({mergedClsPrefix:t,messageRefs:r,messageList:o,handleAfterLeave:a},n)},render(){var e,t,o;return y(et,null,(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e),this.messageList.length?y(ch,{to:(o=this.to)!==null&&o!==void 0?o:"body"},y("div",{class:[`${this.mergedClsPrefix}-message-container`,`${this.mergedClsPrefix}-message-container--${this.placement}`,this.containerClass],key:"message-container",style:this.containerStyle},this.messageList.map(r=>y(PS,Object.assign({ref:n=>{n&&(this.messageRefs[r.key]=n)},internalKey:r.key,onInternalAfterLeave:this.handleAfterLeave},Fb(r,["destroy"],void 0),{duration:r.duration===void 0?this.duration:r.duration,keepAliveOnHover:r.keepAliveOnHover===void 0?this.keepAliveOnHover:r.keepAliveOnHover,closable:r.closable===void 0?this.closable:r.closable}))))):null)}}),$S={closeMargin:"16px 12px",closeSize:"20px",closeIconSize:"16px",width:"365px",padding:"16px",titleFontSize:"16px",metaFontSize:"12px",descriptionFontSize:"12px"};function RS(e){const{textColor2:t,successColor:o,infoColor:r,warningColor:n,errorColor:i,popoverColor:a,closeIconColor:l,closeIconColorHover:s,closeIconColorPressed:c,closeColorHover:d,closeColorPressed:u,textColor1:p,textColor3:m,borderRadius:f,fontWeightStrong:g,boxShadow2:S,lineHeight:v,fontSize:$}=e;return Object.assign(Object.assign({},$S),{borderRadius:f,lineHeight:v,fontSize:$,headerFontWeight:g,iconColor:t,iconColorSuccess:o,iconColorInfo:r,iconColorWarning:n,iconColorError:i,color:a,textColor:t,closeIconColor:l,closeIconColorHover:s,closeIconColorPressed:c,closeBorderRadius:f,closeColorHover:d,closeColorPressed:u,headerTextColor:p,descriptionTextColor:m,actionTextColor:t,boxShadow:S})}const FS={name:"Notification",common:W,peers:{Scrollbar:St},self:RS};function AS(e){const{textColor1:t,dividerColor:o,fontWeightStrong:r}=e;return{textColor:t,color:o,fontWeight:r}}const IS={name:"Divider",common:W,self:AS};function _S(e){const{modalColor:t,textColor1:o,textColor2:r,boxShadow3:n,lineHeight:i,fontWeightStrong:a,dividerColor:l,closeColorHover:s,closeColorPressed:c,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,borderRadius:m,primaryColorHover:f}=e;return{bodyPadding:"16px 24px",borderRadius:m,headerPadding:"16px 24px",footerPadding:"16px 24px",color:t,textColor:r,titleTextColor:o,titleFontSize:"18px",titleFontWeight:a,boxShadow:n,lineHeight:i,headerBorderBottom:`1px solid ${l}`,footerBorderTop:`1px solid ${l}`,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,closeSize:"22px",closeIconSize:"18px",closeColorHover:s,closeColorPressed:c,closeBorderRadius:m,resizableTriggerColorHover:f}}const ES={name:"Drawer",common:W,peers:{Scrollbar:St},self:_S},MS={actionMargin:"0 0 0 20px",actionMarginRtl:"0 20px 0 0"},zS={name:"DynamicInput",common:W,peers:{Input:zt,Button:wt},self(){return MS}},HS={gapSmall:"4px 8px",gapMedium:"8px 12px",gapLarge:"12px 16px"},bf={name:"Space",self(){return HS}},kS={name:"DynamicTags",common:W,peers:{Input:zt,Button:wt,Tag:Lu,Space:bf},self(){return{inputWidth:"64px"}}},DS={name:"Element",common:W},OS={gapSmall:"4px 8px",gapMedium:"8px 12px",gapLarge:"12px 16px"},BS={name:"Flex",self(){return OS}},LS={name:"ButtonGroup",common:W},WS={feedbackPadding:"4px 0 0 2px",feedbackHeightSmall:"24px",feedbackHeightMedium:"24px",feedbackHeightLarge:"26px",feedbackFontSizeSmall:"13px",feedbackFontSizeMedium:"14px",feedbackFontSizeLarge:"14px",labelFontSizeLeftSmall:"14px",labelFontSizeLeftMedium:"14px",labelFontSizeLeftLarge:"15px",labelFontSizeTopSmall:"13px",labelFontSizeTopMedium:"14px",labelFontSizeTopLarge:"14px",labelHeightSmall:"24px",labelHeightMedium:"26px",labelHeightLarge:"28px",labelPaddingVertical:"0 0 6px 2px",labelPaddingHorizontal:"0 12px 0 0",labelTextAlignVertical:"left",labelTextAlignHorizontal:"right",labelFontWeight:"400"};function vf(e){const{heightSmall:t,heightMedium:o,heightLarge:r,textColor1:n,errorColor:i,warningColor:a,lineHeight:l,textColor3:s}=e;return Object.assign(Object.assign({},WS),{blankHeightSmall:t,blankHeightMedium:o,blankHeightLarge:r,lineHeight:l,labelTextColor:n,asteriskColor:i,feedbackTextColorError:i,feedbackTextColorWarning:a,feedbackTextColor:s})}const xf={common:Be,self:vf},jS={name:"Form",common:W,self:vf},NS={name:"GradientText",common:W,self(e){const{primaryColor:t,successColor:o,warningColor:r,errorColor:n,infoColor:i,primaryColorSuppl:a,successColorSuppl:l,warningColorSuppl:s,errorColorSuppl:c,infoColorSuppl:d,fontWeightStrong:u}=e;return{fontWeight:u,rotate:"252deg",colorStartPrimary:t,colorEndPrimary:a,colorStartInfo:i,colorEndInfo:d,colorStartWarning:r,colorEndWarning:s,colorStartError:n,colorEndError:c,colorStartSuccess:o,colorEndSuccess:l}}},VS={name:"InputNumber",common:W,peers:{Button:wt,Input:zt},self(e){const{textColorDisabled:t}=e;return{iconColorDisabled:t}}},US={name:"Layout",common:W,peers:{Scrollbar:St},self(e){const{textColor2:t,bodyColor:o,popoverColor:r,cardColor:n,dividerColor:i,scrollbarColor:a,scrollbarColorHover:l}=e;return{textColor:t,textColorInverted:t,color:o,colorEmbedded:o,headerColor:n,headerColorInverted:n,footerColor:n,footerColorInverted:n,headerBorderColor:i,headerBorderColorInverted:i,footerBorderColor:i,footerBorderColorInverted:i,siderBorderColor:i,siderBorderColorInverted:i,siderColor:n,siderColorInverted:n,siderToggleButtonBorder:"1px solid transparent",siderToggleButtonColor:r,siderToggleButtonIconColor:t,siderToggleButtonIconColorInverted:t,siderToggleBarColor:ee(o,a),siderToggleBarColorHover:ee(o,l),__invertScrollbar:"false"}}},qS={name:"Row",common:W};function GS(e){const{textColor2:t,cardColor:o,modalColor:r,popoverColor:n,dividerColor:i,borderRadius:a,fontSize:l,hoverColor:s}=e;return{textColor:t,color:o,colorHover:s,colorModal:r,colorHoverModal:ee(r,s),colorPopover:n,colorHoverPopover:ee(n,s),borderColor:i,borderColorModal:ee(r,i),borderColorPopover:ee(n,i),borderRadius:a,fontSize:l}}const KS={name:"List",common:W,self:GS},YS={name:"Log",common:W,peers:{Scrollbar:St,Code:Xu},self(e){const{textColor2:t,inputColor:o,fontSize:r,primaryColor:n}=e;return{loaderFontSize:r,loaderTextColor:t,loaderColor:o,loaderBorder:"1px solid #0000",loadingColor:n}}},XS={name:"Mention",common:W,peers:{InternalSelectMenu:Fn,Input:zt},self(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}};function JS(e,t,o,r){return{itemColorHoverInverted:"#0000",itemColorActiveInverted:t,itemColorActiveHoverInverted:t,itemColorActiveCollapsedInverted:t,itemTextColorInverted:e,itemTextColorHoverInverted:o,itemTextColorChildActiveInverted:o,itemTextColorChildActiveHoverInverted:o,itemTextColorActiveInverted:o,itemTextColorActiveHoverInverted:o,itemTextColorHorizontalInverted:e,itemTextColorHoverHorizontalInverted:o,itemTextColorChildActiveHorizontalInverted:o,itemTextColorChildActiveHoverHorizontalInverted:o,itemTextColorActiveHorizontalInverted:o,itemTextColorActiveHoverHorizontalInverted:o,itemIconColorInverted:e,itemIconColorHoverInverted:o,itemIconColorActiveInverted:o,itemIconColorActiveHoverInverted:o,itemIconColorChildActiveInverted:o,itemIconColorChildActiveHoverInverted:o,itemIconColorCollapsedInverted:e,itemIconColorHorizontalInverted:e,itemIconColorHoverHorizontalInverted:o,itemIconColorActiveHorizontalInverted:o,itemIconColorActiveHoverHorizontalInverted:o,itemIconColorChildActiveHorizontalInverted:o,itemIconColorChildActiveHoverHorizontalInverted:o,arrowColorInverted:e,arrowColorHoverInverted:o,arrowColorActiveInverted:o,arrowColorActiveHoverInverted:o,arrowColorChildActiveInverted:o,arrowColorChildActiveHoverInverted:o,groupTextColorInverted:r}}function ZS(e){const{borderRadius:t,textColor3:o,primaryColor:r,textColor2:n,textColor1:i,fontSize:a,dividerColor:l,hoverColor:s,primaryColorHover:c}=e;return Object.assign({borderRadius:t,color:"#0000",groupTextColor:o,itemColorHover:s,itemColorActive:K(r,{alpha:.1}),itemColorActiveHover:K(r,{alpha:.1}),itemColorActiveCollapsed:K(r,{alpha:.1}),itemTextColor:n,itemTextColorHover:n,itemTextColorActive:r,itemTextColorActiveHover:r,itemTextColorChildActive:r,itemTextColorChildActiveHover:r,itemTextColorHorizontal:n,itemTextColorHoverHorizontal:c,itemTextColorActiveHorizontal:r,itemTextColorActiveHoverHorizontal:r,itemTextColorChildActiveHorizontal:r,itemTextColorChildActiveHoverHorizontal:r,itemIconColor:i,itemIconColorHover:i,itemIconColorActive:r,itemIconColorActiveHover:r,itemIconColorChildActive:r,itemIconColorChildActiveHover:r,itemIconColorCollapsed:i,itemIconColorHorizontal:i,itemIconColorHoverHorizontal:c,itemIconColorActiveHorizontal:r,itemIconColorActiveHoverHorizontal:r,itemIconColorChildActiveHorizontal:r,itemIconColorChildActiveHoverHorizontal:r,itemHeight:"42px",arrowColor:n,arrowColorHover:n,arrowColorActive:r,arrowColorActiveHover:r,arrowColorChildActive:r,arrowColorChildActiveHover:r,colorInverted:"#0000",borderColorHorizontal:"#0000",fontSize:a,dividerColor:l},JS("#BBB",r,"#FFF","#AAA"))}const QS={name:"Menu",common:W,peers:{Tooltip:Di,Dropdown:yl},self(e){const{primaryColor:t,primaryColorSuppl:o}=e,r=ZS(e);return r.itemColorActive=K(t,{alpha:.15}),r.itemColorActiveHover=K(t,{alpha:.15}),r.itemColorActiveCollapsed=K(t,{alpha:.15}),r.itemColorActiveInverted=o,r.itemColorActiveHoverInverted=o,r.itemColorActiveCollapsedInverted=o,r}},ew={titleFontSize:"18px",backSize:"22px"};function tw(e){const{textColor1:t,textColor2:o,textColor3:r,fontSize:n,fontWeightStrong:i,primaryColorHover:a,primaryColorPressed:l}=e;return Object.assign(Object.assign({},ew),{titleFontWeight:i,fontSize:n,titleTextColor:t,backColor:o,backColorHover:a,backColorPressed:l,subtitleTextColor:r})}const ow={name:"PageHeader",common:W,self:tw},rw={iconSize:"22px"};function Cf(e){const{fontSize:t,warningColor:o}=e;return Object.assign(Object.assign({},rw),{fontSize:t,iconColor:o})}const FP={name:"Popconfirm",common:Be,peers:{Button:An,Popover:zr},self:Cf},nw={name:"Popconfirm",common:W,peers:{Button:wt,Popover:lr},self:Cf};function iw(e){const{infoColor:t,successColor:o,warningColor:r,errorColor:n,textColor2:i,progressRailColor:a,fontSize:l,fontWeight:s}=e;return{fontSize:l,fontSizeCircle:"28px",fontWeightCircle:s,railColor:a,railHeight:"8px",iconSizeCircle:"36px",iconSizeLine:"18px",iconColor:t,iconColorInfo:t,iconColorSuccess:o,iconColorWarning:r,iconColorError:n,textColorCircle:i,textColorLineInner:"rgb(255, 255, 255)",textColorLineOuter:i,fillColor:t,fillColorInfo:t,fillColorSuccess:o,fillColorWarning:r,fillColorError:n,lineBgProcessing:"linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)"}}const yf={name:"Progress",common:W,self(e){const t=iw(e);return t.textColorLineInner="rgb(0, 0, 0)",t.lineBgProcessing="linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)",t}},aw={name:"Rate",common:W,self(e){const{railColor:t}=e;return{itemColor:t,itemColorActive:"#CCAA33",itemSize:"20px",sizeSmall:"16px",sizeMedium:"20px",sizeLarge:"24px"}}},lw={titleFontSizeSmall:"26px",titleFontSizeMedium:"32px",titleFontSizeLarge:"40px",titleFontSizeHuge:"48px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",iconSizeSmall:"64px",iconSizeMedium:"80px",iconSizeLarge:"100px",iconSizeHuge:"125px",iconColor418:void 0,iconColor404:void 0,iconColor403:void 0,iconColor500:void 0};function sw(e){const{textColor2:t,textColor1:o,errorColor:r,successColor:n,infoColor:i,warningColor:a,lineHeight:l,fontWeightStrong:s}=e;return Object.assign(Object.assign({},lw),{lineHeight:l,titleFontWeight:s,titleTextColor:o,textColor:t,iconColorError:r,iconColorSuccess:n,iconColorInfo:i,iconColorWarning:a})}const cw={name:"Result",common:W,self:sw},dw={railHeight:"4px",railWidthVertical:"4px",handleSize:"18px",dotHeight:"8px",dotWidth:"8px",dotBorderRadius:"4px"},uw={name:"Slider",common:W,self(e){const t="0 2px 8px 0 rgba(0, 0, 0, 0.12)",{railColor:o,modalColor:r,primaryColorSuppl:n,popoverColor:i,textColor2:a,cardColor:l,borderRadius:s,fontSize:c,opacityDisabled:d}=e;return Object.assign(Object.assign({},dw),{fontSize:c,markFontSize:c,railColor:o,railColorHover:o,fillColor:n,fillColorHover:n,opacityDisabled:d,handleColor:"#FFF",dotColor:l,dotColorModal:r,dotColorPopover:i,handleBoxShadow:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowHover:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowActive:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowFocus:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",indicatorColor:i,indicatorBoxShadow:t,indicatorTextColor:a,indicatorBorderRadius:s,dotBorder:`2px solid ${o}`,dotBorderActive:`2px solid ${n}`,dotBoxShadow:""})}};function Sf(e){const{opacityDisabled:t,heightTiny:o,heightSmall:r,heightMedium:n,heightLarge:i,heightHuge:a,primaryColor:l,fontSize:s}=e;return{fontSize:s,textColor:l,sizeTiny:o,sizeSmall:r,sizeMedium:n,sizeLarge:i,sizeHuge:a,color:l,opacitySpinning:t}}const AP={common:Be,self:Sf},fw={name:"Spin",common:W,self:Sf};function pw(e){const{textColor2:t,textColor3:o,fontSize:r,fontWeight:n}=e;return{labelFontSize:r,labelFontWeight:n,valueFontWeight:n,valueFontSize:"24px",labelTextColor:o,valuePrefixTextColor:t,valueSuffixTextColor:t,valueTextColor:t}}const hw={name:"Statistic",common:W,self:pw},gw={stepHeaderFontSizeSmall:"14px",stepHeaderFontSizeMedium:"16px",indicatorIndexFontSizeSmall:"14px",indicatorIndexFontSizeMedium:"16px",indicatorSizeSmall:"22px",indicatorSizeMedium:"28px",indicatorIconSizeSmall:"14px",indicatorIconSizeMedium:"18px"};function mw(e){const{fontWeightStrong:t,baseColor:o,textColorDisabled:r,primaryColor:n,errorColor:i,textColor1:a,textColor2:l}=e;return Object.assign(Object.assign({},gw),{stepHeaderFontWeight:t,indicatorTextColorProcess:o,indicatorTextColorWait:r,indicatorTextColorFinish:n,indicatorTextColorError:i,indicatorBorderColorProcess:n,indicatorBorderColorWait:r,indicatorBorderColorFinish:n,indicatorBorderColorError:i,indicatorColorProcess:n,indicatorColorWait:"#0000",indicatorColorFinish:"#0000",indicatorColorError:"#0000",splitorColorProcess:r,splitorColorWait:r,splitorColorFinish:n,splitorColorError:r,headerTextColorProcess:a,headerTextColorWait:r,headerTextColorFinish:r,headerTextColorError:i,descriptionTextColorProcess:l,descriptionTextColorWait:r,descriptionTextColorFinish:r,descriptionTextColorError:i})}const bw={name:"Steps",common:W,self:mw},vw={buttonHeightSmall:"14px",buttonHeightMedium:"18px",buttonHeightLarge:"22px",buttonWidthSmall:"14px",buttonWidthMedium:"18px",buttonWidthLarge:"22px",buttonWidthPressedSmall:"20px",buttonWidthPressedMedium:"24px",buttonWidthPressedLarge:"28px",railHeightSmall:"18px",railHeightMedium:"22px",railHeightLarge:"26px",railWidthSmall:"32px",railWidthMedium:"40px",railWidthLarge:"48px"},xw={name:"Switch",common:W,self(e){const{primaryColorSuppl:t,opacityDisabled:o,borderRadius:r,primaryColor:n,textColor2:i,baseColor:a}=e;return Object.assign(Object.assign({},vw),{iconColor:a,textColor:i,loadingColor:t,opacityDisabled:o,railColor:"rgba(255, 255, 255, .20)",railColorActive:t,buttonBoxShadow:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",buttonColor:"#FFF",railBorderRadiusSmall:r,railBorderRadiusMedium:r,railBorderRadiusLarge:r,buttonBorderRadiusSmall:r,buttonBorderRadiusMedium:r,buttonBorderRadiusLarge:r,boxShadowFocus:`0 0 8px 0 ${K(n,{alpha:.3})}`})}},Cw={thPaddingSmall:"6px",thPaddingMedium:"12px",thPaddingLarge:"12px",tdPaddingSmall:"6px",tdPaddingMedium:"12px",tdPaddingLarge:"12px"};function yw(e){const{dividerColor:t,cardColor:o,modalColor:r,popoverColor:n,tableHeaderColor:i,tableColorStriped:a,textColor1:l,textColor2:s,borderRadius:c,fontWeightStrong:d,lineHeight:u,fontSizeSmall:p,fontSizeMedium:m,fontSizeLarge:f}=e;return Object.assign(Object.assign({},Cw),{fontSizeSmall:p,fontSizeMedium:m,fontSizeLarge:f,lineHeight:u,borderRadius:c,borderColor:ee(o,t),borderColorModal:ee(r,t),borderColorPopover:ee(n,t),tdColor:o,tdColorModal:r,tdColorPopover:n,tdColorStriped:ee(o,a),tdColorStripedModal:ee(r,a),tdColorStripedPopover:ee(n,a),thColor:ee(o,i),thColorModal:ee(r,i),thColorPopover:ee(n,i),thTextColor:l,tdTextColor:s,thFontWeight:d})}const Sw={name:"Table",common:W,self:yw},ww={tabFontSizeSmall:"14px",tabFontSizeMedium:"14px",tabFontSizeLarge:"16px",tabGapSmallLine:"36px",tabGapMediumLine:"36px",tabGapLargeLine:"36px",tabGapSmallLineVertical:"8px",tabGapMediumLineVertical:"8px",tabGapLargeLineVertical:"8px",tabPaddingSmallLine:"6px 0",tabPaddingMediumLine:"10px 0",tabPaddingLargeLine:"14px 0",tabPaddingVerticalSmallLine:"6px 12px",tabPaddingVerticalMediumLine:"8px 16px",tabPaddingVerticalLargeLine:"10px 20px",tabGapSmallBar:"36px",tabGapMediumBar:"36px",tabGapLargeBar:"36px",tabGapSmallBarVertical:"8px",tabGapMediumBarVertical:"8px",tabGapLargeBarVertical:"8px",tabPaddingSmallBar:"4px 0",tabPaddingMediumBar:"6px 0",tabPaddingLargeBar:"10px 0",tabPaddingVerticalSmallBar:"6px 12px",tabPaddingVerticalMediumBar:"8px 16px",tabPaddingVerticalLargeBar:"10px 20px",tabGapSmallCard:"4px",tabGapMediumCard:"4px",tabGapLargeCard:"4px",tabGapSmallCardVertical:"4px",tabGapMediumCardVertical:"4px",tabGapLargeCardVertical:"4px",tabPaddingSmallCard:"8px 16px",tabPaddingMediumCard:"10px 20px",tabPaddingLargeCard:"12px 24px",tabPaddingSmallSegment:"4px 0",tabPaddingMediumSegment:"6px 0",tabPaddingLargeSegment:"8px 0",tabPaddingVerticalLargeSegment:"0 8px",tabPaddingVerticalSmallCard:"8px 12px",tabPaddingVerticalMediumCard:"10px 16px",tabPaddingVerticalLargeCard:"12px 20px",tabPaddingVerticalSmallSegment:"0 4px",tabPaddingVerticalMediumSegment:"0 6px",tabGapSmallSegment:"0",tabGapMediumSegment:"0",tabGapLargeSegment:"0",tabGapSmallSegmentVertical:"0",tabGapMediumSegmentVertical:"0",tabGapLargeSegmentVertical:"0",panePaddingSmall:"8px 0 0 0",panePaddingMedium:"12px 0 0 0",panePaddingLarge:"16px 0 0 0",closeSize:"18px",closeIconSize:"14px"};function Pw(e){const{textColor2:t,primaryColor:o,textColorDisabled:r,closeIconColor:n,closeIconColorHover:i,closeIconColorPressed:a,closeColorHover:l,closeColorPressed:s,tabColor:c,baseColor:d,dividerColor:u,fontWeight:p,textColor1:m,borderRadius:f,fontSize:g,fontWeightStrong:S}=e;return Object.assign(Object.assign({},ww),{colorSegment:c,tabFontSizeCard:g,tabTextColorLine:m,tabTextColorActiveLine:o,tabTextColorHoverLine:o,tabTextColorDisabledLine:r,tabTextColorSegment:m,tabTextColorActiveSegment:t,tabTextColorHoverSegment:t,tabTextColorDisabledSegment:r,tabTextColorBar:m,tabTextColorActiveBar:o,tabTextColorHoverBar:o,tabTextColorDisabledBar:r,tabTextColorCard:m,tabTextColorHoverCard:m,tabTextColorActiveCard:o,tabTextColorDisabledCard:r,barColor:o,closeIconColor:n,closeIconColorHover:i,closeIconColorPressed:a,closeColorHover:l,closeColorPressed:s,closeBorderRadius:f,tabColor:c,tabColorSegment:d,tabBorderColor:u,tabFontWeightActive:p,tabFontWeight:p,tabBorderRadius:f,paneTextColor:t,fontWeightStrong:S})}const Tw={name:"Tabs",common:W,self(e){const t=Pw(e),{inputColor:o}=e;return t.colorSegment=o,t.tabColorSegment=o,t}};function $w(e){const{textColor1:t,textColor2:o,fontWeightStrong:r,fontSize:n}=e;return{fontSize:n,titleTextColor:t,textColor:o,titleFontWeight:r}}const Rw={name:"Thing",common:W,self:$w},Fw={titleMarginMedium:"0 0 6px 0",titleMarginLarge:"-2px 0 6px 0",titleFontSizeMedium:"14px",titleFontSizeLarge:"16px",iconSizeMedium:"14px",iconSizeLarge:"14px"},Aw={name:"Timeline",common:W,self(e){const{textColor3:t,infoColorSuppl:o,errorColorSuppl:r,successColorSuppl:n,warningColorSuppl:i,textColor1:a,textColor2:l,railColor:s,fontWeightStrong:c,fontSize:d}=e;return Object.assign(Object.assign({},Fw),{contentFontSize:d,titleFontWeight:c,circleBorder:`2px solid ${t}`,circleBorderInfo:`2px solid ${o}`,circleBorderError:`2px solid ${r}`,circleBorderSuccess:`2px solid ${n}`,circleBorderWarning:`2px solid ${i}`,iconColor:t,iconColorInfo:o,iconColorError:r,iconColorSuccess:n,iconColorWarning:i,titleTextColor:a,contentTextColor:l,metaTextColor:t,lineColor:s})}},Iw={extraFontSizeSmall:"12px",extraFontSizeMedium:"12px",extraFontSizeLarge:"14px",titleFontSizeSmall:"14px",titleFontSizeMedium:"16px",titleFontSizeLarge:"16px",closeSize:"20px",closeIconSize:"16px",headerHeightSmall:"44px",headerHeightMedium:"44px",headerHeightLarge:"50px"},_w={name:"Transfer",common:W,peers:{Checkbox:Hr,Scrollbar:St,Input:zt,Empty:ar,Button:wt},self(e){const{fontWeight:t,fontSizeLarge:o,fontSizeMedium:r,fontSizeSmall:n,heightLarge:i,heightMedium:a,borderRadius:l,inputColor:s,tableHeaderColor:c,textColor1:d,textColorDisabled:u,textColor2:p,textColor3:m,hoverColor:f,closeColorHover:g,closeColorPressed:S,closeIconColor:v,closeIconColorHover:$,closeIconColorPressed:T,dividerColor:w}=e;return Object.assign(Object.assign({},Iw),{itemHeightSmall:a,itemHeightMedium:a,itemHeightLarge:i,fontSizeSmall:n,fontSizeMedium:r,fontSizeLarge:o,borderRadius:l,dividerColor:w,borderColor:"#0000",listColor:s,headerColor:c,titleTextColor:d,titleTextColorDisabled:u,extraTextColor:m,extraTextColorDisabled:u,itemTextColor:p,itemTextColorDisabled:u,itemColorPending:f,titleFontWeight:t,closeColorHover:g,closeColorPressed:S,closeIconColor:v,closeIconColorHover:$,closeIconColorPressed:T})}};function Ew(e){const{borderRadiusSmall:t,dividerColor:o,hoverColor:r,pressedColor:n,primaryColor:i,textColor3:a,textColor2:l,textColorDisabled:s,fontSize:c}=e;return{fontSize:c,lineHeight:"1.5",nodeHeight:"30px",nodeWrapperPadding:"3px 0",nodeBorderRadius:t,nodeColorHover:r,nodeColorPressed:n,nodeColorActive:K(i,{alpha:.1}),arrowColor:a,nodeTextColor:l,nodeTextColorDisabled:s,loadingColor:i,dropMarkColor:i,lineColor:o}}const wf={name:"Tree",common:W,peers:{Checkbox:Hr,Scrollbar:St,Empty:ar},self(e){const{primaryColor:t}=e,o=Ew(e);return o.nodeColorActive=K(t,{alpha:.15}),o}},Mw={name:"TreeSelect",common:W,peers:{Tree:wf,Empty:ar,InternalSelection:Cl}},zw={headerFontSize1:"30px",headerFontSize2:"22px",headerFontSize3:"18px",headerFontSize4:"16px",headerFontSize5:"16px",headerFontSize6:"16px",headerMargin1:"28px 0 20px 0",headerMargin2:"28px 0 20px 0",headerMargin3:"28px 0 20px 0",headerMargin4:"28px 0 18px 0",headerMargin5:"28px 0 18px 0",headerMargin6:"28px 0 18px 0",headerPrefixWidth1:"16px",headerPrefixWidth2:"16px",headerPrefixWidth3:"12px",headerPrefixWidth4:"12px",headerPrefixWidth5:"12px",headerPrefixWidth6:"12px",headerBarWidth1:"4px",headerBarWidth2:"4px",headerBarWidth3:"3px",headerBarWidth4:"3px",headerBarWidth5:"3px",headerBarWidth6:"3px",pMargin:"16px 0 16px 0",liMargin:".25em 0 0 0",olPadding:"0 0 0 2em",ulPadding:"0 0 0 2em"};function Hw(e){const{primaryColor:t,textColor2:o,borderColor:r,lineHeight:n,fontSize:i,borderRadiusSmall:a,dividerColor:l,fontWeightStrong:s,textColor1:c,textColor3:d,infoColor:u,warningColor:p,errorColor:m,successColor:f,codeColor:g}=e;return Object.assign(Object.assign({},zw),{aTextColor:t,blockquoteTextColor:o,blockquotePrefixColor:r,blockquoteLineHeight:n,blockquoteFontSize:i,codeBorderRadius:a,liTextColor:o,liLineHeight:n,liFontSize:i,hrColor:l,headerFontWeight:s,headerTextColor:c,pTextColor:o,pTextColor1Depth:c,pTextColor2Depth:o,pTextColor3Depth:d,pLineHeight:n,pFontSize:i,headerBarColor:t,headerBarColorPrimary:t,headerBarColorInfo:u,headerBarColorError:m,headerBarColorWarning:p,headerBarColorSuccess:f,textColor:o,textColor1Depth:c,textColor2Depth:o,textColor3Depth:d,textColorPrimary:t,textColorInfo:u,textColorSuccess:f,textColorWarning:p,textColorError:m,codeTextColor:o,codeColor:g,codeBorder:"1px solid #0000"})}const kw={name:"Typography",common:W,self:Hw};function Dw(e){const{iconColor:t,primaryColor:o,errorColor:r,textColor2:n,successColor:i,opacityDisabled:a,actionColor:l,borderColor:s,hoverColor:c,lineHeight:d,borderRadius:u,fontSize:p}=e;return{fontSize:p,lineHeight:d,borderRadius:u,draggerColor:l,draggerBorder:`1px dashed ${s}`,draggerBorderHover:`1px dashed ${o}`,itemColorHover:c,itemColorHoverError:K(r,{alpha:.06}),itemTextColor:n,itemTextColorError:r,itemTextColorSuccess:i,itemIconColor:t,itemDisabledOpacity:a,itemBorderImageCardError:`1px solid ${r}`,itemBorderImageCard:`1px solid ${s}`}}const Ow={name:"Upload",common:W,peers:{Button:wt,Progress:yf},self(e){const{errorColor:t}=e,o=Dw(e);return o.itemColorHoverError=K(t,{alpha:.09}),o}},Bw={name:"Watermark",common:W,self(e){const{fontFamily:t}=e;return{fontFamily:t}}},Lw={name:"FloatButton",common:W,self(e){const{popoverColor:t,textColor2:o,buttonColor2Hover:r,buttonColor2Pressed:n,primaryColor:i,primaryColorHover:a,primaryColorPressed:l,baseColor:s,borderRadius:c}=e;return{color:t,textColor:o,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .18)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .18)",colorHover:r,colorPressed:n,colorPrimary:i,colorPrimaryHover:a,colorPrimaryPressed:l,textColorPrimary:s,borderRadiusSquare:c}}},In="n-form",Pf="n-form-item-insts",Ww=pe("form",[re("inline",` + `)])]),yS={info:()=>y(vy,null),success:()=>y(xy,null),warning:()=>y(Cy,null),error:()=>y(gy,null),default:()=>null},SS=He({name:"Message",props:Object.assign(Object.assign({},mf),{render:Function}),setup(e){const{inlineThemeDisabled:t,mergedRtlRef:o}=zo(e),{props:r,mergedClsPrefixRef:n}=Le(hf),i=$n("Message",o,n),a=Ct("Message","-message",CS,vS,r,n),l=Y(()=>{const{type:c}=e,{common:{cubicBezierEaseInOut:d},self:{padding:u,margin:p,maxWidth:m,iconMargin:f,closeMargin:g,closeSize:S,iconSize:v,fontSize:$,lineHeight:T,borderRadius:w,iconColorInfo:E,iconColorSuccess:O,iconColorWarning:x,iconColorError:F,iconColorLoading:R,closeIconSize:B,closeBorderRadius:j,[ae("textColor",c)]:A,[ae("boxShadow",c)]:J,[ae("color",c)]:G,[ae("closeColorHover",c)]:le,[ae("closeColorPressed",c)]:te,[ae("closeIconColor",c)]:N,[ae("closeIconColorPressed",c)]:oe,[ae("closeIconColorHover",c)]:ye}}=a.value;return{"--n-bezier":d,"--n-margin":p,"--n-padding":u,"--n-max-width":m,"--n-font-size":$,"--n-icon-margin":f,"--n-icon-size":v,"--n-close-icon-size":B,"--n-close-border-radius":j,"--n-close-size":S,"--n-close-margin":g,"--n-text-color":A,"--n-color":G,"--n-box-shadow":J,"--n-icon-color-info":E,"--n-icon-color-success":O,"--n-icon-color-warning":x,"--n-icon-color-error":F,"--n-icon-color-loading":R,"--n-close-color-hover":le,"--n-close-color-pressed":te,"--n-close-icon-color":N,"--n-close-icon-color-pressed":oe,"--n-close-icon-color-hover":ye,"--n-line-height":T,"--n-border-radius":w}}),s=t?Fr("message",Y(()=>e.type[0]),l,{}):void 0;return{mergedClsPrefix:n,rtlEnabled:i,messageProviderProps:r,handleClose(){var c;(c=e.onClose)===null||c===void 0||c.call(e)},cssVars:t?void 0:l,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender,placement:r.placement}},render(){const{render:e,type:t,closable:o,content:r,mergedClsPrefix:n,cssVars:i,themeClass:a,onRender:l,icon:s,handleClose:c,showIcon:d}=this;l==null||l();let u;return y("div",{class:[`${n}-message-wrapper`,a],onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave,style:[{alignItems:this.placement.startsWith("top")?"flex-start":"flex-end"},i]},e?e(this.$props):y("div",{class:[`${n}-message ${n}-message--${t}-type`,this.rtlEnabled&&`${n}-message--rtl`]},(u=wS(s,t,n))&&d?y("div",{class:`${n}-message__icon ${n}-message__icon--${t}-type`},y(Hi,null,{default:()=>u})):null,y("div",{class:`${n}-message__content`},Ab(r)),o?y(Iu,{clsPrefix:n,class:`${n}-message__close`,onClick:c,absolute:!0}):null))}});function wS(e,t,o){if(typeof e=="function")return e();{const r=t==="loading"?y(vl,{clsPrefix:o,strokeWidth:24,scale:.85}):yS[t]();return r?y(Tr,{clsPrefix:o,key:t},{default:()=>r}):null}}const PS=He({name:"MessageEnvironment",props:Object.assign(Object.assign({},mf),{duration:{type:Number,default:3e3},onAfterLeave:Function,onLeave:Function,internalKey:{type:String,required:!0},onInternalAfterLeave:Function,onHide:Function,onAfterHide:Function}),setup(e){let t=null;const o=fe(!0);Mo(()=>{r()});function r(){const{duration:d}=e;d&&(t=window.setTimeout(a,d))}function n(d){d.currentTarget===d.target&&t!==null&&(window.clearTimeout(t),t=null)}function i(d){d.currentTarget===d.target&&r()}function a(){const{onHide:d}=e;o.value=!1,t&&(window.clearTimeout(t),t=null),d&&d()}function l(){const{onClose:d}=e;d&&d(),a()}function s(){const{onAfterLeave:d,onInternalAfterLeave:u,onAfterHide:p,internalKey:m}=e;d&&d(),u&&u(m),p&&p()}function c(){a()}return{show:o,hide:a,handleClose:l,handleAfterLeave:s,handleMouseleave:i,handleMouseenter:n,deactivate:c}},render(){return y(Eu,{appear:!0,onAfterLeave:this.handleAfterLeave,onLeave:this.onLeave},{default:()=>[this.show?y(SS,{content:this.content,type:this.type,icon:this.icon,showIcon:this.showIcon,closable:this.closable,onClose:this.handleClose,onMouseenter:this.keepAliveOnHover?this.handleMouseenter:void 0,onMouseleave:this.keepAliveOnHover?this.handleMouseleave:void 0}):null]})}}),TS=Object.assign(Object.assign({},Ct.props),{to:[String,Object],duration:{type:Number,default:3e3},keepAliveOnHover:Boolean,max:Number,placement:{type:String,default:"top"},closable:Boolean,containerClass:String,containerStyle:[String,Object]}),RP=He({name:"MessageProvider",props:TS,setup(e){const{mergedClsPrefixRef:t}=zo(e),o=fe([]),r=fe({}),n={create(s,c){return i(s,Object.assign({type:"default"},c))},info(s,c){return i(s,Object.assign(Object.assign({},c),{type:"info"}))},success(s,c){return i(s,Object.assign(Object.assign({},c),{type:"success"}))},warning(s,c){return i(s,Object.assign(Object.assign({},c),{type:"warning"}))},error(s,c){return i(s,Object.assign(Object.assign({},c),{type:"error"}))},loading(s,c){return i(s,Object.assign(Object.assign({},c),{type:"loading"}))},destroyAll:l};po(hf,{props:e,mergedClsPrefixRef:t}),po(mS,n);function i(s,c){const d=$a(),u=Ci(Object.assign(Object.assign({},c),{content:s,key:d,destroy:()=>{var m;(m=r.value[d])===null||m===void 0||m.hide()}})),{max:p}=e;return p&&o.value.length>=p&&o.value.shift(),o.value.push(u),u}function a(s){o.value.splice(o.value.findIndex(c=>c.key===s),1),delete r.value[s]}function l(){Object.values(r.value).forEach(s=>{s.hide()})}return Object.assign({mergedClsPrefix:t,messageRefs:r,messageList:o,handleAfterLeave:a},n)},render(){var e,t,o;return y(et,null,(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e),this.messageList.length?y(ch,{to:(o=this.to)!==null&&o!==void 0?o:"body"},y("div",{class:[`${this.mergedClsPrefix}-message-container`,`${this.mergedClsPrefix}-message-container--${this.placement}`,this.containerClass],key:"message-container",style:this.containerStyle},this.messageList.map(r=>y(PS,Object.assign({ref:n=>{n&&(this.messageRefs[r.key]=n)},internalKey:r.key,onInternalAfterLeave:this.handleAfterLeave},Fb(r,["destroy"],void 0),{duration:r.duration===void 0?this.duration:r.duration,keepAliveOnHover:r.keepAliveOnHover===void 0?this.keepAliveOnHover:r.keepAliveOnHover,closable:r.closable===void 0?this.closable:r.closable}))))):null)}}),$S={closeMargin:"16px 12px",closeSize:"20px",closeIconSize:"16px",width:"365px",padding:"16px",titleFontSize:"16px",metaFontSize:"12px",descriptionFontSize:"12px"};function RS(e){const{textColor2:t,successColor:o,infoColor:r,warningColor:n,errorColor:i,popoverColor:a,closeIconColor:l,closeIconColorHover:s,closeIconColorPressed:c,closeColorHover:d,closeColorPressed:u,textColor1:p,textColor3:m,borderRadius:f,fontWeightStrong:g,boxShadow2:S,lineHeight:v,fontSize:$}=e;return Object.assign(Object.assign({},$S),{borderRadius:f,lineHeight:v,fontSize:$,headerFontWeight:g,iconColor:t,iconColorSuccess:o,iconColorInfo:r,iconColorWarning:n,iconColorError:i,color:a,textColor:t,closeIconColor:l,closeIconColorHover:s,closeIconColorPressed:c,closeBorderRadius:f,closeColorHover:d,closeColorPressed:u,headerTextColor:p,descriptionTextColor:m,actionTextColor:t,boxShadow:S})}const FS={name:"Notification",common:W,peers:{Scrollbar:St},self:RS};function AS(e){const{textColor1:t,dividerColor:o,fontWeightStrong:r}=e;return{textColor:t,color:o,fontWeight:r}}const IS={name:"Divider",common:W,self:AS};function ES(e){const{modalColor:t,textColor1:o,textColor2:r,boxShadow3:n,lineHeight:i,fontWeightStrong:a,dividerColor:l,closeColorHover:s,closeColorPressed:c,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,borderRadius:m,primaryColorHover:f}=e;return{bodyPadding:"16px 24px",borderRadius:m,headerPadding:"16px 24px",footerPadding:"16px 24px",color:t,textColor:r,titleTextColor:o,titleFontSize:"18px",titleFontWeight:a,boxShadow:n,lineHeight:i,headerBorderBottom:`1px solid ${l}`,footerBorderTop:`1px solid ${l}`,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,closeSize:"22px",closeIconSize:"18px",closeColorHover:s,closeColorPressed:c,closeBorderRadius:m,resizableTriggerColorHover:f}}const _S={name:"Drawer",common:W,peers:{Scrollbar:St},self:ES},MS={actionMargin:"0 0 0 20px",actionMarginRtl:"0 20px 0 0"},zS={name:"DynamicInput",common:W,peers:{Input:zt,Button:wt},self(){return MS}},HS={gapSmall:"4px 8px",gapMedium:"8px 12px",gapLarge:"12px 16px"},bf={name:"Space",self(){return HS}},kS={name:"DynamicTags",common:W,peers:{Input:zt,Button:wt,Tag:Lu,Space:bf},self(){return{inputWidth:"64px"}}},DS={name:"Element",common:W},OS={gapSmall:"4px 8px",gapMedium:"8px 12px",gapLarge:"12px 16px"},BS={name:"Flex",self(){return OS}},LS={name:"ButtonGroup",common:W},WS={feedbackPadding:"4px 0 0 2px",feedbackHeightSmall:"24px",feedbackHeightMedium:"24px",feedbackHeightLarge:"26px",feedbackFontSizeSmall:"13px",feedbackFontSizeMedium:"14px",feedbackFontSizeLarge:"14px",labelFontSizeLeftSmall:"14px",labelFontSizeLeftMedium:"14px",labelFontSizeLeftLarge:"15px",labelFontSizeTopSmall:"13px",labelFontSizeTopMedium:"14px",labelFontSizeTopLarge:"14px",labelHeightSmall:"24px",labelHeightMedium:"26px",labelHeightLarge:"28px",labelPaddingVertical:"0 0 6px 2px",labelPaddingHorizontal:"0 12px 0 0",labelTextAlignVertical:"left",labelTextAlignHorizontal:"right",labelFontWeight:"400"};function vf(e){const{heightSmall:t,heightMedium:o,heightLarge:r,textColor1:n,errorColor:i,warningColor:a,lineHeight:l,textColor3:s}=e;return Object.assign(Object.assign({},WS),{blankHeightSmall:t,blankHeightMedium:o,blankHeightLarge:r,lineHeight:l,labelTextColor:n,asteriskColor:i,feedbackTextColorError:i,feedbackTextColorWarning:a,feedbackTextColor:s})}const xf={common:Be,self:vf},jS={name:"Form",common:W,self:vf},NS={name:"GradientText",common:W,self(e){const{primaryColor:t,successColor:o,warningColor:r,errorColor:n,infoColor:i,primaryColorSuppl:a,successColorSuppl:l,warningColorSuppl:s,errorColorSuppl:c,infoColorSuppl:d,fontWeightStrong:u}=e;return{fontWeight:u,rotate:"252deg",colorStartPrimary:t,colorEndPrimary:a,colorStartInfo:i,colorEndInfo:d,colorStartWarning:r,colorEndWarning:s,colorStartError:n,colorEndError:c,colorStartSuccess:o,colorEndSuccess:l}}},VS={name:"InputNumber",common:W,peers:{Button:wt,Input:zt},self(e){const{textColorDisabled:t}=e;return{iconColorDisabled:t}}},US={name:"Layout",common:W,peers:{Scrollbar:St},self(e){const{textColor2:t,bodyColor:o,popoverColor:r,cardColor:n,dividerColor:i,scrollbarColor:a,scrollbarColorHover:l}=e;return{textColor:t,textColorInverted:t,color:o,colorEmbedded:o,headerColor:n,headerColorInverted:n,footerColor:n,footerColorInverted:n,headerBorderColor:i,headerBorderColorInverted:i,footerBorderColor:i,footerBorderColorInverted:i,siderBorderColor:i,siderBorderColorInverted:i,siderColor:n,siderColorInverted:n,siderToggleButtonBorder:"1px solid transparent",siderToggleButtonColor:r,siderToggleButtonIconColor:t,siderToggleButtonIconColorInverted:t,siderToggleBarColor:ee(o,a),siderToggleBarColorHover:ee(o,l),__invertScrollbar:"false"}}},qS={name:"Row",common:W};function GS(e){const{textColor2:t,cardColor:o,modalColor:r,popoverColor:n,dividerColor:i,borderRadius:a,fontSize:l,hoverColor:s}=e;return{textColor:t,color:o,colorHover:s,colorModal:r,colorHoverModal:ee(r,s),colorPopover:n,colorHoverPopover:ee(n,s),borderColor:i,borderColorModal:ee(r,i),borderColorPopover:ee(n,i),borderRadius:a,fontSize:l}}const KS={name:"List",common:W,self:GS},YS={name:"Log",common:W,peers:{Scrollbar:St,Code:Xu},self(e){const{textColor2:t,inputColor:o,fontSize:r,primaryColor:n}=e;return{loaderFontSize:r,loaderTextColor:t,loaderColor:o,loaderBorder:"1px solid #0000",loadingColor:n}}},XS={name:"Mention",common:W,peers:{InternalSelectMenu:Fn,Input:zt},self(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}};function JS(e,t,o,r){return{itemColorHoverInverted:"#0000",itemColorActiveInverted:t,itemColorActiveHoverInverted:t,itemColorActiveCollapsedInverted:t,itemTextColorInverted:e,itemTextColorHoverInverted:o,itemTextColorChildActiveInverted:o,itemTextColorChildActiveHoverInverted:o,itemTextColorActiveInverted:o,itemTextColorActiveHoverInverted:o,itemTextColorHorizontalInverted:e,itemTextColorHoverHorizontalInverted:o,itemTextColorChildActiveHorizontalInverted:o,itemTextColorChildActiveHoverHorizontalInverted:o,itemTextColorActiveHorizontalInverted:o,itemTextColorActiveHoverHorizontalInverted:o,itemIconColorInverted:e,itemIconColorHoverInverted:o,itemIconColorActiveInverted:o,itemIconColorActiveHoverInverted:o,itemIconColorChildActiveInverted:o,itemIconColorChildActiveHoverInverted:o,itemIconColorCollapsedInverted:e,itemIconColorHorizontalInverted:e,itemIconColorHoverHorizontalInverted:o,itemIconColorActiveHorizontalInverted:o,itemIconColorActiveHoverHorizontalInverted:o,itemIconColorChildActiveHorizontalInverted:o,itemIconColorChildActiveHoverHorizontalInverted:o,arrowColorInverted:e,arrowColorHoverInverted:o,arrowColorActiveInverted:o,arrowColorActiveHoverInverted:o,arrowColorChildActiveInverted:o,arrowColorChildActiveHoverInverted:o,groupTextColorInverted:r}}function ZS(e){const{borderRadius:t,textColor3:o,primaryColor:r,textColor2:n,textColor1:i,fontSize:a,dividerColor:l,hoverColor:s,primaryColorHover:c}=e;return Object.assign({borderRadius:t,color:"#0000",groupTextColor:o,itemColorHover:s,itemColorActive:K(r,{alpha:.1}),itemColorActiveHover:K(r,{alpha:.1}),itemColorActiveCollapsed:K(r,{alpha:.1}),itemTextColor:n,itemTextColorHover:n,itemTextColorActive:r,itemTextColorActiveHover:r,itemTextColorChildActive:r,itemTextColorChildActiveHover:r,itemTextColorHorizontal:n,itemTextColorHoverHorizontal:c,itemTextColorActiveHorizontal:r,itemTextColorActiveHoverHorizontal:r,itemTextColorChildActiveHorizontal:r,itemTextColorChildActiveHoverHorizontal:r,itemIconColor:i,itemIconColorHover:i,itemIconColorActive:r,itemIconColorActiveHover:r,itemIconColorChildActive:r,itemIconColorChildActiveHover:r,itemIconColorCollapsed:i,itemIconColorHorizontal:i,itemIconColorHoverHorizontal:c,itemIconColorActiveHorizontal:r,itemIconColorActiveHoverHorizontal:r,itemIconColorChildActiveHorizontal:r,itemIconColorChildActiveHoverHorizontal:r,itemHeight:"42px",arrowColor:n,arrowColorHover:n,arrowColorActive:r,arrowColorActiveHover:r,arrowColorChildActive:r,arrowColorChildActiveHover:r,colorInverted:"#0000",borderColorHorizontal:"#0000",fontSize:a,dividerColor:l},JS("#BBB",r,"#FFF","#AAA"))}const QS={name:"Menu",common:W,peers:{Tooltip:Di,Dropdown:yl},self(e){const{primaryColor:t,primaryColorSuppl:o}=e,r=ZS(e);return r.itemColorActive=K(t,{alpha:.15}),r.itemColorActiveHover=K(t,{alpha:.15}),r.itemColorActiveCollapsed=K(t,{alpha:.15}),r.itemColorActiveInverted=o,r.itemColorActiveHoverInverted=o,r.itemColorActiveCollapsedInverted=o,r}},ew={titleFontSize:"18px",backSize:"22px"};function tw(e){const{textColor1:t,textColor2:o,textColor3:r,fontSize:n,fontWeightStrong:i,primaryColorHover:a,primaryColorPressed:l}=e;return Object.assign(Object.assign({},ew),{titleFontWeight:i,fontSize:n,titleTextColor:t,backColor:o,backColorHover:a,backColorPressed:l,subtitleTextColor:r})}const ow={name:"PageHeader",common:W,self:tw},rw={iconSize:"22px"};function Cf(e){const{fontSize:t,warningColor:o}=e;return Object.assign(Object.assign({},rw),{fontSize:t,iconColor:o})}const FP={name:"Popconfirm",common:Be,peers:{Button:An,Popover:zr},self:Cf},nw={name:"Popconfirm",common:W,peers:{Button:wt,Popover:lr},self:Cf};function iw(e){const{infoColor:t,successColor:o,warningColor:r,errorColor:n,textColor2:i,progressRailColor:a,fontSize:l,fontWeight:s}=e;return{fontSize:l,fontSizeCircle:"28px",fontWeightCircle:s,railColor:a,railHeight:"8px",iconSizeCircle:"36px",iconSizeLine:"18px",iconColor:t,iconColorInfo:t,iconColorSuccess:o,iconColorWarning:r,iconColorError:n,textColorCircle:i,textColorLineInner:"rgb(255, 255, 255)",textColorLineOuter:i,fillColor:t,fillColorInfo:t,fillColorSuccess:o,fillColorWarning:r,fillColorError:n,lineBgProcessing:"linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)"}}const yf={name:"Progress",common:W,self(e){const t=iw(e);return t.textColorLineInner="rgb(0, 0, 0)",t.lineBgProcessing="linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)",t}},aw={name:"Rate",common:W,self(e){const{railColor:t}=e;return{itemColor:t,itemColorActive:"#CCAA33",itemSize:"20px",sizeSmall:"16px",sizeMedium:"20px",sizeLarge:"24px"}}},lw={titleFontSizeSmall:"26px",titleFontSizeMedium:"32px",titleFontSizeLarge:"40px",titleFontSizeHuge:"48px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",iconSizeSmall:"64px",iconSizeMedium:"80px",iconSizeLarge:"100px",iconSizeHuge:"125px",iconColor418:void 0,iconColor404:void 0,iconColor403:void 0,iconColor500:void 0};function sw(e){const{textColor2:t,textColor1:o,errorColor:r,successColor:n,infoColor:i,warningColor:a,lineHeight:l,fontWeightStrong:s}=e;return Object.assign(Object.assign({},lw),{lineHeight:l,titleFontWeight:s,titleTextColor:o,textColor:t,iconColorError:r,iconColorSuccess:n,iconColorInfo:i,iconColorWarning:a})}const cw={name:"Result",common:W,self:sw},dw={railHeight:"4px",railWidthVertical:"4px",handleSize:"18px",dotHeight:"8px",dotWidth:"8px",dotBorderRadius:"4px"},uw={name:"Slider",common:W,self(e){const t="0 2px 8px 0 rgba(0, 0, 0, 0.12)",{railColor:o,modalColor:r,primaryColorSuppl:n,popoverColor:i,textColor2:a,cardColor:l,borderRadius:s,fontSize:c,opacityDisabled:d}=e;return Object.assign(Object.assign({},dw),{fontSize:c,markFontSize:c,railColor:o,railColorHover:o,fillColor:n,fillColorHover:n,opacityDisabled:d,handleColor:"#FFF",dotColor:l,dotColorModal:r,dotColorPopover:i,handleBoxShadow:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowHover:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowActive:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowFocus:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",indicatorColor:i,indicatorBoxShadow:t,indicatorTextColor:a,indicatorBorderRadius:s,dotBorder:`2px solid ${o}`,dotBorderActive:`2px solid ${n}`,dotBoxShadow:""})}};function Sf(e){const{opacityDisabled:t,heightTiny:o,heightSmall:r,heightMedium:n,heightLarge:i,heightHuge:a,primaryColor:l,fontSize:s}=e;return{fontSize:s,textColor:l,sizeTiny:o,sizeSmall:r,sizeMedium:n,sizeLarge:i,sizeHuge:a,color:l,opacitySpinning:t}}const AP={common:Be,self:Sf},fw={name:"Spin",common:W,self:Sf};function pw(e){const{textColor2:t,textColor3:o,fontSize:r,fontWeight:n}=e;return{labelFontSize:r,labelFontWeight:n,valueFontWeight:n,valueFontSize:"24px",labelTextColor:o,valuePrefixTextColor:t,valueSuffixTextColor:t,valueTextColor:t}}const hw={name:"Statistic",common:W,self:pw},gw={stepHeaderFontSizeSmall:"14px",stepHeaderFontSizeMedium:"16px",indicatorIndexFontSizeSmall:"14px",indicatorIndexFontSizeMedium:"16px",indicatorSizeSmall:"22px",indicatorSizeMedium:"28px",indicatorIconSizeSmall:"14px",indicatorIconSizeMedium:"18px"};function mw(e){const{fontWeightStrong:t,baseColor:o,textColorDisabled:r,primaryColor:n,errorColor:i,textColor1:a,textColor2:l}=e;return Object.assign(Object.assign({},gw),{stepHeaderFontWeight:t,indicatorTextColorProcess:o,indicatorTextColorWait:r,indicatorTextColorFinish:n,indicatorTextColorError:i,indicatorBorderColorProcess:n,indicatorBorderColorWait:r,indicatorBorderColorFinish:n,indicatorBorderColorError:i,indicatorColorProcess:n,indicatorColorWait:"#0000",indicatorColorFinish:"#0000",indicatorColorError:"#0000",splitorColorProcess:r,splitorColorWait:r,splitorColorFinish:n,splitorColorError:r,headerTextColorProcess:a,headerTextColorWait:r,headerTextColorFinish:r,headerTextColorError:i,descriptionTextColorProcess:l,descriptionTextColorWait:r,descriptionTextColorFinish:r,descriptionTextColorError:i})}const bw={name:"Steps",common:W,self:mw},vw={buttonHeightSmall:"14px",buttonHeightMedium:"18px",buttonHeightLarge:"22px",buttonWidthSmall:"14px",buttonWidthMedium:"18px",buttonWidthLarge:"22px",buttonWidthPressedSmall:"20px",buttonWidthPressedMedium:"24px",buttonWidthPressedLarge:"28px",railHeightSmall:"18px",railHeightMedium:"22px",railHeightLarge:"26px",railWidthSmall:"32px",railWidthMedium:"40px",railWidthLarge:"48px"},xw={name:"Switch",common:W,self(e){const{primaryColorSuppl:t,opacityDisabled:o,borderRadius:r,primaryColor:n,textColor2:i,baseColor:a}=e;return Object.assign(Object.assign({},vw),{iconColor:a,textColor:i,loadingColor:t,opacityDisabled:o,railColor:"rgba(255, 255, 255, .20)",railColorActive:t,buttonBoxShadow:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",buttonColor:"#FFF",railBorderRadiusSmall:r,railBorderRadiusMedium:r,railBorderRadiusLarge:r,buttonBorderRadiusSmall:r,buttonBorderRadiusMedium:r,buttonBorderRadiusLarge:r,boxShadowFocus:`0 0 8px 0 ${K(n,{alpha:.3})}`})}},Cw={thPaddingSmall:"6px",thPaddingMedium:"12px",thPaddingLarge:"12px",tdPaddingSmall:"6px",tdPaddingMedium:"12px",tdPaddingLarge:"12px"};function yw(e){const{dividerColor:t,cardColor:o,modalColor:r,popoverColor:n,tableHeaderColor:i,tableColorStriped:a,textColor1:l,textColor2:s,borderRadius:c,fontWeightStrong:d,lineHeight:u,fontSizeSmall:p,fontSizeMedium:m,fontSizeLarge:f}=e;return Object.assign(Object.assign({},Cw),{fontSizeSmall:p,fontSizeMedium:m,fontSizeLarge:f,lineHeight:u,borderRadius:c,borderColor:ee(o,t),borderColorModal:ee(r,t),borderColorPopover:ee(n,t),tdColor:o,tdColorModal:r,tdColorPopover:n,tdColorStriped:ee(o,a),tdColorStripedModal:ee(r,a),tdColorStripedPopover:ee(n,a),thColor:ee(o,i),thColorModal:ee(r,i),thColorPopover:ee(n,i),thTextColor:l,tdTextColor:s,thFontWeight:d})}const Sw={name:"Table",common:W,self:yw},ww={tabFontSizeSmall:"14px",tabFontSizeMedium:"14px",tabFontSizeLarge:"16px",tabGapSmallLine:"36px",tabGapMediumLine:"36px",tabGapLargeLine:"36px",tabGapSmallLineVertical:"8px",tabGapMediumLineVertical:"8px",tabGapLargeLineVertical:"8px",tabPaddingSmallLine:"6px 0",tabPaddingMediumLine:"10px 0",tabPaddingLargeLine:"14px 0",tabPaddingVerticalSmallLine:"6px 12px",tabPaddingVerticalMediumLine:"8px 16px",tabPaddingVerticalLargeLine:"10px 20px",tabGapSmallBar:"36px",tabGapMediumBar:"36px",tabGapLargeBar:"36px",tabGapSmallBarVertical:"8px",tabGapMediumBarVertical:"8px",tabGapLargeBarVertical:"8px",tabPaddingSmallBar:"4px 0",tabPaddingMediumBar:"6px 0",tabPaddingLargeBar:"10px 0",tabPaddingVerticalSmallBar:"6px 12px",tabPaddingVerticalMediumBar:"8px 16px",tabPaddingVerticalLargeBar:"10px 20px",tabGapSmallCard:"4px",tabGapMediumCard:"4px",tabGapLargeCard:"4px",tabGapSmallCardVertical:"4px",tabGapMediumCardVertical:"4px",tabGapLargeCardVertical:"4px",tabPaddingSmallCard:"8px 16px",tabPaddingMediumCard:"10px 20px",tabPaddingLargeCard:"12px 24px",tabPaddingSmallSegment:"4px 0",tabPaddingMediumSegment:"6px 0",tabPaddingLargeSegment:"8px 0",tabPaddingVerticalLargeSegment:"0 8px",tabPaddingVerticalSmallCard:"8px 12px",tabPaddingVerticalMediumCard:"10px 16px",tabPaddingVerticalLargeCard:"12px 20px",tabPaddingVerticalSmallSegment:"0 4px",tabPaddingVerticalMediumSegment:"0 6px",tabGapSmallSegment:"0",tabGapMediumSegment:"0",tabGapLargeSegment:"0",tabGapSmallSegmentVertical:"0",tabGapMediumSegmentVertical:"0",tabGapLargeSegmentVertical:"0",panePaddingSmall:"8px 0 0 0",panePaddingMedium:"12px 0 0 0",panePaddingLarge:"16px 0 0 0",closeSize:"18px",closeIconSize:"14px"};function Pw(e){const{textColor2:t,primaryColor:o,textColorDisabled:r,closeIconColor:n,closeIconColorHover:i,closeIconColorPressed:a,closeColorHover:l,closeColorPressed:s,tabColor:c,baseColor:d,dividerColor:u,fontWeight:p,textColor1:m,borderRadius:f,fontSize:g,fontWeightStrong:S}=e;return Object.assign(Object.assign({},ww),{colorSegment:c,tabFontSizeCard:g,tabTextColorLine:m,tabTextColorActiveLine:o,tabTextColorHoverLine:o,tabTextColorDisabledLine:r,tabTextColorSegment:m,tabTextColorActiveSegment:t,tabTextColorHoverSegment:t,tabTextColorDisabledSegment:r,tabTextColorBar:m,tabTextColorActiveBar:o,tabTextColorHoverBar:o,tabTextColorDisabledBar:r,tabTextColorCard:m,tabTextColorHoverCard:m,tabTextColorActiveCard:o,tabTextColorDisabledCard:r,barColor:o,closeIconColor:n,closeIconColorHover:i,closeIconColorPressed:a,closeColorHover:l,closeColorPressed:s,closeBorderRadius:f,tabColor:c,tabColorSegment:d,tabBorderColor:u,tabFontWeightActive:p,tabFontWeight:p,tabBorderRadius:f,paneTextColor:t,fontWeightStrong:S})}const Tw={name:"Tabs",common:W,self(e){const t=Pw(e),{inputColor:o}=e;return t.colorSegment=o,t.tabColorSegment=o,t}};function $w(e){const{textColor1:t,textColor2:o,fontWeightStrong:r,fontSize:n}=e;return{fontSize:n,titleTextColor:t,textColor:o,titleFontWeight:r}}const Rw={name:"Thing",common:W,self:$w},Fw={titleMarginMedium:"0 0 6px 0",titleMarginLarge:"-2px 0 6px 0",titleFontSizeMedium:"14px",titleFontSizeLarge:"16px",iconSizeMedium:"14px",iconSizeLarge:"14px"},Aw={name:"Timeline",common:W,self(e){const{textColor3:t,infoColorSuppl:o,errorColorSuppl:r,successColorSuppl:n,warningColorSuppl:i,textColor1:a,textColor2:l,railColor:s,fontWeightStrong:c,fontSize:d}=e;return Object.assign(Object.assign({},Fw),{contentFontSize:d,titleFontWeight:c,circleBorder:`2px solid ${t}`,circleBorderInfo:`2px solid ${o}`,circleBorderError:`2px solid ${r}`,circleBorderSuccess:`2px solid ${n}`,circleBorderWarning:`2px solid ${i}`,iconColor:t,iconColorInfo:o,iconColorError:r,iconColorSuccess:n,iconColorWarning:i,titleTextColor:a,contentTextColor:l,metaTextColor:t,lineColor:s})}},Iw={extraFontSizeSmall:"12px",extraFontSizeMedium:"12px",extraFontSizeLarge:"14px",titleFontSizeSmall:"14px",titleFontSizeMedium:"16px",titleFontSizeLarge:"16px",closeSize:"20px",closeIconSize:"16px",headerHeightSmall:"44px",headerHeightMedium:"44px",headerHeightLarge:"50px"},Ew={name:"Transfer",common:W,peers:{Checkbox:Hr,Scrollbar:St,Input:zt,Empty:ar,Button:wt},self(e){const{fontWeight:t,fontSizeLarge:o,fontSizeMedium:r,fontSizeSmall:n,heightLarge:i,heightMedium:a,borderRadius:l,inputColor:s,tableHeaderColor:c,textColor1:d,textColorDisabled:u,textColor2:p,textColor3:m,hoverColor:f,closeColorHover:g,closeColorPressed:S,closeIconColor:v,closeIconColorHover:$,closeIconColorPressed:T,dividerColor:w}=e;return Object.assign(Object.assign({},Iw),{itemHeightSmall:a,itemHeightMedium:a,itemHeightLarge:i,fontSizeSmall:n,fontSizeMedium:r,fontSizeLarge:o,borderRadius:l,dividerColor:w,borderColor:"#0000",listColor:s,headerColor:c,titleTextColor:d,titleTextColorDisabled:u,extraTextColor:m,extraTextColorDisabled:u,itemTextColor:p,itemTextColorDisabled:u,itemColorPending:f,titleFontWeight:t,closeColorHover:g,closeColorPressed:S,closeIconColor:v,closeIconColorHover:$,closeIconColorPressed:T})}};function _w(e){const{borderRadiusSmall:t,dividerColor:o,hoverColor:r,pressedColor:n,primaryColor:i,textColor3:a,textColor2:l,textColorDisabled:s,fontSize:c}=e;return{fontSize:c,lineHeight:"1.5",nodeHeight:"30px",nodeWrapperPadding:"3px 0",nodeBorderRadius:t,nodeColorHover:r,nodeColorPressed:n,nodeColorActive:K(i,{alpha:.1}),arrowColor:a,nodeTextColor:l,nodeTextColorDisabled:s,loadingColor:i,dropMarkColor:i,lineColor:o}}const wf={name:"Tree",common:W,peers:{Checkbox:Hr,Scrollbar:St,Empty:ar},self(e){const{primaryColor:t}=e,o=_w(e);return o.nodeColorActive=K(t,{alpha:.15}),o}},Mw={name:"TreeSelect",common:W,peers:{Tree:wf,Empty:ar,InternalSelection:Cl}},zw={headerFontSize1:"30px",headerFontSize2:"22px",headerFontSize3:"18px",headerFontSize4:"16px",headerFontSize5:"16px",headerFontSize6:"16px",headerMargin1:"28px 0 20px 0",headerMargin2:"28px 0 20px 0",headerMargin3:"28px 0 20px 0",headerMargin4:"28px 0 18px 0",headerMargin5:"28px 0 18px 0",headerMargin6:"28px 0 18px 0",headerPrefixWidth1:"16px",headerPrefixWidth2:"16px",headerPrefixWidth3:"12px",headerPrefixWidth4:"12px",headerPrefixWidth5:"12px",headerPrefixWidth6:"12px",headerBarWidth1:"4px",headerBarWidth2:"4px",headerBarWidth3:"3px",headerBarWidth4:"3px",headerBarWidth5:"3px",headerBarWidth6:"3px",pMargin:"16px 0 16px 0",liMargin:".25em 0 0 0",olPadding:"0 0 0 2em",ulPadding:"0 0 0 2em"};function Hw(e){const{primaryColor:t,textColor2:o,borderColor:r,lineHeight:n,fontSize:i,borderRadiusSmall:a,dividerColor:l,fontWeightStrong:s,textColor1:c,textColor3:d,infoColor:u,warningColor:p,errorColor:m,successColor:f,codeColor:g}=e;return Object.assign(Object.assign({},zw),{aTextColor:t,blockquoteTextColor:o,blockquotePrefixColor:r,blockquoteLineHeight:n,blockquoteFontSize:i,codeBorderRadius:a,liTextColor:o,liLineHeight:n,liFontSize:i,hrColor:l,headerFontWeight:s,headerTextColor:c,pTextColor:o,pTextColor1Depth:c,pTextColor2Depth:o,pTextColor3Depth:d,pLineHeight:n,pFontSize:i,headerBarColor:t,headerBarColorPrimary:t,headerBarColorInfo:u,headerBarColorError:m,headerBarColorWarning:p,headerBarColorSuccess:f,textColor:o,textColor1Depth:c,textColor2Depth:o,textColor3Depth:d,textColorPrimary:t,textColorInfo:u,textColorSuccess:f,textColorWarning:p,textColorError:m,codeTextColor:o,codeColor:g,codeBorder:"1px solid #0000"})}const kw={name:"Typography",common:W,self:Hw};function Dw(e){const{iconColor:t,primaryColor:o,errorColor:r,textColor2:n,successColor:i,opacityDisabled:a,actionColor:l,borderColor:s,hoverColor:c,lineHeight:d,borderRadius:u,fontSize:p}=e;return{fontSize:p,lineHeight:d,borderRadius:u,draggerColor:l,draggerBorder:`1px dashed ${s}`,draggerBorderHover:`1px dashed ${o}`,itemColorHover:c,itemColorHoverError:K(r,{alpha:.06}),itemTextColor:n,itemTextColorError:r,itemTextColorSuccess:i,itemIconColor:t,itemDisabledOpacity:a,itemBorderImageCardError:`1px solid ${r}`,itemBorderImageCard:`1px solid ${s}`}}const Ow={name:"Upload",common:W,peers:{Button:wt,Progress:yf},self(e){const{errorColor:t}=e,o=Dw(e);return o.itemColorHoverError=K(t,{alpha:.09}),o}},Bw={name:"Watermark",common:W,self(e){const{fontFamily:t}=e;return{fontFamily:t}}},Lw={name:"FloatButton",common:W,self(e){const{popoverColor:t,textColor2:o,buttonColor2Hover:r,buttonColor2Pressed:n,primaryColor:i,primaryColorHover:a,primaryColorPressed:l,baseColor:s,borderRadius:c}=e;return{color:t,textColor:o,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .18)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .18)",colorHover:r,colorPressed:n,colorPrimary:i,colorPrimaryHover:a,colorPrimaryPressed:l,textColorPrimary:s,borderRadiusSquare:c}}},In="n-form",Pf="n-form-item-insts",Ww=pe("form",[re("inline",` width: 100%; display: inline-flex; align-items: flex-start; align-content: space-around; - `,[pe("form-item",{width:"auto",marginRight:"18px"},[L("&:last-child",{marginRight:0})])])]);var jw=function(e,t,o,r){function n(i){return i instanceof o?i:new o(function(a){a(i)})}return new(o||(o=Promise))(function(i,a){function l(d){try{c(r.next(d))}catch(u){a(u)}}function s(d){try{c(r.throw(d))}catch(u){a(u)}}function c(d){d.done?i(d.value):n(d.value).then(l,s)}c((r=r.apply(e,t||[])).next())})};const Nw=Object.assign(Object.assign({},Ct.props),{inline:Boolean,labelWidth:[Number,String],labelAlign:String,labelPlacement:{type:String,default:"top"},model:{type:Object,default:()=>{}},rules:Object,disabled:Boolean,size:String,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:!0},onSubmit:{type:Function,default:e=>{e.preventDefault()}},showLabel:{type:Boolean,default:void 0},validateMessages:Object}),IP=He({name:"Form",props:Nw,setup(e){const{mergedClsPrefixRef:t}=zo(e);Ct("Form","-form",Ww,xf,e,t);const o={},r=fe(void 0),n=s=>{const c=r.value;(c===void 0||s>=c)&&(r.value=s)};function i(s){return jw(this,arguments,void 0,function*(c,d=()=>!0){return yield new Promise((u,p)=>{const m=[];for(const f of Es(o)){const g=o[f];for(const S of g)S.path&&m.push(S.internalValidate(null,d))}Promise.all(m).then(f=>{const g=f.some($=>!$.valid),S=[],v=[];f.forEach($=>{var T,w;!((T=$.errors)===null||T===void 0)&&T.length&&S.push($.errors),!((w=$.warnings)===null||w===void 0)&&w.length&&v.push($.warnings)}),c&&c(S.length?S:void 0,{warnings:v.length?v:void 0}),g?p(S.length?S:void 0):u({warnings:v.length?v:void 0})})})})}function a(){for(const s of Es(o)){const c=o[s];for(const d of c)d.restoreValidation()}}return po(In,{props:e,maxChildLabelWidthRef:r,deriveMaxChildLabelWidth:n}),po(Pf,{formItems:o}),Object.assign({validate:i,restoreValidation:a},{mergedClsPrefix:t})},render(){const{mergedClsPrefix:e}=this;return y("form",{class:[`${e}-form`,this.inline&&`${e}-form--inline`],onSubmit:this.onSubmit},this.$slots)}});function Ko(){return Ko=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ti(e,t,o){return Uw()?ti=Reflect.construct.bind():ti=function(n,i,a){var l=[null];l.push.apply(l,i);var s=Function.bind.apply(n,l),c=new s;return a&&xn(c,a.prototype),c},ti.apply(null,arguments)}function qw(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Oa(e){var t=typeof Map=="function"?new Map:void 0;return Oa=function(r){if(r===null||!qw(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(r))return t.get(r);t.set(r,n)}function n(){return ti(r,arguments,Da(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),xn(n,r)},Oa(e)}var Gw=/%[sdj%]/g,Kw=function(){};function Ba(e){if(!e||!e.length)return null;var t={};return e.forEach(function(o){var r=o.field;t[r]=t[r]||[],t[r].push(o)}),t}function At(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),r=1;r=i)return l;switch(l){case"%s":return String(o[n++]);case"%d":return Number(o[n++]);case"%j":try{return JSON.stringify(o[n++])}catch{return"[Circular]"}break;default:return l}});return a}return e}function Yw(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function Je(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||Yw(t)&&typeof e=="string"&&!e)}function Xw(e,t,o){var r=[],n=0,i=e.length;function a(l){r.push.apply(r,l||[]),n++,n===i&&o(r)}e.forEach(function(l){t(l,a)})}function Qs(e,t,o){var r=0,n=e.length;function i(a){if(a&&a.length){o(a);return}var l=r;r=r+1,l{}},rules:Object,disabled:Boolean,size:String,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:!0},onSubmit:{type:Function,default:e=>{e.preventDefault()}},showLabel:{type:Boolean,default:void 0},validateMessages:Object}),IP=He({name:"Form",props:Nw,setup(e){const{mergedClsPrefixRef:t}=zo(e);Ct("Form","-form",Ww,xf,e,t);const o={},r=fe(void 0),n=s=>{const c=r.value;(c===void 0||s>=c)&&(r.value=s)};function i(s){return jw(this,arguments,void 0,function*(c,d=()=>!0){return yield new Promise((u,p)=>{const m=[];for(const f of _s(o)){const g=o[f];for(const S of g)S.path&&m.push(S.internalValidate(null,d))}Promise.all(m).then(f=>{const g=f.some($=>!$.valid),S=[],v=[];f.forEach($=>{var T,w;!((T=$.errors)===null||T===void 0)&&T.length&&S.push($.errors),!((w=$.warnings)===null||w===void 0)&&w.length&&v.push($.warnings)}),c&&c(S.length?S:void 0,{warnings:v.length?v:void 0}),g?p(S.length?S:void 0):u({warnings:v.length?v:void 0})})})})}function a(){for(const s of _s(o)){const c=o[s];for(const d of c)d.restoreValidation()}}return po(In,{props:e,maxChildLabelWidthRef:r,deriveMaxChildLabelWidth:n}),po(Pf,{formItems:o}),Object.assign({validate:i,restoreValidation:a},{mergedClsPrefix:t})},render(){const{mergedClsPrefix:e}=this;return y("form",{class:[`${e}-form`,this.inline&&`${e}-form--inline`],onSubmit:this.onSubmit},this.$slots)}});function Ko(){return Ko=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ti(e,t,o){return Uw()?ti=Reflect.construct.bind():ti=function(n,i,a){var l=[null];l.push.apply(l,i);var s=Function.bind.apply(n,l),c=new s;return a&&xn(c,a.prototype),c},ti.apply(null,arguments)}function qw(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Oa(e){var t=typeof Map=="function"?new Map:void 0;return Oa=function(r){if(r===null||!qw(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(r))return t.get(r);t.set(r,n)}function n(){return ti(r,arguments,Da(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),xn(n,r)},Oa(e)}var Gw=/%[sdj%]/g,Kw=function(){};function Ba(e){if(!e||!e.length)return null;var t={};return e.forEach(function(o){var r=o.field;t[r]=t[r]||[],t[r].push(o)}),t}function At(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),r=1;r=i)return l;switch(l){case"%s":return String(o[n++]);case"%d":return Number(o[n++]);case"%j":try{return JSON.stringify(o[n++])}catch{return"[Circular]"}break;default:return l}});return a}return e}function Yw(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function Je(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||Yw(t)&&typeof e=="string"&&!e)}function Xw(e,t,o){var r=[],n=0,i=e.length;function a(l){r.push.apply(r,l||[]),n++,n===i&&o(r)}e.forEach(function(l){t(l,a)})}function Qs(e,t,o){var r=0,n=e.length;function i(a){if(a&&a.length){o(a);return}var l=r;r=r+1,l()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},Ur={integer:function(t){return Ur.number(t)&&parseInt(t,10)===t},float:function(t){return Ur.number(t)&&!Ur.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return typeof t=="object"&&!Ur.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(rc.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(o2())},hex:function(t){return typeof t=="string"&&!!t.match(rc.hex)}},r2=function(t,o,r,n,i){if(t.required&&o===void 0){Tf(t,o,r,n,i);return}var a=["integer","float","array","regexp","object","method","email","number","date","url","hex"],l=t.type;a.indexOf(l)>-1?Ur[l](o)||n.push(At(i.messages.types[l],t.fullField,t.type)):l&&typeof o!==t.type&&n.push(At(i.messages.types[l],t.fullField,t.type))},n2=function(t,o,r,n,i){var a=typeof t.len=="number",l=typeof t.min=="number",s=typeof t.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,d=o,u=null,p=typeof o=="number",m=typeof o=="string",f=Array.isArray(o);if(p?u="number":m?u="string":f&&(u="array"),!u)return!1;f&&(d=o.length),m&&(d=o.replace(c,"_").length),a?d!==t.len&&n.push(At(i.messages[u].len,t.fullField,t.len)):l&&!s&&dt.max?n.push(At(i.messages[u].max,t.fullField,t.max)):l&&s&&(dt.max)&&n.push(At(i.messages[u].range,t.fullField,t.min,t.max))},ur="enum",i2=function(t,o,r,n,i){t[ur]=Array.isArray(t[ur])?t[ur]:[],t[ur].indexOf(o)===-1&&n.push(At(i.messages[ur],t.fullField,t[ur].join(", ")))},a2=function(t,o,r,n,i){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(o)||n.push(At(i.messages.pattern.mismatch,t.fullField,o,t.pattern));else if(typeof t.pattern=="string"){var a=new RegExp(t.pattern);a.test(o)||n.push(At(i.messages.pattern.mismatch,t.fullField,o,t.pattern))}}},xe={required:Tf,whitespace:t2,type:r2,range:n2,enum:i2,pattern:a2},l2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o,"string")&&!t.required)return r();xe.required(t,o,n,a,i,"string"),Je(o,"string")||(xe.type(t,o,n,a,i),xe.range(t,o,n,a,i),xe.pattern(t,o,n,a,i),t.whitespace===!0&&xe.whitespace(t,o,n,a,i))}r(a)},s2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&xe.type(t,o,n,a,i)}r(a)},c2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(o===""&&(o=void 0),Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&(xe.type(t,o,n,a,i),xe.range(t,o,n,a,i))}r(a)},d2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&xe.type(t,o,n,a,i)}r(a)},u2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),Je(o)||xe.type(t,o,n,a,i)}r(a)},f2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&(xe.type(t,o,n,a,i),xe.range(t,o,n,a,i))}r(a)},p2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&(xe.type(t,o,n,a,i),xe.range(t,o,n,a,i))}r(a)},h2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(o==null&&!t.required)return r();xe.required(t,o,n,a,i,"array"),o!=null&&(xe.type(t,o,n,a,i),xe.range(t,o,n,a,i))}r(a)},g2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&xe.type(t,o,n,a,i)}r(a)},m2="enum",b2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&xe[m2](t,o,n,a,i)}r(a)},v2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o,"string")&&!t.required)return r();xe.required(t,o,n,a,i),Je(o,"string")||xe.pattern(t,o,n,a,i)}r(a)},x2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o,"date")&&!t.required)return r();if(xe.required(t,o,n,a,i),!Je(o,"date")){var s;o instanceof Date?s=o:s=new Date(o),xe.type(t,s,n,a,i),s&&xe.range(t,s.getTime(),n,a,i)}}r(a)},C2=function(t,o,r,n,i){var a=[],l=Array.isArray(o)?"array":typeof o;xe.required(t,o,n,a,i,l),r(a)},aa=function(t,o,r,n,i){var a=t.type,l=[],s=t.required||!t.required&&n.hasOwnProperty(t.field);if(s){if(Je(o,a)&&!t.required)return r();xe.required(t,o,n,l,i,a),Je(o,a)||xe.type(t,o,n,l,i)}r(l)},y2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i)}r(a)},tn={string:l2,method:s2,number:c2,boolean:d2,regexp:u2,integer:f2,float:p2,array:h2,object:g2,enum:b2,pattern:v2,date:x2,url:aa,hex:aa,email:aa,required:C2,any:y2};function La(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var Wa=La(),$r=function(){function e(o){this.rules=null,this._messages=Wa,this.define(o)}var t=e.prototype;return t.define=function(r){var n=this;if(!r)throw new Error("Cannot configure a schema with no rules");if(typeof r!="object"||Array.isArray(r))throw new Error("Rules must be an object");this.rules={},Object.keys(r).forEach(function(i){var a=r[i];n.rules[i]=Array.isArray(a)?a:[a]})},t.messages=function(r){return r&&(this._messages=oc(La(),r)),this._messages},t.validate=function(r,n,i){var a=this;n===void 0&&(n={}),i===void 0&&(i=function(){});var l=r,s=n,c=i;if(typeof s=="function"&&(c=s,s={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,l),Promise.resolve(l);function d(g){var S=[],v={};function $(w){if(Array.isArray(w)){var _;S=(_=S).concat.apply(_,w)}else S.push(w)}for(var T=0;T()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},Ur={integer:function(t){return Ur.number(t)&&parseInt(t,10)===t},float:function(t){return Ur.number(t)&&!Ur.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return typeof t=="object"&&!Ur.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(rc.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(o2())},hex:function(t){return typeof t=="string"&&!!t.match(rc.hex)}},r2=function(t,o,r,n,i){if(t.required&&o===void 0){Tf(t,o,r,n,i);return}var a=["integer","float","array","regexp","object","method","email","number","date","url","hex"],l=t.type;a.indexOf(l)>-1?Ur[l](o)||n.push(At(i.messages.types[l],t.fullField,t.type)):l&&typeof o!==t.type&&n.push(At(i.messages.types[l],t.fullField,t.type))},n2=function(t,o,r,n,i){var a=typeof t.len=="number",l=typeof t.min=="number",s=typeof t.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,d=o,u=null,p=typeof o=="number",m=typeof o=="string",f=Array.isArray(o);if(p?u="number":m?u="string":f&&(u="array"),!u)return!1;f&&(d=o.length),m&&(d=o.replace(c,"_").length),a?d!==t.len&&n.push(At(i.messages[u].len,t.fullField,t.len)):l&&!s&&dt.max?n.push(At(i.messages[u].max,t.fullField,t.max)):l&&s&&(dt.max)&&n.push(At(i.messages[u].range,t.fullField,t.min,t.max))},ur="enum",i2=function(t,o,r,n,i){t[ur]=Array.isArray(t[ur])?t[ur]:[],t[ur].indexOf(o)===-1&&n.push(At(i.messages[ur],t.fullField,t[ur].join(", ")))},a2=function(t,o,r,n,i){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(o)||n.push(At(i.messages.pattern.mismatch,t.fullField,o,t.pattern));else if(typeof t.pattern=="string"){var a=new RegExp(t.pattern);a.test(o)||n.push(At(i.messages.pattern.mismatch,t.fullField,o,t.pattern))}}},xe={required:Tf,whitespace:t2,type:r2,range:n2,enum:i2,pattern:a2},l2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o,"string")&&!t.required)return r();xe.required(t,o,n,a,i,"string"),Je(o,"string")||(xe.type(t,o,n,a,i),xe.range(t,o,n,a,i),xe.pattern(t,o,n,a,i),t.whitespace===!0&&xe.whitespace(t,o,n,a,i))}r(a)},s2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&xe.type(t,o,n,a,i)}r(a)},c2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(o===""&&(o=void 0),Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&(xe.type(t,o,n,a,i),xe.range(t,o,n,a,i))}r(a)},d2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&xe.type(t,o,n,a,i)}r(a)},u2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),Je(o)||xe.type(t,o,n,a,i)}r(a)},f2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&(xe.type(t,o,n,a,i),xe.range(t,o,n,a,i))}r(a)},p2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&(xe.type(t,o,n,a,i),xe.range(t,o,n,a,i))}r(a)},h2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(o==null&&!t.required)return r();xe.required(t,o,n,a,i,"array"),o!=null&&(xe.type(t,o,n,a,i),xe.range(t,o,n,a,i))}r(a)},g2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&xe.type(t,o,n,a,i)}r(a)},m2="enum",b2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&xe[m2](t,o,n,a,i)}r(a)},v2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o,"string")&&!t.required)return r();xe.required(t,o,n,a,i),Je(o,"string")||xe.pattern(t,o,n,a,i)}r(a)},x2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o,"date")&&!t.required)return r();if(xe.required(t,o,n,a,i),!Je(o,"date")){var s;o instanceof Date?s=o:s=new Date(o),xe.type(t,s,n,a,i),s&&xe.range(t,s.getTime(),n,a,i)}}r(a)},C2=function(t,o,r,n,i){var a=[],l=Array.isArray(o)?"array":typeof o;xe.required(t,o,n,a,i,l),r(a)},aa=function(t,o,r,n,i){var a=t.type,l=[],s=t.required||!t.required&&n.hasOwnProperty(t.field);if(s){if(Je(o,a)&&!t.required)return r();xe.required(t,o,n,l,i,a),Je(o,a)||xe.type(t,o,n,l,i)}r(l)},y2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i)}r(a)},tn={string:l2,method:s2,number:c2,boolean:d2,regexp:u2,integer:f2,float:p2,array:h2,object:g2,enum:b2,pattern:v2,date:x2,url:aa,hex:aa,email:aa,required:C2,any:y2};function La(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var Wa=La(),$r=function(){function e(o){this.rules=null,this._messages=Wa,this.define(o)}var t=e.prototype;return t.define=function(r){var n=this;if(!r)throw new Error("Cannot configure a schema with no rules");if(typeof r!="object"||Array.isArray(r))throw new Error("Rules must be an object");this.rules={},Object.keys(r).forEach(function(i){var a=r[i];n.rules[i]=Array.isArray(a)?a:[a]})},t.messages=function(r){return r&&(this._messages=oc(La(),r)),this._messages},t.validate=function(r,n,i){var a=this;n===void 0&&(n={}),i===void 0&&(i=function(){});var l=r,s=n,c=i;if(typeof s=="function"&&(c=s,s={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,l),Promise.resolve(l);function d(g){var S=[],v={};function $(w){if(Array.isArray(w)){var E;S=(E=S).concat.apply(E,w)}else S.push(w)}for(var T=0;Te.size!==void 0?e.size:(t==null?void 0:t.props.size)!==void 0?t.props.size:"medium")}}function T2(e){const t=Le(In,null),o=Y(()=>{const{labelPlacement:f}=e;return f!==void 0?f:t!=null&&t.props.labelPlacement?t.props.labelPlacement:"top"}),r=Y(()=>o.value==="left"&&(e.labelWidth==="auto"||(t==null?void 0:t.props.labelWidth)==="auto")),n=Y(()=>{if(o.value==="top")return;const{labelWidth:f}=e;if(f!==void 0&&f!=="auto")return oa(f);if(r.value){const g=t==null?void 0:t.maxChildLabelWidthRef.value;return g!==void 0?oa(g):void 0}if((t==null?void 0:t.props.labelWidth)!==void 0)return oa(t.props.labelWidth)}),i=Y(()=>{const{labelAlign:f}=e;if(f)return f;if(t!=null&&t.props.labelAlign)return t.props.labelAlign}),a=Y(()=>{var f;return[(f=e.labelProps)===null||f===void 0?void 0:f.style,e.labelStyle,{width:n.value}]}),l=Y(()=>{const{showRequireMark:f}=e;return f!==void 0?f:t==null?void 0:t.props.showRequireMark}),s=Y(()=>{const{requireMarkPlacement:f}=e;return f!==void 0?f:(t==null?void 0:t.props.requireMarkPlacement)||"right"}),c=fe(!1),d=fe(!1),u=Y(()=>{const{validationStatus:f}=e;if(f!==void 0)return f;if(c.value)return"error";if(d.value)return"warning"}),p=Y(()=>{const{showFeedback:f}=e;return f!==void 0?f:(t==null?void 0:t.props.showFeedback)!==void 0?t.props.showFeedback:!0}),m=Y(()=>{const{showLabel:f}=e;return f!==void 0?f:(t==null?void 0:t.props.showLabel)!==void 0?t.props.showLabel:!0});return{validationErrored:c,validationWarned:d,mergedLabelStyle:a,mergedLabelPlacement:o,mergedLabelAlign:i,mergedShowRequireMark:l,mergedRequireMarkPlacement:s,mergedValidationStatus:u,mergedShowFeedback:p,mergedShowLabel:m,isAutoLabelWidth:r}}function $2(e){const t=Le(In,null),o=Y(()=>{const{rulePath:a}=e;if(a!==void 0)return a;const{path:l}=e;if(l!==void 0)return l}),r=Y(()=>{const a=[],{rule:l}=e;if(l!==void 0&&(Array.isArray(l)?a.push(...l):a.push(l)),t){const{rules:s}=t.props,{value:c}=o;if(s!==void 0&&c!==void 0){const d=bu(s,c);d!==void 0&&(Array.isArray(d)?a.push(...d):a.push(d))}}return a}),n=Y(()=>r.value.some(a=>a.required)),i=Y(()=>n.value||e.required);return{mergedRules:r,mergedRequired:i}}var ic=function(e,t,o,r){function n(i){return i instanceof o?i:new o(function(a){a(i)})}return new(o||(o=Promise))(function(i,a){function l(d){try{c(r.next(d))}catch(u){a(u)}}function s(d){try{c(r.throw(d))}catch(u){a(u)}}function c(d){d.done?i(d.value):n(d.value).then(l,s)}c((r=r.apply(e,t||[])).next())})};const R2=Object.assign(Object.assign({},Ct.props),{label:String,labelWidth:[Number,String],labelStyle:[String,Object],labelAlign:String,labelPlacement:String,path:String,first:Boolean,rulePath:String,required:Boolean,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:void 0},rule:[Object,Array],size:String,ignorePathChange:Boolean,validationStatus:String,feedback:String,feedbackClass:String,feedbackStyle:[String,Object],showLabel:{type:Boolean,default:void 0},labelProps:Object});function ac(e,t){return(...o)=>{try{const r=e(...o);return!t&&(typeof r=="boolean"||r instanceof Error||Array.isArray(r))||r!=null&&r.then?r:(r===void 0||Aa("form-item/validate",`You return a ${typeof r} typed value in the validator method, which is not recommended. Please use ${t?"`Promise`":"`boolean`, `Error` or `Promise`"} typed value instead.`),!0)}catch(r){Aa("form-item/validate","An error is catched in the validation, so the validation won't be done. Your callback in `validate` method of `n-form` or `n-form-item` won't be called in this validation."),console.error(r);return}}}const _P=He({name:"FormItem",props:R2,setup(e){Zm(Pf,"formItems",Dt(e,"path"));const{mergedClsPrefixRef:t,inlineThemeDisabled:o}=zo(e),r=Le(In,null),n=P2(e),i=T2(e),{validationErrored:a,validationWarned:l}=i,{mergedRequired:s,mergedRules:c}=$2(e),{mergedSize:d}=n,{mergedLabelPlacement:u,mergedLabelAlign:p,mergedRequireMarkPlacement:m}=i,f=fe([]),g=fe($a()),S=r?Dt(r.props,"disabled"):fe(!1),v=Ct("Form","-form-item",w2,xf,e,t);Zt(Dt(e,"path"),()=>{e.ignorePathChange||$()});function $(){f.value=[],a.value=!1,l.value=!1,e.feedback&&(g.value=$a())}const T=(...G)=>ic(this,[...G],void 0,function*(le=null,te=()=>!0,N={suppressWarning:!0}){const{path:oe}=e;N?N.first||(N.first=e.first):N={};const{value:ye}=c,Pe=r?bu(r.props.model,oe||""):void 0,Re={},Fe={},Ve=(le?ye.filter(h=>Array.isArray(h.trigger)?h.trigger.includes(le):h.trigger===le):ye).filter(te).map((h,b)=>{const P=Object.assign({},h);if(P.validator&&(P.validator=ac(P.validator,!1)),P.asyncValidator&&(P.asyncValidator=ac(P.asyncValidator,!0)),P.renderMessage){const H=`__renderMessage__${b}`;Fe[H]=P.message,P.message=H,Re[H]=P.renderMessage}return P}),qe=Ve.filter(h=>h.level!=="warning"),gt=Ve.filter(h=>h.level==="warning"),he={valid:!0,errors:void 0,warnings:void 0};if(!Ve.length)return he;const Ue=oe??"__n_no_path__",rt=new $r({[Ue]:qe}),be=new $r({[Ue]:gt}),{validateMessages:Ge}=(r==null?void 0:r.props)||{};Ge&&(rt.messages(Ge),be.messages(Ge));const Pt=h=>{f.value=h.map(b=>{const P=(b==null?void 0:b.message)||"";return{key:P,render:()=>P.startsWith("__renderMessage__")?Re[P]():P}}),h.forEach(b=>{var P;!((P=b.message)===null||P===void 0)&&P.startsWith("__renderMessage__")&&(b.message=Fe[b.message])})};if(qe.length){const h=yield new Promise(b=>{rt.validate({[Ue]:Pe},N,b)});h!=null&&h.length&&(he.valid=!1,he.errors=h,Pt(h))}if(gt.length&&!he.errors){const h=yield new Promise(b=>{be.validate({[Ue]:Pe},N,b)});h!=null&&h.length&&(Pt(h),he.warnings=h)}return!he.errors&&!he.warnings?$():(a.value=!!he.errors,l.value=!!he.warnings),he});function w(){T("blur")}function _(){T("change")}function O(){T("focus")}function x(){T("input")}function F(G,le){return ic(this,void 0,void 0,function*(){let te,N,oe,ye;return typeof G=="string"?(te=G,N=le):G!==null&&typeof G=="object"&&(te=G.trigger,N=G.callback,oe=G.shouldRuleBeApplied,ye=G.options),yield new Promise((Pe,Re)=>{T(te,oe,ye).then(({valid:Fe,errors:Ve,warnings:qe})=>{Fe?(N&&N(void 0,{warnings:qe}),Pe({warnings:qe})):(N&&N(Ve,{warnings:qe}),Re(Ve))})})})}po(Ia,{path:Dt(e,"path"),disabled:S,mergedSize:n.mergedSize,mergedValidationStatus:i.mergedValidationStatus,restoreValidation:$,handleContentBlur:w,handleContentChange:_,handleContentFocus:O,handleContentInput:x});const R={validate:F,restoreValidation:$,internalValidate:T},B=fe(null);Mo(()=>{if(!i.isAutoLabelWidth.value)return;const G=B.value;if(G!==null){const le=G.style.whiteSpace;G.style.whiteSpace="nowrap",G.style.width="",r==null||r.deriveMaxChildLabelWidth(Number(getComputedStyle(G).width.slice(0,-2))),G.style.whiteSpace=le}});const j=Y(()=>{var G;const{value:le}=d,{value:te}=u,N=te==="top"?"vertical":"horizontal",{common:{cubicBezierEaseInOut:oe},self:{labelTextColor:ye,asteriskColor:Pe,lineHeight:Re,feedbackTextColor:Fe,feedbackTextColorWarning:Ve,feedbackTextColorError:qe,feedbackPadding:gt,labelFontWeight:he,[ae("labelHeight",le)]:Ue,[ae("blankHeight",le)]:rt,[ae("feedbackFontSize",le)]:be,[ae("feedbackHeight",le)]:Ge,[ae("labelPadding",N)]:Pt,[ae("labelTextAlign",N)]:h,[ae(ae("labelFontSize",te),le)]:b}}=v.value;let P=(G=p.value)!==null&&G!==void 0?G:h;return te==="top"&&(P=P==="right"?"flex-end":"flex-start"),{"--n-bezier":oe,"--n-line-height":Re,"--n-blank-height":rt,"--n-label-font-size":b,"--n-label-text-align":P,"--n-label-height":Ue,"--n-label-padding":Pt,"--n-label-font-weight":he,"--n-asterisk-color":Pe,"--n-label-text-color":ye,"--n-feedback-padding":gt,"--n-feedback-font-size":be,"--n-feedback-height":Ge,"--n-feedback-text-color":Fe,"--n-feedback-text-color-warning":Ve,"--n-feedback-text-color-error":qe}}),A=o?Fr("form-item",Y(()=>{var G;return`${d.value[0]}${u.value[0]}${((G=p.value)===null||G===void 0?void 0:G[0])||""}`}),j,e):void 0,J=Y(()=>u.value==="left"&&m.value==="left"&&p.value==="left");return Object.assign(Object.assign(Object.assign(Object.assign({labelElementRef:B,mergedClsPrefix:t,mergedRequired:s,feedbackId:g,renderExplains:f,reverseColSpace:J},i),n),R),{cssVars:o?void 0:j,themeClass:A==null?void 0:A.themeClass,onRender:A==null?void 0:A.onRender})},render(){const{$slots:e,mergedClsPrefix:t,mergedShowLabel:o,mergedShowRequireMark:r,mergedRequireMarkPlacement:n,onRender:i}=this,a=r!==void 0?r:this.mergedRequired;i==null||i();const l=()=>{const s=this.$slots.label?this.$slots.label():this.label;if(!s)return null;const c=y("span",{class:`${t}-form-item-label__text`},s),d=a?y("span",{class:`${t}-form-item-label__asterisk`},n!=="left"?" *":"* "):n==="right-hanging"&&y("span",{class:`${t}-form-item-label__asterisk-placeholder`}," *"),{labelProps:u}=this;return y("label",Object.assign({},u,{class:[u==null?void 0:u.class,`${t}-form-item-label`,`${t}-form-item-label--${n}-mark`,this.reverseColSpace&&`${t}-form-item-label--reverse-columns-space`],style:this.mergedLabelStyle,ref:"labelElementRef"}),n==="left"?[d,c]:[c,d])};return y("div",{class:[`${t}-form-item`,this.themeClass,`${t}-form-item--${this.mergedSize}-size`,`${t}-form-item--${this.mergedLabelPlacement}-labelled`,this.isAutoLabelWidth&&`${t}-form-item--auto-label-width`,!o&&`${t}-form-item--no-label`],style:this.cssVars},o&&l(),y("div",{class:[`${t}-form-item-blank`,this.mergedValidationStatus&&`${t}-form-item-blank--${this.mergedValidationStatus}`]},e),this.mergedShowFeedback?y("div",{key:this.feedbackId,style:this.feedbackStyle,class:[`${t}-form-item-feedback-wrapper`,this.feedbackClass]},y(un,{name:"fade-down-transition",mode:"out-in"},{default:()=>{const{mergedValidationStatus:s}=this;return $t(e.feedback,c=>{var d;const{feedback:u}=this,p=c||u?y("div",{key:"__feedback__",class:`${t}-form-item-feedback__line`},c||u):this.renderExplains.length?(d=this.renderExplains)===null||d===void 0?void 0:d.map(({key:m,render:f})=>y("div",{key:m,class:`${t}-form-item-feedback__line`},f())):null;return p?s==="warning"?y("div",{key:"controlled-warning",class:`${t}-form-item-feedback ${t}-form-item-feedback--warning`},p):s==="error"?y("div",{key:"controlled-error",class:`${t}-form-item-feedback ${t}-form-item-feedback--error`},p):s==="success"?y("div",{key:"controlled-success",class:`${t}-form-item-feedback ${t}-form-item-feedback--success`},p):y("div",{key:"controlled-default",class:`${t}-form-item-feedback`},p):null})}})):null)}});function F2(e){const{primaryColor:t,baseColor:o}=e;return{color:t,iconColor:o}}const A2={name:"IconWrapper",common:W,self:F2},I2={name:"Image",common:W,peers:{Tooltip:Di},self:e=>{const{textColor2:t}=e;return{toolbarIconColor:t,toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}},_2={extraFontSize:"12px",width:"440px"},E2={name:"Transfer",common:W,peers:{Checkbox:Hr,Scrollbar:St,Input:zt,Empty:ar,Button:wt},self(e){const{iconColorDisabled:t,iconColor:o,fontWeight:r,fontSizeLarge:n,fontSizeMedium:i,fontSizeSmall:a,heightLarge:l,heightMedium:s,heightSmall:c,borderRadius:d,inputColor:u,tableHeaderColor:p,textColor1:m,textColorDisabled:f,textColor2:g,hoverColor:S}=e;return Object.assign(Object.assign({},_2),{itemHeightSmall:c,itemHeightMedium:s,itemHeightLarge:l,fontSizeSmall:a,fontSizeMedium:i,fontSizeLarge:n,borderRadius:d,borderColor:"#0000",listColor:u,headerColor:p,titleTextColor:m,titleTextColorDisabled:f,extraTextColor:g,filterDividerColor:"#0000",itemTextColor:g,itemTextColorDisabled:f,itemColorPending:S,titleFontWeight:r,iconColor:o,iconColorDisabled:t})}};function M2(){return{}}const z2={name:"Marquee",common:W,self:M2},H2={name:"QrCode",common:W,self:e=>({borderRadius:e.borderRadius})},k2={name:"Skeleton",common:W,self(e){const{heightSmall:t,heightMedium:o,heightLarge:r,borderRadius:n}=e;return{color:"rgba(255, 255, 255, 0.12)",colorEnd:"rgba(255, 255, 255, 0.18)",borderRadius:n,heightSmall:t,heightMedium:o,heightLarge:r}}},D2={name:"Split",common:W},O2=()=>({}),B2={name:"Equation",common:W,self:O2},L2={name:"FloatButtonGroup",common:W,self(e){const{popoverColor:t,dividerColor:o,borderRadius:r}=e;return{color:t,buttonBorderColor:o,borderRadiusSquare:r,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)"}}},EP={name:"dark",common:W,Alert:qy,Anchor:Zy,AutoComplete:l1,Avatar:Uu,AvatarGroup:d1,BackTop:f1,Badge:p1,Breadcrumb:m1,Button:wt,ButtonGroup:LS,Calendar:P1,Card:Ku,Carousel:_1,Cascader:H1,Checkbox:Hr,Code:Xu,Collapse:D1,CollapseTransition:B1,ColorPicker:W1,DataTable:oS,DatePicker:lS,Descriptions:dS,Dialog:pf,Divider:IS,Drawer:ES,Dropdown:yl,DynamicInput:zS,DynamicTags:kS,Element:DS,Empty:ar,Ellipsis:nf,Equation:B2,Flex:BS,Form:jS,GradientText:NS,Icon:rS,IconWrapper:A2,Image:I2,Input:zt,InputNumber:VS,LegacyTransfer:E2,Layout:US,List:KS,LoadingBar:gS,Log:YS,Menu:QS,Mention:XS,Message:xS,Modal:hS,Notification:FS,PageHeader:ow,Pagination:tf,Popconfirm:nw,Popover:lr,Popselect:Ju,Progress:yf,QrCode:H2,Radio:lf,Rate:aw,Result:cw,Row:qS,Scrollbar:St,Select:Qu,Skeleton:k2,Slider:uw,Space:bf,Spin:fw,Statistic:hw,Steps:bw,Switch:xw,Table:Sw,Tabs:Tw,Tag:Lu,Thing:Rw,TimePicker:uf,Timeline:Aw,Tooltip:Di,Transfer:_w,Tree:wf,TreeSelect:Mw,Typography:kw,Upload:Ow,Watermark:Bw,Split:D2,FloatButton:Lw,FloatButtonGroup:L2,Marquee:z2};function Wo(e,t){return typeof document>"u"?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function MP(){const e=Wo("--bg","#0b1020"),t=Wo("--fg","#e2e8f0"),o=Wo("--fg-dim","#94a3b8"),r=Wo("--panel","#0f172a"),n=Wo("--border","#1e293b"),i=Wo("--accent","#60a5fa"),a=Wo("--bad","#f87171");return{common:{bodyColor:e,textColorBase:t,textColor1:t,textColor2:t,textColor3:o,primaryColor:i,primaryColorHover:i,primaryColorPressed:i,borderColor:n,cardColor:r,errorColor:a}}}const zP=Y(()=>Pn.value==="zh-CN"?{locale:Eb,dateLocale:Uv}:{locale:Qd,dateLocale:tu});function HP(){return{t:fo,languageOptions:Gg,localePreference:Fi,resolvedLocale:Pn,setLocalePreference:Kg}}export{Ro as $,Tn as A,y1 as B,fy as C,An as D,gy as E,et as F,L as G,pe as H,vy as I,fP as J,V as K,re as L,gu as M,Iu as N,Po as O,Ke as P,cC as Q,K as R,Hu as S,ch as T,Ys as U,Fa as V,Cy as W,yP as X,M1 as Y,sP as Z,pp as _,pt as a,uu as a$,As as a0,ko as a1,Oy as a2,Uy as a3,HS as a4,vw as a5,ee as a6,Y as a7,Qt as a8,oP as a9,nP as aA,oa as aB,bu as aC,Sn as aD,Fp as aE,Db as aF,hP as aG,Vo as aH,MP as aI,hl as aJ,Im as aK,y as aL,K2 as aM,TP as aN,vn as aO,iu as aP,rP as aQ,Le as aR,ki as aS,Rm as aT,Fm as aU,Ou as aV,Wy as aW,_a as aX,Pr as aY,ml as aZ,Ii as a_,yd as aa,va as ab,J2 as ac,Y2 as ad,$a as ae,mP as af,ae as ag,X2 as ah,xa as ai,vP as aj,ht as ak,bn as al,EP as am,PP as an,$P as ao,He as ap,ms as aq,Be as ar,Y1 as as,W2 as at,Z1 as au,xl as av,hv as aw,Ei as ax,Yy as ay,$y as az,Sm as b,fo as b$,au as b0,Ex as b1,lu as b2,iP as b3,Ym as b4,ir as b5,Ir as b6,su as b7,gr as b8,ot as b9,zr as bA,V1 as bB,po as bC,pP as bD,eS as bE,Ci as bF,el as bG,fe as bH,Ab as bI,G2 as bJ,vh as bK,gP as bL,Mr as bM,Fs as bN,U2 as bO,q2 as bP,Qr as bQ,Ib as bR,$t as bS,ho as bT,Ar as bU,lP as bV,U1 as bW,Kg as bX,Ac as bY,AP as bZ,zs as b_,Ob as ba,_b as bb,pu as bc,Es as bd,aP as be,da as bf,Sd as bg,mS as bh,zP as bi,nn as bj,Ga as bk,qa as bl,lo as bm,Fb as bn,Go as bo,Kc as bp,Pi as bq,nr as br,Yc as bs,Mo as bt,j2 as bu,Zc as bv,ba as bw,Tx as bx,G1 as by,FP as bz,Ho as c,Rb as c0,iS as c1,Hb as c2,Rp as c3,dC as c4,we as c5,Dt as c6,N2 as c7,d0 as c8,J1 as c9,eP as cA,Xp as ca,zo as cb,Zd as cc,HP as cd,ly as ce,hn as cf,bP as cg,Km as ch,$n as ci,_i as cj,Er as ck,Ct as cl,Fr as cm,zg as cn,Q2 as co,Hg as cp,kg as cq,ls as cr,Z2 as cs,cP as ct,Aa as cu,Zt as cv,sn as cw,lh as cx,V2 as cy,tP as cz,Tr as d,vl as e,By as f,SP as g,wP as h,_u as i,IP as j,_P as k,Hi as l,CP as m,RP as n,_r as o,xy as p,wr as q,$i as r,un as s,Ms as t,xP as u,dP as v,Px as w,o0 as x,ry as y,uC as z}; + `),pe("form-item-feedback",{transition:"color .3s var(--n-bezier)",color:"var(--n-feedback-text-color)"},[re("warning",{color:"var(--n-feedback-text-color-warning)"}),re("error",{color:"var(--n-feedback-text-color-error)"}),S2({fromOffset:"-3px",enterDuration:".3s",leaveDuration:".2s"})])])]);function P2(e){const t=Le(In,null);return{mergedSize:Y(()=>e.size!==void 0?e.size:(t==null?void 0:t.props.size)!==void 0?t.props.size:"medium")}}function T2(e){const t=Le(In,null),o=Y(()=>{const{labelPlacement:f}=e;return f!==void 0?f:t!=null&&t.props.labelPlacement?t.props.labelPlacement:"top"}),r=Y(()=>o.value==="left"&&(e.labelWidth==="auto"||(t==null?void 0:t.props.labelWidth)==="auto")),n=Y(()=>{if(o.value==="top")return;const{labelWidth:f}=e;if(f!==void 0&&f!=="auto")return oa(f);if(r.value){const g=t==null?void 0:t.maxChildLabelWidthRef.value;return g!==void 0?oa(g):void 0}if((t==null?void 0:t.props.labelWidth)!==void 0)return oa(t.props.labelWidth)}),i=Y(()=>{const{labelAlign:f}=e;if(f)return f;if(t!=null&&t.props.labelAlign)return t.props.labelAlign}),a=Y(()=>{var f;return[(f=e.labelProps)===null||f===void 0?void 0:f.style,e.labelStyle,{width:n.value}]}),l=Y(()=>{const{showRequireMark:f}=e;return f!==void 0?f:t==null?void 0:t.props.showRequireMark}),s=Y(()=>{const{requireMarkPlacement:f}=e;return f!==void 0?f:(t==null?void 0:t.props.requireMarkPlacement)||"right"}),c=fe(!1),d=fe(!1),u=Y(()=>{const{validationStatus:f}=e;if(f!==void 0)return f;if(c.value)return"error";if(d.value)return"warning"}),p=Y(()=>{const{showFeedback:f}=e;return f!==void 0?f:(t==null?void 0:t.props.showFeedback)!==void 0?t.props.showFeedback:!0}),m=Y(()=>{const{showLabel:f}=e;return f!==void 0?f:(t==null?void 0:t.props.showLabel)!==void 0?t.props.showLabel:!0});return{validationErrored:c,validationWarned:d,mergedLabelStyle:a,mergedLabelPlacement:o,mergedLabelAlign:i,mergedShowRequireMark:l,mergedRequireMarkPlacement:s,mergedValidationStatus:u,mergedShowFeedback:p,mergedShowLabel:m,isAutoLabelWidth:r}}function $2(e){const t=Le(In,null),o=Y(()=>{const{rulePath:a}=e;if(a!==void 0)return a;const{path:l}=e;if(l!==void 0)return l}),r=Y(()=>{const a=[],{rule:l}=e;if(l!==void 0&&(Array.isArray(l)?a.push(...l):a.push(l)),t){const{rules:s}=t.props,{value:c}=o;if(s!==void 0&&c!==void 0){const d=bu(s,c);d!==void 0&&(Array.isArray(d)?a.push(...d):a.push(d))}}return a}),n=Y(()=>r.value.some(a=>a.required)),i=Y(()=>n.value||e.required);return{mergedRules:r,mergedRequired:i}}var ic=function(e,t,o,r){function n(i){return i instanceof o?i:new o(function(a){a(i)})}return new(o||(o=Promise))(function(i,a){function l(d){try{c(r.next(d))}catch(u){a(u)}}function s(d){try{c(r.throw(d))}catch(u){a(u)}}function c(d){d.done?i(d.value):n(d.value).then(l,s)}c((r=r.apply(e,t||[])).next())})};const R2=Object.assign(Object.assign({},Ct.props),{label:String,labelWidth:[Number,String],labelStyle:[String,Object],labelAlign:String,labelPlacement:String,path:String,first:Boolean,rulePath:String,required:Boolean,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:void 0},rule:[Object,Array],size:String,ignorePathChange:Boolean,validationStatus:String,feedback:String,feedbackClass:String,feedbackStyle:[String,Object],showLabel:{type:Boolean,default:void 0},labelProps:Object});function ac(e,t){return(...o)=>{try{const r=e(...o);return!t&&(typeof r=="boolean"||r instanceof Error||Array.isArray(r))||r!=null&&r.then?r:(r===void 0||Aa("form-item/validate",`You return a ${typeof r} typed value in the validator method, which is not recommended. Please use ${t?"`Promise`":"`boolean`, `Error` or `Promise`"} typed value instead.`),!0)}catch(r){Aa("form-item/validate","An error is catched in the validation, so the validation won't be done. Your callback in `validate` method of `n-form` or `n-form-item` won't be called in this validation."),console.error(r);return}}}const EP=He({name:"FormItem",props:R2,setup(e){Zm(Pf,"formItems",Dt(e,"path"));const{mergedClsPrefixRef:t,inlineThemeDisabled:o}=zo(e),r=Le(In,null),n=P2(e),i=T2(e),{validationErrored:a,validationWarned:l}=i,{mergedRequired:s,mergedRules:c}=$2(e),{mergedSize:d}=n,{mergedLabelPlacement:u,mergedLabelAlign:p,mergedRequireMarkPlacement:m}=i,f=fe([]),g=fe($a()),S=r?Dt(r.props,"disabled"):fe(!1),v=Ct("Form","-form-item",w2,xf,e,t);Zt(Dt(e,"path"),()=>{e.ignorePathChange||$()});function $(){f.value=[],a.value=!1,l.value=!1,e.feedback&&(g.value=$a())}const T=(...G)=>ic(this,[...G],void 0,function*(le=null,te=()=>!0,N={suppressWarning:!0}){const{path:oe}=e;N?N.first||(N.first=e.first):N={};const{value:ye}=c,Pe=r?bu(r.props.model,oe||""):void 0,Re={},Fe={},Ve=(le?ye.filter(h=>Array.isArray(h.trigger)?h.trigger.includes(le):h.trigger===le):ye).filter(te).map((h,b)=>{const P=Object.assign({},h);if(P.validator&&(P.validator=ac(P.validator,!1)),P.asyncValidator&&(P.asyncValidator=ac(P.asyncValidator,!0)),P.renderMessage){const H=`__renderMessage__${b}`;Fe[H]=P.message,P.message=H,Re[H]=P.renderMessage}return P}),qe=Ve.filter(h=>h.level!=="warning"),gt=Ve.filter(h=>h.level==="warning"),he={valid:!0,errors:void 0,warnings:void 0};if(!Ve.length)return he;const Ue=oe??"__n_no_path__",rt=new $r({[Ue]:qe}),be=new $r({[Ue]:gt}),{validateMessages:Ge}=(r==null?void 0:r.props)||{};Ge&&(rt.messages(Ge),be.messages(Ge));const Pt=h=>{f.value=h.map(b=>{const P=(b==null?void 0:b.message)||"";return{key:P,render:()=>P.startsWith("__renderMessage__")?Re[P]():P}}),h.forEach(b=>{var P;!((P=b.message)===null||P===void 0)&&P.startsWith("__renderMessage__")&&(b.message=Fe[b.message])})};if(qe.length){const h=yield new Promise(b=>{rt.validate({[Ue]:Pe},N,b)});h!=null&&h.length&&(he.valid=!1,he.errors=h,Pt(h))}if(gt.length&&!he.errors){const h=yield new Promise(b=>{be.validate({[Ue]:Pe},N,b)});h!=null&&h.length&&(Pt(h),he.warnings=h)}return!he.errors&&!he.warnings?$():(a.value=!!he.errors,l.value=!!he.warnings),he});function w(){T("blur")}function E(){T("change")}function O(){T("focus")}function x(){T("input")}function F(G,le){return ic(this,void 0,void 0,function*(){let te,N,oe,ye;return typeof G=="string"?(te=G,N=le):G!==null&&typeof G=="object"&&(te=G.trigger,N=G.callback,oe=G.shouldRuleBeApplied,ye=G.options),yield new Promise((Pe,Re)=>{T(te,oe,ye).then(({valid:Fe,errors:Ve,warnings:qe})=>{Fe?(N&&N(void 0,{warnings:qe}),Pe({warnings:qe})):(N&&N(Ve,{warnings:qe}),Re(Ve))})})})}po(Ia,{path:Dt(e,"path"),disabled:S,mergedSize:n.mergedSize,mergedValidationStatus:i.mergedValidationStatus,restoreValidation:$,handleContentBlur:w,handleContentChange:E,handleContentFocus:O,handleContentInput:x});const R={validate:F,restoreValidation:$,internalValidate:T},B=fe(null);Mo(()=>{if(!i.isAutoLabelWidth.value)return;const G=B.value;if(G!==null){const le=G.style.whiteSpace;G.style.whiteSpace="nowrap",G.style.width="",r==null||r.deriveMaxChildLabelWidth(Number(getComputedStyle(G).width.slice(0,-2))),G.style.whiteSpace=le}});const j=Y(()=>{var G;const{value:le}=d,{value:te}=u,N=te==="top"?"vertical":"horizontal",{common:{cubicBezierEaseInOut:oe},self:{labelTextColor:ye,asteriskColor:Pe,lineHeight:Re,feedbackTextColor:Fe,feedbackTextColorWarning:Ve,feedbackTextColorError:qe,feedbackPadding:gt,labelFontWeight:he,[ae("labelHeight",le)]:Ue,[ae("blankHeight",le)]:rt,[ae("feedbackFontSize",le)]:be,[ae("feedbackHeight",le)]:Ge,[ae("labelPadding",N)]:Pt,[ae("labelTextAlign",N)]:h,[ae(ae("labelFontSize",te),le)]:b}}=v.value;let P=(G=p.value)!==null&&G!==void 0?G:h;return te==="top"&&(P=P==="right"?"flex-end":"flex-start"),{"--n-bezier":oe,"--n-line-height":Re,"--n-blank-height":rt,"--n-label-font-size":b,"--n-label-text-align":P,"--n-label-height":Ue,"--n-label-padding":Pt,"--n-label-font-weight":he,"--n-asterisk-color":Pe,"--n-label-text-color":ye,"--n-feedback-padding":gt,"--n-feedback-font-size":be,"--n-feedback-height":Ge,"--n-feedback-text-color":Fe,"--n-feedback-text-color-warning":Ve,"--n-feedback-text-color-error":qe}}),A=o?Fr("form-item",Y(()=>{var G;return`${d.value[0]}${u.value[0]}${((G=p.value)===null||G===void 0?void 0:G[0])||""}`}),j,e):void 0,J=Y(()=>u.value==="left"&&m.value==="left"&&p.value==="left");return Object.assign(Object.assign(Object.assign(Object.assign({labelElementRef:B,mergedClsPrefix:t,mergedRequired:s,feedbackId:g,renderExplains:f,reverseColSpace:J},i),n),R),{cssVars:o?void 0:j,themeClass:A==null?void 0:A.themeClass,onRender:A==null?void 0:A.onRender})},render(){const{$slots:e,mergedClsPrefix:t,mergedShowLabel:o,mergedShowRequireMark:r,mergedRequireMarkPlacement:n,onRender:i}=this,a=r!==void 0?r:this.mergedRequired;i==null||i();const l=()=>{const s=this.$slots.label?this.$slots.label():this.label;if(!s)return null;const c=y("span",{class:`${t}-form-item-label__text`},s),d=a?y("span",{class:`${t}-form-item-label__asterisk`},n!=="left"?" *":"* "):n==="right-hanging"&&y("span",{class:`${t}-form-item-label__asterisk-placeholder`}," *"),{labelProps:u}=this;return y("label",Object.assign({},u,{class:[u==null?void 0:u.class,`${t}-form-item-label`,`${t}-form-item-label--${n}-mark`,this.reverseColSpace&&`${t}-form-item-label--reverse-columns-space`],style:this.mergedLabelStyle,ref:"labelElementRef"}),n==="left"?[d,c]:[c,d])};return y("div",{class:[`${t}-form-item`,this.themeClass,`${t}-form-item--${this.mergedSize}-size`,`${t}-form-item--${this.mergedLabelPlacement}-labelled`,this.isAutoLabelWidth&&`${t}-form-item--auto-label-width`,!o&&`${t}-form-item--no-label`],style:this.cssVars},o&&l(),y("div",{class:[`${t}-form-item-blank`,this.mergedValidationStatus&&`${t}-form-item-blank--${this.mergedValidationStatus}`]},e),this.mergedShowFeedback?y("div",{key:this.feedbackId,style:this.feedbackStyle,class:[`${t}-form-item-feedback-wrapper`,this.feedbackClass]},y(un,{name:"fade-down-transition",mode:"out-in"},{default:()=>{const{mergedValidationStatus:s}=this;return $t(e.feedback,c=>{var d;const{feedback:u}=this,p=c||u?y("div",{key:"__feedback__",class:`${t}-form-item-feedback__line`},c||u):this.renderExplains.length?(d=this.renderExplains)===null||d===void 0?void 0:d.map(({key:m,render:f})=>y("div",{key:m,class:`${t}-form-item-feedback__line`},f())):null;return p?s==="warning"?y("div",{key:"controlled-warning",class:`${t}-form-item-feedback ${t}-form-item-feedback--warning`},p):s==="error"?y("div",{key:"controlled-error",class:`${t}-form-item-feedback ${t}-form-item-feedback--error`},p):s==="success"?y("div",{key:"controlled-success",class:`${t}-form-item-feedback ${t}-form-item-feedback--success`},p):y("div",{key:"controlled-default",class:`${t}-form-item-feedback`},p):null})}})):null)}});function F2(e){const{primaryColor:t,baseColor:o}=e;return{color:t,iconColor:o}}const A2={name:"IconWrapper",common:W,self:F2},I2={name:"Image",common:W,peers:{Tooltip:Di},self:e=>{const{textColor2:t}=e;return{toolbarIconColor:t,toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}},E2={extraFontSize:"12px",width:"440px"},_2={name:"Transfer",common:W,peers:{Checkbox:Hr,Scrollbar:St,Input:zt,Empty:ar,Button:wt},self(e){const{iconColorDisabled:t,iconColor:o,fontWeight:r,fontSizeLarge:n,fontSizeMedium:i,fontSizeSmall:a,heightLarge:l,heightMedium:s,heightSmall:c,borderRadius:d,inputColor:u,tableHeaderColor:p,textColor1:m,textColorDisabled:f,textColor2:g,hoverColor:S}=e;return Object.assign(Object.assign({},E2),{itemHeightSmall:c,itemHeightMedium:s,itemHeightLarge:l,fontSizeSmall:a,fontSizeMedium:i,fontSizeLarge:n,borderRadius:d,borderColor:"#0000",listColor:u,headerColor:p,titleTextColor:m,titleTextColorDisabled:f,extraTextColor:g,filterDividerColor:"#0000",itemTextColor:g,itemTextColorDisabled:f,itemColorPending:S,titleFontWeight:r,iconColor:o,iconColorDisabled:t})}};function M2(){return{}}const z2={name:"Marquee",common:W,self:M2},H2={name:"QrCode",common:W,self:e=>({borderRadius:e.borderRadius})},k2={name:"Skeleton",common:W,self(e){const{heightSmall:t,heightMedium:o,heightLarge:r,borderRadius:n}=e;return{color:"rgba(255, 255, 255, 0.12)",colorEnd:"rgba(255, 255, 255, 0.18)",borderRadius:n,heightSmall:t,heightMedium:o,heightLarge:r}}},D2={name:"Split",common:W},O2=()=>({}),B2={name:"Equation",common:W,self:O2},L2={name:"FloatButtonGroup",common:W,self(e){const{popoverColor:t,dividerColor:o,borderRadius:r}=e;return{color:t,buttonBorderColor:o,borderRadiusSquare:r,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)"}}},_P={name:"dark",common:W,Alert:qy,Anchor:Zy,AutoComplete:l1,Avatar:Uu,AvatarGroup:d1,BackTop:f1,Badge:p1,Breadcrumb:m1,Button:wt,ButtonGroup:LS,Calendar:P1,Card:Ku,Carousel:E1,Cascader:H1,Checkbox:Hr,Code:Xu,Collapse:D1,CollapseTransition:B1,ColorPicker:W1,DataTable:oS,DatePicker:lS,Descriptions:dS,Dialog:pf,Divider:IS,Drawer:_S,Dropdown:yl,DynamicInput:zS,DynamicTags:kS,Element:DS,Empty:ar,Ellipsis:nf,Equation:B2,Flex:BS,Form:jS,GradientText:NS,Icon:rS,IconWrapper:A2,Image:I2,Input:zt,InputNumber:VS,LegacyTransfer:_2,Layout:US,List:KS,LoadingBar:gS,Log:YS,Menu:QS,Mention:XS,Message:xS,Modal:hS,Notification:FS,PageHeader:ow,Pagination:tf,Popconfirm:nw,Popover:lr,Popselect:Ju,Progress:yf,QrCode:H2,Radio:lf,Rate:aw,Result:cw,Row:qS,Scrollbar:St,Select:Qu,Skeleton:k2,Slider:uw,Space:bf,Spin:fw,Statistic:hw,Steps:bw,Switch:xw,Table:Sw,Tabs:Tw,Tag:Lu,Thing:Rw,TimePicker:uf,Timeline:Aw,Tooltip:Di,Transfer:Ew,Tree:wf,TreeSelect:Mw,Typography:kw,Upload:Ow,Watermark:Bw,Split:D2,FloatButton:Lw,FloatButtonGroup:L2,Marquee:z2};function Wo(e,t){return typeof document>"u"?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function MP(){const e=Wo("--bg","#0b1020"),t=Wo("--fg","#e2e8f0"),o=Wo("--fg-dim","#94a3b8"),r=Wo("--panel","#0f172a"),n=Wo("--border","#1e293b"),i=Wo("--accent","#60a5fa"),a=Wo("--bad","#f87171");return{common:{bodyColor:e,textColorBase:t,textColor1:t,textColor2:t,textColor3:o,primaryColor:i,primaryColorHover:i,primaryColorPressed:i,borderColor:n,cardColor:r,errorColor:a}}}const zP=Y(()=>Pn.value==="zh-CN"?{locale:_b,dateLocale:Uv}:{locale:Qd,dateLocale:tu});function HP(){return{t:fo,languageOptions:Gg,localePreference:Fi,resolvedLocale:Pn,setLocalePreference:Kg}}export{Ro as $,Tn as A,y1 as B,fy as C,An as D,gy as E,et as F,L as G,pe as H,vy as I,fP as J,V as K,re as L,gu as M,Iu as N,Po as O,Ke as P,cC as Q,K as R,Hu as S,ch as T,Ys as U,Fa as V,Cy as W,yP as X,M1 as Y,sP as Z,pp as _,pt as a,uu as a$,As as a0,ko as a1,Oy as a2,Uy as a3,HS as a4,vw as a5,ee as a6,Y as a7,Qt as a8,oP as a9,nP as aA,oa as aB,bu as aC,Sn as aD,Fp as aE,Db as aF,hP as aG,Vo as aH,MP as aI,hl as aJ,Im as aK,y as aL,K2 as aM,TP as aN,vn as aO,iu as aP,rP as aQ,Le as aR,ki as aS,Rm as aT,Fm as aU,Ou as aV,Wy as aW,Ea as aX,Pr as aY,ml as aZ,Ii as a_,yd as aa,va as ab,J2 as ac,Y2 as ad,$a as ae,mP as af,ae as ag,X2 as ah,xa as ai,vP as aj,ht as ak,bn as al,_P as am,PP as an,$P as ao,He as ap,ms as aq,Be as ar,Y1 as as,W2 as at,Z1 as au,xl as av,hv as aw,_i as ax,Yy as ay,$y as az,Sm as b,fo as b$,au as b0,_x as b1,lu as b2,iP as b3,Ym as b4,ir as b5,Ir as b6,su as b7,gr as b8,ot as b9,zr as bA,V1 as bB,po as bC,pP as bD,eS as bE,Ci as bF,el as bG,fe as bH,Ab as bI,G2 as bJ,vh as bK,gP as bL,Mr as bM,Fs as bN,U2 as bO,q2 as bP,Qr as bQ,Ib as bR,$t as bS,ho as bT,Ar as bU,lP as bV,U1 as bW,Kg as bX,Ac as bY,AP as bZ,zs as b_,Ob as ba,Eb as bb,pu as bc,_s as bd,aP as be,da as bf,Sd as bg,mS as bh,zP as bi,nn as bj,Ga as bk,qa as bl,lo as bm,Fb as bn,Go as bo,Kc as bp,Pi as bq,nr as br,Yc as bs,Mo as bt,j2 as bu,Zc as bv,ba as bw,Tx as bx,G1 as by,FP as bz,Ho as c,Rb as c0,iS as c1,Hb as c2,Rp as c3,dC as c4,we as c5,Dt as c6,N2 as c7,d0 as c8,J1 as c9,eP as cA,Xp as ca,zo as cb,Zd as cc,HP as cd,ly as ce,hn as cf,bP as cg,Km as ch,$n as ci,Ei as cj,_r as ck,Ct as cl,Fr as cm,zg as cn,Q2 as co,Hg as cp,kg as cq,ls as cr,Z2 as cs,cP as ct,Aa as cu,Zt as cv,sn as cw,lh as cx,V2 as cy,tP as cz,Tr as d,vl as e,By as f,SP as g,wP as h,Eu as i,IP as j,EP as k,Hi as l,CP as m,RP as n,Er as o,xy as p,wr as q,$i as r,un as s,Ms as t,xP as u,dP as v,Px as w,o0 as x,ry as y,uC as z}; diff --git a/internal/relay/web-dist/assets/version-Dm8mqW3q.js b/internal/relay/web-dist/assets/version-DDxXxorX.js similarity index 62% rename from internal/relay/web-dist/assets/version-Dm8mqW3q.js rename to internal/relay/web-dist/assets/version-DDxXxorX.js index 4f65755e..a2fdda17 100644 --- a/internal/relay/web-dist/assets/version-Dm8mqW3q.js +++ b/internal/relay/web-dist/assets/version-DDxXxorX.js @@ -1 +1 @@ -import{a as t,A as e}from"./client-DMh7GjbV.js";import{b$ as n}from"./useI18n-lwZlSdSx.js";function s(r,o=n){return o("common.versionLabel",{version:r||"dev"})}async function c(){try{const{data:r}=await t("/api/version");return r.version}catch(r){if(!(r instanceof e))throw r;return"dev"}}export{c as fetchVersion,s as formatVersionLabel}; +import{a as t,A as e}from"./client-n-fLEpOg.js";import{b$ as n}from"./useI18n-D4u8zssu.js";function s(r,o=n){return o("common.versionLabel",{version:r||"dev"})}async function c(){try{const{data:r}=await t("/api/version");return r.version}catch(r){if(!(r instanceof e))throw r;return"dev"}}export{c as fetchVersion,s as formatVersionLabel}; diff --git a/internal/relay/web-dist/firstrun.html b/internal/relay/web-dist/firstrun.html index a34a83cb..c14a506b 100644 --- a/internal/relay/web-dist/firstrun.html +++ b/internal/relay/web-dist/firstrun.html @@ -7,13 +7,13 @@ AT Term · setup - - - - - - - + + + + + + + diff --git a/internal/relay/web-dist/index.html b/internal/relay/web-dist/index.html index 82d149e0..1aff32c4 100644 --- a/internal/relay/web-dist/index.html +++ b/internal/relay/web-dist/index.html @@ -11,13 +11,13 @@ AT Term - - - - - - - + + + + + + +
diff --git a/internal/relay/web-dist/login.html b/internal/relay/web-dist/login.html index 1ad31bd3..16437113 100644 --- a/internal/relay/web-dist/login.html +++ b/internal/relay/web-dist/login.html @@ -7,13 +7,13 @@ AT Term · sign in - - - - - - - + + + + + + + diff --git a/internal/relay/web-dist/setup.html b/internal/relay/web-dist/setup.html index 2f287308..7db5d3dd 100644 --- a/internal/relay/web-dist/setup.html +++ b/internal/relay/web-dist/setup.html @@ -10,10 +10,10 @@ AT Term · setup - - - - + + + + diff --git a/internal/relay/web-dist/signup.html b/internal/relay/web-dist/signup.html index 1c988774..57d9d324 100644 --- a/internal/relay/web-dist/signup.html +++ b/internal/relay/web-dist/signup.html @@ -7,13 +7,13 @@ AT Term · sign up - - - - - - - + + + + + + + diff --git a/internal/relay/web-dist/sw.js b/internal/relay/web-dist/sw.js index 0bd36c85..dabca570 100644 --- a/internal/relay/web-dist/sw.js +++ b/internal/relay/web-dist/sw.js @@ -1 +1 @@ -if(!self.define){let s,e={};const i=(i,l)=>(i=new URL(i+".js",l).href,e[i]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=i,s.onload=e,document.head.appendChild(s)}else s=i,importScripts(i),e()}).then(()=>{let s=e[i];if(!s)throw new Error(`Module ${i} didn’t register its module`);return s}));self.define=(l,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let u={};const o=s=>i(s,r),t={module:{uri:r},exports:u,require:o};e[r]=Promise.all(l.map(s=>t[s]||o(s))).then(s=>(n(...s),u))}}define(["./workbox-0bb07689"],function(s){"use strict";importScripts("notification-click.js"),self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"signup.html",revision:"24a20311f461b336be3112fdfcb43c24"},{url:"setup.html",revision:"19d5c9b75b6e902244f779e98a954175"},{url:"notification-click.js",revision:"bb04a6b8230e48578719120cf2c820cf"},{url:"manifest.webmanifest",revision:"ee62007ccffc3e46461d5812bb890bf8"},{url:"login.html",revision:"e65764737341c2e2e90415287e07fea4"},{url:"index.html",revision:"0ed2d18dc53f55f416dd862bee9e30ea"},{url:"icon.svg",revision:"2ef190cf56a973b4e843228dc551b92e"},{url:"icon.png",revision:"9ee6de251ff079b039219fb78a2a1776"},{url:"firstrun.html",revision:"39d15aa3d9dc27af848e55302678a9ec"},{url:"assets/workbox-window.prod.es5-BqEJf4Xk.js",revision:null},{url:"assets/wasm_exec-vVX9mWnE.js",revision:null},{url:"assets/wasm_exec-BVJFcdQq.js",revision:null},{url:"assets/version-Dm8mqW3q.js",revision:null},{url:"assets/useI18n-lwZlSdSx.js",revision:null},{url:"assets/toml-Bm5Em-hy.js",revision:null},{url:"assets/swift-BzpIVaGY.js",revision:null},{url:"assets/signup-zTxZ2Ho_.css",revision:null},{url:"assets/signup-BXhwDxUo.js",revision:null},{url:"assets/shell-CjFT_Tl9.js",revision:null},{url:"assets/setup-WUaGlTjO.js",revision:null},{url:"assets/setup-BisxzT2E.css",revision:null},{url:"assets/sessions-RpM2fLHY.js",revision:null},{url:"assets/ruby-B2Rjki9n.js",revision:null},{url:"assets/pwa-BO-YW0rH.js",revision:null},{url:"assets/properties-C78fOPTZ.js",revision:null},{url:"assets/prefsSync-C5tz9Q-s.js",revision:null},{url:"assets/opaque-BH0YqBjY.js",revision:null},{url:"assets/mobile-guard-Cco5WjS8.js",revision:null},{url:"assets/mobile-guard-CPlabY_J.css",revision:null},{url:"assets/lua-VAEuO923.js",revision:null},{url:"assets/login-B2LUhNm2.css",revision:null},{url:"assets/login-B-BiQRGX.js",revision:null},{url:"assets/index-gs2Ov3d4.js",revision:null},{url:"assets/index-cGfdCuRo.js",revision:null},{url:"assets/index-KcexLGIr.js",revision:null},{url:"assets/index-Dy-6tZbQ.js",revision:null},{url:"assets/index-Di5PmtZ2.js",revision:null},{url:"assets/index-DfP-AjMF.css",revision:null},{url:"assets/index-DblmzGAc.js",revision:null},{url:"assets/index-DZaDIMfZ.js",revision:null},{url:"assets/index-DTgf7QAl.js",revision:null},{url:"assets/index-DRFRE0Ca.js",revision:null},{url:"assets/index-DR4XN96w.js",revision:null},{url:"assets/index-DB-c3u2H.js",revision:null},{url:"assets/index-D8AWWFft.js",revision:null},{url:"assets/index-CidLZrB5.js",revision:null},{url:"assets/index-Ci2MtInW.js",revision:null},{url:"assets/index-CVE6o20G.js",revision:null},{url:"assets/index-CHTSx7s6.js",revision:null},{url:"assets/index-C5ykaaYB.js",revision:null},{url:"assets/index-BKUnbiGw.js",revision:null},{url:"assets/index-BKS_vG9j.js",revision:null},{url:"assets/index-B5lmJj73.js",revision:null},{url:"assets/firstrun-dxEwnRB_.css",revision:null},{url:"assets/firstrun-BX3Qt0kf.js",revision:null},{url:"assets/dockerfile-ZL4hHokT.js",revision:null},{url:"assets/diff-DbItnlRl.js",revision:null},{url:"assets/clike-B9uivgTg.js",revision:null},{url:"assets/client-DMh7GjbV.js",revision:null},{url:"assets/auth-B3RxKR1W.js",revision:null},{url:"assets/Switch-DguIL3dU.js",revision:null},{url:"assets/FileExplorer-DKo_tolh.css",revision:null},{url:"assets/FileExplorer-BumK3wPT.js",revision:null},{url:"icon.png",revision:"9ee6de251ff079b039219fb78a2a1776"},{url:"icon.svg",revision:"2ef190cf56a973b4e843228dc551b92e"},{url:"manifest.webmanifest",revision:"ee62007ccffc3e46461d5812bb890bf8"}],{}),s.cleanupOutdatedCaches()}); +if(!self.define){let s,e={};const i=(i,l)=>(i=new URL(i+".js",l).href,e[i]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=i,s.onload=e,document.head.appendChild(s)}else s=i,importScripts(i),e()}).then(()=>{let s=e[i];if(!s)throw new Error(`Module ${i} didn’t register its module`);return s}));self.define=(l,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let u={};const o=s=>i(s,r),t={module:{uri:r},exports:u,require:o};e[r]=Promise.all(l.map(s=>t[s]||o(s))).then(s=>(n(...s),u))}}define(["./workbox-0bb07689"],function(s){"use strict";importScripts("notification-click.js"),self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"signup.html",revision:"34d8d08cca6256ed8761b4429e5fef3e"},{url:"setup.html",revision:"b362c8292a72993d710eb69f47080f03"},{url:"notification-click.js",revision:"bb04a6b8230e48578719120cf2c820cf"},{url:"manifest.webmanifest",revision:"ee62007ccffc3e46461d5812bb890bf8"},{url:"login.html",revision:"0cf8528d8f961754e2bf57d6bf33088d"},{url:"index.html",revision:"8c00c9085843c137c77f9f31ad4f39f5"},{url:"icon.svg",revision:"2ef190cf56a973b4e843228dc551b92e"},{url:"icon.png",revision:"9ee6de251ff079b039219fb78a2a1776"},{url:"firstrun.html",revision:"31cdad226e2442e9dcd05c2fbb3ca517"},{url:"assets/workbox-window.prod.es5-BqEJf4Xk.js",revision:null},{url:"assets/wasm_exec-vVX9mWnE.js",revision:null},{url:"assets/wasm_exec-BVJFcdQq.js",revision:null},{url:"assets/version-DDxXxorX.js",revision:null},{url:"assets/useI18n-D4u8zssu.js",revision:null},{url:"assets/toml-Bm5Em-hy.js",revision:null},{url:"assets/swift-BzpIVaGY.js",revision:null},{url:"assets/signup-zTxZ2Ho_.css",revision:null},{url:"assets/signup-CLz9yc9B.js",revision:null},{url:"assets/shell-CjFT_Tl9.js",revision:null},{url:"assets/setup-UJjLdwJk.js",revision:null},{url:"assets/setup-BisxzT2E.css",revision:null},{url:"assets/sessions-BYTwjtj6.js",revision:null},{url:"assets/ruby-B2Rjki9n.js",revision:null},{url:"assets/pwa-CEp47jJM.js",revision:null},{url:"assets/properties-C78fOPTZ.js",revision:null},{url:"assets/prefsSync-Dj3wNxrO.js",revision:null},{url:"assets/opaque-BH0YqBjY.js",revision:null},{url:"assets/mobile-guard-CPlabY_J.css",revision:null},{url:"assets/mobile-guard-B4PiwDK4.js",revision:null},{url:"assets/lua-VAEuO923.js",revision:null},{url:"assets/login-TRn4eBSs.js",revision:null},{url:"assets/login-B2LUhNm2.css",revision:null},{url:"assets/index-zrZBIArQ.js",revision:null},{url:"assets/index-_4Qee-Ew.js",revision:null},{url:"assets/index-HGllhEs0.js",revision:null},{url:"assets/index-DoVrcQoW.js",revision:null},{url:"assets/index-DmukWKLV.js",revision:null},{url:"assets/index-DlIw5VzR.js",revision:null},{url:"assets/index-DPMPlQhe.js",revision:null},{url:"assets/index-DDP-KCe3.js",revision:null},{url:"assets/index-D8AWWFft.js",revision:null},{url:"assets/index-Ck_fIti9.js",revision:null},{url:"assets/index-ChT88caY.js",revision:null},{url:"assets/index-CehbsLvs.js",revision:null},{url:"assets/index-CR9U8Dqy.css",revision:null},{url:"assets/index-CKUfNIJP.js",revision:null},{url:"assets/index-C7tiEnPN.js",revision:null},{url:"assets/index-C1t4FMl1.js",revision:null},{url:"assets/index-Bf0-KgBD.js",revision:null},{url:"assets/index-BSbI304G.js",revision:null},{url:"assets/index-BBTANB6i.js",revision:null},{url:"assets/index-B6JsQQbt.js",revision:null},{url:"assets/index-8SnOqa2v.js",revision:null},{url:"assets/firstrun-dxEwnRB_.css",revision:null},{url:"assets/firstrun-BwaQ7wyz.js",revision:null},{url:"assets/dockerfile-ZL4hHokT.js",revision:null},{url:"assets/diff-DbItnlRl.js",revision:null},{url:"assets/clike-B9uivgTg.js",revision:null},{url:"assets/client-n-fLEpOg.js",revision:null},{url:"assets/auth-BBmiA1GG.js",revision:null},{url:"assets/Switch-BlSJOKEO.js",revision:null},{url:"assets/FileExplorer-DKo_tolh.css",revision:null},{url:"assets/FileExplorer-BmPzqkbb.js",revision:null},{url:"icon.png",revision:"9ee6de251ff079b039219fb78a2a1776"},{url:"icon.svg",revision:"2ef190cf56a973b4e843228dc551b92e"},{url:"manifest.webmanifest",revision:"ee62007ccffc3e46461d5812bb890bf8"}],{}),s.cleanupOutdatedCaches()}); diff --git a/internal/userstore/contract_test.go b/internal/userstore/contract_test.go index f33a4572..eaa9aed8 100644 --- a/internal/userstore/contract_test.go +++ b/internal/userstore/contract_test.go @@ -409,5 +409,37 @@ func runStoreContract(t *testing.T, open func(t *testing.T) *DBStore) { if err := st.AddTrafficDeltas(ctx, day, nil); err != nil { t.Errorf("AddTrafficDeltas(nil): %v", err) } + filtered, err := st.QueryTrafficForUser(ctx, "u1", "2026-09-01", "2026-09-30") + if err != nil || len(filtered) != 2 { + t.Errorf("QueryTrafficForUser: len=%d err=%v", len(filtered), err) + } + if other, err := st.QueryTrafficForUser(ctx, "u2", "2026-09-01", "2026-09-30"); err != nil || len(other) != 0 { + t.Errorf("QueryTrafficForUser(u2): len=%d err=%v", len(other), err) + } + }) + + t.Run("direct traffic rollup", func(t *testing.T) { + st := open(t) + day := "2026-09-15" + for _, delta := range []DirectTrafficDelta{ + {UserID: "u1", Attempts: 2, Successes: 1, Fallbacks: 1, BytesSent: 100, BytesReceived: 20}, + {UserID: "u1", Attempts: 1, Successes: 1, BytesSent: 50, BytesReceived: 10}, + {UserID: "u2", Attempts: 9, Successes: 9, BytesSent: 999}, + } { + if err := st.AddDirectTrafficDeltas(ctx, day, []DirectTrafficDelta{delta}); err != nil { + t.Fatalf("AddDirectTrafficDeltas: %v", err) + } + } + rows, err := st.QueryDirectTraffic(ctx, "u1", "2026-09-01", "2026-09-30") + if err != nil || len(rows) != 1 { + t.Fatalf("QueryDirectTraffic: rows=%+v err=%v", rows, err) + } + got := rows[0] + if got.Attempts != 3 || got.Successes != 2 || got.Fallbacks != 1 || got.BytesSent != 150 || got.BytesReceived != 30 { + t.Errorf("direct rollup = %+v", got) + } + if err := st.AddDirectTrafficDeltas(ctx, day, nil); err != nil { + t.Errorf("AddDirectTrafficDeltas(nil): %v", err) + } }) } diff --git a/internal/userstore/migrations/postgres/0013_direct_traffic.sql b/internal/userstore/migrations/postgres/0013_direct_traffic.sql new file mode 100644 index 00000000..d1c73863 --- /dev/null +++ b/internal/userstore/migrations/postgres/0013_direct_traffic.sql @@ -0,0 +1,12 @@ +CREATE TABLE direct_traffic_daily ( + user_id TEXT NOT NULL, + day TEXT NOT NULL, + attempts BIGINT NOT NULL DEFAULT 0, + successes BIGINT NOT NULL DEFAULT 0, + fallbacks BIGINT NOT NULL DEFAULT 0, + bytes_sent BIGINT NOT NULL DEFAULT 0, + bytes_received BIGINT NOT NULL DEFAULT 0, + updated_at BIGINT NOT NULL, + PRIMARY KEY (user_id, day) +); +CREATE INDEX idx_direct_traffic_day ON direct_traffic_daily (day); diff --git a/internal/userstore/migrations/sqlite/0013_direct_traffic.sql b/internal/userstore/migrations/sqlite/0013_direct_traffic.sql new file mode 100644 index 00000000..d1c73863 --- /dev/null +++ b/internal/userstore/migrations/sqlite/0013_direct_traffic.sql @@ -0,0 +1,12 @@ +CREATE TABLE direct_traffic_daily ( + user_id TEXT NOT NULL, + day TEXT NOT NULL, + attempts BIGINT NOT NULL DEFAULT 0, + successes BIGINT NOT NULL DEFAULT 0, + fallbacks BIGINT NOT NULL DEFAULT 0, + bytes_sent BIGINT NOT NULL DEFAULT 0, + bytes_received BIGINT NOT NULL DEFAULT 0, + updated_at BIGINT NOT NULL, + PRIMARY KEY (user_id, day) +); +CREATE INDEX idx_direct_traffic_day ON direct_traffic_daily (day); diff --git a/internal/userstore/store.go b/internal/userstore/store.go index 59e312c4..92648cd1 100644 --- a/internal/userstore/store.go +++ b/internal/userstore/store.go @@ -233,6 +233,9 @@ type Store interface { // caller to aggregate into detail/group/summary views. AddTrafficDeltas(ctx context.Context, day string, deltas []TrafficDelta) error QueryTraffic(ctx context.Context, from, to string) ([]TrafficRow, error) + QueryTrafficForUser(ctx context.Context, userID, from, to string) ([]TrafficRow, error) + AddDirectTrafficDeltas(ctx context.Context, day string, deltas []DirectTrafficDelta) error + QueryDirectTraffic(ctx context.Context, userID, from, to string) ([]DirectTrafficRow, error) Close() error } diff --git a/internal/userstore/traffic.go b/internal/userstore/traffic.go index ca7b8e3d..9b86c447 100644 --- a/internal/userstore/traffic.go +++ b/internal/userstore/traffic.go @@ -25,6 +25,27 @@ type TrafficRow struct { Frames int64 } +// DirectTrafficDelta is one user's aggregate P2P usage increment. +type DirectTrafficDelta struct { + UserID string + Attempts int64 + Successes int64 + Fallbacks int64 + BytesSent int64 + BytesReceived int64 +} + +// DirectTrafficRow is one persisted per-user, per-day P2P rollup row. +type DirectTrafficRow struct { + UserID string + Day string + Attempts int64 + Successes int64 + Fallbacks int64 + BytesSent int64 + BytesReceived int64 +} + // AddTrafficDeltas folds deltas into relay_traffic_daily for the given UTC // day. Each (user_id, day, frame_type, direction) row is upserted with // bytes/frames accumulated, so multiple relay instances writing the same @@ -78,3 +99,82 @@ func (s *DBStore) QueryTraffic(ctx context.Context, from, to string) ([]TrafficR } return out, rows.Err() } + +// QueryTrafficForUser returns only userID's relay rollups in [from, to]. +// Keeping the filter in SQL prevents personal-account handlers from ever +// loading another account's usage into memory. +func (s *DBStore) QueryTrafficForUser(ctx context.Context, userID, from, to string) ([]TrafficRow, error) { + rows, err := s.db.QueryContext(ctx, s.dia.Rebind( + `SELECT user_id, day, frame_type, direction, bytes, frames + FROM relay_traffic_daily + WHERE user_id = ? AND day >= ? AND day <= ? + ORDER BY day, frame_type, direction`), userID, from, to) + if err != nil { + return nil, fmt.Errorf("query user traffic: %w", err) + } + defer rows.Close() + var out []TrafficRow + for rows.Next() { + var r TrafficRow + if err := rows.Scan(&r.UserID, &r.Day, &r.FrameType, &r.Direction, &r.Bytes, &r.Frames); err != nil { + return nil, fmt.Errorf("scan user traffic: %w", err) + } + out = append(out, r) + } + return out, rows.Err() +} + +// AddDirectTrafficDeltas folds aggregate P2P deltas into the UTC daily +// rollup. The additive upsert converges when several relay instances share +// the same Postgres database. +func (s *DBStore) AddDirectTrafficDeltas(ctx context.Context, day string, deltas []DirectTrafficDelta) error { + if len(deltas) == 0 { + return nil + } + tx, err := s.db.BeginTx(ctx, nil) + if err != nil { + return fmt.Errorf("begin direct traffic tx: %w", err) + } + now := time.Now().Unix() + stmt := s.dia.Rebind(`INSERT INTO direct_traffic_daily + (user_id, day, attempts, successes, fallbacks, bytes_sent, bytes_received, updated_at) + VALUES (?, ?, ?, ?, ?, ?, ?, ?) + ON CONFLICT (user_id, day) + DO UPDATE SET attempts = direct_traffic_daily.attempts + excluded.attempts, + successes = direct_traffic_daily.successes + excluded.successes, + fallbacks = direct_traffic_daily.fallbacks + excluded.fallbacks, + bytes_sent = direct_traffic_daily.bytes_sent + excluded.bytes_sent, + bytes_received = direct_traffic_daily.bytes_received + excluded.bytes_received, + updated_at = excluded.updated_at`) + for _, d := range deltas { + if _, err := tx.ExecContext(ctx, stmt, d.UserID, day, d.Attempts, d.Successes, + d.Fallbacks, d.BytesSent, d.BytesReceived, now); err != nil { + tx.Rollback() + return fmt.Errorf("upsert direct traffic: %w", err) + } + } + return tx.Commit() +} + +// QueryDirectTraffic returns userID's P2P rollups in [from, to]. +func (s *DBStore) QueryDirectTraffic(ctx context.Context, userID, from, to string) ([]DirectTrafficRow, error) { + rows, err := s.db.QueryContext(ctx, s.dia.Rebind( + `SELECT user_id, day, attempts, successes, fallbacks, bytes_sent, bytes_received + FROM direct_traffic_daily + WHERE user_id = ? AND day >= ? AND day <= ? + ORDER BY day`), userID, from, to) + if err != nil { + return nil, fmt.Errorf("query direct traffic: %w", err) + } + defer rows.Close() + var out []DirectTrafficRow + for rows.Next() { + var r DirectTrafficRow + if err := rows.Scan(&r.UserID, &r.Day, &r.Attempts, &r.Successes, &r.Fallbacks, + &r.BytesSent, &r.BytesReceived); err != nil { + return nil, fmt.Errorf("scan direct traffic: %w", err) + } + out = append(out, r) + } + return out, rows.Err() +} diff --git a/web/src/shared/api/me.ts b/web/src/shared/api/me.ts index 0f64feae..8fd28be6 100644 --- a/web/src/shared/api/me.ts +++ b/web/src/shared/api/me.ts @@ -1,6 +1,6 @@ import { apiFetch } from './client' import { requestStepUpToken } from './stepup' -import type { MeResponse } from './types' +import type { MeResponse, MeTrafficResponse } from './types' // getMe fetches the current user. The relay no longer issues CSRF // tokens (session_token in Authorization: Bearer is sufficient @@ -10,6 +10,12 @@ export async function getMe(): Promise { return data } +export async function getMeTraffic(from: string, to: string): Promise { + const query = new URLSearchParams({ from, to }) + const { data } = await apiFetch(`/api/me/traffic?${query}`) + return data +} + // Password (settings → Change Password tab). // // This intentionally restores the pre-stepup shape: POST /api/me/password diff --git a/web/src/shared/api/types.ts b/web/src/shared/api/types.ts index 5bb6ba4a..c23af07f 100644 --- a/web/src/shared/api/types.ts +++ b/web/src/shared/api/types.ts @@ -5,6 +5,41 @@ export interface MeResponse { csrf_token?: string } +export interface MeRelayTrafficDay { + day: string + bytes_in: number + bytes_out: number + frames_in: number + frames_out: number +} + +export interface MeDirectTrafficDay { + day: string + attempts: number + successes: number + fallbacks: number + bytes_sent: number + bytes_received: number +} + +export interface MeRelayTrafficDetail { + day: string + frame_type: number + frame_type_name: string + category: string + direction: number + bytes: number + frames: number +} + +export interface MeTrafficResponse { + from: string + to: string + relay: MeRelayTrafficDay[] + relay_detail: MeRelayTrafficDetail[] + direct: MeDirectTrafficDay[] +} + export interface AuthSuccess { user_id: string email: string @@ -177,6 +212,11 @@ export interface AdminHealthResponse { active_sessions: number relay_instances: number traffic_flush_interval_seconds: number + direct_attempts: number + direct_signal_enabled: boolean + direct_successes: number + direct_fallbacks: number + direct_bytes_avoided: number generated_at: string health_check_warnings?: string[] } diff --git a/web/src/shared/i18n/messages/en.ts b/web/src/shared/i18n/messages/en.ts index cc61e3cb..75de1520 100644 --- a/web/src/shared/i18n/messages/en.ts +++ b/web/src/shared/i18n/messages/en.ts @@ -183,6 +183,16 @@ export const en = { liveValue: 'Live on this node', liveInstances: 'Heartbeat within 90s', flushEvery: 'Traffic flushes every {seconds}s', + directAttempts: 'Direct attempts', + directAttemptsHint: 'Since this Relay started', + directEnabled: 'Signaling enabled', + directDisabled: 'Signaling disabled', + directSuccesses: 'Direct successes', + directSuccessesHint: 'Authenticated data channels', + directFallbacks: 'Direct fallbacks', + directFallbacksHint: 'Setup failures and route loss', + directBytesAvoided: 'Relay bytes avoided', + directBytesAvoidedHint: 'Estimated from host reports', userScope: 'User scope', userAnalysis: 'User traffic analysis', range: 'Date range', @@ -260,6 +270,9 @@ export const en = { categories: { terminal: 'Terminal relay', state: 'State sync', + config: 'Configuration', + fs: 'File browser', + preview: 'Remote preview', filesystem: 'File browser', service: 'Remote preview', control: 'Control', diff --git a/web/src/shared/i18n/messages/zh-CN.ts b/web/src/shared/i18n/messages/zh-CN.ts index 47b11a1d..70f545cd 100644 --- a/web/src/shared/i18n/messages/zh-CN.ts +++ b/web/src/shared/i18n/messages/zh-CN.ts @@ -185,6 +185,16 @@ export const zhCN = { liveValue: '当前节点实时值', liveInstances: '90 秒内有心跳', flushEvery: '流量每 {seconds} 秒入库', + directAttempts: '直连尝试', + directAttemptsHint: '当前 Relay 进程启动以来', + directEnabled: '信令已启用', + directDisabled: '信令已关闭', + directSuccesses: '直连成功', + directSuccessesHint: '已完成认证的数据通道', + directFallbacks: '直连回退', + directFallbacksHint: '建立失败与活跃通道中断', + directBytesAvoided: '节省 Relay 流量', + directBytesAvoidedHint: '根据 host 上报估算', userScope: '用户范围', userAnalysis: '用户流量分析', range: '时间范围', @@ -262,6 +272,9 @@ export const zhCN = { categories: { terminal: '终端转发', state: '状态同步', + config: '配置同步', + fs: '文件浏览', + preview: '远程预览', filesystem: '文件浏览', service: '远程预览', control: '控制信令', diff --git a/web/tests/unit/shared/api/me.test.ts b/web/tests/unit/shared/api/me.test.ts index ea130170..07491698 100644 --- a/web/tests/unit/shared/api/me.test.ts +++ b/web/tests/unit/shared/api/me.test.ts @@ -8,7 +8,7 @@ vi.mock('@shared/lib/opaqueWasm', () => ({ opaqueLoginFinish: vi.fn(async () => ({ ke3: 'a2Uz', exportKey: '', sessionKey: '' })), })) -import { getMe, changePassword, deleteMe } from '@shared/api/me' +import { getMe, getMeTraffic, changePassword, deleteMe } from '@shared/api/me' import { clearRelayConfig, saveRelayConfig } from '@shared/api/relay-config' function jsonResponse(status: number, body: unknown): Response { @@ -103,4 +103,13 @@ describe('me.ts /api/me get', () => { expect(result).toEqual({ user_id: 'u1', email: 'a@b' }) expect(fetchMock.mock.calls[0]![0]).toBe('/api/me') }) + + it('getMeTraffic scopes the requested date range to the current-user endpoint', async () => { + const body = { from: '2026-09-17', to: '2026-09-23', relay: [], relay_detail: [], direct: [] } + const fetchMock = vi.fn().mockResolvedValue(jsonResponse(200, body)) + vi.stubGlobal('fetch', fetchMock) + + await expect(getMeTraffic(body.from, body.to)).resolves.toEqual(body) + expect(fetchMock.mock.calls[0]![0]).toBe('/api/me/traffic?from=2026-09-17&to=2026-09-23') + }) })