From 75d38964a278b0be366ec7da816117b47a2bd661 Mon Sep 17 00:00:00 2001 From: TizenryA Date: Tue, 14 Jul 2026 09:56:01 +0800 Subject: [PATCH 01/16] =?UTF-8?q?feat:=20=E5=9F=BA=E4=BA=8E=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E7=89=88=E8=BF=81=E7=A7=BB=20Console=20Multi-Agent=20?= =?UTF-8?q?=E4=B8=8E=E5=AA=92=E4=BD=93=E7=AE=A1=E7=90=86=E9=93=BE=E8=B7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/internal/app/application.go | 4 +- .../application/gateway/video_test.go | 4 + backend/internal/application/media/service.go | 79 +- .../application/media/service_test.go | 6 +- .../relational/media_repository.go | 61 + .../relational/media_repository_test.go | 191 + .../internal/infra/provider/web/adapter.go | 7 + .../internal/infra/provider/web/catalog.go | 24 +- backend/internal/infra/provider/web/chat.go | 63 +- .../internal/infra/provider/web/console.go | 160 + .../infra/provider/web/console_test.go | 145 + .../infra/provider/web/protocol_test.go | 63 +- backend/internal/repository/media.go | 3 + .../internal/transport/http/media/handler.go | 129 + .../transport/http/media/handler_test.go | 2 +- backend/internal/transport/http/server.go | 4 +- frontend/package-lock.json | 4827 +++++++++++++++++ frontend/src/app/app-shell.tsx | 2 + frontend/src/app/deferred-pages.tsx | 10 + frontend/src/app/router.tsx | 4 +- frontend/src/features/media/gallery-page.tsx | 154 + frontend/src/features/media/media-api.ts | 90 + frontend/src/features/media/types.ts | 28 + .../src/features/media/video-gallery-page.tsx | 230 + frontend/src/shared/i18n/index.ts | 48 +- 25 files changed, 6301 insertions(+), 37 deletions(-) create mode 100644 backend/internal/infra/persistence/relational/media_repository_test.go create mode 100644 backend/internal/infra/provider/web/console.go create mode 100644 backend/internal/infra/provider/web/console_test.go create mode 100644 frontend/package-lock.json create mode 100644 frontend/src/features/media/gallery-page.tsx create mode 100644 frontend/src/features/media/media-api.ts create mode 100644 frontend/src/features/media/types.ts create mode 100644 frontend/src/features/media/video-gallery-page.tsx diff --git a/backend/internal/app/application.go b/backend/internal/app/application.go index 539db31b..2a4aa479 100644 --- a/backend/internal/app/application.go +++ b/backend/internal/app/application.go @@ -150,7 +150,7 @@ func New(ctx context.Context, cfg config.Config, logger *slog.Logger) (*Applicat database.Close() return nil, fmt.Errorf("不支持的运行态驱动: %s", cfg.RuntimeStore.Driver) } - mediaService := mediaapp.NewService(mediaAssetRepo, localMediaStore, refreshLock, mediaConfig(cfg)) + mediaService := mediaapp.NewService(mediaAssetRepo, mediaJobRepo, localMediaStore, refreshLock, mediaConfig(cfg)) egressManager := infraegress.NewManager(egressRepo, cipher) cliAdapter := cliprovider.NewAdapter(cliprovider.Config{BaseURL: cfg.Provider.Build.BaseURL, ClientVersion: cfg.Provider.Build.ClientVersion, ClientIdentifier: cfg.Provider.Build.ClientIdentifier, TokenAuth: cfg.Provider.Build.TokenAuth, UserAgent: cfg.Provider.Build.UserAgent}, cipher) @@ -276,7 +276,7 @@ func maxBatchConcurrency(value config.BatchConfig) int { func webProviderConfig(cfg config.Config) webprovider.Config { return webprovider.Config{ - BaseURL: cfg.Provider.Web.BaseURL, QuotaTimeoutSeconds: int(cfg.Provider.Web.QuotaTimeout.Value().Seconds()), + BaseURL: cfg.Provider.Web.BaseURL, ConsoleBaseURL: "https://console.x.ai", QuotaTimeoutSeconds: int(cfg.Provider.Web.QuotaTimeout.Value().Seconds()), StatsigMode: cfg.Provider.Web.StatsigMode, StatsigManualValue: cfg.Provider.Web.StatsigManualValue, StatsigSignerURL: cfg.Provider.Web.StatsigSignerURL, ChatTimeoutSeconds: int(cfg.Provider.Web.ChatTimeout.Value().Seconds()), ImageTimeoutSeconds: int(cfg.Provider.Web.ImageTimeout.Value().Seconds()), diff --git a/backend/internal/application/gateway/video_test.go b/backend/internal/application/gateway/video_test.go index 6b433430..335d67ef 100644 --- a/backend/internal/application/gateway/video_test.go +++ b/backend/internal/application/gateway/video_test.go @@ -82,6 +82,10 @@ func (r *videoUsageRepository) GetMediaJob(context.Context, string, uint64) (med func (r *videoUsageRepository) UpdateMediaJob(context.Context, media.Job) error { return nil } +func (r *videoUsageRepository) ListMediaJobs(context.Context, int, int, string) ([]media.Job, int64, error) { + return nil, 0, nil +} + func (r *videoUsageRepository) ListRecoverableMediaJobs(context.Context, int) ([]media.Job, error) { return nil, nil } diff --git a/backend/internal/application/media/service.go b/backend/internal/application/media/service.go index 0da1620e..7786fb4e 100644 --- a/backend/internal/application/media/service.go +++ b/backend/internal/application/media/service.go @@ -21,13 +21,15 @@ import ( ) var ( - ErrAssetNotFound = errors.New("媒体资源不存在") - ErrInvalidImage = errors.New("图片内容无效") + ErrAssetNotFound = errors.New("媒体资源不存在") + ErrInvalidImage = errors.New("图片内容无效") + ErrMediaJobsUnavailable = errors.New("视频任务仓储未配置") ) // Service 负责图片校验、文件落盘和元数据持久化的一致性收口。 type Service struct { assets repository.MediaAssetRepository + jobs repository.MediaJobRepository objects repository.MediaObjectStorage cleanupLock repository.DistributedLock publicBaseURL string @@ -49,9 +51,22 @@ type Config struct { CleanupInterval time.Duration } -func NewService(assets repository.MediaAssetRepository, objects repository.MediaObjectStorage, cleanupLock repository.DistributedLock, cfg Config) *Service { +type ImageStats struct { + TotalImages int64 + TotalBytes int64 +} + +type VideoStats struct { + TotalJobs int64 + Completed int64 + Failed int64 + InProgress int64 + Queued int64 +} + +func NewService(assets repository.MediaAssetRepository, jobs repository.MediaJobRepository, objects repository.MediaObjectStorage, cleanupLock repository.DistributedLock, cfg Config) *Service { return &Service{ - assets: assets, objects: objects, cleanupLock: cleanupLock, + assets: assets, jobs: jobs, objects: objects, cleanupLock: cleanupLock, publicBaseURL: strings.TrimRight(cfg.PublicBaseURL, "/"), maxImageBytes: cfg.MaxImageBytes, maxTotalBytes: cfg.MaxTotalBytes, cleanupAt: cfg.CleanupThresholdPercent, cleanupEvery: cfg.CleanupInterval, cleanupSignal: make(chan struct{}, 1), configChanged: make(chan struct{}, 1), @@ -136,6 +151,62 @@ func (s *Service) OpenImage(ctx context.Context, id string) (mediadomain.Asset, return asset, body, nil } +// AdminListImages 分页返回图片资源列表。 +func (s *Service) AdminListImages(ctx context.Context, page, pageSize int) ([]mediadomain.Asset, int64, error) { + return s.assets.ListMediaAssets(ctx, page, pageSize) +} + +// AdminListVideoJobs 分页返回视频任务列表。 +func (s *Service) AdminListVideoJobs(ctx context.Context, page, pageSize int, status string) ([]mediadomain.Job, int64, error) { + if s.jobs == nil { + return nil, 0, ErrMediaJobsUnavailable + } + return s.jobs.ListMediaJobs(ctx, page, pageSize, strings.TrimSpace(status)) +} + +// AdminImageStats 返回图片统计信息。 +func (s *Service) AdminImageStats(ctx context.Context) (ImageStats, error) { + totalImages, err := s.assets.CountMediaAssets(ctx) + if err != nil { + return ImageStats{}, err + } + totalBytes, err := s.assets.TotalMediaAssetBytes(ctx) + if err != nil { + return ImageStats{}, err + } + return ImageStats{TotalImages: totalImages, TotalBytes: totalBytes}, nil +} + +// AdminVideoStats 返回视频任务统计信息。 +func (s *Service) AdminVideoStats(ctx context.Context) (VideoStats, error) { + if s.jobs == nil { + return VideoStats{}, ErrMediaJobsUnavailable + } + var stats VideoStats + var err error + _, stats.TotalJobs, err = s.jobs.ListMediaJobs(ctx, 1, 1, "") + if err != nil { + return VideoStats{}, err + } + _, stats.Completed, err = s.jobs.ListMediaJobs(ctx, 1, 1, string(mediadomain.StatusCompleted)) + if err != nil { + return VideoStats{}, err + } + _, stats.Failed, err = s.jobs.ListMediaJobs(ctx, 1, 1, string(mediadomain.StatusFailed)) + if err != nil { + return VideoStats{}, err + } + _, stats.InProgress, err = s.jobs.ListMediaJobs(ctx, 1, 1, string(mediadomain.StatusInProgress)) + if err != nil { + return VideoStats{}, err + } + _, stats.Queued, err = s.jobs.ListMediaJobs(ctx, 1, 1, string(mediadomain.StatusQueued)) + if err != nil { + return VideoStats{}, err + } + return stats, nil +} + // RunCleanup 响应容量阈值并按周期清理最旧媒体资源。 func (s *Service) RunCleanup(ctx context.Context, onError func(error)) { cfg := s.runtimeConfig() diff --git a/backend/internal/application/media/service_test.go b/backend/internal/application/media/service_test.go index 782184cc..52b4dea8 100644 --- a/backend/internal/application/media/service_test.go +++ b/backend/internal/application/media/service_test.go @@ -33,7 +33,7 @@ func TestServicePersistsAndReopensImage(t *testing.T) { if err != nil { t.Fatal(err) } - service := NewService(relational.NewMediaAssetRepository(database), objects, nil, Config{ + service := NewService(relational.NewMediaAssetRepository(database), relational.NewMediaJobRepository(database), objects, nil, Config{ PublicBaseURL: "https://api.example", MaxImageBytes: 32 << 20, MaxTotalBytes: 1 << 30, CleanupThresholdPercent: 80, CleanupInterval: 10 * time.Minute, }) @@ -96,7 +96,7 @@ func TestCleanupDeletesOldestAssetsAtThreshold(t *testing.T) { t.Fatal(err) } } - service := NewService(repository, objects, nil, Config{ + service := NewService(repository, relational.NewMediaJobRepository(database), objects, nil, Config{ PublicBaseURL: "https://api.example", MaxImageBytes: 32 << 20, MaxTotalBytes: int64(len(raw) * 2), CleanupThresholdPercent: 50, CleanupInterval: 10 * time.Minute, @@ -146,7 +146,7 @@ func TestCleanupPreservesMetadataWhenLocalObjectIsMissing(t *testing.T) { if err := objects.Delete(ctx, key); err != nil { t.Fatal(err) } - service := NewService(repository, objects, nil, Config{PublicBaseURL: "https://api.example", MaxImageBytes: 32 << 20, MaxTotalBytes: int64(len(raw)), CleanupThresholdPercent: 50, CleanupInterval: 10 * time.Minute}) + service := NewService(repository, relational.NewMediaJobRepository(database), objects, nil, Config{PublicBaseURL: "https://api.example", MaxImageBytes: 32 << 20, MaxTotalBytes: int64(len(raw)), CleanupThresholdPercent: 50, CleanupInterval: 10 * time.Minute}) if _, err := service.Cleanup(ctx); !errors.Is(err, os.ErrNotExist) { t.Fatalf("cleanup error = %v", err) } diff --git a/backend/internal/infra/persistence/relational/media_repository.go b/backend/internal/infra/persistence/relational/media_repository.go index ad68ac50..e741af26 100644 --- a/backend/internal/infra/persistence/relational/media_repository.go +++ b/backend/internal/infra/persistence/relational/media_repository.go @@ -37,6 +37,33 @@ func (r *MediaAssetRepository) GetMediaAsset(ctx context.Context, id string) (me }, nil } +func (r *MediaAssetRepository) ListMediaAssets(ctx context.Context, page, pageSize int) ([]media.Asset, int64, error) { + page, pageSize = normalizeMediaPagination(page, pageSize) + query := r.db.db.WithContext(ctx).Model(&mediaAssetModel{}) + var total int64 + if err := query.Count(&total).Error; err != nil { + return nil, 0, err + } + var rows []mediaAssetModel + if err := query.Order("created_at DESC, id DESC").Offset((page - 1) * pageSize).Limit(pageSize).Find(&rows).Error; err != nil { + return nil, 0, err + } + values := make([]media.Asset, 0, len(rows)) + for _, row := range rows { + values = append(values, media.Asset{ + ID: row.ID, Kind: row.Kind, StorageKey: row.StorageKey, MIMEType: row.MIMEType, + SizeBytes: row.SizeBytes, SHA256: row.SHA256, CreatedAt: row.CreatedAt, + }) + } + return values, total, nil +} + +func (r *MediaAssetRepository) CountMediaAssets(ctx context.Context) (int64, error) { + var count int64 + err := r.db.db.WithContext(ctx).Model(&mediaAssetModel{}).Count(&count).Error + return count, err +} + func (r *MediaAssetRepository) TotalMediaAssetBytes(ctx context.Context) (int64, error) { var total int64 err := r.db.db.WithContext(ctx).Model(&mediaAssetModel{}).Select("COALESCE(SUM(size_bytes), 0)").Scan(&total).Error @@ -100,6 +127,27 @@ func (r *MediaJobRepository) UpdateMediaJob(ctx context.Context, value media.Job return nil } +func (r *MediaJobRepository) ListMediaJobs(ctx context.Context, page, pageSize int, status string) ([]media.Job, int64, error) { + page, pageSize = normalizeMediaPagination(page, pageSize) + query := r.db.db.WithContext(ctx).Model(&mediaJobModel{}) + if status != "" { + query = query.Where("status = ?", status) + } + var total int64 + if err := query.Count(&total).Error; err != nil { + return nil, 0, err + } + var rows []mediaJobModel + if err := query.Order("created_at DESC, id DESC").Offset((page - 1) * pageSize).Limit(pageSize).Find(&rows).Error; err != nil { + return nil, 0, err + } + values := make([]media.Job, 0, len(rows)) + for _, row := range rows { + values = append(values, mediaJobToDomain(row)) + } + return values, total, nil +} + func (r *MediaJobRepository) ListUnrecordedCompletedMediaJobs(ctx context.Context, limit int) ([]media.Job, error) { if limit <= 0 || limit > 1000 { limit = 200 @@ -191,3 +239,16 @@ func mediaJobToDomain(row mediaJobModel) media.Job { CompletedAt: row.CompletedAt, UsageRecordedAt: row.UsageRecordedAt, } } + +func normalizeMediaPagination(page, pageSize int) (int, int) { + if page < 1 { + page = 1 + } + if pageSize < 1 { + pageSize = 20 + } + if pageSize > 100 { + pageSize = 100 + } + return page, pageSize +} diff --git a/backend/internal/infra/persistence/relational/media_repository_test.go b/backend/internal/infra/persistence/relational/media_repository_test.go new file mode 100644 index 00000000..1ea71cc3 --- /dev/null +++ b/backend/internal/infra/persistence/relational/media_repository_test.go @@ -0,0 +1,191 @@ +package relational + +import ( + "context" + "strings" + "testing" + "time" + + accountdomain "github.com/chenyme/grok2api/backend/internal/domain/account" + mediadomain "github.com/chenyme/grok2api/backend/internal/domain/media" +) + +func TestMediaJobRepositoryListMediaJobsPaginatesAndFilters(t *testing.T) { + ctx := context.Background() + database := openTestDatabase(t) + + accountValue, _, err := NewAccountRepository(database).UpsertByIdentity(ctx, accountdomain.Credential{ + Provider: accountdomain.ProviderWeb, + AuthType: accountdomain.AuthTypeSSO, + WebTier: accountdomain.WebTierBasic, + Name: "media-list-account", + SourceKey: "media-list-account", + EncryptedAccessToken: testEncryptedToken, + AuthStatus: accountdomain.AuthStatusActive, + }) + if err != nil { + t.Fatal(err) + } + key := clientKeyModel{Name: "media-list-key", Prefix: "media-list-key", SecretHash: testSecretHash, EncryptedSecret: testEncryptedToken, Enabled: true, RPMLimit: 60, MaxConcurrent: 4} + if err := database.db.WithContext(ctx).Create(&key).Error; err != nil { + t.Fatal(err) + } + + repository := NewMediaJobRepository(database) + now := time.Date(2026, 7, 13, 12, 0, 0, 0, time.UTC) + jobs := []mediadomain.Job{ + testMediaJob("media_job_completed_old", accountValue.ID, key.ID, mediadomain.StatusCompleted, now.Add(-4*time.Hour)), + testMediaJob("media_job_queued_mid", accountValue.ID, key.ID, mediadomain.StatusQueued, now.Add(-3*time.Hour)), + testMediaJob("media_job_failed_newer", accountValue.ID, key.ID, mediadomain.StatusFailed, now.Add(-2*time.Hour)), + testMediaJob("media_job_completed_new", accountValue.ID, key.ID, mediadomain.StatusCompleted, now.Add(-time.Hour)), + } + for _, job := range jobs { + if err := repository.CreateMediaJob(ctx, job); err != nil { + t.Fatal(err) + } + } + + firstPage, total, err := repository.ListMediaJobs(ctx, 1, 2, "") + if err != nil { + t.Fatal(err) + } + if total != 4 { + t.Fatalf("total = %d", total) + } + assertMediaJobIDs(t, firstPage, "media_job_completed_new", "media_job_failed_newer") + + secondPage, total, err := repository.ListMediaJobs(ctx, 2, 2, "") + if err != nil { + t.Fatal(err) + } + if total != 4 { + t.Fatalf("second page total = %d", total) + } + assertMediaJobIDs(t, secondPage, "media_job_queued_mid", "media_job_completed_old") + + completed, total, err := repository.ListMediaJobs(ctx, 1, 10, string(mediadomain.StatusCompleted)) + if err != nil { + t.Fatal(err) + } + if total != 2 { + t.Fatalf("completed total = %d", total) + } + assertMediaJobIDs(t, completed, "media_job_completed_new", "media_job_completed_old") +} + +func TestMediaAssetRepositoryListMediaAssetsPaginatesAndCounts(t *testing.T) { + ctx := context.Background() + database := openTestDatabase(t) + repository := NewMediaAssetRepository(database) + + count, err := repository.CountMediaAssets(ctx) + if err != nil { + t.Fatal(err) + } + if count != 0 { + t.Fatalf("initial count = %d", count) + } + + now := time.Date(2026, 7, 13, 12, 0, 0, 0, time.UTC) + assets := []mediadomain.Asset{ + testMediaAsset("media_asset_0001", "media/asset-0001.png", now.Add(-3*time.Hour)), + testMediaAsset("media_asset_0002", "media/asset-0002.png", now.Add(-2*time.Hour)), + testMediaAsset("media_asset_0003", "media/asset-0003.png", now.Add(-time.Hour)), + } + for _, asset := range assets { + if err := repository.CreateMediaAsset(ctx, asset); err != nil { + t.Fatal(err) + } + } + + firstPage, total, err := repository.ListMediaAssets(ctx, 1, 2) + if err != nil { + t.Fatal(err) + } + if total != 3 { + t.Fatalf("total = %d", total) + } + assertMediaAssetIDs(t, firstPage, "media_asset_0003", "media_asset_0002") + + secondPage, total, err := repository.ListMediaAssets(ctx, 2, 2) + if err != nil { + t.Fatal(err) + } + if total != 3 { + t.Fatalf("second page total = %d", total) + } + assertMediaAssetIDs(t, secondPage, "media_asset_0001") + + count, err = repository.CountMediaAssets(ctx) + if err != nil { + t.Fatal(err) + } + if count != 3 { + t.Fatalf("count = %d", count) + } +} + +func testMediaJob(id string, accountID, clientKeyID uint64, status mediadomain.Status, createdAt time.Time) mediadomain.Job { + job := mediadomain.Job{ + ID: id, + RequestID: "request-" + id, + ClientKeyID: clientKeyID, + ClientKeyName: "media-list-key", + AccountID: accountID, + AccountName: "media-list-account", + Provider: "grok_web", + Model: "grok-imagine-video", + ModelRouteID: 1, + UpstreamModel: "grok-imagine-video-upstream", + Prompt: "test prompt", + Seconds: 8, + Size: "16:9", + Quality: "720p", + Status: status, + InputJSON: `{}`, + CreatedAt: createdAt, + UpdatedAt: createdAt, + } + if status == mediadomain.StatusCompleted || status == mediadomain.StatusFailed { + job.Progress = 100 + completedAt := createdAt.Add(time.Minute) + job.CompletedAt = &completedAt + } + return job +} + +func testMediaAsset(id, storageKey string, createdAt time.Time) mediadomain.Asset { + return mediadomain.Asset{ + ID: id, + Kind: "image", + StorageKey: storageKey, + MIMEType: "image/png", + SizeBytes: 1024, + SHA256: strings.Repeat("a", 64), + CreatedAt: createdAt, + } +} + +func assertMediaJobIDs(t *testing.T, values []mediadomain.Job, expected ...string) { + t.Helper() + if len(values) != len(expected) { + t.Fatalf("len(values) = %d, expected %d: %#v", len(values), len(expected), values) + } + for index, id := range expected { + if values[index].ID != id { + t.Fatalf("values[%d].ID = %q, expected %q; values = %#v", index, values[index].ID, id, values) + } + } +} + +func assertMediaAssetIDs(t *testing.T, values []mediadomain.Asset, expected ...string) { + t.Helper() + if len(values) != len(expected) { + t.Fatalf("len(values) = %d, expected %d: %#v", len(values), len(expected), values) + } + for index, id := range expected { + if values[index].ID != id { + t.Fatalf("values[%d].ID = %q, expected %q; values = %#v", index, values[index].ID, id, values) + } + } +} diff --git a/backend/internal/infra/provider/web/adapter.go b/backend/internal/infra/provider/web/adapter.go index 8c8e7852..5177c146 100644 --- a/backend/internal/infra/provider/web/adapter.go +++ b/backend/internal/infra/provider/web/adapter.go @@ -15,6 +15,7 @@ import ( type Config struct { BaseURL string + ConsoleBaseURL string StatsigMode string StatsigManualValue string StatsigSignerURL string @@ -59,6 +60,9 @@ func normalizedConfig(cfg Config) Config { if cfg.BaseURL == "" { cfg.BaseURL = "https://grok.com" } + if cfg.ConsoleBaseURL == "" { + cfg.ConsoleBaseURL = "https://console.x.ai" + } if cfg.StatsigMode == "" { cfg.StatsigMode = "url" } @@ -129,6 +133,9 @@ func (a *Adapter) PricingModel(upstreamModel string) string { if ok && spec.Capability == modeldomain.CapabilityChat { return "grok-4.5" } + if ok && spec.ProtocolModel == "imagine-lite" { + return "grok-imagine-image" + } return upstreamModel } diff --git a/backend/internal/infra/provider/web/catalog.go b/backend/internal/infra/provider/web/catalog.go index 61bc96dc..59f5b7ee 100644 --- a/backend/internal/infra/provider/web/catalog.go +++ b/backend/internal/infra/provider/web/catalog.go @@ -5,13 +5,17 @@ import ( modeldomain "github.com/chenyme/grok2api/backend/internal/domain/model" ) +const consoleResponsesTransport = "console_responses" + type ModelSpec struct { - PublicID string - UpstreamModel string - ProtocolModel string - Capability modeldomain.Capability - Mode string - MinimumTier account.WebTier + PublicID string + UpstreamModel string + ProtocolModel string + Capability modeldomain.Capability + Mode string + MinimumTier account.WebTier + Transport string + ReasoningEffort string } var catalog = []ModelSpec{ @@ -19,7 +23,15 @@ var catalog = []ModelSpec{ {PublicID: "grok-chat-auto", UpstreamModel: "grok-chat-auto", Capability: modeldomain.CapabilityChat, Mode: "auto", MinimumTier: account.WebTierSuper}, {PublicID: "grok-chat-expert", UpstreamModel: "grok-chat-expert", Capability: modeldomain.CapabilityChat, Mode: "expert", MinimumTier: account.WebTierSuper}, {PublicID: "grok-chat-heavy", UpstreamModel: "grok-chat-heavy", Capability: modeldomain.CapabilityChat, Mode: "heavy", MinimumTier: account.WebTierHeavy}, + {PublicID: "grok-4.20-multi-agent-console", UpstreamModel: "grok-4.20-multi-agent-console", ProtocolModel: "grok-4.20-multi-agent-0309", Capability: modeldomain.CapabilityChat, MinimumTier: account.WebTierBasic, Transport: consoleResponsesTransport}, + {PublicID: "grok-4.20-multi-agent-low", UpstreamModel: "grok-4.20-multi-agent-low", ProtocolModel: "grok-4.20-multi-agent-0309", Capability: modeldomain.CapabilityChat, MinimumTier: account.WebTierBasic, Transport: consoleResponsesTransport, ReasoningEffort: "low"}, + {PublicID: "grok-4.20-multi-agent-medium", UpstreamModel: "grok-4.20-multi-agent-medium", ProtocolModel: "grok-4.20-multi-agent-0309", Capability: modeldomain.CapabilityChat, MinimumTier: account.WebTierBasic, Transport: consoleResponsesTransport, ReasoningEffort: "medium"}, + {PublicID: "grok-4.20-multi-agent-high", UpstreamModel: "grok-4.20-multi-agent-high", ProtocolModel: "grok-4.20-multi-agent-0309", Capability: modeldomain.CapabilityChat, MinimumTier: account.WebTierBasic, Transport: consoleResponsesTransport, ReasoningEffort: "high"}, + {PublicID: "grok-4.20-multi-agent-xhigh", UpstreamModel: "grok-4.20-multi-agent-xhigh", ProtocolModel: "grok-4.20-multi-agent-0309", Capability: modeldomain.CapabilityChat, MinimumTier: account.WebTierBasic, Transport: consoleResponsesTransport, ReasoningEffort: "xhigh"}, {PublicID: "grok-imagine-image", UpstreamModel: "grok-imagine-image", ProtocolModel: "imagine-lite", Capability: modeldomain.CapabilityImage, Mode: "fast", MinimumTier: account.WebTierBasic}, + // Backward-compatible public name from the Python implementation. It deliberately + // reuses the current Lite protocol instead of maintaining a second code path. + {PublicID: "grok-imagine-image-lite", UpstreamModel: "grok-imagine-image-lite", ProtocolModel: "imagine-lite", Capability: modeldomain.CapabilityImage, Mode: "fast", MinimumTier: account.WebTierBasic}, {PublicID: "grok-imagine-image-quality", UpstreamModel: "grok-imagine-image-quality", ProtocolModel: "imagine", Capability: modeldomain.CapabilityImage, MinimumTier: account.WebTierSuper}, {PublicID: "grok-imagine-image-edit", UpstreamModel: "imagine-image-edit", Capability: modeldomain.CapabilityImageEdit, MinimumTier: account.WebTierSuper}, {PublicID: "grok-imagine-video", UpstreamModel: "grok-imagine-video", ProtocolModel: "imagine-video-gen", Capability: modeldomain.CapabilityVideo, MinimumTier: account.WebTierSuper}, diff --git a/backend/internal/infra/provider/web/chat.go b/backend/internal/infra/provider/web/chat.go index bc892d1b..62d6a3d0 100644 --- a/backend/internal/infra/provider/web/chat.go +++ b/backend/internal/infra/provider/web/chat.go @@ -29,8 +29,9 @@ import ( const webResponseTTL = 30 * 24 * time.Hour var ( - errWebAntiBot = errors.New("Grok Web anti-bot rejection") - errWebUsageLimit = errors.New("Grok Web usage limit reached") + errWebAntiBot = errors.New("Grok Web anti-bot rejection") + errWebUsageLimit = errors.New("Grok Web usage limit reached") + errWebImageGeneration = errors.New("Grok Web image generation failed") ) var grokRenderPattern = regexp.MustCompile(`(?s)]*>.*?`) @@ -91,6 +92,12 @@ type parsedChat struct { } func (a *Adapter) ForwardResponse(ctx context.Context, request provider.ResponseResourceRequest) (*provider.Response, error) { + if spec, ok := Resolve(request.Model); ok && spec.Transport == consoleResponsesTransport { + if request.Method != http.MethodPost || request.Path != "/responses" { + return jsonProviderResponse(http.StatusMethodNotAllowed, map[string]any{"error": map[string]any{"message": "Console 模型仅支持创建 Response", "type": "invalid_request_error"}}), nil + } + return a.forwardConsoleResponse(ctx, request, spec) + } if request.Method == http.MethodGet || request.Method == http.MethodDelete { return a.handleResponseResource(ctx, request) } @@ -767,7 +774,11 @@ func parseUpstreamFrame(data []byte, parsed *parsedChat) (string, string, error) return "", "", webResponseError(errorValue) } for _, key := range []string{"cardAttachment", "cardAttachments"} { - if rawURL := collectCardAttachment(parsed, response[key]); rawURL != "" { + rawURL, cardErr := collectCardAttachment(parsed, response[key]) + if cardErr != nil { + return "", "", cardErr + } + if rawURL != "" { rawURL = absoluteAssetURL(rawURL) parsed.Images = appendUniqueString(parsed.Images, rawURL) return "image", rawURL, nil @@ -980,19 +991,23 @@ func containsString(values []string, value string) bool { return false } -func collectCardAttachment(parsed *parsedChat, value any) string { +func collectCardAttachment(parsed *parsedChat, value any) (string, error) { if values, ok := value.([]any); ok { first := "" for _, item := range values { - if rawURL := collectCardAttachment(parsed, item); first == "" && rawURL != "" { + rawURL, err := collectCardAttachment(parsed, item) + if err != nil { + return "", err + } + if first == "" && rawURL != "" { first = rawURL } } - return first + return first, nil } data := cardAttachmentData(value) if data == nil { - return "" + return "", nil } if id, _ := data["id"].(string); id != "" { if parsed.cardCache == nil { @@ -1000,7 +1015,10 @@ func collectCardAttachment(parsed *parsedChat, value any) string { } parsed.cardCache[id] = data } - return imageURLFromCardData(data) + if err := imageErrorFromCardData(data); err != nil { + return "", err + } + return imageURLFromCardData(data), nil } func cardAttachmentData(value any) map[string]any { @@ -1023,11 +1041,32 @@ func cardAttachmentData(value any) map[string]any { return nil } -func imageURLFromCardData(data map[string]any) string { +func imageChunkFromCardData(data map[string]any) map[string]any { chunk, _ := data["image_chunk"].(map[string]any) if chunk == nil { chunk, _ = data["imageChunk"].(map[string]any) } + return chunk +} + +func imageErrorFromCardData(data map[string]any) error { + chunk := imageChunkFromCardData(data) + if chunk == nil { + return nil + } + progress, _ := numberAsInt(chunk["progress"]) + if progress < 100 || firstString(chunk, "imageUrl", "image_url", "url") != "" { + return nil + } + code := strings.TrimSpace(fmt.Sprint(chunk["systemErrCode"])) + if code == "" || code == "" || code == "0" { + return nil + } + return fmt.Errorf("%w: systemErrCode=%s", errWebImageGeneration, code) +} + +func imageURLFromCardData(data map[string]any) string { + chunk := imageChunkFromCardData(data) if chunk == nil { return "" } @@ -1036,11 +1075,7 @@ func imageURLFromCardData(data map[string]any) string { if moderated || progress < 100 { return "" } - imageURL, _ := chunk["imageUrl"].(string) - if imageURL == "" { - imageURL, _ = chunk["image_url"].(string) - } - return imageURL + return firstString(chunk, "imageUrl", "image_url", "url") } func cleanChatToken(parsed *parsedChat, token string) string { diff --git a/backend/internal/infra/provider/web/console.go b/backend/internal/infra/provider/web/console.go new file mode 100644 index 00000000..0f9b35a5 --- /dev/null +++ b/backend/internal/infra/provider/web/console.go @@ -0,0 +1,160 @@ +package web + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "strconv" + "strings" + "time" + + domainegress "github.com/chenyme/grok2api/backend/internal/domain/egress" + infraegress "github.com/chenyme/grok2api/backend/internal/infra/egress" + "github.com/chenyme/grok2api/backend/internal/infra/provider" + "github.com/chenyme/grok2api/backend/internal/infra/provider/conversation" +) + +const consoleCluster = "https://us-east-1.api.x.ai" + +func buildConsolePayload(body []byte, spec ModelSpec, requestedStreaming bool) ([]byte, bool, error) { + var payload map[string]any + if err := json.Unmarshal(body, &payload); err != nil { + return nil, false, fmt.Errorf("解析 Console 请求: %w", err) + } + payload["model"] = spec.ProtocolModel + payload["max_output_tokens"] = 2_000_000 + payload["store"] = false + payload["include"] = []string{"reasoning.encrypted_content"} + streaming := requestedStreaming + if value, ok := payload["stream"].(bool); ok { + streaming = streaming || value + } + payload["stream"] = streaming + effort := spec.ReasoningEffort + if effort == "" { + if reasoning, ok := payload["reasoning"].(map[string]any); ok { + if value, ok := reasoning["effort"].(string); ok { + switch value { + case "minimal": + effort = "low" + case "none", "low", "medium", "high", "xhigh": + effort = value + } + } + } + } + if effort == "" { + effort = "medium" + } + payload["reasoning"] = map[string]any{"effort": effort} + payload["tools"] = []map[string]any{ + {"type": "web_search", "enable_image_understanding": true}, + {"type": "x_search", "enable_video_understanding": true}, + } + payload["tool_choice"] = "auto" + data, err := json.Marshal(payload) + return data, streaming, err +} + +func buildConsoleHeaders(token string, lease *infraegress.Lease) http.Header { + headers := buildHeaders(token, lease, "application/json") + headers.Set("Authorization", "Bearer "+token) + cookies := []string{"sso=" + token, "sso-rw=" + token} + if value := strings.TrimSpace(lease.CFCookies); value != "" { + cookies = append(cookies, value) + } + headers.Set("Cookie", strings.Join(cookies, "; ")) + headers.Set("Origin", "https://console.x.ai") + headers.Set("Referer", "https://console.x.ai/") + headers.Set("x-cluster", consoleCluster) + return headers +} + +func (a *Adapter) forwardConsoleResponse(ctx context.Context, request provider.ResponseResourceRequest, spec ModelSpec) (*provider.Response, error) { + body := request.Body + if request.Operation == conversation.OperationChat || request.Operation == conversation.OperationMessages { + converted, err := conversation.ConvertRequest(body, request.Model, request.Operation) + if err != nil { + return jsonProviderResponse(http.StatusBadRequest, map[string]any{"error": map[string]any{"message": err.Error(), "type": "invalid_request_error"}}), nil + } + body = converted + } + payload, streaming, err := buildConsolePayload(body, spec, request.Streaming) + if err != nil { + return jsonProviderResponse(http.StatusBadRequest, map[string]any{"error": map[string]any{"message": err.Error(), "type": "invalid_request_error"}}), nil + } + token, err := a.cipher.Decrypt(request.Credential.EncryptedAccessToken) + if err != nil { + return nil, err + } + lease, err := a.egress.Acquire(ctx, domainegress.ScopeWeb, fmt.Sprintf("%d", request.Credential.ID)) + if err != nil { + return nil, err + } + cfg := a.config() + requestCtx, cancel := context.WithTimeout(ctx, time.Duration(cfg.ChatTimeoutSeconds)*time.Second) + upstreamRequest, err := http.NewRequestWithContext(requestCtx, http.MethodPost, strings.TrimRight(cfg.ConsoleBaseURL, "/")+"/v1/responses", bytes.NewReader(payload)) + if err != nil { + cancel() + lease.Release() + return nil, err + } + upstreamRequest.Header = buildConsoleHeaders(token, lease) + if streaming { + upstreamRequest.Header.Set("Accept", "text/event-stream") + } else { + upstreamRequest.Header.Set("Accept", "application/json") + } + upstream, err := lease.Do(upstreamRequest) + if err != nil { + cancel() + a.egress.Feedback(context.WithoutCancel(ctx), lease.NodeID, 0, err) + lease.Release() + return nil, err + } + upstream.Body = &cancelBody{ReadCloser: upstream.Body, cancel: cancel} + if upstream.StatusCode < 200 || upstream.StatusCode >= 300 { + return &provider.Response{StatusCode: upstream.StatusCode, Status: upstream.Status, Header: upstream.Header.Clone(), Body: &releaseBody{ReadCloser: upstream.Body, release: func() { + a.egress.Feedback(context.WithoutCancel(ctx), lease.NodeID, upstream.StatusCode, nil) + lease.Release() + }}}, nil + } + + if streaming { + body := upstream.Body + if request.Operation == conversation.OperationChat || request.Operation == conversation.OperationMessages { + body = conversation.ConvertResponseStream(body, request.Operation) + } + return &provider.Response{StatusCode: upstream.StatusCode, Status: upstream.Status, Header: streamHeaders(), Body: &releaseBody{ReadCloser: body, release: func() { + a.egress.Feedback(context.WithoutCancel(ctx), lease.NodeID, upstream.StatusCode, nil) + lease.Release() + }}}, nil + } + + data, readErr := io.ReadAll(io.LimitReader(upstream.Body, (64<<20)+1)) + _ = upstream.Body.Close() + if readErr != nil { + a.egress.Feedback(context.WithoutCancel(ctx), lease.NodeID, 0, readErr) + lease.Release() + return nil, readErr + } + if len(data) > 64<<20 { + lease.Release() + return nil, fmt.Errorf("Console 上游响应超过 64 MiB") + } + if request.Operation == conversation.OperationChat || request.Operation == conversation.OperationMessages { + data, err = conversation.ConvertResponseJSON(data, request.Operation) + if err != nil { + lease.Release() + return nil, err + } + } + a.egress.Feedback(context.WithoutCancel(ctx), lease.NodeID, upstream.StatusCode, nil) + lease.Release() + headers := jsonHeaders() + headers.Set("Content-Length", strconv.Itoa(len(data))) + return &provider.Response{StatusCode: upstream.StatusCode, Status: upstream.Status, Header: headers, Body: io.NopCloser(bytes.NewReader(data))}, nil +} diff --git a/backend/internal/infra/provider/web/console_test.go b/backend/internal/infra/provider/web/console_test.go new file mode 100644 index 00000000..33b1326f --- /dev/null +++ b/backend/internal/infra/provider/web/console_test.go @@ -0,0 +1,145 @@ +package web + +import ( + "context" + "encoding/base64" + "encoding/json" + "io" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "github.com/chenyme/grok2api/backend/internal/domain/account" + infraegress "github.com/chenyme/grok2api/backend/internal/infra/egress" + "github.com/chenyme/grok2api/backend/internal/infra/provider" + "github.com/chenyme/grok2api/backend/internal/infra/security" +) + +func TestConsoleCatalogModelsResolveToSharedTransport(t *testing.T) { + cases := map[string]string{ + "grok-4.20-multi-agent-console": "", + "grok-4.20-multi-agent-low": "low", + "grok-4.20-multi-agent-medium": "medium", + "grok-4.20-multi-agent-high": "high", + "grok-4.20-multi-agent-xhigh": "xhigh", + } + for model, effort := range cases { + spec, ok := Resolve(model) + if !ok { + t.Fatalf("missing Console model %s", model) + } + if spec.Transport != consoleResponsesTransport || spec.ProtocolModel != "grok-4.20-multi-agent-0309" || spec.ReasoningEffort != effort { + t.Fatalf("spec for %s = %#v", model, spec) + } + } +} + +func TestBuildConsolePayloadAppliesDefaultsAndFixedEffort(t *testing.T) { + body := []byte(`{"model":"grok-4.20-multi-agent-high","input":"hello","stream":false,"reasoning":{"effort":"low"}}`) + spec, _ := Resolve("grok-4.20-multi-agent-high") + data, streaming, err := buildConsolePayload(body, spec, false) + if err != nil { + t.Fatal(err) + } + if streaming { + t.Fatal("non-stream request unexpectedly became streaming") + } + var payload map[string]any + if err := json.Unmarshal(data, &payload); err != nil { + t.Fatal(err) + } + if payload["model"] != "grok-4.20-multi-agent-0309" || payload["max_output_tokens"] != float64(2_000_000) || payload["store"] != false { + t.Fatalf("payload defaults = %#v", payload) + } + reasoning, _ := payload["reasoning"].(map[string]any) + if reasoning["effort"] != "high" { + t.Fatalf("reasoning = %#v", reasoning) + } + tools, _ := payload["tools"].([]any) + if len(tools) != 2 || payload["tool_choice"] != "auto" { + t.Fatalf("tools = %#v choice=%#v", tools, payload["tool_choice"]) + } + include, _ := payload["include"].([]any) + if len(include) != 1 || include[0] != "reasoning.encrypted_content" { + t.Fatalf("include = %#v", include) + } +} + +func TestConsoleForwardUsesConsoleHeadersAndConvertsChatResponse(t *testing.T) { + var received map[string]any + server := httptest.NewServer(http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { + if request.URL.Path != "/v1/responses" { + http.NotFound(writer, request) + return + } + if request.Header.Get("Authorization") != "Bearer test-sso" { + t.Errorf("authorization = %q", request.Header.Get("Authorization")) + } + cookie := request.Header.Get("Cookie") + if !strings.Contains(cookie, "sso=test-sso") || !strings.Contains(cookie, "sso-rw=test-sso") { + t.Errorf("cookie = %q", cookie) + } + if request.Header.Get("Origin") != "https://console.x.ai" || request.Header.Get("Referer") != "https://console.x.ai/" || request.Header.Get("x-cluster") == "" { + t.Errorf("console headers = %#v", request.Header) + } + if err := json.NewDecoder(request.Body).Decode(&received); err != nil { + t.Error(err) + } + writer.Header().Set("Content-Type", "application/json") + _, _ = io.WriteString(writer, `{"id":"resp_console","object":"response","created_at":1,"model":"grok-4.20-multi-agent-0309","status":"completed","output":[{"id":"msg_1","type":"message","role":"assistant","status":"completed","content":[{"type":"output_text","text":"console works"}]}],"usage":{"input_tokens":2,"output_tokens":3}}`) + })) + defer server.Close() + + cipher, err := security.NewCipher(base64.StdEncoding.EncodeToString(make([]byte, 32))) + if err != nil { + t.Fatal(err) + } + encrypted, err := cipher.Encrypt("test-sso") + if err != nil { + t.Fatal(err) + } + adapter := NewAdapter(Config{ConsoleBaseURL: server.URL}, infraegress.NewManager(egressRepositoryStub{}, cipher), cipher, nil, nil) + body := []byte(`{"model":"grok-4.20-multi-agent-low","messages":[{"role":"user","content":"hello"}],"stream":false}`) + response, err := adapter.ForwardResponse(context.Background(), provider.ResponseResourceRequest{ + Credential: account.Credential{ID: 7, EncryptedAccessToken: encrypted}, Method: http.MethodPost, + Path: "/responses", Body: body, Model: "grok-4.20-multi-agent-low", Operation: "chat", + }) + if err != nil { + t.Fatal(err) + } + defer response.Body.Close() + data, _ := io.ReadAll(response.Body) + if response.StatusCode != http.StatusOK || !strings.Contains(string(data), "console works") || !strings.Contains(string(data), "chat.completion") { + t.Fatalf("status=%d body=%s", response.StatusCode, data) + } + if received["model"] != "grok-4.20-multi-agent-0309" { + t.Fatalf("upstream payload = %#v", received) + } +} + +func TestConsoleForwardConvertsStreamingMessagesResponse(t *testing.T) { + server := httptest.NewServer(http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { + writer.Header().Set("Content-Type", "text/event-stream") + _, _ = io.WriteString(writer, "event: response.created\ndata: {\"type\":\"response.created\",\"response\":{\"id\":\"resp_1\",\"model\":\"grok-4.20-multi-agent-0309\",\"status\":\"in_progress\"}}\n\n") + _, _ = io.WriteString(writer, "event: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"delta\":\"hi\"}\n\n") + _, _ = io.WriteString(writer, "event: response.completed\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"resp_1\",\"model\":\"grok-4.20-multi-agent-0309\",\"status\":\"completed\",\"usage\":{\"input_tokens\":1,\"output_tokens\":1}}}\n\n") + })) + defer server.Close() + cipher, _ := security.NewCipher(base64.StdEncoding.EncodeToString(make([]byte, 32))) + encrypted, _ := cipher.Encrypt("test-sso") + adapter := NewAdapter(Config{ConsoleBaseURL: server.URL}, infraegress.NewManager(egressRepositoryStub{}, cipher), cipher, nil, nil) + response, err := adapter.ForwardResponse(context.Background(), provider.ResponseResourceRequest{ + Credential: account.Credential{ID: 8, EncryptedAccessToken: encrypted}, Method: http.MethodPost, + Path: "/responses", Body: []byte(`{"model":"grok-4.20-multi-agent-console","messages":[{"role":"user","content":"hello"}],"stream":true,"max_tokens":1024}`), + Model: "grok-4.20-multi-agent-console", Operation: "messages", Streaming: true, + }) + if err != nil { + t.Fatal(err) + } + defer response.Body.Close() + data, _ := io.ReadAll(response.Body) + if !strings.Contains(string(data), "content_block_delta") || !strings.Contains(string(data), "hi") { + t.Fatalf("messages stream = %s", data) + } +} diff --git a/backend/internal/infra/provider/web/protocol_test.go b/backend/internal/infra/provider/web/protocol_test.go index 3e9eaa10..da7b2477 100644 --- a/backend/internal/infra/provider/web/protocol_test.go +++ b/backend/internal/infra/provider/web/protocol_test.go @@ -25,7 +25,7 @@ import ( func TestCatalogMatchesSupportedSurface(t *testing.T) { values := Catalog() - if len(values) != 8 { + if len(values) != 14 { t.Fatalf("catalog size = %d", len(values)) } publicIDs := make(map[string]struct{}, len(values)) @@ -40,12 +40,12 @@ func TestCatalogMatchesSupportedSurface(t *testing.T) { publicIDs[value.PublicID] = struct{}{} upstreamIDs[value.UpstreamModel] = struct{}{} } - for _, required := range []string{"grok-chat-fast", "grok-chat-auto", "grok-chat-expert", "grok-chat-heavy", "grok-imagine-image", "grok-imagine-image-quality", "grok-imagine-image-edit", "grok-imagine-video"} { + for _, required := range []string{"grok-chat-fast", "grok-chat-auto", "grok-chat-expert", "grok-chat-heavy", "grok-4.20-multi-agent-console", "grok-4.20-multi-agent-low", "grok-4.20-multi-agent-medium", "grok-4.20-multi-agent-high", "grok-4.20-multi-agent-xhigh", "grok-imagine-image", "grok-imagine-image-lite", "grok-imagine-image-quality", "grok-imagine-image-edit", "grok-imagine-video"} { if _, exists := publicIDs[required]; !exists { t.Fatalf("missing supported model: %s", required) } } - for _, removed := range []string{"grok-imagine-image-lite", "grok-imagine-image-speed", "grok-imagine-image-pro"} { + for _, removed := range []string{"grok-imagine-image-speed", "grok-imagine-image-pro"} { if _, exists := publicIDs[removed]; exists { t.Fatalf("obsolete image model remains: %s", removed) } @@ -59,7 +59,12 @@ func TestWebChatPricingUsesGrok45(t *testing.T) { t.Fatalf("pricing model for %s = %q", upstreamModel, got) } } - for _, upstreamModel := range []string{"grok-imagine-image", "grok-imagine-image-quality", "imagine-image-edit", "grok-imagine-video"} { + for _, upstreamModel := range []string{"grok-imagine-image", "grok-imagine-image-lite"} { + if got := registry.PricingModel(account.ProviderWeb, upstreamModel); got != "grok-imagine-image" { + t.Fatalf("Lite media pricing model for %s = %q", upstreamModel, got) + } + } + for _, upstreamModel := range []string{"grok-imagine-image-quality", "imagine-image-edit", "grok-imagine-video"} { if got := registry.PricingModel(account.ProviderWeb, upstreamModel); got != upstreamModel { t.Fatalf("media pricing model for %s = %q", upstreamModel, got) } @@ -277,6 +282,23 @@ func TestLiteChatRejectsInvalidImageConfigBeforeUpstream(t *testing.T) { } } +func TestLegacyLiteAliasUsesCurrentChatImageProtocol(t *testing.T) { + current, ok := Resolve("grok-imagine-image") + if !ok { + t.Fatal("current Lite image model is missing") + } + legacy, ok := Resolve("grok-imagine-image-lite") + if !ok { + t.Fatal("legacy Lite image alias is missing") + } + if legacy.ProtocolModel != current.ProtocolModel || legacy.Mode != current.Mode || legacy.MinimumTier != current.MinimumTier || legacy.Capability != current.Capability { + t.Fatalf("legacy alias = %#v, current = %#v", legacy, current) + } + if legacy.UpstreamModel != legacy.PublicID { + t.Fatalf("legacy route must preserve its public upstream key: %#v", legacy) + } +} + func TestParseLiteImageCardAttachment(t *testing.T) { parsed := &parsedChat{} frame := map[string]any{"result": map[string]any{"response": map[string]any{ @@ -297,6 +319,36 @@ func TestParseLiteNestedUsageLimit(t *testing.T) { } } +func TestParseLiteCompletedCardWithSystemErrorReturnsUpstreamError(t *testing.T) { + parsed := &parsedChat{} + frame := []byte(`{"result":{"response":{"cardAttachment":{"jsonData":"{\"id\":\"card_1\",\"image_chunk\":{\"imageUuid\":\"image_1\",\"progress\":100,\"systemErrCode\":1010}}"}}}}`) + _, _, err := parseUpstreamFrame(frame, parsed) + if !errors.Is(err, errWebImageGeneration) { + t.Fatalf("error = %v", err) + } + if !strings.Contains(err.Error(), "1010") { + t.Fatalf("error does not preserve systemErrCode: %v", err) + } +} + +func TestParseLiteSystemErrorDoesNotOverrideCompletedImageURL(t *testing.T) { + parsed := &parsedChat{} + frame := []byte(`{"result":{"response":{"cardAttachment":{"jsonData":"{\"id\":\"card_1\",\"image_chunk\":{\"progress\":100,\"imageUrl\":\"generated/image.jpg\",\"systemErrCode\":1010}}"}}}}`) + kind, delta, err := parseUpstreamFrame(frame, parsed) + if err != nil || kind != "image" || delta != "https://assets.grok.com/generated/image.jpg" { + t.Fatalf("kind=%q delta=%q error=%v", kind, delta, err) + } +} + +func TestParseLiteSystemErrorBeforeCompletionIsNotTerminal(t *testing.T) { + parsed := &parsedChat{} + frame := []byte(`{"result":{"response":{"cardAttachment":{"jsonData":"{\"id\":\"card_1\",\"image_chunk\":{\"progress\":50,\"systemErrCode\":1010}}"}}}}`) + kind, delta, err := parseUpstreamFrame(frame, parsed) + if err != nil || kind != "" || delta != "" { + t.Fatalf("kind=%q delta=%q error=%v", kind, delta, err) + } +} + func TestParseLiteImageCardAttachmentVariants(t *testing.T) { parsed := &parsedChat{} frame := map[string]any{"result": map[string]any{"response": map[string]any{ @@ -406,6 +458,9 @@ func TestChatModelsUseLowestSufficientTierFirst(t *testing.T) { func TestOnlyChatModelsExposeRateLimitModes(t *testing.T) { for _, spec := range Catalog() { + if spec.Transport == consoleResponsesTransport { + continue + } if spec.Capability == modeldomain.CapabilityChat { if !slices.Contains([]string{"auto", "fast", "expert", "heavy"}, spec.Mode) { t.Fatalf("chat model %s has invalid quota mode %q", spec.PublicID, spec.Mode) diff --git a/backend/internal/repository/media.go b/backend/internal/repository/media.go index a62f52f7..7dae2aae 100644 --- a/backend/internal/repository/media.go +++ b/backend/internal/repository/media.go @@ -12,6 +12,7 @@ type MediaJobRepository interface { CreateMediaJob(ctx context.Context, value media.Job) error GetMediaJob(ctx context.Context, id string, clientKeyID uint64) (media.Job, error) UpdateMediaJob(ctx context.Context, value media.Job) error + ListMediaJobs(ctx context.Context, page, pageSize int, status string) ([]media.Job, int64, error) ListRecoverableMediaJobs(ctx context.Context, limit int) ([]media.Job, error) ListUnrecordedCompletedMediaJobs(ctx context.Context, limit int) ([]media.Job, error) TryClaimMediaJob(ctx context.Context, id string, now, leaseUntil time.Time, claimToken string) (media.Job, bool, error) @@ -22,6 +23,8 @@ type MediaJobRepository interface { type MediaAssetRepository interface { CreateMediaAsset(ctx context.Context, value media.Asset) error GetMediaAsset(ctx context.Context, id string) (media.Asset, error) + ListMediaAssets(ctx context.Context, page, pageSize int) ([]media.Asset, int64, error) + CountMediaAssets(ctx context.Context) (int64, error) TotalMediaAssetBytes(ctx context.Context) (int64, error) ListOldestMediaAssets(ctx context.Context, limit int) ([]media.Asset, error) DeleteMediaAsset(ctx context.Context, id string) error diff --git a/backend/internal/transport/http/media/handler.go b/backend/internal/transport/http/media/handler.go index b5eeff0d..45f2c850 100644 --- a/backend/internal/transport/http/media/handler.go +++ b/backend/internal/transport/http/media/handler.go @@ -8,6 +8,7 @@ import ( "strings" mediaapp "github.com/chenyme/grok2api/backend/internal/application/media" + "github.com/chenyme/grok2api/backend/internal/shared/response" "github.com/gin-gonic/gin" ) @@ -23,6 +24,14 @@ func (h *Handler) RegisterPublic(router *gin.Engine) { router.HEAD("/v1/media/images/:assetId", h.getImage) } +// RegisterAdmin 注册管理端媒体列表和统计端点。 +func (h *Handler) RegisterAdmin(router *gin.RouterGroup) { + router.GET("/media/images", h.listImages) + router.GET("/media/images/stats", h.imageStats) + router.GET("/media/videos", h.listVideos) + router.GET("/media/videos/stats", h.videoStats) +} + func (h *Handler) getImage(c *gin.Context) { asset, body, err := h.service.OpenImage(c.Request.Context(), c.Param("assetId")) if errors.Is(err, mediaapp.ErrAssetNotFound) { @@ -52,3 +61,123 @@ func (h *Handler) getImage(c *gin.Context) { c.Status(http.StatusOK) _, _ = io.Copy(c.Writer, body) } + +// --- Admin endpoints --- + +type mediaAssetDTO struct { + ID string `json:"id"` + Kind string `json:"kind"` + MimeType string `json:"mimeType"` + SizeBytes int64 `json:"sizeBytes"` + SHA256 string `json:"sha256"` + CreatedAt string `json:"createdAt"` + URL string `json:"url"` +} + +type imageStatsDTO struct { + TotalImages int64 `json:"totalImages"` + TotalBytes int64 `json:"totalBytes"` +} + +type mediaJobDTO struct { + ID string `json:"id"` + Model string `json:"model"` + Prompt string `json:"prompt"` + Status string `json:"status"` + Progress int `json:"progress"` + Seconds int `json:"seconds"` + Size string `json:"size"` + Quality string `json:"quality"` + AccountName string `json:"accountName"` + ClientKeyName string `json:"clientKeyName"` + CreatedAt string `json:"createdAt"` + CompletedAt string `json:"completedAt"` + ErrorMessage string `json:"errorMessage"` +} + +type videoStatsDTO struct { + TotalJobs int64 `json:"totalJobs"` + Completed int64 `json:"completed"` + Failed int64 `json:"failed"` + InProgress int64 `json:"inProgress"` + Queued int64 `json:"queued"` +} + +func (h *Handler) listImages(c *gin.Context) { + page, pageSize := parsePagination(c) + assets, total, err := h.service.AdminListImages(c.Request.Context(), page, pageSize) + if err != nil { + response.Error(c, http.StatusInternalServerError, "mediaListImagesFailed", "读取图片列表失败") + return + } + items := make([]mediaAssetDTO, 0, len(assets)) + for _, a := range assets { + items = append(items, mediaAssetDTO{ + ID: a.ID, Kind: a.Kind, MimeType: a.MIMEType, SizeBytes: a.SizeBytes, + SHA256: a.SHA256, CreatedAt: a.CreatedAt.Format("2006-01-02T15:04:05Z"), + URL: h.service.PublicImageURL(a.ID), + }) + } + response.Success(c, http.StatusOK, gin.H{"items": items, "page": page, "pageSize": pageSize, "total": total}) +} + +func (h *Handler) imageStats(c *gin.Context) { + stats, err := h.service.AdminImageStats(c.Request.Context()) + if err != nil { + response.Error(c, http.StatusInternalServerError, "mediaImageStatsFailed", "读取图片统计失败") + return + } + response.Success(c, http.StatusOK, imageStatsDTO{TotalImages: stats.TotalImages, TotalBytes: stats.TotalBytes}) +} + +func (h *Handler) listVideos(c *gin.Context) { + page, pageSize := parsePagination(c) + status := c.Query("status") + jobs, total, err := h.service.AdminListVideoJobs(c.Request.Context(), page, pageSize, status) + if err != nil { + response.Error(c, http.StatusInternalServerError, "mediaListVideosFailed", "读取视频任务列表失败") + return + } + items := make([]mediaJobDTO, 0, len(jobs)) + for _, j := range jobs { + completedAt := "" + if j.CompletedAt != nil { + completedAt = j.CompletedAt.Format("2006-01-02T15:04:05Z") + } + items = append(items, mediaJobDTO{ + ID: j.ID, Model: j.Model, Prompt: j.Prompt, Status: string(j.Status), + Progress: j.Progress, Seconds: j.Seconds, Size: j.Size, Quality: j.Quality, + AccountName: j.AccountName, ClientKeyName: j.ClientKeyName, + CreatedAt: j.CreatedAt.Format("2006-01-02T15:04:05Z"), + CompletedAt: completedAt, ErrorMessage: j.ErrorMessage, + }) + } + response.Success(c, http.StatusOK, gin.H{"items": items, "page": page, "pageSize": pageSize, "total": total}) +} + +func (h *Handler) videoStats(c *gin.Context) { + stats, err := h.service.AdminVideoStats(c.Request.Context()) + if err != nil { + response.Error(c, http.StatusInternalServerError, "mediaVideoStatsFailed", "读取视频统计失败") + return + } + response.Success(c, http.StatusOK, videoStatsDTO{ + TotalJobs: stats.TotalJobs, Completed: stats.Completed, Failed: stats.Failed, + InProgress: stats.InProgress, Queued: stats.Queued, + }) +} + +func parsePagination(c *gin.Context) (int, int) { + page, _ := strconv.Atoi(c.DefaultQuery("page", "1")) + pageSize, _ := strconv.Atoi(c.DefaultQuery("pageSize", "20")) + if page < 1 { + page = 1 + } + if pageSize < 1 { + pageSize = 20 + } + if pageSize > 100 { + pageSize = 100 + } + return page, pageSize +} diff --git a/backend/internal/transport/http/media/handler_test.go b/backend/internal/transport/http/media/handler_test.go index bb76a9fe..2b48b8c9 100644 --- a/backend/internal/transport/http/media/handler_test.go +++ b/backend/internal/transport/http/media/handler_test.go @@ -30,7 +30,7 @@ func TestPublicImageSupportsGetHeadAndETag(t *testing.T) { if err != nil { t.Fatal(err) } - service := mediaapp.NewService(relational.NewMediaAssetRepository(database), objects, nil, mediaapp.Config{ + service := mediaapp.NewService(relational.NewMediaAssetRepository(database), relational.NewMediaJobRepository(database), objects, nil, mediaapp.Config{ PublicBaseURL: "https://api.example", MaxImageBytes: 32 << 20, MaxTotalBytes: 1 << 30, CleanupThresholdPercent: 80, CleanupInterval: 10 * time.Minute, }) diff --git a/backend/internal/transport/http/server.go b/backend/internal/transport/http/server.go index a09e068a..559038b9 100644 --- a/backend/internal/transport/http/server.go +++ b/backend/internal/transport/http/server.go @@ -126,7 +126,8 @@ func New(deps Dependencies) *gin.Engine { if deps.SwaggerEnabled { router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) } - mediahttp.NewHandler(deps.Media).RegisterPublic(router) + mediaHandler := mediahttp.NewHandler(deps.Media) + mediaHandler.RegisterPublic(router) adminRoot := router.Group("/api/admin/v1") authHandler := adminauthhttp.NewHandler(deps.AdminAuth, deps.SecureCookies) @@ -139,6 +140,7 @@ func New(deps Dependencies) *gin.Engine { clientkeyhttp.NewHandler(deps.ClientKeys).Register(adminProtected) audithttp.NewHandler(deps.Audits).Register(adminProtected) dashboardhttp.NewHandler(deps.Dashboard).Register(adminProtected) + mediaHandler.RegisterAdmin(adminProtected) settingshttp.NewHandler(deps.Settings).Register(adminProtected) egresshttp.NewHandler(deps.Egress).Register(adminProtected) systemhttp.NewHandler(deps.PublicAPIBaseURL).Register(adminProtected) diff --git a/frontend/package-lock.json b/frontend/package-lock.json new file mode 100644 index 00000000..c97d7e80 --- /dev/null +++ b/frontend/package-lock.json @@ -0,0 +1,4827 @@ +{ + "name": "grok2api-frontend", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "grok2api-frontend", + "version": "0.1.0", + "dependencies": { + "@hookform/resolvers": "^5.4.0", + "@radix-ui/react-alert-dialog": "^1.1.19", + "@radix-ui/react-checkbox": "^1.3.7", + "@radix-ui/react-dialog": "^1.1.19", + "@radix-ui/react-dropdown-menu": "^2.1.20", + "@radix-ui/react-label": "^2.1.11", + "@radix-ui/react-popover": "^1.1.19", + "@radix-ui/react-select": "^2.3.3", + "@radix-ui/react-slot": "^1.3.0", + "@radix-ui/react-switch": "^1.3.3", + "@radix-ui/react-tabs": "^1.1.17", + "@radix-ui/react-tooltip": "^1.2.12", + "@tanstack/react-query": "^5.101.2", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", + "date-fns": "^4.4.0", + "i18next": "^26.3.6", + "lucide-react": "^1.24.0", + "next-themes": "^0.4.6", + "react": "^19.2.7", + "react-day-picker": "^10.0.1", + "react-dom": "^19.2.7", + "react-hook-form": "^7.81.0", + "react-i18next": "^17.0.9", + "react-router-dom": "^7.18.1", + "recharts": "2.15.4", + "sonner": "^2.0.7", + "tailwind-merge": "^3.6.0", + "tw-animate-css": "^1.4.0", + "zod": "^4.4.3" + }, + "devDependencies": { + "@eslint/js": "^10.0.1", + "@tailwindcss/vite": "^4.3.2", + "@types/node": "^26.1.1", + "@types/react": "^19.2.17", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^6.0.3", + "eslint": "^10.6.0", + "eslint-plugin-react-hooks": "^7.1.1", + "eslint-plugin-react-refresh": "^0.5.3", + "globals": "^17.7.0", + "tailwindcss": "^4.3.2", + "typescript": "^6.0.2", + "typescript-eslint": "^8.63.0", + "vite": "^8.1.4" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helpers": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz", + "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz", + "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz", + "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.7" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz", + "integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz", + "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", + "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@date-fns/tz": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@date-fns/tz/-/tz-1.5.0.tgz", + "integrity": "sha512-lwYN/vDPeNRULcepoE/LO2Pgx+7/RV+S9ARfbc9lr2DtGkOD7pAiruHvbR1RX3Qyf6ja47EWJDMsNK5vK08DJg==", + "license": "MIT" + }, + "node_modules/@emnapi/core": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.1.tgz", + "integrity": "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.2", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.1.tgz", + "integrity": "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz", + "integrity": "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.23.5", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz", + "integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^3.0.5", + "debug": "^4.3.1", + "minimatch": "^10.2.4" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.6.0.tgz", + "integrity": "sha512-ii6Bw9jJ2zi2cWA2Z+9/QZ/+3DX6kwaV5Q986D/CdP3Lap3w/pgQZ373FV7byY/i7L4IRH/G43I5dz1ClsCbpA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.2.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/core": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.1.tgz", + "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/js": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", + "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "eslint": "^10.0.0" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/@eslint/object-schema": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.5.tgz", + "integrity": "sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.2.tgz", + "integrity": "sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.2.1", + "levn": "^0.4.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@floating-ui/core": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.8.0.tgz", + "integrity": "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ==", + "license": "MIT", + "dependencies": { + "@floating-ui/utils": "^0.2.12" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.8.0.tgz", + "integrity": "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg==", + "license": "MIT", + "dependencies": { + "@floating-ui/core": "^1.8.0", + "@floating-ui/utils": "^0.2.12" + } + }, + "node_modules/@floating-ui/react-dom": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.9.tgz", + "integrity": "sha512-JDjEFGCpImxDCA7JJKviA0M9+RtmJdj0m/NVU5IMgBK+AmZouAQQ7/+2GLH0GXXY0YMw9oXPB8hKdbPYg5QLYg==", + "license": "MIT", + "dependencies": { + "@floating-ui/dom": "^1.8.0" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.12.tgz", + "integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==", + "license": "MIT" + }, + "node_modules/@hookform/resolvers": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@hookform/resolvers/-/resolvers-5.4.0.tgz", + "integrity": "sha512-EIsqr/t/qbinPIhGjMdtvutIN1Kk4uwbROE9/UQ93CAVGR7GkA7Y92+fX80OzXi/OB67jVFYwKGO1WzkxmkFZw==", + "license": "MIT", + "dependencies": { + "@standard-schema/utils": "^0.3.0" + }, + "peerDependencies": { + "react-hook-form": "^7.55.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", + "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/types": "^0.15.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz", + "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.2", + "@humanfs/types": "^0.15.0", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/types": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz", + "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.6.tgz", + "integrity": "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.3" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.139.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.139.0.tgz", + "integrity": "sha512-r9gHphtCs+1M7J0pw6Sn/hh/Wpa/iQrOOkrNAlVLF/gHq+/CJmHIWKKUUhdWjcD6CIa8idarspCsASiXCXvFUw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, + "node_modules/@radix-ui/number": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.2.tgz", + "integrity": "sha512-ceTwaxc4I5IOi97DgCotl3pqiyRGvffcc0oOsE2dQYaJOFIDsDt4VWG6xEbg1QePv9QWausCEIppud/tJ1wNig==", + "license": "MIT" + }, + "node_modules/@radix-ui/primitive": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.5.tgz", + "integrity": "sha512-d86WIWFYNtGA0H/d8exstrTRTp7eWJYlYJbtNofxr/3ljupZYn6EFDG/Qgu/0Kc8v7yMUxySagqJsL1+PdYjWg==", + "license": "MIT" + }, + "node_modules/@radix-ui/react-alert-dialog": { + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/@radix-ui/react-alert-dialog/-/react-alert-dialog-1.1.19.tgz", + "integrity": "sha512-FA7n1f6D/DwGE0+AWxiY5LacNbbExQuEgMubeG06idEaH+mSLuf9dp/qBNqOnvbTQ+4gZ2ue1RATF1Ub91Mg5g==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.5", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-context": "1.2.0", + "@radix-ui/react-dialog": "1.1.19", + "@radix-ui/react-primitive": "2.1.7" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-arrow": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/@radix-ui/react-arrow/-/react-arrow-1.1.11.tgz", + "integrity": "sha512-Kdil9BB1rIFC/khmf4hC35bn8701AJcizTU7G7cUbEbk5XqqbjDuHW60uUfKqO5WojjZcbAW51Q7P0hRmMLw8A==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-primitive": "2.1.7" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-checkbox": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-checkbox/-/react-checkbox-1.3.7.tgz", + "integrity": "sha512-JroKHfQBfh+fDuzpPsBC+pESkhuq8ql4hljTguz8MWnS35cISr3d/Jhl9kYrB44FlDtxCArYdDvTx+BSsJ64rQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.5", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-context": "1.2.0", + "@radix-ui/react-presence": "1.1.7", + "@radix-ui/react-primitive": "2.1.7", + "@radix-ui/react-use-controllable-state": "1.2.3", + "@radix-ui/react-use-previous": "1.1.2", + "@radix-ui/react-use-size": "1.1.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-collection": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.1.12.tgz", + "integrity": "sha512-nb67INpE0IahJKN7EYPp9m9YGwYeKlnzxT3MwXVkgCskaSJia97kG4T0ywpjNUSSnoJk/uvk12V8vbrEHEj+/Q==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-context": "1.2.0", + "@radix-ui/react-primitive": "2.1.7", + "@radix-ui/react-slot": "1.3.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-compose-refs": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.3.tgz", + "integrity": "sha512-rYOP8OMnuuPMQF1uhPVlGNcCDlkokKqGFE3JcxFViIkAXP7EvFWUliJAstrapypaBLJNHbZL6jGhbVDGTwmVhA==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-context": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.2.0.tgz", + "integrity": "sha512-fOE+JtN9rygNZkCnHRBEP0TAvLldlhyOxMsbwFvTP4nAs+nBmfnna+o/Zski2wkmY1YMrFC0aSzsHoLY47iLrg==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-dialog": { + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.1.19.tgz", + "integrity": "sha512-+HhbN2+YtkRgVirjZ2afMeutQRuGOrdkWR5+EFC58SJojGmtyNQwYzgi6tHBpOxvFHefMtPeHdgtjz0BOGxFQg==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.5", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-context": "1.2.0", + "@radix-ui/react-dismissable-layer": "1.1.15", + "@radix-ui/react-focus-guards": "1.1.4", + "@radix-ui/react-focus-scope": "1.1.12", + "@radix-ui/react-id": "1.1.2", + "@radix-ui/react-portal": "1.1.13", + "@radix-ui/react-presence": "1.1.7", + "@radix-ui/react-primitive": "2.1.7", + "@radix-ui/react-slot": "1.3.0", + "@radix-ui/react-use-controllable-state": "1.2.3", + "aria-hidden": "^1.2.4", + "react-remove-scroll": "^2.7.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-direction": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.1.2.tgz", + "integrity": "sha512-C3vFhbyi4SW3PmbAi6Awpu4OzJtd0MxGurvSsYtr7p7nM8RNB3VAF3CUmnp2j50knpkrRcB7+ycVXzgLgF6yNA==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-dismissable-layer": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.15.tgz", + "integrity": "sha512-b0XaRlzn2QKuo10XyNgi2DAJDf5XC9d1nD3FJcuvCjbR7+4Ad28zmZsLsqx+hvDEzMnRuZaZxZm9gYObV6RmRA==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.5", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-primitive": "2.1.7", + "@radix-ui/react-use-callback-ref": "1.1.2", + "@radix-ui/react-use-effect-event": "0.0.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-dropdown-menu": { + "version": "2.1.20", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.1.20.tgz", + "integrity": "sha512-slfm+rRaZRuQBvHq60lXvSVUPhid0IPtjSZzIuUlWZMUs01iYZNlGS3mJgRD3ChLQVBAYlKiL/tFyWGX+dz8Xw==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.5", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-context": "1.2.0", + "@radix-ui/react-id": "1.1.2", + "@radix-ui/react-menu": "2.1.20", + "@radix-ui/react-primitive": "2.1.7", + "@radix-ui/react-use-controllable-state": "1.2.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-focus-guards": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.1.4.tgz", + "integrity": "sha512-cot/aB/mOm0IYVYTTmQcEEK1M48lZWi8FlYe5nDPQQ8NYZUlXEFgncJ9p2Kzer3RKSrY7cTTpEMLZKNo9QoP5Q==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-focus-scope": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.1.12.tgz", + "integrity": "sha512-jjk/lqTeNL0azUx5ZYzVrl4NgaDIrdzTNE4mABV9yBFI7FQqN7pIgzV1bTleUezP2QiTGA1BFTqY8MegDgWX9A==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-primitive": "2.1.7", + "@radix-ui/react-use-callback-ref": "1.1.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-id": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.1.2.tgz", + "integrity": "sha512-orBC88futVpqCmhX1p4cvquNHsELQ+w+vBJnuj3ftETI5bJb0bZn3Tqu3SWN2IOcPycTnMGnhwoermvISt72sA==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-layout-effect": "1.1.2" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-label": { + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/@radix-ui/react-label/-/react-label-2.1.11.tgz", + "integrity": "sha512-3PKvDDxOn62k0oV1n4QtNtD2vpu+zYjXR7ojLBPaO6SPvhy53yg0vAmgNeBQeJW5rV3dffoRG+HYfLBZuzw0CQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-primitive": "2.1.7" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-menu": { + "version": "2.1.20", + "resolved": "https://registry.npmjs.org/@radix-ui/react-menu/-/react-menu-2.1.20.tgz", + "integrity": "sha512-VsUrXxFe9d2ScbZF0fR/oPR1+qjyeLs5p0jzG8h90puMoA9bq4SirYlXbE+USRg9Q2qTeJSFNqjw2nts8jJe4w==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.5", + "@radix-ui/react-collection": "1.1.12", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-context": "1.2.0", + "@radix-ui/react-direction": "1.1.2", + "@radix-ui/react-dismissable-layer": "1.1.15", + "@radix-ui/react-focus-guards": "1.1.4", + "@radix-ui/react-focus-scope": "1.1.12", + "@radix-ui/react-id": "1.1.2", + "@radix-ui/react-popper": "1.3.3", + "@radix-ui/react-portal": "1.1.13", + "@radix-ui/react-presence": "1.1.7", + "@radix-ui/react-primitive": "2.1.7", + "@radix-ui/react-roving-focus": "1.1.15", + "@radix-ui/react-slot": "1.3.0", + "@radix-ui/react-use-callback-ref": "1.1.2", + "aria-hidden": "^1.2.4", + "react-remove-scroll": "^2.7.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-popover": { + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/@radix-ui/react-popover/-/react-popover-1.1.19.tgz", + "integrity": "sha512-jkrTdQVxnIB8fpn0NyyxW9CTB5aCXZZelVz5z+Xmii6g5WxMqS3fInNslZ63puP39+Puu4jYohUK31y3dT87gQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.5", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-context": "1.2.0", + "@radix-ui/react-dismissable-layer": "1.1.15", + "@radix-ui/react-focus-guards": "1.1.4", + "@radix-ui/react-focus-scope": "1.1.12", + "@radix-ui/react-id": "1.1.2", + "@radix-ui/react-popper": "1.3.3", + "@radix-ui/react-portal": "1.1.13", + "@radix-ui/react-presence": "1.1.7", + "@radix-ui/react-primitive": "2.1.7", + "@radix-ui/react-slot": "1.3.0", + "@radix-ui/react-use-controllable-state": "1.2.3", + "aria-hidden": "^1.2.4", + "react-remove-scroll": "^2.7.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-popper": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.3.3.tgz", + "integrity": "sha512-mS7dGpyjv6b+gsDjLF7e0ia1W4Im1B1hSCy2yuXlHuvnZxHKagfDaobt/KAKt27EpZMit2pss8eJBVyVjEWM+g==", + "license": "MIT", + "dependencies": { + "@floating-ui/react-dom": "^2.0.0", + "@radix-ui/react-arrow": "1.1.11", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-context": "1.2.0", + "@radix-ui/react-primitive": "2.1.7", + "@radix-ui/react-use-callback-ref": "1.1.2", + "@radix-ui/react-use-layout-effect": "1.1.2", + "@radix-ui/react-use-rect": "1.1.2", + "@radix-ui/react-use-size": "1.1.2", + "@radix-ui/rect": "1.1.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-portal": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.1.13.tgz", + "integrity": "sha512-z3oXfmaHLJTF1wktbjgD6cn9jiEbq3WSondB10LIuIt2m2Ym4iJlrW04/euMwENDdWDdE7z+OuY7Qyp1YpRSwA==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-primitive": "2.1.7", + "@radix-ui/react-use-layout-effect": "1.1.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-presence": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.1.7.tgz", + "integrity": "sha512-zBZ4QM5XG3JRanDmqXYf3MD6th4AFXFmgU6KNMFzUaV6F3uw9I5/zjMUvFriSEn5ewo1nxuibvyxJdmLlDcslA==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-layout-effect": "1.1.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-primitive": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.7.tgz", + "integrity": "sha512-bC3NiwsprbxKjuon9l7X6BUTw7FPVzEYaL92MPEY5SCd/9hUTPXVFtVwRix7778wtRsVao+zE062gL79FZleeQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-slot": "1.3.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-roving-focus": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.1.15.tgz", + "integrity": "sha512-40svmmugfM3mUN7VUDGVE1tQGOhyi8enlGD0CNJEcMM36C1f71PKM21DFgNHUfem0XnA+d8H8oN3Z9ZpJjSslg==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.5", + "@radix-ui/react-collection": "1.1.12", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-context": "1.2.0", + "@radix-ui/react-direction": "1.1.2", + "@radix-ui/react-id": "1.1.2", + "@radix-ui/react-primitive": "2.1.7", + "@radix-ui/react-use-callback-ref": "1.1.2", + "@radix-ui/react-use-controllable-state": "1.2.3", + "@radix-ui/react-use-is-hydrated": "0.1.1", + "@radix-ui/react-use-layout-effect": "1.1.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-select": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-select/-/react-select-2.3.3.tgz", + "integrity": "sha512-L5RQTXz6Anxsf9CCv+pTgiAsUpyVj7rJxsGtmhFaEOJ++cVfXucv4qWfsIO0AIB4NAhi3yovWGVMKKS1Xf1Wrg==", + "license": "MIT", + "dependencies": { + "@radix-ui/number": "1.1.2", + "@radix-ui/primitive": "1.1.5", + "@radix-ui/react-collection": "1.1.12", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-context": "1.2.0", + "@radix-ui/react-direction": "1.1.2", + "@radix-ui/react-dismissable-layer": "1.1.15", + "@radix-ui/react-focus-guards": "1.1.4", + "@radix-ui/react-focus-scope": "1.1.12", + "@radix-ui/react-id": "1.1.2", + "@radix-ui/react-popper": "1.3.3", + "@radix-ui/react-portal": "1.1.13", + "@radix-ui/react-presence": "1.1.7", + "@radix-ui/react-primitive": "2.1.7", + "@radix-ui/react-slot": "1.3.0", + "@radix-ui/react-use-callback-ref": "1.1.2", + "@radix-ui/react-use-controllable-state": "1.2.3", + "@radix-ui/react-use-layout-effect": "1.1.2", + "@radix-ui/react-use-previous": "1.1.2", + "@radix-ui/react-visually-hidden": "1.2.7", + "aria-hidden": "^1.2.4", + "react-remove-scroll": "^2.7.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-slot": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.0.tgz", + "integrity": "sha512-MojKku4U/miO8Av4Dkb+ctMAQx7JmY96LmtDQlAarCRtd7rN52QCSzBF+XAvr5S6coSVj9HEPBgHAHKEJVk/WA==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.3" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-switch": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-switch/-/react-switch-1.3.3.tgz", + "integrity": "sha512-1+mlB4/lxJfk5tgJ4g+R5mUCbRpPE1T9+UsEyeLYbGgMtwiMgmuTnfKz4Mw1nHALHjuwyxw4MLd4cSHn6pNSlQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.5", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-context": "1.2.0", + "@radix-ui/react-primitive": "2.1.7", + "@radix-ui/react-use-controllable-state": "1.2.3", + "@radix-ui/react-use-previous": "1.1.2", + "@radix-ui/react-use-size": "1.1.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-tabs": { + "version": "1.1.17", + "resolved": "https://registry.npmjs.org/@radix-ui/react-tabs/-/react-tabs-1.1.17.tgz", + "integrity": "sha512-nRyXnrAVCwjeXcHbvEbLS6ndbTeKHG1RqCP4A8Gw5L4cemDzPXdD8rAmr6wet0v57R69wGvuIIsFjHSVkZiMzQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.5", + "@radix-ui/react-context": "1.2.0", + "@radix-ui/react-direction": "1.1.2", + "@radix-ui/react-id": "1.1.2", + "@radix-ui/react-presence": "1.1.7", + "@radix-ui/react-primitive": "2.1.7", + "@radix-ui/react-roving-focus": "1.1.15", + "@radix-ui/react-use-controllable-state": "1.2.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-tooltip": { + "version": "1.2.12", + "resolved": "https://registry.npmjs.org/@radix-ui/react-tooltip/-/react-tooltip-1.2.12.tgz", + "integrity": "sha512-U3HoftgWnmla78vzQbLvKKb7bUYJxoiiqYFzp1wu/TBMyDqMZSuCl3aRICsD6EfVEwcJD2mumGDGUXLFVqQHKA==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.5", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-context": "1.2.0", + "@radix-ui/react-dismissable-layer": "1.1.15", + "@radix-ui/react-id": "1.1.2", + "@radix-ui/react-popper": "1.3.3", + "@radix-ui/react-portal": "1.1.13", + "@radix-ui/react-presence": "1.1.7", + "@radix-ui/react-primitive": "2.1.7", + "@radix-ui/react-slot": "1.3.0", + "@radix-ui/react-use-controllable-state": "1.2.3", + "@radix-ui/react-visually-hidden": "1.2.7" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-callback-ref": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.2.tgz", + "integrity": "sha512-xCso9j1/u8sEgP1RNHjFrXJLApL8LiqOkI1R4ywuN00rxWdYg4oQXuwKLS3i0j5NWLromUD27/4nlxj2UFVvIw==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-controllable-state": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.3.tgz", + "integrity": "sha512-PLzC90MS+ReootmjC597dvopoelpZ8Q61HJkDXZSExitIq7PL55vHNnesAHwguHK0aPfBnpdNzQtv1uliaqQrA==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-effect-event": "0.0.3", + "@radix-ui/react-use-layout-effect": "1.1.2" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-effect-event": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.3.tgz", + "integrity": "sha512-6c8ZqvPTWILEKnyVkP53EGRCcpnJiKTC21sS/6R1GF5xKyHJJWQEPfkqlcgUkdRQivd6tb23abUwe4ngWmY0JA==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-layout-effect": "1.1.2" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-is-hydrated": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-is-hydrated/-/react-use-is-hydrated-0.1.1.tgz", + "integrity": "sha512-qwOiz4Tjo8CNnrOLAYUMXeZwDzXgXpvK4TKQPmWLECM9XoWvA6+0Z2/7Ag3A4ivjS4ovbLJPbskkxioFyBhr8A==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-layout-effect": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.2.tgz", + "integrity": "sha512-jrBWOxZITuGcnjRCM2t2U5ZPkCLxD+Ym6DjfssS5haTj2iiak/DOb64JeN6OdLfLgptb6/e2kKR+ZuTrGoZTPA==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-previous": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-previous/-/react-use-previous-1.1.2.tgz", + "integrity": "sha512-IGBQPtRFdhN6MQ8dbegVmBq1LVZluya3F1jWY+puIcQC3MHctRwTDSBWCkL/3ZcnMJLTMJ++Z+ktmvg0F89iCw==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-rect": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-rect/-/react-use-rect-1.1.2.tgz", + "integrity": "sha512-d8a+bBY/FxikNPlgJJoaBHZX+zKVbWHYJGTLnLvveQgFSTntkGdEKv3JDtHrMS0DNYpllz2nRsTLGLKYttbpmw==", + "license": "MIT", + "dependencies": { + "@radix-ui/rect": "1.1.2" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-size": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-size/-/react-use-size-1.1.2.tgz", + "integrity": "sha512-giWQp+4mxjBPt4KZ0MmyuykFNWfbDxKt4x+fPkRYmgRFJSbCZFzUglvMb/Kjn38tm10YP4ufiQZDx3zna4LU6w==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-layout-effect": "1.1.2" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-visually-hidden": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.2.7.tgz", + "integrity": "sha512-1wNZBggTDK3GRuuQ6nP4k2yi7a6l7I5qbMPbZcRsrGsGVead/f/d5FhEzUvqFs0bcrDLx7n1zKQ3JvLR6whaaw==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-primitive": "2.1.7" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/rect": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/rect/-/rect-1.1.2.tgz", + "integrity": "sha512-xnXE7wG13PI+cxieVssYXlQJuYVRhH9NBoxt3KNwzghDIA69GMm7d4wXRouHIYjE+KvS6U/MsMO73NdS2MH9ZA==", + "license": "MIT" + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.1.5.tgz", + "integrity": "sha512-lZg8fqIv2v7FF237bwMgzGZEJvGL79/s5knJ/i6FmsGF4XXlzccZ4jb+TrFIxtSSxFtIpdsgrPZeMk1I9AFcyQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.1.5.tgz", + "integrity": "sha512-51Bnx9pNiMRKSUNtBfySkNJ9vMU9Hh3I1ozDd6gyPPYzaXCfnptUcEZxXGYFn+ul2dtcMUiqGR1Yai2K10uoTw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.1.5.tgz", + "integrity": "sha512-Tm+gbfC0aHu1tBA/JvKQh32S0K6YgCHkiAF4/W6xX0K0RmNuc94VeK419dJoE65R5aRxmo+noZQSWrAMF6yb6g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.1.5.tgz", + "integrity": "sha512-JMzDKCCXq93YccG5gz3hvOs1oXRKAf0XYpfOS88e+wZrC8Iugj6j68867vrYZkvpDDpKn/KoKORThmchMpF6TA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.1.5.tgz", + "integrity": "sha512-uML21j2K5TfPGutKxub+M+nLjZIrWjXQ5Grx4lCe/nimTj9B4L63zHpjXLl4y0L3mcm2htEQIb06oCG/szerNw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.1.5.tgz", + "integrity": "sha512-navSiuTMogvnQoZoM/v+l3ZWo50/NTwSHSzheABx/RCnmUPaKwq9qSo4Br2OYRs21+Fz8uFqITZM3H4opOB0/Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.1.5.tgz", + "integrity": "sha512-lAryqH7IteztmCXQXk0etKj4wBQ7Gx5S6LjKhsgp9zb8I5bsuvU/2llH1hDQcjsFeqIsovMVN339/8pUDDBXxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.1.5.tgz", + "integrity": "sha512-fsK/sNBnxzBlL4O1JNrZakVQxPspqpED5dLtNsZS9oOKmtSpdNIzxH2kkol5HYTWJN47sE20ztMJPxfZ89qGOg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.1.5.tgz", + "integrity": "sha512-gLYb4BIadlfTOYT5gO503n8zQjXflgzpD0FcyKh0Mzx3rqCZKnHoJWV9xe1KXUJ5lx2JfcSHr/mhzS0PC/McAA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.1.5.tgz", + "integrity": "sha512-FjcpEKUyJygHgs1o50VYNvkt5+7Le/VEdYt0AkRpkL33MnyQfwr8l5mXwMmfmTbyMPr5vJLC+8/Gd9gXnwU1QQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.1.5.tgz", + "integrity": "sha512-Me+PfPI2TMeOQk0gYWfLQZtTktrmzbr8cDboqX83XKc7UrgAi55gF+2dUkWdxd19n55Essp2yeca+O9N5rBxHg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.1.5.tgz", + "integrity": "sha512-yc5WrLzXks6zCQfn9Oxr8pORKyl/pF+QjHmW/Qx3qu0oyrrNC+y2JLTU1E2rcWYAmzlnqngWXHQjy51VzW70Vw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.1.5.tgz", + "integrity": "sha512-VbQGPX2b4r48TAMIM2cjgluIM1HYutm4pcTEJsle7iEP7sB1dFqtPLBVbdLAZCxy1txCcPxf4QFf4v8uvltPqA==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "1.11.1", + "@emnapi/runtime": "1.11.1", + "@napi-rs/wasm-runtime": "^1.1.6" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.1.5.tgz", + "integrity": "sha512-gHv82k63z4qpV5+Q1y/12KrK0ltWBukVDI8nZcbT7Tt/ZlOIVwppazneq0F93oDxTo3IgAMEDIoQh3E2n6mVsw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.1.5.tgz", + "integrity": "sha512-tTZuDBPw85tEN5PQi1pnEBzDy0Z49HtScLAbD5t6hyeU92A95pRWaSMw1GZZi/RwgSgUIl0xrSlXIT/9QzvYSA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@standard-schema/utils": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@standard-schema/utils/-/utils-0.3.0.tgz", + "integrity": "sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==", + "license": "MIT" + }, + "node_modules/@tailwindcss/node": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.3.2.tgz", + "integrity": "sha512-yWP/sqEcBLaD8JuA6zNwxoYKr75qxTioYwlRwekj5Jr/I5GXnoJfjetH/psLUIv74cYTH2lBUEzBkinthoYcBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.5", + "enhanced-resolve": "5.21.6", + "jiti": "^2.7.0", + "lightningcss": "1.32.0", + "magic-string": "^0.30.21", + "source-map-js": "^1.2.1", + "tailwindcss": "4.3.2" + } + }, + "node_modules/@tailwindcss/oxide": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.3.2.tgz", + "integrity": "sha512-z8ZgnzX8gdNoWLBLqBPoh/sjnxkwvf9ZuWjnO0l0yIzbLa5/9S+eC5QxGZKRobVHIC3/1BoMWjHblqWjcgFgag==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 20" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.3.2", + "@tailwindcss/oxide-darwin-arm64": "4.3.2", + "@tailwindcss/oxide-darwin-x64": "4.3.2", + "@tailwindcss/oxide-freebsd-x64": "4.3.2", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.2", + "@tailwindcss/oxide-linux-arm64-gnu": "4.3.2", + "@tailwindcss/oxide-linux-arm64-musl": "4.3.2", + "@tailwindcss/oxide-linux-x64-gnu": "4.3.2", + "@tailwindcss/oxide-linux-x64-musl": "4.3.2", + "@tailwindcss/oxide-wasm32-wasi": "4.3.2", + "@tailwindcss/oxide-win32-arm64-msvc": "4.3.2", + "@tailwindcss/oxide-win32-x64-msvc": "4.3.2" + } + }, + "node_modules/@tailwindcss/oxide-android-arm64": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.3.2.tgz", + "integrity": "sha512-WHxqIuHpvZ5VtdX6GTl1Ik/Vp2YuN42Et+0CdeaVd/frQ9jAvGmvR8vLT+jk3e8/Q3x8kECB9+R17pgpp2BulA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-arm64": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.3.2.tgz", + "integrity": "sha512-GZypeUY/IDJW3877KeM+O67vbXr3MBnbtEL4aYhNErv/JWZhye2vGSWWG9tB6iiqR2MqRNkY8IOUy4NdSZV26w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-x64": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.3.2.tgz", + "integrity": "sha512-UIIzmefR6KO1sDU7MzRqAxC8iBpft/VhkGjTjnhoS6k7Z3rQ9wEgA1ODSiyH/tcSYssulNm4Ci3hOeK1jH7ccQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-freebsd-x64": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.3.2.tgz", + "integrity": "sha512-GN+uAmcI6DNspnCDwtOAZrTz6oukJnp337qZvxqCGLd3BHBzJpO0ZbTLRvJNdztOeAmTzewewGIMPb0tk2R4WA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.3.2.tgz", + "integrity": "sha512-4ABn7qSbdHRwTiDiuWNegCyb5+2FJ4vKIKc3DmKrvAFw7MU1Lm11dIkTPwUaFdTzc7IsOpDbqBrlh0x6y36U/w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.3.2.tgz", + "integrity": "sha512-wDgEIGwoM8w8pufh9LVt1PahDgNdKXrLC2qfAnV3vAmococ9RWbxeAw4pxPttd/TsJfwjyLf90Dg1y9y8I6Emw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-musl": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.3.2.tgz", + "integrity": "sha512-J5Nuk0uZQIiMTJj3LEx4sAA9tMFUoXQZFv1J6An+QGYe53HKRJuFDi0rpq/tuouCZeAbOBY3kQ6g8qeD4TUjtA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-gnu": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.3.2.tgz", + "integrity": "sha512-kqCZpSKOBEJO4mz7OqWoofBZeXTAwaVGPj0ErAj7CojmhKpWVWVOnrt9dE8odoIraZq4oj3ausM37kXi+Tow8w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.3.2.tgz", + "integrity": "sha512-cixpqbh2toJDmkuCRI68nXA8ZxNmdK9Y+9v5h3MC3ZQKy/0BO8AWzlkWyRM7JAFSGBlfig4YVTPsK6MVgqz1uw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.3.2.tgz", + "integrity": "sha512-4ec2Z/LOmRsAgU23CS4xeJfcJlmRg94A/XrbGRCF1gyU/zdDfRLYDVsS+ynSZCmGNxQ1jQriQOKMQeQxBA3Isw==", + "bundleDependencies": [ + "@napi-rs/wasm-runtime", + "@emnapi/core", + "@emnapi/runtime", + "@tybys/wasm-util", + "@emnapi/wasi-threads", + "tslib" + ], + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.11.1", + "@emnapi/runtime": "^1.11.1", + "@emnapi/wasi-threads": "^1.2.2", + "@napi-rs/wasm-runtime": "^1.1.4", + "@tybys/wasm-util": "^0.10.2", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.2.tgz", + "integrity": "sha512-Zyr/M0+XcYZu3bZrUytc7TXvrk0ftWfl8gN2MwekNDzhqhKRUucMPSeOzM0o0wH5AWOU49BsKRrfKxI2atCPMQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.2.tgz", + "integrity": "sha512-QI9BO7KlNZsp2GuO0jwAAj5jCDABOKXRkCk2XuKTSaNEFSdfzqswYVTtCHBNKHLsqyjFyFkqlDiwkNbTYSssMQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/vite": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.3.2.tgz", + "integrity": "sha512-eHpMeX4JXfVNJDEcsouTeCBubJBTcTLigeaw/NTUW6PB5ATKKXdyonnXgTBX2VuRbjz1hjfz6C5XAhr52ImQXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tailwindcss/node": "4.3.2", + "@tailwindcss/oxide": "4.3.2", + "tailwindcss": "4.3.2" + }, + "peerDependencies": { + "vite": "^5.2.0 || ^6 || ^7 || ^8" + } + }, + "node_modules/@tanstack/query-core": { + "version": "5.101.2", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.101.2.tgz", + "integrity": "sha512-hH5MLoJhF7KaIGd7q3xTXGXvslI+GYlM1Z/35aSHHWaCJWB7XvTSHYuV3eM7tw+aE0mT/xMro4M4Q9rCGHT0lw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tanstack/react-query": { + "version": "5.101.2", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.101.2.tgz", + "integrity": "sha512-seDkr6kzGzX1okaaTtZPtgA688CDPlXUz1C6xSg0ESqn04Vuc8tlrYms1s3de+znBqhPVxFRfpAfUf+6XvfPWg==", + "license": "MIT", + "dependencies": { + "@tanstack/query-core": "5.101.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": "^18 || ^19" + } + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.3.tgz", + "integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@types/d3-array": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.2.tgz", + "integrity": "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==", + "license": "MIT" + }, + "node_modules/@types/d3-color": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz", + "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==", + "license": "MIT" + }, + "node_modules/@types/d3-ease": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.2.tgz", + "integrity": "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==", + "license": "MIT" + }, + "node_modules/@types/d3-interpolate": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz", + "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==", + "license": "MIT", + "dependencies": { + "@types/d3-color": "*" + } + }, + "node_modules/@types/d3-path": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.1.1.tgz", + "integrity": "sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==", + "license": "MIT" + }, + "node_modules/@types/d3-scale": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.9.tgz", + "integrity": "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==", + "license": "MIT", + "dependencies": { + "@types/d3-time": "*" + } + }, + "node_modules/@types/d3-shape": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.1.8.tgz", + "integrity": "sha512-lae0iWfcDeR7qt7rA88BNiqdvPS5pFVPpo5OfjElwNaT2yyekbM0C9vK+yqBqEmHr6lDkRnYNoTBYlAgJa7a4w==", + "license": "MIT", + "dependencies": { + "@types/d3-path": "*" + } + }, + "node_modules/@types/d3-time": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.4.tgz", + "integrity": "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==", + "license": "MIT" + }, + "node_modules/@types/d3-timer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.2.tgz", + "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==", + "license": "MIT" + }, + "node_modules/@types/esrecurse": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@types/esrecurse/-/esrecurse-4.3.1.tgz", + "integrity": "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "26.1.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz", + "integrity": "sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~8.3.0" + } + }, + "node_modules/@types/react": { + "version": "19.2.17", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.17.tgz", + "integrity": "sha512-MXfmqaVPEVgkBT/aY0aGCkRWWtByiYQXo3xdQ8r5RzuFrPiRn8Gar2tQdXSUQ2GKV3bkXckek89V8wQBY2Q/Aw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz", + "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", + "devOptional": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.2.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.63.0.tgz", + "integrity": "sha512-rvwSgqT+DHpWdzfSzPatRLm02a0GlESt++9iy3hLCDY4BgkaLcl8LBi9Yh7XGFBpwcBE/K3024QuXWTpbz4FfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.63.0", + "@typescript-eslint/type-utils": "8.63.0", + "@typescript-eslint/utils": "8.63.0", + "@typescript-eslint/visitor-keys": "8.63.0", + "ignore": "^7.0.5", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.63.0", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.6.tgz", + "integrity": "sha512-BAg6QkE8W+TuQLrrw0Ugr7HegXduRuuj8/ti2kSOc+jz1dmx8/WNcjr6XGnq5YpDWxFwwaavqD0+jIUOKelTsw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.63.0.tgz", + "integrity": "sha512-gwh4gvvlaVDKKxyfxMG+Gnu1u9X0OQBwyGLkbwB65dIzBKnxeRiJlNFqlI3zwVhNXJIs6qV7mlFCn/BIajlVig==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.63.0", + "@typescript-eslint/types": "8.63.0", + "@typescript-eslint/typescript-estree": "8.63.0", + "@typescript-eslint/visitor-keys": "8.63.0", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.63.0.tgz", + "integrity": "sha512-e5dh0/UI0ok53AlZ5wRkXCB32z/f2jUZqPR/ygAw5WYaSw8j9EoJWlS7wQjr/dmOaqWjnPIn2m+HhVPCMWGZVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.63.0", + "@typescript-eslint/types": "^8.63.0", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.63.0.tgz", + "integrity": "sha512-uUyfMWCnDSN8bCpcrY8nGP2BLkQ9Xn0GsipcONcpIDWhwhO4ZSyHvyS14U3X75mzxWxL3I2UZIrenTzdzcJO8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.63.0", + "@typescript-eslint/visitor-keys": "8.63.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.63.0.tgz", + "integrity": "sha512-sUAbkulqBAsncKnbRP3+7CtQFRKicexnj7ZwNC6ddCR7EmrXvjvdCYMJbUIqMd6lwoEriZjwLo08aS5tSjVMHg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.63.0.tgz", + "integrity": "sha512-Nzzh/OGxVCOjObjaj1CQF2RUasyYy2Jfuh+zZ3PjLzG2fYRriAiZLib9UKtO+CpQAS3YHiAS+ckZDclwqI1TPA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.63.0", + "@typescript-eslint/typescript-estree": "8.63.0", + "@typescript-eslint/utils": "8.63.0", + "debug": "^4.4.3", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.63.0.tgz", + "integrity": "sha512-xyLtl9DUBBFrcJS4x2pIqGLH68/tC2uOa4Z7pUteW09D3bXnnXUom4dyPikzWgB7llmIc1zoeI3aoUdC4rPK/Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.63.0.tgz", + "integrity": "sha512-ygBkU+B7ex5UI/gKhaqexWev79uISfIv7XQCRNYO/jmD8rGLPyWLAb3KMRT6nd8Gt9bmUBi9+iX6tBdYfOY81Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.63.0", + "@typescript-eslint/tsconfig-utils": "8.63.0", + "@typescript-eslint/types": "8.63.0", + "@typescript-eslint/visitor-keys": "8.63.0", + "debug": "^4.4.3", + "minimatch": "^10.2.2", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.63.0.tgz", + "integrity": "sha512-fUKaeAvrTuQg/Tgt3nliAUSZHJM6DlCcfyEmxCvlX8kieWSStBX+5O5Fnidtc3i2JrH+9c/GL4RY2iasd/GPTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.63.0", + "@typescript-eslint/types": "8.63.0", + "@typescript-eslint/typescript-estree": "8.63.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.63.0.tgz", + "integrity": "sha512-UexrHGnGTpbuQHct2ExOc2ZcFbGUS9FOesCxxqdBGcpI1BxYu/LZ6U8Aq6/72XtF/qRBk9nhuGHFJIXXMhPMdw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.63.0", + "eslint-visitor-keys": "^5.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.0.3.tgz", + "integrity": "sha512-vmFvco5/QuC2f9Oj+wTk0+9XeDFkHxSamwZKYc7MxYwKICfvUvlMhqKI0VuICPltGqh1neqBKDvO4kes1ya8vg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "^1.0.1" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0", + "babel-plugin-react-compiler": "^1.0.0", + "vite": "^8.0.0" + }, + "peerDependenciesMeta": { + "@rolldown/plugin-babel": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + } + } + }, + "node_modules/acorn": { + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz", + "integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/aria-hidden": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/aria-hidden/-/aria-hidden-1.2.6.tgz", + "integrity": "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/baseline-browser-mapping": { + "version": "2.10.43", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.43.tgz", + "integrity": "sha512-AjYpR78kDWAY3Efj+cDTFH9t9SCoL7OoTp1BOb0mQV7S+6CiLwnWM3FyxhJtdPufDFKzmCSFoUncKjWgJEZTCQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/brace-expansion": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz", + "integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/browserslist": { + "version": "4.28.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.6.tgz", + "integrity": "sha512-FQBYNK15VMslhLHpA7+n+n1GOlF1kId2xcCg7/j95f24AOF6VDYMNH4mFxF7KuaTdv627faazpOAjFzMrfJOUw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.10.42", + "caniuse-lite": "^1.0.30001803", + "electron-to-chromium": "^1.5.389", + "node-releases": "^2.0.51", + "update-browserslist-db": "^1.2.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001805", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001805.tgz", + "integrity": "sha512-52noaS3DubycKSXaU30TwPGIp+POyQSUVa5jBEq3vkRkY0kjyb3LQgvhU6WGyCcyXqVLWO0Cw0Q6BSdD0kUfVA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/class-variance-authority": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/class-variance-authority/-/class-variance-authority-0.7.1.tgz", + "integrity": "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==", + "license": "Apache-2.0", + "dependencies": { + "clsx": "^2.1.1" + }, + "funding": { + "url": "https://polar.sh/cva" + } + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", + "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT" + }, + "node_modules/d3-array": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", + "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", + "license": "ISC", + "dependencies": { + "internmap": "1 - 2" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-color": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-ease": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", + "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-format": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.2.tgz", + "integrity": "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-interpolate": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", + "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz", + "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-scale": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", + "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", + "license": "ISC", + "dependencies": { + "d3-array": "2.10.0 - 3", + "d3-format": "1 - 3", + "d3-interpolate": "1.2.0 - 3", + "d3-time": "2.1.1 - 3", + "d3-time-format": "2 - 4" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-shape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", + "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==", + "license": "ISC", + "dependencies": { + "d3-path": "^3.1.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz", + "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==", + "license": "ISC", + "dependencies": { + "d3-array": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time-format": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", + "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", + "license": "ISC", + "dependencies": { + "d3-time": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-timer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", + "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/date-fns": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-4.4.0.tgz", + "integrity": "sha512-+1UMbeh68lH1SegH83CGWwpb6OHHbpSgr3+s5Eww5M4CAgswBpoWS0AjTOfEJ33HiYKz1hdj/KTFprzXHmq/6w==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/kossnocorp" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decimal.js-light": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/decimal.js-light/-/decimal.js-light-2.5.1.tgz", + "integrity": "sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==", + "license": "MIT" + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/detect-node-es": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz", + "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==", + "license": "MIT" + }, + "node_modules/dom-helpers": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", + "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.8.7", + "csstype": "^3.0.2" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.389", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.389.tgz", + "integrity": "sha512-cEto7aeOqBfU1D+c5py5pE+ooscKE75JifxLBdFUZsqAxRS6y7kebtxAZvICszSl05gPjYHDTjY+lXpyGvpJbg==", + "dev": true, + "license": "ISC" + }, + "node_modules/enhanced-resolve": { + "version": "5.21.6", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.21.6.tgz", + "integrity": "sha512-aNnGCvbJ/RIyWo1IuhNdVjnNF+EjH9wpzpNHt+ci/m9He9LJvUN8wrCcXjp9cWsGNAuvSpVFTx/vraAFQ8qGjQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.3.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "10.7.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.7.0.tgz", + "integrity": "sha512-GVTD7s1vdIl6UYvAfriOPeY1Df8LIZjfofLvHwde+erDHGGuHyuM6xoxRxmHiebhYuD2p1vN4wWh0XzPARSGDQ==", + "dev": true, + "license": "MIT", + "workspaces": [ + "packages/*" + ], + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.2", + "@eslint/config-array": "^0.23.5", + "@eslint/config-helpers": "^0.6.0", + "@eslint/core": "^1.2.1", + "@eslint/plugin-kit": "^0.7.2", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^9.1.2", + "eslint-visitor-keys": "^5.0.1", + "espree": "^11.2.0", + "esquery": "^1.7.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "minimatch": "^10.2.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-react-hooks": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.1.1.tgz", + "integrity": "sha512-f2I7Gw6JbvCexzIInuSbZpfdQ44D7iqdWX01FKLvrPgqxoE7oMj8clOfto8U6vYiz4yd5oKu39rRSVOe1zRu0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.24.4", + "@babel/parser": "^7.24.4", + "hermes-parser": "^0.25.1", + "zod": "^3.25.0 || ^4.0.0", + "zod-validation-error": "^3.5.0 || ^4.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 || ^10.0.0" + } + }, + "node_modules/eslint-plugin-react-refresh": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.5.3.tgz", + "integrity": "sha512-5EMmLCV98Pi4o/f/3DP/v/tNqLHMIc9I8LKClNDWhZ9JTho89/kQcitCXQBMG7sAfVRK0Ie3T2EDOzp1YXYiVA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "eslint": "^9 || ^10" + } + }, + "node_modules/eslint-scope": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.2.tgz", + "integrity": "sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@types/esrecurse": "^4.3.1", + "@types/estree": "^1.0.8", + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz", + "integrity": "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.16.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^5.0.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "license": "MIT" + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-equals": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.4.1.tgz", + "integrity": "sha512-DjlFSM5Pk9cGcL0q5QXl66eGzx0N6szNgaswwc5ZphlBohjTVJSnGgI+rJVOgOi65qUoQnDZN4nDqi33udtydQ==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", + "dev": true, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-nonce": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-nonce/-/get-nonce-1.0.1.tgz", + "integrity": "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "17.7.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.7.0.tgz", + "integrity": "sha512-Czmyns5dUsq4seFBR/Kdydhmo8y9kC79hiSkPn0YcGtNnYWnrgt0vjrSjx9tspoDGWm2CMarffRuLjM4xUz8xg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/hermes-estree": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz", + "integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==", + "dev": true, + "license": "MIT" + }, + "node_modules/hermes-parser": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.25.1.tgz", + "integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hermes-estree": "0.25.1" + } + }, + "node_modules/html-parse-stringify": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz", + "integrity": "sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==", + "license": "MIT", + "dependencies": { + "void-elements": "3.1.0" + } + }, + "node_modules/i18next": { + "version": "26.3.6", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-26.3.6.tgz", + "integrity": "sha512-Bu5Z2nAXgfVyM8xvW3jk9EKRIuX37PudsrBViThNFx7CR7aaYTpP01cxNB/E4c4UUzTDiAZRstEhsRfPOL/8xA==", + "funding": [ + { + "type": "individual", + "url": "https://www.locize.com/i18next" + }, + { + "type": "individual", + "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" + }, + { + "type": "individual", + "url": "https://www.locize.com" + } + ], + "license": "MIT", + "peerDependencies": { + "typescript": "^5 || ^6 || ^7" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/internmap": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", + "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/jiti": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", + "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lightningcss": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", + "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.32.0", + "lightningcss-darwin-arm64": "1.32.0", + "lightningcss-darwin-x64": "1.32.0", + "lightningcss-freebsd-x64": "1.32.0", + "lightningcss-linux-arm-gnueabihf": "1.32.0", + "lightningcss-linux-arm64-gnu": "1.32.0", + "lightningcss-linux-arm64-musl": "1.32.0", + "lightningcss-linux-x64-gnu": "1.32.0", + "lightningcss-linux-x64-musl": "1.32.0", + "lightningcss-win32-arm64-msvc": "1.32.0", + "lightningcss-win32-x64-msvc": "1.32.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", + "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", + "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", + "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", + "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", + "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", + "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", + "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", + "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", + "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", + "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", + "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", + "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", + "license": "MIT" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/lucide-react": { + "version": "1.24.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-1.24.0.tgz", + "integrity": "sha512-YT6mBD8lGKkg4nM39enlm94/sfJIiW0YKUT60fBy4YK8tai31ylg1VhGNWxkpSKHo9UagfnZqwIff3HTDQwXeA==", + "license": "ISC", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/minimatch": { + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.5" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.16", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.16.tgz", + "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/next-themes": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.4.6.tgz", + "integrity": "sha512-pZvgD5L0IEvX5/9GWyHMf3m8BKiVQwsCMHfoFosXtXBMnaS0ZnIJ9ST4b4NqLVKDEm8QBxoNNGNaBv2JNF6XNA==", + "license": "MIT", + "peerDependencies": { + "react": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc" + } + }, + "node_modules/node-releases": { + "version": "2.0.51", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.51.tgz", + "integrity": "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.19", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.19.tgz", + "integrity": "sha512-Mz8SaolMd8nB+G13WkORcxQKHZ/NE4xXevtkJHVuG+guo9/wYKlIMTKAqGdEmYOXR2ijPjTYNHssizdaVSUNdQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.12", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/prop-types/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "license": "MIT" + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/react": { + "version": "19.2.7", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.7.tgz", + "integrity": "sha512-HNe9WslTbXmFK8o8cmwgAeJFSBvt1bPdHCVKtaaV+WlAN36mpT4hcRpwbf3fY56ar2oIXzsBpOAiIRHAdY0OlQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-day-picker": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/react-day-picker/-/react-day-picker-10.0.1.tgz", + "integrity": "sha512-eNh6BlwcYInWaJtRv18mXQ06Ys/H6rdTZAnTaSdOYJuTpwP1JMCHNd1FDRadA+gbeinq+psdULN5Xnowy9mV8w==", + "license": "MIT", + "dependencies": { + "@date-fns/tz": "^1.4.1", + "date-fns": "^4.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "individual", + "url": "https://github.com/sponsors/gpbl" + }, + "peerDependencies": { + "@types/react": ">=16.8.0", + "react": ">=16.8.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/react-dom": { + "version": "19.2.7", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.7.tgz", + "integrity": "sha512-t0BRVXvbiE/o20Hfw669rLbMCDWtYZLvmJigy2f0MxsXF+71pxhR3xOkspmsO8h3ZlNzyibAmtCa3l4lYKk6gQ==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.27.0" + }, + "peerDependencies": { + "react": "^19.2.7" + } + }, + "node_modules/react-hook-form": { + "version": "7.81.0", + "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.81.0.tgz", + "integrity": "sha512-ocbmr2p5KBMoAfj4WCUvped33lVi1Kd5DuDUvQDnB6VEAacOjPI/jMbtDdbhco4y9ct4xUuCmMY0b/C9L0QHjw==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/react-hook-form" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17 || ^18 || ^19" + } + }, + "node_modules/react-i18next": { + "version": "17.0.9", + "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-17.0.9.tgz", + "integrity": "sha512-buLzOSqHtXxjf+qgSrLWNTXVZ1jSwO6kUv3uJqSP1roGBPgNnbhFm7OmdVwWcgf2gIbUyP0J333uPyx+Btsi3w==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.29.2", + "html-parse-stringify": "^3.0.1", + "use-sync-external-store": "^1.6.0" + }, + "peerDependencies": { + "i18next": ">= 26.2.0", + "react": ">= 16.8.0", + "typescript": "^5 || ^6 || ^7" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "license": "MIT" + }, + "node_modules/react-remove-scroll": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.7.2.tgz", + "integrity": "sha512-Iqb9NjCCTt6Hf+vOdNIZGdTiH1QSqr27H/Ek9sv/a97gfueI/5h1s3yRi1nngzMUaOOToin5dI1dXKdXiF+u0Q==", + "license": "MIT", + "dependencies": { + "react-remove-scroll-bar": "^2.3.7", + "react-style-singleton": "^2.2.3", + "tslib": "^2.1.0", + "use-callback-ref": "^1.3.3", + "use-sidecar": "^1.1.3" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/react-remove-scroll-bar": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.8.tgz", + "integrity": "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==", + "license": "MIT", + "dependencies": { + "react-style-singleton": "^2.2.2", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/react-router": { + "version": "7.18.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.18.1.tgz", + "integrity": "sha512-GDLgg3i3uM0aeJO3Fm+TCS+sDQ7gu12T6x0qdTEzcwqEfleci7JwugVNIF3U//0FWKnJT7ptG+20B2jfDqnZAg==", + "license": "MIT", + "dependencies": { + "cookie": "^1.0.1", + "set-cookie-parser": "^2.6.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "react": ">=18", + "react-dom": ">=18" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } + } + }, + "node_modules/react-router-dom": { + "version": "7.18.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.18.1.tgz", + "integrity": "sha512-KaZh+X/6UtEp28x51AUYZDMg9NGoz2ja3dNHa+ta/tk40vCzKhQ/RypCWBMLbmDr6//E24Vv5uPsrqXFozdkAg==", + "license": "MIT", + "dependencies": { + "react-router": "7.18.1" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "react": ">=18", + "react-dom": ">=18" + } + }, + "node_modules/react-smooth": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/react-smooth/-/react-smooth-4.0.4.tgz", + "integrity": "sha512-gnGKTpYwqL0Iii09gHobNolvX4Kiq4PKx6eWBCYYix+8cdw+cGo3do906l1NBPKkSWx1DghC1dlWG9L2uGd61Q==", + "license": "MIT", + "dependencies": { + "fast-equals": "^5.0.1", + "prop-types": "^15.8.1", + "react-transition-group": "^4.4.5" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/react-style-singleton": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.3.tgz", + "integrity": "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ==", + "license": "MIT", + "dependencies": { + "get-nonce": "^1.0.0", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/react-transition-group": { + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", + "license": "BSD-3-Clause", + "dependencies": { + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", + "loose-envify": "^1.4.0", + "prop-types": "^15.6.2" + }, + "peerDependencies": { + "react": ">=16.6.0", + "react-dom": ">=16.6.0" + } + }, + "node_modules/recharts": { + "version": "2.15.4", + "resolved": "https://registry.npmjs.org/recharts/-/recharts-2.15.4.tgz", + "integrity": "sha512-UT/q6fwS3c1dHbXv2uFgYJ9BMFHu3fwnd7AYZaEQhXuYQ4hgsxLvsUXzGdKeZrW5xopzDCvuA2N41WJ88I7zIw==", + "deprecated": "1.x and 2.x branches are no longer active. Bump to Recharts v3 to receive latest features and bugfixes. See https://github.com/recharts/recharts/wiki/3.0-migration-guide", + "license": "MIT", + "dependencies": { + "clsx": "^2.0.0", + "eventemitter3": "^4.0.1", + "lodash": "^4.17.21", + "react-is": "^18.3.1", + "react-smooth": "^4.0.4", + "recharts-scale": "^0.4.4", + "tiny-invariant": "^1.3.1", + "victory-vendor": "^36.6.8" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/recharts-scale": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/recharts-scale/-/recharts-scale-0.4.5.tgz", + "integrity": "sha512-kivNFO+0OcUNu7jQquLXAxz1FIwZj8nrj+YkOKc5694NbjCvcT6aSZiIzNzd2Kul4o4rTto8QVR9lMNtxD4G1w==", + "license": "MIT", + "dependencies": { + "decimal.js-light": "^2.4.1" + } + }, + "node_modules/rolldown": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.1.5.tgz", + "integrity": "sha512-t9z29cJjXf/vxQ8dyhCSpt6H6aSwHTk8cT5I3iy6SMXuFpk5mB6PL6XfC8PCwrPTx93udwKUm9HRteAlTGBLiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.139.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm64": "1.1.5", + "@rolldown/binding-darwin-arm64": "1.1.5", + "@rolldown/binding-darwin-x64": "1.1.5", + "@rolldown/binding-freebsd-x64": "1.1.5", + "@rolldown/binding-linux-arm-gnueabihf": "1.1.5", + "@rolldown/binding-linux-arm64-gnu": "1.1.5", + "@rolldown/binding-linux-arm64-musl": "1.1.5", + "@rolldown/binding-linux-ppc64-gnu": "1.1.5", + "@rolldown/binding-linux-s390x-gnu": "1.1.5", + "@rolldown/binding-linux-x64-gnu": "1.1.5", + "@rolldown/binding-linux-x64-musl": "1.1.5", + "@rolldown/binding-openharmony-arm64": "1.1.5", + "@rolldown/binding-wasm32-wasi": "1.1.5", + "@rolldown/binding-win32-arm64-msvc": "1.1.5", + "@rolldown/binding-win32-x64-msvc": "1.1.5" + } + }, + "node_modules/scheduler": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", + "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/set-cookie-parser": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz", + "integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==", + "license": "MIT" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/sonner": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/sonner/-/sonner-2.0.7.tgz", + "integrity": "sha512-W6ZN4p58k8aDKA4XPcx2hpIQXBRAgyiWVkYhT7CvK6D3iAu7xjvVyhQHg2/iaKJZ1XVJ4r7XuwGL+WGEK37i9w==", + "license": "MIT", + "peerDependencies": { + "react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc", + "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tailwind-merge": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.6.0.tgz", + "integrity": "sha512-uxL7qAVQriqRQPAyK3pj66VqskWqoZ37PW94jwOTwNfq/z9oyu1V+eqrZqtR2+fCiXdYOZe/Modt8GtvqNzu+w==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/dcastil" + } + }, + "node_modules/tailwindcss": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.2.tgz", + "integrity": "sha512-WtctNNSH8A9jlMIqxzuYumOHU5uGZyRv0Q5svQl+oEPy5w84YpBxdb7MdqyiSPQge5jTJ6zFQLq0PFygdccSBA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tapable": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", + "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/tiny-invariant": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", + "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/ts-api-utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", + "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/tw-animate-css": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/tw-animate-css/-/tw-animate-css-1.4.0.tgz", + "integrity": "sha512-7bziOlRqH0hJx80h/3mbicLW7o8qLsH5+RaLR2t+OHM3D0JlWGODQKQ4cxbK7WlvmUxpcj6Kgu6EKqjrGFe3QQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Wombosvideo" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/typescript": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "devOptional": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typescript-eslint": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.63.0.tgz", + "integrity": "sha512-xgwXyzG4sK9ALkBxbyGkTMMOS+imnW65iPhxCQMK83KhxyoDNW7l+IDqEf9vMdoUidHpOoS967RCq4eMiTexwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.63.0", + "@typescript-eslint/parser": "8.63.0", + "@typescript-eslint/typescript-estree": "8.63.0", + "@typescript-eslint/utils": "8.63.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/undici-types": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", + "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/update-browserslist-db": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/use-callback-ref": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.3.tgz", + "integrity": "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/use-sidecar": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.3.tgz", + "integrity": "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ==", + "license": "MIT", + "dependencies": { + "detect-node-es": "^1.1.0", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/use-sync-external-store": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz", + "integrity": "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==", + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/victory-vendor": { + "version": "36.9.2", + "resolved": "https://registry.npmjs.org/victory-vendor/-/victory-vendor-36.9.2.tgz", + "integrity": "sha512-PnpQQMuxlwYdocC8fIJqVXvkeViHYzotI+NJrCuav0ZYFoq912ZHBk3mCeuj+5/VpodOjPe1z0Fk2ihgzlXqjQ==", + "license": "MIT AND ISC", + "dependencies": { + "@types/d3-array": "^3.0.3", + "@types/d3-ease": "^3.0.0", + "@types/d3-interpolate": "^3.0.1", + "@types/d3-scale": "^4.0.2", + "@types/d3-shape": "^3.1.0", + "@types/d3-time": "^3.0.0", + "@types/d3-timer": "^3.0.0", + "d3-array": "^3.1.6", + "d3-ease": "^3.0.1", + "d3-interpolate": "^3.0.1", + "d3-scale": "^4.0.2", + "d3-shape": "^3.1.0", + "d3-time": "^3.0.0", + "d3-timer": "^3.0.1" + } + }, + "node_modules/vite": { + "version": "8.1.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.1.4.tgz", + "integrity": "sha512-bTT9PsdWO+MQMNG9ZXIP/qM9wGh37DFxTV/sPq9cFpHr3w4jkgef032PkAL9jAqhk3Nz8NQw3O8n6/xFkqO4QQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "lightningcss": "^1.32.0", + "picomatch": "^4.0.5", + "postcss": "^8.5.16", + "rolldown": "~1.1.4", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.3.0", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/void-elements": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz", + "integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", + "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-validation-error": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-4.0.2.tgz", + "integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "zod": "^3.25.0 || ^4.0.0" + } + } + } +} diff --git a/frontend/src/app/app-shell.tsx b/frontend/src/app/app-shell.tsx index ccc45865..c70c6853 100644 --- a/frontend/src/app/app-shell.tsx +++ b/frontend/src/app/app-shell.tsx @@ -24,6 +24,8 @@ const navigation = [ { href: "/accounts", label: "nav.accounts", icon: Users }, { href: "/client-keys", label: "nav.clientKeys", icon: KeyRound }, { href: "/models", label: "nav.models", icon: Box }, + { href: "/gallery", label: "nav.gallery", icon: Image }, + { href: "/video-gallery", label: "nav.videoGallery", icon: Video }, { href: "/request-audits", label: "nav.audits", icon: Eye }, ] as const; diff --git a/frontend/src/app/deferred-pages.tsx b/frontend/src/app/deferred-pages.tsx index 7ba12213..958f78c8 100644 --- a/frontend/src/app/deferred-pages.tsx +++ b/frontend/src/app/deferred-pages.tsx @@ -8,6 +8,8 @@ const RequestAuditsPage = lazyNamed(() => import("@/features/audits/request-audi const ClientKeysPage = lazyNamed(() => import("@/features/client-keys/client-keys-page"), "ClientKeysPage"); const DashboardPage = lazyNamed(() => import("@/features/dashboard/dashboard-page"), "DashboardPage"); const ApiDocsPage = lazyNamed(() => import("@/features/docs/api-docs-page"), "ApiDocsPage"); +const GalleryPage = lazyNamed(() => import("@/features/media/gallery-page"), "GalleryPage"); +const VideoGalleryPage = lazyNamed(() => import("@/features/media/video-gallery-page"), "VideoGalleryPage"); const ModelsPage = lazyNamed(() => import("@/features/models/models-page"), "ModelsPage"); const SettingsPage = lazyNamed(() => import("@/features/settings/settings-page"), "SettingsPage"); @@ -43,6 +45,14 @@ export function DeferredRequestAuditsPage() { return ; } +export function DeferredGalleryPage() { + return ; +} + +export function DeferredVideoGalleryPage() { + return ; +} + export function DeferredApiDocsPage() { return ; } diff --git a/frontend/src/app/router.tsx b/frontend/src/app/router.tsx index 68d04a67..ecbefca9 100644 --- a/frontend/src/app/router.tsx +++ b/frontend/src/app/router.tsx @@ -1,7 +1,7 @@ import { Navigate, createBrowserRouter } from "react-router-dom"; import { AnonymousBoundary, AuthBoundary } from "@/app/auth-boundary"; -import { DeferredAccountsPage, DeferredApiDocsPage, DeferredAppShell, DeferredClientKeysPage, DeferredDashboardPage, DeferredModelsPage, DeferredRequestAuditsPage, DeferredSettingsPage } from "@/app/deferred-pages"; +import { DeferredAccountsPage, DeferredApiDocsPage, DeferredAppShell, DeferredClientKeysPage, DeferredDashboardPage, DeferredGalleryPage, DeferredModelsPage, DeferredRequestAuditsPage, DeferredSettingsPage, DeferredVideoGalleryPage } from "@/app/deferred-pages"; import { LoginPage } from "@/features/auth/login-page"; export const router = createBrowserRouter([ @@ -20,6 +20,8 @@ export const router = createBrowserRouter([ { path: "/accounts", element: }, { path: "/models", element: }, { path: "/client-keys", element: }, + { path: "/gallery", element: }, + { path: "/video-gallery", element: }, { path: "/request-audits", element: }, { path: "/docs", element: }, { path: "/docs/:category/:endpoint", element: }, diff --git a/frontend/src/features/media/gallery-page.tsx b/frontend/src/features/media/gallery-page.tsx new file mode 100644 index 00000000..9a402e57 --- /dev/null +++ b/frontend/src/features/media/gallery-page.tsx @@ -0,0 +1,154 @@ +import { useQuery } from "@tanstack/react-query"; +import { Database, Image as ImageIcon, RefreshCw, Search, type LucideIcon } from "lucide-react"; +import { useState } from "react"; +import { useTranslation } from "react-i18next"; + +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { Spinner } from "@/components/ui/spinner"; +import { getImageStats, listImages } from "@/features/media/media-api"; +import type { MediaAssetDTO } from "@/features/media/types"; +import { EmptyState, ErrorState, LoadingState } from "@/shared/components/data-state"; +import { PageHeader } from "@/shared/components/page-header"; +import { Pagination } from "@/shared/components/pagination"; +import { useDebouncedValue } from "@/shared/hooks/use-debounced-value"; +import { formatDateTime, formatNumber } from "@/shared/lib/format"; + +export function GalleryPage() { + const { t, i18n } = useTranslation(); + const [page, setPage] = useState(1); + const [pageSize, setPageSize] = useState(20); + const [search, setSearch] = useState(""); + const debouncedSearch = useDebouncedValue(search); + + const imagesQuery = useQuery({ + queryKey: ["media", "images", page, pageSize], + queryFn: () => listImages({ page, pageSize }), + }); + const statsQuery = useQuery({ + queryKey: ["media", "images", "stats"], + queryFn: getImageStats, + staleTime: 30_000, + }); + + const result = imagesQuery.data; + const visibleImages = (result?.items ?? []).filter((image) => matchesImageSearch(image, debouncedSearch)); + const refreshing = imagesQuery.isFetching || statsQuery.isFetching; + + function refreshAll(): void { + void imagesQuery.refetch(); + void statsQuery.refetch(); + } + + return ( +
+ + + {t("common.refresh")} + + )} + /> + +
+ + +
+ +
+
+
+ + { setSearch(event.target.value); setPage(1); }} + placeholder={t("media.images.search")} + aria-label={t("media.images.search")} + /> +
+ {result ? {t("media.images.pageSummary", { count: visibleImages.length, total: result.total })} : null} +
+ + {imagesQuery.isError ? void imagesQuery.refetch()} /> : null} + {imagesQuery.isPending ? : null} + {!imagesQuery.isPending && result && result.items.length === 0 ? : null} + {!imagesQuery.isPending && result && result.items.length > 0 && visibleImages.length === 0 ? : null} + + {!imagesQuery.isPending && visibleImages.length > 0 ? ( +
+ {visibleImages.map((image) => )} +
+ ) : null} + + {result && result.total > 0 ? ( + { setPageSize(value); setPage(1); }} + /> + ) : null} +
+
+ ); +} + +function ImageCard({ image, locale }: { image: MediaAssetDTO; locale: string }) { + const { t } = useTranslation(); + return ( + +
+ {image.id} +
+
+
+ {image.id} + {formatBytes(image.sizeBytes, locale)} +
+
+ {image.mimeType || image.kind} + {formatDateTime(image.createdAt, locale)} +
+
{t("media.images.sha256")}: {image.sha256}
+
+
+ ); +} + +function MediaMetric({ icon: Icon, label, value, detail, loading }: { icon: LucideIcon; label: string; value: string; detail: string; loading: boolean }) { + return ( +
+
+ {label} + +
+
{loading ? : value}
+

{detail}

+
+ ); +} + +function matchesImageSearch(image: MediaAssetDTO, search: string): boolean { + const normalized = search.trim().toLocaleLowerCase(); + if (!normalized) return true; + return [image.id, image.kind, image.mimeType, image.sha256] + .filter(Boolean) + .some((value) => value.toLocaleLowerCase().includes(normalized)); +} + +function formatBytes(value: number, locale: string): string { + if (!Number.isFinite(value) || value <= 0) return "0 B"; + const units = ["B", "KB", "MB", "GB", "TB"]; + let size = value; + let unitIndex = 0; + while (size >= 1024 && unitIndex < units.length - 1) { + size /= 1024; + unitIndex += 1; + } + return `${new Intl.NumberFormat(locale, { maximumFractionDigits: unitIndex === 0 || size >= 10 ? 0 : 1 }).format(size)} ${units[unitIndex]}`; +} diff --git a/frontend/src/features/media/media-api.ts b/frontend/src/features/media/media-api.ts new file mode 100644 index 00000000..6d832571 --- /dev/null +++ b/frontend/src/features/media/media-api.ts @@ -0,0 +1,90 @@ +import type { MediaAssetDTO, ImageStatsDTO, MediaJobDTO, VideoStatsDTO } from "@/features/media/types"; +import { apiRequest, type PaginatedDTO } from "@/shared/api/client"; +import { + createObjectDecoder, + createPaginatedDecoder, + hasShape, + isNumber, + isString, + isOneOf, + isOptional, +} from "@/shared/api/decoder"; +import type { SortOrder } from "@/shared/lib/table-sort"; + +export type ListImagesInput = { + page: number; + pageSize: number; + search?: string; +}; + +export type ListVideosInput = { + page: number; + pageSize: number; + status?: MediaJobDTO["status"] | ""; + search?: string; + sortBy?: string; + sortOrder?: SortOrder; +}; + +const mediaAssetShape = { + id: isString, + kind: isString, + mimeType: isString, + sizeBytes: isNumber, + sha256: isString, + createdAt: isString, + url: isString, +}; + +const mediaJobShape = { + id: isString, + model: isString, + prompt: isString, + status: isOneOf("queued", "in_progress", "completed", "failed"), + progress: isNumber, + seconds: isNumber, + size: isString, + quality: isString, + accountName: isString, + clientKeyName: isString, + createdAt: isString, + completedAt: isOptional(isString), + errorMessage: isString, +}; + +const decodeImageStats = createObjectDecoder("image stats", { + totalImages: isNumber, + totalBytes: isNumber, +}); +const decodeVideoStats = createObjectDecoder("video stats", { + totalJobs: isNumber, + completed: isNumber, + failed: isNumber, + inProgress: isNumber, + queued: isNumber, +}); + +export function listImages(input: ListImagesInput): Promise> { + const query = new URLSearchParams({ page: String(input.page), pageSize: String(input.pageSize) }); + if (input.search) query.set("search", input.search); + return apiRequest(`/api/admin/v1/media/images?${query}`, {}, createPaginatedDecoder(hasShape(mediaAssetShape))); +} + +export function getImageStats(): Promise { + return apiRequest("/api/admin/v1/media/images/stats", {}, decodeImageStats); +} + +export function listVideos(input: ListVideosInput): Promise> { + const query = new URLSearchParams({ page: String(input.page), pageSize: String(input.pageSize) }); + if (input.status) query.set("status", input.status); + if (input.search) query.set("search", input.search); + if (input.sortBy && input.sortOrder) { + query.set("sortBy", input.sortBy); + query.set("sortOrder", input.sortOrder); + } + return apiRequest(`/api/admin/v1/media/videos?${query}`, {}, createPaginatedDecoder(hasShape(mediaJobShape))); +} + +export function getVideoStats(): Promise { + return apiRequest("/api/admin/v1/media/videos/stats", {}, decodeVideoStats); +} diff --git a/frontend/src/features/media/types.ts b/frontend/src/features/media/types.ts new file mode 100644 index 00000000..620f081c --- /dev/null +++ b/frontend/src/features/media/types.ts @@ -0,0 +1,28 @@ +export type MediaAssetDTO = { + id: string; + kind: string; + mimeType: string; + sizeBytes: number; + sha256: string; + createdAt: string; + url: string; +}; + +export type MediaJobDTO = { + id: string; + model: string; + prompt: string; + status: "queued" | "in_progress" | "completed" | "failed"; + progress: number; + seconds: number; + size: string; + quality: string; + accountName: string; + clientKeyName: string; + createdAt: string; + completedAt: string | null; + errorMessage: string; +}; + +export type ImageStatsDTO = { totalImages: number; totalBytes: number }; +export type VideoStatsDTO = { totalJobs: number; completed: number; failed: number; inProgress: number; queued: number }; diff --git a/frontend/src/features/media/video-gallery-page.tsx b/frontend/src/features/media/video-gallery-page.tsx new file mode 100644 index 00000000..55f6e19c --- /dev/null +++ b/frontend/src/features/media/video-gallery-page.tsx @@ -0,0 +1,230 @@ +import { useQuery } from "@tanstack/react-query"; +import { AlertCircle, CheckCircle2, Clock, ListVideo, Loader2, RefreshCw, Search, type LucideIcon } from "lucide-react"; +import { useState } from "react"; +import { useTranslation } from "react-i18next"; + +import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; +import { Spinner } from "@/components/ui/spinner"; +import { Table, TableBody, TableCell, TableHeader, TableRow } from "@/components/ui/table"; +import { getVideoStats, listVideos } from "@/features/media/media-api"; +import type { MediaJobDTO } from "@/features/media/types"; +import { EmptyState, ErrorState, TableLoadingRow } from "@/shared/components/data-state"; +import { DataTableShell } from "@/shared/components/data-table-shell"; +import { PageHeader } from "@/shared/components/page-header"; +import { Pagination } from "@/shared/components/pagination"; +import { SortableTableHead } from "@/shared/components/sortable-table-head"; +import { useDebouncedValue } from "@/shared/hooks/use-debounced-value"; +import { cn } from "@/shared/lib/cn"; +import { formatDateTime, formatNumber } from "@/shared/lib/format"; +import { nextTableSort, type SortOrder, type TableSort } from "@/shared/lib/table-sort"; + +type VideoStatusFilter = MediaJobDTO["status"] | ""; + +const statusOptions: VideoStatusFilter[] = ["", "queued", "in_progress", "completed", "failed"]; + +export function VideoGalleryPage() { + const { t, i18n } = useTranslation(); + const [page, setPage] = useState(1); + const [pageSize, setPageSize] = useState(20); + const [search, setSearch] = useState(""); + const [statusFilter, setStatusFilter] = useState(""); + const [sort, setSort] = useState({ field: "createdAt", order: "desc" }); + const debouncedSearch = useDebouncedValue(search); + + const videosQuery = useQuery({ + queryKey: ["media", "videos", page, pageSize, statusFilter, debouncedSearch, sort.field, sort.order], + queryFn: () => listVideos({ page, pageSize, status: statusFilter, search: debouncedSearch, sortBy: sort.field, sortOrder: sort.order }), + }); + const statsQuery = useQuery({ + queryKey: ["media", "videos", "stats"], + queryFn: getVideoStats, + staleTime: 30_000, + }); + + const result = videosQuery.data; + const refreshing = videosQuery.isFetching || statsQuery.isFetching; + + function refreshAll(): void { + void videosQuery.refetch(); + void statsQuery.refetch(); + } + + function changeSort(field: string, initialOrder: SortOrder): void { + setSort((current) => nextTableSort(current, field, initialOrder)); + setPage(1); + } + + return ( +
+ + + {t("common.refresh")} + + )} + /> + +
+ + + + + +
+ + +
+
+ + { setSearch(event.target.value); setPage(1); }} + placeholder={t("media.videos.search")} + aria-label={t("media.videos.search")} + /> +
+ +
+ {result ? {t("media.videos.pageSummary", { count: result.items.length, total: result.total })} : null} + + )} + footer={result && result.total > 0 ? ( + { setPageSize(value); setPage(1); }} + /> + ) : undefined} + > + {videosQuery.isError ? void videosQuery.refetch()} /> : null} + {result && result.items.length === 0 ? : null} + {videosQuery.isPending || (result && result.items.length > 0) ? ( + + + + + + + + + + + + + + {t("media.videos.prompt")} + {t("media.videos.model")} + {t("media.videos.status")} + {t("media.videos.progress")} + {t("media.videos.spec")} + {t("media.videos.owner")} + {t("media.videos.createdAt")} + {t("media.videos.completedAt")} + + + + {videosQuery.isPending ? : result?.items.map((job) => ( + + +
+ {job.prompt || "-"} + {job.id} + {job.errorMessage ? {job.errorMessage} : null} +
+
+ {job.model || "-"} + + + +
+ {formatSpec(job)} + {t("media.videos.seconds", { count: job.seconds })} +
+
+ +
+ {job.accountName || "-"} + {job.clientKeyName || "-"} +
+
+ {formatDateTime(job.createdAt, i18n.language)} + {formatDateTime(job.completedAt, i18n.language)} +
+ ))} +
+
+ ) : null} +
+
+ ); +} + +function VideoMetric({ icon: Icon, label, value, loading }: { icon: LucideIcon; label: string; value: string; loading: boolean }) { + return ( +
+
+ {label} + +
+
{loading ? : value}
+
+ ); +} + +function VideoStatusBadge({ status }: { status: MediaJobDTO["status"] }) { + const { t } = useTranslation(); + return ( + + {t(`media.videoStatus.${status}`)} + + ); +} + +function ProgressValue({ value, locale }: { value: number; locale: string }) { + const normalized = Math.max(0, Math.min(100, value)); + return ( +
+ {formatNumber(normalized, locale, 0)}% + + + +
+ ); +} + +function statusClassName(status: MediaJobDTO["status"]): string { + switch (status) { + case "completed": + return "bg-emerald-500/10 text-emerald-700 dark:text-emerald-300"; + case "failed": + return "bg-red-500/10 text-red-700 dark:text-red-300"; + case "in_progress": + return "bg-sky-500/10 text-sky-700 dark:text-sky-300"; + case "queued": + return "bg-amber-500/10 text-amber-700 dark:text-amber-300"; + } +} + +function formatSpec(job: MediaJobDTO): string { + return [job.size, job.quality].filter(Boolean).join(" · ") || "-"; +} diff --git a/frontend/src/shared/i18n/index.ts b/frontend/src/shared/i18n/index.ts index 8d6c38b8..4ba5f182 100644 --- a/frontend/src/shared/i18n/index.ts +++ b/frontend/src/shared/i18n/index.ts @@ -59,10 +59,55 @@ const resources = { accounts: "账号", models: "模型", clientKeys: "密钥", + gallery: "图库", + videoGallery: "视频库", audits: "请求审计", docs: "文档", settings: "设置", }, + media: { + images: { + title: "图库", + description: "浏览已生成的图片资源", + search: "搜索 ID、类型或哈希", + empty: "暂无图片", + noMatches: "未找到匹配的图片", + sha256: "SHA256", + totalImages: "图片总数", + totalImagesDetail: "已归档的图片数量", + totalBytes: "占用空间", + totalBytesDetail: "所有图片文件总大小", + pageSummary: "显示 {{count}} / {{total}} 张", + }, + videos: { + title: "视频库", + description: "查看视频生成任务记录", + search: "搜索提示词或 ID", + empty: "暂无视频任务", + statusFilter: "状态筛选", + totalJobs: "任务总数", + queued: "排队中", + inProgress: "进行中", + completed: "已完成", + failed: "失败", + prompt: "提示词", + model: "模型", + status: "状态", + progress: "进度", + spec: "规格", + owner: "归属", + createdAt: "创建时间", + completedAt: "完成时间", + seconds: "{{count}} 秒", + pageSummary: "显示 {{count}} / {{total}} 条", + }, + videoStatus: { + queued: "排队中", + in_progress: "进行中", + completed: "已完成", + failed: "失败", + }, + }, auth: { title: "管理员登录", productTitle: "轻量 API 网关", @@ -649,7 +694,8 @@ const resources = { expiryUnknown: "Credential expiry is unknown", }, common: { actions: "Actions", cancel: "Cancel", close: "Close", copy: "Copy", copied: "Copied", create: "Create", delete: "Delete", disabled: "Disabled", disable: "Disable", edit: "Edit", enabled: "Enabled", enable: "Enable", loading: "Loading", importingProgress: "Importing, completed {{completed}} / {{total}}", syncingProgress: "Syncing initial data, completed {{completed}} / {{total}}", noData: "No data", pageOf: "Page {{page}}/{{pages}}", perPage: "Per page", rows: "rows", firstPage: "First page", lastPage: "Last page", previousPage: "Previous page", nextPage: "Next page", selectedCount: "{{count}} selected", selectPage: "Select this page", selectItem: "Select {{name}}", refresh: "Refresh", retry: "Retry", filter: "Filters", all: "All", clearFilters: "Clear filters", save: "Save", reset: "Reset", sortAscending: "Sort {{column}} ascending", sortDescending: "Sort {{column}} descending" }, - nav: { dashboard: "Dashboard", accounts: "Accounts", models: "Models", clientKeys: "Client keys", audits: "Request audits", docs: "Documentation", settings: "Settings" }, + nav: { dashboard: "Dashboard", accounts: "Accounts", models: "Models", clientKeys: "Client keys", gallery: "Gallery", videoGallery: "Video Gallery", audits: "Request audits", docs: "Documentation", settings: "Settings" }, + media: { images: { title: "Gallery", description: "Browse generated image assets", search: "Search ID, type, or hash", empty: "No images", noMatches: "No matching images", sha256: "SHA256", totalImages: "Total images", totalImagesDetail: "Archived image count", totalBytes: "Storage", totalBytesDetail: "Total size of all image files", pageSummary: "Showing {{count}} / {{total}}" }, videos: { title: "Video Gallery", description: "View video generation job records", search: "Search prompt or ID", empty: "No video jobs", statusFilter: "Status filter", totalJobs: "Total jobs", queued: "Queued", inProgress: "In progress", completed: "Completed", failed: "Failed", prompt: "Prompt", model: "Model", status: "Status", progress: "Progress", spec: "Spec", owner: "Owner", createdAt: "Created", completedAt: "Completed", seconds: "{{count}} sec", pageSummary: "Showing {{count}} / {{total}}" }, videoStatus: { queued: "Queued", in_progress: "In progress", completed: "Completed", failed: "Failed" } }, auth: { title: "Admin sign in", productTitle: "Lightweight API gateway", subtitle: "Manage upstream accounts, model routes, and client access.", username: "Username", password: "Password", usernameRequired: "Enter your username", passwordRequired: "Enter your password", signIn: "Sign in", signingIn: "Signing in", signOut: "Sign out", changePassword: "Change password", currentPassword: "Current password", newPassword: "New password", passwordUpdated: "Password updated. Sign in again.", sessionUnavailable: "Unable to restore the session", sessionUnavailableDescription: "The service may be temporarily unavailable. Your session was not cleared; please retry shortly.", retrySession: "Retry" }, shell: { appearance: "Appearance", dark: "Dark", light: "Light", system: "System", language: "Language", navigation: "Navigation", openNavigation: "Open navigation" }, dashboard: { title: "Dashboard", subtitle: "Welcome, {{name}}", lastUpdated: "Updated {{time}}", welcome: "Welcome, {{name}}", gatewayOnline: "Gateway healthy", gatewayOffline: "Unavailable", gatewayReady: "The gateway is ready to process API requests.", gatewayNeedsAccount: "Connect an available account to process API requests.", manageAccounts: "Manage accounts", usage: "Usage overview", seeAll: "View audits", activeAccounts: "Available accounts", accountCapacity: "{{total}} accounts · {{rate}}% success", manage: "Manage", tokens: "Total tokens", requests: "Requests", successRate: "Success rate", availableSummary: "{{active}} / {{total}} available", requestBreakdown: "{{success}} succeeded · {{failed}} failed", requestQualitySummary: "{{success}}% success · {{failed}} failed", periodSummary: "Current {{period}} range", successSummary: "{{success}} / {{total}} requests succeeded", trend: "Usage trend", trendRequests: "Requests", trendTokens: "Tokens", resourcesTitle: "Resource status", qualityTitle: "Request quality", successfulRequests: "Successful requests", failedRequests: "Failed requests", topModels: "Top 10 models", model: "Model", share: "Call share", noTopModels: "No model calls in this period", billing: "Billing", billingSummary: "Accumulated in the current {{period}} range", inputTokens: "Input", cachedTokens: "Cached", outputTokens: "Output", reasoningTokens: "Reasoning", uncachedInput: "Uncached input", visibleOutput: "Visible output", otherModels: "Other models", tokenBreakdown: "Input {{input}} · Cached {{cached}} · Output {{output}} · Reasoning {{reasoning}}", tokenEfficiency: "Cache hit rate {{rate}}%", explore: "Manage resources", accountsProduct: "Upstream accounts", accountsProductDescription: "Manage OAuth credentials, health, quota, and concurrency.", keysProduct: "Client keys", keysProductDescription: "Create downstream API keys and control models, RPM, and concurrency.", modelsProduct: "Model routes", modelsProductDescription: "Manage public model IDs, upstream mappings, and availability.", auditsProduct: "Request audits", auditsProductDescription: "Inspect status, latency, and token usage records.", gatewayFooter: "A lightweight API gateway", learnMore: "View models", unknown: "Unknown" }, From 7c03e43e976a80722316102c90b62a08e0f97105 Mon Sep 17 00:00:00 2001 From: hamburg <176999917@qq.com> Date: Tue, 14 Jul 2026 13:01:58 +0800 Subject: [PATCH 02/16] fix(frontend): repair copy buttons on non-secure contexts All copy buttons silently failed when the app was served over plain HTTP on a LAN IP, because navigator.clipboard.writeText rejects in a non-secure context and the previous code neither awaited the promise nor handled its rejection. Surface a boolean return value from copyToClipboard and fall back to execCommand(copy) with a hidden textarea so copying works regardless of context security. Extract the duplicated inline CopyButton implementations from the docs, accounts, and client-keys pages into a single shared component that handles the icon toggle, toast notifications, and fallback wiring. Client keys still fetch the secret before copying via the existing mutation, but now surface copy failures through its error handler. Add the common.copyFailed translation key for both locales. --- .../src/features/accounts/accounts-page.tsx | 14 +---- .../features/client-keys/client-keys-page.tsx | 16 ++---- frontend/src/features/docs/api-docs-page.tsx | 15 +---- frontend/src/shared/clipboard.ts | 57 +++++++++++++++++-- .../src/shared/components/copy-button.tsx | 51 +++++++++++++++++ frontend/src/shared/i18n/index.ts | 3 +- 6 files changed, 115 insertions(+), 41 deletions(-) create mode 100644 frontend/src/shared/components/copy-button.tsx diff --git a/frontend/src/features/accounts/accounts-page.tsx b/frontend/src/features/accounts/accounts-page.tsx index 5261693e..cfe61bb8 100644 --- a/frontend/src/features/accounts/accounts-page.tsx +++ b/frontend/src/features/accounts/accounts-page.tsx @@ -1,13 +1,13 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; -import { ArrowRight, ClipboardPaste, Compass, Copy, Download, ExternalLink, FileUp, Link2, MoreHorizontal, Pencil, RefreshCw, RotateCw, Search, SquareTerminal, Trash2, TriangleAlert, Webhook } from "lucide-react"; +import { ArrowRight, ClipboardPaste, Compass, Download, ExternalLink, FileUp, Link2, MoreHorizontal, Pencil, RefreshCw, RotateCw, Search, SquareTerminal, Trash2, TriangleAlert, Webhook } from "lucide-react"; import { useCallback, useEffect, useRef, useState, type ReactNode } from "react"; import { useForm, useWatch } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { toast } from "sonner"; import { z } from "zod"; -import { copyToClipboard } from "@/shared/clipboard"; +import { CopyButton } from "@/shared/components/copy-button"; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@/components/ui/alert-dialog"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; @@ -778,15 +778,7 @@ export function AccountsPage() {
{deviceSession.userCode} - - - - - {t("common.copy")} - + toast.success(t("common.copied"))} />
- - {t("keys.copySecret")} - + toast.success(t("common.copied"))} /> diff --git a/frontend/src/features/docs/api-docs-page.tsx b/frontend/src/features/docs/api-docs-page.tsx index c7558c4c..b17e3891 100644 --- a/frontend/src/features/docs/api-docs-page.tsx +++ b/frontend/src/features/docs/api-docs-page.tsx @@ -1,17 +1,16 @@ import { useQuery } from "@tanstack/react-query"; -import { Braces, Check, Code2, Copy, Info, Link2 } from "lucide-react"; +import { Braces, Code2, Info, Link2 } from "lucide-react"; import { useState, type ReactNode } from "react"; import { Navigate, useParams } from "react-router-dom"; import { useTranslation } from "react-i18next"; -import { Button } from "@/components/ui/button"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { listModels } from "@/entities/model/model-api"; import type { ModelRouteDTO } from "@/entities/model/types"; import { getSystemInfo } from "@/entities/system/system-api"; import { runtimeConfig } from "@/shared/config/runtime-config"; -import { copyToClipboard } from "@/shared/clipboard"; +import { CopyButton } from "@/shared/components/copy-button"; import { cn } from "@/shared/lib/cn"; type ExampleLanguage = "curl" | "python" | "javascript"; @@ -362,13 +361,3 @@ function ExamplePanel({ ); } - -function CopyButton({ value, className }: { value: string; className?: string }) { - const { t } = useTranslation(); - const [copied, setCopied] = useState(false); - return ( - - ); -} diff --git a/frontend/src/shared/clipboard.ts b/frontend/src/shared/clipboard.ts index a222ab05..89085c3a 100644 --- a/frontend/src/shared/clipboard.ts +++ b/frontend/src/shared/clipboard.ts @@ -1,13 +1,62 @@ -export async function copyToClipboard(text: string): Promise { +export async function copyToClipboard(text: string): Promise { if (navigator.clipboard?.writeText) { - return navigator.clipboard.writeText(text); + try { + await navigator.clipboard.writeText(text); + return true; + } catch { + // The async Clipboard API can reject in a non-secure context (plain + // HTTP on a LAN IP) or when the document is not focused. Fall through to + // the synchronous execCommand fallback so copying still works there. + } } + return legacyCopy(text); +} + +// execCommand("copy") is deprecated but remains the standard way to copy +// programmatically when the async Clipboard API is unavailable. +function legacyCopy(text: string): boolean { + if (typeof document === "undefined") return false; const textarea = document.createElement("textarea"); textarea.value = text; + textarea.setAttribute("readonly", ""); textarea.style.position = "fixed"; - textarea.style.opacity = "0"; + textarea.style.top = "0"; + textarea.style.left = "0"; + textarea.style.width = "1em"; + textarea.style.height = "1em"; + // A large font keeps iOS Safari from zooming the page and lets the + // selection persist on the programmatically created element. + textarea.style.fontSize = "2em"; + textarea.style.padding = "0"; + textarea.style.border = "none"; + textarea.style.outline = "none"; + textarea.style.boxShadow = "none"; + textarea.style.background = "transparent"; + + const activeElement = document.activeElement as Element | null; + const selection = document.getSelection(); + let savedRange: Range | null = null; + if (selection && selection.rangeCount > 0) savedRange = selection.getRangeAt(0); + document.body.appendChild(textarea); + textarea.focus(); textarea.select(); - document.execCommand("copy"); + textarea.setSelectionRange(0, text.length); + + let ok = false; + try { + ok = document.execCommand("copy"); + } catch { + // execCommand may throw in restricted environments; ok stays false. + } + document.body.removeChild(textarea); + if (savedRange && selection) { + selection.removeAllRanges(); + selection.addRange(savedRange); + } + if (activeElement instanceof HTMLElement && typeof activeElement.focus === "function") { + activeElement.focus(); + } + return ok; } diff --git a/frontend/src/shared/components/copy-button.tsx b/frontend/src/shared/components/copy-button.tsx new file mode 100644 index 00000000..6134b56e --- /dev/null +++ b/frontend/src/shared/components/copy-button.tsx @@ -0,0 +1,51 @@ +import { Check, Copy } from "lucide-react"; +import { useState } from "react"; +import { useTranslation } from "react-i18next"; +import { toast } from "sonner"; + +import { Button } from "@/components/ui/button"; +import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; +import { copyToClipboard } from "@/shared/clipboard"; +import { cn } from "@/shared/lib/cn"; + +export function CopyButton({ + value, + className, + disabled, + onCopied, + onError, +}: { + value: string; + className?: string; + disabled?: boolean; + onCopied?: () => void; + onError?: (error: unknown) => void; +}) { + const { t } = useTranslation(); + const [copied, setCopied] = useState(false); + + async function handleClick() { + const ok = await copyToClipboard(value); + if (ok) { + setCopied(true); + window.setTimeout(() => setCopied(false), 1500); + onCopied?.(); + } else { + const message = t("common.copyFailed"); + toast.error(message); + onError?.(new Error(message)); + } + } + + const label = copied ? t("common.copied") : t("common.copy"); + return ( + + + + + {label} + + ); +} diff --git a/frontend/src/shared/i18n/index.ts b/frontend/src/shared/i18n/index.ts index 3ace22b7..5b8a0eba 100644 --- a/frontend/src/shared/i18n/index.ts +++ b/frontend/src/shared/i18n/index.ts @@ -50,6 +50,7 @@ const resources = { close: "关闭", copy: "复制", copied: "已复制", + copyFailed: "复制失败", create: "创建", delete: "删除", disabled: "已停用", @@ -701,7 +702,7 @@ const resources = { expiresAt: "Credential expires: {{time}}", expiryUnknown: "Credential expiry is unknown", }, - common: { actions: "Actions", cancel: "Cancel", close: "Close", copy: "Copy", copied: "Copied", create: "Create", delete: "Delete", disabled: "Disabled", disable: "Disable", edit: "Edit", enabled: "Enabled", enable: "Enable", loading: "Loading", importingProgress: "Importing, completed {{completed}} / {{total}}", syncingProgress: "Syncing initial data, completed {{completed}} / {{total}}", noData: "No data", pageOf: "Page {{page}}/{{pages}}", perPage: "Per page", rows: "rows", firstPage: "First page", lastPage: "Last page", previousPage: "Previous page", nextPage: "Next page", selectedCount: "{{count}} selected", selectPage: "Select this page", selectItem: "Select {{name}}", refresh: "Refresh", retry: "Retry", filter: "Filters", all: "All", clearFilters: "Clear filters", save: "Save", reset: "Reset", sortAscending: "Sort {{column}} ascending", sortDescending: "Sort {{column}} descending" }, + common: { actions: "Actions", cancel: "Cancel", close: "Close", copy: "Copy", copied: "Copied", copyFailed: "Copy failed", create: "Create", delete: "Delete", disabled: "Disabled", disable: "Disable", edit: "Edit", enabled: "Enabled", enable: "Enable", loading: "Loading", importingProgress: "Importing, completed {{completed}} / {{total}}", syncingProgress: "Syncing initial data, completed {{completed}} / {{total}}", noData: "No data", pageOf: "Page {{page}}/{{pages}}", perPage: "Per page", rows: "rows", firstPage: "First page", lastPage: "Last page", previousPage: "Previous page", nextPage: "Next page", selectedCount: "{{count}} selected", selectPage: "Select this page", selectItem: "Select {{name}}", refresh: "Refresh", retry: "Retry", filter: "Filters", all: "All", clearFilters: "Clear filters", save: "Save", reset: "Reset", sortAscending: "Sort {{column}} ascending", sortDescending: "Sort {{column}} descending" }, nav: { dashboard: "Dashboard", accounts: "Accounts", models: "Models", clientKeys: "Client keys", audits: "Request audits", docs: "Documentation", settings: "Settings" }, auth: { title: "Admin sign in", productTitle: "Lightweight API gateway", subtitle: "Manage upstream accounts, model routes, and client access.", username: "Username", password: "Password", usernameRequired: "Enter your username", passwordRequired: "Enter your password", signIn: "Sign in", signingIn: "Signing in", signOut: "Sign out", changePassword: "Change password", currentPassword: "Current password", newPassword: "New password", passwordUpdated: "Password updated. Sign in again.", sessionUnavailable: "Unable to restore the session", sessionUnavailableDescription: "The service may be temporarily unavailable. Your session was not cleared; please retry shortly.", retrySession: "Retry" }, shell: { appearance: "Appearance", dark: "Dark", light: "Light", system: "System", language: "Language", navigation: "Navigation", openNavigation: "Open navigation" }, From dcaeb3f3c214559a2680bc5903869080164a67e6 Mon Sep 17 00:00:00 2001 From: Chenyme <118253778+chenyme@users.noreply.github.com> Date: Tue, 14 Jul 2026 13:56:35 +0800 Subject: [PATCH 03/16] chore: Update Docker workflow to enhance pull request handling and image publishing logic --- .github/workflows/docker-publish.yml | 72 +++++++++++++++++++++++----- 1 file changed, 59 insertions(+), 13 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 5348a09a..cac64124 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -1,12 +1,21 @@ name: Docker on: - push: + pull_request: branches: - main - tags: - - "v*" - pull_request: + types: + - opened + - reopened + - synchronize + pull_request_target: + branches: + - main + types: + - closed + release: + types: + - published workflow_dispatch: concurrency: @@ -15,7 +24,6 @@ concurrency: permissions: contents: read - packages: write env: REGISTRY: ghcr.io @@ -28,6 +36,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.merge_commit_sha || github.ref }} - name: Set up Go uses: actions/setup-go@v5 @@ -72,8 +82,9 @@ jobs: working-directory: frontend run: pnpm build - image: - name: Build and publish image + image-check: + name: Build image + if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' needs: verify runs-on: ubuntu-latest steps: @@ -86,8 +97,41 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Build + uses: docker/build-push-action@v6 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: false + cache-from: type=gha + provenance: false + sbom: false + + publish: + name: Publish image + if: >- + (github.event_name == 'pull_request_target' && + github.event.pull_request.merged == true) || + (github.event_name == 'release' && + github.event.action == 'published') + needs: verify + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.merge_commit_sha || github.ref }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to GHCR - if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} @@ -99,10 +143,12 @@ jobs: uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + flavor: | + latest=false tags: | - type=raw,value=latest,enable={{is_default_branch}} - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} + type=raw,value=latest,enable=${{ github.event_name == 'pull_request_target' }} + type=semver,pattern={{version}},enable=${{ github.event_name == 'release' }} + type=semver,pattern={{major}}.{{minor}},enable=${{ github.event_name == 'release' }} type=sha,prefix=sha- - name: Build and publish @@ -110,10 +156,10 @@ jobs: with: context: . platforms: linux/amd64,linux/arm64 - push: ${{ github.event_name != 'pull_request' }} + push: true tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} cache-from: type=gha - cache-to: ${{ github.event_name != 'pull_request' && 'type=gha,mode=max' || '' }} + cache-to: type=gha,mode=max provenance: mode=max sbom: true From 19ec7812eaabd07f20e6460c82c60ce92fad55a7 Mon Sep 17 00:00:00 2001 From: Chenyme <118253778+chenyme@users.noreply.github.com> Date: Tue, 14 Jul 2026 14:05:43 +0800 Subject: [PATCH 04/16] chore: Remove Docker workflow file as part of repository cleanup --- .github/workflows/codeql.yml | 49 ++++++ .github/workflows/docker-publish.yml | 165 -------------------- .github/workflows/ghcr-image.yml | 219 +++++++++++++++++++++++++++ .github/workflows/stale.yml | 30 ++++ 4 files changed, 298 insertions(+), 165 deletions(-) create mode 100644 .github/workflows/codeql.yml delete mode 100644 .github/workflows/docker-publish.yml create mode 100644 .github/workflows/ghcr-image.yml create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..99e7d25d --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,49 @@ +name: CodeQL Advanced + +on: + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: "0 0 * * *" + +concurrency: + group: codeql-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ubuntu-latest + permissions: + security-events: write + packages: read + actions: read + contents: read + strategy: + fail-fast: false + matrix: + include: + - language: actions + build-mode: none + - language: go + build-mode: autobuild + - language: javascript-typescript + build-mode: none + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v4 + with: + category: /language:${{ matrix.language }} diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml deleted file mode 100644 index cac64124..00000000 --- a/.github/workflows/docker-publish.yml +++ /dev/null @@ -1,165 +0,0 @@ -name: Docker - -on: - pull_request: - branches: - - main - types: - - opened - - reopened - - synchronize - pull_request_target: - branches: - - main - types: - - closed - release: - types: - - published - workflow_dispatch: - -concurrency: - group: docker-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - contents: read - -env: - REGISTRY: ghcr.io - IMAGE_NAME: chenyme/grok2api - -jobs: - verify: - name: Verify - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.merge_commit_sha || github.ref }} - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version-file: backend/go.mod - cache-dependency-path: backend/go.sum - - - name: Test backend - working-directory: backend - run: go test ./... - - - name: Vet backend - working-directory: backend - run: go vet ./... - - - name: Verify Swagger document - run: | - make swagger - git diff --exit-code -- backend/docs/docs.go backend/docs/swagger.json backend/docs/swagger.yaml - - - name: Set up pnpm - uses: pnpm/action-setup@v4 - with: - version: 11.5.2 - - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: pnpm - cache-dependency-path: frontend/pnpm-lock.yaml - - - name: Install frontend dependencies - working-directory: frontend - run: pnpm install --frozen-lockfile - - - name: Lint frontend - working-directory: frontend - run: pnpm lint - - - name: Build frontend - working-directory: frontend - run: pnpm build - - image-check: - name: Build image - if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' - needs: verify - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build - uses: docker/build-push-action@v6 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: false - cache-from: type=gha - provenance: false - sbom: false - - publish: - name: Publish image - if: >- - (github.event_name == 'pull_request_target' && - github.event.pull_request.merged == true) || - (github.event_name == 'release' && - github.event.action == 'published') - needs: verify - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.merge_commit_sha || github.ref }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to GHCR - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract image metadata - id: metadata - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - flavor: | - latest=false - tags: | - type=raw,value=latest,enable=${{ github.event_name == 'pull_request_target' }} - type=semver,pattern={{version}},enable=${{ github.event_name == 'release' }} - type=semver,pattern={{major}}.{{minor}},enable=${{ github.event_name == 'release' }} - type=sha,prefix=sha- - - - name: Build and publish - uses: docker/build-push-action@v6 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.metadata.outputs.tags }} - labels: ${{ steps.metadata.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max - provenance: mode=max - sbom: true diff --git a/.github/workflows/ghcr-image.yml b/.github/workflows/ghcr-image.yml new file mode 100644 index 00000000..06aa63bd --- /dev/null +++ b/.github/workflows/ghcr-image.yml @@ -0,0 +1,219 @@ +name: GHCR Image + +on: + push: + branches: + - main + tags: + - "v*.*.*" + pull_request: + branches: + - main + workflow_dispatch: + +concurrency: + group: ghcr-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + verify: + name: Verify + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: backend/go.mod + cache-dependency-path: backend/go.sum + + - name: Test backend + working-directory: backend + run: go test ./... + + - name: Vet backend + working-directory: backend + run: go vet ./... + + - name: Verify Swagger document + run: | + make swagger + git diff --exit-code -- backend/docs/docs.go backend/docs/swagger.json backend/docs/swagger.yaml + + - name: Set up pnpm + uses: pnpm/action-setup@v4 + with: + version: 11.5.2 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + cache-dependency-path: frontend/pnpm-lock.yaml + + - name: Install frontend dependencies + working-directory: frontend + run: pnpm install --frozen-lockfile + + - name: Lint frontend + working-directory: frontend + run: pnpm lint + + - name: Build frontend + working-directory: frontend + run: pnpm build + + check_ghcr_image: + name: Build image (${{ matrix.arch }}) + if: github.event_name != 'push' + needs: verify + strategy: + fail-fast: false + matrix: + include: + - arch: amd64 + platform: linux/amd64 + runner: ubuntu-24.04 + - arch: arm64 + platform: linux/arm64 + runner: ubuntu-24.04-arm + runs-on: ${{ matrix.runner }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + platforms: ${{ matrix.platform }} + push: false + cache-from: type=gha,scope=${{ matrix.arch }} + provenance: false + sbom: false + + build_ghcr_image: + name: Publish image (${{ matrix.arch }}) + if: github.event_name == 'push' + needs: verify + permissions: + contents: read + packages: write + strategy: + fail-fast: false + matrix: + include: + - arch: amd64 + platform: linux/amd64 + runner: ubuntu-24.04 + - arch: arm64 + platform: linux/arm64 + runner: ubuntu-24.04-arm + runs-on: ${{ matrix.runner }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Buildx + uses: docker/setup-buildx-action@v3 + + - name: Normalize image name + id: image + shell: bash + run: | + image_name=$(printf '%s' "$GITHUB_REPOSITORY" | tr '[:upper:]' '[:lower:]') + echo "name=ghcr.io/$image_name" >> "$GITHUB_OUTPUT" + + - name: Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ steps.image.outputs.name }} + tags: | + type=ref,event=branch,suffix=-${{ matrix.arch }} + type=ref,event=tag,suffix=-${{ matrix.arch }} + type=raw,value=latest-${{ matrix.arch }},enable=${{ github.ref == 'refs/heads/main' }} + + - name: Login to GHCR + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and publish + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + platforms: ${{ matrix.platform }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha,scope=${{ matrix.arch }} + cache-to: type=gha,scope=${{ matrix.arch }},mode=max + provenance: mode=max + sbom: true + + merge: + name: Merge image + if: github.event_name == 'push' + needs: + - build_ghcr_image + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Set up Buildx + uses: docker/setup-buildx-action@v3 + + - name: Normalize image name + id: image + shell: bash + run: | + image_name=$(printf '%s' "$GITHUB_REPOSITORY" | tr '[:upper:]' '[:lower:]') + echo "name=ghcr.io/$image_name" >> "$GITHUB_OUTPUT" + + - name: Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ steps.image.outputs.name }} + tags: | + type=ref,event=branch + type=ref,event=tag + type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} + + - name: Login to GHCR + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list + shell: bash + run: | + jq -cr '.tags[]' <<< "$DOCKER_METADATA_OUTPUT_JSON" | while read -r tag; do + docker buildx imagetools create \ + -t "$tag" \ + "${tag}-amd64" \ + "${tag}-arm64" + done + + - name: Inspect image + run: docker buildx imagetools inspect "${{ steps.image.outputs.name }}:${{ steps.meta.outputs.version }}" diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 00000000..e5634213 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,30 @@ +name: Close inactive issues and PRs + +on: + schedule: + - cron: "30 1 * * *" + workflow_dispatch: + +permissions: + issues: write + pull-requests: write + +jobs: + stale: + name: Mark and close inactive issues and PRs + runs-on: ubuntu-latest + + steps: + - name: Process stale issues and PRs + uses: actions/stale@v10 + with: + days-before-issue-stale: 7 + days-before-pr-stale: 7 + days-before-issue-close: 7 + days-before-pr-close: 7 + stale-issue-label: stale + stale-pr-label: stale + stale-issue-message: This issue has had no activity for 7 days. It will be closed in 7 days if there is no further activity. + stale-pr-message: This pull request has had no activity for 7 days. It will be closed in 7 days if there is no further activity. + close-issue-message: This issue was closed because it had no activity for 7 days after being marked stale. + close-pr-message: This pull request was closed because it had no activity for 7 days after being marked stale. From ef87d9e0fc31c0974685360918584c288c118009 Mon Sep 17 00:00:00 2001 From: Chenyme <118253778+chenyme@users.noreply.github.com> Date: Tue, 14 Jul 2026 14:18:28 +0800 Subject: [PATCH 05/16] chore: improve repository organization --- .github/ISSUE_TEMPLATE/bug_report.yml | 118 +++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 1 + .github/ISSUE_TEMPLATE/documentation.yml | 95 +++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.yml | 114 ++++++++++++++++++++ 4 files changed, 328 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/documentation.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000..ae37d740 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,118 @@ +name: Bug 报告 +description: 报告可稳定复现的功能、兼容性或部署问题。 +title: "[Bug]: " +labels: + - bug +body: + - type: markdown + attributes: + value: | + 感谢反馈问题。请尽量提供最小复现步骤和经过脱敏的日志、请求或响应。 + + 请勿提交 Access Token、Refresh Token、Cookie、API Key、账号密码或其他敏感信息。安全漏洞请不要通过公开 Issue 披露。 + + - type: dropdown + id: area + attributes: + label: 问题模块 + description: 请选择问题主要出现在哪个模块。 + options: + - OpenAI API 兼容层(Responses / Chat Completions) + - 模型同步、映射、路由与定价 + - 账号、Provider、OAuth 与凭据 + - 额度、计费与请求审计 + - 图片、视频与媒体处理 + - 管理端前端界面 + - SQLite / PostgreSQL 数据库 + - Docker、配置、部署与网络出口 + - 其他 + validations: + required: true + + - type: dropdown + id: provider + attributes: + label: 相关 Provider + description: 请选择受影响的上游渠道。 + options: + - Grok Build + - Grok Web + - Grok Console + - 多个 Provider + - 与 Provider 无关 + validations: + required: true + + - type: input + id: version + attributes: + label: 版本信息 + description: 请提供版本号、Docker 镜像标签或 Commit SHA。 + placeholder: "v0.2.99、ghcr.io/chenyme/grok2api:latest、main@abcdef1" + validations: + required: true + + - type: textarea + id: environment + attributes: + label: 部署与运行环境 + description: 请填写与问题相关的部署方式、系统、架构、数据库和网络环境。 + placeholder: | + 部署方式:Docker Compose / Docker Run / 源码运行 + 操作系统:Debian 13 / Ubuntu 24.04 / macOS ... + CPU 架构:amd64 / arm64 + 数据库:SQLite / PostgreSQL + 反向代理:Nginx / Nginx Proxy Manager / 无 + 出口网络:直连 / HTTP Proxy / SOCKS5 / WARP + validations: + required: true + + - type: textarea + id: steps + attributes: + label: 复现步骤 + description: 请提供能够稳定复现问题的最小操作步骤。 + placeholder: | + 1. 使用配置……启动服务 + 2. 导入或选择……账号 + 3. 请求……接口 + 4. 出现……错误 + validations: + required: true + + - type: textarea + id: expected + attributes: + label: 预期行为 + description: 正常情况下应该发生什么? + validations: + required: true + + - type: textarea + id: actual + attributes: + label: 实际行为 + description: 实际发生了什么?请包含完整错误信息。 + validations: + required: true + + - type: textarea + id: evidence + attributes: + label: 请求、响应、日志与截图 + description: 请提供脱敏后的最小请求、状态码、响应体、容器日志、请求 ID 或截图。长日志请仅保留问题前后的关键部分。 + placeholder: 可粘贴内容或直接拖放截图、日志文件;提交前请再次确认内容已经脱敏。 + validations: + required: false + + - type: checkboxes + id: checklist + attributes: + label: 提交前检查 + options: + - label: 我已经搜索现有 Issue 和 Pull Request,确认没有相同问题。 + required: true + - label: 我已经删除 Token、Cookie、API Key、账号凭据和个人信息。 + required: true + - label: 这不是需要私下披露的安全漏洞。 + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..3ba13e0c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.github/ISSUE_TEMPLATE/documentation.yml b/.github/ISSUE_TEMPLATE/documentation.yml new file mode 100644 index 00000000..7dd0c7a9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation.yml @@ -0,0 +1,95 @@ +name: 文档改进 +description: 报告缺失、错误、过时或难以理解的文档内容。 +title: "[Docs]: " +labels: + - documentation +body: + - type: markdown + attributes: + value: | + 请指出具体文档位置,并说明当前内容的问题和建议修改方向。 + + - type: dropdown + id: area + attributes: + label: 文档范围 + options: + - README + - 配置文件与 config.example.yaml + - Docker 与部署说明 + - Grok Build / Web / Console 账号接入 + - OpenAI API 兼容与 Swagger 契约 + - 模型同步、映射、路由与定价 + - 故障排查与常见问题 + - 开发规范与项目架构 + - 管理端界面文案 + - 其他 + validations: + required: true + + - type: dropdown + id: issue_type + attributes: + label: 问题类型 + options: + - 文档缺失 + - 内容错误 + - 内容已过时 + - 描述不清晰 + - 缺少示例 + - 链接失效 + - 格式或用词不统一 + - 其他 + validations: + required: true + + - type: input + id: location + attributes: + label: 文档位置 + description: 请提供文件路径、页面链接、章节名称或 API 路径。 + placeholder: "README.md#docker、config.example.yaml、/v1/responses" + validations: + required: true + + - type: textarea + id: issue + attributes: + label: 当前问题 + description: 当前文档缺少什么、哪里错误或为什么难以理解? + validations: + required: true + + - type: textarea + id: expected + attributes: + label: 建议修改 + description: 请描述建议补充、修正或重写的内容;如有条件可提供示例文本。 + validations: + required: false + + - type: dropdown + id: audience + attributes: + label: 主要受众 + options: + - 新用户 + - API 调用方 + - Docker 部署者 + - 系统管理员 + - 前端开发者 + - 后端开发者 + - 项目贡献者 + - 其他 + validations: + required: true + + - type: checkboxes + id: checklist + attributes: + label: 提交前检查 + options: + - label: 我已经搜索现有 Issue 和 Pull Request,确认没有相同文档问题。 + required: true + - label: 我已经提供尽可能具体的文档位置。 + required: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 00000000..506317ce --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,114 @@ +name: 功能建议 +description: 提议新的功能、兼容能力或工程改进。 +title: "[Feature]: " +labels: + - enhancement +body: + - type: markdown + attributes: + value: | + 请围绕一个明确的问题或使用场景提出建议,并说明预期行为、兼容性和部署影响。 + + - type: dropdown + id: area + attributes: + label: 功能模块 + description: 请选择建议主要影响的模块。 + options: + - OpenAI API 兼容层(Responses / Chat Completions) + - 模型同步、映射、路由与定价 + - 账号、Provider、OAuth 与凭据 + - 额度、计费与请求审计 + - 图片、视频与媒体处理 + - 管理端前端界面 + - SQLite / PostgreSQL 数据库 + - Docker、配置、部署与网络出口 + - 开发体验与工程质量 + - 其他 + validations: + required: true + + - type: dropdown + id: provider + attributes: + label: 相关 Provider + options: + - Grok Build + - Grok Web + - Grok Console + - 多个 Provider + - 新 Provider + - 与 Provider 无关 + validations: + required: true + + - type: textarea + id: problem + attributes: + label: 问题与使用场景 + description: 当前存在什么限制?谁会受到影响?为什么需要解决? + placeholder: 请描述实际使用场景,而不仅是功能名称。 + validations: + required: true + + - type: textarea + id: proposal + attributes: + label: 建议方案 + description: 请描述期望的交互、API、配置或运行行为。 + validations: + required: true + + - type: textarea + id: acceptance + attributes: + label: 验收标准 + description: 满足哪些可验证条件时,可以认为该功能已经完成? + placeholder: | + - 当……时,系统应…… + - API 应返回…… + - 现有配置和客户端应继续兼容…… + validations: + required: true + + - type: textarea + id: api_example + attributes: + label: API、配置或界面示例 + description: 如适用,请提供期望的请求响应、配置片段或界面流程。 + validations: + required: false + + - type: textarea + id: alternatives + attributes: + label: 替代方案 + description: 请描述目前的解决办法、绕过方式或考虑过的其他设计。 + validations: + required: false + + - type: textarea + id: compatibility + attributes: + label: 兼容性、部署与迁移影响 + description: 请说明是否影响 API 协议、模型命名、配置、数据库、Docker 部署或现有客户端。 + placeholder: | + API 兼容性: + 配置变更: + 数据库迁移: + Docker / 网络变更: + 向后兼容性: + validations: + required: false + + - type: checkboxes + id: checklist + attributes: + label: 提交前检查 + options: + - label: 我已经搜索现有 Issue 和 Pull Request,确认没有相同建议。 + required: true + - label: 该 Issue 只聚焦一个功能或改进方向。 + required: true + - label: 我已经说明用户价值和可验证的验收标准。 + required: true From b7f9f83d95c485fd4cf66057d3c721c6c2af5246 Mon Sep 17 00:00:00 2001 From: TizenryA Date: Tue, 14 Jul 2026 06:30:01 +0000 Subject: [PATCH 06/16] chore: prepare PR branch for upstream sync --- .../infra/provider/web/protocol_test.go | 67 +++---------------- 1 file changed, 8 insertions(+), 59 deletions(-) diff --git a/backend/internal/infra/provider/web/protocol_test.go b/backend/internal/infra/provider/web/protocol_test.go index da7b2477..1a532b4a 100644 --- a/backend/internal/infra/provider/web/protocol_test.go +++ b/backend/internal/infra/provider/web/protocol_test.go @@ -25,7 +25,7 @@ import ( func TestCatalogMatchesSupportedSurface(t *testing.T) { values := Catalog() - if len(values) != 14 { + if len(values) != 8 { t.Fatalf("catalog size = %d", len(values)) } publicIDs := make(map[string]struct{}, len(values)) @@ -40,12 +40,12 @@ func TestCatalogMatchesSupportedSurface(t *testing.T) { publicIDs[value.PublicID] = struct{}{} upstreamIDs[value.UpstreamModel] = struct{}{} } - for _, required := range []string{"grok-chat-fast", "grok-chat-auto", "grok-chat-expert", "grok-chat-heavy", "grok-4.20-multi-agent-console", "grok-4.20-multi-agent-low", "grok-4.20-multi-agent-medium", "grok-4.20-multi-agent-high", "grok-4.20-multi-agent-xhigh", "grok-imagine-image", "grok-imagine-image-lite", "grok-imagine-image-quality", "grok-imagine-image-edit", "grok-imagine-video"} { + for _, required := range []string{"grok-chat-fast", "grok-chat-auto", "grok-chat-expert", "grok-chat-heavy", "grok-imagine-image", "grok-imagine-image-quality", "grok-imagine-image-edit", "grok-imagine-video"} { if _, exists := publicIDs[required]; !exists { t.Fatalf("missing supported model: %s", required) } } - for _, removed := range []string{"grok-imagine-image-speed", "grok-imagine-image-pro"} { + for _, removed := range []string{"grok-imagine-image-lite", "grok-imagine-image-speed", "grok-imagine-image-pro"} { if _, exists := publicIDs[removed]; exists { t.Fatalf("obsolete image model remains: %s", removed) } @@ -59,13 +59,12 @@ func TestWebChatPricingUsesGrok45(t *testing.T) { t.Fatalf("pricing model for %s = %q", upstreamModel, got) } } - for _, upstreamModel := range []string{"grok-imagine-image", "grok-imagine-image-lite"} { - if got := registry.PricingModel(account.ProviderWeb, upstreamModel); got != "grok-imagine-image" { - t.Fatalf("Lite media pricing model for %s = %q", upstreamModel, got) - } + mediaModels := map[string]string{ + "grok-imagine-image": "grok-imagine-image", "grok-imagine-image-quality": "grok-imagine-image-quality", + "imagine-image-edit": "grok-imagine-image-edit", "grok-imagine-video": "grok-imagine-video", } - for _, upstreamModel := range []string{"grok-imagine-image-quality", "imagine-image-edit", "grok-imagine-video"} { - if got := registry.PricingModel(account.ProviderWeb, upstreamModel); got != upstreamModel { + for upstreamModel, expected := range mediaModels { + if got := registry.PricingModel(account.ProviderWeb, upstreamModel); got != expected { t.Fatalf("media pricing model for %s = %q", upstreamModel, got) } } @@ -282,23 +281,6 @@ func TestLiteChatRejectsInvalidImageConfigBeforeUpstream(t *testing.T) { } } -func TestLegacyLiteAliasUsesCurrentChatImageProtocol(t *testing.T) { - current, ok := Resolve("grok-imagine-image") - if !ok { - t.Fatal("current Lite image model is missing") - } - legacy, ok := Resolve("grok-imagine-image-lite") - if !ok { - t.Fatal("legacy Lite image alias is missing") - } - if legacy.ProtocolModel != current.ProtocolModel || legacy.Mode != current.Mode || legacy.MinimumTier != current.MinimumTier || legacy.Capability != current.Capability { - t.Fatalf("legacy alias = %#v, current = %#v", legacy, current) - } - if legacy.UpstreamModel != legacy.PublicID { - t.Fatalf("legacy route must preserve its public upstream key: %#v", legacy) - } -} - func TestParseLiteImageCardAttachment(t *testing.T) { parsed := &parsedChat{} frame := map[string]any{"result": map[string]any{"response": map[string]any{ @@ -319,36 +301,6 @@ func TestParseLiteNestedUsageLimit(t *testing.T) { } } -func TestParseLiteCompletedCardWithSystemErrorReturnsUpstreamError(t *testing.T) { - parsed := &parsedChat{} - frame := []byte(`{"result":{"response":{"cardAttachment":{"jsonData":"{\"id\":\"card_1\",\"image_chunk\":{\"imageUuid\":\"image_1\",\"progress\":100,\"systemErrCode\":1010}}"}}}}`) - _, _, err := parseUpstreamFrame(frame, parsed) - if !errors.Is(err, errWebImageGeneration) { - t.Fatalf("error = %v", err) - } - if !strings.Contains(err.Error(), "1010") { - t.Fatalf("error does not preserve systemErrCode: %v", err) - } -} - -func TestParseLiteSystemErrorDoesNotOverrideCompletedImageURL(t *testing.T) { - parsed := &parsedChat{} - frame := []byte(`{"result":{"response":{"cardAttachment":{"jsonData":"{\"id\":\"card_1\",\"image_chunk\":{\"progress\":100,\"imageUrl\":\"generated/image.jpg\",\"systemErrCode\":1010}}"}}}}`) - kind, delta, err := parseUpstreamFrame(frame, parsed) - if err != nil || kind != "image" || delta != "https://assets.grok.com/generated/image.jpg" { - t.Fatalf("kind=%q delta=%q error=%v", kind, delta, err) - } -} - -func TestParseLiteSystemErrorBeforeCompletionIsNotTerminal(t *testing.T) { - parsed := &parsedChat{} - frame := []byte(`{"result":{"response":{"cardAttachment":{"jsonData":"{\"id\":\"card_1\",\"image_chunk\":{\"progress\":50,\"systemErrCode\":1010}}"}}}}`) - kind, delta, err := parseUpstreamFrame(frame, parsed) - if err != nil || kind != "" || delta != "" { - t.Fatalf("kind=%q delta=%q error=%v", kind, delta, err) - } -} - func TestParseLiteImageCardAttachmentVariants(t *testing.T) { parsed := &parsedChat{} frame := map[string]any{"result": map[string]any{"response": map[string]any{ @@ -458,9 +410,6 @@ func TestChatModelsUseLowestSufficientTierFirst(t *testing.T) { func TestOnlyChatModelsExposeRateLimitModes(t *testing.T) { for _, spec := range Catalog() { - if spec.Transport == consoleResponsesTransport { - continue - } if spec.Capability == modeldomain.CapabilityChat { if !slices.Contains([]string{"auto", "fast", "expert", "heavy"}, spec.Mode) { t.Fatalf("chat model %s has invalid quota mode %q", spec.PublicID, spec.Mode) From 01975a69ea36d29ea8697478cba20a01d1160871 Mon Sep 17 00:00:00 2001 From: TizenryA Date: Tue, 14 Jul 2026 06:40:53 +0000 Subject: [PATCH 07/16] =?UTF-8?q?refactor:=20=E5=AF=B9=E9=BD=90=E4=B8=8A?= =?UTF-8?q?=E6=B8=B8=20Console=20=E5=AE=9E=E7=8E=B0=E5=B9=B6=E4=BF=9D?= =?UTF-8?q?=E7=95=99=E5=AA=92=E4=BD=93=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/internal/app/application.go | 32 +++- .../internal/infra/provider/web/adapter.go | 14 +- .../internal/infra/provider/web/catalog.go | 27 +-- backend/internal/infra/provider/web/chat.go | 63 ++----- .../internal/infra/provider/web/console.go | 160 ------------------ .../infra/provider/web/console_test.go | 145 ---------------- 6 files changed, 55 insertions(+), 386 deletions(-) delete mode 100644 backend/internal/infra/provider/web/console.go delete mode 100644 backend/internal/infra/provider/web/console_test.go diff --git a/backend/internal/app/application.go b/backend/internal/app/application.go index 2a4aa479..b638c5b2 100644 --- a/backend/internal/app/application.go +++ b/backend/internal/app/application.go @@ -29,6 +29,7 @@ import ( "github.com/chenyme/grok2api/backend/internal/infra/persistence/relational" "github.com/chenyme/grok2api/backend/internal/infra/provider" cliprovider "github.com/chenyme/grok2api/backend/internal/infra/provider/cli" + consoleprovider "github.com/chenyme/grok2api/backend/internal/infra/provider/console" webprovider "github.com/chenyme/grok2api/backend/internal/infra/provider/web" "github.com/chenyme/grok2api/backend/internal/infra/runtime/memory" redisruntime "github.com/chenyme/grok2api/backend/internal/infra/runtime/redis" @@ -157,7 +158,15 @@ func New(ctx context.Context, cfg config.Config, logger *slog.Logger) (*Applicat cliAdapter.SetEgress(egressManager) webAdapter := webprovider.NewAdapter(webProviderConfig(cfg), egressManager, cipher, responseRepo, mediaService) webAdapter.SetLogger(logger) - providers := provider.NewRegistry(cliAdapter, webAdapter) + consoleAdapter := consoleprovider.NewAdapter(consoleProviderConfig(cfg), egressManager, cipher) + providers := provider.NewRegistry(cliAdapter, webAdapter, consoleAdapter) + if err := providers.Validate(); err != nil { + if runtimeStore != nil { + _ = runtimeStore.Close() + } + database.Close() + return nil, fmt.Errorf("校验 Provider 注册表: %w", err) + } adminService := adminauth.NewService(adminRepo, sessionRepo, security.NewTokenService(cfg.Secrets.JWTSecret), cfg.Auth.AccessTokenTTL.Value(), cfg.Auth.RefreshTokenTTL.Value()) adminService.SetLoginRateLimiter(rateLimiter) if err := adminService.Bootstrap(ctx, cfg.BootstrapAdmin.Username, cfg.BootstrapAdmin.Password); err != nil { @@ -208,10 +217,17 @@ func New(ctx context.Context, cfg config.Config, logger *slog.Logger) (*Applicat database.Close() return nil, fmt.Errorf("初始化 Grok Web 模型目录: %w", err) } + if err := modelRepo.ReplaceProviderRoutes(ctx, account.ProviderConsole, consoleprovider.Routes()); err != nil { + if runtimeStore != nil { + _ = runtimeStore.Close() + } + database.Close() + return nil, fmt.Errorf("初始化 Grok Console 模型目录: %w", err) + } accountSyncService := accountsyncapp.NewService(logger, accountService, accountService, accountService, modelService) accountSyncService.SetBulkPool(importPool) accountSyncService.UpdateConcurrency(cfg.Batch.ImportConcurrency) - egressService := egressapp.NewService(egressRepo, cipher, infraegress.DefaultUserAgent) + egressService := egressapp.NewService(egressRepo, cipher, infraegress.DefaultUserAgent, cfg.Provider.Console.UserAgent) clientKeyService := clientkeyapp.NewService(clientKeyRepo, rateLimiter, concurrency, cfg.ClientKeyDefaults.RPMLimit, cfg.ClientKeyDefaults.MaxConcurrent, cipher) auditService := auditapp.NewService(auditRepo, logger, cfg.Audit.BufferSize, cfg.Audit.BatchSize, cfg.Audit.FlushInterval.Value()) dashboardService := dashboardapp.NewService(dashboardRepo) @@ -246,7 +262,8 @@ func New(ctx context.Context, cfg config.Config, logger *slog.Logger) (*Applicat UserAgent: next.Provider.Build.UserAgent, }) webAdapter.UpdateConfig(webProviderConfig(next)) - egressService.UpdateDefaults(infraegress.DefaultUserAgent) + consoleAdapter.UpdateConfig(consoleProviderConfig(next)) + egressService.UpdateDefaults(infraegress.DefaultUserAgent, next.Provider.Console.UserAgent) mediaService.UpdateConfig(mediaConfig(next)) quotaRecoveryService.UpdateConfig(next.Provider.Web.RecoveryBackoffBase.Value(), next.Provider.Web.RecoveryBackoffMax.Value()) accountSyncService.UpdateConcurrency(next.Batch.ImportConcurrency) @@ -276,7 +293,7 @@ func maxBatchConcurrency(value config.BatchConfig) int { func webProviderConfig(cfg config.Config) webprovider.Config { return webprovider.Config{ - BaseURL: cfg.Provider.Web.BaseURL, ConsoleBaseURL: "https://console.x.ai", QuotaTimeoutSeconds: int(cfg.Provider.Web.QuotaTimeout.Value().Seconds()), + BaseURL: cfg.Provider.Web.BaseURL, QuotaTimeoutSeconds: int(cfg.Provider.Web.QuotaTimeout.Value().Seconds()), StatsigMode: cfg.Provider.Web.StatsigMode, StatsigManualValue: cfg.Provider.Web.StatsigManualValue, StatsigSignerURL: cfg.Provider.Web.StatsigSignerURL, ChatTimeoutSeconds: int(cfg.Provider.Web.ChatTimeout.Value().Seconds()), ImageTimeoutSeconds: int(cfg.Provider.Web.ImageTimeout.Value().Seconds()), @@ -285,6 +302,13 @@ func webProviderConfig(cfg config.Config) webprovider.Config { } } +func consoleProviderConfig(cfg config.Config) consoleprovider.Config { + return consoleprovider.Config{ + BaseURL: cfg.Provider.Console.BaseURL, UserAgent: cfg.Provider.Console.UserAgent, + TimeoutSeconds: int(cfg.Provider.Console.ChatTimeout.Value().Seconds()), + } +} + func mediaConfig(cfg config.Config) mediaapp.Config { return mediaapp.Config{ PublicBaseURL: cfg.Frontend.PublicAPIBaseURL, MaxImageBytes: cfg.Media.MaxImageBytes, diff --git a/backend/internal/infra/provider/web/adapter.go b/backend/internal/infra/provider/web/adapter.go index 5177c146..09704608 100644 --- a/backend/internal/infra/provider/web/adapter.go +++ b/backend/internal/infra/provider/web/adapter.go @@ -15,7 +15,6 @@ import ( type Config struct { BaseURL string - ConsoleBaseURL string StatsigMode string StatsigManualValue string StatsigSignerURL string @@ -60,9 +59,6 @@ func normalizedConfig(cfg Config) Config { if cfg.BaseURL == "" { cfg.BaseURL = "https://grok.com" } - if cfg.ConsoleBaseURL == "" { - cfg.ConsoleBaseURL = "https://console.x.ai" - } if cfg.StatsigMode == "" { cfg.StatsigMode = "url" } @@ -130,11 +126,11 @@ func (a *Adapter) TierOrder(upstreamModel string) []account.WebTier { func (a *Adapter) PricingModel(upstreamModel string) string { spec, ok := Resolve(upstreamModel) - if ok && spec.Capability == modeldomain.CapabilityChat { - return "grok-4.5" - } - if ok && spec.ProtocolModel == "imagine-lite" { - return "grok-imagine-image" + if ok { + if spec.Capability == modeldomain.CapabilityChat { + return "grok-4.5" + } + return spec.PublicID } return upstreamModel } diff --git a/backend/internal/infra/provider/web/catalog.go b/backend/internal/infra/provider/web/catalog.go index 59f5b7ee..ad68f54c 100644 --- a/backend/internal/infra/provider/web/catalog.go +++ b/backend/internal/infra/provider/web/catalog.go @@ -5,17 +5,13 @@ import ( modeldomain "github.com/chenyme/grok2api/backend/internal/domain/model" ) -const consoleResponsesTransport = "console_responses" - type ModelSpec struct { - PublicID string - UpstreamModel string - ProtocolModel string - Capability modeldomain.Capability - Mode string - MinimumTier account.WebTier - Transport string - ReasoningEffort string + PublicID string + UpstreamModel string + ProtocolModel string + Capability modeldomain.Capability + Mode string + MinimumTier account.WebTier } var catalog = []ModelSpec{ @@ -23,15 +19,7 @@ var catalog = []ModelSpec{ {PublicID: "grok-chat-auto", UpstreamModel: "grok-chat-auto", Capability: modeldomain.CapabilityChat, Mode: "auto", MinimumTier: account.WebTierSuper}, {PublicID: "grok-chat-expert", UpstreamModel: "grok-chat-expert", Capability: modeldomain.CapabilityChat, Mode: "expert", MinimumTier: account.WebTierSuper}, {PublicID: "grok-chat-heavy", UpstreamModel: "grok-chat-heavy", Capability: modeldomain.CapabilityChat, Mode: "heavy", MinimumTier: account.WebTierHeavy}, - {PublicID: "grok-4.20-multi-agent-console", UpstreamModel: "grok-4.20-multi-agent-console", ProtocolModel: "grok-4.20-multi-agent-0309", Capability: modeldomain.CapabilityChat, MinimumTier: account.WebTierBasic, Transport: consoleResponsesTransport}, - {PublicID: "grok-4.20-multi-agent-low", UpstreamModel: "grok-4.20-multi-agent-low", ProtocolModel: "grok-4.20-multi-agent-0309", Capability: modeldomain.CapabilityChat, MinimumTier: account.WebTierBasic, Transport: consoleResponsesTransport, ReasoningEffort: "low"}, - {PublicID: "grok-4.20-multi-agent-medium", UpstreamModel: "grok-4.20-multi-agent-medium", ProtocolModel: "grok-4.20-multi-agent-0309", Capability: modeldomain.CapabilityChat, MinimumTier: account.WebTierBasic, Transport: consoleResponsesTransport, ReasoningEffort: "medium"}, - {PublicID: "grok-4.20-multi-agent-high", UpstreamModel: "grok-4.20-multi-agent-high", ProtocolModel: "grok-4.20-multi-agent-0309", Capability: modeldomain.CapabilityChat, MinimumTier: account.WebTierBasic, Transport: consoleResponsesTransport, ReasoningEffort: "high"}, - {PublicID: "grok-4.20-multi-agent-xhigh", UpstreamModel: "grok-4.20-multi-agent-xhigh", ProtocolModel: "grok-4.20-multi-agent-0309", Capability: modeldomain.CapabilityChat, MinimumTier: account.WebTierBasic, Transport: consoleResponsesTransport, ReasoningEffort: "xhigh"}, {PublicID: "grok-imagine-image", UpstreamModel: "grok-imagine-image", ProtocolModel: "imagine-lite", Capability: modeldomain.CapabilityImage, Mode: "fast", MinimumTier: account.WebTierBasic}, - // Backward-compatible public name from the Python implementation. It deliberately - // reuses the current Lite protocol instead of maintaining a second code path. - {PublicID: "grok-imagine-image-lite", UpstreamModel: "grok-imagine-image-lite", ProtocolModel: "imagine-lite", Capability: modeldomain.CapabilityImage, Mode: "fast", MinimumTier: account.WebTierBasic}, {PublicID: "grok-imagine-image-quality", UpstreamModel: "grok-imagine-image-quality", ProtocolModel: "imagine", Capability: modeldomain.CapabilityImage, MinimumTier: account.WebTierSuper}, {PublicID: "grok-imagine-image-edit", UpstreamModel: "imagine-image-edit", Capability: modeldomain.CapabilityImageEdit, MinimumTier: account.WebTierSuper}, {PublicID: "grok-imagine-video", UpstreamModel: "grok-imagine-video", ProtocolModel: "imagine-video-gen", Capability: modeldomain.CapabilityVideo, MinimumTier: account.WebTierSuper}, @@ -42,7 +30,8 @@ func Catalog() []ModelSpec { return append([]ModelSpec(nil), catalog...) } func Routes() []modeldomain.Route { values := make([]modeldomain.Route, 0, len(catalog)) for _, spec := range catalog { - values = append(values, modeldomain.Route{PublicID: spec.PublicID, Provider: account.ProviderWeb, UpstreamModel: spec.UpstreamModel, Capability: spec.Capability, Enabled: true}) + publicID, _ := modeldomain.NormalizePublicID(account.ProviderWeb, spec.PublicID) + values = append(values, modeldomain.Route{PublicID: publicID, Provider: account.ProviderWeb, UpstreamModel: spec.UpstreamModel, Capability: spec.Capability, Enabled: true}) } return values } diff --git a/backend/internal/infra/provider/web/chat.go b/backend/internal/infra/provider/web/chat.go index 62d6a3d0..bc892d1b 100644 --- a/backend/internal/infra/provider/web/chat.go +++ b/backend/internal/infra/provider/web/chat.go @@ -29,9 +29,8 @@ import ( const webResponseTTL = 30 * 24 * time.Hour var ( - errWebAntiBot = errors.New("Grok Web anti-bot rejection") - errWebUsageLimit = errors.New("Grok Web usage limit reached") - errWebImageGeneration = errors.New("Grok Web image generation failed") + errWebAntiBot = errors.New("Grok Web anti-bot rejection") + errWebUsageLimit = errors.New("Grok Web usage limit reached") ) var grokRenderPattern = regexp.MustCompile(`(?s)]*>.*?`) @@ -92,12 +91,6 @@ type parsedChat struct { } func (a *Adapter) ForwardResponse(ctx context.Context, request provider.ResponseResourceRequest) (*provider.Response, error) { - if spec, ok := Resolve(request.Model); ok && spec.Transport == consoleResponsesTransport { - if request.Method != http.MethodPost || request.Path != "/responses" { - return jsonProviderResponse(http.StatusMethodNotAllowed, map[string]any{"error": map[string]any{"message": "Console 模型仅支持创建 Response", "type": "invalid_request_error"}}), nil - } - return a.forwardConsoleResponse(ctx, request, spec) - } if request.Method == http.MethodGet || request.Method == http.MethodDelete { return a.handleResponseResource(ctx, request) } @@ -774,11 +767,7 @@ func parseUpstreamFrame(data []byte, parsed *parsedChat) (string, string, error) return "", "", webResponseError(errorValue) } for _, key := range []string{"cardAttachment", "cardAttachments"} { - rawURL, cardErr := collectCardAttachment(parsed, response[key]) - if cardErr != nil { - return "", "", cardErr - } - if rawURL != "" { + if rawURL := collectCardAttachment(parsed, response[key]); rawURL != "" { rawURL = absoluteAssetURL(rawURL) parsed.Images = appendUniqueString(parsed.Images, rawURL) return "image", rawURL, nil @@ -991,23 +980,19 @@ func containsString(values []string, value string) bool { return false } -func collectCardAttachment(parsed *parsedChat, value any) (string, error) { +func collectCardAttachment(parsed *parsedChat, value any) string { if values, ok := value.([]any); ok { first := "" for _, item := range values { - rawURL, err := collectCardAttachment(parsed, item) - if err != nil { - return "", err - } - if first == "" && rawURL != "" { + if rawURL := collectCardAttachment(parsed, item); first == "" && rawURL != "" { first = rawURL } } - return first, nil + return first } data := cardAttachmentData(value) if data == nil { - return "", nil + return "" } if id, _ := data["id"].(string); id != "" { if parsed.cardCache == nil { @@ -1015,10 +1000,7 @@ func collectCardAttachment(parsed *parsedChat, value any) (string, error) { } parsed.cardCache[id] = data } - if err := imageErrorFromCardData(data); err != nil { - return "", err - } - return imageURLFromCardData(data), nil + return imageURLFromCardData(data) } func cardAttachmentData(value any) map[string]any { @@ -1041,32 +1023,11 @@ func cardAttachmentData(value any) map[string]any { return nil } -func imageChunkFromCardData(data map[string]any) map[string]any { +func imageURLFromCardData(data map[string]any) string { chunk, _ := data["image_chunk"].(map[string]any) if chunk == nil { chunk, _ = data["imageChunk"].(map[string]any) } - return chunk -} - -func imageErrorFromCardData(data map[string]any) error { - chunk := imageChunkFromCardData(data) - if chunk == nil { - return nil - } - progress, _ := numberAsInt(chunk["progress"]) - if progress < 100 || firstString(chunk, "imageUrl", "image_url", "url") != "" { - return nil - } - code := strings.TrimSpace(fmt.Sprint(chunk["systemErrCode"])) - if code == "" || code == "" || code == "0" { - return nil - } - return fmt.Errorf("%w: systemErrCode=%s", errWebImageGeneration, code) -} - -func imageURLFromCardData(data map[string]any) string { - chunk := imageChunkFromCardData(data) if chunk == nil { return "" } @@ -1075,7 +1036,11 @@ func imageURLFromCardData(data map[string]any) string { if moderated || progress < 100 { return "" } - return firstString(chunk, "imageUrl", "image_url", "url") + imageURL, _ := chunk["imageUrl"].(string) + if imageURL == "" { + imageURL, _ = chunk["image_url"].(string) + } + return imageURL } func cleanChatToken(parsed *parsedChat, token string) string { diff --git a/backend/internal/infra/provider/web/console.go b/backend/internal/infra/provider/web/console.go deleted file mode 100644 index 0f9b35a5..00000000 --- a/backend/internal/infra/provider/web/console.go +++ /dev/null @@ -1,160 +0,0 @@ -package web - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - "net/http" - "strconv" - "strings" - "time" - - domainegress "github.com/chenyme/grok2api/backend/internal/domain/egress" - infraegress "github.com/chenyme/grok2api/backend/internal/infra/egress" - "github.com/chenyme/grok2api/backend/internal/infra/provider" - "github.com/chenyme/grok2api/backend/internal/infra/provider/conversation" -) - -const consoleCluster = "https://us-east-1.api.x.ai" - -func buildConsolePayload(body []byte, spec ModelSpec, requestedStreaming bool) ([]byte, bool, error) { - var payload map[string]any - if err := json.Unmarshal(body, &payload); err != nil { - return nil, false, fmt.Errorf("解析 Console 请求: %w", err) - } - payload["model"] = spec.ProtocolModel - payload["max_output_tokens"] = 2_000_000 - payload["store"] = false - payload["include"] = []string{"reasoning.encrypted_content"} - streaming := requestedStreaming - if value, ok := payload["stream"].(bool); ok { - streaming = streaming || value - } - payload["stream"] = streaming - effort := spec.ReasoningEffort - if effort == "" { - if reasoning, ok := payload["reasoning"].(map[string]any); ok { - if value, ok := reasoning["effort"].(string); ok { - switch value { - case "minimal": - effort = "low" - case "none", "low", "medium", "high", "xhigh": - effort = value - } - } - } - } - if effort == "" { - effort = "medium" - } - payload["reasoning"] = map[string]any{"effort": effort} - payload["tools"] = []map[string]any{ - {"type": "web_search", "enable_image_understanding": true}, - {"type": "x_search", "enable_video_understanding": true}, - } - payload["tool_choice"] = "auto" - data, err := json.Marshal(payload) - return data, streaming, err -} - -func buildConsoleHeaders(token string, lease *infraegress.Lease) http.Header { - headers := buildHeaders(token, lease, "application/json") - headers.Set("Authorization", "Bearer "+token) - cookies := []string{"sso=" + token, "sso-rw=" + token} - if value := strings.TrimSpace(lease.CFCookies); value != "" { - cookies = append(cookies, value) - } - headers.Set("Cookie", strings.Join(cookies, "; ")) - headers.Set("Origin", "https://console.x.ai") - headers.Set("Referer", "https://console.x.ai/") - headers.Set("x-cluster", consoleCluster) - return headers -} - -func (a *Adapter) forwardConsoleResponse(ctx context.Context, request provider.ResponseResourceRequest, spec ModelSpec) (*provider.Response, error) { - body := request.Body - if request.Operation == conversation.OperationChat || request.Operation == conversation.OperationMessages { - converted, err := conversation.ConvertRequest(body, request.Model, request.Operation) - if err != nil { - return jsonProviderResponse(http.StatusBadRequest, map[string]any{"error": map[string]any{"message": err.Error(), "type": "invalid_request_error"}}), nil - } - body = converted - } - payload, streaming, err := buildConsolePayload(body, spec, request.Streaming) - if err != nil { - return jsonProviderResponse(http.StatusBadRequest, map[string]any{"error": map[string]any{"message": err.Error(), "type": "invalid_request_error"}}), nil - } - token, err := a.cipher.Decrypt(request.Credential.EncryptedAccessToken) - if err != nil { - return nil, err - } - lease, err := a.egress.Acquire(ctx, domainegress.ScopeWeb, fmt.Sprintf("%d", request.Credential.ID)) - if err != nil { - return nil, err - } - cfg := a.config() - requestCtx, cancel := context.WithTimeout(ctx, time.Duration(cfg.ChatTimeoutSeconds)*time.Second) - upstreamRequest, err := http.NewRequestWithContext(requestCtx, http.MethodPost, strings.TrimRight(cfg.ConsoleBaseURL, "/")+"/v1/responses", bytes.NewReader(payload)) - if err != nil { - cancel() - lease.Release() - return nil, err - } - upstreamRequest.Header = buildConsoleHeaders(token, lease) - if streaming { - upstreamRequest.Header.Set("Accept", "text/event-stream") - } else { - upstreamRequest.Header.Set("Accept", "application/json") - } - upstream, err := lease.Do(upstreamRequest) - if err != nil { - cancel() - a.egress.Feedback(context.WithoutCancel(ctx), lease.NodeID, 0, err) - lease.Release() - return nil, err - } - upstream.Body = &cancelBody{ReadCloser: upstream.Body, cancel: cancel} - if upstream.StatusCode < 200 || upstream.StatusCode >= 300 { - return &provider.Response{StatusCode: upstream.StatusCode, Status: upstream.Status, Header: upstream.Header.Clone(), Body: &releaseBody{ReadCloser: upstream.Body, release: func() { - a.egress.Feedback(context.WithoutCancel(ctx), lease.NodeID, upstream.StatusCode, nil) - lease.Release() - }}}, nil - } - - if streaming { - body := upstream.Body - if request.Operation == conversation.OperationChat || request.Operation == conversation.OperationMessages { - body = conversation.ConvertResponseStream(body, request.Operation) - } - return &provider.Response{StatusCode: upstream.StatusCode, Status: upstream.Status, Header: streamHeaders(), Body: &releaseBody{ReadCloser: body, release: func() { - a.egress.Feedback(context.WithoutCancel(ctx), lease.NodeID, upstream.StatusCode, nil) - lease.Release() - }}}, nil - } - - data, readErr := io.ReadAll(io.LimitReader(upstream.Body, (64<<20)+1)) - _ = upstream.Body.Close() - if readErr != nil { - a.egress.Feedback(context.WithoutCancel(ctx), lease.NodeID, 0, readErr) - lease.Release() - return nil, readErr - } - if len(data) > 64<<20 { - lease.Release() - return nil, fmt.Errorf("Console 上游响应超过 64 MiB") - } - if request.Operation == conversation.OperationChat || request.Operation == conversation.OperationMessages { - data, err = conversation.ConvertResponseJSON(data, request.Operation) - if err != nil { - lease.Release() - return nil, err - } - } - a.egress.Feedback(context.WithoutCancel(ctx), lease.NodeID, upstream.StatusCode, nil) - lease.Release() - headers := jsonHeaders() - headers.Set("Content-Length", strconv.Itoa(len(data))) - return &provider.Response{StatusCode: upstream.StatusCode, Status: upstream.Status, Header: headers, Body: io.NopCloser(bytes.NewReader(data))}, nil -} diff --git a/backend/internal/infra/provider/web/console_test.go b/backend/internal/infra/provider/web/console_test.go deleted file mode 100644 index 33b1326f..00000000 --- a/backend/internal/infra/provider/web/console_test.go +++ /dev/null @@ -1,145 +0,0 @@ -package web - -import ( - "context" - "encoding/base64" - "encoding/json" - "io" - "net/http" - "net/http/httptest" - "strings" - "testing" - - "github.com/chenyme/grok2api/backend/internal/domain/account" - infraegress "github.com/chenyme/grok2api/backend/internal/infra/egress" - "github.com/chenyme/grok2api/backend/internal/infra/provider" - "github.com/chenyme/grok2api/backend/internal/infra/security" -) - -func TestConsoleCatalogModelsResolveToSharedTransport(t *testing.T) { - cases := map[string]string{ - "grok-4.20-multi-agent-console": "", - "grok-4.20-multi-agent-low": "low", - "grok-4.20-multi-agent-medium": "medium", - "grok-4.20-multi-agent-high": "high", - "grok-4.20-multi-agent-xhigh": "xhigh", - } - for model, effort := range cases { - spec, ok := Resolve(model) - if !ok { - t.Fatalf("missing Console model %s", model) - } - if spec.Transport != consoleResponsesTransport || spec.ProtocolModel != "grok-4.20-multi-agent-0309" || spec.ReasoningEffort != effort { - t.Fatalf("spec for %s = %#v", model, spec) - } - } -} - -func TestBuildConsolePayloadAppliesDefaultsAndFixedEffort(t *testing.T) { - body := []byte(`{"model":"grok-4.20-multi-agent-high","input":"hello","stream":false,"reasoning":{"effort":"low"}}`) - spec, _ := Resolve("grok-4.20-multi-agent-high") - data, streaming, err := buildConsolePayload(body, spec, false) - if err != nil { - t.Fatal(err) - } - if streaming { - t.Fatal("non-stream request unexpectedly became streaming") - } - var payload map[string]any - if err := json.Unmarshal(data, &payload); err != nil { - t.Fatal(err) - } - if payload["model"] != "grok-4.20-multi-agent-0309" || payload["max_output_tokens"] != float64(2_000_000) || payload["store"] != false { - t.Fatalf("payload defaults = %#v", payload) - } - reasoning, _ := payload["reasoning"].(map[string]any) - if reasoning["effort"] != "high" { - t.Fatalf("reasoning = %#v", reasoning) - } - tools, _ := payload["tools"].([]any) - if len(tools) != 2 || payload["tool_choice"] != "auto" { - t.Fatalf("tools = %#v choice=%#v", tools, payload["tool_choice"]) - } - include, _ := payload["include"].([]any) - if len(include) != 1 || include[0] != "reasoning.encrypted_content" { - t.Fatalf("include = %#v", include) - } -} - -func TestConsoleForwardUsesConsoleHeadersAndConvertsChatResponse(t *testing.T) { - var received map[string]any - server := httptest.NewServer(http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { - if request.URL.Path != "/v1/responses" { - http.NotFound(writer, request) - return - } - if request.Header.Get("Authorization") != "Bearer test-sso" { - t.Errorf("authorization = %q", request.Header.Get("Authorization")) - } - cookie := request.Header.Get("Cookie") - if !strings.Contains(cookie, "sso=test-sso") || !strings.Contains(cookie, "sso-rw=test-sso") { - t.Errorf("cookie = %q", cookie) - } - if request.Header.Get("Origin") != "https://console.x.ai" || request.Header.Get("Referer") != "https://console.x.ai/" || request.Header.Get("x-cluster") == "" { - t.Errorf("console headers = %#v", request.Header) - } - if err := json.NewDecoder(request.Body).Decode(&received); err != nil { - t.Error(err) - } - writer.Header().Set("Content-Type", "application/json") - _, _ = io.WriteString(writer, `{"id":"resp_console","object":"response","created_at":1,"model":"grok-4.20-multi-agent-0309","status":"completed","output":[{"id":"msg_1","type":"message","role":"assistant","status":"completed","content":[{"type":"output_text","text":"console works"}]}],"usage":{"input_tokens":2,"output_tokens":3}}`) - })) - defer server.Close() - - cipher, err := security.NewCipher(base64.StdEncoding.EncodeToString(make([]byte, 32))) - if err != nil { - t.Fatal(err) - } - encrypted, err := cipher.Encrypt("test-sso") - if err != nil { - t.Fatal(err) - } - adapter := NewAdapter(Config{ConsoleBaseURL: server.URL}, infraegress.NewManager(egressRepositoryStub{}, cipher), cipher, nil, nil) - body := []byte(`{"model":"grok-4.20-multi-agent-low","messages":[{"role":"user","content":"hello"}],"stream":false}`) - response, err := adapter.ForwardResponse(context.Background(), provider.ResponseResourceRequest{ - Credential: account.Credential{ID: 7, EncryptedAccessToken: encrypted}, Method: http.MethodPost, - Path: "/responses", Body: body, Model: "grok-4.20-multi-agent-low", Operation: "chat", - }) - if err != nil { - t.Fatal(err) - } - defer response.Body.Close() - data, _ := io.ReadAll(response.Body) - if response.StatusCode != http.StatusOK || !strings.Contains(string(data), "console works") || !strings.Contains(string(data), "chat.completion") { - t.Fatalf("status=%d body=%s", response.StatusCode, data) - } - if received["model"] != "grok-4.20-multi-agent-0309" { - t.Fatalf("upstream payload = %#v", received) - } -} - -func TestConsoleForwardConvertsStreamingMessagesResponse(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { - writer.Header().Set("Content-Type", "text/event-stream") - _, _ = io.WriteString(writer, "event: response.created\ndata: {\"type\":\"response.created\",\"response\":{\"id\":\"resp_1\",\"model\":\"grok-4.20-multi-agent-0309\",\"status\":\"in_progress\"}}\n\n") - _, _ = io.WriteString(writer, "event: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"delta\":\"hi\"}\n\n") - _, _ = io.WriteString(writer, "event: response.completed\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"resp_1\",\"model\":\"grok-4.20-multi-agent-0309\",\"status\":\"completed\",\"usage\":{\"input_tokens\":1,\"output_tokens\":1}}}\n\n") - })) - defer server.Close() - cipher, _ := security.NewCipher(base64.StdEncoding.EncodeToString(make([]byte, 32))) - encrypted, _ := cipher.Encrypt("test-sso") - adapter := NewAdapter(Config{ConsoleBaseURL: server.URL}, infraegress.NewManager(egressRepositoryStub{}, cipher), cipher, nil, nil) - response, err := adapter.ForwardResponse(context.Background(), provider.ResponseResourceRequest{ - Credential: account.Credential{ID: 8, EncryptedAccessToken: encrypted}, Method: http.MethodPost, - Path: "/responses", Body: []byte(`{"model":"grok-4.20-multi-agent-console","messages":[{"role":"user","content":"hello"}],"stream":true,"max_tokens":1024}`), - Model: "grok-4.20-multi-agent-console", Operation: "messages", Streaming: true, - }) - if err != nil { - t.Fatal(err) - } - defer response.Body.Close() - data, _ := io.ReadAll(response.Body) - if !strings.Contains(string(data), "content_block_delta") || !strings.Contains(string(data), "hi") { - t.Fatalf("messages stream = %s", data) - } -} From cce221339b84c47d72d16efb90199e0a4083f89f Mon Sep 17 00:00:00 2001 From: Chenyme <118253778+chenyme@users.noreply.github.com> Date: Tue, 14 Jul 2026 15:00:39 +0800 Subject: [PATCH 08/16] refactor: improve client keys dialog and copy button functionality --- .../features/client-keys/client-keys-page.tsx | 139 +++++++++--------- .../src/shared/components/copy-button.tsx | 22 ++- frontend/src/shared/i18n/index.ts | 11 +- 3 files changed, 94 insertions(+), 78 deletions(-) diff --git a/frontend/src/features/client-keys/client-keys-page.tsx b/frontend/src/features/client-keys/client-keys-page.tsx index eff19cf6..8032327b 100644 --- a/frontend/src/features/client-keys/client-keys-page.tsx +++ b/frontend/src/features/client-keys/client-keys-page.tsx @@ -7,7 +7,6 @@ import { useTranslation } from "react-i18next"; import { toast } from "sonner"; import { z } from "zod"; -import { copyToClipboard } from "@/shared/clipboard"; import { CopyButton } from "@/shared/components/copy-button"; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@/components/ui/alert-dialog"; @@ -37,6 +36,11 @@ import { nextTableSort, type SortOrder, type TableSort } from "@/shared/lib/tabl const USD_TICKS = 10_000_000_000; const MAX_BILLING_LIMIT_USD = 900_000; +type SecretDialogState = { + secret: string; + source: "created" | "retrieved"; +}; + export function ClientKeysPage() { const { t, i18n } = useTranslation(); const queryClient = useQueryClient(); @@ -50,7 +54,7 @@ export function ClientKeysPage() { const [batchDeleteOpen, setBatchDeleteOpen] = useState(false); const [editing, setEditing] = useState(null); const [deleting, setDeleting] = useState(null); - const [createdSecret, setCreatedSecret] = useState(null); + const [secretDialog, setSecretDialog] = useState(null); const [modelOptionsPage, setModelOptionsPage] = useState(1); const [modelOptionsSearch, setModelOptionsSearch] = useState(""); const [statusReferenceTime] = useState(() => Date.now()); @@ -105,7 +109,7 @@ export function ClientKeysPage() { onSuccess: (result) => { void queryClient.invalidateQueries({ queryKey: ["client-keys"] }); if ("secret" in result) { - setCreatedSecret(result.secret); + setSecretDialog({ secret: result.secret, source: "created" }); toast.success(t("keys.created")); } else { toast.success(t("keys.updated")); @@ -126,13 +130,8 @@ export function ClientKeysPage() { }); const copyMutation = useMutation({ - mutationFn: async (id: string) => { - const result = await getClientKeySecret(id); - const ok = await copyToClipboard(result.secret); - if (!ok) throw new Error(t("common.copyFailed")); - return id; - }, - onSuccess: () => toast.success(t("common.copied")), + mutationFn: getClientKeySecret, + onSuccess: (result) => setSecretDialog({ secret: result.secret, source: "retrieved" }), onError: showError, }); @@ -331,83 +330,85 @@ export function ClientKeysPage() { !open && setEditing(null)}> - - + + {editing === "new" ? t("keys.createTitle") : t("keys.editTitle")} {editing === "new" ? t("keys.description") : editing?.prefix} -
saveMutation.mutate(values))}> -
{form.formState.errors.name ?

{form.formState.errors.name.message}

: null}
-
form.setValue("enabled", checked)} />
-
-
-
-
-
-
- -
- {t("keys.unlimited")} - form.setValue("billingUnlimited", checked, { shouldDirty: true })} /> + saveMutation.mutate(values))}> +
+
{form.formState.errors.name ?

{form.formState.errors.name.message}

: null}
+
form.setValue("enabled", checked)} />
+
+
+
+
+
+
+ +
+ {t("keys.unlimited")} + form.setValue("billingUnlimited", checked, { shouldDirty: true })} /> +
-
-
- $ - -
-

{t("keys.billingLimitDescription")}

-
-
- - } /> -
-
-
- {t("keys.models")} - {selectedModels.length === 0 ? t("keys.allModels") : t("keys.selectedModels", { count: selectedModels.length })} -
-
-
- - { setModelOptionsSearch(event.target.value); setModelOptionsPage(1); }} placeholder={t("keys.modelSearch")} aria-label={t("keys.modelSearch")} /> +
+ $ +
-
- {modelsQuery.isPending ? : modelsQuery.data?.items.map((model) => { - const checked = selectedModels.includes(model.id); - const controlId = `allowed-model-${model.id}`; - return ( - - ); - })} - {modelsQuery.data?.items.length === 0 ?

{t("common.noData")}

: null} -
- {modelsQuery.data && modelsQuery.data.total > modelsQuery.data.pageSize ? : null} +

{t("keys.billingLimitDescription")}

-
- +
+ + } /> +
+
+
+ {t("keys.models")} + {selectedModels.length === 0 ? t("keys.allModels") : t("keys.selectedModels", { count: selectedModels.length })} +
+
+
+ + { setModelOptionsSearch(event.target.value); setModelOptionsPage(1); }} placeholder={t("keys.modelSearch")} aria-label={t("keys.modelSearch")} /> +
+
+ {modelsQuery.isPending ? : modelsQuery.data?.items.map((model) => { + const checked = selectedModels.includes(model.id); + const controlId = `allowed-model-${model.id}`; + return ( + + ); + })} + {modelsQuery.data?.items.length === 0 ?

{t("common.noData")}

: null} +
+ {modelsQuery.data && modelsQuery.data.total > modelsQuery.data.pageSize ? : null} +
+
+
+
- !open && setCreatedSecret(null)}> + !open && setSecretDialog(null)}> - {t("keys.secretTitle")} - {t("keys.secretDescription")} + {t(secretDialog?.source === "created" ? "keys.secretTitle" : "keys.copySecretTitle")} + {t(secretDialog?.source === "created" ? "keys.secretDescription" : "keys.copySecretDescription")}
- {createdSecret} - toast.success(t("common.copied"))} /> + {secretDialog?.source === "created" ? secretDialog.secret : t("keys.secretReady")} + toast.success(t("common.copied"))} />
- +
diff --git a/frontend/src/shared/components/copy-button.tsx b/frontend/src/shared/components/copy-button.tsx index 6134b56e..7fa84978 100644 --- a/frontend/src/shared/components/copy-button.tsx +++ b/frontend/src/shared/components/copy-button.tsx @@ -1,5 +1,5 @@ import { Check, Copy } from "lucide-react"; -import { useState } from "react"; +import { useEffect, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; import { toast } from "sonner"; @@ -12,23 +12,34 @@ export function CopyButton({ value, className, disabled, + copyLabel, onCopied, onError, }: { value: string; className?: string; disabled?: boolean; + copyLabel?: string; onCopied?: () => void; onError?: (error: unknown) => void; }) { const { t } = useTranslation(); - const [copied, setCopied] = useState(false); + const [copiedValue, setCopiedValue] = useState(null); + const resetTimerRef = useRef(null); + + useEffect(() => () => { + if (resetTimerRef.current !== null) window.clearTimeout(resetTimerRef.current); + }, []); async function handleClick() { const ok = await copyToClipboard(value); if (ok) { - setCopied(true); - window.setTimeout(() => setCopied(false), 1500); + if (resetTimerRef.current !== null) window.clearTimeout(resetTimerRef.current); + setCopiedValue(value); + resetTimerRef.current = window.setTimeout(() => { + setCopiedValue(null); + resetTimerRef.current = null; + }, 1500); onCopied?.(); } else { const message = t("common.copyFailed"); @@ -37,7 +48,8 @@ export function CopyButton({ } } - const label = copied ? t("common.copied") : t("common.copy"); + const copied = copiedValue === value; + const label = copied ? t("common.copied") : copyLabel ?? t("common.copy"); return ( diff --git a/frontend/src/shared/i18n/index.ts b/frontend/src/shared/i18n/index.ts index 5b8a0eba..0baac1b8 100644 --- a/frontend/src/shared/i18n/index.ts +++ b/frontend/src/shared/i18n/index.ts @@ -380,9 +380,12 @@ const resources = { createTitle: "创建密钥", editTitle: "编辑密钥", secretTitle: "密钥已创建", - secretDescription: "请妥善保管此密钥。列表中默认隐藏,后续可随时重新复制。", - secretLabel: "完整密钥", - copySecret: "复制完整密钥", + secretDescription: "请妥善保管。", + secretLabel: "密钥", + copySecret: "复制", + copySecretTitle: "复制密钥", + copySecretDescription: "点击下方按钮复制您的密钥", + secretReady: "已就绪", created: "密钥已创建", updated: "密钥已更新", deleted: "密钥已删除", @@ -709,7 +712,7 @@ const resources = { dashboard: { title: "Dashboard", subtitle: "Welcome, {{name}}", lastUpdated: "Updated {{time}}", welcome: "Welcome, {{name}}", gatewayOnline: "Gateway healthy", gatewayOffline: "Unavailable", gatewayReady: "The gateway is ready to process API requests.", gatewayNeedsAccount: "Connect an available account to process API requests.", manageAccounts: "Manage accounts", usage: "Usage overview", seeAll: "View audits", activeAccounts: "Available accounts", accountCapacity: "{{total}} accounts · {{rate}}% success", manage: "Manage", tokens: "Total tokens", requests: "Requests", successRate: "Success rate", availableSummary: "{{active}} / {{total}} available", requestBreakdown: "{{success}} succeeded · {{failed}} failed", requestQualitySummary: "{{success}}% success · {{failed}} failed", periodSummary: "Current {{period}} range", successSummary: "{{success}} / {{total}} requests succeeded", trend: "Usage trend", trendRequests: "Requests", trendTokens: "Tokens", resourcesTitle: "Resource status", qualityTitle: "Request quality", successfulRequests: "Successful requests", failedRequests: "Failed requests", topModels: "Top 10 models", model: "Model", share: "Call share", noTopModels: "No model calls in this period", billing: "Billing", billingSummary: "Accumulated in the current {{period}} range", inputTokens: "Input", cachedTokens: "Cached", outputTokens: "Output", reasoningTokens: "Reasoning", uncachedInput: "Uncached input", visibleOutput: "Visible output", otherModels: "Other models", tokenBreakdown: "Input {{input}} · Cached {{cached}} · Output {{output}} · Reasoning {{reasoning}}", tokenEfficiency: "Cache hit rate {{rate}}%", explore: "Manage resources", accountsProduct: "Upstream accounts", accountsProductDescription: "Manage OAuth credentials, health, quota, and concurrency.", keysProduct: "Client keys", keysProductDescription: "Create downstream API keys and control models, RPM, and concurrency.", modelsProduct: "Model routes", modelsProductDescription: "Manage public model IDs, upstream mappings, and availability.", auditsProduct: "Request audits", auditsProductDescription: "Inspect status, latency, and token usage records.", gatewayFooter: "A lightweight API gateway", learnMore: "View models", unknown: "Unknown" }, accounts: { title: "Upstream accounts", description: "Manage separate Grok Build OAuth and Grok Web SSO pools, health, concurrency, and quotas.", add: "Connect account", connectAccount: "Connect account", convertToBuild: "Convert to Build", convertToBuildTitle: "Convert Grok Web accounts to Build?", convertToBuildDescription: "The selected {{count}} accounts will use SSO to complete Device OAuth automatically. Linked accounts are skipped and conversion may take a moment.", convertingProgress: "Converting {{completed}} / {{total}}", syncingProgress: "Syncing {{completed}} / {{total}}", conversionCompleted: "Conversion complete: {{created}} created, {{linked}} linked, {{skipped}} skipped, {{failed}} failed", linkedAccountTooltip: "Linked account: {{name}}", syncAll: "Sync all", renewAll: "Renew all", syncAllTitle: "Sync all accounts?", syncAllDescription: "Refresh quota data for every enabled Grok Build account.", syncAllWebDescription: "Refresh real quota data for every enabled Grok Web account.", renewAllTitle: "Renew all accounts?", renewAllDescription: "Refresh every renewable Grok Build credential. Accounts without automatic renewal will be skipped.", search: "Search accounts", deviceLogin: "Device OAuth", importAuth: "Import account files", importSSO: "Import SSO JSON", quickImportSSO: "Quick import SSO", importWebFile: "Import account files", quickImportTitle: "Quick import Grok Web accounts", quickImportDescription: "Paste multiple SSO tokens directly. Duplicate entries are ignored.", ssoTokens: "SSO tokens (one per line)", ssoTokenPlaceholder: "sso_token_1\nsso_token_2\nsso=token_3", importAction: "Import", exportAuth: "Export all accounts", exported: "Account credentials exported", exportTitle: "Export all account credentials?", exportDescription: "The exported JSON contains OAuth credentials that can access the upstream service. Store it only in a trusted location and never upload, share, or commit it to version control.", refreshAllBilling: "Sync all quotas", account: "Account", status: "Status", type: "Type", quota: "Quota", routing: "Routing", credentialExpiry: "Credential expiry", credentialRenewal: "Renewal capability", autoRefresh: "Auto-renewal", noAutoRefresh: "No auto-renewal", buildAccountCount: "Grok Build accounts", webAccountCount: "Grok Web accounts", consoleAccountCount: "Grok Console accounts", abnormalAccountCount: "Abnormal accounts", routableAccountCount: "{{count}} routable", abnormalAccountBreakdown: "Recovering {{recovering}} · Needs attention {{attention}}", lastUsed: "Last used", createdAt: "Created at", name: "Name", priority: "Priority", maxConcurrent: "Max concurrency", minimumRemaining: "Minimum remaining threshold", routingSummary: "Priority {{priority}} · {{count}} concurrent", minimumRemainingSummary: "Minimum remaining {{value}}", minimumRemainingNotApplicable: "Minimum remaining does not apply to Free", refreshToken: "Refresh credential", refreshBilling: "Sync quota", refreshModeQuota: "Sync quota", quotaNotSynced: "Not synced", quotaResetAt: "Next reset {{time}}", quotaResetUnknown: "The upstream did not return a reset time", webQuotaUsage: "Used {{used}} / {{total}} total · {{remaining}} remaining", webModeQuotaRemaining: "{{mode}} has {{remaining}} calls remaining", webWeeklyQuotaUsage: "Weekly quota {{remaining}}% remaining", paidQuotaDetails: "{{remaining}} credits remaining", created: "Account connected", createdWithSyncFailure: "Account connected, but initial quota or model sync failed", updated: "Account updated", deleted: "Account deleted", imported: "Import complete: {{created}} created, {{updated}} updated", importedWithSyncFailures: "Import complete: {{created}} created, {{updated}} updated; {{synced}} synced, {{syncFailed}} failed initial sync", billingRefreshed: "Quota synced", authRefreshed: "Credential refreshed", allBillingRefreshed: "Sync complete: {{succeeded}} succeeded, {{failed}} failed", allTokensRefreshed: "Renewal complete: {{succeeded}} succeeded, {{failed}} failed, {{skipped}} skipped", statusDisabled: "Disabled", statusReauthRequired: "Invalid", statusCooldown: "Cooling", statusActive: "Normal", quotaFree: "Free", quotaSuper: "Super", quotaPaid: "Super", quotaUnknown: "Unknown", paidQuotaUsage: "Upstream quota usage", weeklyQuota: "Weekly", monthlyQuota: "Monthly", weeklyLimit: "Weekly limit {{percent}}% remaining", freeObservedUsage: "{{used}} tokens observed in the last 24 hours", freeEstimatedUsage: "About {{used}} / {{limit}} tokens", freeEstimatedDescription: "Estimated from observed Grok Build Free characteristics; upstream exhaustion data takes precedence", observedRolling: "Free accounts use this proxy's rolling observation and may differ from upstream billing data", upstreamConfirmed: "Exhaustion confirmed by upstream", waitingReset: "Waiting reset", waitingResetUntil: "Waiting for reset · probe after {{time}} on real traffic", paidWaitingResetUntil: "Waiting for reset · check the upstream Billing period after {{time}}", probing: "Probing", probingQuota: "Checking quota recovery with real traffic", paidProbingQuota: "Checking whether the upstream Billing period has recovered", upstreamBilling: "Upstream billing data", deviceTitle: "Connect Grok Build", deviceDescription: "Complete authorization in a new window. This page will check status automatically.", userCode: "Device code", openVerification: "Open authorization", waiting: "Waiting for authorization", expiresAt: "Expires {{time}}", deleteTitle: "Delete account?", deleteDescription: "Credentials and quota snapshots will be removed. This cannot be undone.", batchUpdated: "Selected accounts updated", batchBillingRefreshed: "Quota sync complete: {{succeeded}} succeeded, {{failed}} failed", batchDeleteTitle: "Delete {{count}} selected accounts?" }, models: { title: "Model routes", description: "Map one client-facing model name to provider-specific Build, Web, and Console routes.", sync: "Sync models", search: "Search models", model: "Public model name", publicId: "Public model name", upstream: "Upstream model", provider: "Model source", providerGrokBuild: "Grok Build", providerGrokWeb: "Grok Web", accountSupport: "Supported accounts", lastSyncedAt: "Last synced", capability: "Account model capabilities", supportSummary: "{{supported}} available / {{total}} total", awaitingCapabilitySync: "Awaiting model capability sync", unknownCapability: "Pending sync", partialCapability: "Awaiting remaining accounts", available: "Available", unavailable: "Unavailable", status: "Status", create: "Add model", createTitle: "Add model route", createDescription: "Add a custom Grok Build route. The public model name has no source prefix; the upstream model uses Build/ to identify its actual channel.", editTitle: "Edit model route", bindAccounts: "Bind specific accounts", boundAccounts: "Bound accounts", bindAccountsDescription: "When enabled, only selected accounts are routed and treated as manually confirmed to support the model. Otherwise model sync decides automatically.", searchAccounts: "Search account name or ID", selectedAccounts: "{{count}} accounts selected", selectAccountRequired: "Select at least one account", noBindableAccounts: "No accounts from this provider can be bound", deleteTitle: "Delete model route?", deleteDescription: "This removes {{name}} and its client-key permissions. A later sync recreates it if upstream accounts still support the model.", batchDeleteTitle: "Delete {{count}} selected model routes?", batchDeleteDescription: "This removes the selected routes and their client-key permissions. Models still supported by upstream accounts are recreated on a later sync.", synced: "Synced {{count}} models", created: "Model route created", updated: "Model route updated", deleted: "Model route deleted", batchDeleted: "Deleted {{count}} model routes", batchUpdated: "Selected models updated" }, - keys: { title: "Client keys", description: "Control downstream model access, RPM, concurrency, billed usage, and expiration.", search: "Search keys", create: "Create key", name: "Name", prefix: "Key", limits: "Limits", rpmLimit: "RPM limit", concurrencyLimit: "Concurrency limit", rpmShort: "RPM", concurrencyShort: "Concurrency", billingLimit: "Usage limit", models: "Allowed models", status: "Status", statusActive: "Active", statusExpired: "Expired", modelScope: "Model scope", restrictedModels: "Selected models", expires: "Expires", lastUsed: "Last used", rpm: "Requests per minute", maxConcurrent: "Max concurrency", rpmValue: "{{value}} RPM", concurrentValue: "{{value}} concurrent", unlimited: "Unlimited", billedUsage: "{{value}} billed", billingLimitDescription: "Accumulates billed request audits, preferring upstream-reported cost and otherwise using the official price estimate.", allModels: "All models", modelSearch: "Search models. Leave blank to allow all models.", selectedModels: "{{count}} models selected", neverExpires: "Never expires", clearExpiry: "Clear expiration", expiryTime: "Expiration time", createTitle: "Create client key", editTitle: "Edit client key", secretTitle: "Client key created", secretDescription: "Store this key securely. It is hidden by default in the list and can be copied again later.", secretLabel: "Complete key", copySecret: "Copy complete key", created: "Client key created", updated: "Client key updated", deleted: "Client key deleted", deleteTitle: "Delete client key?", deleteDescription: "All downstream requests using this key will stop immediately.", batchUpdated: "Selected keys updated", batchDeleteTitle: "Delete {{count}} selected keys?" }, + keys: { title: "Client keys", description: "Control downstream model access, RPM, concurrency, billed usage, and expiration.", search: "Search keys", create: "Create key", name: "Name", prefix: "Key", limits: "Limits", rpmLimit: "RPM limit", concurrencyLimit: "Concurrency limit", rpmShort: "RPM", concurrencyShort: "Concurrency", billingLimit: "Usage limit", models: "Allowed models", status: "Status", statusActive: "Active", statusExpired: "Expired", modelScope: "Model scope", restrictedModels: "Selected models", expires: "Expires", lastUsed: "Last used", rpm: "Requests per minute", maxConcurrent: "Max concurrency", rpmValue: "{{value}} RPM", concurrentValue: "{{value}} concurrent", unlimited: "Unlimited", billedUsage: "{{value}} billed", billingLimitDescription: "Accumulates billed request audits, preferring upstream-reported cost and otherwise using the official price estimate.", allModels: "All models", modelSearch: "Search models. Leave blank to allow all models.", selectedModels: "{{count}} models selected", neverExpires: "Never expires", clearExpiry: "Clear expiration", expiryTime: "Expiration time", createTitle: "Create client key", editTitle: "Edit client key", secretTitle: "Client key created", secretDescription: "Store this key securely.", secretLabel: "Key", copySecret: "Copy", copySecretTitle: "Copy key", copySecretDescription: "Use the button below to copy your key.", secretReady: "Ready", created: "Client key created", updated: "Client key updated", deleted: "Client key deleted", deleteTitle: "Delete client key?", deleteDescription: "All downstream requests using this key will stop immediately.", batchUpdated: "Selected keys updated", batchDeleteTitle: "Delete {{count}} selected keys?" }, audits: { title: "Request audits", description: "Stores routing, status, latency, and usage details only. Request and response bodies are never saved.", search: "Search request ID or model", request: "Request ID", route: "Route", status: "Status", mode: "Mode", tokens: "Details", billing: "Billing", duration: "Duration", createdAt: "Time", stream: "Streaming", nonStream: "Non-streaming", cursorPage: "Page {{page}}", key: "Key", keyFilterPlaceholder: "Enter key name or ID", model: "Model", account: "Account", accountFilterPlaceholder: "Enter account name or ID", owningAccount: "Account", owningKey: "Client key", routeDetails: "View routing details", statusSuccess: "Success", statusClientError: "Client error", statusServerError: "Server error", usageSummary: "Usage summary", totalRequests: "Total requests", requestBreakdown: "{{success}} succeeded · {{failed}} failed", totalTokens: "Total tokens", tokenEfficiency: "Cache hit rate {{cacheRate}}%", tokenBreakdown: "Input {{input}} · Output {{output}} · Cached {{cached}} · Reasoning {{reasoning}}", successRate: "Success rate", averageDuration: "Average duration {{duration}}", estimatedCost: "Estimated cost", pricingCoverage: "{{priced}} priced · {{unpriced}} unpriced", pricingDescription: "Calculated using the latest official xAI model prices. Models without a listed price are excluded.", total: "Total", input: "Input", output: "Output", mediaInput: "Media Input", imageCount: "{{count}} images", secondsCount: "{{count}} sec", cached: "Cached", reasoning: "Reasoning", costUsd: "Cost ${{value}}", sources: "Sources {{count}}", serverTools: "Server tools called {{count}} times" }, settings: { title: "Runtime settings", description: "Manage hot-reloadable gateway runtime parameters.", saved: "Settings saved and applied", restartRequired: "Restart required", invalidValue: "Enter a valid value", durationUnit: "Duration unit", groups: { providers: "Providers", delivery: "Media & network", policies: "Runtime policies" }, provider: { title: "Grok Build provider", baseURL: "Upstream URL", clientVersion: "Client version", clientIdentifier: "Client identifier", tokenAuth: "Token auth", userAgent: "User-Agent", recommendedVersion: "Recommended {{version}}", syncRecommendedVersion: "Sync recommended version", recommendedVersionApplied: "Recommended version active", syncRecommendedVersionDescription: "Fill in the backend version and User-Agent that passed compatibility regression; save to apply." }, web: { title: "Grok Web", baseURL: "Upstream URL", statsigMode: "x-statsig source", statsigManual: "Manual", statsigURL: "Fetch from URL", statsigValue: "x-statsig-id", statsigConfigured: "Configured", statsigKeepConfigured: "Leave blank to keep the current value", statsigValuePlaceholder: "Paste x-statsig-id", statsigSignerURL: "Signer URL", quotaTimeout: "Quota timeout", chatTimeout: "Chat timeout", imageTimeout: "Image timeout", videoTimeout: "Video timeout", mediaConcurrency: "Media job concurrency", recoveryBackoffBase: "Quota recovery backoff", recoveryBackoffMax: "Maximum recovery backoff", allowNSFW: "Allow NSFW images" }, batch: { title: "Batch tasks", importConcurrency: "Import sync concurrency", conversionConcurrency: "Account conversion concurrency", syncConcurrency: "Data sync concurrency", refreshConcurrency: "Credential refresh concurrency", randomDelay: "Maximum random delay (ms)" }, media: { title: "Media storage", maxImageSize: "Maximum image size", maxTotalSize: "Media storage limit", cleanupThresholdPercent: "Automatic cleanup threshold", cleanupInterval: "Capacity check interval", sizeUnit: "Storage unit" }, egress: { title: "Egress proxies", description: "Nodes manage proxy and health independently for Grok Build, Grok Web, or Web assets. Build inherits the Provider User-Agent; Web nodes manage their own browser User-Agent and cookies. Proxy URLs and Cloudflare cookies are write-only.", add: "Add node", saved: "Proxy node saved", deleted: "Proxy node deleted", name: "Name", scope: "Scope", proxy: "Proxy", clearance: "Clearance", health: "Health", directFallback: "Direct connection is used when no node is configured", scopeBuild: "Grok Build", scopeWeb: "Grok Web", scopeWebAsset: "Grok Web (assets only)", configured: "Configured", direct: "Direct", none: "None", editTitle: "Edit proxy node", addTitle: "Add proxy node", dialogDescription: "Build nodes only configure the proxy and inherit the Provider User-Agent; Web nodes use their own browser User-Agent and Cloudflare cookies.", enabled: "Enabled", proxyURL: "Proxy URL", proxyProtocols: "Supports HTTP, HTTPS, SOCKS4, SOCKS4A, SOCKS5, and SOCKS5H with optional username and password.", userAgent: "User-Agent", cloudflareCookie: "Cloudflare Cookie", keepConfigured: "Configured; leave blank to keep unchanged", operationFailed: "Operation failed" }, routing: { title: "Routing policy", stickyTTL: "Sticky session TTL", cooldownBase: "Base cooldown", cooldownMax: "Maximum cooldown", maxAttempts: "Maximum attempts" }, audit: { title: "Request audit", bufferSize: "Queue capacity", batchSize: "Batch size", flushInterval: "Flush interval" }, clientKeys: { title: "Client key defaults", rpmLimit: "Default RPM", maxConcurrent: "Default concurrency" }, units: { seconds: "Seconds", minutes: "Minutes", hours: "Hours", days: "Days" } }, docs: { From f30195d9ba702c84a1f170db756b9ac0986e0bf9 Mon Sep 17 00:00:00 2001 From: Mas0nShi Date: Tue, 14 Jul 2026 15:16:26 +0800 Subject: [PATCH 09/16] fix: restore console egress UI and audit routing --- backend/docs/RESPONSES_COMPATIBILITY.md | 7 ++- .../application/gateway/egress_audit.go | 55 ++++++++++++++++ .../internal/application/gateway/service.go | 20 ++++-- backend/internal/application/gateway/video.go | 4 ++ backend/internal/domain/audit/audit.go | 11 ++++ backend/internal/domain/media/job.go | 4 ++ backend/internal/infra/egress/manager.go | 5 +- backend/internal/infra/egress/manager_test.go | 31 +++++++++- backend/internal/infra/egress/trace.go | 62 +++++++++++++++++++ .../relational/audit_repository.go | 6 +- .../relational/audit_repository_test.go | 8 ++- .../infra/persistence/relational/mapping.go | 4 +- .../relational/media_repository.go | 14 +++-- .../infra/persistence/relational/models.go | 50 ++++++++------- .../internal/transport/http/audit/handler.go | 8 ++- .../src/features/audits/request-audits-api.ts | 9 ++- .../features/audits/request-audits-page.tsx | 47 +++++++++++--- .../src/features/settings/egress-nodes.tsx | 5 +- .../src/features/settings/settings-api.ts | 6 +- frontend/src/shared/components/data-state.tsx | 2 +- frontend/src/shared/i18n/index.ts | 10 ++- 21 files changed, 307 insertions(+), 61 deletions(-) create mode 100644 backend/internal/application/gateway/egress_audit.go create mode 100644 backend/internal/infra/egress/trace.go diff --git a/backend/docs/RESPONSES_COMPATIBILITY.md b/backend/docs/RESPONSES_COMPATIBILITY.md index 2a3e18f3..6b684e0a 100644 --- a/backend/docs/RESPONSES_COMPATIBILITY.md +++ b/backend/docs/RESPONSES_COMPATIBILITY.md @@ -128,8 +128,11 @@ Messages 转换层兼容 Claude Code 常见载荷:标准顶层 `system` 与误 - `media_input_images` - `media_output_images` - `media_output_seconds` +- `egress_mode`(`proxy` 或 `direct`) +- `egress_scope` +- `egress_node_id` / `egress_node_name`(出口节点快照) -不保存 prompt、response body、encrypted reasoning 内容或工具参数。 +不保存 prompt、response body、encrypted reasoning 内容、工具参数、代理 URL、代理认证信息、User-Agent 或 Cookie。 Grok Web 未提供与公开 API 等价的精确 Token 计量,因此聊天审计标记 `usageSource: estimated`;图片和视频标记 `usageSource: none`,不会伪造 Token,用量费用仅按已配置的官方媒体单价估算。 @@ -189,7 +192,7 @@ JSON 只接受当前 `accounts` 结构。SSO 不存在自动刷新:上游返 - `sso`、`sso-rw` 始终从当前账号的加密 SSO Token 生成。 - Clearance 与出口节点绑定;403 或挑战只重建当前节点会话并降低健康分,下一次优先选择更健康节点,不会冷却或移除账号。 - User-Agent 必须与获取 Clearance 时一致。当前 TLS 客户端使用其最新 Chrome 146 profile;自定义为 Firefox、Safari 等非 Chromium UA 会造成明显指纹不一致。 -- 出口节点按 `Grok Build`、`Grok Web`、`Grok Web(仅资源)` 三个作用域独立管理代理、健康度和冷却状态。Grok Build 始终沿用 Provider 的 CLI User-Agent,节点不能覆盖;Grok Web 和 Web 资源节点独立管理浏览器 User-Agent 与 Cloudflare Cookie。Web 资源未配置专用节点时仅回退到 Grok Web 节点。 +- 出口节点按 `Grok Build`、`Grok Web`、`Grok Console`、`Grok Web(仅资源)` 四个作用域独立管理代理、健康度和冷却状态。Grok Build 始终沿用 Provider 的 CLI User-Agent,节点不能覆盖;Grok Web、Console 和 Web 资源节点独立管理浏览器 User-Agent 与 Cloudflare Cookie。Web 资源未配置专用节点时仅回退到 Grok Web 节点。 - 代理地址支持 HTTP、HTTPS、SOCKS4、SOCKS4A、SOCKS5 与 SOCKS5H,可携带用户名和密码。Cloudflare Cookie 只适用于 Grok Web。 - 配置过对应作用域的出口节点后,如果全部节点不可用,服务不会静默退回直连;只有该作用域完全没有配置节点时才使用 direct。Grok Build 未配置节点时保持原有标准 HTTP 直连。 - 首版仅支持 `none/manual` Clearance,不接 FlareSolverr。 diff --git a/backend/internal/application/gateway/egress_audit.go b/backend/internal/application/gateway/egress_audit.go new file mode 100644 index 00000000..fe546d97 --- /dev/null +++ b/backend/internal/application/gateway/egress_audit.go @@ -0,0 +1,55 @@ +package gateway + +import ( + accountdomain "github.com/chenyme/grok2api/backend/internal/domain/account" + "github.com/chenyme/grok2api/backend/internal/domain/audit" + egressdomain "github.com/chenyme/grok2api/backend/internal/domain/egress" + "github.com/chenyme/grok2api/backend/internal/domain/media" + infraegress "github.com/chenyme/grok2api/backend/internal/infra/egress" +) + +func applyAuditEgress(record *audit.Record, trace *infraegress.Trace, provider accountdomain.Provider) { + selection, ok := trace.Selection(primaryEgressScope(provider)) + if !ok { + return + } + record.EgressNodeName = selection.NodeName + record.EgressScope = string(selection.Scope) + if selection.Proxied { + record.EgressMode = audit.EgressModeProxy + } else { + record.EgressMode = audit.EgressModeDirect + } + if selection.NodeID != 0 { + id := selection.NodeID + record.EgressNodeID = &id + } +} + +func applyMediaJobEgress(job *media.Job, trace *infraegress.Trace, provider accountdomain.Provider) { + selection, ok := trace.Selection(primaryEgressScope(provider)) + if !ok { + return + } + job.EgressNodeName = selection.NodeName + job.EgressScope = string(selection.Scope) + job.EgressMode = string(audit.EgressModeDirect) + if selection.Proxied { + job.EgressMode = string(audit.EgressModeProxy) + } + if selection.NodeID != 0 { + id := selection.NodeID + job.EgressNodeID = &id + } +} + +func primaryEgressScope(provider accountdomain.Provider) egressdomain.Scope { + switch provider { + case accountdomain.ProviderWeb: + return egressdomain.ScopeWeb + case accountdomain.ProviderConsole: + return egressdomain.ScopeConsole + default: + return egressdomain.ScopeBuild + } +} diff --git a/backend/internal/application/gateway/service.go b/backend/internal/application/gateway/service.go index 02cb1b10..36aa7b00 100644 --- a/backend/internal/application/gateway/service.go +++ b/backend/internal/application/gateway/service.go @@ -23,6 +23,7 @@ import ( "github.com/chenyme/grok2api/backend/internal/domain/clientkey" inferencedomain "github.com/chenyme/grok2api/backend/internal/domain/inference" modeldomain "github.com/chenyme/grok2api/backend/internal/domain/model" + infraegress "github.com/chenyme/grok2api/backend/internal/infra/egress" "github.com/chenyme/grok2api/backend/internal/infra/provider" "github.com/chenyme/grok2api/backend/internal/infra/security" "github.com/chenyme/grok2api/backend/internal/repository" @@ -258,6 +259,7 @@ func (s *Service) selectMediaRoute(routes []modeldomain.Route, key clientkey.Key } func (s *Service) createResponseAt(ctx context.Context, input Input, path string) (*Result, error) { + ctx, egressTrace := infraegress.WithTrace(ctx) startedAt := time.Now() eventID := newAuditEventID() operation := input.Operation @@ -311,6 +313,7 @@ func (s *Service) createResponseAt(ctx context.Context, input Input, path string record.DurationMS = time.Since(startedAt).Milliseconds() record.ErrorCode = "model_not_allowed" record.CreatedAt = time.Now().UTC() + applyAuditEgress(&record, egressTrace, route.Provider) if err := s.audits.Create(ctx, record); err != nil { s.logger.Error("request_usage_write_failed", "event_id", record.EventID, "request_id", input.RequestID, "error", err) } @@ -571,6 +574,7 @@ attemptLoop: record.DurationMS = time.Since(startedAt).Milliseconds() record.ErrorCode = errorCode record.CreatedAt = now + applyAuditEgress(&record, egressTrace, route.Provider) if err := s.audits.Create(persistCtx, record); err != nil { s.logger.Error("request_usage_write_failed", "event_id", record.EventID, "request_id", input.RequestID, "error", err) } @@ -611,6 +615,7 @@ attemptLoop: record.DurationMS = time.Since(startedAt).Milliseconds() record.ErrorCode = lastFailure.AuditCode() record.CreatedAt = time.Now().UTC() + applyAuditEgress(&record, egressTrace, route.Provider) if lastFailure.AccountID != 0 { accountID := lastFailure.AccountID record.AccountID = &accountID @@ -631,6 +636,7 @@ attemptLoop: record.DurationMS = time.Since(startedAt).Milliseconds() record.ErrorCode = "upstream_unavailable" record.CreatedAt = time.Now().UTC() + applyAuditEgress(&record, egressTrace, route.Provider) persistCtx, cancel := context.WithTimeout(context.Background(), finalizationTimeout) defer cancel() if err := s.audits.Create(persistCtx, record); err != nil { @@ -699,8 +705,8 @@ type ImageEditInput struct { } func (s *Service) GenerateImage(ctx context.Context, input ImageGenerationInput) (*Result, error) { - return s.executeImage(ctx, input.RequestID, input.ClientKey, input.PublicModel, audit.OperationImage, func(adapter provider.ImageAdapter, credential accountdomain.Credential, upstream string) (*provider.Response, error) { - return adapter.GenerateImage(ctx, provider.ImageGenerationRequest{ + return s.executeImage(ctx, input.RequestID, input.ClientKey, input.PublicModel, audit.OperationImage, func(executionCtx context.Context, adapter provider.ImageAdapter, credential accountdomain.Credential, upstream string) (*provider.Response, error) { + return adapter.GenerateImage(executionCtx, provider.ImageGenerationRequest{ Credential: credential, Model: upstream, Prompt: input.Prompt, Count: input.Count, Size: input.Size, AspectRatio: input.AspectRatio, Resolution: input.Resolution, ResponseFormat: input.ResponseFormat, Streaming: input.Streaming, @@ -709,15 +715,16 @@ func (s *Service) GenerateImage(ctx context.Context, input ImageGenerationInput) } func (s *Service) EditImage(ctx context.Context, input ImageEditInput) (*Result, error) { - return s.executeImage(ctx, input.RequestID, input.ClientKey, input.PublicModel, audit.OperationImageEdit, func(adapter provider.ImageAdapter, credential accountdomain.Credential, upstream string) (*provider.Response, error) { - return adapter.EditImage(ctx, provider.ImageEditRequest{ + return s.executeImage(ctx, input.RequestID, input.ClientKey, input.PublicModel, audit.OperationImageEdit, func(executionCtx context.Context, adapter provider.ImageAdapter, credential accountdomain.Credential, upstream string) (*provider.Response, error) { + return adapter.EditImage(executionCtx, provider.ImageEditRequest{ Credential: credential, Model: upstream, Prompt: input.Prompt, ImageURLs: input.ImageURLs, Count: input.Count, Resolution: input.Resolution, ResponseFormat: input.ResponseFormat, }) }, false, input.Resolution, input.Count, len(input.ImageURLs)) } -func (s *Service) executeImage(ctx context.Context, requestID string, key clientkey.Key, publicModel string, operation audit.Operation, execute func(provider.ImageAdapter, accountdomain.Credential, string) (*provider.Response, error), streaming bool, resolution string, requestedCount, inputImageCount int) (*Result, error) { +func (s *Service) executeImage(ctx context.Context, requestID string, key clientkey.Key, publicModel string, operation audit.Operation, execute func(context.Context, provider.ImageAdapter, accountdomain.Credential, string) (*provider.Response, error), streaming bool, resolution string, requestedCount, inputImageCount int) (*Result, error) { + ctx, egressTrace := infraegress.WithTrace(ctx) startedAt := time.Now() eventID := newAuditEventID() routes, err := s.models.GetByPublicIDCandidates(ctx, publicModel) @@ -783,7 +790,7 @@ func (s *Service) executeImage(ctx context.Context, requestID string, key client lease.Release() return nil, err } - response, err = execute(adapter, credential, route.UpstreamModel) + response, err = execute(ctx, adapter, credential, route.UpstreamModel) if err != nil { s.logger.Error("image_upstream_failed", "event_id", eventID, "request_id", requestID, "model", externalModel, "provider", route.Provider, "account_id", credential.ID, "error", err) s.selector.MarkFailure(ctx, credential, 0, 0) @@ -831,6 +838,7 @@ func (s *Service) executeImage(ctx context.Context, requestID string, key client Streaming: streaming, ErrorCode: errorCode, DurationMS: time.Since(startedAt).Milliseconds(), CreatedAt: time.Now().UTC(), } + applyAuditEgress(&record, egressTrace, route.Provider) switch operation { case audit.OperationImage: record.MediaOutputImages = int64(max(0, requestedCount)) diff --git a/backend/internal/application/gateway/video.go b/backend/internal/application/gateway/video.go index e37eb9a2..a3b8298b 100644 --- a/backend/internal/application/gateway/video.go +++ b/backend/internal/application/gateway/video.go @@ -14,6 +14,7 @@ import ( "github.com/chenyme/grok2api/backend/internal/domain/clientkey" "github.com/chenyme/grok2api/backend/internal/domain/media" "github.com/chenyme/grok2api/backend/internal/domain/model" + infraegress "github.com/chenyme/grok2api/backend/internal/infra/egress" "github.com/chenyme/grok2api/backend/internal/infra/provider" "github.com/chenyme/grok2api/backend/internal/infra/security" "github.com/chenyme/grok2api/backend/internal/pkg/batch" @@ -243,6 +244,7 @@ func (s *Service) claimVideoJob(ctx context.Context, id string) (media.Job, bool func (s *Service) runVideoJob(parent context.Context, job media.Job, route model.Route) { ctx, cancel := context.WithTimeout(parent, videoJobTimeout) defer cancel() + ctx, egressTrace := infraegress.WithTrace(ctx) startedAt := time.Now() job.Progress = max(job.Progress, 1) job.UpdatedAt = time.Now().UTC() @@ -296,6 +298,7 @@ func (s *Service) runVideoJob(parent context.Context, job media.Job, route model } now := time.Now().UTC() job.Status, job.Progress, job.UpstreamURL, job.ContentType = media.StatusCompleted, 100, result.URL, result.ContentType + applyMediaJobEgress(&job, egressTrace, route.Provider) job.LeaseUntil, job.UpdatedAt, job.CompletedAt = nil, now, &now if err := s.persistVideoJobWithRetry(parent, job); err != nil { s.logger.Error("video_job_terminal_write_failed", "job_id", job.ID, "error", err) @@ -339,6 +342,7 @@ func (s *Service) recordVideoUsage(ctx context.Context, job media.Job, durationM ModelRouteID: job.ModelRouteID, ModelPublicID: job.Model, ModelUpstreamModel: job.UpstreamModel, Provider: job.Provider, Operation: audit.OperationVideo, UsageSource: audit.UsageSourceNone, AccountID: &accountID, AccountName: job.AccountName, StatusCode: http.StatusOK, + EgressNodeID: job.EgressNodeID, EgressNodeName: job.EgressNodeName, EgressScope: job.EgressScope, EgressMode: audit.EgressMode(job.EgressMode), MediaInputImages: int64(len(decodeVideoInput(job.InputJSON))), MediaOutputSeconds: int64(max(0, job.Seconds)), DurationMS: durationMS, CreatedAt: createdAt, } diff --git a/backend/internal/domain/audit/audit.go b/backend/internal/domain/audit/audit.go index 67ea6afa..282c447b 100644 --- a/backend/internal/domain/audit/audit.go +++ b/backend/internal/domain/audit/audit.go @@ -21,6 +21,13 @@ const ( UsageSourceNone UsageSource = "none" ) +type EgressMode string + +const ( + EgressModeDirect EgressMode = "direct" + EgressModeProxy EgressMode = "proxy" +) + // Record 表示不包含提示词和响应正文的推理请求审计记录。 type Record struct { ID uint64 @@ -36,6 +43,10 @@ type Record struct { UsageSource UsageSource AccountID *uint64 AccountName string + EgressNodeID *uint64 + EgressNodeName string + EgressScope string + EgressMode EgressMode StatusCode int Streaming bool MediaInputImages int64 diff --git a/backend/internal/domain/media/job.go b/backend/internal/domain/media/job.go index 21826f90..54723688 100644 --- a/backend/internal/domain/media/job.go +++ b/backend/internal/domain/media/job.go @@ -19,6 +19,10 @@ type Job struct { ClientKeyName string AccountID uint64 AccountName string + EgressNodeID *uint64 + EgressNodeName string + EgressScope string + EgressMode string Provider string Model string ModelRouteID uint64 diff --git a/backend/internal/infra/egress/manager.go b/backend/internal/infra/egress/manager.go index dda0c74a..f3226f99 100644 --- a/backend/internal/infra/egress/manager.go +++ b/backend/internal/infra/egress/manager.go @@ -24,6 +24,7 @@ const nodeSnapshotTTL = time.Second type Lease struct { NodeID uint64 + NodeName string Scope domain.Scope ProxyURL string UserAgent string @@ -111,6 +112,7 @@ func (m *Manager) acquire(ctx context.Context, scope domain.Scope, affinity stri return nil, false, fmt.Errorf("当前没有可用的 %s 出口节点", scope) } if !allowDirect { + recordSelection(ctx, Selection{NodeName: "direct", Scope: scope}) return nil, false, nil } available = []domain.Node{{ID: 0, Name: "direct", Scope: scope, Enabled: true, Health: 1}} @@ -147,8 +149,9 @@ func (m *Manager) acquire(ctx context.Context, scope domain.Scope, affinity stri m.mu.Lock() m.inflight[selected.ID]++ m.mu.Unlock() + recordSelection(ctx, Selection{NodeID: selected.ID, NodeName: selected.Name, Scope: scope, Proxied: proxyURL != ""}) var once sync.Once - return &Lease{NodeID: selected.ID, Scope: scope, ProxyURL: proxyURL, UserAgent: userAgent, CFCookies: cookies, client: client.client, browser: client.browser, release: func() { + return &Lease{NodeID: selected.ID, NodeName: selected.Name, Scope: scope, ProxyURL: proxyURL, UserAgent: userAgent, CFCookies: cookies, client: client.client, browser: client.browser, release: func() { once.Do(func() { m.mu.Lock() m.inflight[selected.ID]-- diff --git a/backend/internal/infra/egress/manager_test.go b/backend/internal/infra/egress/manager_test.go index fd8bd99a..39646c8c 100644 --- a/backend/internal/infra/egress/manager_test.go +++ b/backend/internal/infra/egress/manager_test.go @@ -58,10 +58,39 @@ func TestAcquireIfConfiguredDoesNotChangeBuildDirectTransport(t *testing.T) { t.Fatal(err) } manager := NewManager(egressRepositoryTestStub{}, cipher) - lease, configured, err := manager.AcquireIfConfigured(context.Background(), domain.ScopeBuild, "") + ctx, trace := WithTrace(context.Background()) + lease, configured, err := manager.AcquireIfConfigured(ctx, domain.ScopeBuild, "") if err != nil || configured || lease != nil { t.Fatalf("lease=%#v configured=%v err=%v", lease, configured, err) } + selection, ok := trace.Selection(domain.ScopeBuild) + if !ok || selection.NodeID != 0 || selection.NodeName != "direct" || selection.Proxied { + t.Fatalf("direct selection = %#v, ok=%v", selection, ok) + } +} + +func TestTraceRecordsConfiguredProxyWithoutCredentials(t *testing.T) { + cipher, err := security.NewCipher("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=") + if err != nil { + t.Fatal(err) + } + encryptedProxy, err := cipher.Encrypt("socks5h://secret:password@127.0.0.1:1080") + if err != nil { + t.Fatal(err) + } + manager := NewManager(egressRepositoryTestStub{nodes: []domain.Node{{ + ID: 42, Name: "primary-proxy", Scope: domain.ScopeBuild, Enabled: true, Health: 1, EncryptedProxyURL: encryptedProxy, + }}}, cipher) + ctx, trace := WithTrace(context.Background()) + lease, configured, err := manager.AcquireIfConfigured(ctx, domain.ScopeBuild, "") + if err != nil || !configured || lease == nil { + t.Fatalf("lease=%#v configured=%v err=%v", lease, configured, err) + } + defer lease.Release() + selection, ok := trace.Selection(domain.ScopeBuild) + if !ok || selection.NodeID != 42 || selection.NodeName != "primary-proxy" || !selection.Proxied { + t.Fatalf("proxy selection = %#v, ok=%v", selection, ok) + } } func TestConfiguredBuildNodeDoesNotOverrideProviderUserAgent(t *testing.T) { diff --git a/backend/internal/infra/egress/trace.go b/backend/internal/infra/egress/trace.go new file mode 100644 index 00000000..53b7065a --- /dev/null +++ b/backend/internal/infra/egress/trace.go @@ -0,0 +1,62 @@ +package egress + +import ( + "context" + "sync" + + domain "github.com/chenyme/grok2api/backend/internal/domain/egress" +) + +// Selection 是一次上游请求实际选择的出口快照。它只包含可安全写入审计的元数据, +// 不包含代理 URL、认证信息、User-Agent 或 Cookie。 +type Selection struct { + NodeID uint64 + NodeName string + Scope domain.Scope + Proxied bool +} + +// Trace 按作用域保留最后一次实际出口选择。相同请求发生出口重试时,审计记录最终尝试; +// Web 资源归档使用独立作用域,不会覆盖主要的 Grok Web 推理出口。 +type Trace struct { + mu sync.RWMutex + selections map[domain.Scope]Selection +} + +type traceContextKey struct{} + +func WithTrace(ctx context.Context) (context.Context, *Trace) { + if existing := TraceFromContext(ctx); existing != nil { + return ctx, existing + } + trace := &Trace{selections: make(map[domain.Scope]Selection)} + return context.WithValue(ctx, traceContextKey{}, trace), trace +} + +func TraceFromContext(ctx context.Context) *Trace { + if ctx == nil { + return nil + } + trace, _ := ctx.Value(traceContextKey{}).(*Trace) + return trace +} + +func (t *Trace) Selection(scope domain.Scope) (Selection, bool) { + if t == nil { + return Selection{}, false + } + t.mu.RLock() + defer t.mu.RUnlock() + value, ok := t.selections[scope] + return value, ok +} + +func recordSelection(ctx context.Context, value Selection) { + trace := TraceFromContext(ctx) + if trace == nil { + return + } + trace.mu.Lock() + trace.selections[value.Scope] = value + trace.mu.Unlock() +} diff --git a/backend/internal/infra/persistence/relational/audit_repository.go b/backend/internal/infra/persistence/relational/audit_repository.go index b8224fcf..09373c34 100644 --- a/backend/internal/infra/persistence/relational/audit_repository.go +++ b/backend/internal/infra/persistence/relational/audit_repository.go @@ -89,7 +89,9 @@ func toAuditModel(value audit.Record) requestAuditModel { EventID: truncate(eventID, 64), RequestID: truncate(value.RequestID, 64), ClientKeyID: value.ClientKeyID, ClientKeyName: truncate(value.ClientKeyName, 160), ModelRouteID: value.ModelRouteID, ModelPublicID: truncate(value.ModelPublicID, 255), ModelUpstreamModel: truncate(value.ModelUpstreamModel, 255), Provider: truncate(provider, 32), Operation: string(operation), UsageSource: string(usageSource), - AccountID: value.AccountID, AccountName: truncate(value.AccountName, 160), StatusCode: value.StatusCode, Streaming: value.Streaming, + AccountID: value.AccountID, AccountName: truncate(value.AccountName, 160), + EgressNodeID: value.EgressNodeID, EgressNodeName: truncate(value.EgressNodeName, 160), EgressScope: truncate(value.EgressScope, 32), EgressMode: string(value.EgressMode), + StatusCode: value.StatusCode, Streaming: value.Streaming, MediaInputImages: nonNegative(value.MediaInputImages), MediaOutputImages: nonNegative(value.MediaOutputImages), MediaOutputSeconds: nonNegative(value.MediaOutputSeconds), InputTokens: nonNegative(value.InputTokens), CachedInputTokens: nonNegative(value.CachedInputTokens), OutputTokens: nonNegative(value.OutputTokens), ReasoningTokens: nonNegative(value.ReasoningTokens), TotalTokens: nonNegative(value.TotalTokens), CostInUSDTicks: nonNegative(value.CostInUSDTicks), @@ -301,7 +303,7 @@ func (r *AuditRepository) Summarize(ctx context.Context, input repository.AuditS func applyAuditQuery(query *gorm.DB, search string, start, end time.Time, filter repository.AuditListFilter) *gorm.DB { if value := strings.TrimSpace(search); value != "" { pattern := "%" + strings.ToLower(value) + "%" - query = query.Where("LOWER(request_id) LIKE ? OR LOWER(model_public_id) LIKE ? OR LOWER(model_upstream_model) LIKE ?", pattern, pattern, pattern) + query = query.Where("LOWER(request_id) LIKE ? OR LOWER(model_public_id) LIKE ? OR LOWER(model_upstream_model) LIKE ? OR LOWER(egress_node_name) LIKE ?", pattern, pattern, pattern, pattern) } if !start.IsZero() { query = query.Where("created_at >= ?", start) diff --git a/backend/internal/infra/persistence/relational/audit_repository_test.go b/backend/internal/infra/persistence/relational/audit_repository_test.go index bf0d4338..fe18dfbd 100644 --- a/backend/internal/infra/persistence/relational/audit_repository_test.go +++ b/backend/internal/infra/persistence/relational/audit_repository_test.go @@ -58,7 +58,7 @@ func TestAuditRepositoryBatchAndCursor(t *testing.T) { {RequestID: "cursor-old", ClientKeyID: 1, ModelRouteID: 1, StatusCode: 200, CreatedAt: now.Add(-48 * time.Hour)}, {RequestID: "cursor-1", ClientKeyID: 1, ModelRouteID: 1, StatusCode: 200, CreatedAt: now.Add(-3 * time.Minute)}, {RequestID: "cursor-2", ClientKeyID: 1, ModelRouteID: 1, StatusCode: 200, CreatedAt: now.Add(-2 * time.Minute)}, - {RequestID: "cursor-3", ClientKeyID: 1, ClientKeyName: "production", ModelRouteID: 1, ModelPublicID: "grok-test", ModelUpstreamModel: "grok-test-upstream", AccountName: "primary", StatusCode: 200, CreatedAt: now.Add(-time.Minute)}, + {RequestID: "cursor-3", ClientKeyID: 1, ClientKeyName: "production", ModelRouteID: 1, ModelPublicID: "grok-test", ModelUpstreamModel: "grok-test-upstream", AccountName: "primary", EgressNodeID: uint64Pointer(42), EgressNodeName: "proxy-shanghai", EgressScope: "grok_web", EgressMode: audit.EgressModeProxy, StatusCode: 200, CreatedAt: now.Add(-time.Minute)}, } if err := repository.CreateBatch(ctx, values); err != nil { t.Fatal(err) @@ -71,9 +71,13 @@ func TestAuditRepositoryBatchAndCursor(t *testing.T) { if len(first) != 2 || !hasMore || first[0].ID <= first[1].ID { t.Fatalf("first page = %#v, hasMore = %v", first, hasMore) } - if first[0].ClientKeyName != "production" || first[0].ModelPublicID != "grok-test" || first[0].ModelUpstreamModel != "grok-test-upstream" || first[0].AccountName != "primary" { + if first[0].ClientKeyName != "production" || first[0].ModelPublicID != "grok-test" || first[0].ModelUpstreamModel != "grok-test-upstream" || first[0].AccountName != "primary" || first[0].EgressNodeID == nil || *first[0].EgressNodeID != 42 || first[0].EgressNodeName != "proxy-shanghai" || first[0].EgressMode != audit.EgressModeProxy { t.Fatalf("audit snapshots = %#v", first[0]) } + matched, _, err := repository.ListCursor(ctx, repositorypkg.AuditCursorQuery{Limit: 10, Search: "proxy-shanghai", Sort: sort}) + if err != nil || len(matched) != 1 || matched[0].RequestID != "cursor-3" { + t.Fatalf("egress search = %#v, err = %v", matched, err) + } second, _, err := repository.ListCursor(ctx, repositorypkg.AuditCursorQuery{Cursor: &repositorypkg.SortCursor{ID: first[len(first)-1].ID, Value: first[len(first)-1].CreatedAt}, Limit: 2, Sort: sort}) if err != nil { t.Fatal(err) diff --git a/backend/internal/infra/persistence/relational/mapping.go b/backend/internal/infra/persistence/relational/mapping.go index 6fb2aab4..5b76b1eb 100644 --- a/backend/internal/infra/persistence/relational/mapping.go +++ b/backend/internal/infra/persistence/relational/mapping.go @@ -147,7 +147,9 @@ func toAuditDomain(value requestAuditModel) audit.Record { ID: value.ID, EventID: value.EventID, RequestID: value.RequestID, ClientKeyID: value.ClientKeyID, ClientKeyName: value.ClientKeyName, ModelRouteID: value.ModelRouteID, ModelPublicID: value.ModelPublicID, ModelUpstreamModel: value.ModelUpstreamModel, Provider: value.Provider, Operation: audit.Operation(value.Operation), UsageSource: audit.UsageSource(value.UsageSource), - AccountID: value.AccountID, AccountName: value.AccountName, StatusCode: value.StatusCode, Streaming: value.Streaming, + AccountID: value.AccountID, AccountName: value.AccountName, + EgressNodeID: value.EgressNodeID, EgressNodeName: value.EgressNodeName, EgressScope: value.EgressScope, EgressMode: audit.EgressMode(value.EgressMode), + StatusCode: value.StatusCode, Streaming: value.Streaming, MediaInputImages: value.MediaInputImages, MediaOutputImages: value.MediaOutputImages, MediaOutputSeconds: value.MediaOutputSeconds, InputTokens: value.InputTokens, CachedInputTokens: value.CachedInputTokens, OutputTokens: value.OutputTokens, ReasoningTokens: value.ReasoningTokens, TotalTokens: value.TotalTokens, CostInUSDTicks: value.CostInUSDTicks, diff --git a/backend/internal/infra/persistence/relational/media_repository.go b/backend/internal/infra/persistence/relational/media_repository.go index ad68ac50..599852b7 100644 --- a/backend/internal/infra/persistence/relational/media_repository.go +++ b/backend/internal/infra/persistence/relational/media_repository.go @@ -90,7 +90,7 @@ func (r *MediaJobRepository) UpdateMediaJob(ctx context.Context, value media.Job if value.ClaimToken != "" { query = query.Where("claim_token = ?", value.ClaimToken) } - result := query.Select("request_id", "client_key_name", "account_id", "account_name", "provider", "model", "model_route_id", "upstream_model", "prompt", "seconds", "size", "quality", "status", "progress", "input_json", "upstream_url", "content_type", "error_code", "error_message", "lease_until", "claim_token", "updated_at", "completed_at", "usage_recorded_at").Updates(updates) + result := query.Select("request_id", "client_key_name", "account_id", "account_name", "egress_node_id", "egress_node_name", "egress_scope", "egress_mode", "provider", "model", "model_route_id", "upstream_model", "prompt", "seconds", "size", "quality", "status", "progress", "input_json", "upstream_url", "content_type", "error_code", "error_message", "lease_until", "claim_token", "updated_at", "completed_at", "usage_recorded_at").Updates(updates) if result.Error != nil { return result.Error } @@ -169,8 +169,10 @@ func (r *MediaJobRepository) TryClaimMediaJob(ctx context.Context, id string, no func mediaJobFromDomain(value media.Job) *mediaJobModel { return &mediaJobModel{ ID: value.ID, RequestID: value.RequestID, ClientKeyID: value.ClientKeyID, ClientKeyName: value.ClientKeyName, - AccountID: value.AccountID, AccountName: value.AccountName, Provider: value.Provider, - Model: value.Model, ModelRouteID: value.ModelRouteID, UpstreamModel: value.UpstreamModel, + AccountID: value.AccountID, AccountName: value.AccountName, + EgressNodeID: value.EgressNodeID, EgressNodeName: value.EgressNodeName, EgressScope: value.EgressScope, EgressMode: value.EgressMode, + Provider: value.Provider, + Model: value.Model, ModelRouteID: value.ModelRouteID, UpstreamModel: value.UpstreamModel, Prompt: value.Prompt, Seconds: value.Seconds, Size: value.Size, Quality: value.Quality, Status: string(value.Status), Progress: value.Progress, InputJSON: value.InputJSON, UpstreamURL: value.UpstreamURL, ContentType: value.ContentType, ErrorCode: value.ErrorCode, ErrorMessage: value.ErrorMessage, @@ -182,8 +184,10 @@ func mediaJobFromDomain(value media.Job) *mediaJobModel { func mediaJobToDomain(row mediaJobModel) media.Job { return media.Job{ ID: row.ID, RequestID: row.RequestID, ClientKeyID: row.ClientKeyID, ClientKeyName: row.ClientKeyName, - AccountID: row.AccountID, AccountName: row.AccountName, Provider: row.Provider, - Model: row.Model, ModelRouteID: row.ModelRouteID, UpstreamModel: row.UpstreamModel, + AccountID: row.AccountID, AccountName: row.AccountName, + EgressNodeID: row.EgressNodeID, EgressNodeName: row.EgressNodeName, EgressScope: row.EgressScope, EgressMode: row.EgressMode, + Provider: row.Provider, + Model: row.Model, ModelRouteID: row.ModelRouteID, UpstreamModel: row.UpstreamModel, Prompt: row.Prompt, Seconds: row.Seconds, Size: row.Size, Quality: row.Quality, Status: media.Status(row.Status), Progress: row.Progress, InputJSON: row.InputJSON, UpstreamURL: row.UpstreamURL, ContentType: row.ContentType, ErrorCode: row.ErrorCode, ErrorMessage: row.ErrorMessage, diff --git a/backend/internal/infra/persistence/relational/models.go b/backend/internal/infra/persistence/relational/models.go index 9aaeb34c..e4cc81ef 100644 --- a/backend/internal/infra/persistence/relational/models.go +++ b/backend/internal/infra/persistence/relational/models.go @@ -260,6 +260,10 @@ type requestAuditModel struct { UsageSource string `gorm:"size:16;not null;check:chk_request_audits_usage_source,usage_source IN ('upstream','estimated','none')"` AccountID *uint64 `gorm:"check:chk_request_audits_account_id,account_id IS NULL OR account_id > 0"` AccountName string `gorm:"size:160;check:chk_request_audits_account_name,length(account_name) <= 160"` + EgressNodeID *uint64 `gorm:"check:chk_request_audits_egress_node_id,egress_node_id IS NULL OR egress_node_id > 0"` + EgressNodeName string `gorm:"size:160;not null;default:'';check:chk_request_audits_egress_node_name,length(egress_node_name) <= 160"` + EgressScope string `gorm:"size:32;not null;default:'';check:chk_request_audits_egress_scope,egress_scope IN ('','grok_build','grok_web','grok_console','grok_web_asset')"` + EgressMode string `gorm:"size:16;not null;default:'';check:chk_request_audits_egress_mode,egress_mode IN ('','direct','proxy')"` StatusCode int `gorm:"not null;check:chk_request_audits_status_code,status_code BETWEEN 100 AND 599"` Streaming bool `gorm:"not null;default:false"` MediaInputImages int64 `gorm:"not null;default:0"` @@ -315,27 +319,31 @@ type webResponseStateModel struct { func (webResponseStateModel) TableName() string { return "web_response_states" } type mediaJobModel struct { - ID string `gorm:"size:64;primaryKey;check:chk_media_jobs_id,length(id) BETWEEN 1 AND 64"` - RequestID string `gorm:"size:64;not null;check:chk_media_jobs_request_id,length(request_id) BETWEEN 1 AND 64"` - ClientKeyID uint64 `gorm:"not null;check:chk_media_jobs_client_key_id,client_key_id > 0"` - ClientKeyName string `gorm:"size:160;not null;default:'';check:chk_media_jobs_client_key_name,length(client_key_name) <= 160"` - AccountID uint64 `gorm:"not null;check:chk_media_jobs_account_id,account_id > 0"` - AccountName string `gorm:"size:160;not null;default:'';check:chk_media_jobs_account_name,length(account_name) <= 160"` - Provider string `gorm:"size:32;not null;check:chk_media_jobs_provider,provider IN ('grok_web')"` - Model string `gorm:"size:255;not null;check:chk_media_jobs_model,length(trim(model)) BETWEEN 1 AND 255"` - ModelRouteID uint64 `gorm:"not null;check:chk_media_jobs_model_route_id,model_route_id > 0"` - UpstreamModel string `gorm:"size:255;not null;check:chk_media_jobs_upstream_model,length(trim(upstream_model)) BETWEEN 1 AND 255"` - Prompt string `gorm:"type:text;not null;check:chk_media_jobs_prompt,length(prompt) BETWEEN 0 AND 100000"` - Seconds int `gorm:"not null;check:chk_media_jobs_seconds,seconds BETWEEN 1 AND 15"` - Size string `gorm:"size:32;not null;check:chk_media_jobs_size,length(trim(size)) BETWEEN 1 AND 32"` - Quality string `gorm:"size:32;not null;check:chk_media_jobs_quality,length(trim(quality)) BETWEEN 1 AND 32"` - Status string `gorm:"size:32;not null;check:chk_media_jobs_status,status IN ('queued','in_progress','completed','failed')"` - Progress int `gorm:"not null;check:chk_media_jobs_progress,progress BETWEEN 0 AND 100"` - InputJSON string `gorm:"type:text;not null;default:'{}';check:chk_media_jobs_input_json,length(input_json) <= 1048576"` - UpstreamURL string `gorm:"type:text;not null;default:'';check:chk_media_jobs_upstream_url,length(upstream_url) <= 8192"` - ContentType string `gorm:"size:128;not null;default:'';check:chk_media_jobs_content_type,length(content_type) <= 128"` - ErrorCode string `gorm:"size:100;not null;default:'';check:chk_media_jobs_error_code,length(error_code) <= 100"` - ErrorMessage string `gorm:"size:512;not null;default:'';check:chk_media_jobs_error_message,length(error_message) <= 512"` + ID string `gorm:"size:64;primaryKey;check:chk_media_jobs_id,length(id) BETWEEN 1 AND 64"` + RequestID string `gorm:"size:64;not null;check:chk_media_jobs_request_id,length(request_id) BETWEEN 1 AND 64"` + ClientKeyID uint64 `gorm:"not null;check:chk_media_jobs_client_key_id,client_key_id > 0"` + ClientKeyName string `gorm:"size:160;not null;default:'';check:chk_media_jobs_client_key_name,length(client_key_name) <= 160"` + AccountID uint64 `gorm:"not null;check:chk_media_jobs_account_id,account_id > 0"` + AccountName string `gorm:"size:160;not null;default:'';check:chk_media_jobs_account_name,length(account_name) <= 160"` + EgressNodeID *uint64 `gorm:"check:chk_media_jobs_egress_node_id,egress_node_id IS NULL OR egress_node_id > 0"` + EgressNodeName string `gorm:"size:160;not null;default:'';check:chk_media_jobs_egress_node_name,length(egress_node_name) <= 160"` + EgressScope string `gorm:"size:32;not null;default:'';check:chk_media_jobs_egress_scope,egress_scope IN ('','grok_web')"` + EgressMode string `gorm:"size:16;not null;default:'';check:chk_media_jobs_egress_mode,egress_mode IN ('','direct','proxy')"` + Provider string `gorm:"size:32;not null;check:chk_media_jobs_provider,provider IN ('grok_web')"` + Model string `gorm:"size:255;not null;check:chk_media_jobs_model,length(trim(model)) BETWEEN 1 AND 255"` + ModelRouteID uint64 `gorm:"not null;check:chk_media_jobs_model_route_id,model_route_id > 0"` + UpstreamModel string `gorm:"size:255;not null;check:chk_media_jobs_upstream_model,length(trim(upstream_model)) BETWEEN 1 AND 255"` + Prompt string `gorm:"type:text;not null;check:chk_media_jobs_prompt,length(prompt) BETWEEN 0 AND 100000"` + Seconds int `gorm:"not null;check:chk_media_jobs_seconds,seconds BETWEEN 1 AND 15"` + Size string `gorm:"size:32;not null;check:chk_media_jobs_size,length(trim(size)) BETWEEN 1 AND 32"` + Quality string `gorm:"size:32;not null;check:chk_media_jobs_quality,length(trim(quality)) BETWEEN 1 AND 32"` + Status string `gorm:"size:32;not null;check:chk_media_jobs_status,status IN ('queued','in_progress','completed','failed')"` + Progress int `gorm:"not null;check:chk_media_jobs_progress,progress BETWEEN 0 AND 100"` + InputJSON string `gorm:"type:text;not null;default:'{}';check:chk_media_jobs_input_json,length(input_json) <= 1048576"` + UpstreamURL string `gorm:"type:text;not null;default:'';check:chk_media_jobs_upstream_url,length(upstream_url) <= 8192"` + ContentType string `gorm:"size:128;not null;default:'';check:chk_media_jobs_content_type,length(content_type) <= 128"` + ErrorCode string `gorm:"size:100;not null;default:'';check:chk_media_jobs_error_code,length(error_code) <= 100"` + ErrorMessage string `gorm:"size:512;not null;default:'';check:chk_media_jobs_error_message,length(error_message) <= 512"` LeaseUntil *time.Time ClaimToken string `gorm:"size:64;not null;default:'';check:chk_media_jobs_claim_token,claim_token = '' OR length(claim_token) BETWEEN 16 AND 64"` CreatedAt time.Time `gorm:"not null"` diff --git a/backend/internal/transport/http/audit/handler.go b/backend/internal/transport/http/audit/handler.go index 302cc5c6..7f6e89e3 100644 --- a/backend/internal/transport/http/audit/handler.go +++ b/backend/internal/transport/http/audit/handler.go @@ -35,6 +35,10 @@ type auditResponse struct { UsageSource string `json:"usageSource"` AccountID *uint64 `json:"accountId,string,omitempty"` AccountName string `json:"accountName,omitempty"` + EgressNodeID *uint64 `json:"egressNodeId,string,omitempty"` + EgressNodeName string `json:"egressNodeName,omitempty"` + EgressScope string `json:"egressScope,omitempty"` + EgressMode string `json:"egressMode,omitempty"` StatusCode int `json:"statusCode"` Streaming bool `json:"streaming"` MediaInputImages int64 `json:"mediaInputImages"` @@ -195,7 +199,9 @@ func newAuditResponse(value auditdomain.Record) auditResponse { ID: value.ID, RequestID: value.RequestID, ClientKeyID: value.ClientKeyID, ClientKeyName: value.ClientKeyName, ModelRouteID: value.ModelRouteID, ModelPublicID: value.ModelPublicID, ModelUpstreamModel: value.ModelUpstreamModel, Provider: value.Provider, Operation: string(value.Operation), UsageSource: string(value.UsageSource), - AccountID: value.AccountID, AccountName: value.AccountName, StatusCode: value.StatusCode, Streaming: value.Streaming, + AccountID: value.AccountID, AccountName: value.AccountName, + EgressNodeID: value.EgressNodeID, EgressNodeName: value.EgressNodeName, EgressScope: value.EgressScope, EgressMode: string(value.EgressMode), + StatusCode: value.StatusCode, Streaming: value.Streaming, MediaInputImages: value.MediaInputImages, MediaOutputImages: value.MediaOutputImages, MediaOutputSeconds: value.MediaOutputSeconds, InputTokens: value.InputTokens, CachedInputTokens: value.CachedInputTokens, OutputTokens: value.OutputTokens, ReasoningTokens: value.ReasoningTokens, TotalTokens: value.TotalTokens, CostInUSDTicks: value.CostInUSDTicks, diff --git a/frontend/src/features/audits/request-audits-api.ts b/frontend/src/features/audits/request-audits-api.ts index abe02cbd..bfbd3fd1 100644 --- a/frontend/src/features/audits/request-audits-api.ts +++ b/frontend/src/features/audits/request-audits-api.ts @@ -18,6 +18,10 @@ export type AuditDTO = { usageSource: "upstream" | "estimated" | "none"; accountId?: string; accountName?: string; + egressNodeId?: string; + egressNodeName?: string; + egressScope?: "grok_build" | "grok_web" | "grok_console" | "grok_web_asset"; + egressMode?: "direct" | "proxy"; statusCode: number; streaming: boolean; mediaInputImages: number; @@ -79,7 +83,10 @@ const auditValidator = hasShape({ id: isString, requestId: isString, clientKeyId: isString, clientKeyName: isOptional(isString), modelRouteId: isString, modelPublicId: isOptional(isString), modelUpstreamModel: isOptional(isString), provider: isOneOf("grok_build", "grok_web", "grok_console"), operation: isOneOf("responses", "chat", "messages", "image", "image_edit", "video"), usageSource: isOneOf("upstream", "estimated", "none"), - accountId: isOptional(isString), accountName: isOptional(isString), statusCode: isNumber, streaming: isBoolean, + accountId: isOptional(isString), accountName: isOptional(isString), + egressNodeId: isOptional(isString), egressNodeName: isOptional(isString), + egressScope: isOptional(isOneOf("grok_build", "grok_web", "grok_console", "grok_web_asset")), egressMode: isOptional(isOneOf("direct", "proxy")), + statusCode: isNumber, streaming: isBoolean, mediaInputImages: isNumber, mediaOutputImages: isNumber, mediaOutputSeconds: isNumber, inputTokens: isNumber, cachedInputTokens: isNumber, outputTokens: isNumber, reasoningTokens: isNumber, totalTokens: isNumber, costInUsdTicks: isNumber, estimatedCostInUsdTicks: isNumber, pricingModel: isOptional(isString), pricingVersion: isOptional(isString), diff --git a/frontend/src/features/audits/request-audits-page.tsx b/frontend/src/features/audits/request-audits-page.tsx index addb1572..7c56a765 100644 --- a/frontend/src/features/audits/request-audits-page.tsx +++ b/frontend/src/features/audits/request-audits-page.tsx @@ -7,7 +7,7 @@ import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Spinner } from "@/components/ui/spinner"; -import { Table, TableBody, TableCell, TableHeader, TableRow } from "@/components/ui/table"; +import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; import { listModels } from "@/entities/model/model-api"; import { getRequestAudits, getRequestAuditSummary, type AuditDTO, type AuditPeriod } from "@/features/audits/request-audits-api"; @@ -153,21 +153,23 @@ export function RequestAuditsPage() { {auditsQuery.isError ? void auditsQuery.refetch()} /> : null} {result && result.items.length === 0 ? : null} {auditsQuery.isPending || (result && result.items.length > 0) ? ( - +
- - - - - + + + + - + + + {t("audits.request")} {t("audits.model")} + {t("audits.egress")} {t("audits.billing")} {t("audits.tokens")} {t("audits.status")} @@ -177,7 +179,7 @@ export function RequestAuditsPage() { - {auditsQuery.isPending ? : result?.items.map((audit) => ( + {auditsQuery.isPending ? : result?.items.map((audit) => ( {audit.requestId} @@ -190,6 +192,7 @@ export function RequestAuditsPage() { clientKey={audit.clientKeyName || `#${audit.clientKeyId}`} /> + @@ -206,6 +209,32 @@ export function RequestAuditsPage() { ); } +function EgressValue({ audit }: { audit: AuditDTO }) { + const { t } = useTranslation(); + if (!audit.egressMode) { + return -; + } + const proxied = audit.egressMode === "proxy"; + const node = audit.egressNodeName || (proxied ? t("audits.egressUnknown") : t("audits.egressDirect")); + const details = [audit.egressScope, audit.egressNodeId ? `#${audit.egressNodeId}` : ""].filter(Boolean).join(" · "); + return ( + + + + + +
{node}
+ {details ?
{details}
: null} +
+
+ ); +} + function BillingValue({ audit }: { audit: AuditDTO }) { const { t } = useTranslation(); const upstreamReported = audit.costInUsdTicks > 0; diff --git a/frontend/src/features/settings/egress-nodes.tsx b/frontend/src/features/settings/egress-nodes.tsx index 750f8926..0a0f37ff 100644 --- a/frontend/src/features/settings/egress-nodes.tsx +++ b/frontend/src/features/settings/egress-nodes.tsx @@ -15,6 +15,7 @@ import { Switch } from "@/components/ui/switch"; import { Table, TableActionCell, TableActionHead, TableBody, TableCell, TableHeader, TableRow } from "@/components/ui/table"; import { createEgressNode, deleteEgressNode, listEgressNodes, updateEgressNode, type EgressNodeDTO, type EgressNodeInput, type EgressScope } from "@/features/settings/settings-api"; import { SortableTableHead } from "@/shared/components/sortable-table-head"; +import { ErrorState } from "@/shared/components/data-state"; import { nextTableSort, type SortOrder, type TableSort } from "@/shared/lib/table-sort"; const emptyInput: EgressNodeInput = { name: "", scope: "grok_build", enabled: true, proxyURL: "", userAgent: "", cloudflareCookies: "" }; @@ -84,7 +85,7 @@ export function EgressNodes() {

{t("console.egressDescription")}

-
+ {query.isError ? void query.refetch()} /> :
{t("settings.egress.name")}{t("settings.egress.scope")}{t("settings.egress.proxy")}{t("settings.egress.clearance")}{t("settings.egress.health")} @@ -104,7 +105,7 @@ export function EgressNodes() { ))}
- + } { if (!open) setEditing(undefined); }}> diff --git a/frontend/src/features/settings/settings-api.ts b/frontend/src/features/settings/settings-api.ts index 59242f82..4eb5717b 100644 --- a/frontend/src/features/settings/settings-api.ts +++ b/frontend/src/features/settings/settings-api.ts @@ -64,18 +64,18 @@ const decodeSettingsSnapshot = createObjectDecoder("setting restartRequired: isArrayOf(isString), }); const egressNodeValidator = hasShape({ - id: isString, name: isString, scope: isOneOf("grok_build", "grok_web", "grok_web_asset"), enabled: isBoolean, + id: isString, name: isString, scope: isOneOf("grok_build", "grok_web", "grok_console", "grok_web_asset"), enabled: isBoolean, proxyConfigured: isBoolean, userAgent: isString, cookieConfigured: isBoolean, health: isNumber, failureCount: isNumber, cooldownUntil: isOptional(isString), lastError: isOptional(isString), }); const decodeEgressNode = createObjectDecoder("egress node", { - id: isString, name: isString, scope: isOneOf("grok_build", "grok_web", "grok_web_asset"), enabled: isBoolean, + id: isString, name: isString, scope: isOneOf("grok_build", "grok_web", "grok_console", "grok_web_asset"), enabled: isBoolean, proxyConfigured: isBoolean, userAgent: isString, cookieConfigured: isBoolean, health: isNumber, failureCount: isNumber, cooldownUntil: isOptional(isString), lastError: isOptional(isString), }); const decodeEgressNodeList = createObjectDecoder("egress node list", { items: isArrayOf(egressNodeValidator), - defaultUserAgents: hasShape({ grok_build: isString, grok_web: isString, grok_web_asset: isString }), + defaultUserAgents: hasShape({ grok_build: isString, grok_web: isString, grok_console: isString, grok_web_asset: isString }), }); export function getSettings(): Promise { diff --git a/frontend/src/shared/components/data-state.tsx b/frontend/src/shared/components/data-state.tsx index 364eaf34..a1963cc6 100644 --- a/frontend/src/shared/components/data-state.tsx +++ b/frontend/src/shared/components/data-state.tsx @@ -40,7 +40,7 @@ export function ErrorState({ message, onRetry }: { message: string; onRetry: ()

{message}

- +
); } diff --git a/frontend/src/shared/i18n/index.ts b/frontend/src/shared/i18n/index.ts index 0baac1b8..43ec18d6 100644 --- a/frontend/src/shared/i18n/index.ts +++ b/frontend/src/shared/i18n/index.ts @@ -397,7 +397,7 @@ const resources = { audits: { title: "请求审计", description: "仅记录路由、状态、耗时和用量明细,不保存请求或响应正文。", - search: "搜索请求 ID 或模型", + search: "搜索请求 ID、模型或出口节点", request: "请求 ID", route: "路由", status: "状态", @@ -414,6 +414,10 @@ const resources = { model: "模型", account: "账号", accountFilterPlaceholder: "输入账号名称或 ID", + egress: "出口", + egressProxy: "代理", + egressDirect: "直连", + egressUnknown: "未命名节点", owningAccount: "所属账号", owningKey: "所属密钥", routeDetails: "查看路由详情", @@ -713,8 +717,8 @@ const resources = { accounts: { title: "Upstream accounts", description: "Manage separate Grok Build OAuth and Grok Web SSO pools, health, concurrency, and quotas.", add: "Connect account", connectAccount: "Connect account", convertToBuild: "Convert to Build", convertToBuildTitle: "Convert Grok Web accounts to Build?", convertToBuildDescription: "The selected {{count}} accounts will use SSO to complete Device OAuth automatically. Linked accounts are skipped and conversion may take a moment.", convertingProgress: "Converting {{completed}} / {{total}}", syncingProgress: "Syncing {{completed}} / {{total}}", conversionCompleted: "Conversion complete: {{created}} created, {{linked}} linked, {{skipped}} skipped, {{failed}} failed", linkedAccountTooltip: "Linked account: {{name}}", syncAll: "Sync all", renewAll: "Renew all", syncAllTitle: "Sync all accounts?", syncAllDescription: "Refresh quota data for every enabled Grok Build account.", syncAllWebDescription: "Refresh real quota data for every enabled Grok Web account.", renewAllTitle: "Renew all accounts?", renewAllDescription: "Refresh every renewable Grok Build credential. Accounts without automatic renewal will be skipped.", search: "Search accounts", deviceLogin: "Device OAuth", importAuth: "Import account files", importSSO: "Import SSO JSON", quickImportSSO: "Quick import SSO", importWebFile: "Import account files", quickImportTitle: "Quick import Grok Web accounts", quickImportDescription: "Paste multiple SSO tokens directly. Duplicate entries are ignored.", ssoTokens: "SSO tokens (one per line)", ssoTokenPlaceholder: "sso_token_1\nsso_token_2\nsso=token_3", importAction: "Import", exportAuth: "Export all accounts", exported: "Account credentials exported", exportTitle: "Export all account credentials?", exportDescription: "The exported JSON contains OAuth credentials that can access the upstream service. Store it only in a trusted location and never upload, share, or commit it to version control.", refreshAllBilling: "Sync all quotas", account: "Account", status: "Status", type: "Type", quota: "Quota", routing: "Routing", credentialExpiry: "Credential expiry", credentialRenewal: "Renewal capability", autoRefresh: "Auto-renewal", noAutoRefresh: "No auto-renewal", buildAccountCount: "Grok Build accounts", webAccountCount: "Grok Web accounts", consoleAccountCount: "Grok Console accounts", abnormalAccountCount: "Abnormal accounts", routableAccountCount: "{{count}} routable", abnormalAccountBreakdown: "Recovering {{recovering}} · Needs attention {{attention}}", lastUsed: "Last used", createdAt: "Created at", name: "Name", priority: "Priority", maxConcurrent: "Max concurrency", minimumRemaining: "Minimum remaining threshold", routingSummary: "Priority {{priority}} · {{count}} concurrent", minimumRemainingSummary: "Minimum remaining {{value}}", minimumRemainingNotApplicable: "Minimum remaining does not apply to Free", refreshToken: "Refresh credential", refreshBilling: "Sync quota", refreshModeQuota: "Sync quota", quotaNotSynced: "Not synced", quotaResetAt: "Next reset {{time}}", quotaResetUnknown: "The upstream did not return a reset time", webQuotaUsage: "Used {{used}} / {{total}} total · {{remaining}} remaining", webModeQuotaRemaining: "{{mode}} has {{remaining}} calls remaining", webWeeklyQuotaUsage: "Weekly quota {{remaining}}% remaining", paidQuotaDetails: "{{remaining}} credits remaining", created: "Account connected", createdWithSyncFailure: "Account connected, but initial quota or model sync failed", updated: "Account updated", deleted: "Account deleted", imported: "Import complete: {{created}} created, {{updated}} updated", importedWithSyncFailures: "Import complete: {{created}} created, {{updated}} updated; {{synced}} synced, {{syncFailed}} failed initial sync", billingRefreshed: "Quota synced", authRefreshed: "Credential refreshed", allBillingRefreshed: "Sync complete: {{succeeded}} succeeded, {{failed}} failed", allTokensRefreshed: "Renewal complete: {{succeeded}} succeeded, {{failed}} failed, {{skipped}} skipped", statusDisabled: "Disabled", statusReauthRequired: "Invalid", statusCooldown: "Cooling", statusActive: "Normal", quotaFree: "Free", quotaSuper: "Super", quotaPaid: "Super", quotaUnknown: "Unknown", paidQuotaUsage: "Upstream quota usage", weeklyQuota: "Weekly", monthlyQuota: "Monthly", weeklyLimit: "Weekly limit {{percent}}% remaining", freeObservedUsage: "{{used}} tokens observed in the last 24 hours", freeEstimatedUsage: "About {{used}} / {{limit}} tokens", freeEstimatedDescription: "Estimated from observed Grok Build Free characteristics; upstream exhaustion data takes precedence", observedRolling: "Free accounts use this proxy's rolling observation and may differ from upstream billing data", upstreamConfirmed: "Exhaustion confirmed by upstream", waitingReset: "Waiting reset", waitingResetUntil: "Waiting for reset · probe after {{time}} on real traffic", paidWaitingResetUntil: "Waiting for reset · check the upstream Billing period after {{time}}", probing: "Probing", probingQuota: "Checking quota recovery with real traffic", paidProbingQuota: "Checking whether the upstream Billing period has recovered", upstreamBilling: "Upstream billing data", deviceTitle: "Connect Grok Build", deviceDescription: "Complete authorization in a new window. This page will check status automatically.", userCode: "Device code", openVerification: "Open authorization", waiting: "Waiting for authorization", expiresAt: "Expires {{time}}", deleteTitle: "Delete account?", deleteDescription: "Credentials and quota snapshots will be removed. This cannot be undone.", batchUpdated: "Selected accounts updated", batchBillingRefreshed: "Quota sync complete: {{succeeded}} succeeded, {{failed}} failed", batchDeleteTitle: "Delete {{count}} selected accounts?" }, models: { title: "Model routes", description: "Map one client-facing model name to provider-specific Build, Web, and Console routes.", sync: "Sync models", search: "Search models", model: "Public model name", publicId: "Public model name", upstream: "Upstream model", provider: "Model source", providerGrokBuild: "Grok Build", providerGrokWeb: "Grok Web", accountSupport: "Supported accounts", lastSyncedAt: "Last synced", capability: "Account model capabilities", supportSummary: "{{supported}} available / {{total}} total", awaitingCapabilitySync: "Awaiting model capability sync", unknownCapability: "Pending sync", partialCapability: "Awaiting remaining accounts", available: "Available", unavailable: "Unavailable", status: "Status", create: "Add model", createTitle: "Add model route", createDescription: "Add a custom Grok Build route. The public model name has no source prefix; the upstream model uses Build/ to identify its actual channel.", editTitle: "Edit model route", bindAccounts: "Bind specific accounts", boundAccounts: "Bound accounts", bindAccountsDescription: "When enabled, only selected accounts are routed and treated as manually confirmed to support the model. Otherwise model sync decides automatically.", searchAccounts: "Search account name or ID", selectedAccounts: "{{count}} accounts selected", selectAccountRequired: "Select at least one account", noBindableAccounts: "No accounts from this provider can be bound", deleteTitle: "Delete model route?", deleteDescription: "This removes {{name}} and its client-key permissions. A later sync recreates it if upstream accounts still support the model.", batchDeleteTitle: "Delete {{count}} selected model routes?", batchDeleteDescription: "This removes the selected routes and their client-key permissions. Models still supported by upstream accounts are recreated on a later sync.", synced: "Synced {{count}} models", created: "Model route created", updated: "Model route updated", deleted: "Model route deleted", batchDeleted: "Deleted {{count}} model routes", batchUpdated: "Selected models updated" }, keys: { title: "Client keys", description: "Control downstream model access, RPM, concurrency, billed usage, and expiration.", search: "Search keys", create: "Create key", name: "Name", prefix: "Key", limits: "Limits", rpmLimit: "RPM limit", concurrencyLimit: "Concurrency limit", rpmShort: "RPM", concurrencyShort: "Concurrency", billingLimit: "Usage limit", models: "Allowed models", status: "Status", statusActive: "Active", statusExpired: "Expired", modelScope: "Model scope", restrictedModels: "Selected models", expires: "Expires", lastUsed: "Last used", rpm: "Requests per minute", maxConcurrent: "Max concurrency", rpmValue: "{{value}} RPM", concurrentValue: "{{value}} concurrent", unlimited: "Unlimited", billedUsage: "{{value}} billed", billingLimitDescription: "Accumulates billed request audits, preferring upstream-reported cost and otherwise using the official price estimate.", allModels: "All models", modelSearch: "Search models. Leave blank to allow all models.", selectedModels: "{{count}} models selected", neverExpires: "Never expires", clearExpiry: "Clear expiration", expiryTime: "Expiration time", createTitle: "Create client key", editTitle: "Edit client key", secretTitle: "Client key created", secretDescription: "Store this key securely.", secretLabel: "Key", copySecret: "Copy", copySecretTitle: "Copy key", copySecretDescription: "Use the button below to copy your key.", secretReady: "Ready", created: "Client key created", updated: "Client key updated", deleted: "Client key deleted", deleteTitle: "Delete client key?", deleteDescription: "All downstream requests using this key will stop immediately.", batchUpdated: "Selected keys updated", batchDeleteTitle: "Delete {{count}} selected keys?" }, - audits: { title: "Request audits", description: "Stores routing, status, latency, and usage details only. Request and response bodies are never saved.", search: "Search request ID or model", request: "Request ID", route: "Route", status: "Status", mode: "Mode", tokens: "Details", billing: "Billing", duration: "Duration", createdAt: "Time", stream: "Streaming", nonStream: "Non-streaming", cursorPage: "Page {{page}}", key: "Key", keyFilterPlaceholder: "Enter key name or ID", model: "Model", account: "Account", accountFilterPlaceholder: "Enter account name or ID", owningAccount: "Account", owningKey: "Client key", routeDetails: "View routing details", statusSuccess: "Success", statusClientError: "Client error", statusServerError: "Server error", usageSummary: "Usage summary", totalRequests: "Total requests", requestBreakdown: "{{success}} succeeded · {{failed}} failed", totalTokens: "Total tokens", tokenEfficiency: "Cache hit rate {{cacheRate}}%", tokenBreakdown: "Input {{input}} · Output {{output}} · Cached {{cached}} · Reasoning {{reasoning}}", successRate: "Success rate", averageDuration: "Average duration {{duration}}", estimatedCost: "Estimated cost", pricingCoverage: "{{priced}} priced · {{unpriced}} unpriced", pricingDescription: "Calculated using the latest official xAI model prices. Models without a listed price are excluded.", total: "Total", input: "Input", output: "Output", mediaInput: "Media Input", imageCount: "{{count}} images", secondsCount: "{{count}} sec", cached: "Cached", reasoning: "Reasoning", costUsd: "Cost ${{value}}", sources: "Sources {{count}}", serverTools: "Server tools called {{count}} times" }, - settings: { title: "Runtime settings", description: "Manage hot-reloadable gateway runtime parameters.", saved: "Settings saved and applied", restartRequired: "Restart required", invalidValue: "Enter a valid value", durationUnit: "Duration unit", groups: { providers: "Providers", delivery: "Media & network", policies: "Runtime policies" }, provider: { title: "Grok Build provider", baseURL: "Upstream URL", clientVersion: "Client version", clientIdentifier: "Client identifier", tokenAuth: "Token auth", userAgent: "User-Agent", recommendedVersion: "Recommended {{version}}", syncRecommendedVersion: "Sync recommended version", recommendedVersionApplied: "Recommended version active", syncRecommendedVersionDescription: "Fill in the backend version and User-Agent that passed compatibility regression; save to apply." }, web: { title: "Grok Web", baseURL: "Upstream URL", statsigMode: "x-statsig source", statsigManual: "Manual", statsigURL: "Fetch from URL", statsigValue: "x-statsig-id", statsigConfigured: "Configured", statsigKeepConfigured: "Leave blank to keep the current value", statsigValuePlaceholder: "Paste x-statsig-id", statsigSignerURL: "Signer URL", quotaTimeout: "Quota timeout", chatTimeout: "Chat timeout", imageTimeout: "Image timeout", videoTimeout: "Video timeout", mediaConcurrency: "Media job concurrency", recoveryBackoffBase: "Quota recovery backoff", recoveryBackoffMax: "Maximum recovery backoff", allowNSFW: "Allow NSFW images" }, batch: { title: "Batch tasks", importConcurrency: "Import sync concurrency", conversionConcurrency: "Account conversion concurrency", syncConcurrency: "Data sync concurrency", refreshConcurrency: "Credential refresh concurrency", randomDelay: "Maximum random delay (ms)" }, media: { title: "Media storage", maxImageSize: "Maximum image size", maxTotalSize: "Media storage limit", cleanupThresholdPercent: "Automatic cleanup threshold", cleanupInterval: "Capacity check interval", sizeUnit: "Storage unit" }, egress: { title: "Egress proxies", description: "Nodes manage proxy and health independently for Grok Build, Grok Web, or Web assets. Build inherits the Provider User-Agent; Web nodes manage their own browser User-Agent and cookies. Proxy URLs and Cloudflare cookies are write-only.", add: "Add node", saved: "Proxy node saved", deleted: "Proxy node deleted", name: "Name", scope: "Scope", proxy: "Proxy", clearance: "Clearance", health: "Health", directFallback: "Direct connection is used when no node is configured", scopeBuild: "Grok Build", scopeWeb: "Grok Web", scopeWebAsset: "Grok Web (assets only)", configured: "Configured", direct: "Direct", none: "None", editTitle: "Edit proxy node", addTitle: "Add proxy node", dialogDescription: "Build nodes only configure the proxy and inherit the Provider User-Agent; Web nodes use their own browser User-Agent and Cloudflare cookies.", enabled: "Enabled", proxyURL: "Proxy URL", proxyProtocols: "Supports HTTP, HTTPS, SOCKS4, SOCKS4A, SOCKS5, and SOCKS5H with optional username and password.", userAgent: "User-Agent", cloudflareCookie: "Cloudflare Cookie", keepConfigured: "Configured; leave blank to keep unchanged", operationFailed: "Operation failed" }, routing: { title: "Routing policy", stickyTTL: "Sticky session TTL", cooldownBase: "Base cooldown", cooldownMax: "Maximum cooldown", maxAttempts: "Maximum attempts" }, audit: { title: "Request audit", bufferSize: "Queue capacity", batchSize: "Batch size", flushInterval: "Flush interval" }, clientKeys: { title: "Client key defaults", rpmLimit: "Default RPM", maxConcurrent: "Default concurrency" }, units: { seconds: "Seconds", minutes: "Minutes", hours: "Hours", days: "Days" } }, + audits: { title: "Request audits", description: "Stores routing, status, latency, and usage details only. Request and response bodies are never saved.", search: "Search request ID, model, or egress node", request: "Request ID", route: "Route", status: "Status", mode: "Mode", tokens: "Details", billing: "Billing", duration: "Duration", createdAt: "Time", stream: "Streaming", nonStream: "Non-streaming", cursorPage: "Page {{page}}", key: "Key", keyFilterPlaceholder: "Enter key name or ID", model: "Model", account: "Account", accountFilterPlaceholder: "Enter account name or ID", egress: "Egress", egressProxy: "Proxy", egressDirect: "Direct", egressUnknown: "Unnamed node", owningAccount: "Account", owningKey: "Client key", routeDetails: "View routing details", statusSuccess: "Success", statusClientError: "Client error", statusServerError: "Server error", usageSummary: "Usage summary", totalRequests: "Total requests", requestBreakdown: "{{success}} succeeded · {{failed}} failed", totalTokens: "Total tokens", tokenEfficiency: "Cache hit rate {{cacheRate}}%", tokenBreakdown: "Input {{input}} · Output {{output}} · Cached {{cached}} · Reasoning {{reasoning}}", successRate: "Success rate", averageDuration: "Average duration {{duration}}", estimatedCost: "Estimated cost", pricingCoverage: "{{priced}} priced · {{unpriced}} unpriced", pricingDescription: "Calculated using the latest official xAI model prices. Models without a listed price are excluded.", total: "Total", input: "Input", output: "Output", mediaInput: "Media Input", imageCount: "{{count}} images", secondsCount: "{{count}} sec", cached: "Cached", reasoning: "Reasoning", costUsd: "Cost ${{value}}", sources: "Sources {{count}}", serverTools: "Server tools called {{count}} times" }, + settings: { title: "Runtime settings", description: "Manage hot-reloadable gateway runtime parameters.", saved: "Settings saved and applied", restartRequired: "Restart required", invalidValue: "Enter a valid value", durationUnit: "Duration unit", groups: { providers: "Providers", delivery: "Media & network", policies: "Runtime policies" }, provider: { title: "Grok Build provider", baseURL: "Upstream URL", clientVersion: "Client version", clientIdentifier: "Client identifier", tokenAuth: "Token auth", userAgent: "User-Agent", recommendedVersion: "Recommended {{version}}", syncRecommendedVersion: "Sync recommended version", recommendedVersionApplied: "Recommended version active", syncRecommendedVersionDescription: "Fill in the backend version and User-Agent that passed compatibility regression; save to apply." }, web: { title: "Grok Web", baseURL: "Upstream URL", statsigMode: "x-statsig source", statsigManual: "Manual", statsigURL: "Fetch from URL", statsigValue: "x-statsig-id", statsigConfigured: "Configured", statsigKeepConfigured: "Leave blank to keep the current value", statsigValuePlaceholder: "Paste x-statsig-id", statsigSignerURL: "Signer URL", quotaTimeout: "Quota timeout", chatTimeout: "Chat timeout", imageTimeout: "Image timeout", videoTimeout: "Video timeout", mediaConcurrency: "Media job concurrency", recoveryBackoffBase: "Quota recovery backoff", recoveryBackoffMax: "Maximum recovery backoff", allowNSFW: "Allow NSFW images" }, batch: { title: "Batch tasks", importConcurrency: "Import sync concurrency", conversionConcurrency: "Account conversion concurrency", syncConcurrency: "Data sync concurrency", refreshConcurrency: "Credential refresh concurrency", randomDelay: "Maximum random delay (ms)" }, media: { title: "Media storage", maxImageSize: "Maximum image size", maxTotalSize: "Media storage limit", cleanupThresholdPercent: "Automatic cleanup threshold", cleanupInterval: "Capacity check interval", sizeUnit: "Storage unit" }, egress: { title: "Egress proxies", description: "Nodes manage proxy and health independently for Grok Build, Grok Web, Grok Console, or Web assets. Build inherits the Provider User-Agent; Web and Console nodes manage their own browser User-Agent and cookies. Proxy URLs and Cloudflare cookies are write-only.", add: "Add node", saved: "Proxy node saved", deleted: "Proxy node deleted", name: "Name", scope: "Scope", proxy: "Proxy", clearance: "Clearance", health: "Health", directFallback: "Direct connection is used when no node is configured", scopeBuild: "Grok Build", scopeWeb: "Grok Web", scopeWebAsset: "Grok Web (assets only)", configured: "Configured", direct: "Direct", none: "None", editTitle: "Edit proxy node", addTitle: "Add proxy node", dialogDescription: "Build nodes only configure the proxy and inherit the Provider User-Agent; Web and Console nodes use their own browser User-Agent and Cloudflare cookies.", enabled: "Enabled", proxyURL: "Proxy URL", proxyProtocols: "Supports HTTP, HTTPS, SOCKS4, SOCKS4A, SOCKS5, and SOCKS5H with optional username and password.", userAgent: "User-Agent", cloudflareCookie: "Cloudflare Cookie", keepConfigured: "Configured; leave blank to keep unchanged", operationFailed: "Operation failed" }, routing: { title: "Routing policy", stickyTTL: "Sticky session TTL", cooldownBase: "Base cooldown", cooldownMax: "Maximum cooldown", maxAttempts: "Maximum attempts" }, audit: { title: "Request audit", bufferSize: "Queue capacity", batchSize: "Batch size", flushInterval: "Flush interval" }, clientKeys: { title: "Client key defaults", rpmLimit: "Default RPM", maxConcurrent: "Default concurrency" }, units: { seconds: "Seconds", minutes: "Minutes", hours: "Hours", days: "Days" } }, docs: { title: "API documentation", description: "OpenAI Responses compatibility, account routing, and conversation-state behavior for this gateway.", From 178bfd40c18193f63994f434432e038e5cd41ea8 Mon Sep 17 00:00:00 2001 From: li Date: Tue, 14 Jul 2026 15:41:18 +0800 Subject: [PATCH 10/16] fix: include input_tokens in streaming /v1/messages message_delta event The upstream Responses API only provides usage data in the final response.completed event, but message_start is emitted earlier during response.created when input_tokens is still 0. Add input_tokens to the message_delta usage payload so clients can accurately track input token consumption in streaming mode. Closes #612 --- .../conversation/conversation_test.go | 20 +++++++++++++++++++ .../infra/provider/conversation/stream.go | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/backend/internal/infra/provider/conversation/conversation_test.go b/backend/internal/infra/provider/conversation/conversation_test.go index e6578bb6..53086998 100644 --- a/backend/internal/infra/provider/conversation/conversation_test.go +++ b/backend/internal/infra/provider/conversation/conversation_test.go @@ -455,3 +455,23 @@ func TestConvertResponsesStreamEmitsDoneOnlyToolArguments(t *testing.T) { t.Fatalf("tool block closed multiple times: %s", text) } } + +func TestConvertResponsesStreamMessagesInputTokens(t *testing.T) { + stream := strings.Join([]string{ + `event: response.created`, + `data: {"type":"response.created","response":{"id":"resp_1","model":"grok-4.5","status":"in_progress"}}`, "", + `event: response.output_text.delta`, + `data: {"type":"response.output_text.delta","delta":"hello"}`, "", + `event: response.completed`, + `data: {"type":"response.completed","response":{"id":"resp_1","model":"grok-4.5","status":"completed","usage":{"input_tokens":194,"output_tokens":7}}}`, "", "", + }, "\n") + converted, err := io.ReadAll(ConvertResponseStream(io.NopCloser(strings.NewReader(stream)), OperationMessages)) + if err != nil { + t.Fatal(err) + } + text := string(converted) + + if !strings.Contains(text, `"input_tokens":194`) { + t.Fatalf("message_delta should contain input_tokens from response.completed usage:\n%s", text) + } +} diff --git a/backend/internal/infra/provider/conversation/stream.go b/backend/internal/infra/provider/conversation/stream.go index 7b136810..9f0da8ea 100644 --- a/backend/internal/infra/provider/conversation/stream.go +++ b/backend/internal/infra/provider/conversation/stream.go @@ -413,7 +413,7 @@ func (c *streamConverter) done(status string) error { } if err := c.writeEvent("message_delta", map[string]any{ "type": "message_delta", "delta": map[string]any{"stop_reason": stopReason, "stop_sequence": nullableAnthropicString(c.stopSequence)}, - "usage": map[string]any{"output_tokens": c.usage.OutputTokens}, + "usage": map[string]any{"input_tokens": c.usage.InputTokens, "output_tokens": c.usage.OutputTokens}, }); err != nil { return err } From 56fa0a968eed46dcceedbed5579efe51d73ce4eb Mon Sep 17 00:00:00 2001 From: li Date: Tue, 14 Jul 2026 15:48:20 +0800 Subject: [PATCH 11/16] fix: prevent Basic/Auto accounts from being promoted to Super when rate-limit endpoints are unavailable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When both auto and fast mode rate-limit endpoints fail but weekly credits succeed, resolveWebTierFromQuota unconditionally returned WebTierSuper for any non-Heavy account. This incorrectly elevated free Basic accounts to Super tier, granting access to premium models (expert, auto) they should not have. Preserve the stored tier for already-confirmed Heavy/Super accounts, and keep the current tier (Basic or Auto) unchanged for unconfirmed accounts — weekly credits alone cannot prove a paid subscription. --- backend/internal/infra/provider/web/quota.go | 10 +++++----- backend/internal/infra/provider/web/quota_test.go | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/backend/internal/infra/provider/web/quota.go b/backend/internal/infra/provider/web/quota.go index fb86dd11..46a5b39b 100644 --- a/backend/internal/infra/provider/web/quota.go +++ b/backend/internal/infra/provider/web/quota.go @@ -57,12 +57,12 @@ func resolveWebTierFromQuota(current account.WebTier, windows []account.QuotaWin } return tier, weeklyAvailable && tier != account.WebTierBasic } - // 周额度是付费账号信号,但无法区分 Super/Heavy。只有已确认的 Heavy - // 可以在模式额度暂时不可用时保留,其余账号只授予最低付费等级。 - if current == account.WebTierHeavy { - return account.WebTierHeavy, weeklyAvailable + // 周额度是付费账号信号,但无法区分 Super/Heavy。已确认的等级在模式 + // 额度暂时不可用时保留;未确认(Auto/Basic)的不能凭周额度提权。 + if current == account.WebTierHeavy || current == account.WebTierSuper { + return current, weeklyAvailable } - return account.WebTierSuper, weeklyAvailable + return current, false } // inferWebTierFromQuota 使用 Grok Web /rest/rate-limits 的真实额度形态判级。 diff --git a/backend/internal/infra/provider/web/quota_test.go b/backend/internal/infra/provider/web/quota_test.go index b1e7a104..082cccdb 100644 --- a/backend/internal/infra/provider/web/quota_test.go +++ b/backend/internal/infra/provider/web/quota_test.go @@ -85,6 +85,21 @@ func TestResolveWebTierUsesFreshWebQuotaOverStoredTier(t *testing.T) { if tier != account.WebTierAuto || useWeekly { t.Fatalf("unknown snapshot resolved to %q, weekly=%v", tier, useWeekly) } + + tier, useWeekly = resolveWebTierFromQuota(account.WebTierSuper, nil, true) + if tier != account.WebTierSuper || !useWeekly { + t.Fatalf("super weekly fallback resolved to %q, weekly=%v", tier, useWeekly) + } + + tier, useWeekly = resolveWebTierFromQuota(account.WebTierBasic, nil, true) + if tier != account.WebTierBasic || useWeekly { + t.Fatalf("basic should not be promoted when modes unavailable: got %q, weekly=%v", tier, useWeekly) + } + + tier, useWeekly = resolveWebTierFromQuota(account.WebTierAuto, nil, true) + if tier != account.WebTierAuto || useWeekly { + t.Fatalf("auto should not be promoted when modes unavailable: got %q, weekly=%v", tier, useWeekly) + } } func TestSyncQuotaCorrectsStoredSuperFromFreshWebQuota(t *testing.T) { From b5aad0e43d139ec0e547c54ab02c00dea77ca67a Mon Sep 17 00:00:00 2001 From: li Date: Tue, 14 Jul 2026 15:53:01 +0800 Subject: [PATCH 12/16] fix: improve image generation reliability and prevent resource leaks Three fixes: 1. Image generation now retries with the next account on credential failure or upstream transport error, matching the text completion path. Previously a single broken account would fail the entire request even when healthy accounts were available. 2. Add 30-second timeout to downloadImage. Without a timeout, a stalled connection to assets.grok.com holds a goroutine and lease indefinitely, eventually exhausting the connection pool. 3. Add write deadline to Imagine WebSocket connections. Only a read deadline was set; writes could hang forever if the remote peer stops reading, causing goroutine and connection leaks. --- backend/internal/application/gateway/service.go | 10 ++++++++-- backend/internal/infra/provider/web/image.go | 5 ++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/backend/internal/application/gateway/service.go b/backend/internal/application/gateway/service.go index 02cb1b10..e27a8583 100644 --- a/backend/internal/application/gateway/service.go +++ b/backend/internal/application/gateway/service.go @@ -781,14 +781,14 @@ func (s *Service) executeImage(ctx context.Context, requestID string, key client if err != nil { s.logger.Error("image_credential_failed", "event_id", eventID, "request_id", requestID, "model", externalModel, "provider", route.Provider, "account_id", lease.Credential.ID, "error", err) lease.Release() - return nil, err + continue } response, err = execute(adapter, credential, route.UpstreamModel) if err != nil { s.logger.Error("image_upstream_failed", "event_id", eventID, "request_id", requestID, "model", externalModel, "provider", route.Provider, "account_id", credential.ID, "error", err) s.selector.MarkFailure(ctx, credential, 0, 0) lease.Release() - return nil, err + continue } if s.providers.RetryForbiddenAsEgress(credential.Provider) && response.StatusCode == http.StatusForbidden && attempt == 0 && attempt+1 < attempts { _, _ = readRetryableBody(response.Body) @@ -811,6 +811,12 @@ func (s *Service) executeImage(ctx context.Context, requestID string, key client } break } + if response == nil { + if err != nil { + return nil, fmt.Errorf("%w: %w", ErrNoAvailableAccount, err) + } + return nil, ErrNoAvailableAccount + } if response.StatusCode == http.StatusUnauthorized && credential.AuthType == accountdomain.AuthTypeSSO { _ = s.accounts.MarkReauthRequired(ctx, credential.ID, fmt.Sprintf("%s SSO credential rejected", credential.Provider)) s.selector.MarkFailure(ctx, credential, http.StatusUnauthorized, 0) diff --git a/backend/internal/infra/provider/web/image.go b/backend/internal/infra/provider/web/image.go index 272c08e2..1831388e 100644 --- a/backend/internal/infra/provider/web/image.go +++ b/backend/internal/infra/provider/web/image.go @@ -529,6 +529,7 @@ func (a *Adapter) generateWSImage(ctx context.Context, request provider.ImageGen connection.SetReadLimit(64 << 20) deadline := time.Now().Add(time.Duration(cfg.ImageTimeoutSeconds) * time.Second) _ = connection.SetReadDeadline(deadline) + _ = connection.SetWriteDeadline(deadline) if err := connection.WriteJSON(imagineResetMessage()); err != nil { a.egress.Feedback(context.WithoutCancel(ctx), lease.NodeID, 0, err) return nil, err @@ -1096,7 +1097,9 @@ func (a *Adapter) downloadImage(ctx context.Context, credential account.Credenti return nil, err } defer lease.Release() - request, err := http.NewRequestWithContext(ctx, http.MethodGet, parsed.String(), nil) + downloadCtx, cancel := context.WithTimeout(ctx, 30*time.Second) + defer cancel() + request, err := http.NewRequestWithContext(downloadCtx, http.MethodGet, parsed.String(), nil) if err != nil { return nil, err } From 26081617f58a87a64159f8be19742ce5b43456ad Mon Sep 17 00:00:00 2001 From: li Date: Tue, 14 Jul 2026 15:58:27 +0800 Subject: [PATCH 13/16] chore: increase downloadImage timeout from 30s to 60s Large 2K resolution images (up to 32 MiB) over slower connections could hit the 30s boundary. 60s provides adequate margin while still preventing indefinite hangs. --- backend/internal/infra/provider/web/image.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/internal/infra/provider/web/image.go b/backend/internal/infra/provider/web/image.go index 1831388e..8bd837c8 100644 --- a/backend/internal/infra/provider/web/image.go +++ b/backend/internal/infra/provider/web/image.go @@ -1097,7 +1097,7 @@ func (a *Adapter) downloadImage(ctx context.Context, credential account.Credenti return nil, err } defer lease.Release() - downloadCtx, cancel := context.WithTimeout(ctx, 30*time.Second) + downloadCtx, cancel := context.WithTimeout(ctx, 60*time.Second) defer cancel() request, err := http.NewRequestWithContext(downloadCtx, http.MethodGet, parsed.String(), nil) if err != nil { From 3d5e7de10216d45d0aa4548d941e6e89d3fbd3e7 Mon Sep 17 00:00:00 2001 From: Mas0nShi Date: Tue, 14 Jul 2026 16:16:58 +0800 Subject: [PATCH 14/16] feat(audit): add complete failure diagnostics --- backend/internal/application/audit/service.go | 4 + .../internal/application/gateway/attempt.go | 207 +++++++++++++ .../application/gateway/attempt_test.go | 84 ++++++ .../internal/application/gateway/service.go | 13 +- .../application/gateway/service_test.go | 6 +- backend/internal/domain/audit/audit.go | 39 ++- .../relational/audit_repository.go | 102 ++++++- .../relational/audit_repository_test.go | 60 ++++ .../infra/persistence/relational/mapping.go | 33 ++- .../infra/persistence/relational/models.go | 25 ++ .../infra/persistence/relational/schema.go | 2 + .../internal/infra/provider/cli/adapter.go | 22 +- .../infra/provider/console/adapter.go | 26 +- backend/internal/infra/provider/provider.go | 14 +- backend/internal/infra/provider/web/chat.go | 1 + backend/internal/repository/audit.go | 1 + .../internal/transport/http/audit/handler.go | 76 ++++- .../transport/http/audit/handler_test.go | 81 ++++++ .../audits/request-audit-detail-dialog.tsx | 273 ++++++++++++++++++ .../src/features/audits/request-audits-api.ts | 46 ++- .../features/audits/request-audits-page.tsx | 21 +- frontend/src/shared/i18n/index.ts | 118 +++++++- 22 files changed, 1207 insertions(+), 47 deletions(-) create mode 100644 backend/internal/application/gateway/attempt.go create mode 100644 backend/internal/application/gateway/attempt_test.go create mode 100644 backend/internal/transport/http/audit/handler_test.go create mode 100644 frontend/src/features/audits/request-audit-detail-dialog.tsx diff --git a/backend/internal/application/audit/service.go b/backend/internal/application/audit/service.go index f14bf7aa..fff53abc 100644 --- a/backend/internal/application/audit/service.go +++ b/backend/internal/application/audit/service.go @@ -178,6 +178,10 @@ func (s *Service) List(ctx context.Context, page, pageSize int) ([]auditdomain.R return s.audits.List(ctx, (page-1)*pageSize, pageSize) } +func (s *Service) Get(ctx context.Context, id uint64) (auditdomain.Record, error) { + return s.audits.Get(ctx, id) +} + // CursorResult 表示按递减 ID 游标读取的一页审计记录。 type CursorResult struct { Items []auditdomain.Record diff --git a/backend/internal/application/gateway/attempt.go b/backend/internal/application/gateway/attempt.go new file mode 100644 index 00000000..db5192f3 --- /dev/null +++ b/backend/internal/application/gateway/attempt.go @@ -0,0 +1,207 @@ +package gateway + +import ( + "bytes" + "context" + "crypto/tls" + "crypto/x509" + "errors" + "io" + "net" + "net/url" + "reflect" + "time" + + accountdomain "github.com/chenyme/grok2api/backend/internal/domain/account" + "github.com/chenyme/grok2api/backend/internal/domain/audit" + "github.com/chenyme/grok2api/backend/internal/infra/provider" +) + +type failureAttemptRecorder struct { + method string + path string + attempts []audit.Attempt +} + +func newFailureAttemptRecorder(method, path string) *failureAttemptRecorder { + return &failureAttemptRecorder{method: method, path: path} +} + +func (r *failureAttemptRecorder) captureCredentialFailure(credential accountdomain.Credential, startedAt time.Time, force bool, err error) { + if err == nil { + return + } + stage := "credential_validation" + if force { + stage = "credential_refresh" + } + r.append(audit.Attempt{ + Source: audit.AttemptSourceCredential, + Stage: stage, + AccountID: auditAccountID(credential.ID), + AccountName: credential.Name, + StartedAt: startedAt.UTC(), + DurationMS: time.Since(startedAt).Milliseconds(), + TransportError: err.Error(), + ErrorChain: errorFrames(err), + }) +} + +func (r *failureAttemptRecorder) captureResponse(credential accountdomain.Credential, startedAt time.Time, response *provider.Response, requestErr error) error { + if requestErr != nil { + r.append(audit.Attempt{ + Source: audit.AttemptSourceTransport, + Stage: transportStage(requestErr), + AccountID: auditAccountID(credential.ID), + AccountName: credential.Name, + Method: r.method, + RequestPath: r.path, + UpstreamURL: errorUpstreamURL(requestErr), + StartedAt: startedAt.UTC(), + DurationMS: time.Since(startedAt).Milliseconds(), + TransportError: requestErr.Error(), + ErrorChain: errorFrames(requestErr), + }) + return requestErr + } + if response.StatusCode >= 200 && response.StatusCode < 300 { + return nil + } + + statusCode := response.StatusCode + status := response.Status + headers := response.Header.Clone() + var body []byte + if response.Diagnostic != nil { + statusCode = response.Diagnostic.StatusCode + status = response.Diagnostic.Status + headers = response.Diagnostic.Header.Clone() + body = bytes.Clone(response.Diagnostic.Body) + } else { + var err error + body, err = readResponseBody(response.Body) + response.Body = io.NopCloser(bytes.NewReader(body)) + if err != nil { + r.append(audit.Attempt{ + Source: audit.AttemptSourceUpstreamHTTP, + Stage: "response_body", + AccountID: auditAccountID(credential.ID), + AccountName: credential.Name, + Method: r.method, + RequestPath: r.path, + UpstreamURL: response.UpstreamURL, + StartedAt: startedAt.UTC(), + DurationMS: time.Since(startedAt).Milliseconds(), + UpstreamStatusCode: &statusCode, + UpstreamStatus: status, + ResponseHeaders: headers, + ResponseBody: body, + TransportError: err.Error(), + ErrorChain: errorFrames(err), + }) + return err + } + } + r.append(audit.Attempt{ + Source: audit.AttemptSourceUpstreamHTTP, + Stage: "upstream_response", + AccountID: auditAccountID(credential.ID), + AccountName: credential.Name, + Method: r.method, + RequestPath: r.path, + UpstreamURL: response.UpstreamURL, + StartedAt: startedAt.UTC(), + DurationMS: time.Since(startedAt).Milliseconds(), + UpstreamStatusCode: &statusCode, + UpstreamStatus: status, + ResponseHeaders: headers, + ResponseBody: body, + }) + return nil +} + +func (r *failureAttemptRecorder) append(attempt audit.Attempt) { + attempt.Number = len(r.attempts) + 1 + r.attempts = append(r.attempts, attempt) +} + +func (r *failureAttemptRecorder) snapshot() []audit.Attempt { + return append([]audit.Attempt(nil), r.attempts...) +} + +func auditAccountID(id uint64) *uint64 { + if id == 0 { + return nil + } + return &id +} + +func readResponseBody(body io.ReadCloser) ([]byte, error) { + if body == nil { + return nil, nil + } + defer body.Close() + return io.ReadAll(body) +} + +func errorFrames(err error) []audit.ErrorFrame { + frames := make([]audit.ErrorFrame, 0, 4) + appendErrorFrames(&frames, err) + return frames +} + +func appendErrorFrames(frames *[]audit.ErrorFrame, err error) { + if err == nil { + return + } + *frames = append(*frames, audit.ErrorFrame{Type: reflect.TypeOf(err).String(), Message: err.Error()}) + if joined, ok := err.(interface{ Unwrap() []error }); ok { + for _, nested := range joined.Unwrap() { + appendErrorFrames(frames, nested) + } + return + } + appendErrorFrames(frames, errors.Unwrap(err)) +} + +func errorUpstreamURL(err error) string { + var urlErr *url.Error + if errors.As(err, &urlErr) { + return urlErr.URL + } + return "" +} + +func transportStage(err error) string { + switch { + case errors.Is(err, context.Canceled): + return "request_canceled" + case errors.Is(err, context.DeadlineExceeded): + return "request_timeout" + } + var dnsErr *net.DNSError + if errors.As(err, &dnsErr) { + return "dns_lookup" + } + var certificateError *tls.CertificateVerificationError + if errors.As(err, &certificateError) { + return "tls_verification" + } + var unknownAuthority x509.UnknownAuthorityError + if errors.As(err, &unknownAuthority) { + return "tls_verification" + } + var recordHeaderError tls.RecordHeaderError + if errors.As(err, &recordHeaderError) { + return "tls_handshake" + } + var networkError net.Error + if errors.As(err, &networkError) && networkError.Timeout() { + return "network_timeout" + } + var operationError *net.OpError + if errors.As(err, &operationError) && operationError.Op != "" { + return operationError.Op + } + return "transport" +} diff --git a/backend/internal/application/gateway/attempt_test.go b/backend/internal/application/gateway/attempt_test.go new file mode 100644 index 00000000..a7d80ccb --- /dev/null +++ b/backend/internal/application/gateway/attempt_test.go @@ -0,0 +1,84 @@ +package gateway + +import ( + "context" + "errors" + "io" + "net" + "net/http" + "net/url" + "strings" + "testing" + "time" + + "github.com/chenyme/grok2api/backend/internal/domain/account" + "github.com/chenyme/grok2api/backend/internal/domain/audit" + "github.com/chenyme/grok2api/backend/internal/infra/provider" +) + +func TestFailureAttemptRecorderPreservesCompleteHTTPResponse(t *testing.T) { + body := strings.Repeat("upstream failure\n", 8192) + recorder := newFailureAttemptRecorder(http.MethodPost, "/responses") + response := &provider.Response{ + StatusCode: http.StatusBadGateway, + Status: "502 Bad Gateway", + Header: http.Header{"Content-Type": {"text/plain"}, "X-Debug": {"edge-a", "edge-b"}}, + Body: io.NopCloser(strings.NewReader(body)), + UpstreamURL: "https://api.example.test/v1/responses", + } + if err := recorder.captureResponse(account.Credential{ID: 9, Name: "primary"}, time.Now(), response, nil); err != nil { + t.Fatal(err) + } + stored := recorder.snapshot() + if len(stored) != 1 || stored[0].Source != audit.AttemptSourceUpstreamHTTP || string(stored[0].ResponseBody) != body || len(stored[0].ResponseHeaders["X-Debug"]) != 2 { + t.Fatalf("attempt = %#v", stored) + } + rebuilt, err := io.ReadAll(response.Body) + if err != nil || string(rebuilt) != body { + t.Fatalf("rebuilt body length = %d, err = %v", len(rebuilt), err) + } +} + +func TestFailureAttemptRecorderUsesProviderDiagnosticResponse(t *testing.T) { + recorder := newFailureAttemptRecorder(http.MethodPost, "/responses") + response := &provider.Response{ + StatusCode: http.StatusBadGateway, + Status: "502 Bad Gateway", + Header: http.Header{"Content-Type": {"application/json"}}, + Body: io.NopCloser(strings.NewReader(`{"error":{"message":"normalized"}}`)), + UpstreamURL: "https://api.example.test/v1/responses", + Diagnostic: &provider.DiagnosticResponse{ + StatusCode: http.StatusBadGateway, + Status: "502 Bad Gateway", + Header: http.Header{"Content-Type": {"text/plain"}, "X-Upstream": {"raw"}}, + Body: []byte("complete raw upstream failure"), + }, + } + if err := recorder.captureResponse(account.Credential{ID: 9, Name: "primary"}, time.Now(), response, nil); err != nil { + t.Fatal(err) + } + stored := recorder.snapshot()[0] + if string(stored.ResponseBody) != "complete raw upstream failure" || len(stored.ResponseHeaders["X-Upstream"]) != 1 || stored.ResponseHeaders["X-Upstream"][0] != "raw" { + t.Fatalf("attempt = %#v", stored) + } + converted, err := io.ReadAll(response.Body) + if err != nil || !strings.Contains(string(converted), "normalized") { + t.Fatalf("provider response body = %q, err = %v", converted, err) + } +} + +func TestFailureAttemptRecorderClassifiesTransportErrorChain(t *testing.T) { + dnsErr := &net.DNSError{Err: "no such host", Name: "api.example.test", IsNotFound: true} + requestErr := &url.Error{Op: "Post", URL: "https://api.example.test/v1/responses", Err: dnsErr} + recorder := newFailureAttemptRecorder(http.MethodPost, "/responses") + if err := recorder.captureResponse(account.Credential{ID: 3, Name: "primary"}, time.Now(), nil, requestErr); !errors.Is(err, dnsErr) { + t.Fatalf("capture error = %v", err) + } + stored := recorder.snapshot() + if len(stored) != 1 || stored[0].Stage != "dns_lookup" || stored[0].UpstreamURL != requestErr.URL || len(stored[0].ErrorChain) != 2 { + t.Fatalf("attempt = %#v", stored) + } + if transportStage(context.DeadlineExceeded) != "request_timeout" { + t.Fatalf("deadline stage = %s", transportStage(context.DeadlineExceeded)) + } +} diff --git a/backend/internal/application/gateway/service.go b/backend/internal/application/gateway/service.go index 02cb1b10..32dd7c91 100644 --- a/backend/internal/application/gateway/service.go +++ b/backend/internal/application/gateway/service.go @@ -37,7 +37,6 @@ var ( ErrConversationUnsupported = errors.New("目标模型不支持当前对话协议") ) -const maxRetryableBodyBytes = 64 << 10 const responseOwnershipTTL = 30 * 24 * time.Hour const finalizationTimeout = 5 * time.Second const textBillingReservationTTL = 2 * time.Hour @@ -345,15 +344,18 @@ func (s *Service) createResponseAt(ctx context.Context, input Input, path string quotaProbeAttempted := false var lastErr error var lastFailure *UpstreamFailure + failureAttempts := newFailureAttemptRecorder(http.MethodPost, path) forwardResponse := func(credential accountdomain.Credential) (*provider.Response, error) { started := time.Now() response, err := adapter.ForwardResponse(ctx, provider.ResponseResourceRequest{Credential: credential, Method: http.MethodPost, Path: path, Model: route.UpstreamModel, PromptCacheKey: input.PromptCacheKey, IdempotencyID: idempotencyID, Body: input.Body, Streaming: input.Streaming, NormalizeBody: true, Operation: string(operation)}) + err = failureAttempts.captureResponse(credential, started, response, err) timing.markUpstream(time.Since(started)) return response, err } ensureCredential := func(credential accountdomain.Credential, force bool) (accountdomain.Credential, error) { started := time.Now() result, err := s.accounts.EnsureCredential(ctx, credential, force) + failureAttempts.captureCredentialFailure(credential, started, force, err) timing.markCredential(time.Since(started)) return result, err } @@ -570,6 +572,7 @@ attemptLoop: record.ContextOutputTokens = usage.ContextOutputTokens record.DurationMS = time.Since(startedAt).Milliseconds() record.ErrorCode = errorCode + record.Attempts = failureAttempts.snapshot() record.CreatedAt = now if err := s.audits.Create(persistCtx, record); err != nil { s.logger.Error("request_usage_write_failed", "event_id", record.EventID, "request_id", input.RequestID, "error", err) @@ -610,6 +613,7 @@ attemptLoop: record.StatusCode = lastFailure.HTTPStatus record.DurationMS = time.Since(startedAt).Milliseconds() record.ErrorCode = lastFailure.AuditCode() + record.Attempts = failureAttempts.snapshot() record.CreatedAt = time.Now().UTC() if lastFailure.AccountID != 0 { accountID := lastFailure.AccountID @@ -630,6 +634,7 @@ attemptLoop: record.StatusCode = http.StatusServiceUnavailable record.DurationMS = time.Since(startedAt).Milliseconds() record.ErrorCode = "upstream_unavailable" + record.Attempts = failureAttempts.snapshot() record.CreatedAt = time.Now().UTC() persistCtx, cancel := context.WithTimeout(context.Background(), finalizationTimeout) defer cancel() @@ -959,11 +964,7 @@ func (s *Service) forwardOwnedResponse(ctx context.Context, input ResourceInput, } func readRetryableBody(body io.ReadCloser) ([]byte, error) { - if body == nil { - return nil, nil - } - defer body.Close() - return io.ReadAll(io.LimitReader(body, maxRetryableBodyBytes)) + return readResponseBody(body) } func parseFreeQuotaExhaustion(body []byte) (int64, int64, bool) { diff --git a/backend/internal/application/gateway/service_test.go b/backend/internal/application/gateway/service_test.go index 005ebbf6..c01e4c3e 100644 --- a/backend/internal/application/gateway/service_test.go +++ b/backend/internal/application/gateway/service_test.go @@ -94,9 +94,13 @@ func TestGatewayFailsOverBeforeReturningBody(t *testing.T) { t.Fatalf("observed account = %#v, err = %v", observedAccount, err) } logs, total, err := auditRepo.List(ctx, 0, 10) - if err != nil || total != 1 || logs[0].AccountID == nil || *logs[0].AccountID != second.ID || logs[0].ClientKeyName != "test-key" || logs[0].ModelPublicID != "grok-test" || logs[0].ModelUpstreamModel != "Build/grok-test" || logs[0].AccountName != "second" || logs[0].CachedInputTokens != 80 { + if err != nil || total != 1 || logs[0].AccountID == nil || *logs[0].AccountID != second.ID || logs[0].ClientKeyName != "test-key" || logs[0].ModelPublicID != "grok-test" || logs[0].ModelUpstreamModel != "Build/grok-test" || logs[0].AccountName != "second" || logs[0].CachedInputTokens != 80 || logs[0].AttemptCount != 1 { t.Fatalf("audit = %#v, %d, %v", logs, total, err) } + detail, err := auditRepo.Get(ctx, logs[0].ID) + if err != nil || len(detail.Attempts) != 1 || detail.Attempts[0].Source != audit.AttemptSourceUpstreamHTTP || detail.Attempts[0].UpstreamStatusCode == nil || *detail.Attempts[0].UpstreamStatusCode != http.StatusTooManyRequests || string(detail.Attempts[0].ResponseBody) != "limited" || detail.Attempts[0].AccountID == nil || *detail.Attempts[0].AccountID != first.ID { + t.Fatalf("audit detail = %#v, err = %v", detail, err) + } ownership, err := responseRepo.Get(ctx, "resp-test", clientKey.ID, time.Now().UTC()) if err != nil || ownership.AccountID != second.ID { t.Fatalf("ownership = %#v, err = %v", ownership, err) diff --git a/backend/internal/domain/audit/audit.go b/backend/internal/domain/audit/audit.go index 67ea6afa..08e24ba4 100644 --- a/backend/internal/domain/audit/audit.go +++ b/backend/internal/domain/audit/audit.go @@ -21,7 +21,42 @@ const ( UsageSourceNone UsageSource = "none" ) -// Record 表示不包含提示词和响应正文的推理请求审计记录。 +type AttemptSource string + +const ( + AttemptSourceUpstreamHTTP AttemptSource = "upstream_http" + AttemptSourceTransport AttemptSource = "gateway_transport" + AttemptSourceCredential AttemptSource = "credential" +) + +type ErrorFrame struct { + Type string + Message string +} + +// Attempt 保存一次失败尝试的完整管理员诊断现场。 +type Attempt struct { + ID uint64 + AuditID uint64 + Number int + Source AttemptSource + Stage string + AccountID *uint64 + AccountName string + Method string + RequestPath string + UpstreamURL string + StartedAt time.Time + DurationMS int64 + UpstreamStatusCode *int + UpstreamStatus string + ResponseHeaders map[string][]string + ResponseBody []byte + TransportError string + ErrorChain []ErrorFrame +} + +// Record 表示推理请求审计;成功响应不保存正文,失败尝试仅保留管理员诊断现场。 type Record struct { ID uint64 EventID string @@ -56,6 +91,8 @@ type Record struct { ContextOutputTokens int64 DurationMS int64 ErrorCode string + AttemptCount int + Attempts []Attempt CreatedAt time.Time } diff --git a/backend/internal/infra/persistence/relational/audit_repository.go b/backend/internal/infra/persistence/relational/audit_repository.go index b8224fcf..3cd91c7a 100644 --- a/backend/internal/infra/persistence/relational/audit_repository.go +++ b/backend/internal/infra/persistence/relational/audit_repository.go @@ -3,6 +3,7 @@ package relational import ( "context" "crypto/sha256" + "encoding/json" "errors" "fmt" "math" @@ -20,9 +21,12 @@ type AuditRepository struct{ db *Database } func NewAuditRepository(db *Database) *AuditRepository { return &AuditRepository{db: db} } func (r *AuditRepository) Create(ctx context.Context, value audit.Record) error { - row := toAuditModel(value) + row, attempts, err := toAuditModels(value) + if err != nil { + return err + } return r.db.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error { - return createAuditAndBill(tx, row) + return createAuditAndBill(tx, &row, attempts) }) } @@ -33,12 +37,18 @@ func (r *AuditRepository) CreateBatch(ctx context.Context, values []audit.Record return r.db.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error { insertedRows := make([]requestAuditModel, 0, len(values)) for _, value := range values { - row := toAuditModel(value) - inserted, err := insertAudit(tx, row) + row, attempts, err := toAuditModels(value) + if err != nil { + return err + } + inserted, err := insertAudit(tx, &row) if err != nil { return err } if inserted { + if err := insertAuditAttempts(tx, row.ID, attempts); err != nil { + return err + } insertedRows = append(insertedRows, row) } } @@ -67,7 +77,7 @@ func (r *AuditRepository) CreateBatch(ctx context.Context, values []audit.Record }) } -func toAuditModel(value audit.Record) requestAuditModel { +func toAuditModels(value audit.Record) (requestAuditModel, []requestAuditAttemptModel, error) { provider := value.Provider if provider == "" { provider = "grok_build" @@ -85,7 +95,7 @@ func toAuditModel(value audit.Record) requestAuditModel { digest := sha256.Sum256([]byte(fmt.Sprintf("%s\x00%d\x00%d\x00%d", value.RequestID, value.ClientKeyID, value.ModelRouteID, value.CreatedAt.UnixNano()))) eventID = fmt.Sprintf("evt_%x", digest[:18]) } - return requestAuditModel{ + row := requestAuditModel{ EventID: truncate(eventID, 64), RequestID: truncate(value.RequestID, 64), ClientKeyID: value.ClientKeyID, ClientKeyName: truncate(value.ClientKeyName, 160), ModelRouteID: value.ModelRouteID, ModelPublicID: truncate(value.ModelPublicID, 255), ModelUpstreamModel: truncate(value.ModelUpstreamModel, 255), Provider: truncate(provider, 32), Operation: string(operation), UsageSource: string(usageSource), @@ -96,28 +106,77 @@ func toAuditModel(value audit.Record) requestAuditModel { EstimatedCostInUSDTicks: nonNegative(value.EstimatedCostInUSDTicks), PricingModel: truncate(value.PricingModel, 100), PricingVersion: truncate(value.PricingVersion, 20), NumSourcesUsed: nonNegative(value.NumSourcesUsed), NumServerSideToolsUsed: nonNegative(value.NumServerSideToolsUsed), ContextInputTokens: nonNegative(value.ContextInputTokens), ContextOutputTokens: nonNegative(value.ContextOutputTokens), DurationMS: nonNegative(value.DurationMS), - ErrorCode: truncate(value.ErrorCode, 100), CreatedAt: value.CreatedAt, + ErrorCode: truncate(value.ErrorCode, 100), AttemptCount: len(value.Attempts), CreatedAt: value.CreatedAt, } + attempts := make([]requestAuditAttemptModel, 0, len(value.Attempts)) + for _, attempt := range value.Attempts { + responseHeaders, err := json.Marshal(attempt.ResponseHeaders) + if err != nil { + return requestAuditModel{}, nil, fmt.Errorf("序列化审计响应头: %w", err) + } + if attempt.ResponseHeaders == nil { + responseHeaders = []byte("{}") + } + errorChain, err := json.Marshal(attempt.ErrorChain) + if err != nil { + return requestAuditModel{}, nil, fmt.Errorf("序列化审计错误链: %w", err) + } + if attempt.ErrorChain == nil { + errorChain = []byte("[]") + } + attempts = append(attempts, requestAuditAttemptModel{ + Number: attempt.Number, + Source: string(attempt.Source), + Stage: attempt.Stage, + AccountID: attempt.AccountID, + AccountName: truncate(attempt.AccountName, 160), + Method: truncate(attempt.Method, 16), + RequestPath: attempt.RequestPath, + UpstreamURL: attempt.UpstreamURL, + StartedAt: attempt.StartedAt, + DurationMS: nonNegative(attempt.DurationMS), + UpstreamStatusCode: attempt.UpstreamStatusCode, + UpstreamStatus: truncate(attempt.UpstreamStatus, 128), + ResponseHeadersJSON: string(responseHeaders), + ResponseBody: attempt.ResponseBody, + TransportError: attempt.TransportError, + ErrorChainJSON: string(errorChain), + }) + } + return row, attempts, nil } -func createAuditAndBill(tx *gorm.DB, row requestAuditModel) error { +func createAuditAndBill(tx *gorm.DB, row *requestAuditModel, attempts []requestAuditAttemptModel) error { inserted, err := insertAudit(tx, row) if err != nil || !inserted { return err } + if err := insertAuditAttempts(tx, row.ID, attempts); err != nil { + return err + } var reservation billingReservationModel reservationErr := tx.Where("event_id = ?", row.EventID).First(&reservation).Error if reservationErr != nil && !errors.Is(reservationErr, gorm.ErrRecordNotFound) { return reservationErr } - return billInsertedAudit(tx, row, reservation, reservationErr == nil) + return billInsertedAudit(tx, *row, reservation, reservationErr == nil) } -func insertAudit(tx *gorm.DB, row requestAuditModel) (bool, error) { - result := tx.Clauses(clause.OnConflict{DoNothing: true}).Create(&row) +func insertAudit(tx *gorm.DB, row *requestAuditModel) (bool, error) { + result := tx.Clauses(clause.OnConflict{DoNothing: true}).Create(row) return result.RowsAffected == 1, result.Error } +func insertAuditAttempts(tx *gorm.DB, auditID uint64, attempts []requestAuditAttemptModel) error { + if len(attempts) == 0 { + return nil + } + for index := range attempts { + attempts[index].AuditID = auditID + } + return tx.Create(&attempts).Error +} + func billInsertedAudit(tx *gorm.DB, row requestAuditModel, reservation billingReservationModel, hasReservation bool) error { amount := row.CostInUSDTicks if amount <= 0 { @@ -214,6 +273,27 @@ func (r *AuditRepository) List(ctx context.Context, offset, limit int) ([]audit. return out, total, nil } +func (r *AuditRepository) Get(ctx context.Context, id uint64) (audit.Record, error) { + var row requestAuditModel + if err := r.db.db.WithContext(ctx).First(&row, id).Error; err != nil { + return audit.Record{}, mapError(err) + } + var attemptRows []requestAuditAttemptModel + if err := r.db.db.WithContext(ctx).Where("audit_id = ?", id).Order("number ASC").Find(&attemptRows).Error; err != nil { + return audit.Record{}, err + } + value := toAuditDomain(row) + value.Attempts = make([]audit.Attempt, 0, len(attemptRows)) + for _, attemptRow := range attemptRows { + attempt, err := toAuditAttemptDomain(attemptRow) + if err != nil { + return audit.Record{}, err + } + value.Attempts = append(value.Attempts, attempt) + } + return value, nil +} + // ListCursor 使用“排序值 + ID”复合游标读取审计,避免深分页和同值记录漏读。 func (r *AuditRepository) ListCursor(ctx context.Context, input repository.AuditCursorQuery) ([]audit.Record, bool, error) { query := r.db.db.WithContext(ctx).Model(&requestAuditModel{}) diff --git a/backend/internal/infra/persistence/relational/audit_repository_test.go b/backend/internal/infra/persistence/relational/audit_repository_test.go index bf0d4338..3350ce53 100644 --- a/backend/internal/infra/persistence/relational/audit_repository_test.go +++ b/backend/internal/infra/persistence/relational/audit_repository_test.go @@ -2,6 +2,8 @@ package relational import ( "context" + "errors" + "net/http" "path/filepath" "testing" "time" @@ -190,6 +192,64 @@ func TestAuditRepositoryAllowsRepeatedExternalRequestIDs(t *testing.T) { } } +func TestAuditRepositoryRoundTripsFailureAttempts(t *testing.T) { + ctx := context.Background() + database, err := OpenSQLite(ctx, filepath.Join(t.TempDir(), "audit-attempts.db")) + if err != nil { + t.Fatal(err) + } + defer database.Close() + if err := database.InitializeSchema(ctx); err != nil { + t.Fatal(err) + } + repository := NewAuditRepository(database) + now := time.Now().UTC() + status := http.StatusBadGateway + record := audit.Record{ + EventID: "evt_failure_attempts_0001", RequestID: "failure-attempts", ClientKeyID: 1, ModelRouteID: 1, + StatusCode: http.StatusBadGateway, CreatedAt: now, + Attempts: []audit.Attempt{ + { + Number: 1, Source: audit.AttemptSourceTransport, Stage: "dns_lookup", AccountID: uint64Pointer(7), AccountName: "primary", + Method: http.MethodPost, RequestPath: "/responses", UpstreamURL: "https://api.example.test/v1/responses", StartedAt: now.Add(-2 * time.Second), DurationMS: 125, + TransportError: "lookup api.example.test: no such host", ErrorChain: []audit.ErrorFrame{{Type: "*url.Error", Message: "Post request failed"}, {Type: "*net.DNSError", Message: "no such host"}}, + }, + { + Number: 2, Source: audit.AttemptSourceUpstreamHTTP, Stage: "upstream_response", AccountID: uint64Pointer(8), AccountName: "secondary", + Method: http.MethodPost, RequestPath: "/responses", UpstreamURL: "https://api.example.test/v1/responses", StartedAt: now.Add(-time.Second), DurationMS: 250, + UpstreamStatusCode: &status, UpstreamStatus: "502 Bad Gateway", ResponseHeaders: http.Header{"Content-Type": {"application/json"}, "X-Upstream": {"edge-a", "edge-b"}}, + ResponseBody: []byte{'{', '"', 'e', 'r', 'r', 'o', 'r', '"', ':', ' ', '"', 'f', 'a', 'i', 'l', 'e', 'd', '"', '}', 0xff}, + }, + }, + } + if err := repository.Create(ctx, record); err != nil { + t.Fatal(err) + } + stored, err := repository.Get(ctx, 1) + if err != nil { + t.Fatal(err) + } + if stored.AttemptCount != 2 || len(stored.Attempts) != 2 { + t.Fatalf("attempt count = %d, attempts = %#v", stored.AttemptCount, stored.Attempts) + } + if stored.Attempts[0].Number != 1 || stored.Attempts[0].Stage != "dns_lookup" || len(stored.Attempts[0].ErrorChain) != 2 { + t.Fatalf("transport attempt = %#v", stored.Attempts[0]) + } + httpAttempt := stored.Attempts[1] + if httpAttempt.Number != 2 || httpAttempt.UpstreamStatusCode == nil || *httpAttempt.UpstreamStatusCode != status || string(httpAttempt.ResponseBody) != string(record.Attempts[1].ResponseBody) || len(httpAttempt.ResponseHeaders["X-Upstream"]) != 2 { + t.Fatalf("HTTP attempt = %#v", httpAttempt) + } + if err := repository.Create(ctx, record); err != nil { + t.Fatal(err) + } + if count := tableRowCount(t, database, "request_audit_attempts"); count != 2 { + t.Fatalf("idempotent attempts = %d", count) + } + if _, err := repository.Get(ctx, 999); !errors.Is(err, repositorypkg.ErrNotFound) { + t.Fatalf("missing audit error = %v", err) + } +} + func TestAuditRepositoryNormalizesUntrustedUsage(t *testing.T) { ctx := context.Background() database, err := OpenSQLite(ctx, filepath.Join(t.TempDir(), "audit-normalize.db")) diff --git a/backend/internal/infra/persistence/relational/mapping.go b/backend/internal/infra/persistence/relational/mapping.go index 6fb2aab4..9696b09e 100644 --- a/backend/internal/infra/persistence/relational/mapping.go +++ b/backend/internal/infra/persistence/relational/mapping.go @@ -154,6 +154,37 @@ func toAuditDomain(value requestAuditModel) audit.Record { EstimatedCostInUSDTicks: value.EstimatedCostInUSDTicks, PricingModel: value.PricingModel, PricingVersion: value.PricingVersion, NumSourcesUsed: value.NumSourcesUsed, NumServerSideToolsUsed: value.NumServerSideToolsUsed, ContextInputTokens: value.ContextInputTokens, ContextOutputTokens: value.ContextOutputTokens, DurationMS: value.DurationMS, - ErrorCode: value.ErrorCode, CreatedAt: value.CreatedAt, + ErrorCode: value.ErrorCode, AttemptCount: value.AttemptCount, CreatedAt: value.CreatedAt, } } + +func toAuditAttemptDomain(value requestAuditAttemptModel) (audit.Attempt, error) { + var responseHeaders map[string][]string + if err := json.Unmarshal([]byte(value.ResponseHeadersJSON), &responseHeaders); err != nil { + return audit.Attempt{}, err + } + var errorChain []audit.ErrorFrame + if err := json.Unmarshal([]byte(value.ErrorChainJSON), &errorChain); err != nil { + return audit.Attempt{}, err + } + return audit.Attempt{ + ID: value.ID, + AuditID: value.AuditID, + Number: value.Number, + Source: audit.AttemptSource(value.Source), + Stage: value.Stage, + AccountID: value.AccountID, + AccountName: value.AccountName, + Method: value.Method, + RequestPath: value.RequestPath, + UpstreamURL: value.UpstreamURL, + StartedAt: value.StartedAt, + DurationMS: value.DurationMS, + UpstreamStatusCode: value.UpstreamStatusCode, + UpstreamStatus: value.UpstreamStatus, + ResponseHeaders: responseHeaders, + ResponseBody: value.ResponseBody, + TransportError: value.TransportError, + ErrorChain: errorChain, + }, nil +} diff --git a/backend/internal/infra/persistence/relational/models.go b/backend/internal/infra/persistence/relational/models.go index 9aaeb34c..8c737c6e 100644 --- a/backend/internal/infra/persistence/relational/models.go +++ b/backend/internal/infra/persistence/relational/models.go @@ -280,11 +280,36 @@ type requestAuditModel struct { ContextOutputTokens int64 `gorm:"not null;default:0"` DurationMS int64 `gorm:"not null;default:0"` ErrorCode string `gorm:"size:100;check:chk_request_audits_error_code,length(error_code) <= 100"` + AttemptCount int `gorm:"not null;default:0;check:chk_request_audits_attempt_count,attempt_count >= 0"` CreatedAt time.Time `gorm:"not null"` } func (requestAuditModel) TableName() string { return "request_audits" } +type requestAuditAttemptModel struct { + ID uint64 `gorm:"primaryKey;autoIncrement"` + AuditID uint64 `gorm:"not null;uniqueIndex:uidx_audit_attempt_number;check:chk_request_audit_attempts_audit_id,audit_id > 0"` + Number int `gorm:"not null;uniqueIndex:uidx_audit_attempt_number;check:chk_request_audit_attempts_number,number > 0"` + Source string `gorm:"size:32;not null;check:chk_request_audit_attempts_source,source IN ('upstream_http','gateway_transport','credential')"` + Stage string `gorm:"size:64;not null;check:chk_request_audit_attempts_stage,length(trim(stage)) BETWEEN 1 AND 64"` + AccountID *uint64 `gorm:"check:chk_request_audit_attempts_account_id,account_id IS NULL OR account_id > 0"` + AccountName string `gorm:"size:160;not null;default:'';check:chk_request_audit_attempts_account_name,length(account_name) <= 160"` + Method string `gorm:"size:16;not null;default:'';check:chk_request_audit_attempts_method,length(method) <= 16"` + RequestPath string `gorm:"type:text;not null;default:''"` + UpstreamURL string `gorm:"type:text;not null;default:''"` + StartedAt time.Time `gorm:"not null"` + DurationMS int64 `gorm:"not null;default:0;check:chk_request_audit_attempts_duration,duration_ms >= 0"` + UpstreamStatusCode *int `gorm:"check:chk_request_audit_attempts_status,upstream_status_code IS NULL OR upstream_status_code BETWEEN 100 AND 599"` + UpstreamStatus string `gorm:"size:128;not null;default:'';check:chk_request_audit_attempts_status_text,length(upstream_status) <= 128"` + ResponseHeadersJSON string `gorm:"type:text;not null;default:'{}'"` + ResponseBody []byte + TransportError string `gorm:"type:text;not null;default:''"` + ErrorChainJSON string `gorm:"type:text;not null;default:'[]'"` + Audit *requestAuditModel `gorm:"foreignKey:AuditID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"` +} + +func (requestAuditAttemptModel) TableName() string { return "request_audit_attempts" } + type responseOwnershipModel struct { ResponseID string `gorm:"size:255;primaryKey;check:chk_response_ownership_id,length(response_id) BETWEEN 1 AND 255"` AccountID uint64 `gorm:"not null"` diff --git a/backend/internal/infra/persistence/relational/schema.go b/backend/internal/infra/persistence/relational/schema.go index cac42664..5b8e8753 100644 --- a/backend/internal/infra/persistence/relational/schema.go +++ b/backend/internal/infra/persistence/relational/schema.go @@ -26,6 +26,7 @@ var schemaModels = []any{ &clientKeyModelPermission{}, &billingReservationModel{}, &requestAuditModel{}, + &requestAuditAttemptModel{}, &responseOwnershipModel{}, &webResponseStateModel{}, &mediaJobModel{}, @@ -61,6 +62,7 @@ var schemaIndexes = []string{ "CREATE INDEX IF NOT EXISTS idx_audits_account_created_id ON request_audits(account_id, created_at DESC, id DESC)", "CREATE INDEX IF NOT EXISTS idx_audits_status_created_id ON request_audits(status_code, created_at DESC, id DESC)", "CREATE INDEX IF NOT EXISTS idx_audits_streaming_created_id ON request_audits(streaming, created_at DESC, id DESC)", + "CREATE INDEX IF NOT EXISTS idx_audit_attempts_audit_number ON request_audit_attempts(audit_id, number)", "CREATE INDEX IF NOT EXISTS idx_response_ownership_expires ON response_ownership(expires_at)", "CREATE INDEX IF NOT EXISTS idx_response_ownership_account ON response_ownership(account_id)", "CREATE INDEX IF NOT EXISTS idx_response_ownership_client_key ON response_ownership(client_key_id)", diff --git a/backend/internal/infra/provider/cli/adapter.go b/backend/internal/infra/provider/cli/adapter.go index 42d55faf..62d4e724 100644 --- a/backend/internal/infra/provider/cli/adapter.go +++ b/backend/internal/infra/provider/cli/adapter.go @@ -160,24 +160,38 @@ func (a *Adapter) ForwardResponse(ctx context.Context, request provider.Response resp.Header.Del("Content-Length") resp.Header.Set("Content-Type", "text/event-stream") } else { - data, readErr := io.ReadAll(io.LimitReader(resp.Body, (64<<20)+1)) + var data []byte + var readErr error + if resp.StatusCode >= 200 && resp.StatusCode < 300 { + data, readErr = io.ReadAll(io.LimitReader(resp.Body, (64<<20)+1)) + } else { + data, readErr = io.ReadAll(resp.Body) + } _ = resp.Body.Close() if readErr != nil { return nil, readErr } - if len(data) > 64<<20 { + if resp.StatusCode >= 200 && resp.StatusCode < 300 && len(data) > 64<<20 { return nil, fmt.Errorf("上游对话响应超过 64 MiB") } + var diagnostic *provider.DiagnosticResponse + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + diagnostic = &provider.DiagnosticResponse{StatusCode: resp.StatusCode, Status: resp.Status, Header: resp.Header.Clone(), Body: data} + } converted, convertErr := conversation.ConvertResponseJSONWithOptions(data, request.Operation, conversationOptions) if convertErr != nil { - return nil, convertErr + if diagnostic == nil { + return nil, convertErr + } + return &provider.Response{StatusCode: resp.StatusCode, Status: resp.Status, Header: diagnostic.Header.Clone(), Body: io.NopCloser(bytes.NewReader(data)), UpstreamURL: req.URL.String(), Diagnostic: diagnostic}, nil } resp.Body = io.NopCloser(bytes.NewReader(converted)) resp.Header.Set("Content-Length", strconv.Itoa(len(converted))) resp.Header.Set("Content-Type", "application/json") + return &provider.Response{StatusCode: resp.StatusCode, Status: resp.Status, Header: resp.Header.Clone(), Body: resp.Body, UpstreamURL: req.URL.String(), Diagnostic: diagnostic}, nil } } - return &provider.Response{StatusCode: resp.StatusCode, Status: resp.Status, Header: resp.Header.Clone(), Body: resp.Body}, nil + return &provider.Response{StatusCode: resp.StatusCode, Status: resp.Status, Header: resp.Header.Clone(), Body: resp.Body, UpstreamURL: req.URL.String()}, nil } // invalidResponsesResponse 将本地协议校验错误转换为标准 OpenAI 错误响应,避免触发上游账号重试。 diff --git a/backend/internal/infra/provider/console/adapter.go b/backend/internal/infra/provider/console/adapter.go index 0a9d07e2..804e20de 100644 --- a/backend/internal/infra/provider/console/adapter.go +++ b/backend/internal/infra/provider/console/adapter.go @@ -184,20 +184,29 @@ func (a *Adapter) ForwardResponse(ctx context.Context, request provider.Response response.Header.Set("Content-Type", "text/event-stream") return responseResult(response, &releaseBody{ReadCloser: response.Body, release: release}), nil } - data, readErr := io.ReadAll(io.LimitReader(response.Body, (64<<20)+1)) + var data []byte + var readErr error + if response.StatusCode >= 200 && response.StatusCode < 300 { + data, readErr = io.ReadAll(io.LimitReader(response.Body, (64<<20)+1)) + } else { + data, readErr = io.ReadAll(response.Body) + } _ = response.Body.Close() release() if readErr != nil { return nil, readErr } - if len(data) > 64<<20 { + if response.StatusCode >= 200 && response.StatusCode < 300 && len(data) > 64<<20 { return nil, fmt.Errorf("Console 对话响应超过 64 MiB") } if response.StatusCode < 200 || response.StatusCode >= 300 { + diagnostic := &provider.DiagnosticResponse{StatusCode: response.StatusCode, Status: response.Status, Header: response.Header.Clone(), Body: data} converted := normalizeConversationError(data, request.Operation, response.StatusCode) response.Header.Set("Content-Length", strconv.Itoa(len(converted))) response.Header.Set("Content-Type", "application/json") - return responseResult(response, io.NopCloser(bytes.NewReader(converted))), nil + result := responseResult(response, io.NopCloser(bytes.NewReader(converted))) + result.Diagnostic = diagnostic + return result, nil } converted, convertErr := conversation.ConvertResponseJSONWithOptions(data, request.Operation, conversationOptions) if convertErr != nil { @@ -294,13 +303,10 @@ func applyHeaders(request *http.Request, token, configuredUserAgent string, leas } func normalizeRateLimitResponse(response *http.Response) error { - data, err := io.ReadAll(io.LimitReader(response.Body, (1<<20)+1)) + data, err := io.ReadAll(response.Body) if err != nil { return err } - if len(data) > 1<<20 { - return fmt.Errorf("Console 错误响应超过 1 MiB") - } _ = response.Body.Close() response.Body = io.NopCloser(bytes.NewReader(data)) response.ContentLength = int64(len(data)) @@ -314,8 +320,12 @@ func normalizeRateLimitResponse(response *http.Response) error { } func responseResult(response *http.Response, body io.ReadCloser) *provider.Response { + upstreamURL := "" + if response.Request != nil && response.Request.URL != nil { + upstreamURL = response.Request.URL.String() + } return &provider.Response{ - StatusCode: response.StatusCode, Status: response.Status, Header: response.Header.Clone(), Body: body, QuotaUnits: 1, + StatusCode: response.StatusCode, Status: response.Status, Header: response.Header.Clone(), Body: body, QuotaUnits: 1, UpstreamURL: upstreamURL, } } diff --git a/backend/internal/infra/provider/provider.go b/backend/internal/infra/provider/provider.go index 2439c8ec..1b46b62b 100644 --- a/backend/internal/infra/provider/provider.go +++ b/backend/internal/infra/provider/provider.go @@ -66,11 +66,21 @@ type ResponseResourceRequest struct { // Response 表示尚未写入下游的上游响应。 type Response struct { + StatusCode int + Status string + Header http.Header + Body io.ReadCloser + QuotaUnits int + UpstreamURL string + Diagnostic *DiagnosticResponse +} + +// DiagnosticResponse 保留 Provider 转换前的原始失败响应。 +type DiagnosticResponse struct { StatusCode int Status string Header http.Header - Body io.ReadCloser - QuotaUnits int + Body []byte } // DeviceAuthorization 表示 Device OAuth 启动结果。 diff --git a/backend/internal/infra/provider/web/chat.go b/backend/internal/infra/provider/web/chat.go index bc892d1b..25cc1b03 100644 --- a/backend/internal/infra/provider/web/chat.go +++ b/backend/internal/infra/provider/web/chat.go @@ -165,6 +165,7 @@ func (a *Adapter) ForwardResponse(ctx context.Context, request provider.Response } return &provider.Response{ StatusCode: upstream.StatusCode, Status: upstream.Status, Header: http.Header(upstream.Header), + UpstreamURL: upstream.Request.URL.String(), Body: &releaseBody{ReadCloser: upstream.Body, release: func() { a.egress.Feedback(context.WithoutCancel(ctx), lease.NodeID, upstream.StatusCode, nil) lease.Release() diff --git a/backend/internal/repository/audit.go b/backend/internal/repository/audit.go index be710f59..a29e56d0 100644 --- a/backend/internal/repository/audit.go +++ b/backend/internal/repository/audit.go @@ -11,6 +11,7 @@ import ( type AuditRepository interface { Create(ctx context.Context, value audit.Record) error CreateBatch(ctx context.Context, values []audit.Record) error + Get(ctx context.Context, id uint64) (audit.Record, error) List(ctx context.Context, offset, limit int) ([]audit.Record, int64, error) ListCursor(ctx context.Context, query AuditCursorQuery) ([]audit.Record, bool, error) Summarize(ctx context.Context, query AuditSummaryQuery) (audit.Summary, error) diff --git a/backend/internal/transport/http/audit/handler.go b/backend/internal/transport/http/audit/handler.go index 302cc5c6..73d87e39 100644 --- a/backend/internal/transport/http/audit/handler.go +++ b/backend/internal/transport/http/audit/handler.go @@ -1,10 +1,12 @@ package audit import ( + "encoding/base64" "errors" "net/http" "strconv" "time" + "unicode/utf8" auditapp "github.com/chenyme/grok2api/backend/internal/application/audit" auditdomain "github.com/chenyme/grok2api/backend/internal/domain/audit" @@ -20,6 +22,7 @@ func NewHandler(service *auditapp.Service) *Handler { return &Handler{service: s func (h *Handler) Register(router *gin.RouterGroup) { router.GET("/request-audits", h.list) router.GET("/request-audits/summary", h.summary) + router.GET("/request-audits/:id", h.get) } type auditResponse struct { @@ -55,9 +58,41 @@ type auditResponse struct { ContextOutputTokens int64 `json:"contextOutputTokens"` DurationMS int64 `json:"durationMs"` ErrorCode string `json:"errorCode,omitempty"` + AttemptCount int `json:"attemptCount"` CreatedAt time.Time `json:"createdAt"` } +type auditAttemptResponse struct { + ID uint64 `json:"id,string"` + Number int `json:"number"` + Source string `json:"source"` + Stage string `json:"stage"` + AccountID *uint64 `json:"accountId,string,omitempty"` + AccountName string `json:"accountName,omitempty"` + Method string `json:"method,omitempty"` + RequestPath string `json:"requestPath,omitempty"` + UpstreamURL string `json:"upstreamUrl,omitempty"` + StartedAt time.Time `json:"startedAt"` + DurationMS int64 `json:"durationMs"` + UpstreamStatusCode *int `json:"upstreamStatusCode,omitempty"` + UpstreamStatus string `json:"upstreamStatus,omitempty"` + ResponseHeaders map[string][]string `json:"responseHeaders"` + ResponseBody string `json:"responseBody"` + ResponseBodyEncoding string `json:"responseBodyEncoding"` + TransportError string `json:"transportError,omitempty"` + ErrorChain []auditErrorFrameResponse `json:"errorChain"` +} + +type auditErrorFrameResponse struct { + Type string `json:"type"` + Message string `json:"message"` +} + +type auditDetailResponse struct { + Audit auditResponse `json:"audit"` + Attempts []auditAttemptResponse `json:"attempts"` +} + func (h *Handler) list(c *gin.Context) { if c.Query("pagination") == "cursor" { h.listCursor(c) @@ -112,6 +147,45 @@ func (h *Handler) listCursor(c *gin.Context) { response.Success(c, http.StatusOK, gin.H{"items": items, "pageSize": pageSize, "nextCursor": result.NextCursor, "hasMore": result.HasMore}) } +func (h *Handler) get(c *gin.Context) { + id, err := strconv.ParseUint(c.Param("id"), 10, 64) + if err != nil || id == 0 { + response.Error(c, http.StatusBadRequest, "invalidId", "审计 ID 无效") + return + } + value, err := h.service.Get(c.Request.Context(), id) + if errors.Is(err, repository.ErrNotFound) { + response.Error(c, http.StatusNotFound, "auditNotFound", "审计记录不存在") + return + } + if err != nil { + response.Error(c, http.StatusInternalServerError, "auditDetailFailed", "读取审计详情失败") + return + } + attempts := make([]auditAttemptResponse, 0, len(value.Attempts)) + for _, attempt := range value.Attempts { + body := string(attempt.ResponseBody) + encoding := "utf8" + if !utf8.Valid(attempt.ResponseBody) { + body = base64.StdEncoding.EncodeToString(attempt.ResponseBody) + encoding = "base64" + } + errorChain := make([]auditErrorFrameResponse, 0, len(attempt.ErrorChain)) + for _, frame := range attempt.ErrorChain { + errorChain = append(errorChain, auditErrorFrameResponse{Type: frame.Type, Message: frame.Message}) + } + attempts = append(attempts, auditAttemptResponse{ + ID: attempt.ID, Number: attempt.Number, Source: string(attempt.Source), Stage: attempt.Stage, + AccountID: attempt.AccountID, AccountName: attempt.AccountName, Method: attempt.Method, RequestPath: attempt.RequestPath, + UpstreamURL: attempt.UpstreamURL, StartedAt: attempt.StartedAt, DurationMS: attempt.DurationMS, + UpstreamStatusCode: attempt.UpstreamStatusCode, UpstreamStatus: attempt.UpstreamStatus, + ResponseHeaders: attempt.ResponseHeaders, ResponseBody: body, ResponseBodyEncoding: encoding, + TransportError: attempt.TransportError, ErrorChain: errorChain, + }) + } + response.Success(c, http.StatusOK, auditDetailResponse{Audit: newAuditResponse(value), Attempts: attempts}) +} + type summaryResponse struct { Period string `json:"period"` GeneratedAt time.Time `json:"generatedAt"` @@ -202,6 +276,6 @@ func newAuditResponse(value auditdomain.Record) auditResponse { EstimatedCostInUSDTicks: value.EstimatedCostInUSDTicks, PricingModel: value.PricingModel, PricingVersion: value.PricingVersion, NumSourcesUsed: value.NumSourcesUsed, NumServerSideToolsUsed: value.NumServerSideToolsUsed, ContextInputTokens: value.ContextInputTokens, ContextOutputTokens: value.ContextOutputTokens, DurationMS: value.DurationMS, - ErrorCode: value.ErrorCode, CreatedAt: value.CreatedAt, + ErrorCode: value.ErrorCode, AttemptCount: value.AttemptCount, CreatedAt: value.CreatedAt, } } diff --git a/backend/internal/transport/http/audit/handler_test.go b/backend/internal/transport/http/audit/handler_test.go new file mode 100644 index 00000000..afaf533c --- /dev/null +++ b/backend/internal/transport/http/audit/handler_test.go @@ -0,0 +1,81 @@ +package audit + +import ( + "context" + "encoding/base64" + "encoding/json" + "log/slog" + "net/http" + "net/http/httptest" + "path/filepath" + "testing" + "time" + + auditapp "github.com/chenyme/grok2api/backend/internal/application/audit" + auditdomain "github.com/chenyme/grok2api/backend/internal/domain/audit" + "github.com/chenyme/grok2api/backend/internal/infra/persistence/relational" + "github.com/gin-gonic/gin" +) + +func TestAuditDetailReturnsCompleteTextAndBinaryBodies(t *testing.T) { + gin.SetMode(gin.TestMode) + ctx := context.Background() + database, err := relational.OpenSQLite(ctx, filepath.Join(t.TempDir(), "audit-handler.db")) + if err != nil { + t.Fatal(err) + } + defer database.Close() + if err := database.InitializeSchema(ctx); err != nil { + t.Fatal(err) + } + repository := relational.NewAuditRepository(database) + now := time.Now().UTC() + status := http.StatusBadGateway + if err := repository.Create(ctx, auditdomain.Record{ + EventID: "evt_audit_handler_0001", RequestID: "request-detail", ClientKeyID: 1, ModelRouteID: 1, StatusCode: status, CreatedAt: now, + Attempts: []auditdomain.Attempt{ + {Number: 1, Source: auditdomain.AttemptSourceUpstreamHTTP, Stage: "upstream_response", StartedAt: now, UpstreamStatusCode: &status, ResponseHeaders: http.Header{"Content-Type": {"application/json"}}, ResponseBody: []byte(`{"error":"complete"}`)}, + {Number: 2, Source: auditdomain.AttemptSourceUpstreamHTTP, Stage: "upstream_response", StartedAt: now, UpstreamStatusCode: &status, ResponseHeaders: http.Header{}, ResponseBody: []byte{0x00, 0xff, 0x01}}, + }, + }); err != nil { + t.Fatal(err) + } + service := auditapp.NewService(repository, slog.Default(), 8, 4, time.Second) + router := gin.New() + NewHandler(service).Register(router.Group("/api/admin/v1")) + + recorder := httptest.NewRecorder() + router.ServeHTTP(recorder, httptest.NewRequest(http.MethodGet, "/api/admin/v1/request-audits/1", nil)) + if recorder.Code != http.StatusOK { + t.Fatalf("status = %d, body = %s", recorder.Code, recorder.Body.String()) + } + var payload struct { + Data struct { + Audit struct { + AttemptCount int `json:"attemptCount"` + } `json:"audit"` + Attempts []struct { + ResponseBody string `json:"responseBody"` + ResponseBodyEncoding string `json:"responseBodyEncoding"` + } `json:"attempts"` + } `json:"data"` + } + if err := json.Unmarshal(recorder.Body.Bytes(), &payload); err != nil { + t.Fatal(err) + } + if payload.Data.Audit.AttemptCount != 2 || len(payload.Data.Attempts) != 2 { + t.Fatalf("payload = %#v", payload) + } + if payload.Data.Attempts[0].ResponseBodyEncoding != "utf8" || payload.Data.Attempts[0].ResponseBody != `{"error":"complete"}` { + t.Fatalf("text body = %#v", payload.Data.Attempts[0]) + } + if payload.Data.Attempts[1].ResponseBodyEncoding != "base64" || payload.Data.Attempts[1].ResponseBody != base64.StdEncoding.EncodeToString([]byte{0x00, 0xff, 0x01}) { + t.Fatalf("binary body = %#v", payload.Data.Attempts[1]) + } + + missing := httptest.NewRecorder() + router.ServeHTTP(missing, httptest.NewRequest(http.MethodGet, "/api/admin/v1/request-audits/999", nil)) + if missing.Code != http.StatusNotFound { + t.Fatalf("missing status = %d, body = %s", missing.Code, missing.Body.String()) + } +} diff --git a/frontend/src/features/audits/request-audit-detail-dialog.tsx b/frontend/src/features/audits/request-audit-detail-dialog.tsx new file mode 100644 index 00000000..ec452ea7 --- /dev/null +++ b/frontend/src/features/audits/request-audit-detail-dialog.tsx @@ -0,0 +1,273 @@ +import { useQuery } from "@tanstack/react-query"; +import { Braces, Clock, FileText, KeyRound, Network, Server, TriangleAlert } from "lucide-react"; +import { useState, type ReactNode } from "react"; +import { useTranslation } from "react-i18next"; + +import { Badge } from "@/components/ui/badge"; +import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@/components/ui/dialog"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { getRequestAudit, type AuditAttemptDTO, type AuditDTO } from "@/features/audits/request-audits-api"; +import { CopyButton } from "@/shared/components/copy-button"; +import { ErrorState, LoadingState } from "@/shared/components/data-state"; +import { cn } from "@/shared/lib/cn"; +import { formatDateTime, formatNumber } from "@/shared/lib/format"; + +export function RequestAuditDetailDialog({ audit, open, onOpenChange }: { audit: AuditDTO | null; open: boolean; onOpenChange: (open: boolean) => void }) { + const { t, i18n } = useTranslation(); + const [selectedNumber, setSelectedNumber] = useState(null); + const detailQuery = useQuery({ + queryKey: ["request-audits", "detail", audit?.id], + queryFn: () => getRequestAudit(audit?.id ?? ""), + enabled: open && audit !== null, + }); + + const attempts = detailQuery.data?.attempts ?? []; + const selectedAttempt = attempts.find((attempt) => attempt.number === selectedNumber) ?? attempts[0]; + + return ( + + + +
+ {t("audits.detailTitle")} + {audit ? : null} + {audit?.errorCode ? {audit.errorCode} : null} +
+ + {audit?.requestId} + {audit ? {formatDateTime(audit.createdAt, i18n.language)} : null} + {audit ? {t("audits.failedAttemptCount", { count: audit.attemptCount })} : null} + +
+ + {detailQuery.isPending ? : null} + {detailQuery.isError ? void detailQuery.refetch()} /> : null} + {detailQuery.data ? ( + attempts.length > 0 && selectedAttempt ? ( +
+ + +
+ ) : ( +
+ +

{t("audits.noFailureAttempts")}

+ {detailQuery.data.audit.errorCode ? {detailQuery.data.audit.errorCode} : null} +
+ ) + ) : null} +
+
+ ); +} + +function AttemptButton({ attempt, locale, selected, onClick }: { attempt: AuditAttemptDTO; locale: string; selected: boolean; onClick: () => void }) { + const { t } = useTranslation(); + const Icon = attempt.source === "upstream_http" ? Server : attempt.source === "gateway_transport" ? Network : KeyRound; + return ( + + ); +} + +function AttemptDetail({ attempt }: { attempt: AuditAttemptDTO }) { + const { t } = useTranslation(); + const headersText = JSON.stringify(attempt.responseHeaders, null, 2); + const errorChainText = JSON.stringify(attempt.errorChain, null, 2); + return ( +
+ + +
+ + {t("audits.overview")} + {t("audits.responseBody")} + {t("audits.responseHeaders")} + {t("audits.errorChain")} + +
+ + + + + + + + + + + + +
+
+ ); +} + +function DiagnosticBanner({ attempt }: { attempt: AuditAttemptDTO }) { + const { t } = useTranslation(); + const isHTTP = attempt.source === "upstream_http"; + const Icon = isHTTP ? Server : attempt.source === "gateway_transport" ? Network : KeyRound; + const title = isHTTP + ? t("audits.upstreamHttpFailure", { status: attempt.upstreamStatusCode ?? "-" }) + : attempt.source === "gateway_transport" ? t("audits.gatewayTransportFailure") : t("audits.credentialFailure"); + const description = isHTTP ? t("audits.upstreamResponseReceived") : t("audits.noUpstreamResponse"); + return ( +
+ +
+

{title}

+

{description}

+
+ {attempt.stage} +
+ ); +} + +function AttemptOverview({ attempt }: { attempt: AuditAttemptDTO }) { + const { t, i18n } = useTranslation(); + return ( +
+
+ + + + + + +
+ + {attempt.transportError ? : null} +
+ ); +} + +function InfoCard({ label, value, mono }: { label: string; value: string; mono?: boolean }) { + return ( +
+

{label}

+

{value}

+
+ ); +} + +function DetailField({ label, value, mono, copy }: { label: string; value: string; mono?: boolean; copy?: boolean }) { + return ( +
+
+ {label} + {copy ? : null} +
+

{value}

+
+ ); +} + +function CodePanel({ value, displayValue, emptyMessage, encoding }: { value: string; displayValue: string; emptyMessage: string; encoding: string }) { + const { t } = useTranslation(); + if (!value) return } message={emptyMessage} />; + return ( +
+
+ {t("audits.bodyEncoding", { encoding })} + +
+
{displayValue}
+
+ ); +} + +function HeadersPanel({ headers, copyValue }: { headers: Record; copyValue: string }) { + const { t } = useTranslation(); + const entries = Object.entries(headers); + if (entries.length === 0) return } message={t("audits.emptyResponseHeaders")} />; + return ( +
+
+ {t("audits.headerCount", { count: entries.length })} + +
+
+ {entries.map(([name, values]) => ( +
+ {name} +
{values.map((value, index) => {value})}
+
+ ))} +
+
+ ); +} + +function ErrorChainPanel({ attempt, copyValue }: { attempt: AuditAttemptDTO; copyValue: string }) { + const { t } = useTranslation(); + if (attempt.errorChain.length === 0) return } message={t("audits.emptyErrorChain")} />; + return ( +
+
+ {t("audits.errorFrameCount", { count: attempt.errorChain.length })} + +
+
    + {attempt.errorChain.map((frame, index) => ( +
  1. +
    #{index + 1}{frame.type}
    +
    {frame.message}
    +
  2. + ))} +
+
+ ); +} + +function EmptyPanel({ icon, message }: { icon: ReactNode; message: string }) { + return
{icon}

{message}

; +} + +function formattedResponseBody(attempt: AuditAttemptDTO): string { + if (attempt.responseBodyEncoding !== "utf8") return attempt.responseBody; + const contentType = Object.entries(attempt.responseHeaders).find(([name]) => name.toLowerCase() === "content-type")?.[1].join(";") ?? ""; + if (!contentType.toLowerCase().includes("json")) return attempt.responseBody; + try { + return JSON.stringify(JSON.parse(attempt.responseBody), null, 2); + } catch { + return attempt.responseBody; + } +} + +function sourceLabel(attempt: AuditAttemptDTO, t: (key: string, options?: Record) => string): string { + if (attempt.source === "upstream_http") return t("audits.upstreamHttpFailure", { status: attempt.upstreamStatusCode ?? "-" }); + if (attempt.source === "gateway_transport") return t("audits.gatewayTransportFailure"); + return t("audits.credentialFailure"); +} + +function StatusBadge({ statusCode }: { statusCode: number }) { + const className = statusCode >= 500 + ? "bg-red-500/10 text-red-700 dark:text-red-300" + : statusCode >= 400 ? "bg-amber-500/10 text-amber-700 dark:text-amber-300" + : statusCode >= 200 && statusCode < 300 ? "bg-emerald-500/10 text-emerald-700 dark:text-emerald-300" : "bg-muted text-muted-foreground"; + return {statusCode}; +} diff --git a/frontend/src/features/audits/request-audits-api.ts b/frontend/src/features/audits/request-audits-api.ts index abe02cbd..d4ca19db 100644 --- a/frontend/src/features/audits/request-audits-api.ts +++ b/frontend/src/features/audits/request-audits-api.ts @@ -1,5 +1,5 @@ import { apiRequest } from "@/shared/api/client"; -import { createObjectDecoder, hasShape, isArrayOf, isBoolean, isNumber, isOneOf, isOptional, isString } from "@/shared/api/decoder"; +import { createObjectDecoder, hasShape, isArrayOf, isBoolean, isNumber, isOneOf, isOptional, isRecordOf, isString } from "@/shared/api/decoder"; import type { PeriodValue } from "@/shared/lib/period"; import type { SortOrder } from "@/shared/lib/table-sort"; @@ -38,9 +38,36 @@ export type AuditDTO = { contextOutputTokens: number; durationMs: number; errorCode?: string; + attemptCount: number; createdAt: string; }; +export type AuditAttemptDTO = { + id: string; + number: number; + source: "upstream_http" | "gateway_transport" | "credential"; + stage: string; + accountId?: string; + accountName?: string; + method?: string; + requestPath?: string; + upstreamUrl?: string; + startedAt: string; + durationMs: number; + upstreamStatusCode?: number; + upstreamStatus?: string; + responseHeaders: Record; + responseBody: string; + responseBodyEncoding: "utf8" | "base64"; + transportError?: string; + errorChain: Array<{ type: string; message: string }>; +}; + +export type AuditDetailDTO = { + audit: AuditDTO; + attempts: AuditAttemptDTO[]; +}; + export type AuditCursorPageDTO = { items: AuditDTO[]; pageSize: number; @@ -84,7 +111,14 @@ const auditValidator = hasShape({ cachedInputTokens: isNumber, outputTokens: isNumber, reasoningTokens: isNumber, totalTokens: isNumber, costInUsdTicks: isNumber, estimatedCostInUsdTicks: isNumber, pricingModel: isOptional(isString), pricingVersion: isOptional(isString), numSourcesUsed: isNumber, numServerSideToolsUsed: isNumber, contextInputTokens: isNumber, contextOutputTokens: isNumber, - durationMs: isNumber, errorCode: isOptional(isString), createdAt: isString, + durationMs: isNumber, errorCode: isOptional(isString), attemptCount: isNumber, createdAt: isString, +}); +const auditAttemptValidator = hasShape({ + id: isString, number: isNumber, source: isOneOf("upstream_http", "gateway_transport", "credential"), stage: isString, + accountId: isOptional(isString), accountName: isOptional(isString), method: isOptional(isString), requestPath: isOptional(isString), upstreamUrl: isOptional(isString), + startedAt: isString, durationMs: isNumber, upstreamStatusCode: isOptional(isNumber), upstreamStatus: isOptional(isString), + responseHeaders: isRecordOf(isArrayOf(isString)), responseBody: isString, responseBodyEncoding: isOneOf("utf8", "base64"), + transportError: isOptional(isString), errorChain: isArrayOf(hasShape({ type: isString, message: isString })), }); const decodeAuditPage = createObjectDecoder("audit page", { items: isArrayOf(auditValidator), pageSize: isNumber, nextCursor: isString, hasMore: isBoolean, @@ -100,6 +134,10 @@ const decodeAuditSummary = createObjectDecoder("audit summary", source: isString, asOf: isString, pricedRequests: isNumber, unpricedRequests: isNumber, pricedTokens: isNumber, unpricedTokens: isNumber, }), }); +const decodeAuditDetail = createObjectDecoder("audit detail", { + audit: auditValidator, + attempts: isArrayOf(auditAttemptValidator), +}); type AuditQuery = { cursor?: string; @@ -142,3 +180,7 @@ export function getRequestAuditSummary(input: Omit { + return apiRequest(`/api/admin/v1/request-audits/${id}`, {}, decodeAuditDetail); +} diff --git a/frontend/src/features/audits/request-audits-page.tsx b/frontend/src/features/audits/request-audits-page.tsx index addb1572..04b3803a 100644 --- a/frontend/src/features/audits/request-audits-page.tsx +++ b/frontend/src/features/audits/request-audits-page.tsx @@ -10,6 +10,7 @@ import { Spinner } from "@/components/ui/spinner"; import { Table, TableBody, TableCell, TableHeader, TableRow } from "@/components/ui/table"; import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; import { listModels } from "@/entities/model/model-api"; +import { RequestAuditDetailDialog } from "@/features/audits/request-audit-detail-dialog"; import { getRequestAudits, getRequestAuditSummary, type AuditDTO, type AuditPeriod } from "@/features/audits/request-audits-api"; import { EmptyState, ErrorState, TableLoadingRow } from "@/shared/components/data-state"; import { DataTableShell } from "@/shared/components/data-table-shell"; @@ -36,6 +37,7 @@ export function RequestAuditsPage() { const [periodDays, setPeriodDays] = useState(1); const [sort, setSort] = useState({ field: "createdAt", order: "desc" }); const [manualRefreshing, setManualRefreshing] = useState(false); + const [selectedAudit, setSelectedAudit] = useState(null); const forceSummaryRefresh = useRef(false); const debouncedSearch = useDebouncedValue(search); const debouncedKeyFilter = useDebouncedValue(keyFilter); @@ -158,8 +160,8 @@ export function RequestAuditsPage() { - - + + @@ -192,7 +194,7 @@ export function RequestAuditsPage() { - + setSelectedAudit(audit)} /> {audit.streaming ? "Stream" : "Non-Stream"} {formatNumber(audit.durationMs, i18n.language)} ms {formatDateTime(audit.createdAt, i18n.language)} @@ -202,6 +204,7 @@ export function RequestAuditsPage() { ) : null} + !open && setSelectedAudit(null)} /> ); } @@ -350,17 +353,19 @@ function StatusBadge({ statusCode }: { statusCode: number }) { return {statusCode || "-"}; } -function AuditStatus({ statusCode, errorCode }: { statusCode: number; errorCode?: string }) { - if (!errorCode) return ; +function AuditStatus({ audit, onOpen }: { audit: AuditDTO; onOpen: () => void }) { + const { t } = useTranslation(); + if (!audit.errorCode && audit.attemptCount === 0) return ; return ( - - {errorCode} + {audit.errorCode || t("audits.openDiagnostics")} ); diff --git a/frontend/src/shared/i18n/index.ts b/frontend/src/shared/i18n/index.ts index 0baac1b8..ced74624 100644 --- a/frontend/src/shared/i18n/index.ts +++ b/frontend/src/shared/i18n/index.ts @@ -396,7 +396,7 @@ const resources = { }, audits: { title: "请求审计", - description: "仅记录路由、状态、耗时和用量明细,不保存请求或响应正文。", + description: "成功请求仅记录路由、状态、耗时和用量;失败请求会为管理员完整保留上游响应与网关错误现场。", search: "搜索请求 ID 或模型", request: "请求 ID", route: "路由", @@ -442,6 +442,36 @@ const resources = { costUsd: "成本 ${{value}}", sources: "来源 {{count}}", serverTools: "调用服务端工具 {{count}} 次", + detailTitle: "请求诊断详情", + failedAttemptCount: "{{count}} 次失败", + attemptTimeline: "失败尝试", + noFailureAttempts: "该请求没有可用的失败尝试诊断。", + attemptNumber: "尝试 #{{number}}", + openDiagnostics: "查看完整诊断", + viewDetails: "查看详情", + overview: "概览", + responseBody: "响应 Body", + responseHeaders: "响应 Headers", + errorChain: "Error Chain", + upstreamHttpFailure: "上游 HTTP {{status}}", + gatewayTransportFailure: "网关 Transport 错误", + credentialFailure: "凭据处理错误", + upstreamResponseReceived: "已收到上游 HTTP 响应;下方保留完整 Headers 与 Body。", + noUpstreamResponse: "网关未收到上游 HTTP 响应;请根据阶段、目标 URL 与完整错误链排查。", + attemptStartedAt: "开始时间", + requestMethod: "请求方法", + requestPath: "请求路径", + upstreamStatus: "上游状态", + upstreamUrl: "上游 URL", + upstreamUrlUnavailable: "未生成或无法从错误中解析上游 URL", + transportError: "完整 Transport Error", + attemptError: "完整错误", + emptyResponseBody: "上游未返回响应 Body。", + emptyResponseHeaders: "没有可用的响应 Headers。", + emptyErrorChain: "该次尝试没有 Error Chain。", + bodyEncoding: "原始内容编码:{{encoding}}", + headerCount: "{{count}} 个 Header", + errorFrameCount: "{{count}} 层错误", }, settings: { title: "运行设置", @@ -713,7 +743,91 @@ const resources = { accounts: { title: "Upstream accounts", description: "Manage separate Grok Build OAuth and Grok Web SSO pools, health, concurrency, and quotas.", add: "Connect account", connectAccount: "Connect account", convertToBuild: "Convert to Build", convertToBuildTitle: "Convert Grok Web accounts to Build?", convertToBuildDescription: "The selected {{count}} accounts will use SSO to complete Device OAuth automatically. Linked accounts are skipped and conversion may take a moment.", convertingProgress: "Converting {{completed}} / {{total}}", syncingProgress: "Syncing {{completed}} / {{total}}", conversionCompleted: "Conversion complete: {{created}} created, {{linked}} linked, {{skipped}} skipped, {{failed}} failed", linkedAccountTooltip: "Linked account: {{name}}", syncAll: "Sync all", renewAll: "Renew all", syncAllTitle: "Sync all accounts?", syncAllDescription: "Refresh quota data for every enabled Grok Build account.", syncAllWebDescription: "Refresh real quota data for every enabled Grok Web account.", renewAllTitle: "Renew all accounts?", renewAllDescription: "Refresh every renewable Grok Build credential. Accounts without automatic renewal will be skipped.", search: "Search accounts", deviceLogin: "Device OAuth", importAuth: "Import account files", importSSO: "Import SSO JSON", quickImportSSO: "Quick import SSO", importWebFile: "Import account files", quickImportTitle: "Quick import Grok Web accounts", quickImportDescription: "Paste multiple SSO tokens directly. Duplicate entries are ignored.", ssoTokens: "SSO tokens (one per line)", ssoTokenPlaceholder: "sso_token_1\nsso_token_2\nsso=token_3", importAction: "Import", exportAuth: "Export all accounts", exported: "Account credentials exported", exportTitle: "Export all account credentials?", exportDescription: "The exported JSON contains OAuth credentials that can access the upstream service. Store it only in a trusted location and never upload, share, or commit it to version control.", refreshAllBilling: "Sync all quotas", account: "Account", status: "Status", type: "Type", quota: "Quota", routing: "Routing", credentialExpiry: "Credential expiry", credentialRenewal: "Renewal capability", autoRefresh: "Auto-renewal", noAutoRefresh: "No auto-renewal", buildAccountCount: "Grok Build accounts", webAccountCount: "Grok Web accounts", consoleAccountCount: "Grok Console accounts", abnormalAccountCount: "Abnormal accounts", routableAccountCount: "{{count}} routable", abnormalAccountBreakdown: "Recovering {{recovering}} · Needs attention {{attention}}", lastUsed: "Last used", createdAt: "Created at", name: "Name", priority: "Priority", maxConcurrent: "Max concurrency", minimumRemaining: "Minimum remaining threshold", routingSummary: "Priority {{priority}} · {{count}} concurrent", minimumRemainingSummary: "Minimum remaining {{value}}", minimumRemainingNotApplicable: "Minimum remaining does not apply to Free", refreshToken: "Refresh credential", refreshBilling: "Sync quota", refreshModeQuota: "Sync quota", quotaNotSynced: "Not synced", quotaResetAt: "Next reset {{time}}", quotaResetUnknown: "The upstream did not return a reset time", webQuotaUsage: "Used {{used}} / {{total}} total · {{remaining}} remaining", webModeQuotaRemaining: "{{mode}} has {{remaining}} calls remaining", webWeeklyQuotaUsage: "Weekly quota {{remaining}}% remaining", paidQuotaDetails: "{{remaining}} credits remaining", created: "Account connected", createdWithSyncFailure: "Account connected, but initial quota or model sync failed", updated: "Account updated", deleted: "Account deleted", imported: "Import complete: {{created}} created, {{updated}} updated", importedWithSyncFailures: "Import complete: {{created}} created, {{updated}} updated; {{synced}} synced, {{syncFailed}} failed initial sync", billingRefreshed: "Quota synced", authRefreshed: "Credential refreshed", allBillingRefreshed: "Sync complete: {{succeeded}} succeeded, {{failed}} failed", allTokensRefreshed: "Renewal complete: {{succeeded}} succeeded, {{failed}} failed, {{skipped}} skipped", statusDisabled: "Disabled", statusReauthRequired: "Invalid", statusCooldown: "Cooling", statusActive: "Normal", quotaFree: "Free", quotaSuper: "Super", quotaPaid: "Super", quotaUnknown: "Unknown", paidQuotaUsage: "Upstream quota usage", weeklyQuota: "Weekly", monthlyQuota: "Monthly", weeklyLimit: "Weekly limit {{percent}}% remaining", freeObservedUsage: "{{used}} tokens observed in the last 24 hours", freeEstimatedUsage: "About {{used}} / {{limit}} tokens", freeEstimatedDescription: "Estimated from observed Grok Build Free characteristics; upstream exhaustion data takes precedence", observedRolling: "Free accounts use this proxy's rolling observation and may differ from upstream billing data", upstreamConfirmed: "Exhaustion confirmed by upstream", waitingReset: "Waiting reset", waitingResetUntil: "Waiting for reset · probe after {{time}} on real traffic", paidWaitingResetUntil: "Waiting for reset · check the upstream Billing period after {{time}}", probing: "Probing", probingQuota: "Checking quota recovery with real traffic", paidProbingQuota: "Checking whether the upstream Billing period has recovered", upstreamBilling: "Upstream billing data", deviceTitle: "Connect Grok Build", deviceDescription: "Complete authorization in a new window. This page will check status automatically.", userCode: "Device code", openVerification: "Open authorization", waiting: "Waiting for authorization", expiresAt: "Expires {{time}}", deleteTitle: "Delete account?", deleteDescription: "Credentials and quota snapshots will be removed. This cannot be undone.", batchUpdated: "Selected accounts updated", batchBillingRefreshed: "Quota sync complete: {{succeeded}} succeeded, {{failed}} failed", batchDeleteTitle: "Delete {{count}} selected accounts?" }, models: { title: "Model routes", description: "Map one client-facing model name to provider-specific Build, Web, and Console routes.", sync: "Sync models", search: "Search models", model: "Public model name", publicId: "Public model name", upstream: "Upstream model", provider: "Model source", providerGrokBuild: "Grok Build", providerGrokWeb: "Grok Web", accountSupport: "Supported accounts", lastSyncedAt: "Last synced", capability: "Account model capabilities", supportSummary: "{{supported}} available / {{total}} total", awaitingCapabilitySync: "Awaiting model capability sync", unknownCapability: "Pending sync", partialCapability: "Awaiting remaining accounts", available: "Available", unavailable: "Unavailable", status: "Status", create: "Add model", createTitle: "Add model route", createDescription: "Add a custom Grok Build route. The public model name has no source prefix; the upstream model uses Build/ to identify its actual channel.", editTitle: "Edit model route", bindAccounts: "Bind specific accounts", boundAccounts: "Bound accounts", bindAccountsDescription: "When enabled, only selected accounts are routed and treated as manually confirmed to support the model. Otherwise model sync decides automatically.", searchAccounts: "Search account name or ID", selectedAccounts: "{{count}} accounts selected", selectAccountRequired: "Select at least one account", noBindableAccounts: "No accounts from this provider can be bound", deleteTitle: "Delete model route?", deleteDescription: "This removes {{name}} and its client-key permissions. A later sync recreates it if upstream accounts still support the model.", batchDeleteTitle: "Delete {{count}} selected model routes?", batchDeleteDescription: "This removes the selected routes and their client-key permissions. Models still supported by upstream accounts are recreated on a later sync.", synced: "Synced {{count}} models", created: "Model route created", updated: "Model route updated", deleted: "Model route deleted", batchDeleted: "Deleted {{count}} model routes", batchUpdated: "Selected models updated" }, keys: { title: "Client keys", description: "Control downstream model access, RPM, concurrency, billed usage, and expiration.", search: "Search keys", create: "Create key", name: "Name", prefix: "Key", limits: "Limits", rpmLimit: "RPM limit", concurrencyLimit: "Concurrency limit", rpmShort: "RPM", concurrencyShort: "Concurrency", billingLimit: "Usage limit", models: "Allowed models", status: "Status", statusActive: "Active", statusExpired: "Expired", modelScope: "Model scope", restrictedModels: "Selected models", expires: "Expires", lastUsed: "Last used", rpm: "Requests per minute", maxConcurrent: "Max concurrency", rpmValue: "{{value}} RPM", concurrentValue: "{{value}} concurrent", unlimited: "Unlimited", billedUsage: "{{value}} billed", billingLimitDescription: "Accumulates billed request audits, preferring upstream-reported cost and otherwise using the official price estimate.", allModels: "All models", modelSearch: "Search models. Leave blank to allow all models.", selectedModels: "{{count}} models selected", neverExpires: "Never expires", clearExpiry: "Clear expiration", expiryTime: "Expiration time", createTitle: "Create client key", editTitle: "Edit client key", secretTitle: "Client key created", secretDescription: "Store this key securely.", secretLabel: "Key", copySecret: "Copy", copySecretTitle: "Copy key", copySecretDescription: "Use the button below to copy your key.", secretReady: "Ready", created: "Client key created", updated: "Client key updated", deleted: "Client key deleted", deleteTitle: "Delete client key?", deleteDescription: "All downstream requests using this key will stop immediately.", batchUpdated: "Selected keys updated", batchDeleteTitle: "Delete {{count}} selected keys?" }, - audits: { title: "Request audits", description: "Stores routing, status, latency, and usage details only. Request and response bodies are never saved.", search: "Search request ID or model", request: "Request ID", route: "Route", status: "Status", mode: "Mode", tokens: "Details", billing: "Billing", duration: "Duration", createdAt: "Time", stream: "Streaming", nonStream: "Non-streaming", cursorPage: "Page {{page}}", key: "Key", keyFilterPlaceholder: "Enter key name or ID", model: "Model", account: "Account", accountFilterPlaceholder: "Enter account name or ID", owningAccount: "Account", owningKey: "Client key", routeDetails: "View routing details", statusSuccess: "Success", statusClientError: "Client error", statusServerError: "Server error", usageSummary: "Usage summary", totalRequests: "Total requests", requestBreakdown: "{{success}} succeeded · {{failed}} failed", totalTokens: "Total tokens", tokenEfficiency: "Cache hit rate {{cacheRate}}%", tokenBreakdown: "Input {{input}} · Output {{output}} · Cached {{cached}} · Reasoning {{reasoning}}", successRate: "Success rate", averageDuration: "Average duration {{duration}}", estimatedCost: "Estimated cost", pricingCoverage: "{{priced}} priced · {{unpriced}} unpriced", pricingDescription: "Calculated using the latest official xAI model prices. Models without a listed price are excluded.", total: "Total", input: "Input", output: "Output", mediaInput: "Media Input", imageCount: "{{count}} images", secondsCount: "{{count}} sec", cached: "Cached", reasoning: "Reasoning", costUsd: "Cost ${{value}}", sources: "Sources {{count}}", serverTools: "Server tools called {{count}} times" }, + audits: { + title: "Request audits", + description: "Successful requests store routing, status, latency, and usage only. Failed requests retain the complete upstream response and gateway error diagnostics for administrators.", + search: "Search request ID or model", + request: "Request ID", + route: "Route", + status: "Status", + mode: "Mode", + tokens: "Details", + billing: "Billing", + duration: "Duration", + createdAt: "Time", + stream: "Streaming", + nonStream: "Non-streaming", + cursorPage: "Page {{page}}", + key: "Key", + keyFilterPlaceholder: "Enter key name or ID", + model: "Model", + account: "Account", + accountFilterPlaceholder: "Enter account name or ID", + owningAccount: "Account", + owningKey: "Client key", + routeDetails: "View routing details", + statusSuccess: "Success", + statusClientError: "Client error", + statusServerError: "Server error", + usageSummary: "Usage summary", + totalRequests: "Total requests", + requestBreakdown: "{{success}} succeeded · {{failed}} failed", + totalTokens: "Total tokens", + tokenEfficiency: "Cache hit rate {{cacheRate}}%", + tokenBreakdown: "Input {{input}} · Output {{output}} · Cached {{cached}} · Reasoning {{reasoning}}", + successRate: "Success rate", + averageDuration: "Average duration {{duration}}", + estimatedCost: "Estimated cost", + pricingCoverage: "{{priced}} priced · {{unpriced}} unpriced", + pricingDescription: "Calculated using the latest official xAI model prices. Models without a listed price are excluded.", + total: "Total", + input: "Input", + output: "Output", + mediaInput: "Media Input", + imageCount: "{{count}} images", + secondsCount: "{{count}} sec", + cached: "Cached", + reasoning: "Reasoning", + costUsd: "Cost ${{value}}", + sources: "Sources {{count}}", + serverTools: "Server tools called {{count}} times", + detailTitle: "Request diagnostics", + failedAttemptCount: "{{count}} failed", + failedAttemptCount_one: "{{count}} failed attempt", + failedAttemptCount_other: "{{count}} failed attempts", + attemptTimeline: "Failed attempts", + noFailureAttempts: "No failed-attempt diagnostics are available for this request.", + attemptNumber: "Attempt #{{number}}", + openDiagnostics: "View complete diagnostics", + viewDetails: "View details", + overview: "Overview", + responseBody: "Response body", + responseHeaders: "Response headers", + errorChain: "Error chain", + upstreamHttpFailure: "Upstream HTTP {{status}}", + gatewayTransportFailure: "Gateway transport error", + credentialFailure: "Credential processing error", + upstreamResponseReceived: "An upstream HTTP response was received. Complete headers and body are retained below.", + noUpstreamResponse: "The gateway did not receive an upstream HTTP response. Use the stage, target URL, and complete error chain to diagnose it.", + attemptStartedAt: "Started at", + requestMethod: "Method", + requestPath: "Request path", + upstreamStatus: "Upstream status", + upstreamUrl: "Upstream URL", + upstreamUrlUnavailable: "No upstream URL was generated or parsed from the error", + transportError: "Complete transport error", + attemptError: "Complete error", + emptyResponseBody: "The upstream returned no response body.", + emptyResponseHeaders: "No response headers are available.", + emptyErrorChain: "This attempt has no error chain.", + bodyEncoding: "Original content encoding: {{encoding}}", + headerCount: "{{count}} headers", + headerCount_one: "{{count}} header", + headerCount_other: "{{count}} headers", + errorFrameCount: "{{count}} error frames", + errorFrameCount_one: "{{count}} error frame", + errorFrameCount_other: "{{count}} error frames", + }, settings: { title: "Runtime settings", description: "Manage hot-reloadable gateway runtime parameters.", saved: "Settings saved and applied", restartRequired: "Restart required", invalidValue: "Enter a valid value", durationUnit: "Duration unit", groups: { providers: "Providers", delivery: "Media & network", policies: "Runtime policies" }, provider: { title: "Grok Build provider", baseURL: "Upstream URL", clientVersion: "Client version", clientIdentifier: "Client identifier", tokenAuth: "Token auth", userAgent: "User-Agent", recommendedVersion: "Recommended {{version}}", syncRecommendedVersion: "Sync recommended version", recommendedVersionApplied: "Recommended version active", syncRecommendedVersionDescription: "Fill in the backend version and User-Agent that passed compatibility regression; save to apply." }, web: { title: "Grok Web", baseURL: "Upstream URL", statsigMode: "x-statsig source", statsigManual: "Manual", statsigURL: "Fetch from URL", statsigValue: "x-statsig-id", statsigConfigured: "Configured", statsigKeepConfigured: "Leave blank to keep the current value", statsigValuePlaceholder: "Paste x-statsig-id", statsigSignerURL: "Signer URL", quotaTimeout: "Quota timeout", chatTimeout: "Chat timeout", imageTimeout: "Image timeout", videoTimeout: "Video timeout", mediaConcurrency: "Media job concurrency", recoveryBackoffBase: "Quota recovery backoff", recoveryBackoffMax: "Maximum recovery backoff", allowNSFW: "Allow NSFW images" }, batch: { title: "Batch tasks", importConcurrency: "Import sync concurrency", conversionConcurrency: "Account conversion concurrency", syncConcurrency: "Data sync concurrency", refreshConcurrency: "Credential refresh concurrency", randomDelay: "Maximum random delay (ms)" }, media: { title: "Media storage", maxImageSize: "Maximum image size", maxTotalSize: "Media storage limit", cleanupThresholdPercent: "Automatic cleanup threshold", cleanupInterval: "Capacity check interval", sizeUnit: "Storage unit" }, egress: { title: "Egress proxies", description: "Nodes manage proxy and health independently for Grok Build, Grok Web, or Web assets. Build inherits the Provider User-Agent; Web nodes manage their own browser User-Agent and cookies. Proxy URLs and Cloudflare cookies are write-only.", add: "Add node", saved: "Proxy node saved", deleted: "Proxy node deleted", name: "Name", scope: "Scope", proxy: "Proxy", clearance: "Clearance", health: "Health", directFallback: "Direct connection is used when no node is configured", scopeBuild: "Grok Build", scopeWeb: "Grok Web", scopeWebAsset: "Grok Web (assets only)", configured: "Configured", direct: "Direct", none: "None", editTitle: "Edit proxy node", addTitle: "Add proxy node", dialogDescription: "Build nodes only configure the proxy and inherit the Provider User-Agent; Web nodes use their own browser User-Agent and Cloudflare cookies.", enabled: "Enabled", proxyURL: "Proxy URL", proxyProtocols: "Supports HTTP, HTTPS, SOCKS4, SOCKS4A, SOCKS5, and SOCKS5H with optional username and password.", userAgent: "User-Agent", cloudflareCookie: "Cloudflare Cookie", keepConfigured: "Configured; leave blank to keep unchanged", operationFailed: "Operation failed" }, routing: { title: "Routing policy", stickyTTL: "Sticky session TTL", cooldownBase: "Base cooldown", cooldownMax: "Maximum cooldown", maxAttempts: "Maximum attempts" }, audit: { title: "Request audit", bufferSize: "Queue capacity", batchSize: "Batch size", flushInterval: "Flush interval" }, clientKeys: { title: "Client key defaults", rpmLimit: "Default RPM", maxConcurrent: "Default concurrency" }, units: { seconds: "Seconds", minutes: "Minutes", hours: "Hours", days: "Days" } }, docs: { title: "API documentation", From d439bd71a2ac1ff3da572206ad7d778e4a15344b Mon Sep 17 00:00:00 2001 From: Chenyme <118253778+chenyme@users.noreply.github.com> Date: Tue, 14 Jul 2026 17:01:51 +0800 Subject: [PATCH 15/16] refactor: enhance media job and asset management with improved querying and statistics aggregation --- .../application/gateway/video_test.go | 7 +- backend/internal/application/media/service.go | 63 +- .../relational/media_repository.go | 76 +- .../relational/media_repository_test.go | 91 +- .../internal/infra/provider/cli/normalize.go | 2 +- .../infra/provider/conversation/request.go | 2 +- backend/internal/repository/media.go | 38 +- backend/internal/transport/http/media/dto.go | 40 + .../internal/transport/http/media/handler.go | 58 +- .../transport/http/media/handler_test.go | 34 + frontend/package-lock.json | 4827 ----------------- frontend/src/features/media/gallery-page.tsx | 23 +- frontend/src/features/media/media-api.ts | 3 +- .../src/features/media/video-gallery-page.tsx | 5 +- 14 files changed, 303 insertions(+), 4966 deletions(-) create mode 100644 backend/internal/transport/http/media/dto.go delete mode 100644 frontend/package-lock.json diff --git a/backend/internal/application/gateway/video_test.go b/backend/internal/application/gateway/video_test.go index 335d67ef..f3bad936 100644 --- a/backend/internal/application/gateway/video_test.go +++ b/backend/internal/application/gateway/video_test.go @@ -9,6 +9,7 @@ import ( "github.com/chenyme/grok2api/backend/internal/domain/audit" "github.com/chenyme/grok2api/backend/internal/domain/media" + "github.com/chenyme/grok2api/backend/internal/repository" ) func TestRecoverVideoJobsRetriesUsageWithoutRegeneratingVideo(t *testing.T) { @@ -82,10 +83,14 @@ func (r *videoUsageRepository) GetMediaJob(context.Context, string, uint64) (med func (r *videoUsageRepository) UpdateMediaJob(context.Context, media.Job) error { return nil } -func (r *videoUsageRepository) ListMediaJobs(context.Context, int, int, string) ([]media.Job, int64, error) { +func (r *videoUsageRepository) ListMediaJobs(context.Context, repository.MediaJobListQuery) ([]media.Job, int64, error) { return nil, 0, nil } +func (r *videoUsageRepository) SummarizeMediaJobs(context.Context) (repository.MediaJobStats, error) { + return repository.MediaJobStats{}, nil +} + func (r *videoUsageRepository) ListRecoverableMediaJobs(context.Context, int) ([]media.Job, error) { return nil, nil } diff --git a/backend/internal/application/media/service.go b/backend/internal/application/media/service.go index 7786fb4e..e4eec7fb 100644 --- a/backend/internal/application/media/service.go +++ b/backend/internal/application/media/service.go @@ -23,6 +23,7 @@ import ( var ( ErrAssetNotFound = errors.New("媒体资源不存在") ErrInvalidImage = errors.New("图片内容无效") + ErrInvalidFilter = errors.New("媒体筛选条件无效") ErrMediaJobsUnavailable = errors.New("视频任务仓储未配置") ) @@ -152,29 +153,32 @@ func (s *Service) OpenImage(ctx context.Context, id string) (mediadomain.Asset, } // AdminListImages 分页返回图片资源列表。 -func (s *Service) AdminListImages(ctx context.Context, page, pageSize int) ([]mediadomain.Asset, int64, error) { - return s.assets.ListMediaAssets(ctx, page, pageSize) +func (s *Service) AdminListImages(ctx context.Context, page, pageSize int, search string) ([]mediadomain.Asset, int64, error) { + return s.assets.ListMediaAssets(ctx, repository.MediaAssetListQuery{Page: mediaPageQuery(page, pageSize, search, repository.SortQuery{})}) } // AdminListVideoJobs 分页返回视频任务列表。 -func (s *Service) AdminListVideoJobs(ctx context.Context, page, pageSize int, status string) ([]mediadomain.Job, int64, error) { +func (s *Service) AdminListVideoJobs(ctx context.Context, page, pageSize int, search, status string, sort repository.SortQuery) ([]mediadomain.Job, int64, error) { if s.jobs == nil { return nil, 0, ErrMediaJobsUnavailable } - return s.jobs.ListMediaJobs(ctx, page, pageSize, strings.TrimSpace(status)) + status = strings.TrimSpace(status) + if !validMediaStatus(status) || !repository.IsValidSort(sort, "prompt", "model", "status", "progress", "spec", "account", "createdAt", "completedAt") { + return nil, 0, ErrInvalidFilter + } + return s.jobs.ListMediaJobs(ctx, repository.MediaJobListQuery{ + Page: mediaPageQuery(page, pageSize, search, sort), + Filter: repository.MediaJobListFilter{Status: status}, + }) } // AdminImageStats 返回图片统计信息。 func (s *Service) AdminImageStats(ctx context.Context) (ImageStats, error) { - totalImages, err := s.assets.CountMediaAssets(ctx) + stats, err := s.assets.SummarizeMediaAssets(ctx) if err != nil { return ImageStats{}, err } - totalBytes, err := s.assets.TotalMediaAssetBytes(ctx) - if err != nil { - return ImageStats{}, err - } - return ImageStats{TotalImages: totalImages, TotalBytes: totalBytes}, nil + return ImageStats{TotalImages: stats.TotalImages, TotalBytes: stats.TotalBytes}, nil } // AdminVideoStats 返回视频任务统计信息。 @@ -182,29 +186,36 @@ func (s *Service) AdminVideoStats(ctx context.Context) (VideoStats, error) { if s.jobs == nil { return VideoStats{}, ErrMediaJobsUnavailable } - var stats VideoStats - var err error - _, stats.TotalJobs, err = s.jobs.ListMediaJobs(ctx, 1, 1, "") + stats, err := s.jobs.SummarizeMediaJobs(ctx) if err != nil { return VideoStats{}, err } - _, stats.Completed, err = s.jobs.ListMediaJobs(ctx, 1, 1, string(mediadomain.StatusCompleted)) - if err != nil { - return VideoStats{}, err + return VideoStats{ + TotalJobs: stats.TotalJobs, Completed: stats.Completed, Failed: stats.Failed, + InProgress: stats.InProgress, Queued: stats.Queued, + }, nil +} + +func mediaPageQuery(page, pageSize int, search string, sort repository.SortQuery) repository.PageQuery { + if page < 1 { + page = 1 } - _, stats.Failed, err = s.jobs.ListMediaJobs(ctx, 1, 1, string(mediadomain.StatusFailed)) - if err != nil { - return VideoStats{}, err + if pageSize < 1 { + pageSize = 20 } - _, stats.InProgress, err = s.jobs.ListMediaJobs(ctx, 1, 1, string(mediadomain.StatusInProgress)) - if err != nil { - return VideoStats{}, err + if pageSize > 100 { + pageSize = 100 } - _, stats.Queued, err = s.jobs.ListMediaJobs(ctx, 1, 1, string(mediadomain.StatusQueued)) - if err != nil { - return VideoStats{}, err + return repository.PageQuery{Offset: (page - 1) * pageSize, Limit: pageSize, Search: strings.TrimSpace(search), Sort: sort} +} + +func validMediaStatus(status string) bool { + switch mediadomain.Status(status) { + case "", mediadomain.StatusQueued, mediadomain.StatusInProgress, mediadomain.StatusCompleted, mediadomain.StatusFailed: + return true + default: + return false } - return stats, nil } // RunCleanup 响应容量阈值并按周期清理最旧媒体资源。 diff --git a/backend/internal/infra/persistence/relational/media_repository.go b/backend/internal/infra/persistence/relational/media_repository.go index e741af26..8385283b 100644 --- a/backend/internal/infra/persistence/relational/media_repository.go +++ b/backend/internal/infra/persistence/relational/media_repository.go @@ -2,6 +2,7 @@ package relational import ( "context" + "strings" "time" "github.com/chenyme/grok2api/backend/internal/domain/media" @@ -37,15 +38,19 @@ func (r *MediaAssetRepository) GetMediaAsset(ctx context.Context, id string) (me }, nil } -func (r *MediaAssetRepository) ListMediaAssets(ctx context.Context, page, pageSize int) ([]media.Asset, int64, error) { - page, pageSize = normalizeMediaPagination(page, pageSize) +// ListMediaAssets 通过字段投影返回符合筛选条件的稳定分页结果。 +func (r *MediaAssetRepository) ListMediaAssets(ctx context.Context, input repository.MediaAssetListQuery) ([]media.Asset, int64, error) { query := r.db.db.WithContext(ctx).Model(&mediaAssetModel{}) + if search := strings.TrimSpace(input.Page.Search); search != "" { + pattern := "%" + strings.ToLower(search) + "%" + query = query.Where("LOWER(id) LIKE ? OR LOWER(kind) LIKE ? OR LOWER(mime_type) LIKE ? OR LOWER(sha256) LIKE ?", pattern, pattern, pattern, pattern) + } var total int64 if err := query.Count(&total).Error; err != nil { return nil, 0, err } var rows []mediaAssetModel - if err := query.Order("created_at DESC, id DESC").Offset((page - 1) * pageSize).Limit(pageSize).Find(&rows).Error; err != nil { + if err := query.Select("id", "kind", "mime_type", "size_bytes", "sha256", "created_at").Order("created_at DESC, id DESC").Offset(input.Page.Offset).Limit(input.Page.Limit).Find(&rows).Error; err != nil { return nil, 0, err } values := make([]media.Asset, 0, len(rows)) @@ -58,10 +63,13 @@ func (r *MediaAssetRepository) ListMediaAssets(ctx context.Context, page, pageSi return values, total, nil } -func (r *MediaAssetRepository) CountMediaAssets(ctx context.Context) (int64, error) { - var count int64 - err := r.db.db.WithContext(ctx).Model(&mediaAssetModel{}).Count(&count).Error - return count, err +// SummarizeMediaAssets 通过单次聚合查询返回图片数量和存储占用。 +func (r *MediaAssetRepository) SummarizeMediaAssets(ctx context.Context) (repository.MediaAssetStats, error) { + var stats repository.MediaAssetStats + err := r.db.db.WithContext(ctx).Model(&mediaAssetModel{}). + Select("COUNT(*) AS total_images, COALESCE(SUM(size_bytes), 0) AS total_bytes"). + Scan(&stats).Error + return stats, err } func (r *MediaAssetRepository) TotalMediaAssetBytes(ctx context.Context) (int64, error) { @@ -127,18 +135,35 @@ func (r *MediaJobRepository) UpdateMediaJob(ctx context.Context, value media.Job return nil } -func (r *MediaJobRepository) ListMediaJobs(ctx context.Context, page, pageSize int, status string) ([]media.Job, int64, error) { - page, pageSize = normalizeMediaPagination(page, pageSize) +// ListMediaJobs 通过固定搜索字段和排序白名单返回稳定分页结果。 +func (r *MediaJobRepository) ListMediaJobs(ctx context.Context, input repository.MediaJobListQuery) ([]media.Job, int64, error) { query := r.db.db.WithContext(ctx).Model(&mediaJobModel{}) - if status != "" { - query = query.Where("status = ?", status) + if input.Filter.Status != "" { + query = query.Where("status = ?", input.Filter.Status) + } + if search := strings.TrimSpace(input.Page.Search); search != "" { + pattern := "%" + strings.ToLower(search) + "%" + query = query.Where("LOWER(id) LIKE ? OR LOWER(prompt) LIKE ? OR LOWER(model) LIKE ? OR LOWER(account_name) LIKE ? OR LOWER(client_key_name) LIKE ?", pattern, pattern, pattern, pattern, pattern) } var total int64 if err := query.Count(&total).Error; err != nil { return nil, 0, err } var rows []mediaJobModel - if err := query.Order("created_at DESC, id DESC").Offset((page - 1) * pageSize).Limit(pageSize).Find(&rows).Error; err != nil { + query = applyStableSort(query, input.Page.Sort, map[string]sortSpec{ + "prompt": {expression: "LOWER(prompt)"}, + "model": {expression: "LOWER(model)"}, + "status": {expression: "status"}, + "progress": {expression: "progress", defaultDirection: repository.SortDescending}, + "spec": {expression: "LOWER(size) || ' ' || LOWER(quality)"}, + "account": {expression: "LOWER(account_name)"}, + "createdAt": {expression: "created_at", defaultDirection: repository.SortDescending}, + "completedAt": {expression: "completed_at", nullsLast: true, defaultDirection: repository.SortDescending}, + }, sortSpec{expression: "created_at", defaultDirection: repository.SortDescending}, "id") + if err := query.Select( + "id", "client_key_name", "account_name", "model", "prompt", "seconds", "size", "quality", + "status", "progress", "error_message", "created_at", "completed_at", + ).Offset(input.Page.Offset).Limit(input.Page.Limit).Find(&rows).Error; err != nil { return nil, 0, err } values := make([]media.Job, 0, len(rows)) @@ -148,6 +173,20 @@ func (r *MediaJobRepository) ListMediaJobs(ctx context.Context, page, pageSize i return values, total, nil } +// SummarizeMediaJobs 通过单次条件聚合查询统计全部任务状态。 +func (r *MediaJobRepository) SummarizeMediaJobs(ctx context.Context) (repository.MediaJobStats, error) { + var stats repository.MediaJobStats + err := r.db.db.WithContext(ctx).Model(&mediaJobModel{}).Select(` + COUNT(*) AS total_jobs, + COALESCE(SUM(CASE WHEN status = ? THEN 1 ELSE 0 END), 0) AS completed, + COALESCE(SUM(CASE WHEN status = ? THEN 1 ELSE 0 END), 0) AS failed, + COALESCE(SUM(CASE WHEN status = ? THEN 1 ELSE 0 END), 0) AS in_progress, + COALESCE(SUM(CASE WHEN status = ? THEN 1 ELSE 0 END), 0) AS queued`, + media.StatusCompleted, media.StatusFailed, media.StatusInProgress, media.StatusQueued, + ).Scan(&stats).Error + return stats, err +} + func (r *MediaJobRepository) ListUnrecordedCompletedMediaJobs(ctx context.Context, limit int) ([]media.Job, error) { if limit <= 0 || limit > 1000 { limit = 200 @@ -239,16 +278,3 @@ func mediaJobToDomain(row mediaJobModel) media.Job { CompletedAt: row.CompletedAt, UsageRecordedAt: row.UsageRecordedAt, } } - -func normalizeMediaPagination(page, pageSize int) (int, int) { - if page < 1 { - page = 1 - } - if pageSize < 1 { - pageSize = 20 - } - if pageSize > 100 { - pageSize = 100 - } - return page, pageSize -} diff --git a/backend/internal/infra/persistence/relational/media_repository_test.go b/backend/internal/infra/persistence/relational/media_repository_test.go index 1ea71cc3..a1d3bec2 100644 --- a/backend/internal/infra/persistence/relational/media_repository_test.go +++ b/backend/internal/infra/persistence/relational/media_repository_test.go @@ -8,6 +8,7 @@ import ( accountdomain "github.com/chenyme/grok2api/backend/internal/domain/account" mediadomain "github.com/chenyme/grok2api/backend/internal/domain/media" + "github.com/chenyme/grok2api/backend/internal/repository" ) func TestMediaJobRepositoryListMediaJobsPaginatesAndFilters(t *testing.T) { @@ -31,7 +32,7 @@ func TestMediaJobRepositoryListMediaJobsPaginatesAndFilters(t *testing.T) { t.Fatal(err) } - repository := NewMediaJobRepository(database) + jobRepo := NewMediaJobRepository(database) now := time.Date(2026, 7, 13, 12, 0, 0, 0, time.UTC) jobs := []mediadomain.Job{ testMediaJob("media_job_completed_old", accountValue.ID, key.ID, mediadomain.StatusCompleted, now.Add(-4*time.Hour)), @@ -39,13 +40,19 @@ func TestMediaJobRepositoryListMediaJobsPaginatesAndFilters(t *testing.T) { testMediaJob("media_job_failed_newer", accountValue.ID, key.ID, mediadomain.StatusFailed, now.Add(-2*time.Hour)), testMediaJob("media_job_completed_new", accountValue.ID, key.ID, mediadomain.StatusCompleted, now.Add(-time.Hour)), } + jobs[0].Prompt = "A quiet harbor" + jobs[1].Prompt = "Northern lights" + jobs[2].Prompt = "Desert sunrise" + jobs[3].Prompt = "City skyline" for _, job := range jobs { - if err := repository.CreateMediaJob(ctx, job); err != nil { + if err := jobRepo.CreateMediaJob(ctx, job); err != nil { t.Fatal(err) } } - firstPage, total, err := repository.ListMediaJobs(ctx, 1, 2, "") + firstPage, total, err := jobRepo.ListMediaJobs(ctx, repository.MediaJobListQuery{ + Page: repository.PageQuery{Offset: 0, Limit: 2}, + }) if err != nil { t.Fatal(err) } @@ -54,7 +61,9 @@ func TestMediaJobRepositoryListMediaJobsPaginatesAndFilters(t *testing.T) { } assertMediaJobIDs(t, firstPage, "media_job_completed_new", "media_job_failed_newer") - secondPage, total, err := repository.ListMediaJobs(ctx, 2, 2, "") + secondPage, total, err := jobRepo.ListMediaJobs(ctx, repository.MediaJobListQuery{ + Page: repository.PageQuery{Offset: 2, Limit: 2}, + }) if err != nil { t.Fatal(err) } @@ -63,7 +72,10 @@ func TestMediaJobRepositoryListMediaJobsPaginatesAndFilters(t *testing.T) { } assertMediaJobIDs(t, secondPage, "media_job_queued_mid", "media_job_completed_old") - completed, total, err := repository.ListMediaJobs(ctx, 1, 10, string(mediadomain.StatusCompleted)) + completed, total, err := jobRepo.ListMediaJobs(ctx, repository.MediaJobListQuery{ + Page: repository.PageQuery{Offset: 0, Limit: 10}, + Filter: repository.MediaJobListFilter{Status: string(mediadomain.StatusCompleted)}, + }) if err != nil { t.Fatal(err) } @@ -71,19 +83,53 @@ func TestMediaJobRepositoryListMediaJobsPaginatesAndFilters(t *testing.T) { t.Fatalf("completed total = %d", total) } assertMediaJobIDs(t, completed, "media_job_completed_new", "media_job_completed_old") + + searched, total, err := jobRepo.ListMediaJobs(ctx, repository.MediaJobListQuery{ + Page: repository.PageQuery{Offset: 0, Limit: 1, Search: "northern"}, + }) + if err != nil { + t.Fatal(err) + } + if total != 1 { + t.Fatalf("searched total = %d", total) + } + assertMediaJobIDs(t, searched, "media_job_queued_mid") + + sorted, total, err := jobRepo.ListMediaJobs(ctx, repository.MediaJobListQuery{ + Page: repository.PageQuery{ + Offset: 0, + Limit: 4, + Sort: repository.SortQuery{Field: "prompt", Direction: repository.SortAscending}, + }, + }) + if err != nil { + t.Fatal(err) + } + if total != 4 { + t.Fatalf("sorted total = %d", total) + } + assertMediaJobIDs(t, sorted, "media_job_completed_old", "media_job_completed_new", "media_job_failed_newer", "media_job_queued_mid") + + stats, err := jobRepo.SummarizeMediaJobs(ctx) + if err != nil { + t.Fatal(err) + } + if stats.TotalJobs != 4 || stats.Completed != 2 || stats.Failed != 1 || stats.InProgress != 0 || stats.Queued != 1 { + t.Fatalf("stats = %#v", stats) + } } func TestMediaAssetRepositoryListMediaAssetsPaginatesAndCounts(t *testing.T) { ctx := context.Background() database := openTestDatabase(t) - repository := NewMediaAssetRepository(database) + assetRepo := NewMediaAssetRepository(database) - count, err := repository.CountMediaAssets(ctx) + stats, err := assetRepo.SummarizeMediaAssets(ctx) if err != nil { t.Fatal(err) } - if count != 0 { - t.Fatalf("initial count = %d", count) + if stats.TotalImages != 0 || stats.TotalBytes != 0 { + t.Fatalf("initial stats = %#v", stats) } now := time.Date(2026, 7, 13, 12, 0, 0, 0, time.UTC) @@ -93,12 +139,14 @@ func TestMediaAssetRepositoryListMediaAssetsPaginatesAndCounts(t *testing.T) { testMediaAsset("media_asset_0003", "media/asset-0003.png", now.Add(-time.Hour)), } for _, asset := range assets { - if err := repository.CreateMediaAsset(ctx, asset); err != nil { + if err := assetRepo.CreateMediaAsset(ctx, asset); err != nil { t.Fatal(err) } } - firstPage, total, err := repository.ListMediaAssets(ctx, 1, 2) + firstPage, total, err := assetRepo.ListMediaAssets(ctx, repository.MediaAssetListQuery{ + Page: repository.PageQuery{Offset: 0, Limit: 2}, + }) if err != nil { t.Fatal(err) } @@ -107,7 +155,9 @@ func TestMediaAssetRepositoryListMediaAssetsPaginatesAndCounts(t *testing.T) { } assertMediaAssetIDs(t, firstPage, "media_asset_0003", "media_asset_0002") - secondPage, total, err := repository.ListMediaAssets(ctx, 2, 2) + secondPage, total, err := assetRepo.ListMediaAssets(ctx, repository.MediaAssetListQuery{ + Page: repository.PageQuery{Offset: 2, Limit: 2}, + }) if err != nil { t.Fatal(err) } @@ -116,12 +166,23 @@ func TestMediaAssetRepositoryListMediaAssetsPaginatesAndCounts(t *testing.T) { } assertMediaAssetIDs(t, secondPage, "media_asset_0001") - count, err = repository.CountMediaAssets(ctx) + searched, total, err := assetRepo.ListMediaAssets(ctx, repository.MediaAssetListQuery{ + Page: repository.PageQuery{Offset: 0, Limit: 1, Search: "0001"}, + }) if err != nil { t.Fatal(err) } - if count != 3 { - t.Fatalf("count = %d", count) + if total != 1 { + t.Fatalf("searched total = %d", total) + } + assertMediaAssetIDs(t, searched, "media_asset_0001") + + stats, err = assetRepo.SummarizeMediaAssets(ctx) + if err != nil { + t.Fatal(err) + } + if stats.TotalImages != 3 || stats.TotalBytes != 3*1024 { + t.Fatalf("stats = %#v", stats) } } diff --git a/backend/internal/infra/provider/cli/normalize.go b/backend/internal/infra/provider/cli/normalize.go index 0881ed74..e3283915 100644 --- a/backend/internal/infra/provider/cli/normalize.go +++ b/backend/internal/infra/provider/cli/normalize.go @@ -62,7 +62,7 @@ func normalizeResponseFormat(raw json.RawMessage) (json.RawMessage, error) { if err := json.Unmarshal(format["json_schema"], &schema); err != nil { return nil, fmt.Errorf("解析 response_format.json_schema: %w", err) } - result := make(map[string]json.RawMessage, len(schema)+1) + result := make(map[string]json.RawMessage, len(schema)) result["type"] = mustJSON("json_schema") for key, value := range schema { result[key] = value diff --git a/backend/internal/infra/provider/conversation/request.go b/backend/internal/infra/provider/conversation/request.go index 3243f5b0..3472c969 100644 --- a/backend/internal/infra/provider/conversation/request.go +++ b/backend/internal/infra/provider/conversation/request.go @@ -294,7 +294,7 @@ func convertMessagesRequest(body []byte, model string) ([]byte, ResponseOptions, "model": model, "input": input, "stream": request.Stream, "max_output_tokens": request.MaxTokens, "store": false, } - instructions := make([]string, 0, len(inlineInstructions)+1) + instructions := make([]string, 0, len(inlineInstructions)) if system, err := anthropicSystemText(request.System); err != nil { return nil, ResponseOptions{}, err } else if system != "" { diff --git a/backend/internal/repository/media.go b/backend/internal/repository/media.go index 7dae2aae..b1fbd920 100644 --- a/backend/internal/repository/media.go +++ b/backend/internal/repository/media.go @@ -8,11 +8,43 @@ import ( "github.com/chenyme/grok2api/backend/internal/domain/media" ) +// MediaAssetListQuery 表示管理端媒体资源列表的查询条件。 +type MediaAssetListQuery struct { + Page PageQuery +} + +// MediaJobListFilter 表示视频任务列表允许使用的业务筛选条件。 +type MediaJobListFilter struct { + Status string +} + +// MediaJobListQuery 表示管理端视频任务列表的查询条件。 +type MediaJobListQuery struct { + Page PageQuery + Filter MediaJobListFilter +} + +// MediaAssetStats 表示媒体资源的聚合统计结果。 +type MediaAssetStats struct { + TotalImages int64 + TotalBytes int64 +} + +// MediaJobStats 表示各状态视频任务的聚合统计结果。 +type MediaJobStats struct { + TotalJobs int64 + Completed int64 + Failed int64 + InProgress int64 + Queued int64 +} + type MediaJobRepository interface { CreateMediaJob(ctx context.Context, value media.Job) error GetMediaJob(ctx context.Context, id string, clientKeyID uint64) (media.Job, error) UpdateMediaJob(ctx context.Context, value media.Job) error - ListMediaJobs(ctx context.Context, page, pageSize int, status string) ([]media.Job, int64, error) + ListMediaJobs(ctx context.Context, query MediaJobListQuery) ([]media.Job, int64, error) + SummarizeMediaJobs(ctx context.Context) (MediaJobStats, error) ListRecoverableMediaJobs(ctx context.Context, limit int) ([]media.Job, error) ListUnrecordedCompletedMediaJobs(ctx context.Context, limit int) ([]media.Job, error) TryClaimMediaJob(ctx context.Context, id string, now, leaseUntil time.Time, claimToken string) (media.Job, bool, error) @@ -23,8 +55,8 @@ type MediaJobRepository interface { type MediaAssetRepository interface { CreateMediaAsset(ctx context.Context, value media.Asset) error GetMediaAsset(ctx context.Context, id string) (media.Asset, error) - ListMediaAssets(ctx context.Context, page, pageSize int) ([]media.Asset, int64, error) - CountMediaAssets(ctx context.Context) (int64, error) + ListMediaAssets(ctx context.Context, query MediaAssetListQuery) ([]media.Asset, int64, error) + SummarizeMediaAssets(ctx context.Context) (MediaAssetStats, error) TotalMediaAssetBytes(ctx context.Context) (int64, error) ListOldestMediaAssets(ctx context.Context, limit int) ([]media.Asset, error) DeleteMediaAsset(ctx context.Context, id string) error diff --git a/backend/internal/transport/http/media/dto.go b/backend/internal/transport/http/media/dto.go new file mode 100644 index 00000000..58295594 --- /dev/null +++ b/backend/internal/transport/http/media/dto.go @@ -0,0 +1,40 @@ +package media + +type mediaAssetDTO struct { + ID string `json:"id"` + Kind string `json:"kind"` + MimeType string `json:"mimeType"` + SizeBytes int64 `json:"sizeBytes"` + SHA256 string `json:"sha256"` + CreatedAt string `json:"createdAt"` + URL string `json:"url"` +} + +type imageStatsDTO struct { + TotalImages int64 `json:"totalImages"` + TotalBytes int64 `json:"totalBytes"` +} + +type mediaJobDTO struct { + ID string `json:"id"` + Model string `json:"model"` + Prompt string `json:"prompt"` + Status string `json:"status"` + Progress int `json:"progress"` + Seconds int `json:"seconds"` + Size string `json:"size"` + Quality string `json:"quality"` + AccountName string `json:"accountName"` + ClientKeyName string `json:"clientKeyName"` + CreatedAt string `json:"createdAt"` + CompletedAt *string `json:"completedAt"` + ErrorMessage string `json:"errorMessage"` +} + +type videoStatsDTO struct { + TotalJobs int64 `json:"totalJobs"` + Completed int64 `json:"completed"` + Failed int64 `json:"failed"` + InProgress int64 `json:"inProgress"` + Queued int64 `json:"queued"` +} diff --git a/backend/internal/transport/http/media/handler.go b/backend/internal/transport/http/media/handler.go index 45f2c850..4e7863d6 100644 --- a/backend/internal/transport/http/media/handler.go +++ b/backend/internal/transport/http/media/handler.go @@ -8,6 +8,7 @@ import ( "strings" mediaapp "github.com/chenyme/grok2api/backend/internal/application/media" + "github.com/chenyme/grok2api/backend/internal/repository" "github.com/chenyme/grok2api/backend/internal/shared/response" "github.com/gin-gonic/gin" ) @@ -62,50 +63,9 @@ func (h *Handler) getImage(c *gin.Context) { _, _ = io.Copy(c.Writer, body) } -// --- Admin endpoints --- - -type mediaAssetDTO struct { - ID string `json:"id"` - Kind string `json:"kind"` - MimeType string `json:"mimeType"` - SizeBytes int64 `json:"sizeBytes"` - SHA256 string `json:"sha256"` - CreatedAt string `json:"createdAt"` - URL string `json:"url"` -} - -type imageStatsDTO struct { - TotalImages int64 `json:"totalImages"` - TotalBytes int64 `json:"totalBytes"` -} - -type mediaJobDTO struct { - ID string `json:"id"` - Model string `json:"model"` - Prompt string `json:"prompt"` - Status string `json:"status"` - Progress int `json:"progress"` - Seconds int `json:"seconds"` - Size string `json:"size"` - Quality string `json:"quality"` - AccountName string `json:"accountName"` - ClientKeyName string `json:"clientKeyName"` - CreatedAt string `json:"createdAt"` - CompletedAt string `json:"completedAt"` - ErrorMessage string `json:"errorMessage"` -} - -type videoStatsDTO struct { - TotalJobs int64 `json:"totalJobs"` - Completed int64 `json:"completed"` - Failed int64 `json:"failed"` - InProgress int64 `json:"inProgress"` - Queued int64 `json:"queued"` -} - func (h *Handler) listImages(c *gin.Context) { page, pageSize := parsePagination(c) - assets, total, err := h.service.AdminListImages(c.Request.Context(), page, pageSize) + assets, total, err := h.service.AdminListImages(c.Request.Context(), page, pageSize, c.Query("search")) if err != nil { response.Error(c, http.StatusInternalServerError, "mediaListImagesFailed", "读取图片列表失败") return @@ -132,23 +92,27 @@ func (h *Handler) imageStats(c *gin.Context) { func (h *Handler) listVideos(c *gin.Context) { page, pageSize := parsePagination(c) - status := c.Query("status") - jobs, total, err := h.service.AdminListVideoJobs(c.Request.Context(), page, pageSize, status) + jobs, total, err := h.service.AdminListVideoJobs(c.Request.Context(), page, pageSize, c.Query("search"), c.Query("status"), repository.SortQuery{Field: c.Query("sortBy"), Direction: repository.SortDirection(c.Query("sortOrder"))}) + if errors.Is(err, mediaapp.ErrInvalidFilter) { + response.Error(c, http.StatusBadRequest, "invalidFilter", err.Error()) + return + } if err != nil { response.Error(c, http.StatusInternalServerError, "mediaListVideosFailed", "读取视频任务列表失败") return } items := make([]mediaJobDTO, 0, len(jobs)) for _, j := range jobs { - completedAt := "" + var completedAt *string if j.CompletedAt != nil { - completedAt = j.CompletedAt.Format("2006-01-02T15:04:05Z") + formatted := j.CompletedAt.Format("2006-01-02T15:04:05Z") + completedAt = &formatted } items = append(items, mediaJobDTO{ ID: j.ID, Model: j.Model, Prompt: j.Prompt, Status: string(j.Status), Progress: j.Progress, Seconds: j.Seconds, Size: j.Size, Quality: j.Quality, AccountName: j.AccountName, ClientKeyName: j.ClientKeyName, - CreatedAt: j.CreatedAt.Format("2006-01-02T15:04:05Z"), + CreatedAt: j.CreatedAt.Format("2006-01-02T15:04:05Z"), CompletedAt: completedAt, ErrorMessage: j.ErrorMessage, }) } diff --git a/backend/internal/transport/http/media/handler_test.go b/backend/internal/transport/http/media/handler_test.go index 2b48b8c9..ce83de2d 100644 --- a/backend/internal/transport/http/media/handler_test.go +++ b/backend/internal/transport/http/media/handler_test.go @@ -61,3 +61,37 @@ func TestPublicImageSupportsGetHeadAndETag(t *testing.T) { t.Fatalf("conditional GET status=%d size=%d", notModified.Code, notModified.Body.Len()) } } + +func TestAdminVideoListRejectsInvalidFilters(t *testing.T) { + gin.SetMode(gin.TestMode) + ctx := context.Background() + database, err := relational.OpenSQLite(ctx, filepath.Join(t.TempDir(), "media-admin-http.db")) + if err != nil { + t.Fatal(err) + } + defer database.Close() + if err := database.InitializeSchema(ctx); err != nil { + t.Fatal(err) + } + service := mediaapp.NewService( + relational.NewMediaAssetRepository(database), + relational.NewMediaJobRepository(database), + nil, + nil, + mediaapp.Config{}, + ) + router := gin.New() + NewHandler(service).RegisterAdmin(router.Group("/api/admin/v1")) + + for _, path := range []string{ + "/api/admin/v1/media/videos?status=unknown", + "/api/admin/v1/media/videos?sortBy=input_json&sortOrder=asc", + "/api/admin/v1/media/videos?sortBy=createdAt&sortOrder=sideways", + } { + recorder := httptest.NewRecorder() + router.ServeHTTP(recorder, httptest.NewRequest(http.MethodGet, path, nil)) + if recorder.Code != http.StatusBadRequest { + t.Fatalf("GET %s status = %d, body = %s", path, recorder.Code, recorder.Body.String()) + } + } +} diff --git a/frontend/package-lock.json b/frontend/package-lock.json deleted file mode 100644 index c97d7e80..00000000 --- a/frontend/package-lock.json +++ /dev/null @@ -1,4827 +0,0 @@ -{ - "name": "grok2api-frontend", - "version": "0.1.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "grok2api-frontend", - "version": "0.1.0", - "dependencies": { - "@hookform/resolvers": "^5.4.0", - "@radix-ui/react-alert-dialog": "^1.1.19", - "@radix-ui/react-checkbox": "^1.3.7", - "@radix-ui/react-dialog": "^1.1.19", - "@radix-ui/react-dropdown-menu": "^2.1.20", - "@radix-ui/react-label": "^2.1.11", - "@radix-ui/react-popover": "^1.1.19", - "@radix-ui/react-select": "^2.3.3", - "@radix-ui/react-slot": "^1.3.0", - "@radix-ui/react-switch": "^1.3.3", - "@radix-ui/react-tabs": "^1.1.17", - "@radix-ui/react-tooltip": "^1.2.12", - "@tanstack/react-query": "^5.101.2", - "class-variance-authority": "^0.7.1", - "clsx": "^2.1.1", - "date-fns": "^4.4.0", - "i18next": "^26.3.6", - "lucide-react": "^1.24.0", - "next-themes": "^0.4.6", - "react": "^19.2.7", - "react-day-picker": "^10.0.1", - "react-dom": "^19.2.7", - "react-hook-form": "^7.81.0", - "react-i18next": "^17.0.9", - "react-router-dom": "^7.18.1", - "recharts": "2.15.4", - "sonner": "^2.0.7", - "tailwind-merge": "^3.6.0", - "tw-animate-css": "^1.4.0", - "zod": "^4.4.3" - }, - "devDependencies": { - "@eslint/js": "^10.0.1", - "@tailwindcss/vite": "^4.3.2", - "@types/node": "^26.1.1", - "@types/react": "^19.2.17", - "@types/react-dom": "^19.2.3", - "@vitejs/plugin-react": "^6.0.3", - "eslint": "^10.6.0", - "eslint-plugin-react-hooks": "^7.1.1", - "eslint-plugin-react-refresh": "^0.5.3", - "globals": "^17.7.0", - "tailwindcss": "^4.3.2", - "typescript": "^6.0.2", - "typescript-eslint": "^8.63.0", - "vite": "^8.1.4" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", - "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-validator-identifier": "^7.29.7", - "js-tokens": "^4.0.0", - "picocolors": "^1.1.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/compat-data": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", - "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/core": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", - "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.29.7", - "@babel/generator": "^7.29.7", - "@babel/helper-compilation-targets": "^7.29.7", - "@babel/helper-module-transforms": "^7.29.7", - "@babel/helpers": "^7.29.7", - "@babel/parser": "^7.29.7", - "@babel/template": "^7.29.7", - "@babel/traverse": "^7.29.7", - "@babel/types": "^7.29.7", - "@jridgewell/remapping": "^2.3.5", - "convert-source-map": "^2.0.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.3", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" - } - }, - "node_modules/@babel/generator": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz", - "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.29.7", - "@babel/types": "^7.29.7", - "@jridgewell/gen-mapping": "^0.3.12", - "@jridgewell/trace-mapping": "^0.3.28", - "jsesc": "^3.0.2" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-compilation-targets": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", - "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/compat-data": "^7.29.7", - "@babel/helper-validator-option": "^7.29.7", - "browserslist": "^4.24.0", - "lru-cache": "^5.1.1", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-globals": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", - "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-imports": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", - "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/traverse": "^7.29.7", - "@babel/types": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-transforms": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", - "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-module-imports": "^7.29.7", - "@babel/helper-validator-identifier": "^7.29.7", - "@babel/traverse": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-string-parser": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", - "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", - "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-option": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", - "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helpers": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz", - "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/template": "^7.29.7", - "@babel/types": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/parser": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz", - "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.29.7" - }, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/runtime": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz", - "integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/template": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", - "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.29.7", - "@babel/parser": "^7.29.7", - "@babel/types": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz", - "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.29.7", - "@babel/generator": "^7.29.7", - "@babel/helper-globals": "^7.29.7", - "@babel/parser": "^7.29.7", - "@babel/template": "^7.29.7", - "@babel/types": "^7.29.7", - "debug": "^4.3.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/types": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", - "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-string-parser": "^7.29.7", - "@babel/helper-validator-identifier": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@date-fns/tz": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@date-fns/tz/-/tz-1.5.0.tgz", - "integrity": "sha512-lwYN/vDPeNRULcepoE/LO2Pgx+7/RV+S9ARfbc9lr2DtGkOD7pAiruHvbR1RX3Qyf6ja47EWJDMsNK5vK08DJg==", - "license": "MIT" - }, - "node_modules/@emnapi/core": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.1.tgz", - "integrity": "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@emnapi/wasi-threads": "1.2.2", - "tslib": "^2.4.0" - } - }, - "node_modules/@emnapi/runtime": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.1.tgz", - "integrity": "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@emnapi/wasi-threads": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz", - "integrity": "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", - "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" - } - }, - "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint-community/regexpp": { - "version": "4.12.2", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", - "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/@eslint/config-array": { - "version": "0.23.5", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz", - "integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/object-schema": "^3.0.5", - "debug": "^4.3.1", - "minimatch": "^10.2.4" - }, - "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" - } - }, - "node_modules/@eslint/config-helpers": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.6.0.tgz", - "integrity": "sha512-ii6Bw9jJ2zi2cWA2Z+9/QZ/+3DX6kwaV5Q986D/CdP3Lap3w/pgQZ373FV7byY/i7L4IRH/G43I5dz1ClsCbpA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/core": "^1.2.1" - }, - "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" - } - }, - "node_modules/@eslint/core": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.1.tgz", - "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@types/json-schema": "^7.0.15" - }, - "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" - } - }, - "node_modules/@eslint/js": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", - "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" - }, - "funding": { - "url": "https://eslint.org/donate" - }, - "peerDependencies": { - "eslint": "^10.0.0" - }, - "peerDependenciesMeta": { - "eslint": { - "optional": true - } - } - }, - "node_modules/@eslint/object-schema": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.5.tgz", - "integrity": "sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" - } - }, - "node_modules/@eslint/plugin-kit": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.2.tgz", - "integrity": "sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/core": "^1.2.1", - "levn": "^0.4.1" - }, - "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" - } - }, - "node_modules/@floating-ui/core": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.8.0.tgz", - "integrity": "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ==", - "license": "MIT", - "dependencies": { - "@floating-ui/utils": "^0.2.12" - } - }, - "node_modules/@floating-ui/dom": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.8.0.tgz", - "integrity": "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg==", - "license": "MIT", - "dependencies": { - "@floating-ui/core": "^1.8.0", - "@floating-ui/utils": "^0.2.12" - } - }, - "node_modules/@floating-ui/react-dom": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.9.tgz", - "integrity": "sha512-JDjEFGCpImxDCA7JJKviA0M9+RtmJdj0m/NVU5IMgBK+AmZouAQQ7/+2GLH0GXXY0YMw9oXPB8hKdbPYg5QLYg==", - "license": "MIT", - "dependencies": { - "@floating-ui/dom": "^1.8.0" - }, - "peerDependencies": { - "react": ">=16.8.0", - "react-dom": ">=16.8.0" - } - }, - "node_modules/@floating-ui/utils": { - "version": "0.2.12", - "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.12.tgz", - "integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==", - "license": "MIT" - }, - "node_modules/@hookform/resolvers": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@hookform/resolvers/-/resolvers-5.4.0.tgz", - "integrity": "sha512-EIsqr/t/qbinPIhGjMdtvutIN1Kk4uwbROE9/UQ93CAVGR7GkA7Y92+fX80OzXi/OB67jVFYwKGO1WzkxmkFZw==", - "license": "MIT", - "dependencies": { - "@standard-schema/utils": "^0.3.0" - }, - "peerDependencies": { - "react-hook-form": "^7.55.0" - } - }, - "node_modules/@humanfs/core": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", - "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@humanfs/types": "^0.15.0" - }, - "engines": { - "node": ">=18.18.0" - } - }, - "node_modules/@humanfs/node": { - "version": "0.16.8", - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz", - "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@humanfs/core": "^0.19.2", - "@humanfs/types": "^0.15.0", - "@humanwhocodes/retry": "^0.4.0" - }, - "engines": { - "node": ">=18.18.0" - } - }, - "node_modules/@humanfs/types": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz", - "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18.18.0" - } - }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@humanwhocodes/retry": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", - "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18.18" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.13", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", - "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "node_modules/@jridgewell/remapping": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", - "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.31", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", - "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@napi-rs/wasm-runtime": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.6.tgz", - "integrity": "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@tybys/wasm-util": "^0.10.3" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - }, - "peerDependencies": { - "@emnapi/core": "^1.7.1", - "@emnapi/runtime": "^1.7.1" - } - }, - "node_modules/@oxc-project/types": { - "version": "0.139.0", - "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.139.0.tgz", - "integrity": "sha512-r9gHphtCs+1M7J0pw6Sn/hh/Wpa/iQrOOkrNAlVLF/gHq+/CJmHIWKKUUhdWjcD6CIa8idarspCsASiXCXvFUw==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/Boshen" - } - }, - "node_modules/@radix-ui/number": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.2.tgz", - "integrity": "sha512-ceTwaxc4I5IOi97DgCotl3pqiyRGvffcc0oOsE2dQYaJOFIDsDt4VWG6xEbg1QePv9QWausCEIppud/tJ1wNig==", - "license": "MIT" - }, - "node_modules/@radix-ui/primitive": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.5.tgz", - "integrity": "sha512-d86WIWFYNtGA0H/d8exstrTRTp7eWJYlYJbtNofxr/3ljupZYn6EFDG/Qgu/0Kc8v7yMUxySagqJsL1+PdYjWg==", - "license": "MIT" - }, - "node_modules/@radix-ui/react-alert-dialog": { - "version": "1.1.19", - "resolved": "https://registry.npmjs.org/@radix-ui/react-alert-dialog/-/react-alert-dialog-1.1.19.tgz", - "integrity": "sha512-FA7n1f6D/DwGE0+AWxiY5LacNbbExQuEgMubeG06idEaH+mSLuf9dp/qBNqOnvbTQ+4gZ2ue1RATF1Ub91Mg5g==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.5", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.2.0", - "@radix-ui/react-dialog": "1.1.19", - "@radix-ui/react-primitive": "2.1.7" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-arrow": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/@radix-ui/react-arrow/-/react-arrow-1.1.11.tgz", - "integrity": "sha512-Kdil9BB1rIFC/khmf4hC35bn8701AJcizTU7G7cUbEbk5XqqbjDuHW60uUfKqO5WojjZcbAW51Q7P0hRmMLw8A==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-primitive": "2.1.7" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-checkbox": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/@radix-ui/react-checkbox/-/react-checkbox-1.3.7.tgz", - "integrity": "sha512-JroKHfQBfh+fDuzpPsBC+pESkhuq8ql4hljTguz8MWnS35cISr3d/Jhl9kYrB44FlDtxCArYdDvTx+BSsJ64rQ==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.5", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.2.0", - "@radix-ui/react-presence": "1.1.7", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-use-controllable-state": "1.2.3", - "@radix-ui/react-use-previous": "1.1.2", - "@radix-ui/react-use-size": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-collection": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.1.12.tgz", - "integrity": "sha512-nb67INpE0IahJKN7EYPp9m9YGwYeKlnzxT3MwXVkgCskaSJia97kG4T0ywpjNUSSnoJk/uvk12V8vbrEHEj+/Q==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.2.0", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-slot": "1.3.0" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-compose-refs": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.3.tgz", - "integrity": "sha512-rYOP8OMnuuPMQF1uhPVlGNcCDlkokKqGFE3JcxFViIkAXP7EvFWUliJAstrapypaBLJNHbZL6jGhbVDGTwmVhA==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-context": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.2.0.tgz", - "integrity": "sha512-fOE+JtN9rygNZkCnHRBEP0TAvLldlhyOxMsbwFvTP4nAs+nBmfnna+o/Zski2wkmY1YMrFC0aSzsHoLY47iLrg==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-dialog": { - "version": "1.1.19", - "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.1.19.tgz", - "integrity": "sha512-+HhbN2+YtkRgVirjZ2afMeutQRuGOrdkWR5+EFC58SJojGmtyNQwYzgi6tHBpOxvFHefMtPeHdgtjz0BOGxFQg==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.5", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.2.0", - "@radix-ui/react-dismissable-layer": "1.1.15", - "@radix-ui/react-focus-guards": "1.1.4", - "@radix-ui/react-focus-scope": "1.1.12", - "@radix-ui/react-id": "1.1.2", - "@radix-ui/react-portal": "1.1.13", - "@radix-ui/react-presence": "1.1.7", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-slot": "1.3.0", - "@radix-ui/react-use-controllable-state": "1.2.3", - "aria-hidden": "^1.2.4", - "react-remove-scroll": "^2.7.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-direction": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.1.2.tgz", - "integrity": "sha512-C3vFhbyi4SW3PmbAi6Awpu4OzJtd0MxGurvSsYtr7p7nM8RNB3VAF3CUmnp2j50knpkrRcB7+ycVXzgLgF6yNA==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-dismissable-layer": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.15.tgz", - "integrity": "sha512-b0XaRlzn2QKuo10XyNgi2DAJDf5XC9d1nD3FJcuvCjbR7+4Ad28zmZsLsqx+hvDEzMnRuZaZxZm9gYObV6RmRA==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.5", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-use-callback-ref": "1.1.2", - "@radix-ui/react-use-effect-event": "0.0.3" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-dropdown-menu": { - "version": "2.1.20", - "resolved": "https://registry.npmjs.org/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.1.20.tgz", - "integrity": "sha512-slfm+rRaZRuQBvHq60lXvSVUPhid0IPtjSZzIuUlWZMUs01iYZNlGS3mJgRD3ChLQVBAYlKiL/tFyWGX+dz8Xw==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.5", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.2.0", - "@radix-ui/react-id": "1.1.2", - "@radix-ui/react-menu": "2.1.20", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-use-controllable-state": "1.2.3" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-focus-guards": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.1.4.tgz", - "integrity": "sha512-cot/aB/mOm0IYVYTTmQcEEK1M48lZWi8FlYe5nDPQQ8NYZUlXEFgncJ9p2Kzer3RKSrY7cTTpEMLZKNo9QoP5Q==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-focus-scope": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.1.12.tgz", - "integrity": "sha512-jjk/lqTeNL0azUx5ZYzVrl4NgaDIrdzTNE4mABV9yBFI7FQqN7pIgzV1bTleUezP2QiTGA1BFTqY8MegDgWX9A==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-use-callback-ref": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-id": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.1.2.tgz", - "integrity": "sha512-orBC88futVpqCmhX1p4cvquNHsELQ+w+vBJnuj3ftETI5bJb0bZn3Tqu3SWN2IOcPycTnMGnhwoermvISt72sA==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-use-layout-effect": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-label": { - "version": "2.1.11", - "resolved": "https://registry.npmjs.org/@radix-ui/react-label/-/react-label-2.1.11.tgz", - "integrity": "sha512-3PKvDDxOn62k0oV1n4QtNtD2vpu+zYjXR7ojLBPaO6SPvhy53yg0vAmgNeBQeJW5rV3dffoRG+HYfLBZuzw0CQ==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-primitive": "2.1.7" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-menu": { - "version": "2.1.20", - "resolved": "https://registry.npmjs.org/@radix-ui/react-menu/-/react-menu-2.1.20.tgz", - "integrity": "sha512-VsUrXxFe9d2ScbZF0fR/oPR1+qjyeLs5p0jzG8h90puMoA9bq4SirYlXbE+USRg9Q2qTeJSFNqjw2nts8jJe4w==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.5", - "@radix-ui/react-collection": "1.1.12", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.2.0", - "@radix-ui/react-direction": "1.1.2", - "@radix-ui/react-dismissable-layer": "1.1.15", - "@radix-ui/react-focus-guards": "1.1.4", - "@radix-ui/react-focus-scope": "1.1.12", - "@radix-ui/react-id": "1.1.2", - "@radix-ui/react-popper": "1.3.3", - "@radix-ui/react-portal": "1.1.13", - "@radix-ui/react-presence": "1.1.7", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-roving-focus": "1.1.15", - "@radix-ui/react-slot": "1.3.0", - "@radix-ui/react-use-callback-ref": "1.1.2", - "aria-hidden": "^1.2.4", - "react-remove-scroll": "^2.7.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-popover": { - "version": "1.1.19", - "resolved": "https://registry.npmjs.org/@radix-ui/react-popover/-/react-popover-1.1.19.tgz", - "integrity": "sha512-jkrTdQVxnIB8fpn0NyyxW9CTB5aCXZZelVz5z+Xmii6g5WxMqS3fInNslZ63puP39+Puu4jYohUK31y3dT87gQ==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.5", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.2.0", - "@radix-ui/react-dismissable-layer": "1.1.15", - "@radix-ui/react-focus-guards": "1.1.4", - "@radix-ui/react-focus-scope": "1.1.12", - "@radix-ui/react-id": "1.1.2", - "@radix-ui/react-popper": "1.3.3", - "@radix-ui/react-portal": "1.1.13", - "@radix-ui/react-presence": "1.1.7", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-slot": "1.3.0", - "@radix-ui/react-use-controllable-state": "1.2.3", - "aria-hidden": "^1.2.4", - "react-remove-scroll": "^2.7.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-popper": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.3.3.tgz", - "integrity": "sha512-mS7dGpyjv6b+gsDjLF7e0ia1W4Im1B1hSCy2yuXlHuvnZxHKagfDaobt/KAKt27EpZMit2pss8eJBVyVjEWM+g==", - "license": "MIT", - "dependencies": { - "@floating-ui/react-dom": "^2.0.0", - "@radix-ui/react-arrow": "1.1.11", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.2.0", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-use-callback-ref": "1.1.2", - "@radix-ui/react-use-layout-effect": "1.1.2", - "@radix-ui/react-use-rect": "1.1.2", - "@radix-ui/react-use-size": "1.1.2", - "@radix-ui/rect": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-portal": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.1.13.tgz", - "integrity": "sha512-z3oXfmaHLJTF1wktbjgD6cn9jiEbq3WSondB10LIuIt2m2Ym4iJlrW04/euMwENDdWDdE7z+OuY7Qyp1YpRSwA==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-use-layout-effect": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-presence": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.1.7.tgz", - "integrity": "sha512-zBZ4QM5XG3JRanDmqXYf3MD6th4AFXFmgU6KNMFzUaV6F3uw9I5/zjMUvFriSEn5ewo1nxuibvyxJdmLlDcslA==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-use-layout-effect": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-primitive": { - "version": "2.1.7", - "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.7.tgz", - "integrity": "sha512-bC3NiwsprbxKjuon9l7X6BUTw7FPVzEYaL92MPEY5SCd/9hUTPXVFtVwRix7778wtRsVao+zE062gL79FZleeQ==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-slot": "1.3.0" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-roving-focus": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.1.15.tgz", - "integrity": "sha512-40svmmugfM3mUN7VUDGVE1tQGOhyi8enlGD0CNJEcMM36C1f71PKM21DFgNHUfem0XnA+d8H8oN3Z9ZpJjSslg==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.5", - "@radix-ui/react-collection": "1.1.12", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.2.0", - "@radix-ui/react-direction": "1.1.2", - "@radix-ui/react-id": "1.1.2", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-use-callback-ref": "1.1.2", - "@radix-ui/react-use-controllable-state": "1.2.3", - "@radix-ui/react-use-is-hydrated": "0.1.1", - "@radix-ui/react-use-layout-effect": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-select": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/@radix-ui/react-select/-/react-select-2.3.3.tgz", - "integrity": "sha512-L5RQTXz6Anxsf9CCv+pTgiAsUpyVj7rJxsGtmhFaEOJ++cVfXucv4qWfsIO0AIB4NAhi3yovWGVMKKS1Xf1Wrg==", - "license": "MIT", - "dependencies": { - "@radix-ui/number": "1.1.2", - "@radix-ui/primitive": "1.1.5", - "@radix-ui/react-collection": "1.1.12", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.2.0", - "@radix-ui/react-direction": "1.1.2", - "@radix-ui/react-dismissable-layer": "1.1.15", - "@radix-ui/react-focus-guards": "1.1.4", - "@radix-ui/react-focus-scope": "1.1.12", - "@radix-ui/react-id": "1.1.2", - "@radix-ui/react-popper": "1.3.3", - "@radix-ui/react-portal": "1.1.13", - "@radix-ui/react-presence": "1.1.7", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-slot": "1.3.0", - "@radix-ui/react-use-callback-ref": "1.1.2", - "@radix-ui/react-use-controllable-state": "1.2.3", - "@radix-ui/react-use-layout-effect": "1.1.2", - "@radix-ui/react-use-previous": "1.1.2", - "@radix-ui/react-visually-hidden": "1.2.7", - "aria-hidden": "^1.2.4", - "react-remove-scroll": "^2.7.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-slot": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.0.tgz", - "integrity": "sha512-MojKku4U/miO8Av4Dkb+ctMAQx7JmY96LmtDQlAarCRtd7rN52QCSzBF+XAvr5S6coSVj9HEPBgHAHKEJVk/WA==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-compose-refs": "1.1.3" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-switch": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@radix-ui/react-switch/-/react-switch-1.3.3.tgz", - "integrity": "sha512-1+mlB4/lxJfk5tgJ4g+R5mUCbRpPE1T9+UsEyeLYbGgMtwiMgmuTnfKz4Mw1nHALHjuwyxw4MLd4cSHn6pNSlQ==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.5", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.2.0", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-use-controllable-state": "1.2.3", - "@radix-ui/react-use-previous": "1.1.2", - "@radix-ui/react-use-size": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-tabs": { - "version": "1.1.17", - "resolved": "https://registry.npmjs.org/@radix-ui/react-tabs/-/react-tabs-1.1.17.tgz", - "integrity": "sha512-nRyXnrAVCwjeXcHbvEbLS6ndbTeKHG1RqCP4A8Gw5L4cemDzPXdD8rAmr6wet0v57R69wGvuIIsFjHSVkZiMzQ==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.5", - "@radix-ui/react-context": "1.2.0", - "@radix-ui/react-direction": "1.1.2", - "@radix-ui/react-id": "1.1.2", - "@radix-ui/react-presence": "1.1.7", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-roving-focus": "1.1.15", - "@radix-ui/react-use-controllable-state": "1.2.3" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-tooltip": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/@radix-ui/react-tooltip/-/react-tooltip-1.2.12.tgz", - "integrity": "sha512-U3HoftgWnmla78vzQbLvKKb7bUYJxoiiqYFzp1wu/TBMyDqMZSuCl3aRICsD6EfVEwcJD2mumGDGUXLFVqQHKA==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.5", - "@radix-ui/react-compose-refs": "1.1.3", - "@radix-ui/react-context": "1.2.0", - "@radix-ui/react-dismissable-layer": "1.1.15", - "@radix-ui/react-id": "1.1.2", - "@radix-ui/react-popper": "1.3.3", - "@radix-ui/react-portal": "1.1.13", - "@radix-ui/react-presence": "1.1.7", - "@radix-ui/react-primitive": "2.1.7", - "@radix-ui/react-slot": "1.3.0", - "@radix-ui/react-use-controllable-state": "1.2.3", - "@radix-ui/react-visually-hidden": "1.2.7" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-use-callback-ref": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.2.tgz", - "integrity": "sha512-xCso9j1/u8sEgP1RNHjFrXJLApL8LiqOkI1R4ywuN00rxWdYg4oQXuwKLS3i0j5NWLromUD27/4nlxj2UFVvIw==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-use-controllable-state": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.3.tgz", - "integrity": "sha512-PLzC90MS+ReootmjC597dvopoelpZ8Q61HJkDXZSExitIq7PL55vHNnesAHwguHK0aPfBnpdNzQtv1uliaqQrA==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-use-effect-event": "0.0.3", - "@radix-ui/react-use-layout-effect": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-use-effect-event": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.3.tgz", - "integrity": "sha512-6c8ZqvPTWILEKnyVkP53EGRCcpnJiKTC21sS/6R1GF5xKyHJJWQEPfkqlcgUkdRQivd6tb23abUwe4ngWmY0JA==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-use-layout-effect": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-use-is-hydrated": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-is-hydrated/-/react-use-is-hydrated-0.1.1.tgz", - "integrity": "sha512-qwOiz4Tjo8CNnrOLAYUMXeZwDzXgXpvK4TKQPmWLECM9XoWvA6+0Z2/7Ag3A4ivjS4ovbLJPbskkxioFyBhr8A==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-use-layout-effect": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.2.tgz", - "integrity": "sha512-jrBWOxZITuGcnjRCM2t2U5ZPkCLxD+Ym6DjfssS5haTj2iiak/DOb64JeN6OdLfLgptb6/e2kKR+ZuTrGoZTPA==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-use-previous": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-previous/-/react-use-previous-1.1.2.tgz", - "integrity": "sha512-IGBQPtRFdhN6MQ8dbegVmBq1LVZluya3F1jWY+puIcQC3MHctRwTDSBWCkL/3ZcnMJLTMJ++Z+ktmvg0F89iCw==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-use-rect": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-rect/-/react-use-rect-1.1.2.tgz", - "integrity": "sha512-d8a+bBY/FxikNPlgJJoaBHZX+zKVbWHYJGTLnLvveQgFSTntkGdEKv3JDtHrMS0DNYpllz2nRsTLGLKYttbpmw==", - "license": "MIT", - "dependencies": { - "@radix-ui/rect": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-use-size": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-size/-/react-use-size-1.1.2.tgz", - "integrity": "sha512-giWQp+4mxjBPt4KZ0MmyuykFNWfbDxKt4x+fPkRYmgRFJSbCZFzUglvMb/Kjn38tm10YP4ufiQZDx3zna4LU6w==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-use-layout-effect": "1.1.2" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-visually-hidden": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.2.7.tgz", - "integrity": "sha512-1wNZBggTDK3GRuuQ6nP4k2yi7a6l7I5qbMPbZcRsrGsGVead/f/d5FhEzUvqFs0bcrDLx7n1zKQ3JvLR6whaaw==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-primitive": "2.1.7" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/rect": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@radix-ui/rect/-/rect-1.1.2.tgz", - "integrity": "sha512-xnXE7wG13PI+cxieVssYXlQJuYVRhH9NBoxt3KNwzghDIA69GMm7d4wXRouHIYjE+KvS6U/MsMO73NdS2MH9ZA==", - "license": "MIT" - }, - "node_modules/@rolldown/binding-android-arm64": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.1.5.tgz", - "integrity": "sha512-lZg8fqIv2v7FF237bwMgzGZEJvGL79/s5knJ/i6FmsGF4XXlzccZ4jb+TrFIxtSSxFtIpdsgrPZeMk1I9AFcyQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-darwin-arm64": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.1.5.tgz", - "integrity": "sha512-51Bnx9pNiMRKSUNtBfySkNJ9vMU9Hh3I1ozDd6gyPPYzaXCfnptUcEZxXGYFn+ul2dtcMUiqGR1Yai2K10uoTw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-darwin-x64": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.1.5.tgz", - "integrity": "sha512-Tm+gbfC0aHu1tBA/JvKQh32S0K6YgCHkiAF4/W6xX0K0RmNuc94VeK419dJoE65R5aRxmo+noZQSWrAMF6yb6g==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-freebsd-x64": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.1.5.tgz", - "integrity": "sha512-JMzDKCCXq93YccG5gz3hvOs1oXRKAf0XYpfOS88e+wZrC8Iugj6j68867vrYZkvpDDpKn/KoKORThmchMpF6TA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-linux-arm-gnueabihf": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.1.5.tgz", - "integrity": "sha512-uML21j2K5TfPGutKxub+M+nLjZIrWjXQ5Grx4lCe/nimTj9B4L63zHpjXLl4y0L3mcm2htEQIb06oCG/szerNw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-linux-arm64-gnu": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.1.5.tgz", - "integrity": "sha512-navSiuTMogvnQoZoM/v+l3ZWo50/NTwSHSzheABx/RCnmUPaKwq9qSo4Br2OYRs21+Fz8uFqITZM3H4opOB0/Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-linux-arm64-musl": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.1.5.tgz", - "integrity": "sha512-lAryqH7IteztmCXQXk0etKj4wBQ7Gx5S6LjKhsgp9zb8I5bsuvU/2llH1hDQcjsFeqIsovMVN339/8pUDDBXxA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-linux-ppc64-gnu": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.1.5.tgz", - "integrity": "sha512-fsK/sNBnxzBlL4O1JNrZakVQxPspqpED5dLtNsZS9oOKmtSpdNIzxH2kkol5HYTWJN47sE20ztMJPxfZ89qGOg==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-linux-s390x-gnu": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.1.5.tgz", - "integrity": "sha512-gLYb4BIadlfTOYT5gO503n8zQjXflgzpD0FcyKh0Mzx3rqCZKnHoJWV9xe1KXUJ5lx2JfcSHr/mhzS0PC/McAA==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-linux-x64-gnu": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.1.5.tgz", - "integrity": "sha512-FjcpEKUyJygHgs1o50VYNvkt5+7Le/VEdYt0AkRpkL33MnyQfwr8l5mXwMmfmTbyMPr5vJLC+8/Gd9gXnwU1QQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-linux-x64-musl": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.1.5.tgz", - "integrity": "sha512-Me+PfPI2TMeOQk0gYWfLQZtTktrmzbr8cDboqX83XKc7UrgAi55gF+2dUkWdxd19n55Essp2yeca+O9N5rBxHg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-openharmony-arm64": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.1.5.tgz", - "integrity": "sha512-yc5WrLzXks6zCQfn9Oxr8pORKyl/pF+QjHmW/Qx3qu0oyrrNC+y2JLTU1E2rcWYAmzlnqngWXHQjy51VzW70Vw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-wasm32-wasi": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.1.5.tgz", - "integrity": "sha512-VbQGPX2b4r48TAMIM2cjgluIM1HYutm4pcTEJsle7iEP7sB1dFqtPLBVbdLAZCxy1txCcPxf4QFf4v8uvltPqA==", - "cpu": [ - "wasm32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@emnapi/core": "1.11.1", - "@emnapi/runtime": "1.11.1", - "@napi-rs/wasm-runtime": "^1.1.6" - }, - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-win32-arm64-msvc": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.1.5.tgz", - "integrity": "sha512-gHv82k63z4qpV5+Q1y/12KrK0ltWBukVDI8nZcbT7Tt/ZlOIVwppazneq0F93oDxTo3IgAMEDIoQh3E2n6mVsw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-win32-x64-msvc": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.1.5.tgz", - "integrity": "sha512-tTZuDBPw85tEN5PQi1pnEBzDy0Z49HtScLAbD5t6hyeU92A95pRWaSMw1GZZi/RwgSgUIl0xrSlXIT/9QzvYSA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/pluginutils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", - "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@standard-schema/utils": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@standard-schema/utils/-/utils-0.3.0.tgz", - "integrity": "sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==", - "license": "MIT" - }, - "node_modules/@tailwindcss/node": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.3.2.tgz", - "integrity": "sha512-yWP/sqEcBLaD8JuA6zNwxoYKr75qxTioYwlRwekj5Jr/I5GXnoJfjetH/psLUIv74cYTH2lBUEzBkinthoYcBg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/remapping": "^2.3.5", - "enhanced-resolve": "5.21.6", - "jiti": "^2.7.0", - "lightningcss": "1.32.0", - "magic-string": "^0.30.21", - "source-map-js": "^1.2.1", - "tailwindcss": "4.3.2" - } - }, - "node_modules/@tailwindcss/oxide": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.3.2.tgz", - "integrity": "sha512-z8ZgnzX8gdNoWLBLqBPoh/sjnxkwvf9ZuWjnO0l0yIzbLa5/9S+eC5QxGZKRobVHIC3/1BoMWjHblqWjcgFgag==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 20" - }, - "optionalDependencies": { - "@tailwindcss/oxide-android-arm64": "4.3.2", - "@tailwindcss/oxide-darwin-arm64": "4.3.2", - "@tailwindcss/oxide-darwin-x64": "4.3.2", - "@tailwindcss/oxide-freebsd-x64": "4.3.2", - "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.2", - "@tailwindcss/oxide-linux-arm64-gnu": "4.3.2", - "@tailwindcss/oxide-linux-arm64-musl": "4.3.2", - "@tailwindcss/oxide-linux-x64-gnu": "4.3.2", - "@tailwindcss/oxide-linux-x64-musl": "4.3.2", - "@tailwindcss/oxide-wasm32-wasi": "4.3.2", - "@tailwindcss/oxide-win32-arm64-msvc": "4.3.2", - "@tailwindcss/oxide-win32-x64-msvc": "4.3.2" - } - }, - "node_modules/@tailwindcss/oxide-android-arm64": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.3.2.tgz", - "integrity": "sha512-WHxqIuHpvZ5VtdX6GTl1Ik/Vp2YuN42Et+0CdeaVd/frQ9jAvGmvR8vLT+jk3e8/Q3x8kECB9+R17pgpp2BulA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-darwin-arm64": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.3.2.tgz", - "integrity": "sha512-GZypeUY/IDJW3877KeM+O67vbXr3MBnbtEL4aYhNErv/JWZhye2vGSWWG9tB6iiqR2MqRNkY8IOUy4NdSZV26w==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-darwin-x64": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.3.2.tgz", - "integrity": "sha512-UIIzmefR6KO1sDU7MzRqAxC8iBpft/VhkGjTjnhoS6k7Z3rQ9wEgA1ODSiyH/tcSYssulNm4Ci3hOeK1jH7ccQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-freebsd-x64": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.3.2.tgz", - "integrity": "sha512-GN+uAmcI6DNspnCDwtOAZrTz6oukJnp337qZvxqCGLd3BHBzJpO0ZbTLRvJNdztOeAmTzewewGIMPb0tk2R4WA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.3.2.tgz", - "integrity": "sha512-4ABn7qSbdHRwTiDiuWNegCyb5+2FJ4vKIKc3DmKrvAFw7MU1Lm11dIkTPwUaFdTzc7IsOpDbqBrlh0x6y36U/w==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.3.2.tgz", - "integrity": "sha512-wDgEIGwoM8w8pufh9LVt1PahDgNdKXrLC2qfAnV3vAmococ9RWbxeAw4pxPttd/TsJfwjyLf90Dg1y9y8I6Emw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-linux-arm64-musl": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.3.2.tgz", - "integrity": "sha512-J5Nuk0uZQIiMTJj3LEx4sAA9tMFUoXQZFv1J6An+QGYe53HKRJuFDi0rpq/tuouCZeAbOBY3kQ6g8qeD4TUjtA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-linux-x64-gnu": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.3.2.tgz", - "integrity": "sha512-kqCZpSKOBEJO4mz7OqWoofBZeXTAwaVGPj0ErAj7CojmhKpWVWVOnrt9dE8odoIraZq4oj3ausM37kXi+Tow8w==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-linux-x64-musl": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.3.2.tgz", - "integrity": "sha512-cixpqbh2toJDmkuCRI68nXA8ZxNmdK9Y+9v5h3MC3ZQKy/0BO8AWzlkWyRM7JAFSGBlfig4YVTPsK6MVgqz1uw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-wasm32-wasi": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.3.2.tgz", - "integrity": "sha512-4ec2Z/LOmRsAgU23CS4xeJfcJlmRg94A/XrbGRCF1gyU/zdDfRLYDVsS+ynSZCmGNxQ1jQriQOKMQeQxBA3Isw==", - "bundleDependencies": [ - "@napi-rs/wasm-runtime", - "@emnapi/core", - "@emnapi/runtime", - "@tybys/wasm-util", - "@emnapi/wasi-threads", - "tslib" - ], - "cpu": [ - "wasm32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@emnapi/core": "^1.11.1", - "@emnapi/runtime": "^1.11.1", - "@emnapi/wasi-threads": "^1.2.2", - "@napi-rs/wasm-runtime": "^1.1.4", - "@tybys/wasm-util": "^0.10.2", - "tslib": "^2.8.1" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.2.tgz", - "integrity": "sha512-Zyr/M0+XcYZu3bZrUytc7TXvrk0ftWfl8gN2MwekNDzhqhKRUucMPSeOzM0o0wH5AWOU49BsKRrfKxI2atCPMQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-win32-x64-msvc": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.2.tgz", - "integrity": "sha512-QI9BO7KlNZsp2GuO0jwAAj5jCDABOKXRkCk2XuKTSaNEFSdfzqswYVTtCHBNKHLsqyjFyFkqlDiwkNbTYSssMQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/vite": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.3.2.tgz", - "integrity": "sha512-eHpMeX4JXfVNJDEcsouTeCBubJBTcTLigeaw/NTUW6PB5ATKKXdyonnXgTBX2VuRbjz1hjfz6C5XAhr52ImQXA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@tailwindcss/node": "4.3.2", - "@tailwindcss/oxide": "4.3.2", - "tailwindcss": "4.3.2" - }, - "peerDependencies": { - "vite": "^5.2.0 || ^6 || ^7 || ^8" - } - }, - "node_modules/@tanstack/query-core": { - "version": "5.101.2", - "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.101.2.tgz", - "integrity": "sha512-hH5MLoJhF7KaIGd7q3xTXGXvslI+GYlM1Z/35aSHHWaCJWB7XvTSHYuV3eM7tw+aE0mT/xMro4M4Q9rCGHT0lw==", - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/tannerlinsley" - } - }, - "node_modules/@tanstack/react-query": { - "version": "5.101.2", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.101.2.tgz", - "integrity": "sha512-seDkr6kzGzX1okaaTtZPtgA688CDPlXUz1C6xSg0ESqn04Vuc8tlrYms1s3de+znBqhPVxFRfpAfUf+6XvfPWg==", - "license": "MIT", - "dependencies": { - "@tanstack/query-core": "5.101.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/tannerlinsley" - }, - "peerDependencies": { - "react": "^18 || ^19" - } - }, - "node_modules/@tybys/wasm-util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.3.tgz", - "integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@types/d3-array": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.2.tgz", - "integrity": "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==", - "license": "MIT" - }, - "node_modules/@types/d3-color": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz", - "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==", - "license": "MIT" - }, - "node_modules/@types/d3-ease": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.2.tgz", - "integrity": "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==", - "license": "MIT" - }, - "node_modules/@types/d3-interpolate": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz", - "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==", - "license": "MIT", - "dependencies": { - "@types/d3-color": "*" - } - }, - "node_modules/@types/d3-path": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.1.1.tgz", - "integrity": "sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==", - "license": "MIT" - }, - "node_modules/@types/d3-scale": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.9.tgz", - "integrity": "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==", - "license": "MIT", - "dependencies": { - "@types/d3-time": "*" - } - }, - "node_modules/@types/d3-shape": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.1.8.tgz", - "integrity": "sha512-lae0iWfcDeR7qt7rA88BNiqdvPS5pFVPpo5OfjElwNaT2yyekbM0C9vK+yqBqEmHr6lDkRnYNoTBYlAgJa7a4w==", - "license": "MIT", - "dependencies": { - "@types/d3-path": "*" - } - }, - "node_modules/@types/d3-time": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.4.tgz", - "integrity": "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==", - "license": "MIT" - }, - "node_modules/@types/d3-timer": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.2.tgz", - "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==", - "license": "MIT" - }, - "node_modules/@types/esrecurse": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@types/esrecurse/-/esrecurse-4.3.1.tgz", - "integrity": "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/estree": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", - "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/node": { - "version": "26.1.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz", - "integrity": "sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~8.3.0" - } - }, - "node_modules/@types/react": { - "version": "19.2.17", - "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.17.tgz", - "integrity": "sha512-MXfmqaVPEVgkBT/aY0aGCkRWWtByiYQXo3xdQ8r5RzuFrPiRn8Gar2tQdXSUQ2GKV3bkXckek89V8wQBY2Q/Aw==", - "devOptional": true, - "license": "MIT", - "dependencies": { - "csstype": "^3.2.2" - } - }, - "node_modules/@types/react-dom": { - "version": "19.2.3", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz", - "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", - "devOptional": true, - "license": "MIT", - "peerDependencies": { - "@types/react": "^19.2.0" - } - }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.63.0.tgz", - "integrity": "sha512-rvwSgqT+DHpWdzfSzPatRLm02a0GlESt++9iy3hLCDY4BgkaLcl8LBi9Yh7XGFBpwcBE/K3024QuXWTpbz4FfQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/regexpp": "^4.12.2", - "@typescript-eslint/scope-manager": "8.63.0", - "@typescript-eslint/type-utils": "8.63.0", - "@typescript-eslint/utils": "8.63.0", - "@typescript-eslint/visitor-keys": "8.63.0", - "ignore": "^7.0.5", - "natural-compare": "^1.4.0", - "ts-api-utils": "^2.5.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^8.63.0", - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.6.tgz", - "integrity": "sha512-BAg6QkE8W+TuQLrrw0Ugr7HegXduRuuj8/ti2kSOc+jz1dmx8/WNcjr6XGnq5YpDWxFwwaavqD0+jIUOKelTsw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.63.0.tgz", - "integrity": "sha512-gwh4gvvlaVDKKxyfxMG+Gnu1u9X0OQBwyGLkbwB65dIzBKnxeRiJlNFqlI3zwVhNXJIs6qV7mlFCn/BIajlVig==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/scope-manager": "8.63.0", - "@typescript-eslint/types": "8.63.0", - "@typescript-eslint/typescript-estree": "8.63.0", - "@typescript-eslint/visitor-keys": "8.63.0", - "debug": "^4.4.3" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/project-service": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.63.0.tgz", - "integrity": "sha512-e5dh0/UI0ok53AlZ5wRkXCB32z/f2jUZqPR/ygAw5WYaSw8j9EoJWlS7wQjr/dmOaqWjnPIn2m+HhVPCMWGZVQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.63.0", - "@typescript-eslint/types": "^8.63.0", - "debug": "^4.4.3" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.63.0.tgz", - "integrity": "sha512-uUyfMWCnDSN8bCpcrY8nGP2BLkQ9Xn0GsipcONcpIDWhwhO4ZSyHvyS14U3X75mzxWxL3I2UZIrenTzdzcJO8A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.63.0", - "@typescript-eslint/visitor-keys": "8.63.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.63.0.tgz", - "integrity": "sha512-sUAbkulqBAsncKnbRP3+7CtQFRKicexnj7ZwNC6ddCR7EmrXvjvdCYMJbUIqMd6lwoEriZjwLo08aS5tSjVMHg==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/type-utils": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.63.0.tgz", - "integrity": "sha512-Nzzh/OGxVCOjObjaj1CQF2RUasyYy2Jfuh+zZ3PjLzG2fYRriAiZLib9UKtO+CpQAS3YHiAS+ckZDclwqI1TPA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.63.0", - "@typescript-eslint/typescript-estree": "8.63.0", - "@typescript-eslint/utils": "8.63.0", - "debug": "^4.4.3", - "ts-api-utils": "^2.5.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/types": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.63.0.tgz", - "integrity": "sha512-xyLtl9DUBBFrcJS4x2pIqGLH68/tC2uOa4Z7pUteW09D3bXnnXUom4dyPikzWgB7llmIc1zoeI3aoUdC4rPK/Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.63.0.tgz", - "integrity": "sha512-ygBkU+B7ex5UI/gKhaqexWev79uISfIv7XQCRNYO/jmD8rGLPyWLAb3KMRT6nd8Gt9bmUBi9+iX6tBdYfOY81Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/project-service": "8.63.0", - "@typescript-eslint/tsconfig-utils": "8.63.0", - "@typescript-eslint/types": "8.63.0", - "@typescript-eslint/visitor-keys": "8.63.0", - "debug": "^4.4.3", - "minimatch": "^10.2.2", - "semver": "^7.7.3", - "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.5.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.63.0.tgz", - "integrity": "sha512-fUKaeAvrTuQg/Tgt3nliAUSZHJM6DlCcfyEmxCvlX8kieWSStBX+5O5Fnidtc3i2JrH+9c/GL4RY2iasd/GPTA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.63.0", - "@typescript-eslint/types": "8.63.0", - "@typescript-eslint/typescript-estree": "8.63.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.63.0.tgz", - "integrity": "sha512-UexrHGnGTpbuQHct2ExOc2ZcFbGUS9FOesCxxqdBGcpI1BxYu/LZ6U8Aq6/72XtF/qRBk9nhuGHFJIXXMhPMdw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.63.0", - "eslint-visitor-keys": "^5.0.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@vitejs/plugin-react": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.0.3.tgz", - "integrity": "sha512-vmFvco5/QuC2f9Oj+wTk0+9XeDFkHxSamwZKYc7MxYwKICfvUvlMhqKI0VuICPltGqh1neqBKDvO4kes1ya8vg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rolldown/pluginutils": "^1.0.1" - }, - "engines": { - "node": "^20.19.0 || >=22.12.0" - }, - "peerDependencies": { - "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0", - "babel-plugin-react-compiler": "^1.0.0", - "vite": "^8.0.0" - }, - "peerDependenciesMeta": { - "@rolldown/plugin-babel": { - "optional": true - }, - "babel-plugin-react-compiler": { - "optional": true - } - } - }, - "node_modules/acorn": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz", - "integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==", - "dev": true, - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/ajv": { - "version": "6.15.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", - "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/aria-hidden": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/aria-hidden/-/aria-hidden-1.2.6.tgz", - "integrity": "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA==", - "license": "MIT", - "dependencies": { - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/balanced-match": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/baseline-browser-mapping": { - "version": "2.10.43", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.43.tgz", - "integrity": "sha512-AjYpR78kDWAY3Efj+cDTFH9t9SCoL7OoTp1BOb0mQV7S+6CiLwnWM3FyxhJtdPufDFKzmCSFoUncKjWgJEZTCQ==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "baseline-browser-mapping": "dist/cli.cjs" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/brace-expansion": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz", - "integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^4.0.2" - }, - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/browserslist": { - "version": "4.28.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.6.tgz", - "integrity": "sha512-FQBYNK15VMslhLHpA7+n+n1GOlF1kId2xcCg7/j95f24AOF6VDYMNH4mFxF7KuaTdv627faazpOAjFzMrfJOUw==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "baseline-browser-mapping": "^2.10.42", - "caniuse-lite": "^1.0.30001803", - "electron-to-chromium": "^1.5.389", - "node-releases": "^2.0.51", - "update-browserslist-db": "^1.2.3" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/caniuse-lite": { - "version": "1.0.30001805", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001805.tgz", - "integrity": "sha512-52noaS3DubycKSXaU30TwPGIp+POyQSUVa5jBEq3vkRkY0kjyb3LQgvhU6WGyCcyXqVLWO0Cw0Q6BSdD0kUfVA==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "CC-BY-4.0" - }, - "node_modules/class-variance-authority": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/class-variance-authority/-/class-variance-authority-0.7.1.tgz", - "integrity": "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==", - "license": "Apache-2.0", - "dependencies": { - "clsx": "^2.1.1" - }, - "funding": { - "url": "https://polar.sh/cva" - } - }, - "node_modules/clsx": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", - "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true, - "license": "MIT" - }, - "node_modules/cookie": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", - "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/csstype": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", - "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", - "license": "MIT" - }, - "node_modules/d3-array": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", - "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", - "license": "ISC", - "dependencies": { - "internmap": "1 - 2" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-color": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", - "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-ease": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", - "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", - "license": "BSD-3-Clause", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-format": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.2.tgz", - "integrity": "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-interpolate": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", - "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", - "license": "ISC", - "dependencies": { - "d3-color": "1 - 3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-path": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz", - "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-scale": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", - "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", - "license": "ISC", - "dependencies": { - "d3-array": "2.10.0 - 3", - "d3-format": "1 - 3", - "d3-interpolate": "1.2.0 - 3", - "d3-time": "2.1.1 - 3", - "d3-time-format": "2 - 4" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-shape": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", - "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==", - "license": "ISC", - "dependencies": { - "d3-path": "^3.1.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-time": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz", - "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==", - "license": "ISC", - "dependencies": { - "d3-array": "2 - 3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-time-format": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", - "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", - "license": "ISC", - "dependencies": { - "d3-time": "1 - 3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-timer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", - "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/date-fns": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-4.4.0.tgz", - "integrity": "sha512-+1UMbeh68lH1SegH83CGWwpb6OHHbpSgr3+s5Eww5M4CAgswBpoWS0AjTOfEJ33HiYKz1hdj/KTFprzXHmq/6w==", - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/kossnocorp" - } - }, - "node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/decimal.js-light": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/decimal.js-light/-/decimal.js-light-2.5.1.tgz", - "integrity": "sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==", - "license": "MIT" - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/detect-libc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", - "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=8" - } - }, - "node_modules/detect-node-es": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz", - "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==", - "license": "MIT" - }, - "node_modules/dom-helpers": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", - "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.8.7", - "csstype": "^3.0.2" - } - }, - "node_modules/electron-to-chromium": { - "version": "1.5.389", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.389.tgz", - "integrity": "sha512-cEto7aeOqBfU1D+c5py5pE+ooscKE75JifxLBdFUZsqAxRS6y7kebtxAZvICszSl05gPjYHDTjY+lXpyGvpJbg==", - "dev": true, - "license": "ISC" - }, - "node_modules/enhanced-resolve": { - "version": "5.21.6", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.21.6.tgz", - "integrity": "sha512-aNnGCvbJ/RIyWo1IuhNdVjnNF+EjH9wpzpNHt+ci/m9He9LJvUN8wrCcXjp9cWsGNAuvSpVFTx/vraAFQ8qGjQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.4", - "tapable": "^2.3.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint": { - "version": "10.7.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.7.0.tgz", - "integrity": "sha512-GVTD7s1vdIl6UYvAfriOPeY1Df8LIZjfofLvHwde+erDHGGuHyuM6xoxRxmHiebhYuD2p1vN4wWh0XzPARSGDQ==", - "dev": true, - "license": "MIT", - "workspaces": [ - "packages/*" - ], - "dependencies": { - "@eslint-community/eslint-utils": "^4.8.0", - "@eslint-community/regexpp": "^4.12.2", - "@eslint/config-array": "^0.23.5", - "@eslint/config-helpers": "^0.6.0", - "@eslint/core": "^1.2.1", - "@eslint/plugin-kit": "^0.7.2", - "@humanfs/node": "^0.16.6", - "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.4.2", - "@types/estree": "^1.0.6", - "ajv": "^6.14.0", - "cross-spawn": "^7.0.6", - "debug": "^4.3.2", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^9.1.2", - "eslint-visitor-keys": "^5.0.1", - "espree": "^11.2.0", - "esquery": "^1.7.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^8.0.0", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "minimatch": "^10.2.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" - }, - "funding": { - "url": "https://eslint.org/donate" - }, - "peerDependencies": { - "jiti": "*" - }, - "peerDependenciesMeta": { - "jiti": { - "optional": true - } - } - }, - "node_modules/eslint-plugin-react-hooks": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.1.1.tgz", - "integrity": "sha512-f2I7Gw6JbvCexzIInuSbZpfdQ44D7iqdWX01FKLvrPgqxoE7oMj8clOfto8U6vYiz4yd5oKu39rRSVOe1zRu0g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/core": "^7.24.4", - "@babel/parser": "^7.24.4", - "hermes-parser": "^0.25.1", - "zod": "^3.25.0 || ^4.0.0", - "zod-validation-error": "^3.5.0 || ^4.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 || ^10.0.0" - } - }, - "node_modules/eslint-plugin-react-refresh": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.5.3.tgz", - "integrity": "sha512-5EMmLCV98Pi4o/f/3DP/v/tNqLHMIc9I8LKClNDWhZ9JTho89/kQcitCXQBMG7sAfVRK0Ie3T2EDOzp1YXYiVA==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "eslint": "^9 || ^10" - } - }, - "node_modules/eslint-scope": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.2.tgz", - "integrity": "sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "@types/esrecurse": "^4.3.1", - "@types/estree": "^1.0.8", - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", - "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/espree": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz", - "integrity": "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "acorn": "^8.16.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^5.0.1" - }, - "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/esquery": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", - "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", - "license": "MIT" - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-equals": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.4.1.tgz", - "integrity": "sha512-DjlFSM5Pk9cGcL0q5QXl66eGzx0N6szNgaswwc5ZphlBohjTVJSnGgI+rJVOgOi65qUoQnDZN4nDqi33udtydQ==", - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true, - "license": "MIT" - }, - "node_modules/fdir": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", - "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/file-entry-cache": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", - "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "flat-cache": "^4.0.0" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "license": "MIT", - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat-cache": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", - "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", - "dev": true, - "license": "MIT", - "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.4" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/flatted": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", - "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", - "dev": true, - "license": "ISC" - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/get-nonce": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-nonce/-/get-nonce-1.0.1.tgz", - "integrity": "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/globals": { - "version": "17.7.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-17.7.0.tgz", - "integrity": "sha512-Czmyns5dUsq4seFBR/Kdydhmo8y9kC79hiSkPn0YcGtNnYWnrgt0vjrSjx9tspoDGWm2CMarffRuLjM4xUz8xg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/hermes-estree": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz", - "integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==", - "dev": true, - "license": "MIT" - }, - "node_modules/hermes-parser": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.25.1.tgz", - "integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==", - "dev": true, - "license": "MIT", - "dependencies": { - "hermes-estree": "0.25.1" - } - }, - "node_modules/html-parse-stringify": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz", - "integrity": "sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==", - "license": "MIT", - "dependencies": { - "void-elements": "3.1.0" - } - }, - "node_modules/i18next": { - "version": "26.3.6", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-26.3.6.tgz", - "integrity": "sha512-Bu5Z2nAXgfVyM8xvW3jk9EKRIuX37PudsrBViThNFx7CR7aaYTpP01cxNB/E4c4UUzTDiAZRstEhsRfPOL/8xA==", - "funding": [ - { - "type": "individual", - "url": "https://www.locize.com/i18next" - }, - { - "type": "individual", - "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" - }, - { - "type": "individual", - "url": "https://www.locize.com" - } - ], - "license": "MIT", - "peerDependencies": { - "typescript": "^5 || ^6 || ^7" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/ignore": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/internmap": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", - "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "license": "ISC" - }, - "node_modules/jiti": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", - "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", - "dev": true, - "license": "MIT", - "bin": { - "jiti": "lib/jiti-cli.mjs" - } - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "license": "MIT" - }, - "node_modules/jsesc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", - "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", - "dev": true, - "license": "MIT", - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "license": "MIT" - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "license": "MIT", - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "dev": true, - "license": "MIT", - "dependencies": { - "json-buffer": "3.0.1" - } - }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/lightningcss": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", - "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "detect-libc": "^2.0.3" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, - "optionalDependencies": { - "lightningcss-android-arm64": "1.32.0", - "lightningcss-darwin-arm64": "1.32.0", - "lightningcss-darwin-x64": "1.32.0", - "lightningcss-freebsd-x64": "1.32.0", - "lightningcss-linux-arm-gnueabihf": "1.32.0", - "lightningcss-linux-arm64-gnu": "1.32.0", - "lightningcss-linux-arm64-musl": "1.32.0", - "lightningcss-linux-x64-gnu": "1.32.0", - "lightningcss-linux-x64-musl": "1.32.0", - "lightningcss-win32-arm64-msvc": "1.32.0", - "lightningcss-win32-x64-msvc": "1.32.0" - } - }, - "node_modules/lightningcss-android-arm64": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", - "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-darwin-arm64": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", - "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-darwin-x64": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", - "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-freebsd-x64": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", - "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-arm-gnueabihf": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", - "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-arm64-gnu": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", - "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-arm64-musl": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", - "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-x64-gnu": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", - "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-x64-musl": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", - "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-win32-arm64-msvc": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", - "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-win32-x64-msvc": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", - "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", - "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", - "license": "MIT" - }, - "node_modules/loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "license": "MIT", - "dependencies": { - "js-tokens": "^3.0.0 || ^4.0.0" - }, - "bin": { - "loose-envify": "cli.js" - } - }, - "node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^3.0.2" - } - }, - "node_modules/lucide-react": { - "version": "1.24.0", - "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-1.24.0.tgz", - "integrity": "sha512-YT6mBD8lGKkg4nM39enlm94/sfJIiW0YKUT60fBy4YK8tai31ylg1VhGNWxkpSKHo9UagfnZqwIff3HTDQwXeA==", - "license": "ISC", - "peerDependencies": { - "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" - } - }, - "node_modules/magic-string": { - "version": "0.30.21", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", - "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.5" - } - }, - "node_modules/minimatch": { - "version": "10.2.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", - "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "brace-expansion": "^5.0.5" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, - "node_modules/nanoid": { - "version": "3.3.16", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.16.tgz", - "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "license": "MIT" - }, - "node_modules/next-themes": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.4.6.tgz", - "integrity": "sha512-pZvgD5L0IEvX5/9GWyHMf3m8BKiVQwsCMHfoFosXtXBMnaS0ZnIJ9ST4b4NqLVKDEm8QBxoNNGNaBv2JNF6XNA==", - "license": "MIT", - "peerDependencies": { - "react": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc" - } - }, - "node_modules/node-releases": { - "version": "2.0.51", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.51.tgz", - "integrity": "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/optionator": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", - "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", - "dev": true, - "license": "MIT", - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.5" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, - "license": "ISC" - }, - "node_modules/picomatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", - "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/postcss": { - "version": "8.5.19", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.19.tgz", - "integrity": "sha512-Mz8SaolMd8nB+G13WkORcxQKHZ/NE4xXevtkJHVuG+guo9/wYKlIMTKAqGdEmYOXR2ijPjTYNHssizdaVSUNdQ==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "nanoid": "^3.3.12", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "license": "MIT", - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, - "node_modules/prop-types/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "license": "MIT" - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/react": { - "version": "19.2.7", - "resolved": "https://registry.npmjs.org/react/-/react-19.2.7.tgz", - "integrity": "sha512-HNe9WslTbXmFK8o8cmwgAeJFSBvt1bPdHCVKtaaV+WlAN36mpT4hcRpwbf3fY56ar2oIXzsBpOAiIRHAdY0OlQ==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react-day-picker": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/react-day-picker/-/react-day-picker-10.0.1.tgz", - "integrity": "sha512-eNh6BlwcYInWaJtRv18mXQ06Ys/H6rdTZAnTaSdOYJuTpwP1JMCHNd1FDRadA+gbeinq+psdULN5Xnowy9mV8w==", - "license": "MIT", - "dependencies": { - "@date-fns/tz": "^1.4.1", - "date-fns": "^4.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "type": "individual", - "url": "https://github.com/sponsors/gpbl" - }, - "peerDependencies": { - "@types/react": ">=16.8.0", - "react": ">=16.8.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/react-dom": { - "version": "19.2.7", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.7.tgz", - "integrity": "sha512-t0BRVXvbiE/o20Hfw669rLbMCDWtYZLvmJigy2f0MxsXF+71pxhR3xOkspmsO8h3ZlNzyibAmtCa3l4lYKk6gQ==", - "license": "MIT", - "dependencies": { - "scheduler": "^0.27.0" - }, - "peerDependencies": { - "react": "^19.2.7" - } - }, - "node_modules/react-hook-form": { - "version": "7.81.0", - "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.81.0.tgz", - "integrity": "sha512-ocbmr2p5KBMoAfj4WCUvped33lVi1Kd5DuDUvQDnB6VEAacOjPI/jMbtDdbhco4y9ct4xUuCmMY0b/C9L0QHjw==", - "license": "MIT", - "engines": { - "node": ">=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/react-hook-form" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17 || ^18 || ^19" - } - }, - "node_modules/react-i18next": { - "version": "17.0.9", - "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-17.0.9.tgz", - "integrity": "sha512-buLzOSqHtXxjf+qgSrLWNTXVZ1jSwO6kUv3uJqSP1roGBPgNnbhFm7OmdVwWcgf2gIbUyP0J333uPyx+Btsi3w==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.29.2", - "html-parse-stringify": "^3.0.1", - "use-sync-external-store": "^1.6.0" - }, - "peerDependencies": { - "i18next": ">= 26.2.0", - "react": ">= 16.8.0", - "typescript": "^5 || ^6 || ^7" - }, - "peerDependenciesMeta": { - "react-dom": { - "optional": true - }, - "react-native": { - "optional": true - }, - "typescript": { - "optional": true - } - } - }, - "node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "license": "MIT" - }, - "node_modules/react-remove-scroll": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.7.2.tgz", - "integrity": "sha512-Iqb9NjCCTt6Hf+vOdNIZGdTiH1QSqr27H/Ek9sv/a97gfueI/5h1s3yRi1nngzMUaOOToin5dI1dXKdXiF+u0Q==", - "license": "MIT", - "dependencies": { - "react-remove-scroll-bar": "^2.3.7", - "react-style-singleton": "^2.2.3", - "tslib": "^2.1.0", - "use-callback-ref": "^1.3.3", - "use-sidecar": "^1.1.3" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/react-remove-scroll-bar": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.8.tgz", - "integrity": "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==", - "license": "MIT", - "dependencies": { - "react-style-singleton": "^2.2.2", - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/react-router": { - "version": "7.18.1", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.18.1.tgz", - "integrity": "sha512-GDLgg3i3uM0aeJO3Fm+TCS+sDQ7gu12T6x0qdTEzcwqEfleci7JwugVNIF3U//0FWKnJT7ptG+20B2jfDqnZAg==", - "license": "MIT", - "dependencies": { - "cookie": "^1.0.1", - "set-cookie-parser": "^2.6.0" - }, - "engines": { - "node": ">=20.0.0" - }, - "peerDependencies": { - "react": ">=18", - "react-dom": ">=18" - }, - "peerDependenciesMeta": { - "react-dom": { - "optional": true - } - } - }, - "node_modules/react-router-dom": { - "version": "7.18.1", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.18.1.tgz", - "integrity": "sha512-KaZh+X/6UtEp28x51AUYZDMg9NGoz2ja3dNHa+ta/tk40vCzKhQ/RypCWBMLbmDr6//E24Vv5uPsrqXFozdkAg==", - "license": "MIT", - "dependencies": { - "react-router": "7.18.1" - }, - "engines": { - "node": ">=20.0.0" - }, - "peerDependencies": { - "react": ">=18", - "react-dom": ">=18" - } - }, - "node_modules/react-smooth": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/react-smooth/-/react-smooth-4.0.4.tgz", - "integrity": "sha512-gnGKTpYwqL0Iii09gHobNolvX4Kiq4PKx6eWBCYYix+8cdw+cGo3do906l1NBPKkSWx1DghC1dlWG9L2uGd61Q==", - "license": "MIT", - "dependencies": { - "fast-equals": "^5.0.1", - "prop-types": "^15.8.1", - "react-transition-group": "^4.4.5" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - } - }, - "node_modules/react-style-singleton": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.3.tgz", - "integrity": "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ==", - "license": "MIT", - "dependencies": { - "get-nonce": "^1.0.0", - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/react-transition-group": { - "version": "4.4.5", - "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", - "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", - "license": "BSD-3-Clause", - "dependencies": { - "@babel/runtime": "^7.5.5", - "dom-helpers": "^5.0.1", - "loose-envify": "^1.4.0", - "prop-types": "^15.6.2" - }, - "peerDependencies": { - "react": ">=16.6.0", - "react-dom": ">=16.6.0" - } - }, - "node_modules/recharts": { - "version": "2.15.4", - "resolved": "https://registry.npmjs.org/recharts/-/recharts-2.15.4.tgz", - "integrity": "sha512-UT/q6fwS3c1dHbXv2uFgYJ9BMFHu3fwnd7AYZaEQhXuYQ4hgsxLvsUXzGdKeZrW5xopzDCvuA2N41WJ88I7zIw==", - "deprecated": "1.x and 2.x branches are no longer active. Bump to Recharts v3 to receive latest features and bugfixes. See https://github.com/recharts/recharts/wiki/3.0-migration-guide", - "license": "MIT", - "dependencies": { - "clsx": "^2.0.0", - "eventemitter3": "^4.0.1", - "lodash": "^4.17.21", - "react-is": "^18.3.1", - "react-smooth": "^4.0.4", - "recharts-scale": "^0.4.4", - "tiny-invariant": "^1.3.1", - "victory-vendor": "^36.6.8" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", - "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - } - }, - "node_modules/recharts-scale": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/recharts-scale/-/recharts-scale-0.4.5.tgz", - "integrity": "sha512-kivNFO+0OcUNu7jQquLXAxz1FIwZj8nrj+YkOKc5694NbjCvcT6aSZiIzNzd2Kul4o4rTto8QVR9lMNtxD4G1w==", - "license": "MIT", - "dependencies": { - "decimal.js-light": "^2.4.1" - } - }, - "node_modules/rolldown": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.1.5.tgz", - "integrity": "sha512-t9z29cJjXf/vxQ8dyhCSpt6H6aSwHTk8cT5I3iy6SMXuFpk5mB6PL6XfC8PCwrPTx93udwKUm9HRteAlTGBLiA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@oxc-project/types": "=0.139.0", - "@rolldown/pluginutils": "^1.0.0" - }, - "bin": { - "rolldown": "bin/cli.mjs" - }, - "engines": { - "node": "^20.19.0 || >=22.12.0" - }, - "optionalDependencies": { - "@rolldown/binding-android-arm64": "1.1.5", - "@rolldown/binding-darwin-arm64": "1.1.5", - "@rolldown/binding-darwin-x64": "1.1.5", - "@rolldown/binding-freebsd-x64": "1.1.5", - "@rolldown/binding-linux-arm-gnueabihf": "1.1.5", - "@rolldown/binding-linux-arm64-gnu": "1.1.5", - "@rolldown/binding-linux-arm64-musl": "1.1.5", - "@rolldown/binding-linux-ppc64-gnu": "1.1.5", - "@rolldown/binding-linux-s390x-gnu": "1.1.5", - "@rolldown/binding-linux-x64-gnu": "1.1.5", - "@rolldown/binding-linux-x64-musl": "1.1.5", - "@rolldown/binding-openharmony-arm64": "1.1.5", - "@rolldown/binding-wasm32-wasi": "1.1.5", - "@rolldown/binding-win32-arm64-msvc": "1.1.5", - "@rolldown/binding-win32-x64-msvc": "1.1.5" - } - }, - "node_modules/scheduler": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", - "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", - "license": "MIT" - }, - "node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/set-cookie-parser": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz", - "integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==", - "license": "MIT" - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/sonner": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/sonner/-/sonner-2.0.7.tgz", - "integrity": "sha512-W6ZN4p58k8aDKA4XPcx2hpIQXBRAgyiWVkYhT7CvK6D3iAu7xjvVyhQHg2/iaKJZ1XVJ4r7XuwGL+WGEK37i9w==", - "license": "MIT", - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc", - "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc" - } - }, - "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/tailwind-merge": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.6.0.tgz", - "integrity": "sha512-uxL7qAVQriqRQPAyK3pj66VqskWqoZ37PW94jwOTwNfq/z9oyu1V+eqrZqtR2+fCiXdYOZe/Modt8GtvqNzu+w==", - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/dcastil" - } - }, - "node_modules/tailwindcss": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.2.tgz", - "integrity": "sha512-WtctNNSH8A9jlMIqxzuYumOHU5uGZyRv0Q5svQl+oEPy5w84YpBxdb7MdqyiSPQge5jTJ6zFQLq0PFygdccSBA==", - "dev": true, - "license": "MIT" - }, - "node_modules/tapable": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", - "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/tiny-invariant": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", - "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", - "license": "MIT" - }, - "node_modules/tinyglobby": { - "version": "0.2.17", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", - "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", - "dev": true, - "license": "MIT", - "dependencies": { - "fdir": "^6.5.0", - "picomatch": "^4.0.4" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/SuperchupuDev" - } - }, - "node_modules/ts-api-utils": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", - "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18.12" - }, - "peerDependencies": { - "typescript": ">=4.8.4" - } - }, - "node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" - }, - "node_modules/tw-animate-css": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/tw-animate-css/-/tw-animate-css-1.4.0.tgz", - "integrity": "sha512-7bziOlRqH0hJx80h/3mbicLW7o8qLsH5+RaLR2t+OHM3D0JlWGODQKQ4cxbK7WlvmUxpcj6Kgu6EKqjrGFe3QQ==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/Wombosvideo" - } - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "license": "MIT", - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/typescript": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", - "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", - "devOptional": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/typescript-eslint": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.63.0.tgz", - "integrity": "sha512-xgwXyzG4sK9ALkBxbyGkTMMOS+imnW65iPhxCQMK83KhxyoDNW7l+IDqEf9vMdoUidHpOoS967RCq4eMiTexwQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/eslint-plugin": "8.63.0", - "@typescript-eslint/parser": "8.63.0", - "@typescript-eslint/typescript-estree": "8.63.0", - "@typescript-eslint/utils": "8.63.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/undici-types": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", - "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/update-browserslist-db": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", - "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/use-callback-ref": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.3.tgz", - "integrity": "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==", - "license": "MIT", - "dependencies": { - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/use-sidecar": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.3.tgz", - "integrity": "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ==", - "license": "MIT", - "dependencies": { - "detect-node-es": "^1.1.0", - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/use-sync-external-store": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz", - "integrity": "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==", - "license": "MIT", - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - } - }, - "node_modules/victory-vendor": { - "version": "36.9.2", - "resolved": "https://registry.npmjs.org/victory-vendor/-/victory-vendor-36.9.2.tgz", - "integrity": "sha512-PnpQQMuxlwYdocC8fIJqVXvkeViHYzotI+NJrCuav0ZYFoq912ZHBk3mCeuj+5/VpodOjPe1z0Fk2ihgzlXqjQ==", - "license": "MIT AND ISC", - "dependencies": { - "@types/d3-array": "^3.0.3", - "@types/d3-ease": "^3.0.0", - "@types/d3-interpolate": "^3.0.1", - "@types/d3-scale": "^4.0.2", - "@types/d3-shape": "^3.1.0", - "@types/d3-time": "^3.0.0", - "@types/d3-timer": "^3.0.0", - "d3-array": "^3.1.6", - "d3-ease": "^3.0.1", - "d3-interpolate": "^3.0.1", - "d3-scale": "^4.0.2", - "d3-shape": "^3.1.0", - "d3-time": "^3.0.0", - "d3-timer": "^3.0.1" - } - }, - "node_modules/vite": { - "version": "8.1.4", - "resolved": "https://registry.npmjs.org/vite/-/vite-8.1.4.tgz", - "integrity": "sha512-bTT9PsdWO+MQMNG9ZXIP/qM9wGh37DFxTV/sPq9cFpHr3w4jkgef032PkAL9jAqhk3Nz8NQw3O8n6/xFkqO4QQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "lightningcss": "^1.32.0", - "picomatch": "^4.0.5", - "postcss": "^8.5.16", - "rolldown": "~1.1.4", - "tinyglobby": "^0.2.17" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^20.19.0 || >=22.12.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^20.19.0 || >=22.12.0", - "@vitejs/devtools": "^0.3.0", - "esbuild": "^0.27.0 || ^0.28.0", - "jiti": ">=1.21.0", - "less": "^4.0.0", - "sass": "^1.70.0", - "sass-embedded": "^1.70.0", - "stylus": ">=0.54.8", - "sugarss": "^5.0.0", - "terser": "^5.16.0", - "tsx": "^4.8.1", - "yaml": "^2.4.2" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "@vitejs/devtools": { - "optional": true - }, - "esbuild": { - "optional": true - }, - "jiti": { - "optional": true - }, - "less": { - "optional": true - }, - "sass": { - "optional": true - }, - "sass-embedded": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { - "optional": true - } - } - }, - "node_modules/void-elements": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz", - "integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true, - "license": "ISC" - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/zod": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", - "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, - "node_modules/zod-validation-error": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-4.0.2.tgz", - "integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18.0.0" - }, - "peerDependencies": { - "zod": "^3.25.0 || ^4.0.0" - } - } - } -} diff --git a/frontend/src/features/media/gallery-page.tsx b/frontend/src/features/media/gallery-page.tsx index 9a402e57..99512c37 100644 --- a/frontend/src/features/media/gallery-page.tsx +++ b/frontend/src/features/media/gallery-page.tsx @@ -20,10 +20,11 @@ export function GalleryPage() { const [pageSize, setPageSize] = useState(20); const [search, setSearch] = useState(""); const debouncedSearch = useDebouncedValue(search); + const normalizedSearch = debouncedSearch.trim(); const imagesQuery = useQuery({ - queryKey: ["media", "images", page, pageSize], - queryFn: () => listImages({ page, pageSize }), + queryKey: ["media", "images", page, pageSize, normalizedSearch], + queryFn: () => listImages({ page, pageSize, search: normalizedSearch || undefined }), }); const statsQuery = useQuery({ queryKey: ["media", "images", "stats"], @@ -32,7 +33,6 @@ export function GalleryPage() { }); const result = imagesQuery.data; - const visibleImages = (result?.items ?? []).filter((image) => matchesImageSearch(image, debouncedSearch)); const refreshing = imagesQuery.isFetching || statsQuery.isFetching; function refreshAll(): void { @@ -70,17 +70,16 @@ export function GalleryPage() { aria-label={t("media.images.search")} /> - {result ? {t("media.images.pageSummary", { count: visibleImages.length, total: result.total })} : null} + {result ? {t("media.images.pageSummary", { count: result.items.length, total: result.total })} : null} {imagesQuery.isError ? void imagesQuery.refetch()} /> : null} {imagesQuery.isPending ? : null} - {!imagesQuery.isPending && result && result.items.length === 0 ? : null} - {!imagesQuery.isPending && result && result.items.length > 0 && visibleImages.length === 0 ? : null} + {!imagesQuery.isPending && result && result.items.length === 0 ? : null} - {!imagesQuery.isPending && visibleImages.length > 0 ? ( + {!imagesQuery.isPending && result && result.items.length > 0 ? (
- {visibleImages.map((image) => )} + {result.items.map((image) => )}
) : null} @@ -133,14 +132,6 @@ function MediaMetric({ icon: Icon, label, value, detail, loading }: { icon: Luci ); } -function matchesImageSearch(image: MediaAssetDTO, search: string): boolean { - const normalized = search.trim().toLocaleLowerCase(); - if (!normalized) return true; - return [image.id, image.kind, image.mimeType, image.sha256] - .filter(Boolean) - .some((value) => value.toLocaleLowerCase().includes(normalized)); -} - function formatBytes(value: number, locale: string): string { if (!Number.isFinite(value) || value <= 0) return "0 B"; const units = ["B", "KB", "MB", "GB", "TB"]; diff --git a/frontend/src/features/media/media-api.ts b/frontend/src/features/media/media-api.ts index 6d832571..e09f2423 100644 --- a/frontend/src/features/media/media-api.ts +++ b/frontend/src/features/media/media-api.ts @@ -7,7 +7,6 @@ import { isNumber, isString, isOneOf, - isOptional, } from "@/shared/api/decoder"; import type { SortOrder } from "@/shared/lib/table-sort"; @@ -48,7 +47,7 @@ const mediaJobShape = { accountName: isString, clientKeyName: isString, createdAt: isString, - completedAt: isOptional(isString), + completedAt: (value: unknown) => value === null || isString(value), errorMessage: isString, }; diff --git a/frontend/src/features/media/video-gallery-page.tsx b/frontend/src/features/media/video-gallery-page.tsx index 55f6e19c..7c565b7b 100644 --- a/frontend/src/features/media/video-gallery-page.tsx +++ b/frontend/src/features/media/video-gallery-page.tsx @@ -33,10 +33,11 @@ export function VideoGalleryPage() { const [statusFilter, setStatusFilter] = useState(""); const [sort, setSort] = useState({ field: "createdAt", order: "desc" }); const debouncedSearch = useDebouncedValue(search); + const normalizedSearch = debouncedSearch.trim(); const videosQuery = useQuery({ - queryKey: ["media", "videos", page, pageSize, statusFilter, debouncedSearch, sort.field, sort.order], - queryFn: () => listVideos({ page, pageSize, status: statusFilter, search: debouncedSearch, sortBy: sort.field, sortOrder: sort.order }), + queryKey: ["media", "videos", page, pageSize, statusFilter, normalizedSearch, sort.field, sort.order], + queryFn: () => listVideos({ page, pageSize, status: statusFilter, search: normalizedSearch || undefined, sortBy: sort.field, sortOrder: sort.order }), }); const statsQuery = useQuery({ queryKey: ["media", "videos", "stats"], From 845bff84df7ab0836b055a88f964efde4e8f3577 Mon Sep 17 00:00:00 2001 From: Chenyme <118253778+chenyme@users.noreply.github.com> Date: Tue, 14 Jul 2026 18:11:15 +0800 Subject: [PATCH 16/16] refactor: enhance media job auditing and error handling with egress tracking and improved job status management --- .../internal/application/gateway/service.go | 49 +++++++++++++------ .../application/gateway/service_test.go | 43 +++++++++++++++- backend/internal/application/gateway/video.go | 44 ++++++++++------- .../application/gateway/video_test.go | 31 +++++++++++- backend/internal/infra/egress/trace.go | 3 ++ .../relational/media_repository.go | 10 ++-- .../relational/web_state_repository_test.go | 18 ++++++- backend/internal/repository/media.go | 2 +- 8 files changed, 157 insertions(+), 43 deletions(-) diff --git a/backend/internal/application/gateway/service.go b/backend/internal/application/gateway/service.go index 36aa7b00..a77c0629 100644 --- a/backend/internal/application/gateway/service.go +++ b/backend/internal/application/gateway/service.go @@ -747,6 +747,32 @@ func (s *Service) executeImage(ctx context.Context, requestID string, key client if !ok { return nil, ErrNoAvailableAccount } + auditBase := audit.Record{ + EventID: eventID, RequestID: requestID, ClientKeyID: key.ID, ClientKeyName: key.Name, + ModelRouteID: route.ID, ModelPublicID: externalModel, ModelUpstreamModel: modeldomain.DisplayUpstreamModel(route.Provider, route.UpstreamModel), + Provider: string(route.Provider), Operation: operation, UsageSource: audit.UsageSourceNone, Streaming: streaming, + } + if operation == audit.OperationImageEdit { + auditBase.MediaInputImages = int64(max(0, inputImageCount)) + } + writeFailureAudit := func(statusCode int, errorCode string, credential *accountdomain.Credential) { + record := auditBase + record.StatusCode = statusCode + record.ErrorCode = errorCode + record.DurationMS = time.Since(startedAt).Milliseconds() + record.CreatedAt = time.Now().UTC() + if credential != nil { + accountID := credential.ID + record.AccountID = &accountID + record.AccountName = credential.Name + } + applyAuditEgress(&record, egressTrace, route.Provider) + persistCtx, cancel := context.WithTimeout(context.Background(), finalizationTimeout) + defer cancel() + if auditErr := s.audits.Create(persistCtx, record); auditErr != nil { + s.logger.Error("request_usage_write_failed", "event_id", record.EventID, "request_id", requestID, "error", auditErr) + } + } pricingModel := s.providers.PricingModel(route.Provider, route.UpstreamModel) var reservation audit.PricingResult var priced bool @@ -781,6 +807,7 @@ func (s *Service) executeImage(ctx context.Context, requestID string, key client for attempt := 0; attempt < attempts; attempt++ { lease, err = s.selector.Acquire(ctx, route.Provider, route.UpstreamModel, quotaMode, "", excluded, false) if err != nil { + writeFailureAudit(http.StatusServiceUnavailable, "upstream_unavailable", nil) return nil, fmt.Errorf("%w: %w", ErrNoAvailableAccount, err) } excluded[lease.Credential.ID] = true @@ -788,6 +815,7 @@ func (s *Service) executeImage(ctx context.Context, requestID string, key client if err != nil { s.logger.Error("image_credential_failed", "event_id", eventID, "request_id", requestID, "model", externalModel, "provider", route.Provider, "account_id", lease.Credential.ID, "error", err) lease.Release() + writeFailureAudit(http.StatusBadGateway, "upstream_unavailable", &lease.Credential) return nil, err } response, err = execute(ctx, adapter, credential, route.UpstreamModel) @@ -795,6 +823,7 @@ func (s *Service) executeImage(ctx context.Context, requestID string, key client s.logger.Error("image_upstream_failed", "event_id", eventID, "request_id", requestID, "model", externalModel, "provider", route.Provider, "account_id", credential.ID, "error", err) s.selector.MarkFailure(ctx, credential, 0, 0) lease.Release() + writeFailureAudit(http.StatusBadGateway, "upstream_unavailable", &credential) return nil, err } if s.providers.RetryForbiddenAsEgress(credential.Provider) && response.StatusCode == http.StatusForbidden && attempt == 0 && attempt+1 < attempts { @@ -830,23 +859,13 @@ func (s *Service) executeImage(ctx context.Context, requestID string, key client lease.Release() persistCtx, cancel := context.WithTimeout(context.Background(), finalizationTimeout) defer cancel() - record := audit.Record{ - EventID: eventID, RequestID: requestID, ClientKeyID: key.ID, ClientKeyName: key.Name, - ModelRouteID: route.ID, ModelPublicID: externalModel, ModelUpstreamModel: modeldomain.DisplayUpstreamModel(route.Provider, route.UpstreamModel), - Provider: string(route.Provider), Operation: operation, UsageSource: audit.UsageSourceNone, - AccountID: &accountID, AccountName: credential.Name, StatusCode: response.StatusCode, - Streaming: streaming, ErrorCode: errorCode, - DurationMS: time.Since(startedAt).Milliseconds(), CreatedAt: time.Now().UTC(), - } + record := auditBase + record.AccountID, record.AccountName, record.StatusCode = &accountID, credential.Name, response.StatusCode + record.ErrorCode = errorCode + record.DurationMS, record.CreatedAt = time.Since(startedAt).Milliseconds(), time.Now().UTC() applyAuditEgress(&record, egressTrace, route.Provider) - switch operation { - case audit.OperationImage: - record.MediaOutputImages = int64(max(0, requestedCount)) - case audit.OperationImageEdit: - record.MediaInputImages = int64(max(0, inputImageCount)) - record.MediaOutputImages = int64(max(0, requestedCount)) - } if response.StatusCode >= 200 && response.StatusCode < 300 && errorCode == "" { + record.MediaOutputImages = int64(max(0, requestedCount)) var pricing audit.PricingResult var priced bool switch operation { diff --git a/backend/internal/application/gateway/service_test.go b/backend/internal/application/gateway/service_test.go index 005ebbf6..c2f998bd 100644 --- a/backend/internal/application/gateway/service_test.go +++ b/backend/internal/application/gateway/service_test.go @@ -19,8 +19,10 @@ import ( "github.com/chenyme/grok2api/backend/internal/domain/account" "github.com/chenyme/grok2api/backend/internal/domain/audit" "github.com/chenyme/grok2api/backend/internal/domain/clientkey" + egressdomain "github.com/chenyme/grok2api/backend/internal/domain/egress" inferencedomain "github.com/chenyme/grok2api/backend/internal/domain/inference" modeldomain "github.com/chenyme/grok2api/backend/internal/domain/model" + infraegress "github.com/chenyme/grok2api/backend/internal/infra/egress" "github.com/chenyme/grok2api/backend/internal/infra/persistence/relational" "github.com/chenyme/grok2api/backend/internal/infra/provider" "github.com/chenyme/grok2api/backend/internal/infra/runtime/memory" @@ -651,6 +653,30 @@ func TestImageStreamPropagatesWithoutTouchingChatQuota(t *testing.T) { if adapter.EditResolution() != "2k" { t.Fatalf("image edit resolution = %q", adapter.EditResolution()) } + + billingBeforeFailure, err := keyRepo.Get(ctx, key.ID) + if err != nil { + t.Fatal(err) + } + adapter.FailWithEgress(infraegress.NewManager(relational.NewEgressRepository(database), testCipher(t))) + if _, err := service.GenerateImage(ctx, ImageGenerationInput{ + RequestID: "req-image-failed", ClientKey: key, PublicModel: "grok-imagine-image-quality", + Prompt: "test", Count: 1, Resolution: "1k", ResponseFormat: "url", + }); err == nil { + t.Fatal("expected image transport failure") + } + logs, total, err = auditRepo.List(ctx, 0, 10) + if err != nil || total != 5 || len(logs) != 5 { + t.Fatalf("failure audit logs=%#v total=%d err=%v", logs, total, err) + } + failureAudit := logs[0] + if failureAudit.RequestID != "req-image-failed" || failureAudit.StatusCode != http.StatusBadGateway || failureAudit.ErrorCode != "upstream_unavailable" || failureAudit.MediaOutputImages != 0 || failureAudit.EstimatedCostInUSDTicks != 0 || failureAudit.EgressMode != audit.EgressModeDirect || failureAudit.EgressScope != string(egressdomain.ScopeWeb) || failureAudit.EgressNodeName != "direct" { + t.Fatalf("failure audit = %#v", failureAudit) + } + updatedKey, err := keyRepo.Get(ctx, key.ID) + if err != nil || updatedKey.ReservedUsageUSDTicks != 0 || updatedKey.BilledUsageUSDTicks != billingBeforeFailure.BilledUsageUSDTicks { + t.Fatalf("failed image billing key = %#v, err = %v", updatedKey, err) + } } func TestSuccessfulWebChatRefreshesCurrentModeQuota(t *testing.T) { @@ -844,6 +870,7 @@ type webImageStreamAdapter struct { streaming bool editResolution string synced chan string + failureEgress *infraegress.Manager } type webChatQuotaAdapter struct { @@ -877,10 +904,19 @@ func (a *webImageStreamAdapter) QuotaMode(model string) string { func (a *webImageStreamAdapter) TierOrder(string) []account.WebTier { return []account.WebTier{account.WebTierSuper, account.WebTierHeavy} } -func (a *webImageStreamAdapter) GenerateImage(_ context.Context, request provider.ImageGenerationRequest) (*provider.Response, error) { +func (a *webImageStreamAdapter) GenerateImage(ctx context.Context, request provider.ImageGenerationRequest) (*provider.Response, error) { a.mu.Lock() a.streaming = request.Streaming + failureEgress := a.failureEgress a.mu.Unlock() + if failureEgress != nil { + lease, err := failureEgress.Acquire(ctx, egressdomain.ScopeWeb, "image-failure") + if err != nil { + return nil, err + } + lease.Release() + return nil, errors.New("simulated image transport failure") + } body := "event: image_generation.completed\ndata: {}\n\ndata: [DONE]\n\n" return &provider.Response{StatusCode: http.StatusOK, Status: "200 OK", Header: http.Header{"Content-Type": {"text/event-stream"}}, Body: io.NopCloser(strings.NewReader(body)), QuotaUnits: 1}, nil } @@ -909,6 +945,11 @@ func (a *webImageStreamAdapter) EditResolution() string { defer a.mu.Unlock() return a.editResolution } +func (a *webImageStreamAdapter) FailWithEgress(manager *infraegress.Manager) { + a.mu.Lock() + a.failureEgress = manager + a.mu.Unlock() +} func (a *webImageStreamAdapter) SyncQuota(context.Context, account.Credential) (provider.QuotaSnapshot, error) { return provider.QuotaSnapshot{}, errors.New("unexpected full quota sync") } diff --git a/backend/internal/application/gateway/video.go b/backend/internal/application/gateway/video.go index a3b8298b..bb83734d 100644 --- a/backend/internal/application/gateway/video.go +++ b/backend/internal/application/gateway/video.go @@ -201,16 +201,7 @@ func (s *Service) processVideoJob(ctx context.Context, id string) { route, err = s.models.GetByPublicID(ctx, job.Model) } if err != nil { - now := time.Now().UTC() - job.Status = media.StatusFailed - job.ErrorCode = "model_not_found" - job.ErrorMessage = "模型路由不存在" - job.LeaseUntil, job.UpdatedAt, job.CompletedAt = nil, now, &now - if err := s.mediaJobs.UpdateMediaJob(ctx, job); err != nil { - s.logger.Warn("video_job_terminal_write_failed", "job_id", job.ID, "error", err) - } else { - s.cancelBillingReservation("video_usage_" + job.ID) - } + s.failVideoJob(ctx, job, "model_not_found", errors.New("模型路由不存在")) return } s.runVideoJob(ctx, job, route) @@ -293,6 +284,7 @@ func (s *Service) runVideoJob(parent context.Context, job media.Job, route model _ = s.accounts.MarkReauthRequired(context.Background(), lease.Credential.ID, fmt.Sprintf("%s SSO credential rejected", lease.Credential.Provider)) } s.selector.MarkFailure(context.Background(), lease.Credential, 0, 0) + applyMediaJobEgress(&job, egressTrace, route.Provider) s.failVideoJob(parent, job, "generation_failed", err) return } @@ -305,7 +297,7 @@ func (s *Service) runVideoJob(parent context.Context, job media.Job, route model return } s.selector.MarkSuccess(context.Background(), lease.Credential) - if err := s.recordVideoUsage(context.Background(), job, time.Since(startedAt).Milliseconds()); err != nil { + if err := s.recordVideoAudit(context.Background(), job, time.Since(startedAt).Milliseconds()); err != nil { s.logger.Error("video_usage_record_failed", "job_id", job.ID, "event_id", "video_usage_"+job.ID, "error", err) } if quotaKind, _ := s.providers.QuotaKind(route.Provider); quotaKind == provider.QuotaRemoteWindow && lease.QuotaMode == "weekly" { @@ -314,7 +306,7 @@ func (s *Service) runVideoJob(parent context.Context, job media.Job, route model } func (s *Service) reconcileVideoUsage(ctx context.Context) error { - jobs, err := s.mediaJobs.ListUnrecordedCompletedMediaJobs(ctx, 200) + jobs, err := s.mediaJobs.ListUnrecordedTerminalMediaJobs(ctx, 200) if err != nil { return err } @@ -324,29 +316,42 @@ func (s *Service) reconcileVideoUsage(ctx context.Context) error { if job.CompletedAt != nil { durationMS = max(int64(0), job.CompletedAt.Sub(job.CreatedAt).Milliseconds()) } - if err := s.recordVideoUsage(ctx, job, durationMS); err != nil { + if err := s.recordVideoAudit(ctx, job, durationMS); err != nil { result = firstError(result, fmt.Errorf("任务 %s: %w", job.ID, err)) } } return result } -func (s *Service) recordVideoUsage(ctx context.Context, job media.Job, durationMS int64) error { +func (s *Service) recordVideoAudit(ctx context.Context, job media.Job, durationMS int64) error { accountID := job.AccountID createdAt := time.Now().UTC() if job.CompletedAt != nil && !job.CompletedAt.IsZero() { createdAt = job.CompletedAt.UTC() } + statusCode := http.StatusOK + if job.Status == media.StatusFailed { + statusCode = http.StatusBadGateway + switch job.ErrorCode { + case "account_unavailable", "provider_unavailable": + statusCode = http.StatusServiceUnavailable + case "model_not_found": + statusCode = http.StatusNotFound + } + } record := audit.Record{ EventID: "video_usage_" + job.ID, RequestID: job.RequestID, ClientKeyID: job.ClientKeyID, ClientKeyName: job.ClientKeyName, ModelRouteID: job.ModelRouteID, ModelPublicID: job.Model, ModelUpstreamModel: job.UpstreamModel, Provider: job.Provider, Operation: audit.OperationVideo, UsageSource: audit.UsageSourceNone, - AccountID: &accountID, AccountName: job.AccountName, StatusCode: http.StatusOK, + AccountID: &accountID, AccountName: job.AccountName, StatusCode: statusCode, ErrorCode: job.ErrorCode, EgressNodeID: job.EgressNodeID, EgressNodeName: job.EgressNodeName, EgressScope: job.EgressScope, EgressMode: audit.EgressMode(job.EgressMode), - MediaInputImages: int64(len(decodeVideoInput(job.InputJSON))), MediaOutputSeconds: int64(max(0, job.Seconds)), - DurationMS: durationMS, CreatedAt: createdAt, + MediaInputImages: int64(len(decodeVideoInput(job.InputJSON))), + DurationMS: durationMS, CreatedAt: createdAt, } - if pricing, ok := audit.EstimateOfficialVideoCost(job.Model, job.Quality, job.Seconds); ok { + if job.Status == media.StatusCompleted { + record.MediaOutputSeconds = int64(max(0, job.Seconds)) + } + if pricing, ok := audit.EstimateOfficialVideoCost(job.Model, job.Quality, job.Seconds); ok && job.Status == media.StatusCompleted { record.EstimatedCostInUSDTicks = pricing.CostInUSDTicks record.PricingModel = pricing.Model record.PricingVersion = audit.OfficialPricingAsOf @@ -387,6 +392,9 @@ func (s *Service) failVideoJob(ctx context.Context, job media.Job, code string, s.logger.Error("video_job_terminal_write_failed", "job_id", job.ID, "error", updateErr) return } + if auditErr := s.recordVideoAudit(context.Background(), job, max(int64(0), now.Sub(job.CreatedAt).Milliseconds())); auditErr != nil { + s.logger.Error("video_usage_record_failed", "job_id", job.ID, "event_id", "video_usage_"+job.ID, "error", auditErr) + } s.cancelBillingReservation("video_usage_" + job.ID) } diff --git a/backend/internal/application/gateway/video_test.go b/backend/internal/application/gateway/video_test.go index f3bad936..d2ff1291 100644 --- a/backend/internal/application/gateway/video_test.go +++ b/backend/internal/application/gateway/video_test.go @@ -39,6 +39,33 @@ func TestRecoverVideoJobsRetriesUsageWithoutRegeneratingVideo(t *testing.T) { } } +func TestRecoverVideoJobsRecordsFailedAuditWithEgress(t *testing.T) { + completedAt := time.Now().UTC() + nodeID := uint64(42) + repository := &videoUsageRepository{job: media.Job{ + ID: "video_failed_recovery", RequestID: "request-failed-recovery", + ClientKeyID: 1, ClientKeyName: "client", AccountID: 2, AccountName: "account", + Provider: "grok_web", Model: "grok-imagine-video", ModelRouteID: 3, UpstreamModel: "video", + Seconds: 8, Quality: "720p", Status: media.StatusFailed, ErrorCode: "generation_failed", ErrorMessage: "upstream disconnected", + EgressNodeID: &nodeID, EgressNodeName: "warp", EgressScope: "grok_web", EgressMode: "proxy", + InputJSON: `{}`, CreatedAt: completedAt.Add(-time.Minute), CompletedAt: &completedAt, + }} + recorder := &durableVideoAuditRecorder{} + service := &Service{mediaJobs: repository, audits: recorder} + if err := service.RecoverVideoJobs(context.Background()); err != nil { + t.Fatal(err) + } + if repository.job.UsageRecordedAt == nil || recorder.calls != 1 { + t.Fatalf("recordedAt = %v, audit calls = %d", repository.job.UsageRecordedAt, recorder.calls) + } + if recorder.last.StatusCode != 502 || recorder.last.ErrorCode != "generation_failed" || recorder.last.EgressNodeID == nil || *recorder.last.EgressNodeID != nodeID || recorder.last.EgressNodeName != "warp" || recorder.last.EgressMode != audit.EgressModeProxy { + t.Fatalf("audit = %#v", recorder.last) + } + if recorder.last.EstimatedCostInUSDTicks != 0 || recorder.last.MediaOutputSeconds != 0 { + t.Fatalf("failed job was billed: %#v", recorder.last) + } +} + func TestVideoQueueIsBoundedAndDeduplicated(t *testing.T) { service := &Service{} service.ConfigureMedia(&videoUsageRepository{}, 1) @@ -95,8 +122,8 @@ func (r *videoUsageRepository) ListRecoverableMediaJobs(context.Context, int) ([ return nil, nil } -func (r *videoUsageRepository) ListUnrecordedCompletedMediaJobs(context.Context, int) ([]media.Job, error) { - if r.job.UsageRecordedAt != nil { +func (r *videoUsageRepository) ListUnrecordedTerminalMediaJobs(context.Context, int) ([]media.Job, error) { + if r.job.UsageRecordedAt != nil || (r.job.Status != media.StatusCompleted && r.job.Status != media.StatusFailed) { return nil, nil } return []media.Job{r.job}, nil diff --git a/backend/internal/infra/egress/trace.go b/backend/internal/infra/egress/trace.go index 53b7065a..79267b8d 100644 --- a/backend/internal/infra/egress/trace.go +++ b/backend/internal/infra/egress/trace.go @@ -25,6 +25,7 @@ type Trace struct { type traceContextKey struct{} +// WithTrace 为一次网关请求创建或复用并发安全的出口选择轨迹。 func WithTrace(ctx context.Context) (context.Context, *Trace) { if existing := TraceFromContext(ctx); existing != nil { return ctx, existing @@ -33,6 +34,7 @@ func WithTrace(ctx context.Context) (context.Context, *Trace) { return context.WithValue(ctx, traceContextKey{}, trace), trace } +// TraceFromContext 返回上下文中的出口轨迹;未配置时返回 nil。 func TraceFromContext(ctx context.Context) *Trace { if ctx == nil { return nil @@ -41,6 +43,7 @@ func TraceFromContext(ctx context.Context) *Trace { return trace } +// Selection 返回指定作用域最后一次实际出口选择的安全快照。 func (t *Trace) Selection(scope domain.Scope) (Selection, bool) { if t == nil { return Selection{}, false diff --git a/backend/internal/infra/persistence/relational/media_repository.go b/backend/internal/infra/persistence/relational/media_repository.go index b405c143..326a5150 100644 --- a/backend/internal/infra/persistence/relational/media_repository.go +++ b/backend/internal/infra/persistence/relational/media_repository.go @@ -187,12 +187,13 @@ func (r *MediaJobRepository) SummarizeMediaJobs(ctx context.Context) (repository return stats, err } -func (r *MediaJobRepository) ListUnrecordedCompletedMediaJobs(ctx context.Context, limit int) ([]media.Job, error) { +// ListUnrecordedTerminalMediaJobs 返回尚未完成审计写入的成功或失败任务。 +func (r *MediaJobRepository) ListUnrecordedTerminalMediaJobs(ctx context.Context, limit int) ([]media.Job, error) { if limit <= 0 || limit > 1000 { limit = 200 } var rows []mediaJobModel - if err := r.db.db.WithContext(ctx).Where("status = ? AND usage_recorded_at IS NULL", media.StatusCompleted).Order("completed_at ASC, id ASC").Limit(limit).Find(&rows).Error; err != nil { + if err := r.db.db.WithContext(ctx).Where("status IN ? AND usage_recorded_at IS NULL", []media.Status{media.StatusCompleted, media.StatusFailed}).Order("completed_at ASC, id ASC").Limit(limit).Find(&rows).Error; err != nil { return nil, err } values := make([]media.Job, 0, len(rows)) @@ -203,13 +204,14 @@ func (r *MediaJobRepository) ListUnrecordedCompletedMediaJobs(ctx context.Contex } func (r *MediaJobRepository) MarkMediaJobUsageRecorded(ctx context.Context, id string, recordedAt time.Time) error { - result := r.db.db.WithContext(ctx).Model(&mediaJobModel{}).Where("id = ? AND status = ? AND usage_recorded_at IS NULL", id, media.StatusCompleted).Update("usage_recorded_at", recordedAt) + terminalStatuses := []media.Status{media.StatusCompleted, media.StatusFailed} + result := r.db.db.WithContext(ctx).Model(&mediaJobModel{}).Where("id = ? AND status IN ? AND usage_recorded_at IS NULL", id, terminalStatuses).Update("usage_recorded_at", recordedAt) if result.Error != nil { return result.Error } if result.RowsAffected == 0 { var count int64 - if err := r.db.db.WithContext(ctx).Model(&mediaJobModel{}).Where("id = ? AND status = ? AND usage_recorded_at IS NOT NULL", id, media.StatusCompleted).Count(&count).Error; err != nil { + if err := r.db.db.WithContext(ctx).Model(&mediaJobModel{}).Where("id = ? AND status IN ? AND usage_recorded_at IS NOT NULL", id, terminalStatuses).Count(&count).Error; err != nil { return err } if count == 0 { diff --git a/backend/internal/infra/persistence/relational/web_state_repository_test.go b/backend/internal/infra/persistence/relational/web_state_repository_test.go index a3e0b62a..f0a1fc7e 100644 --- a/backend/internal/infra/persistence/relational/web_state_repository_test.go +++ b/backend/internal/infra/persistence/relational/web_state_repository_test.go @@ -68,15 +68,29 @@ func TestWebResponseStateAndMediaJobRoundTrip(t *testing.T) { if err := jobs.UpdateMediaJob(ctx, claimed); err != nil { t.Fatal(err) } - unrecorded, err := jobs.ListUnrecordedCompletedMediaJobs(ctx, 10) + unrecorded, err := jobs.ListUnrecordedTerminalMediaJobs(ctx, 10) if err != nil || len(unrecorded) != 1 || unrecorded[0].RequestID != job.RequestID || unrecorded[0].ModelRouteID != job.ModelRouteID { t.Fatalf("unrecorded jobs = %#v, err = %v", unrecorded, err) } if err := jobs.MarkMediaJobUsageRecorded(ctx, job.ID, completedAt.Add(time.Second)); err != nil { t.Fatal(err) } - unrecorded, err = jobs.ListUnrecordedCompletedMediaJobs(ctx, 10) + unrecorded, err = jobs.ListUnrecordedTerminalMediaJobs(ctx, 10) if err != nil || len(unrecorded) != 0 { t.Fatalf("recorded jobs = %#v, err = %v", unrecorded, err) } + failedAt := completedAt.Add(2 * time.Second) + failed := job + failed.ID, failed.RequestID, failed.Status, failed.ErrorCode = "video_failed", "request-video-failed", mediadomain.StatusFailed, "generation_failed" + failed.Progress, failed.ClaimToken, failed.CompletedAt, failed.UpdatedAt = 50, "", &failedAt, failedAt + if err := jobs.CreateMediaJob(ctx, failed); err != nil { + t.Fatal(err) + } + unrecorded, err = jobs.ListUnrecordedTerminalMediaJobs(ctx, 10) + if err != nil || len(unrecorded) != 1 || unrecorded[0].ID != failed.ID { + t.Fatalf("failed unrecorded jobs = %#v, err = %v", unrecorded, err) + } + if err := jobs.MarkMediaJobUsageRecorded(ctx, failed.ID, failedAt.Add(time.Second)); err != nil { + t.Fatal(err) + } } diff --git a/backend/internal/repository/media.go b/backend/internal/repository/media.go index b1fbd920..525ec405 100644 --- a/backend/internal/repository/media.go +++ b/backend/internal/repository/media.go @@ -46,7 +46,7 @@ type MediaJobRepository interface { ListMediaJobs(ctx context.Context, query MediaJobListQuery) ([]media.Job, int64, error) SummarizeMediaJobs(ctx context.Context) (MediaJobStats, error) ListRecoverableMediaJobs(ctx context.Context, limit int) ([]media.Job, error) - ListUnrecordedCompletedMediaJobs(ctx context.Context, limit int) ([]media.Job, error) + ListUnrecordedTerminalMediaJobs(ctx context.Context, limit int) ([]media.Job, error) TryClaimMediaJob(ctx context.Context, id string, now, leaseUntil time.Time, claimToken string) (media.Job, bool, error) MarkMediaJobUsageRecorded(ctx context.Context, id string, recordedAt time.Time) error }